MKE-F input file
The file is a sequence of named text sections. This chapter fully replaces the former root-level guide and matches the current parser FEMesh.
1. Applicability
The program solves linear small-displacement problems in the global plane X–Y:
- plane trusses made of type 112 members;
- plane Euler–Bernoulli frames made of type 113 elements;
- static, modal and undamped transient analyses.
Types 112 and 113 cannot be mixed in one file because their nodes have different DOF counts. Static uniform and linear loads on type 113 frames are supported. Other element loads, nonzero prescribed displacements, plasticity, geometric nonlinearity, damping and frame shear deformation are not implemented.
2. Units
The solver does not convert units. All quantities must form one consistent system; SI is recommended.
| Quantity | Field | Recommended unit |
|---|---|---|
| Coordinates and translational displacements | X, Y, Z, ux, uy | m |
| Area | A | m² |
| Young’s modulus and stress | E, axialStress | Pa |
| Density | rho | kg/m³ |
| Second moment of area | I | m⁴ |
| Forces | Fx, Fy | N |
| Moment | Mz | N·m |
| Time and frequency | time, frequencyHz | s, Hz |
Coordinate Z is read for format compatibility, but analysis remains two-dimensional. Components uz and Fz do not exist; the third frame-node DOF is rotation thetaZ, with work-conjugate load moment Mz.
3. General syntax rules
The parser reads to EOF. Blank lines and lines whose first non-whitespace character is # are skipped. A normal section marker is followed by an integer record count and exactly that many nonempty data lines. The optional section analysis is an exception and contains a single configuration record.
section_marker
record_count
comma,separated,record
...
Recommended order: analysis, nodes, then elems_112 or elems_113, then bcfix and load sections. Nodes must precede elements; elements must precede supports and loads.
| Section | Repeatable | Rule |
|---|---|---|
analysis | No | Optional configuration for RunSelected. |
nodes | No | Exactly one nonempty section. |
elems_112 or elems_113 | Yes | Records are appended; the type must be identical across all sections. |
bcfix | Yes | Records are appended; zero records are allowed. |
Any bcforce_* | Yes | Records from all sections are appended and summed when constructing the load. |
Fields within a record are comma-separated; surrounding spaces are allowed. Field counts are checked strictly. Numbers must be finite, and IDs and counts must be integers where required.
3.1. Analysis configuration
analysis
static
analysis
modal
analysis
transient,timeStep,duration,monitorNode,monitorDOF
This section is optional for backward compatibility and may appear only once. For transient analysis, the step must be positive, duration must span at least one step, and the monitoring node and local DOF must be within model bounds. RunSelected runs the specified analysis; without the section, use the original explicit methods.
Static analysis allows type 10 nodal loads and type 20 uniform and type 21 linear element loads; modal analysis allows no loads; transient analysis allows types 10–13. Type 10 retains its historical single-step pulse meaning in transient analysis.
4. Nodes
nodes
<node count>
X,Y,Z
...
Numbers are assigned by row order: the first record is node 1, the second is node 2. Each row contains exactly three finite numbers. Node numbers are not supplied separately.
5. Elements
| Type | Section and record | Nodal DOFs | Model |
|---|---|---|---|
| 112 | elems_112112,node1,node2,A,E,rho | [ux,uy] | Plane truss member, axial force only. |
| 113 | elems_113113,node1,node2,A,E,rho,I | [ux,uy,thetaZ] | Plane Euler–Bernoulli frame, consistent mass. |
node1 and node2 are distinct integer IDs of existing nodes. A, E, rho, and for type 113 also I must be positive finite numbers. Coincident end coordinates are also rejected as zero length.
The first element type determines the DOF count per node. Encountering a different type stops parsing with error MKEF:UnsupportedMixedMesh; truss and frame nodes are not automatically reconciled.
6. Supports
bcfix
<record count>
type,node,0,0,0
type | Free | Constrained |
|---|---|---|
| 1 | — | All nodal DOFs |
| 2 | Only ux | uy and thetaZ for a frame |
| 3 | Only uy | ux and thetaZ for a frame |
| 4 | thetaZ for a frame | ux, uy |
For a truss node, type 4 equals full restraint because there is no rotational DOF. The last three fields are reserved and must be zero: nonzero prescribed displacements are unsupported. If two records constrain the same global DOF, partitionDOFs reports MKEF:DuplicateConstraint.
7. Nodal loads
A truss uses [Fx,Fy], while a frame uses [Fx,Fy,Mz]. The field Mz is still present in a truss record and must be zero.
| Section / type | Record | RunStatic | RunTransient |
|---|---|---|---|
bcforce_stat / 10 | 10,node,Fx,Fy,Mz | Constant static load. | Backward-compatible rectangular pulse only at t=dt; discrete impulse F0·dt. |
bcforce_harm / 11 | 11,node,Fx,Fy,Mz,frequencyHz | Not supported. | F(t)=F0·sin(2πft); f must be strictly positive. |
bcforce_pulse / 12 | 12,node,Fx,Fy,Mz | Not supported. | Explicit single-step pulse at t=dt. |
bcforce_step / 13 | 13,node,Fx,Fy,Mz | Not supported. | Constant step in every column, including t=0. |
Repeated sections, loads at one node and loads mapped to one global DOF are summed. A model may contain different time-dependent types, but the selected solver must support them: RunStatic accepts only type 10 and otherwise reports MKEF:TimeDependentLoadInStaticAnalysis.
8. Complete frame example
# A 0.5 m cantilever with a +100 N force along Y
nodes
2
0,0,0
0.5,0,0
elems_113
1
113,1,2,0.0001,2e11,7800,0.33e-8
bcfix
1
1,1,0,0,0
bcforce_stat
1
10,2,0,100,0
The equivalent file is supplied as examples/cases/Case1ElementBeam.txt. Run:
problem = StructFEProblem(fullfile( ...
"examples", "cases", "Case1ElementBeam.txt"));
result = problem.RunStatic();
result.displacements
result.reactions
result.elementResults(1).localEndForces
Graphics and diagnostic printing are off by default. Enable them explicitly if needed:
options = struct("verbose", true, "plotting", true);
problem = StructFEProblem(fullfile( ...
"examples", "cases", "Case1ElementBeam.txt"), options);
9. Annotated transient example
The most informative compact example file is CasePreprocessorTransient.txt. It illustrates analysis configuration, nodes, frame elements, two support types and a harmonic load. The comments below belong to the file and are safe for the parser:
# The input file specifies the analysis used by RunSelected().
analysis
# transient,timeStep,duration,monitorNode,monitorDOF
# Step 0.0001 s, duration 0.001 s; monitor uy (local DOF 2) at node 3.
transient,0.0001,0.001,3,2
# Nodes are numbered by row order. Each record: X,Y,Z.
nodes
3
# Node 1: left end of the beam.
0,0,0
# Node 2: middle of the beam.
1,0,0
# Node 3: right end of the beam.
2,0,0
# Two type 113 Euler–Bernoulli frame elements.
# Format: 113,node1,node2,A,E,rho,I.
elems_113
2
# Element 1 connects nodes 1 and 2.
113,1,2,0.0004,2e11,7800,5.33e-8
# Element 2 connects nodes 2 and 3; properties match element 1.
113,2,3,0.0004,2e11,7800,5.33e-8
# Boundary conditions. Format: type,node,0,0,0.
bcfix
2
# Type 1: ux, uy and thetaZ are constrained at node 1.
1,1,0,0,0
# Type 4: ux and uy are constrained at node 2; thetaZ remains free.
4,2,0,0,0
# Type 11 harmonic nodal load.
# Format: 11,node,Fx,Fy,Mz,frequencyHz.
bcforce_harm
1
# Node 3 has Fy(t) = -1000*sin(2*pi*135*t) N.
11,3,0,-1000,0,135
| Fragment | How the program interprets it |
|---|---|
transient,0.0001,0.001,3,2 | Newmark integration takes 10 steps of 0.0001 s and produces 11 states including t=0. The chart and spectrum use uy of node 3. |
Three rows after nodes | Create nodes 1–3 on the X axis. There are no separate IDs: the number is the row position. |
113,1,2,… and 113,2,3,… | Create two frame elements with area 0.0004 m², Young’s modulus 2·10¹¹ Pa, density 7800 kg/m³ and second moment of area 5.33·10⁻⁸ m⁴. |
1,1,0,0,0 | Fully fix node 1: constrain ux, uy and thetaZ. |
4,2,0,0,0 | At node 2, constrain both translational DOFs but leave rotation free: thetaZ. |
11,3,0,-1000,0,135 | Apply a harmonic force at node 3 in the negative direction of Y with amplitude 1000 N and frequency 135 Hz. |
The parser skips blank lines and lines whose first non-whitespace character is #. Thus, after nodes the number 3 means three coordinate rows even if explanatory comments appear between them. Comments must occupy separate lines: trailing comments after numeric records are unsupported.
Run the file without supplying analysis parameters from code:
addpath(pwd);
setup;
problem = StructFEProblem(fullfile( ...
"examples", "cases", "CasePreprocessorTransient.txt"));
result = problem.RunSelected();
result.time
result.displacements
result.spectrumFrequencyHz
result.displacementAmplitudeSpectrum
10. Modal and transient analyses
problem = StructFEProblem(fullfile( ...
"examples", "cases", "CaseBeam.txt"));
modalResult = problem.RunModal();
modalResult.frequenciesHz
problem = StructFEProblem(fullfile( ...
"examples", "cases", "CaseBeamDyn.txt"));
dynamicResult = problem.RunTransient(1e-4, 1e-2, 3, 2);
The last two arguments are node 3 and local DOF 2 (uy) for the optional chart. Their integer values and ranges are validated even with plotting=false. When graphics are enabled, displacement and the selected DOF’s single-sided amplitude spectrum are plotted.
All histories use the grid t = 0, dt, …, N·dt, where N=fix(duration/dt). The first column corresponds to t=0, the last to the actual N·dt; the column count is N+1.
initial = struct( ...
"initialDisplacement", u0, ...
"initialVelocity", v0);
dynamicResult = problem.RunTransient(1e-4, 1e-2, 3, 2, initial);
Vectors u0 and v0 have full model size and zeros on constrained DOFs. Initial acceleration is computed from equilibrium. Integration uses Newmark average acceleration with β=1/4 and γ=1/2.
If the file contains section analysis, run the same analysis as result = problem.RunSelected(). A configured transient run uses zero initial displacements and velocities.
From the repository root, run docker compose up --build (or docker-compose up --build), open http://127.0.0.1:8080/preprocessor/ and load the TXT file with Open TXT. For an old file without section analysis first select the analysis type and, if needed, transient parameters. The button Run analysis serializes the validated model, calls RunSelected() in the Octave container and opens the result without manual file transfer.
11. Results and checks
| Analysis | Key result fields |
|---|---|
RunStatic | displacements, reactions, equilibriumResidual, elementResults, full load and DOF lists. |
RunModal | frequenciesHz, full modeShapes with zeros at supports, and reduced matrices. |
RunTransient | time, loadHistory, displacements, velocities, accelerations, reactions, spectrum. |
In truss results, positive axialStrain, axialStress and axialForce mean tension. For a frame, localEndForces is ordered as [N1,V1,M1,N2,V2,M2].
octave --no-gui --quiet --eval "addpath(pwd); setup; run_octave_tests;"
12. Input diagnostics
A read error has the form identifier: filename:line: detail. Main identifiers:
| Identifier | Cause |
|---|---|
MKEF:InputFileOpenFailed | File missing, inaccessible or cannot be opened. |
MKEF:UnknownInputMarker | Unknown section name or typo. |
MKEF:InputSectionOrder | An element precedes nodes, or a support/load precedes elements. |
MKEF:DuplicateInputSection | Repeated section nodes or analysis. |
MKEF:MalformedInput | Invalid field count, nonnumeric/infinite value, record type, node, frequency or properties. |
MKEF:UnexpectedEndOfFile | Declared record count exceeds the actual count. |
MKEF:IncompleteInput | No nodes or elements. |
MKEF:UnsupportedMixedMesh | Types 112 and 113 occur in one file. |
MKEF:UnsupportedConstraintValue | The final three fields of bcfix contain a nonzero prescribed displacement. |
MKEF:UnsupportedLoadComponent | A truss node specifies nonzero Mz. |
MKEF:AnalysisLoadMismatch | Load type is incompatible with the configured analysis. |
MKEF:MissingAnalysisConfiguration | RunSelected was called for an old file without section analysis. |
First open the reported line, then check its marker, record count and exact field count. If parsing succeeds but the solver reports singularity, check connectivity and adequate supports rather than syntax.
13. Code, tests and sources
FEMesh.m— the single current parsing contract;preprocessor/index.html— offline editor with a coordinate grid, exact node entry and canonical export in this format;tests/test_input_validation.m— repeated sections, invalid records, mixed meshes, unknown markers, opening and chart selection;CaseRepeatedSections.txt— executable example of repeated sections;- Henri P. Gavin, Numerical Integration in Structural Dynamics — external Newmark formulation material;
- Mario Paz, William Leigh, Structural Dynamics: Theory and Computation, 5th ed., 2004, DOI 10.1007/978-1-4615-0481-8 — source of geometry, matrices, frequencies and modes of
CaseFig11.7p363 MarioPaz.txt, checked intests/test_mario_paz_modal.m.
Uniform element loads
For static analysis of type 113 frames, add section eload_uniform after the elements. After the record count, each line has the form 20,elementId,coordinateSystem,qx,qy. Coordinate system 1 is local, 2 is global XY; intensity is per unit of actual element length. Local x points from the first node to the second; local y is rotated +90° from x.
eload_uniform
1
20,1,2,0,-1000
Sections may repeat; loads on the same element are summed. All values must be finite; two zero components, a missing element, a type 112 element, and modal/transient analysis are rejected. A nodal force or moment may also be specified using the normal section bcforce_stat.
Example: a 2 m cantilever under qY = −1000 N/m. Reactions: Fy = 2000 N, Mz = 2000 N·m; free-end deflection −0.001 m, rotation −0.000666667 rad.
Editing and deletion in the preprocessor
Select a frame element and click Add element load. The Element loads table contains the coordinate system and components. Switching Local/Global converts components while preserving load direction.
Any actual change to element ends, A, E, rho or I removes its distributed loads. Changing node coordinates removes distributed loads from all incident elements, preserving nodal loads and supports. Re-entering the same value removes nothing.
Deleting a node also deletes its elements, their distributed loads and the node’s own conditions. Other nodes remain and references are renumbered. Deleting an element does not delete its nodes. One Undo restores the whole operation. A deleted transient monitoring node must be selected again.
Linear distribution
Add a repeatable eload_linear section after the elements: a record count followed by 21,elementId,coordinateSystem,qx1,qy1,qx2,qy2. For example:
eload_linear
1
21,1,2,0,-300,0,-900
On element 1, global qY varies from −300 at its first node to −900 at its second node. Zero components at one end give a triangle. Components must be finite; only an entirely zero record is rejected. The same restrictions apply: static analysis, frame 113, entire element length. Split the member into elements for partial loading. Both sections may repeat and coexist; loads add together.
Choose Uniform or Linear in the Element loads table. Linear mode shows four fields with endpoint node numbers. Converting to Linear copies the uniform values to both ends; converting back takes their mean. Changing coordinate systems transforms both vectors. Results with type 21 use JSON v5; older models retain versions v1–v4.
Examples: trapezoid, triangle, with releases, with MPCs.
SPC: ux, uy, thetaZ
Supports use fixUx/fixUy/fixThetaZ masks. Types 1–4 retain their meaning; new types are 5: ux only, 6: uy only, 7: thetaZ only. Trusses reject type 7 and export canonical types 1, 3 and 2. Changing element family preserves masks; remove thetaZ restraints before switching to a truss. Duplicate restraints identify the node and DOF.
MPC
A repeatable mpc section contains an equation count and records depNode,depDOF,rhs,masterCount,node,dof,coefficient,... . DOFs: 1=ux, 2=uy, 3=thetaZ. Only rhs=0 is supported. The example imposes uy(3)=0.5uy(1)+0.5uy(2). Equation IDs follow input order across sections. Diagnostics identify the equation and source line.
mpc
1
3,2,0,2,1,2,0.5,2,2,0.5Complete MPC guide · JSON v3 · CaseMPCFrame.txt · CaseMPCTruss.txt
Mz end releases
After elements, a repeatable releases section contains a record count followed by elementId,end,Mz, with end 1 or 2. N/V components, duplicates and truss releases are rejected. The editor writes one section ordered by element/end. Toggling a release preserves element loads; deleting an element removes its releases.
JSON v4 · CaseReleaseStatic · CaseReleaseModal · CaseReleaseTransient
Section catalog
Open Sections in the preprocessor, create a named section and enter dimensions in model length units. Available shapes are rectangle (b, h), solid circle (d), channel, tee and I section (b, h, tw, tf). Faces are straight, without fillets or flange slopes. Angles are not supported.
Use Assign section beside Add element load to enter section assignment mode. Choose a section and orientation in the sidebar, then click each member to apply. The mode stays active for repeated assignments; Esc returns to Select / pan. Manage sections opens the catalog. Choosing the tool or its settings does not change the model until you click a member. You can also select a member on the diagram and use Assign to selected element in the section card; Assigned to lists its assignments. Alternatively, choose the section and orientation 0°, 90°, 180° or 270° in the element table. Area A and active bending inertia I are calculated automatically; E and density remain element properties. Editing a section updates all assignments and preserves loads. Rerun the analysis after edits. Undo/redo restores catalog and assignments. Detaching preserves current A/I for manual editing; a referenced section cannot be deleted.
sections
1
{"id":1,"name":"Rectangle","type":"rectangle","dimensions":{"b":0.1,"h":0.2}}
element_sections
1
1,1,90Catalog entries are one JSON line each; assignments are elementId,sectionId,angle. Optional repeatable blocks follow the elements. Section IDs are unique; an element has at most one assignment. Geometry overrides the numeric element A/I before matrix assembly. Require tf < h for tees, 2tf < h for channels/I sections, and tw < b for all profiles.