Commit Graph

1571 Commits

Author SHA1 Message Date
Jukka Aho ee536f7a53 feat(io): add Abaqus mesh parsing implementation
New 305-line Abaqus mesh parser:
- element_has_nodes(), element_has_type(): Abaqus element type mappings
- Supports C3D4, C3D8, C3D10, C3D20, S3, CPS4, T2D2, T3D2, B33, etc.
- parse_abaqus(): main parsing function for .inp files
- parse_numbers(), parse_definition(), matchset(): parsing utilities
- empty_or_comment_line(): comment/empty line detection
- Required by AbaqusReader module for mesh reading

Provides core Abaqus .inp file mesh parsing functionality.
2025-12-15 06:12:43 +02:00
Jukka Aho d9fcc6f80c feat(io): add Abaqus keyword registration system
New 24-line keyword registration system:
- register_abaqus_keyword(): register keywords for section parsing
- is_abaqus_keyword_registered(): check if keyword is registered
- Global registry for ABAQUS .inp file keywords
- Required by parse_model.jl for section parsing

Provides keyword registration infrastructure for AbaqusReader module.
2025-12-15 06:12:22 +02:00
Jukka Aho 21309009fc feat(io): add AbaqusReader module for full Abaqus .inp parsing
New 17-line AbaqusReader module:
- Module wrapper for full Abaqus reader functionality
- Includes: parse_mesh.jl, keyword_register.jl, parse_model.jl, create_surface_elements.jl, abaqus_download.jl
- Exports: abaqus_read_mesh, abaqus_read_model, create_surface_elements, abaqus_download
- Required by abaqus_reader.jl (simple wrapper calls AbaqusReader.abaqus_read_mesh)
- Full keyword parsing support vs simplified reader

Provides complete Abaqus .inp file parsing infrastructure.
2025-12-15 06:11:54 +02:00
Jukka Aho 79233380be feat(dofs): add DOF connectivity for inverse mapping
New 434-line DOF connectivity system:
- DOFElementConnection: GPU-compatible bits type (elem_id, local_dof_idx)
- DOFConnectivity: inverse mapping DOF → elements (CPU version)
- DOFConnectivityGPU: GPU version with fixed-size arrays
- build_dof_connectivity(): build inverse mapping from elements
- build_dof_connectivity_gpu(): build GPU-compatible version
- connection_count(), is_empty(): query functions
- Zero-allocation after initialization
- GPU-compatible data structures (bits types, fixed-size arrays)
- Already integrated in JuliaFEM.jl (line 580)

Provides inverse mapping infrastructure for DOF-based assembly.
2025-12-15 06:10:28 +02:00
Jukka Aho 92fe16f45a feat(dofs): add DOFManager for global DOF numbering
New 495-line DOF management system:
- DOFManager: manages global DOF numbering across mesh entities
- register_fields!(): register fields from DOFSet specifications
- allocate_dofs!(): allocate DOFs for entities (supports multi-field)
- get_node_dofs(): retrieve DOF indices for nodes
- count_field_dofs(): count total DOFs for specific field
- count_entities(): count mesh entities by type (Vertex, Edge, Face, Cell)
- create_elements!(): create elements with DOF assignment
- Supports heterogeneous multi-field specifications
- Builds DOF connectivity during element creation
- Already integrated in JuliaFEM.jl (line 577)

Provides global DOF numbering and element creation infrastructure.
2025-12-15 06:10:15 +02:00
Jukka Aho c4afa8347d feat(dofs): add mixed DOF system for coupled fields
New 95-line file for mixed/coupled DOF systems:
- MixedDOF{DOFs}: composition of multiple entity-based DOF types
- Helper functions: is_mixed(), get_dof_types(), num_fields(), get_field_dof_type()
- Support for Stokes (velocity+pressure), 3-field formulations, Taylor-Hood
- DOF ordering: concatenated in field order
- Display formatting for mixed DOF types

