Commit Graph

3 Commits

Author SHA1 Message Date
Jukka Aho bafa3af4d0 test: Add Tutorial 4 - 1-element Quad4 validation (35 tests passing)
Educational validation test for Issue #265 use case (JuliaFEM as reference).

Covers:
- Element creation and connectivity
- Field assignment (geometry, material properties)
- Field retrieval with function call syntax
- Hand-calculated constitutive matrix for plane stress
- Geometry validation (dimensions, center, area)
- Material property validation (physical ranges)

Note: Defers stiffness matrix assembly to future work due to current
Quad4 assembly issues. Focus is on element setup validation that
other FEM developers can use as reference.

Tutorial series now: 107/107 tests passing
- Tutorial 1: Creating elements (5 tests)
- Tutorial 2: Gmsh mesh reading (72 tests)
- Tutorial 4: 1-element validation (35 tests - done before Tutorial 3)
2025-11-09 02:45:29 +02:00
Jukka Aho b91e81c125 test: Add Tutorial 2 - Gmsh mesh reading (72 tests passing)
Educational tutorial covering complete Gmsh.jl workflow:
- Mesh generation recipe (2×5 structured Quad4 grid)
- Reading nodes and extracting coordinates
- Reading elements and topology
- Physical group extraction for boundary conditions
- Creating JuliaFEM Element objects from Gmsh data
- Geometry field validation

Features:
- Co-located .msh file (10 elements, 18 nodes) for self-contained testing
- Recipe script shows exactly how mesh was generated (reproducible)
- Comprehensive tests (72 assertions) validating entire workflow
- Runtime: ~3 seconds
- Type-safe conversions (UInt64 → Int64 for connectivity)

Tutorial series now: 77/77 tests passing (Tutorial 1: 5, Tutorial 2: 72)
2025-11-09 02:24:06 +02:00
Jukka Aho 61218f8fd3 test: Phase 1 - Educational test infrastructure with Literate.jl
Implement testing philosophy (see docs/TESTING_PHILOSOPHY.md):

New test structure:
- test/tutorials/ - Educational tests (generate documentation)
- test/unit/ - Fast focused tests
- test/verification/ - Known analytical solutions
- test/runtests_new.jl - New test runner with env var control

First tutorial: Creating Elements and Fields
- Teaches node/element creation
- Explains field concept (geometry, materials, loads)
- 5 tests, all passing 

Test runner features:
- JULIAFEM_TEST_TUTORIALS=true/false (default: true)
- JULIAFEM_TEST_UNIT=true/false (default: false)
- JULIAFEM_TEST_OLD=true/false (default: false)
- Clear output with test categories
- Preserved old test suite as runtests.jl.old

Results: 5/5 tests passing in <2 seconds

Next: Write 2-3 more fundamental tutorials (mesh reading, 1D elasticity)
2025-11-09 01:51:17 +02:00