Commit Graph

25 Commits

Author SHA1 Message Date
Jukka Aho d1716ab969 docs(physics): cross-link strain extraction helpers
Note that `extract_strain` consumes an existing displacement gradient, with
`compute_strain` covering the assembly path from nodal DOFs.
2026-05-09 18:15:45 +03:00
Jukka Aho 3ada6aa07d docs(physics): tidy Thermal tag docstring
Drop a duplicated example line and remove the commented-out Fluid placeholder
that suggested unfinished velocity dispatch.

- Clarify `Thermal{Dim}` wording; delete stale `Fluid{Dim}` sketch.
2026-05-09 18:15:35 +03:00
Jukka Aho 6a3c6754cb docs(physics): trim api.jl to assembler-era stubs
Replace the long `Physics{...}` narrative with short placeholders that explain
how `assemble!`/`solve!`/BC hooks are extended by assemblers or Legacy only.

- Document the kernel + assembler workflow as the active surface.
- Point Dirichlet/Neumann reservations at matrix-free BC and load value types.
- Keep generic function declarations for Legacy method attachment.
2026-05-09 18:15:34 +03:00
Jukka Aho ca9d61a700 docs(physics): refocus AbstractPhysics as a tag marker
Replace stale `Physics{...}` API docs with the actual 0.x role: a lightweight
trait root for `Elasticity`/`Thermal` tags and material dispatch, with legacy
`Physics` confined to `JuliaFEM.Legacy`.

- Shorten `AbstractPhysics` docstring and drop obsolete interface/examples.
2026-05-09 18:15:03 +03:00
Jukka Aho 60a72da1b2 chore(physics): delete legacy microkernel placeholders
Remove early microkernel scaffolding superseded by domain-local kernels.

- Drop `src/physics/microkernels.jl`.
2026-05-09 18:14:47 +03:00
Jukka Aho 0fbf08ef95 chore(physics): delete unused formulation trait stubs
Remove the superseded formulation tagging layer not included from `JuliaFEM.jl`.

- Drop `src/physics/formulations.jl`.
2026-05-09 18:14:40 +03:00
Jukka Aho 18c66a925b chore(physics): delete legacy elasticity Problem glue
Remove the unused elasticity orchestration module outside active includes.

- Drop `src/physics/elasticity.jl`.
2026-05-09 18:14:31 +03:00
Jukka Aho d66500d362 chore(physics): delete orphaned deformation gradient helpers
Remove duplicated kinematics helpers superseded by `materials/continuum_kinematics.jl`.

- Drop `src/physics/deformation_gradient.jl`.
2026-05-09 18:14:26 +03:00
Jukka Aho 2a3fc9499a chore(physics): remove Dict-based boundary condition bag
Delete the unused boundary-condition container/types file not pulled into the
package entry manifest.

- Drop `src/physics/boundary_conditions.jl`.
2026-05-09 18:14:19 +03:00
Jukka Aho ea1e6de8e9 chore(physics): delete unused assembly helper stubs
Remove legacy glue that lived outside the active `src/physics/` include list.

- Drop `src/physics/assembly_helpers.jl`.
2026-05-09 18:12:50 +03:00
Jukka Aho fd51534b6b feat(physics): add helper utilities for multi-field microkernel assembly
New 88-line formulation utilities:
- field_type_for_dispatch(): extract field type from Element's S parameter
- Helper functions for multi-field Element{K,P,S} system
- Works with NamedTuple-based field specifications
- Supports thermoelasticity and other multi-physics couplings
- Already integrated in JuliaFEM.jl (line 500)

Provides utilities for multi-field microkernel assembly with Element{K,P,S} system.
2025-12-15 06:18:44 +02:00
Jukka Aho 72b10c937b feat(physics): add microkernel interface for DOF-based assembly
New 83-line microkernel interface:
- evaluate(): compute single scalar contribution to K[i,j] at integration point
- Matrix-free assembly support for DOF-based assemblers
- Multi-physics coupling via type dispatch
- Zero-allocation assembly with precomputed caches
- Default implementation returns 0.0 (no coupling)
- Already integrated in JuliaFEM.jl (line 499)

Provides microkernel architecture for efficient matrix-free assembly.
2025-12-15 06:18:38 +02:00
Jukka Aho 4a47610d3f feat(physics): add strain extraction from displacement gradients
New 60-line strain extraction system:
- extract_strain(): extract strain tensor from displacement gradient
- extract_strain_rate(): extract strain rate from velocity gradient
- extract_strain_2d(): 2D version
- Uses symmetric() to compute symmetric part of gradient
- Already integrated in JuliaFEM.jl (line 186)