Enables mixed interpolation methods with different DOF types per field.
2025-12-15 06:09:56 +02:00
Jukka Aho ed30a5fa43 feat(dofs): add entity-based DOF convenience types
New 169-line file with convenience types and helpers:
- ScalarDOF{E}: type alias for scalar DOFs at entities
- VectorDOF{D,E}: type alias for D-dimensional vector DOFs
- TensorDOF{D,E}: type alias for tensor DOFs
- Convenience constructors for common DOF patterns
- Helper functions for entity-based DOF operations

Provides convenient type aliases for common DOF patterns using entity-based system.
2025-12-15 06:09:36 +02:00
Jukka Aho d105e3e6fa feat(dofs): add unified multi-field specification system
New 396-line field specification system:
- @DOFSet macro for clean multi-field syntax
- ndofs(): compute total DOFs for field specifications
- field_ndofs(): count DOFs per field
- field_names(), field_count(), is_single_field(): field queries
- quantity_type(), entity_type(): extract field components
- single_field(): convert single-field DOFSet to DOF type
- Support for single-field and multi-field specifications
- Comprehensive documentation with examples

Implements unified multi-field architecture where single-field is special case.
2025-12-15 06:09:17 +02:00
Jukka Aho 2df1072f65 feat(dofs): add DOF API with type-level field specifications
New 230-line API file defining DOF system foundation:
- AbstractDOF: base type for all field specifications
- DOF{T,E}: abstract type for type-level field specs (never instantiated)
- DOFSet: type alias for multi-field specifications (currently NamedTuple)
- dof_size(): utility for counting DOF components (Float64, Vec, Tensor, etc.)
- @DOFSet macro support for clean multi-field syntax
- Comprehensive documentation with examples
- Type-level, compile-time resolved (no runtime overhead)

Provides foundation for unified multi-field DOF system.
2025-12-15 06:08:58 +02:00
Jukka Aho 2c1701e6a5 feat(dofs): add DOF system main entry point
New 40-line main entry point for DOF system:
- Includes api.jl (DOF{T,E} abstract type)
- Includes fields.jl (field specification system)
- Documents multi-field philosophy (single-field is special case)
- Defines module structure and dependencies
- Already integrated in JuliaFEM.jl (line 313)

Provides unified type-level field specification system for finite elements.
2025-12-15 06:08:09 +02:00
Jukka Aho d85d96b899 feat(assemblers): add experimental DOF-based COO assembler
New 720-line experimental DOF-based assembly implementation:
- DOF-by-DOF paradigm: loops over DOFs (matrix rows) instead of elements
- DOFBasedCOOCache: pre-allocated cache with zero-allocation guarantees
- Matrix-free integration: computes K*v without intermediate storage
- Supports single-kernel problems (experimental limitation)
- Uses DOF connectivity infrastructure for inverse mapping
- Pre-computed element/geometry/material caches for performance
- extract_system(): builds sparse matrix from triplets
- create_cache(): factory function for cache creation

Use cases: matrix-free Krylov solvers, very large problems, contact mechanics, mixed methods.

Status: EXPERIMENTAL - single-kernel assumption only.
2025-12-15 06:06:49 +02:00
Jukka Aho fb3ea93d3d feat(assemblers): add DOF field info decoding for DOF-based assembly
New 197-line module for DOF field information:
- DOFFieldInfo struct: field, entity, component, node index
- decode_local_dof(): decodes local DOF indices to field/entity/component
- Supports single-field and multi-field DOF specifications
- Helper functions: flatten_dof_indices, fill_dof_buffer!
- Zero-allocation buffer operations
- Required dependency for dof_based_coo.jl

Enables DOF-based assembly to decode which field/entity/component each DOF represents.
2025-12-15 06:06:23 +02:00
Jukka Aho f252d6cad7 feat(assemblers): add manually unrolled symmetric scatter function
New 124-line scatter function with manual loop unrolling:
- Scatters symmetric blocked tensor stiffness matrix to COO triplets
- Manually unrolls inner 3×3 loops to eliminate dynamic dispatch
- Handles diagonal and off-diagonal blocks with symmetry
- Zero-allocation guarantee with pre-allocated arrays
- Performance optimization: eliminates 18 dynamic dispatch sites
- Required dependency for element_based_coo.jl

