Files
JuliaFEM.jl/test
Jukka Aho 555c506f17 test(continuum): Add automated allocation and trait tests
Created test/domains/continuum/runtests.jl:
- Test material trait system (6 tests)
  * LinearElastic: StatelessConstantTangent, !needs_deformation, !needs_state
  * NeoHookean: StatelessStrainDependent, needs_deformation, !needs_state
  * PerfectPlasticity: StatefulStrainDependent, needs_deformation, needs_state
- Include zero-allocation tests (27 tests)
  * Verify 0 bytes for LinearElastic integration
  * Verify 0 bytes for NeoHookean integration
  * Test full assembly loop allocations
- Include type stability tests (15 tests)
  * Verify PreparedElement type stability
  * Verify compute_block! type stability
  * Verify trait dispatch type stability

Updated test/runtests.jl:
- Include test/domains/continuum/runtests.jl in main test suite
- Automatically run on every test invocation
- Ensures zero-allocation property maintained
- Ensures material traits work correctly

Updated test/domains/continuum/test_type_stability.jl:
- Adapt to new generic integration API
- Test prepare_element!, compute_block!, compute_all_blocks!
- Verify type stability for both LinearElastic and NeoHookean
- Test material trait helper functions

Test Results:
- 57 tests passing (all tests)
- 33 continuum domain tests (including new trait tests)
- Zero-allocation verified for LinearElastic AND NeoHookean
- Type stability confirmed for generic integration
- Backward compatibility maintained (cantilever test passes)

Why: Automated tests ensure the refactoring maintains performance properties
(zero allocations, type stability) while adding new functionality (traits).
2025-11-19 10:03:46 +02:00
..