Provides strain computation for continuum mechanics formulations.
2025-12-15 06:18:18 +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 ae9e7e3727 feat(physics): Implement boundary condition methods
- Implement add_dirichlet! for essential BCs (prescribed values)
- Implement add_neumann! for natural BCs (forces/tractions)
- Support multiple nodes and DOF components in single call
- Store BCs in physics.bc_dirichlet and physics.bc_neumann
- Add usage examples for common BC patterns
- 86 lines with complete method implementations
2025-11-18 16:08:35 +02:00
Jukka Aho 90d9f52bf6 refactor(physics): Implement Physics struct with 4 type parameters
- Define Physics{Formulation, Field, Mesh, Material} <: AbstractPhysics
- Implement type parameter validation in inner constructor
- Add DirichletBC for essential boundary conditions
- Add NeumannBC for natural boundary conditions
- Add Constraint placeholder for future constraint handling
- Provide keyword constructor with automatic type inference
- Document dispatch-optimized type parameter order
- 205 lines including comprehensive docstrings
2025-11-18 16:08:35 +02:00
Jukka Aho 8479b06cac refactor(physics): Define clean Physics API interface
- Remove duplicate AbstractPhysics definition (now in abstract.jl)
- Define interface functions: assemble!, solve!, add_dirichlet!, add_neumann!
- Document dispatch strategies for formulation × field combinations
- Add implementation method documentation (elimination, penalty, Lagrange)
- Include comprehensive usage examples for each interface function
- Specify must-include-after dependencies in header comments
- 246 lines of interface documentation
2025-11-18 16:08:35 +02:00
Jukka Aho 6243e4fe1e refactor(physics): Create consolidated AbstractPhysics definition
- Define AbstractPhysics abstract type in dedicated file
- Consolidate documentation from previous duplicate definitions
- Document type as coupling of Mesh, Material, Field, and Formulation
- Add comprehensive examples for 3D solid, heat, and beam physics
- Include multiphysics pattern documentation
- Remove duplicate AbstractPhysics definitions across codebase
- 109 lines of documentation and abstract type definition
2025-11-18 16:08:35 +02:00
Jukka Aho 468c786926 docs(physics): Fix fenced code block formatting and escape interpolation in examples
- Replace language-tagged code fences and add proper blank lines to satisfy Markdown lint rules
- Escape `$` in example error string to avoid accidental interpolation (`error("No assembly method for formulation \$Fm with field \$F")`)

Formatting-only changes to improve generated documentation and prevent lint failures; no runtime behavior altered.
2025-11-18 15:09:46 +02:00
Jukka Aho 000dee3994 feat(physics): Add physics coupling API with multiphysics support
Create src/physics/api.jl defining physics problem abstractions:
- AbstractPhysics base type for all physics problems
- assemble!() interface for building global system (K, f)
- solve!() interface for solving physics problems
- add_dirichlet!() for essential BCs (prescribed displacements/temperatures)
- add_neumann!() for natural BCs (surface tractions/heat flux)

Physics couples four components: Mesh (where), Material (constitutive law),
Field (what we solve), Formulation (how we discretize). Physics references
Mesh (does not own it) enabling multiphysics: multiple Physics can share
one Mesh for memory efficiency and coupling.

Dispatch specialization via formulation × field type parameters:
  assemble!(::Physics{ContinuumFormulation{FullThreeD}, Displacement{3}, M, Mat})
  assemble!(::Physics{BeamFormulation{Timoshenko}, DisplacementRotation{3}, M, Mat})

Comprehensive documentation with multiphysics examples, dispatch patterns,
and interface contracts. Assembly implementations in src/assembly/.

Part of systematic modular API architecture.
2025-11-15 18:42:03 +02:00
Jukka Aho 84a1bfec4e feat(physics): Add ElasticityPhysics type with geometric/material nonlinearity
New file src/physics/elasticity.jl:
- ElasticityPhysics struct implementing AbstractPhysics interface
- Formulations: plane_stress, plane_strain, continuum (3D)
- finite_strain flag for Green-Lagrange strain (geometric nonlinearity)
- geometric_stiffness flag for buckling analysis
- Field storage control: store_fields (converged), store_iteration_fields (debug)
- Interface methods: get_unknown_field_name, get_formulation_type, get_unknown_field_dimension
- should_store_field() for selective field storage
- 205 lines with comprehensive documentation and GPU design notes
2025-11-12 00:56:58 +02:00
Jukka Aho 628b902bf5 feat(physics): Add deformation gradient computation with strain formulations
New file src/physics/deformation_gradient.jl:
- compute_deformation_gradient() computes F = I + ∇u at integration points
- StrainFormulation types: FiniteStrain() and SmallStrain()
- Uses Tensors.jl for all tensor operations (Vec, Tensor)
- Zero-allocation design with @inline functions
- GPU-ready immutable operations
- Comprehensive mathematical documentation with references
- 243 lines including commented high-level API for future integration
2025-11-12 00:56:40 +02:00
Jukka Aho 258017922e feat(physics): Add assembly helper functions with Tensors.jl
New file src/physics/assembly_helpers.jl with FEM assembly utilities:
- shape_function_gradients() computes ∇N in current configuration
- compute_strain_from_gradients() small strain ε = sym(∇u)
- compute_green_lagrange_strain() finite strain E = ½(C-I)
- accumulate_stiffness!() adds element stiffness contributions
- accumulate_internal_forces!() computes f_int = ∫σ·∇N dV
- accumulate_external_forces!() computes f_ext = ∫N·b dV
- Zero-allocation design with Tensors.jl Vec and SymmetricTensor
- 331 lines with comprehensive performance documentation
2025-11-12 00:56:19 +02:00
Jukka Aho 4440f86691 feat(physics): Add AbstractPhysics base type and interface
New file src/physics/abstract.jl defining physics system architecture:
- AbstractPhysics base type for all physics implementations
- get_unknown_field_name() returns primary field (displacement, temperature, etc.)
- get_formulation_type() returns :incremental, :total, or :rate
- get_unknown_field_dimension() returns DOFs per node
- assemble!() dispatch point for physics-specific assembly
- Comprehensive docstrings covering multi-physics coupling and GPU compatibility
- 138 lines documenting design philosophy and future extension
2025-11-12 00:56:05 +02:00