Provides optimized symmetric scattering for COO assembly.
2025-12-15 06:06:11 +02:00
Jukka Aho 5995115e72 feat(assemblers): add scatter_to_force! for force vector assembly
New 37-line scatter function for element-based force assembly:
- Scatters element force vector to global force vector in-place
- Zero-allocation guarantee (modifies global vector directly)
- Legacy format support
- Required dependency for element_based_coo.jl

Provides core force scattering functionality for COO assembly.
2025-12-15 06:05:51 +02:00
Jukka Aho 71b580f5ea feat(assemblers): add scatter_to_triplets! for COO assembly
New 63-line scatter function for element-based COO assembly:
- Scatters element stiffness matrix to triplet arrays (I, J, V)
- In-place operation with zero-allocation guarantee
- Capacity checking to prevent overflow
- Required dependency for element_based_coo.jl

Provides core scattering functionality for COO format assembly.
2025-12-15 06:05:32 +02:00
Jukka Aho 078e9f2bc5 docs(mesh): add comprehensive mesh module documentation
New 303-line documentation file describing:
- Type-stable parametric Mesh{N,T} data structure
- Core data (nodes, connectivity, element/node sets, inverse connectivity)
- Files and their purposes (api.jl, mesh.jl, structured.jl, circular.jl, refine.jl, graph_ordering.jl)
- Mesh creation strategies (structured, circular, Gmsh)
- Mesh manipulation (refinement with LongestEdgeBisection)
- Mesh optimization (RCM bandwidth minimization)
- Usage patterns and examples
- Design philosophy (separation of concerns, type stability, industrial workflows)
- Future extensions and dependencies

Documents the complete mesh architecture and API.
2025-12-15 05:48:11 +02:00
Jukka Aho bb51559d92 docs(io): add I/O module documentation for mesh import/export
New 120-line documentation file describing:
- Supported mesh formats (Abaqus .inp, Code Aster .med/.rmed, Gmsh .msh)
- File organization (core readers vs legacy vendor package infrastructure)
- Design philosophy (weak dependencies, two-tier strategy)
- Future work (export formats, import enhancements, consolidation)
- Usage examples and dependency requirements

Documents the mesh I/O architecture and reader strategy.
2025-12-15 05:47:02 +02:00
Jukka Aho 71145f2ce1 docs(elements): add comprehensive elements module documentation
New 219-line documentation file explaining:
- Ciarlet's finite element triple (K, P, Σ) and computational implementation
- Element structure with type-stable @generated constructor
- Field specifications for single and multi-field elements
- DOF extraction strategies (flat and structured)
- Local-global DOF mapping for coupled multi-field assembly
- Performance notes showing zero-allocation achievement (5.5 ns)

Documents the Element{K,P,S,N} type and its zero-allocation design philosophy.
2025-12-15 05:46:24 +02:00
Jukka Aho 91e1428300 docs(src): add comprehensive source code architecture guide
New 536-line documentation file describing:
- Purpose and responsibility of each src/ subdirectory
- Module dependency order and include structure
- Directory health status with action items
- Cleanup plan for dead code and duplicates
- Design principles and future architecture roadmap

Documents all active modules (topology, basis, quadrature, mesh, materials,
assemblers, domains, solvers, physics, etc.) and identifies legacy/duplicate
code that needs cleanup.
2025-12-15 05:46:07 +02:00
Jukka Aho d2031036d9 refactor(materials): streamline perfect plasticity documentation
Removed verbose documentation sections:
- Removed extensive theory documentation (yield function, flow rule, hardening law, consistency condition)
- Removed detailed algorithm step-by-step explanations (radial return mapping)
- Removed type hierarchy, construction examples, and derived properties
- Removed performance notes and timing information
- Removed detailed function documentation with algorithm steps

