Commit Graph

3 Commits

Author SHA1 Message Date
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 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