rtx-fea: re-enable the remaining CPU test modules; fix three real defects they caught
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
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
Performance Benchmarks / Run Benchmarks (push) Canceled after 0s
All 33 remaining #[cfg(disabled)] test modules outside the GPU cluster are now enabled: assembly (dof_mapping, constraints, global assembly), boundary (mod + dirichlet/neumann/robin/thermal/contact), analysis (mod + static), materials (mod, linear_elastic, hyperelastic, plasticity), elements (mod, element_matrices, isoparametric, jacobian, quadrature), mesh (element_types, connectivity, topology, topology_repair), solvers (mod, direct, iterative, nonlinear) and lib.rs. Lib tests 117 -> 335, stable across repeated runs. Only gpu_solver_tests and the GpuMeshData fixture stay disabled — they need CUDA hardware and belong to the GPU tranche. Three real defects found by the newly-compiling tests, each fixed: - Direct solvers reused factorizations keyed on matrix SIZE alone. In a Newton loop the Jacobian changes every iteration but never its dimension, so LuDirect/CholeskyDirect/LdltDirect silently solved with the first iteration's factorization forever — Newton on x^2-4 crawled to x=1.955 in 1000 iterations instead of converging in 5. Invisible in single-solve linear analysis, which is why every green test passed over it. solve() now factorizes the matrix it is given. - AdaptiveQuadrature's refinement re-integrated the WHOLE domain once per subdomain, so each level multiplied the estimate by the subdomain count: integrating e^x over [-1,1] at tolerance 1e-10 returned ~75 instead of 2.35. The recursion now descends into each sub-box with its share of the error budget. - compute_skewness read Jacobian columns as coordinate-line tangents, but the trait's jacobian() stores tangents in ROWS: on a sheared parallelogram whose tangents meet at 14 degrees it reported skewness 0.43 instead of 0.84 — measuring per-component gradients, not mesh skew. Fixtures corrected rather than the code where the fixture was wrong: sigma_yy ~ 0 asserted uniaxial-stress physics on a uniaxial-strain state (exact Lame values now asserted); an "unstable" orthotropic parameter set that satisfies the determinant stability condition (delta = 0.187 > 0); a unit-cube hex Jacobian of 1.0 that assumed a unit reference element (it is 0.125 from [-1,1]^3); a "distorted" quad whose centre Jacobian is exactly orthogonal, asserted as skewed (flattening and shearing now tested separately); a quality score below the implementation's own calibration; Rayleigh damping fed the scalar-field mass (now expanded via the Kronecker identity, with C = alpha*M + beta*K asserted entry-wise); an element factory required to construct Point/Line types that have no implementation; and DOF counts that encoded the repaired 3-DOFs-per-node-on-2-D defect. MaterialDatabase::add_material call sites updated to the (id, material, name) signature; ConnectivityInfo::build takes elements only; TopologyRepair::triangle_quality (normalized 4*sqrt(3)*A/sum(a^2)) added for the repair tests; create_subdomain_rule_* widened to pub(super) for the quadrature tests. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5
parent
8495a690d9
commit
87cf392556
@@ -330,7 +330,7 @@ impl Material for MooneyRivlin {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(disabled)]
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
|
||||
@@ -474,7 +474,7 @@ impl Material for TransverselyIsotropic {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(disabled)]
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
@@ -486,17 +486,30 @@ mod tests {
|
||||
assert!(material.is_linear());
|
||||
}
|
||||
|
||||
// Fixture correction on re-enable (2026-08-19): the original expected
|
||||
// sigma_yy ~ 0 "due to the Poisson effect". That is uniaxial-STRESS
|
||||
// physics; the applied state here is uniaxial STRAIN (eps_yy = eps_zz =
|
||||
// 0), where full 3-D Hooke's law gives sigma_yy = lambda*eps_xx != 0.
|
||||
// Assert the exact Lame values instead.
|
||||
#[test]
|
||||
fn test_linear_elastic_response() {
|
||||
let material = LinearElastic::new(200e9, 0.3);
|
||||
let strain = Vector6::new(0.001, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
let (e, nu, eps) = (200e9, 0.3, 0.001);
|
||||
let material = LinearElastic::new(e, nu);
|
||||
let strain = Vector6::new(eps, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
let state = MaterialState::default();
|
||||
|
||||
let response = material.compute_response(&strain, &state, 1.0).unwrap();
|
||||
|
||||
let lambda = e * nu / ((1.0 + nu) * (1.0 - 2.0 * nu));
|
||||
let mu = e / (2.0 * (1.0 + nu));
|
||||
|
||||
assert!(response.is_valid);
|
||||
assert!(response.stress[0] > 0.0); // Should have positive stress in x-direction
|
||||
assert!((response.stress[1]).abs() < 1e-6); // Should have minimal stress in y-direction due to Poisson effect
|
||||
assert!((response.stress[0] - (lambda + 2.0 * mu) * eps).abs() < 1.0);
|
||||
assert!((response.stress[1] - lambda * eps).abs() < 1.0);
|
||||
assert!((response.stress[2] - lambda * eps).abs() < 1.0);
|
||||
for i in 3..6 {
|
||||
assert!((response.stress[i]).abs() < 1e-9);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -567,12 +580,18 @@ mod tests {
|
||||
let result = OrthotropicElastic::new(-200e9, 15e9, 15e9, 0.25, 0.25, 0.5, 5e9, 5e9, 5e9);
|
||||
assert!(result.is_err());
|
||||
|
||||
// Invalid case: violates stability condition
|
||||
let result = OrthotropicElastic::new(
|
||||
200e9, 15e9, 15e9, 0.8, 0.8, 0.8, // High Poisson's ratios
|
||||
5e9, 5e9, 5e9,
|
||||
);
|
||||
// Invalid case: violates the determinant stability condition. The
|
||||
// original fixture used (E1=200, E2=E3=15) GPa with nu = 0.8, which is
|
||||
// actually STABLE — nu21 = nu12*E2/E1 shrinks the reciprocal products
|
||||
// to delta = 0.187 > 0. Equal moduli with nu = 0.6 genuinely violate
|
||||
// it: delta = 1 - 3*0.36 - 2*0.216 < 0.
|
||||
let result = OrthotropicElastic::new(200e9, 200e9, 200e9, 0.6, 0.6, 0.6, 5e9, 5e9, 5e9);
|
||||
assert!(result.is_err());
|
||||
|
||||
// And the original "high Poisson" case must construct, since it
|
||||
// satisfies the stability condition.
|
||||
let result = OrthotropicElastic::new(200e9, 15e9, 15e9, 0.8, 0.8, 0.8, 5e9, 5e9, 5e9);
|
||||
assert!(result.is_ok());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -715,7 +715,7 @@ pub mod utils {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(disabled)]
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ impl Material for IsotropicPlasticity {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(disabled)]
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user