32 Commits

Author SHA1 Message Date
Jukka Aho 2502707f10 test(materials): snapshot material_behavior inventory across model families
Add one representative model per `material_behavior` kind so refactors to traits
cannot silently orphan newly added constitutive laws.

- Cover constant tangents (elastic/thermal/hydraulic/moisture/diffusion/orthotropic).
- Cover hyperelastic, plasticity, damage, Chaboche, creep, and eigenstrain-augmented elasticity.
2026-05-09 18:46:20 +03:00
Jukka Aho 84fc4ece56 test(materials): extend state-variable trait coverage for new physics hooks
Register the recently introduced damage/creep/eigenstrain/Chaboche markers so the
generated registry cannot drift from their storage types and default symbols.

- SPDX header refresh.
2026-05-09 18:46:17 +03:00
Jukka Aho c631eb6d1c test(materials): assert J2 yield after radial return for PerfectPlasticity
Add a focused regression that `compute_stress` lands on the von Mises surface when
the trial state lies outside yield, using the returned backstress state.

- SPDX header refresh for the file.
2026-05-09 18:46:11 +03:00
Jukka Aho aabca484a3 test(materials): cover buffered stress/tangent vectors in assembly workspace
The refactor exposes in-place `get_*_vector(workspace, buf)` overloads; exercise them
beside the allocating helpers and keep allocation probes on pre-filled buffers.

- Assert buffer aliases and equality against freshly extracted vectors.
- Replace generic `get_field` probes with direct NamedTuple field access.
2026-05-09 18:46:05 +03:00
Jukka Aho 08248d393c test(materials): add orthotropic elasticity regression 2026-05-09 18:39:17 +03:00
Jukka Aho 33efbe2714 test(materials): add J2 plasticity regression 2026-05-09 18:39:17 +03:00
Jukka Aho 91ea4863ae test(materials): add material field trait tests 2026-05-09 18:39:17 +03:00
Jukka Aho 9a301daa85 test(materials): add advanced material law regressions 2026-05-09 18:39:17 +03:00
Jukka Aho 742e82c8f4 test(materials): add materials topic runner 2026-05-09 18:39:16 +03:00
Jukka Aho 5c1db20aac docs(test/materials): document materials test layout 2026-05-09 18:39:16 +03:00
Jukka Aho 5b355cae6c chore(test): delete plasticity new-API experiment
Remove unmaintained plasticity API scaffold tests.

- Drop `test/materials/test_plasticity_new_api.jl`.
2026-05-09 18:27:51 +03:00
Jukka Aho 79739e3371 chore(test): remove legacy perfect plasticity regression
Delete outdated plasticity tests pending `test_plasticity_integration.jl`.

- Drop `test/materials/test_perfect_plasticity.jl`.
2026-05-09 18:27:51 +03:00
Jukka Aho ff8123c350 chore(test): delete retired Neo-Hookean regression file
Remove stale hyperelastic tests superseded by advanced materials coverage.

- Drop `test/materials/test_neo_hookean.jl`.
2026-05-09 18:27:51 +03:00
Jukka Aho 3a8a81919e chore(test): drop legacy global material cache regression
Remove tests targeting deleted `src/materials/material_cache.jl`.

- Delete `test/materials/test_material_cache.jl`.
2026-05-09 18:27:51 +03:00
Jukka Aho c73e189e9f chore(test): delete legacy linear elastic regression
Remove outdated `LinearElastic` tests pending refreshed materials suite.

- Drop `test/materials/test_linear_elastic.jl`.
2026-05-09 18:27:38 +03:00
Jukka Aho c43b37bd9d chore(test): remove hyperelastic API regression file
Delete stale hyperelastic harness superseded by `hyperelastic_models.jl` tests.

- Drop `test/materials/test_hyperelasticity_new_api.jl`.
2026-05-09 18:27:38 +03:00
Jukka Aho 089b50df34 chore(test): delete finite-strain plasticity tests
Remove coverage for deleted `finite_strain_plasticity.jl` material prototype.

- Drop `test/materials/test_finite_strain_plasticity.jl`.
2026-05-09 18:27:38 +03:00
Jukka Aho be875b2bf6 chore(test): drop damage API regression stub
Remove unmaintained damage-model tests for retired APIs.

