Implemented in: mlpg_solver.py (post-processing stage), results.py (TimestepResult)
After solving the linear system K u = f, the solution vector uflat has length 2N, interleaved as:
This vector is reshaped to a (N, 3) array by extracting:
The third component is always zero because the analysis is planar (2D model): no out-of-plane displacement is computed. This ensures compatibility with the 3D data model used by the rest of the GearMaster framework (which uses (N, 3) displacement arrays throughout).
Reaction forces at constrained nodes are computed as the residual of the assembled system:
For unconstrained (free) nodes, Ri ≈ 0 within
solver tolerance. For constrained nodes (those belonging to a GM_Joint with fixed DOFs),
Ri gives the force that the support exerts on the structure
(equal and opposite to the applied reaction).
In the direct-substitution BC method, the rows of K corresponding to constrained DOFs are replaced with unit rows (K_{ii} = 1, K_{ij} = 0, j ≠ i). The reaction forces are therefore computed before BC enforcement, using the original (unmodified) stiffness product Ku at constrained DOFs.
Both arrays are stored in a TimestepResult object (one per solved load step):
| Attribute | Type | Shape | Description |
|---|---|---|---|
displacement | np.ndarray | (N, 3) | Nodal displacements [ux, uy, 0] in mm |
reaction_forces | np.ndarray | (N, 3) | Nodal reaction forces [Rx, Ry, 0] in N |
timestep_index | int | — | Load step index (0 for static) |
time | float | — | Pseudo-time (0.0 for static) |
metadata | dict | — | Solver diagnostics (solve_time, converged, …) |
The convenience property TimestepResult.max_displacement_magnitude() returns
maxi |ui|, useful for solution quality checks.