Simplified docstrings to essential information about material parameters and function signatures.
2025-12-15 03:18:27 +02:00
Jukka Aho a682e964b4 refactor(materials): streamline Neo-Hookean documentation
Removed verbose documentation sections:
- Removed detailed theory explanations and strain energy formulas from module docstring
- Removed type hierarchy, properties, and construction examples
- Removed detailed function documentation with usage examples
- Removed performance notes and automatic differentiation explanations
- Removed stress conversion formulas and notes

Simplified docstrings to essential formulas (strain energy, stress computation) and function signatures.
2025-12-15 03:18:17 +02:00
Jukka Aho 8b1bc18124 refactor(materials): streamline linear elastic documentation
Removed verbose documentation sections:
- Removed detailed theory explanations and formulas from module docstring
- Removed type hierarchy and properties sections
- Removed usage examples from function docstrings
- Removed performance notes and implementation details
- Simplified docstrings to essential formulas (Hooke's law, elasticity tensor)

Kept core mathematical formulas and function signatures.
2025-12-15 03:18:07 +02:00
Jukka Aho 1a8927c8f6 refactor(materials): streamline finite strain plasticity documentation
Removed verbose documentation sections:
- Removed detailed theory references (Simo & Hughes)
- Removed algorithm step-by-step explanations
- Removed performance notes and timing information
- Removed detailed field descriptions and invariants
- Simplified docstrings to essential information about fields and function signatures

Kept core information about multiplicative decomposition and material parameters.
2025-12-15 03:17:57 +02: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 2da5e565b8 chore: remove demos directory from main repository
Remove demos/README.md as all demos and examples have been moved
to the website repository (juliafem.github.io) where they belong
as documentation rather than core library code.

- Move all demos/ and examples/ files to juliafem.github.io
- Update STRUCTURE.md to reflect examples/ and demos/ live in website
- Remove demos/README.md from main codebase
- Keep main repository focused on library code only
2025-12-12 23:56:33 +02:00
Jukka Aho 2a1920a959 test(validation): refactor cantilever test for new DOF-based architecture
Update test_cantilever_regression.jl to use new DOF system, DOFManager,
and proper constraint elimination instead of old Physics struct API.

- Create elements using new @DOFSet and Element{K,P,S} API
- Use DOFManager for DOF allocation and management
- Apply forces using get_node_dofs API instead of NeumannBC
- Apply boundary conditions using constraint elimination (proper method)
- Solve reduced system (K_ff * u_f = f_f) instead of manipulating full matrix
- Reconstruct full solution from reduced solution
- Remove old Physics struct, DirichletBC, NeumannBC usage
- Update step numbering and comments for clarity
2025-12-12 23:50:09 +02:00
Jukka Aho 5feb8c0dfb test: add test suites for new DOF-based architecture
Add test includes for new architecture components: fields, physics,
element interpolation, materials, topology, and validation.

- Add LocalField type test
- Add fields test suite (test_local_field.jl)
- Add physics test suite (test_strain.jl)
- Add element interpolation test suite (test_interpolate_local_fields.jl)
- Add material test suites (state variables, traits, global cache, plasticity, workspace)
- Add topology test suites (segments, triangles, quadrilaterals, entities, etc.)
- Add validation test (test_plasticity_simple.jl)
- Comment out obsolete topology type extraction test
2025-12-12 23:49:41 +02:00
Jukka Aho 2dcadd85e9 test(physics): update tests for new physics category types
Replace tests for old Physics struct with tests for new physics
category types and trait-based dispatch.

- Remove tests for Physics struct, DirichletBC, NeumannBC, Constraint
- Add tests for Elasticity{Dim} and Thermal{Dim} category types
- Add tests for required_field_type trait function
- Test type stability and dispatch behavior
- Verify dimension-dependent field type mapping
2025-12-12 23:49:05 +02:00
Jukka Aho 6d70168321 test(continuum): remove unused element creation in hex8 validation test
Remove unused Element creation since connectivity is only used for
reference and element is not actually used in the test.
2025-12-12 23:47:11 +02:00
Jukka Aho 7778ff344a test(continuum): update reset tests for AssemblyMaterialWorkspace API
Update test_reset_functions.jl to use get_stress/get_tangent getters
and relax allocation requirements for reset! function.

- Rename test set from MaterialStateCache to AssemblyMaterialWorkspace
- Update field access to use get_stress/get_tangent getter functions
- Relax allocation test for reset! (not in hot path, NamedTuple overhead acceptable)
- Add missing test_helpers.jl include
2025-12-12 23:46:55 +02:00
Jukka Aho dedc5e093d test(continuum): update kernel tests to use get_tangent getter
Update test_kernel_functions.jl to use get_tangent getter function
instead of direct field access to material_cache.𝔻, matching the
new AssemblyMaterialWorkspace API.
2025-12-12 23:46:32 +02:00
Jukka Aho 3cb9a66b94 test(continuum): update cache tests for new material workspace API
Update test_cache_updates.jl to support both legacy and new
GlobalMaterialCache API with proper allocation testing.

- Rename legacy test set to indicate it uses old API
- Update field access to use get_stress/get_tangent getter functions
- Relax allocation test for legacy API (may have NamedTuple overhead)
- Add new test set for GlobalMaterialCache API
- Add zero-allocation verification using BenchmarkTools
- Test both material_cache.σ/𝔻 access patterns
2025-12-12 23:45:56 +02:00
Jukka Aho d59b32fed5 refactor(physics): replace Physics struct with trait-based category types
Replace monolithic Physics struct and boundary condition types with
simpler physics category types used for trait-based dispatch.

- Remove Physics struct (Formulation, Field, Mesh, Material coupling)
- Remove DirichletBC and NeumannBC boundary condition storage types
- Remove Constraint type
- Add Elasticity{Dim} and Thermal{Dim} physics category types
- Add required_field_type trait function for physics-to-field mapping
- Simplify to type tags for material trait dispatch
- Support compile-time field type inference from physics
- Align with new architecture: physics types are dispatch tags, not problem containers
2025-12-12 23:45:16 +02:00
Jukka Aho ddb00eda0c fix(physics): update deformation_gradient to use coords field
Update compute_deformation_gradient to use coords field instead of ξ
field from QuadraturePoint, matching the API change.
2025-12-12 23:44:48 +02:00
Jukka Aho 04b7eff2a2 refactor(materials): migrate PerfectPlasticity to compositional state design
Replace monolithic PlasticityState struct with compositional NamedTuple
state system and add new material trait system support.

- Remove PlasticityState struct (now using NamedTuple composition)
- Add supported_physics trait (Elasticity{3})
- Add required_state_variables trait (PlasticStrain, Backstress, EquivalentPlasticStrain)
- Change compute_stress to use NamedTuple for state_old and state_new
- Use get() with defaults for state extraction (handles empty initial state)
- Update state creation to use NamedTuple syntax (ε_p, α, κ)
- Remove state_type trait (replaced by required_state_variables)
2025-12-12 23:44:26 +02:00
Jukka Aho 6f0dd71d2e refactor(materials): update LinearElastic for new trait system and compositional state
Update LinearElastic to support new material trait system and
compositional state design with NamedTuple instead of Nothing.

- Add supported_physics trait (Elasticity{3})
- Add required_state_variables trait (empty tuple for stateless)
- Change state_old parameter to Union{Nothing,NamedTuple}
- Return NamedTuple() instead of nothing for state update
- Support compositional state system in compute_stress
2025-12-12 23:43:51 +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 fd4dc1cb28 fix(geometry): update jacobian docstring to use coords field
Update documentation example to use coords field instead of ξ field
from QuadraturePoint, matching the API change.
2025-12-12 23:41:34 +02:00
Jukka Aho 92b3df4526 feature(fields): add quantity_type trait and optimize get_dof_mapping!
Add quantity type extraction trait for field types and optimize DOF
mapping function for zero-allocation performance.

- Add quantity_type trait function for field types
- Implement quantity_type for Displacement, Temperature, DisplacementRotation
- Add @inline to get_dof_mapping! for better inlining
- Optimize get_dof_mapping! loop to use indexed access instead of iterator
- Avoid iterator allocation in DOF mapping computation
2025-12-12 23:41:16 +02:00
Jukka Aho 8f9f701b39 refactor(api): update main module file for DOF-based architecture
Update JuliaFEM.jl to reflect major architectural changes: DOF system,
material workspace API, and microkernel architecture.

- Add DOF system includes (dofs.jl, dof_manager.jl, dof_connectivity.jl)
- Add material state variables and traits includes
- Add GlobalMaterialCache API exports
- Add DOF-based assembler includes and exports
- Add microkernel and formulation exports (evaluate, field_type_for_dispatch)
- Update MaterialStateCache → AssemblyMaterialWorkspace exports
- Add LocalField and strain extraction exports
- Add element interpolation and DOF extraction includes
- Update readers → io directory includes
- Remove/comment legacy includes (boundary_conditions.jl, assemble_v2.jl, etc.)
- Add DOF system exports (DOFSet, @DOFSet, DOFManager, etc.)
- Add element accessor exports (element_id, element_dofs, field_dof_range)
- Update physics exports (Elasticity, Thermal, required_field_type)
- Add material state variable exports (PlasticStrain, Backstress, etc.)
- Comment out contact problems (uses old Element API)
- Update documentation comments for new architecture
2025-12-12 23:40:44 +02:00
Jukka Aho 4968acd069 refactor(elements): redesign Element type to Ciarlet's triple (K,P,Σ) with DOF-based API
Major architectural refactoring: replace old field-based element system
with modern DOF-based design following Ciarlet's finite element triple.

- Redesign Element from Element{N,NIP,F,B} to Element{K,P,S,N}
- Replace connectivity with dof_indices (flat tuple of global DOF indices)
- Remove all old field system (sfields, dfields, fields, update_field!, etc.)
- Remove old constructors and compatibility shims
- Add compile-time DOF computation via @generated ndofs(K, S)
- Add field_dof_range for compile-time local DOF range computation
- Add local_to_global_map for type-stable DOF mapping
- Add topology_type, basis_type, dof_type query functions
- Add element_id, element_dofs, n_element_dofs, nnodes accessors
- Remove 593 lines of legacy code (963 → 370 lines)
- Simplify API: elements now store DOF indices, not node connectivity
- Support multi-field elements via DOFSet specifications
- Zero-allocation design with compile-time type information
2025-12-12 23:40:15 +02:00
Jukka Aho 47f207bced refactor(domains): migrate update_material_cache! to AssemblyMaterialWorkspace and add GlobalMaterialCache API
Major refactoring: migrate material cache updates to new workspace API
and add support for GlobalMaterialCache alongside legacy API.

- Change all material_cache to material_workspace parameter names
- Remove M<:AbstractMaterialState type constraints from functions
- Change state handling from EmptyState() to NamedTuple()
- Change material_cache.σ/𝔻/states to material_workspace.fields/states
- Add new overloads for GlobalMaterialCache API (NEW API)
- Add zero-allocation optimizations using getfield and pre-allocated NamedTuples
- Add backward compatibility handling for legacy state types
- Update all function signatures and docstrings
- Add imports for GlobalMaterialCache and helper functions
- Add StatelessConstantTangent overload with pre-allocated NamedTuples
- Add StatelessStrainDependent and StatefulStrainDependent overloads for GlobalMaterialCache
- Keep legacy API overloads for Matrix{<:AbstractMaterialState}
2025-12-12 23:38:47 +02:00
Jukka Aho fb770644c4 refactor(domains): optimize update_geometry_cache! for zero-allocation
Optimize update_geometry_cache! to eliminate iterator allocations and
update to use coords field.

- Add @inline to update_geometry_cache! for better inlining
- Change enumerate loop to indexed loop to avoid iterator allocation
- Add @inbounds annotation for bounds-check elimination
- Change ip.ξ to ip.coords to use new QuadraturePoint API
2025-12-12 23:36:21 +02:00
Jukka Aho 00448c8c52 refactor(domains): optimize update_element_cache! for zero-allocation
Optimize update_element_cache! to eliminate iterator and view allocations.

- Add @inline to update_element_cache! for better inlining
- Change enumerate loop to indexed loop to avoid iterator allocation
- Add @inbounds annotations for bounds-check elimination
- Remove @view allocation by passing array directly to get_dof_mapping!
2025-12-12 23:35:56 +02:00
Jukka Aho 9b6e3a5803 fix(domains): use coords field instead of ξ in kinematics
Update kinematics to use coords field from QuadraturePoint instead
of deprecated ξ field.

- Change ip.ξ to ip.coords in compute_deformation_gradient
2025-12-12 23:35:26 +02:00
Jukka Aho ece0428a33 refactor(domains): add atomic stiffness computation and microkernel interface
Refactor continuum kernel to add atomic scalar computation and microkernel
interface while maintaining backward compatibility.

- Add compute_stiffness_value for atomic scalar K[k,l][α,β] computation
- Add compute_stiffness_block for D×D block building using atomic kernel
- Refactor compute_block_at_point to use compute_stiffness_block internally
- Add evaluate function for microkernel interface with field coupling dispatch
- Add basevec import for unit vector construction
- Add conditional imports for evaluate and get_tangent
- Update documentation to reflect new atomic operation structure
2025-12-12 23:34:58 +02:00
Jukka Aho 7a580e604d fix(backend): use coords field instead of ξ in CPU backend
Update CPU backend to use coords field from QuadraturePoint instead
of deprecated ξ field.

- Change ip.ξ to ip.coords in compute_element_stiffness
2025-12-12 23:33:47 +02:00
Jukka Aho bab3f6906c refactor(assemblers): replace MaterialStateCache with AssemblyMaterialWorkspace
Major refactoring: replace material state cache with compositional
workspace using NamedTuple fields for better flexibility and zero-allocation.

- Rename MaterialStateCache to AssemblyMaterialWorkspace
- Change from M<:AbstractMaterialState to FieldType, StateType parameters
- Use AoS pattern: fields::Vector{FieldType} instead of separate σ, 𝔻 vectors
- Add zero-allocation field access via @generated functions
- Add extract_tangent! for type-stable zero-allocation tangent extraction
- Add get_tangent_vector, get_stress_vector helper functions
- Add @field_vector macro for compile-time field access
- Add get_stress, get_tangent, get_field accessor functions
- Update reset! to use create_zero_field and create_zero_state
- Update create_material_cache to use trait system for type inference
- Add backward compatibility alias create_assembly_workspace
- Add extensive documentation for zero-allocation usage patterns
2025-12-12 23:31:35 +02:00
Jukka Aho 4385564778 refactor(assemblers): update kernel interface for new API and zero-allocation
Update kernel interface to use new material workspace API and improve
zero-allocation performance.

- Change ip.ξ to ip.coords in compute_element_stiffness!
- Add @inline to get_dof_mapping! for better inlining
- Optimize get_dof_mapping! to use indexed access instead of iteration
- Remove compute_node_contribution! function (unused)
- Update docstrings to use material_workspace instead of material_cache
- Update compute_all_blocks! example to use get_tangent_vector
- Add FIXME comment about removing B matrix computation functions
2025-12-12 23:30:57 +02:00
Jukka Aho 1f6ec9e7fe fix(assemblers): use coords field instead of ξ in geometry cache
Update geometry cache to use coords field from QuadraturePoint
instead of deprecated ξ field.

- Change ip.ξ to ip.coords in create_geometry_cache function
- Update both gradient computation and detJ*w computation
2025-12-12 23:30:00 +02:00