Skip to main content

Module fem

Expand description

Real finite-element subsystem (element library, global assembly, static solve, Newmark-β time integration, Newton–Raphson nonlinear solve). Backs the structural NonlinearStatic / LinearDynamic / NonlinearDynamic analysis types. Split into its own library submodule (PROJECT RULE §11); carries its own reference tests (cantilever tip deflection, axial/two-bar truss, SDOF Newmark, cubic-spring Newton). Real finite-element subsystem for structural static / dynamic / nonlinear analysis.

This is a genuine, deterministic FE stack — no fabricated numbers, no hard-coded reference answers. Every result is produced by assembling element matrices into a global system and solving it with the crate’s dense linear solvers (crate::solvers::linear_algebra::lu). It backs the previously-NotImplemented AnalysisType variants (NonlinearStatic, LinearDynamic, NonlinearDynamic).

§Model

A planar (2-D) frame model with a uniform 3 DOF per node layout (ux, uy, θz). Global DOF index for node n: ux = 3n, uy = 3n+1, θz = 3n+2. Two element families are provided:

  • [FeElement::Truss] — pin-jointed axial bar, element stiffness kₑ = (EA/L)·[[1,−1],[−1,1]] in the axial coordinate, rotated into global (ux,uy) DOFs by direction cosines. Rotational DOFs are untouched (the caller constrains them for a pure truss).
  • [FeElement::Frame] — 2-node Euler–Bernoulli beam-column: axial EA/L plus the 4×4 bending block with EI/L³ terms, assembled as a 6×6 local matrix and rotated into global coordinates. Consistent 6×6 mass is provided.

§Solvers

  • [solve_static] — K u = F with boundary conditions applied by row/column elimination (exact reactions), solved via LU.
  • [newmark_linear] — average-acceleration Newmark-β (β=¼, γ=½) time integration of M ü + C u̇ + K u = F(t).
  • [newton_raphson] — Newton iteration R(u) = f_int(u) − F_ext → 0 with a caller-supplied tangent.
  • [newmark_nonlinear] — Newmark with an inner Newton–Raphson iteration each step (composition of the two above) for M ü + C u̇ + f_int(u) = F(t).

Structs§

FeModel
A complete finite-element model: nodes, elements, prescribed-displacement constraints and applied nodal loads.
FeNode
A structural node in the planar (2-D) frame model. Coordinates in metres.
FeStaticResult
Result of a linear-static FE solve.
GeoNonlinearBar
A single-DOF geometrically-nonlinear axial bar (fixed–free), Green–Lagrange strain.
NewmarkResult
Time-history response from a Newmark integration.

Enums§

FeElement
A 2-node structural finite element. All elements live in the uniform 3-DOF-per-node layout (ux, uy, θz).

Functions§

assemble_loads
Assemble the global load vector F (length n) from the model’s nodal loads.
assemble_mass
Assemble the global mass matrix M (row-major n×n). Frame elements use their consistent mass; truss elements use lumped mass.
assemble_stiffness
Assemble the global stiffness matrix K (row-major n×n).
newmark_linear
Average-acceleration Newmark-β (β=¼, γ=½ by default) integration of M ü + C u̇ + K u = F(t) on an already-reduced n-DOF system (no constraints). force(t) returns the length-n load vector. Unconditionally stable; the effective stiffness is factored once and reused every step.
newmark_nonlinear
Newmark-β integration with an inner Newton–Raphson iteration each step for M ü + C u̇ + f_int(u) = F(t). internal(u) = f_int, tangent(u) = ∂f_int/∂u. The step residual is G(u) = M a(u) + C v(u) + f_int(u) − F(t+dt) where a,v follow the Newmark relations; the effective tangent is Kₜ + a0·M + a1·C.
newton_raphson
Newton–Raphson solve of R(u) = f_int(u) − F_ext = 0.
solve_static
Solve K u = F with the model’s displacement boundary conditions applied by row/column elimination (partitioning into free / constrained DOFs). Reactions are recovered exactly from the assembled full stiffness.