- Delete `test/materials/test_damage_new_api.jl`.
2026-05-09 18:27:38 +03:00
Jukka Aho c514c1bdcc test(materials): add damage mechanics new API visionary test
New 868-line test file for damage mechanics NEW API (test-driven development):
- Visionary tests for isotropic damage model
- Tests for ductile damage (Lemaitre model)
- Tests for crack band regularization (mesh independence)
- Tests for damage unloading and irreversibility
- Extensive documentation of intended API design
- Tests currently skipped (@test_skip) until implementation complete
- Documents damage variable, effective stress, damage evolution
- Documents regularization and coupled damage-plasticity

This test file serves as both test suite and API design documentation
for the new damage mechanics material model interface.
2025-12-15 08:41:24 +02:00
Jukka Aho 6526697497 test(materials): add hyperelasticity new API visionary test
New 693-line test file for hyperelasticity NEW API (test-driven development):
- Visionary tests for Neo-Hookean material model
- Tests for Mooney-Rivlin and Ogden models
- Tests for incompressibility constraint (nearly incompressible materials)
- Tests for uniaxial tension with large strains
- Extensive documentation of intended API design
- Tests currently skipped (@test_skip) until implementation complete
- Documents strain energy functions, stress computation, tangent moduli
- Documents frame-invariance and material objectivity

This test file serves as both test suite and API design documentation
for the new hyperelastic material model interface.
2025-12-15 08:38:19 +02:00
Jukka Aho 2bcc7ecd1e test(materials): add plasticity new API visionary test
New 747-line test file for plasticity NEW API (test-driven development):
- Visionary tests for J2 plasticity with isotropic hardening
- Tests for radial return mapping algorithm
- Tests for kinematic hardening and Bauschinger effect
- Tests for perfect plasticity and cyclic loading
- Extensive documentation of intended API design
- Tests currently skipped (@test_skip) until implementation complete
- Documents return mapping, consistent tangent, state storage
- Documents nodal assembly for plasticity

