Commit Graph

1717 Commits

Author SHA1 Message Date
Jukka Aho 72cb112ffe test(io): add postprocessing test
New 23-line test file for postprocessing functionality:
- Tests field interpolation from elements
- Tests temperature field interpolation on 1D segment elements
- Tests interpolation at various points including boundaries
- Tests NaN handling for points outside domain

Simple test validating postprocessing interpolation works correctly.
2025-12-15 08:19:07 +02:00
Jukka Aho 4fdbedae1b test(integration): add integration points API test
New 255-line test file for zero-allocation integration points API:
- Tests get_gauss_points! function for all topologies
- Validates zero-allocation performance requirement
- Tests return types (NTuple of (weight, ξ) pairs)
- Tests integration point counts for different Gauss orders
- Validates weight sums equal reference element volumes
- Tests usage in assembly loop pattern
- Includes performance benchmarking

Comprehensive test ensuring integration points API provides
zero-allocation compile-time resolved quadrature points.
2025-12-15 08:18:51 +02:00
Jukka Aho dc44ea6e5f test(geometry): add strain tensor computation test
New 263-line test file for strain tensor computation:
- Tests ε = ½(∇u + ∇u^T) from displacement gradients
- Tests uniaxial extension case
- Tests pure shear deformation
- Tests rigid body translation (should produce zero strain)
- Validates symmetry property (ε = ε^T)
- Tests type stability and zero-allocation performance
- Includes performance benchmark (< 200 ns target)

Comprehensive test for strain computation essential for solid
mechanics and material model evaluation.
2025-12-15 08:17:17 +02:00
Jukka Aho 98b126563f test(geometry): add Jacobian computation test
New 384-line test file for Jacobian matrix computation:
- Tests J = ∂x/∂ξ mapping between parametric and physical coordinates
- Tests identity, scaled, and rotated element transformations
- Tests 2D triangles and 3D tetrahedra
- Tests physical derivatives: dN/dx = J⁻¹ · dN/dξ
- Validates element quality detection (det(J) > 0)
- Tests consistency with manual calculations
- Validates type stability and zero-allocation performance
- Tests both NTuple and Vector interfaces

Comprehensive test for Jacobian computation essential for coordinate
transformation and integration in FEM assembly.
2025-12-15 08:16:26 +02:00
Jukka Aho 1ed455604f test(geometry): add deformation gradient test
New 561-line test file for deformation gradient computation:
- Tests F = ∂x/∂X = I + ∂u/∂X for finite strain mechanics
- Tests identity case (u = 0 → F = I)
- Tests pure translation (rigid body motion)
- Tests pure stretch and simple shear cases
- Tests small vs finite strain difference
- Validates physical constraints (det(F) > 0)
- Tests Hex8 and Tet10 elements
- Validates zero-allocation performance

Comprehensive test for deformation gradient computation essential
for finite strain analysis and hyperelastic materials.
2025-12-15 08:13:44 +02:00
Jukka Aho acf2b75b51 test(elements): add single element patch test
New 312-line test file for single-element patch test:
- Tests core assembly infrastructure with single Tet10 element
- Validates material model (LinearElastic) stress computation
- Tests strain computation from displacement gradients
- Validates zero-allocation in assembly helpers
- Tests type stability with @inferred checks
- Validates stiffness matrix symmetry and positive definiteness
- Tests uniaxial tension case with known analytical solution

Fundamental validation test isolating assembly implementation
from mesh complexities and solver issues.
2025-12-15 08:10:55 +02:00
Jukka Aho fd0241e6e9 test(elements): add interpolation test
New 234-line test file for interpolate_fields functions:
- Tests single-field scalar interpolation (Temperature)
- Tests single-field vector interpolation (Displacement 2D/3D)
- Tests multi-field interpolation (Temperature + Displacement)
- Tests field value and gradient extraction
- Tests individual field extraction (interpolate_field)
- Tests value-only extraction (interpolate_field_value)
- Validates zero-allocation for all interpolation functions
- Tests NamedTuple return types with proper field structure

Comprehensive test ensuring field interpolation works correctly
for all field types and maintains zero-allocation performance.
2025-12-15 08:10:15 +02:00
Jukka Aho fd63377af3 test(elements): add DOF extraction test
New 218-line test file for extract_element_dofs functions:
- Tests single-field scalar extraction (Temperature)
- Tests single-field vector extraction (Displacement 2D/3D)
- Tests multi-field extraction (Temperature + Displacement)
- Tests non-contiguous DOF indices
- Tests both flat and structured extraction variants
- Validates zero-allocation for all extraction functions
- Tests NamedTuple return types with proper field names

