rtx-fea: mor gains total-Lagrangian operators and a held-out ECSW residual
Performance Benchmarks / Run Benchmarks (push) Canceled after 0s
CI / Format Check (push) Canceled after 0s
CI / Clippy Check (push) Canceled after 0s
CI / Build (macos-latest) (push) Canceled after 0s
CI / Build (ubuntu-latest) (push) Canceled after 0s
CI / Test (macos-latest) (push) Canceled after 0s
CI / Test (ubuntu-latest) (push) Canceled after 0s
CI / Build CPU-Only (Explicit) (push) Canceled after 0s
CI / Python Bindings (maturin) (macos-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (ubuntu-latest) (push) Canceled after 0s
CI / WASM Build + Size Check (push) Canceled after 0s
CI / Distributed Training Tests (push) Canceled after 0s
CI / CI Success (push) Canceled after 0s
Documentation / Build API Documentation (push) Canceled after 0s
Documentation / Build User Guide (push) Canceled after 0s

The mor scope was small-strain only ("geometrically linear") — a basis
trained on total-Lagrangian trajectories (the FSI flag marches
with_total_lagrangian) sampled through small-strain operators would
conserve the virtual work of the wrong force. ElementOperator now
carries a Formulation (SmallStrain | TotalLagrangian), the TL branch
mirroring NonlinearDynamicAnalysis exactly (SVK from Lame parameters,
total_lagrangian::internal_force_and_tangent); train_ecsw /
ReducedNonlinearModel::new keep their behavior and delegate, with
_formulated variants added. ecsw_residual evaluates a trained model's
||Cw - b||/||b|| on arbitrary snapshots — the held-out generalization
measurement; on the training set it reproduces training_residual to
1e-12 (pinned).

Verified sharply: identity-basis reduced TL solve vs a
tight-tolerance full TL solve agrees to 4.4e-15 (machine precision)
while small-strain operators land 1.1e-2 away at the same load — the
switch is exercised and exact. (At the default 1e-6 convergence
criteria the reference itself stops 1.7e-4 short; measured and
recorded in the test comment.)

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01X2GmJXeQ2njUecEKiJZ1G2
This commit is contained in:
Omar Sobh
2026-08-29 15:01:09 -05:00
co-authored by Claude Fable 5
parent 9fe9d7f74a
commit d9d8801f1a
4 changed files with 284 additions and 32 deletions
+9 -6
View File
@@ -13,17 +13,20 @@
//! 4. [`reduced::ReducedNonlinearModel`] — Newton in reduced coordinates,
//! assembling only the sampled elements.
//!
//! Scope: geometrically linear, materially nonlinear (what the nonlinear
//! analysis supports), homogeneous Dirichlet data. Lifting for
//! inhomogeneous boundary values is not implemented and the basis is over
//! the free DOFs only.
//! Scope: homogeneous Dirichlet data; the basis is over the free DOFs
//! only (lifting for inhomogeneous boundary values is not implemented).
//! Kinematics are selected per [`reduced::Formulation`]: the original
//! small-strain scope (geometrically linear, materially nonlinear), or
//! total-Lagrangian Saint VenantKirchhoff matching
//! `NonlinearDynamicAnalysis::with_total_lagrangian` — required when the
//! snapshots come from a total-Lagrangian trajectory (the FSI flag).
pub mod ecsw;
pub mod nnls;
pub mod pod;
pub mod reduced;
pub use ecsw::{EcswModel, train_ecsw};
pub use ecsw::{EcswModel, ecsw_residual, train_ecsw, train_ecsw_formulated};
pub use nnls::nnls;
pub use pod::pod_basis;
pub use reduced::ReducedNonlinearModel;
pub use reduced::{Formulation, ReducedNonlinearModel};