Commit Graph

6 Commits

Author SHA1 Message Date
Jukka Aho 1482fe1b5e docs(materials): expand trait docs and align SPDX header
Replace the legacy banner with SPDX lines and document how each
`MaterialBehavior` maps to assembly and `GlobalMaterialCache`, dropping the
unused `AbstractMaterialState` / `state_type` surface in favor of
`material_state_type` NamedTuples.

- Switch the file banner to `SPDX-FileCopyrightText` /
  `SPDX-License-Identifier: MIT`.
- Remove `AbstractMaterialState`, `EmptyState`, and `state_type`; point readers
  at `material_state_type` / `required_state_variables`.
- Enlarge `StatelessConstantTangent`, `StatelessStrainDependent`, and
  `StatefulStrainDependent` docstrings with representative models, tangent
  caveats, and explicit coverage gaps.
2026-05-09 17:33:27 +03:00
Jukka Aho a6d77d4705 refactor(materials): streamline API documentation by removing verbose sections
Removed extensive documentation from material API docstrings:
- Removed detailed interface requirements sections
- Removed type hierarchy explanations
- Removed design philosophy sections
- Removed usage examples and 'See Also' references
- Kept only essential type and function descriptions

This simplifies the API documentation while maintaining core information
about material types and their behavior traits.
2025-12-15 03:17:44 +02:00
Jukka Aho 87d79f15b1 docs(materials): update docstrings for AssemblyMaterialWorkspace API
Update AbstractMaterialState and EmptyState docstrings to reference
new AssemblyMaterialWorkspace and GlobalMaterialCache instead of
old MaterialStateCache API.
2025-12-12 23:42:02 +02:00
Jukka Aho b468fc885d refactor(materials): Add @inline to AbstractMaterial API functions
- Added @inline to is_finite_strain, has_state
- These trait functions are called in hot paths
- Part of selective inlining strategy
2025-11-20 16:56:37 +02:00
Jukka Aho 56b8f25682 feat(materials): Add trait-based material behavior system
- Define MaterialBehavior abstract type for material classification
- Add StatelessConstantTangent trait for linear elastic materials
- Add StatelessStrainDependent trait for hyperelastic materials
- Add StatefulStrainDependent trait for plastic materials
- Implement material_behavior() trait function interface
- Add needs_deformation() and needs_state() helper queries
- Document trait system with comprehensive examples
- Enable generic integration without material-specific code duplication
- 148 lines of trait definitions and documentation

Why: Solves the problem of replicating compute_block! for each material type.
With 100 materials, we'd have 100 copies of integration code. Traits provide
a standardized interface that integration code can query at compile time.
2025-11-19 10:03:44 +02:00
Jukka Aho 2be68f3bf3 feat(materials): Add material model API with elastic and plastic abstractions
Create src/materials/api.jl defining material-specific abstractions:
- AbstractMaterial base type for all material models
- AbstractElasticMaterial for stateless materials (no history)
- AbstractPlasticMaterial for stateful materials (history-dependent)
- compute_stress() interface (strain → stress + tangent + updated state)
- elasticity_tensor() for elastic constitutive relations

Material models use Tensors.jl (no Voigt notation). Elastic materials
are stateless (LinearElastic, NeoHookean). Plastic materials have internal
state (plastic strain εᵖ, backstress α, hardening κ, damage).

Interface returns (σ, 𝔻, state_new) where 𝔻 is the material tangent ∂σ/∂ε.

Part of systematic modular API architecture.
2025-11-15 18:39:20 +02:00