Comprehensive test ensuring DOF extraction works correctly for
all field types and maintains zero-allocation performance.
2025-12-15 08:09:22 +02:00
Jukka Aho 728bfe1a42 test(elements): add element construction test
New 425-line test file for Element construction API:
- Tests separation of concerns: Topology + Basis + Integration + Fields
- Tests 2D/3D elements: Triangles, Tetrahedra, Quadrilaterals, Hexahedra
- Tests P1 and P2 variants with correct node counts
- Validates backward compatibility aliases (Tet4, Tri3, Quad4, Hex8)
- Tests topology properties independent of basis degree
- Tests type-stable NamedTuple fields (100× faster than Dict)
- Tests integration point storage in elements
- Validates zero-allocation element access

Comprehensive test demonstrating new Element API architecture with
proper separation of concerns and type stability.
2025-12-15 08:06:33 +02:00
Jukka Aho d3a8239642 test(elements): add CElement real basis functions test
New 285-line test file verifying CElement uses real Lagrange basis:
- Tests Tri3 and Tet4 linear interpolation (exact at nodes)
- Tests gradient computation for scalar and vector DOFs
- Validates partition of unity property (sum of basis = 1)
- Tests linear reproduction (linear functions reproduced exactly)
- Tests deformation gradient for VectorDOF{2}
- Verifies basis functions from basis_generated.jl, not stubs

Ensures CElement correctly uses actual Lagrange basis functions
with proper mathematical properties.
2025-12-15 08:02:16 +02:00
Jukka Aho 3d4d47294f test(dofs): add THM-ECD hexa-physics coupling test
New 746-line test file implementing 6-field THM-ECD system:
- Tests 6-field system: Temperature, Displacement, Pore pressure,
  Electric potential, Chemical concentration, Damage (NEW)
- Implements complete physics with 30 off-diagonal coupling blocks
- Tests damage-enhanced properties: thermal conductivity κ(d),
  permeability k(d), diffusion D(d), reduced conductivity σ_e(d)
- Tests damage-degraded stiffness: σ = (1-d)·C:ε
- Implements damage evolution: mechanical, thermal, chemical,
  pressure, and electric field damage
- Validates elastic energy driving force: Y = ½ε:(C:ε)
- Tests all damage coupling mechanisms for hydraulic fracturing,
  stress corrosion cracking, concrete spalling, shale gas

Ultimate hexa-physics demonstration with damage mechanics for
complete failure analysis in complex multi-physics systems.
2025-12-15 08:01:27 +02:00
Jukka Aho b1a417e5a3 test(dofs): add THM-EC penta-physics coupling test
New 779-line test file implementing 5-field THM-EC system:
- Tests 5-field system: Temperature, Displacement, Pore pressure,
  Electric potential, Chemical concentration (NEW)
- Implements complete physics with 20 off-diagonal coupling blocks
- Tests all existing THM-E couplings plus 8 new chemical couplings:
  K_uc (chemomechanical), K_Tc (reaction heat), K_cT (Soret),
  K_pc (fluid source), K_cp (pressure-dependent diffusion),
  K_φc (ionic migration)
- Demonstrates chemical transport: diffusion, advection, migration,
  thermal diffusion, pressure-dependent diffusivity
- Tests reaction terms: heat of reaction, fluid source from reactions
- Validates complete multi-physics for geothermal, nuclear waste,
  CO2 sequestration, batteries, concrete durability, corrosion

Ultimate demonstration of multi-field Element API with 5 fields and
20 coupling blocks - the most complex multi-physics system possible.
2025-12-15 08:00:26 +02:00
Jukka Aho 0735206afa test(dofs): add minimal THME multi-physics test
New 118-line minimal test demonstrating complex multi-physics:
- Tests 4-field THME system (Temperature, Displacement, Pressure,
  Electric potential) in under 100 lines of code
- Demonstrates all 6 bidirectional couplings (12 coupling blocks)
- Shows that complex physics does not require complex code
- Validates thermal expansion, Biot poroelasticity, thermal pressurization,
  electro-osmotic, Seebeck/Peltier, and piezoelectric coupling
- Tests simultaneous assembly of all physics in one element loop
- Demonstrates type-safe field access and local-to-global mapping

Minimal but complete demonstration of multi-field Element API for
geothermal, nuclear waste, CO2 sequestration, and smart materials.
2025-12-15 08:00:11 +02:00
Jukka Aho b0434d8c82 test(dofs): add real THM-E physics coupling test
New 705-line test file implementing complete THM-E physics:
- Tests 4-field system: Temperature (vertices), Displacement (vertices),
  Pore pressure (cells), Electric potential (edges)
- Implements complete physics: heat equation, elasticity, Darcy flow,
  charge conservation with all coupling terms
- Tests 12 off-diagonal coupling blocks: K_Tu, K_up, K_Tp, K_φp, K_Tφ, K_uφ
- Implements thermal expansion, Biot poroelasticity, thermal pressurization,
  electro-osmotic, Seebeck/Peltier, and piezoelectric coupling