This test file serves as both test suite and API design documentation
for the new plasticity material model interface.
2025-12-15 08:36:54 +02:00
Jukka Aho 4ff5044dc0 test(materials): add finite strain plasticity test
New 328-line test file for FiniteStrainPlasticity material model:
- Tests material construction and parameter validation
- Tests state management (FiniteStrainPlasticityState with F_p, α_bar, κ)
- Tests small strain limit (should recover small-strain plasticity)
- Tests identity deformation (F=I gives zero stress)
- Tests pure rotation (objectivity, frame-invariance)
- Tests uniaxial extension in elastic and plastic regimes
- Tests simple shear deformation
- Tests incremental loading and plastic incompressibility (det(F_p)=1)
- Tests hardening behavior (kinematic hardening via backstress)
- Tests state persistence (unloading doesn't decrease plastic strain)
- Validates type stability

Comprehensive test for geometrically exact plasticity using multiplicative
decomposition F = F_e F_p, essential for large deformation analysis.
2025-12-15 08:35:12 +02:00
Jukka Aho 3b4a028fec test(materials): add material cache test
New 286-line test file for GlobalMaterialCache system:
- Tests state type inference from material traits
- Tests zero state creation for empty, tensor, scalar, and mixed states
- Tests MaterialCache construction for stateless and stateful materials
- Tests state access functions (get_state, get_old_state, set_state!)
- Tests update_cache! for time stepping (copying current to old)
- Tests reset_cache! for zeroing all states
- Tests state variable helpers (get_state_variable, set_state_variable)
- Validates type stability of cache operations
- Tests integration with material traits

Essential for stateful material models requiring history-dependent behavior.
2025-12-15 08:34:47 +02:00
Jukka Aho bf5df988b8 test(materials): add perfect plasticity material test
New 352-line test file for PerfectPlasticity material model:
- Tests material construction and parameter validation
- Tests state management (PlasticityState with ε_p, α, κ)
- Tests elastic loading (small strain, no plastic strain)
- Tests plastic loading and yield criterion enforcement
- Tests radial return mapping algorithm
- Tests hardening behavior (kinematic hardening via backstress)
- Tests incremental loading and Bauschinger effect
- Tests pure shear case
- Validates consistency (yield criterion f ≤ 0)
- Validates zero-allocation and type stability

Comprehensive test for J2 plasticity with return mapping essential
for nonlinear structural analysis beyond elastic limit.
2025-12-15 08:28:40 +02:00
Jukka Aho 18529a3f51 test(materials): add Neo-Hookean hyperelastic test
New 352-line test file for NeoHookean hyperelastic material:
- Tests material construction and parameter validation
- Tests strain energy function ψ(C) = μ/2·(I₁-3) - μ·ln(J) + λ/2·ln²(J)
- Tests 2nd Piola-Kirchhoff stress S = 2∂ψ/∂C
- Tests tangent modulus (4th-order tensor)
- Validates automatic differentiation consistency
- Tests small strain limit (recovery to linear elasticity)
- Tests incompressibility (ν → 0.5)
- Validates zero-allocation and type stability

Comprehensive test for hyperelasticity essential for finite strain
analysis of rubber-like materials and soft tissues.
2025-12-15 08:25:58 +02:00
Jukka Aho 4716432d20 test(materials): add linear elastic material test
New 319-line test file for LinearElastic material model:
- Tests material construction and parameter validation
- Tests Lamé parameters (λ, μ) computation
- Tests stress computation: uniaxial, pure shear, hydrostatic
- Tests tangent modulus (4th-order elasticity tensor)
- Validates symmetry, isotropy, and physical properties
- Tests simplified interface (without state, Δt)
- Validates zero-allocation and type stability

Comprehensive test for Hooke's law implementation essential
for linear static and dynamic analysis.
2025-12-15 08:25:25 +02:00
Jukka Aho 3376ba15db test(materials): add assembly workspace refactor test
New 294-line test file included in main test/runtests.jl:
- Tests refactored AssemblyMaterialWorkspace with compositional field design
- Tests field structure inference from material traits
- Tests workspace creation with correct field types
- Tests field access (backward compatibility)
- Tests multiphysics support preparation
- Validates zero allocations in workspace operations

Ensures assembly workspace refactoring maintains backward compatibility and performance.
2025-12-15 06:36:54 +02:00
Jukka Aho ac0fc346af test(materials): add cantilever material cache zero allocations test
New 308-line test file included in main test/runtests.jl:
- Tests GlobalMaterialCache with cantilever beam problem
- Verifies ZERO allocations during state access and updates
- Tests cache creation from material traits (automatic)
- Tests time-stepping workflow with zero allocations in hot loop
- Includes performance benchmarks using BenchmarkTools
- Validates material state type inference

Comprehensive performance test ensuring material cache system has zero allocations.
2025-12-15 06:36:46 +02:00
Jukka Aho b7c4f64151 test(materials): add plasticity integration test
New 229-line test file included in main test/runtests.jl:
- Tests PerfectPlasticity material instantiation and traits
- Tests global material cache creation for stateful materials
- Tests direct NamedTuple state manipulation (compositional design)
- Tests cache access and manipulation (set_state!, update_cache!)
- Tests multi-step plasticity simulation workflow
- Tests state variable helpers (get_state_variable, set_state_variable)
- Validates type stability of key operations

Comprehensive integration test ensuring plasticity material works with cache system.
2025-12-15 06:36:30 +02:00
Jukka Aho b5772b141b test(materials): add global material cache test
New 98-line test file included in main test/runtests.jl:
- Tests GlobalMaterialCache construction for stateless and stateful materials
- Tests state access and update operations (get_state, set_state!, update_cache!, reset_cache!)
- Tests state variable helpers (get_state_variable, set_state_variable)
- Tests integration with material traits (create_global_material_cache)
- Validates cache structure and state management for time-dependent materials

Ensures material cache system works correctly for storing state variables at integration points.
2025-12-15 06:36:03 +02:00
Jukka Aho e3527dac93 test(materials): add material traits test
New 99-line test file included in main test/runtests.jl:
- Tests LinearElastic material traits (supported_physics, required_field_types, required_state_variables)
- Validates trait function existence and exports
- Tests helper functions (is_stateful, get_state_variable_types, get_state_variable_symbols)
- Verifies compositional design philosophy for state variables
- Tests physics-to-field-type derivation

Ensures material trait system works correctly for compositional material design.
2025-12-15 06:34:56 +02:00
Jukka Aho 5e1b66cb67 test(materials): add state variables test
New 93-line test file included in main test/runtests.jl:
- Tests AbstractStateVariable type hierarchy
- Validates state_variable_type trait (returns concrete types)
- Validates default_symbol trait (returns symbols like :ε_p, :α, :κ, :d)
- Tests concrete type instantiation (PlasticStrain, Backstress, etc.)
- Tests NamedTuple usage with state variable symbols
- Verifies trait consistency across all state variable types

Ensures state variable system works correctly for material models.
2025-12-15 06:34:44 +02:00