- Uses 3rd-order piezoelectric tensor (Tensor{3,3}) for proper formulation
- Validates Onsager reciprocity for all coupling pairs
- Tests one element loop assembling all physics simultaneously
- Demonstrates type-safe field access and local-to-global mapping

Complete multi-physics demonstration with real tensor operations and
zero-allocation assembly for complex coupled systems.
2025-12-15 07:57:14 +02:00
Jukka Aho 37a383091c test(dofs): add THM-E multi-field coupling test
New 399-line test file demonstrating ultimate multi-physics coupling:
- Tests 4-field system: Temperature (vertices), Displacement (vertices),
  Pore pressure (cells), Electric potential (edges)
- Implements fully coupled THM-E system with off-diagonal blocks
- Demonstrates thermal-mechanical coupling (K_uT)
- Demonstrates poroelastic coupling (K_up, K_pu)
- Tests simultaneous assembly in one pass for all fields
- Validates global DOF numbering across different entity types
- Shows type-safe field access: elem.dof_indices.T, .u, .p, .φ

Ultimate demonstration of multi-field Element API for complex
coupled physics: geomechanics, CO2 sequestration, nuclear waste,
electrokinetic remediation, geothermal energy.
2025-12-15 07:56:27 +02:00
Jukka Aho beac1c264f test(dofs): add real Stokes flow test
New 307-line test file for complete Stokes flow implementation:
- Tests mixed finite elements with velocity (Vec{2} at vertices)
  and pressure (Float64 at cell centers) DOFs
- Implements real viscous term assembly: ∫μ∇u:∇v dx
- Implements real divergence operator: ∫p(∇·v) dx
- Solves incompressible Stokes flow: -μΔu + ∇p = f, ∇·u = 0
- Validates saddle-point system structure [A B'; B 0]
- Tests boundary conditions (no-slip on bottom)
- Verifies incompressibility constraint ∇·u = 0

Demonstrates complete Stokes physics with mixed DOF types and
cell-entity DOFs for incompressible flow applications.
2025-12-15 07:53:04 +02:00
Jukka Aho 08f67d273d test(dofs): add mixed DOF vararg test
New 166-line test file for variadic MixedDOF type system:
- Tests type-level multi-field composition with @MixedDOF macro
- Validates DOF indices structure (tuple of tuples, not NamedTuple)
- Tests DOF sharing between elements for different entity types
- Compares MixedDOF (vararg) vs NamedTuple approaches
- Demonstrates 4-field mixed system: Temperature, Displacement,
  Pressure, Electric potential on different entities

Validates variadic approach to multi-field elements where DOF types
are mixed as type parameters rather than named fields.
2025-12-15 07:50:39 +02:00
Jukka Aho ffe08202f1 test(dofs): add DOF system test
Tests core DOF system functionality.
Validates DOF{T,E} types and DOFSet specifications.
2025-12-15 07:46:39 +02:00
Jukka Aho efbeeb2918 test(dofs): add DOF connectivity test
Tests DOF connectivity system for inverse mapping.
Validates DOF-to-element connectivity for DOF-based assembly.
2025-12-15 07:46:38 +02:00
Jukka Aho b44f7b6d89 test(basis): add zero-cost basis test
Tests zero-allocation basis function evaluation.
Validates performance characteristics of basis functions.
2025-12-15 07:46:36 +02:00
Jukka Aho 41387bd1b2 test(basis): add basis API test
Tests basis function API interface.
Validates get_basis_functions and get_basis_derivatives.
2025-12-15 07:46:33 +02:00
Jukka Aho 52923054ed test(backend): add CPU minimal test
Minimal test for CPU backend functionality.
Validates basic backend operations.
2025-12-15 07:46:30 +02:00
Jukka Aho 5caa75f1d7 test(assemblers): add two-phase assembly test
Tests two-phase assembly workflow.
Validates assembly process with multiple phases.
2025-12-15 07:46:26 +02:00
Jukka Aho 491b45c793 test(assemblers): add microkernel formulations test
Tests microkernel-based physics formulations.
Validates evaluate() interface for DOF-based assembly.
2025-12-15 07:46:20 +02:00
Jukka Aho 8c6e91b1ef test(assemblers): add simple DOF-based COO test
Simple test case for DOF-based COO assembler.
Basic validation of DOF-based assembly workflow.
2025-12-15 07:46:05 +02:00
Jukka Aho 15cb606f86 test(assemblers): add DOF-based COO assembler test
Tests DOF-based COO (Coordinate) assembler implementation.
Validates DOF-based assembly paradigm for matrix-free solvers.
2025-12-15 07:46:02 +02:00
Jukka Aho 06592e115b test(assemblers): add assembler equivalence test
Tests equivalence between different assembler implementations.
Validates that different assembly approaches produce identical results.
2025-12-15 07:45:54 +02:00
Jukka Aho 48e6ff2cc4 test(validation): add strain based test
Validation test for strain-based formulations.
Included in main test/runtests.jl
2025-12-15 07:43:59 +02:00
Jukka Aho 9f8e3796c6 test(validation): add elasticity helpers test
Validation test for elasticity helper functions.
Included in main test/runtests.jl
2025-12-15 07:43:55 +02:00
Jukka Aho a42eb67263 test(validation): add cantilever minimal test
Minimal validation test for cantilever beam problem.
Included in main test/runtests.jl
2025-12-15 07:43:52 +02:00
Jukka Aho 60e0a8da68 test(quadrature): add runtests.jl
Test suite organizer for quadrature module.
Includes accuracy, API, and element-specific quadrature tests.
2025-12-15 07:43:42 +02:00
Jukka Aho 9e287d8fb6 test(element): add runtests.jl
Test suite organizer for element module.
Includes CElement creation, type, and interpolation tests.
2025-12-15 07:43:34 +02:00
Jukka Aho 20729506d3 test(dofs): add runtests.jl
Test suite organizer for DOF system module.
Includes field unification and DOF system tests.
2025-12-15 07:43:28 +02:00
Jukka Aho 8adfb0802f test(basis): add runtests.jl
Test suite organizer for basis module.
Includes all basis function tests: partition of unity, derivatives,
interpolation, type stability, numerical accuracy, etc.
2025-12-15 07:43:23 +02:00
Jukka Aho e55560a35a test(validation): add simple plasticity validation test
Test file included in main test/runtests.jl
Simple validation test for plasticity material behavior
2025-12-15 06:40:15 +02:00
Jukka Aho 5cbb8091fd test(topology): add wedges test
Test file included in main test/runtests.jl
Tests wedge element topology
2025-12-15 06:40:06 +02:00
Jukka Aho ad22999128 test(topology): add triangles test
Test file included in main test/runtests.jl
Tests triangular element topology
2025-12-15 06:40:02 +02:00
Jukka Aho 71ee6849a2 test(topology): add topology entities tetrahedron test
Test file included in main test/runtests.jl
Tests topological entities for tetrahedral elements
2025-12-15 06:40:00 +02:00
Jukka Aho 802296a501 test(topology): add topological invariance test
Test file included in main test/runtests.jl
Tests topological invariance properties
2025-12-15 06:39:58 +02:00
Jukka Aho f92ea0bc08 test(topology): add segments test
Test file included in main test/runtests.jl
Tests segment element topology
2025-12-15 06:39:56 +02:00
Jukka Aho ff3631e449 test(topology): add quadrilaterals test
Test file included in main test/runtests.jl
Tests quadrilateral element topology
2025-12-15 06:39:53 +02:00
Jukka Aho 970fed178b test(topology): add pyramids test
Test file included in main test/runtests.jl
Tests pyramid element topology
2025-12-15 06:39:51 +02:00
Jukka Aho 487a675ad0 test(topology): add hexahedra test
Test file included in main test/runtests.jl
Tests hexahedral element topology
2025-12-15 06:39:49 +02:00
Jukka Aho f9d17c22e8 test(topology): add entity dimensions test
Test file included in main test/runtests.jl
Tests topological entity dimension properties
2025-12-15 06:39:46 +02:00
Jukka Aho 92bd0b9704 test(quadrature): add wedge quadrature test
Test file included in test/quadrature/runtests.jl
Tests quadrature rules for wedge elements
2025-12-15 06:39:35 +02:00
Jukka Aho 5bc7965983 test(quadrature): add triangle quadrature test
Test file included in test/quadrature/runtests.jl
Tests quadrature rules for triangular elements
2025-12-15 06:39:31 +02:00
Jukka Aho 7dc48934d6 test(quadrature): add tetrahedra quadrature test
Test file included in test/quadrature/runtests.jl
Tests quadrature rules for tetrahedral elements
2025-12-15 06:39:28 +02:00
Jukka Aho 1e3839bf69 test(quadrature): add tensor product quadrature test
Test file included in test/quadrature/runtests.jl
Tests tensor product quadrature rules
2025-12-15 06:39:21 +02:00
Jukka Aho c082000a5c test(quadrature): add pyramid quadrature test
Test file included in test/quadrature/runtests.jl
Tests quadrature rules for pyramid elements
2025-12-15 06:39:04 +02:00
Jukka Aho 1663e6d59b test(quadrature): add legacy API test
Test file included in test/quadrature/runtests.jl
Tests backward compatibility with legacy quadrature API
2025-12-15 06:38:41 +02:00