Commit Graph

1832 Commits

Author SHA1 Message Date
Jukka Aho b25e121ab2 feat(juliafem): add centralized exports.jl for public API names
Introduce a single grouped export table consumed by `JuliaFEM.jl`, covering
topology through solvers without embedding exports beside implementations.

- Topology through quadrature, geometry Piola helpers, and basis/Nédélec–RT0 refs.
- Formulation tags, abstract fields, DOF macros/layout/interpolation, handlers,
  connectivity, and mesh constructors.
- Materials, sparse helpers, assemblers (including matrix-free operators), physics
  traits, domain kernels (continuum/heat/darcy/thermoelastic/mixed), and MPI hooks.
- Notes verification hook via `names(JuliaFEM)` in module comments.
2026-05-09 16:57:22 +03:00
Jukka Aho 7d6ef2e560 feat(domains): add ThermoElasticKernel for coupled u–T assembly
Provide multi-field small-strain thermoelasticity with cross blocks between
displacement and temperature using shared geometry SoA caches.

- Dispatch `evaluate_entry` on `field_idx` pairs for `K_uu`, `K_TT`, `K_uT`, `K_Tu`.
- Coupling strength `β` toggles thermal-mechanical interaction; documents additive strain split.
2026-05-09 16:56:53 +03:00
Jukka Aho 12ee626a00 feat(domains): add Hex8 RT0–P0 mixed Darcy kernel
Mirror Tet4 mixed Darcy on structured hexes using Piola push-forward of
`rt0_hex8_reference_basis` and tensor-product Gauss quadrature.
2026-05-09 16:56:44 +03:00
Jukka Aho 350818aa80 feat(domains): add Tet4 RT0–P0 mixed Darcy kernel
Implement lowest-order H(div) flux on faces with cell pressure, Piola-mapped RT0
basis, inverse conductivity mass block, and ±1 divergence coupling.

- Document BC posture (pressure gauge, facet flux DOFs, boundary load helpers).
- Provide `evaluate_entry` / mass hooks plus auxiliary types for mixed Darcy assembly tests.
2026-05-09 16:55:43 +03:00
Jukka Aho f8aecb1675 feat(domains): add HeatKernel for scalar diffusion and optional thermal mass
Implement second concrete `AbstractKernel` sharing the DOF-based microkernel
contract with conductivity-focused buffers.

- Support `HeatConductivity`, `MoistureDiffusivity`, `HydraulicConductivity`, and
  `ElementWiseScalarDiffusion` pairings with temperature/moisture/pressure fields.
- Cache symmetric second-order tensors per IP; `evaluate_entry` contracts gradients
  without displacement-style `(α,β)` branching.
- Add optional `heat_capacity` for consistent thermal mass (`evaluate_mass_entry`)
  with zero-cost skip when unset.
- Provide typed constructors that forbid transient flags on steady hydraulic/moisture paths.
2026-05-09 16:55:28 +03:00
Jukka Aho bb2fba4c5f feat(domains): add DarcyPotentialKernel wrapping HeatKernel
Expose steady primal Darcy head formulation as thermal diffusion with
`HydraulicConductivity` and `PressurePotential` fields on shared assembler paths.
2026-05-09 16:55:08 +03:00
Jukka Aho 264c4d5a23 feat(domains): add StokesMixedKernel for creeping Newtonian flow
Provide velocity–pressure mixed kernel with constant viscous tangent `2μ 𝕀^sym`
and MixedUP-compatible divergence / compressibility blocks.

- Mirrors `MixedUPKernel` layout (`Displacement{3}` + cell pressure).
- Documents gauge pinning and reuse of `default_pressure_gauge_dof`.
2026-05-09 16:52:59 +03:00
Jukka Aho 8c7cd9b308 feat(domains): add MixedUPKernel for u–p elasticity saddle
Implement vertex displacement + cell pressure coupling with optional bulk
compressibility and indefinite-operator guidance for Krylov usage.

- Weak form matches standard dilatation coupling with `inv_bulk = 1/κ`.
- `evaluate_entry` switches on `field_idx` pairs; shares material tangent path with
  continuum kernels for the displacement block.
2026-05-09 16:52:53 +03:00
Jukka Aho 8b5aa491eb feat(domains): add Hex8 material coupon lab helpers
Provide reusable single-brick mesh factory, symmetry BC constructors, and a
minimal linear-elastic uniaxial solve helper for material calibration tests.

- Builds structured `Hex8` lab meshes via `create_structured_box_mesh`.
- Merges Dirichlet dictionaries safely and documents default Gauss usage.
2026-05-09 16:52:48 +03:00
Jukka Aho 6dc8256843 feat(domains): add Hu–Washizu three-field elasticity kernel
Add mixed kernel with vertex displacement plus cell-wise strain and stress
unknowns (`eps`, `sig`) for linear `LinearElastic` materials.

- Document discrete block structure (`K_uσ`, `K_εε`, `K_εσ`, …) with Voigt units
  matching HR conventions.
- Implement microkernel dispatch across field indices with constant `M`/`G`
  matrices precomputed from `C`.
2026-05-09 16:52:43 +03:00
Jukka Aho c46bfbcc9c feat(domains): add Hellinger–Reissner mixed elasticity kernel
Implement HR saddle (`u` vertex + piecewise-constant symmetric stress on Cell)
for small-strain `LinearElastic` materials.

- Encode Voigt unit tensors aligned with `local_dof_layout` components and build
  the 6×6 discrete compliance `G M⁻¹ G` once from `C⁻¹`.
- Provide assembler microkernel hooks (`evaluate_entry`, buffer traits,
  `reference_fields`) with symmetric indefinite operator semantics documented in-module.
2026-05-09 16:52:30 +03:00
Jukka Aho 01e497d5f8 feat(domains): add FacetMassKernel for Face DOF smoke assembly
Provide facet-diagonal kernel allocating area/patch contributions per Face unknown
to exercise DOFHandler face numbering and extended evaluate_entry(elem_id).

- Cover Hex8/Hex20/Tet4/Tet10/Wedge6/Pyr5 with physical face area helpers.
- Wire microkernel buffer traits and mass/stiffness evaluators for assembler tests.
2026-05-09 16:52:07 +03:00
Jukka Aho 617a8441d1 feat(domains): add EdgeMassKernel for facet-map edge DOFs
Introduce diagnostic kernel assembling diagonal edge mass proportional to
physical edge length divided patch multiplicity.

- Dispatch `AbstractKernel` microkernel hooks for Edge-owned fields on Hex8/Hex20/
  Tet4/Tet10/Wedge6/Pyr5 meshes using existing facet map builders.
- Implement `evaluate_entry` / `evaluate_mass_entry` paths plus trivial reference
  buffers for assembler compatibility.
2026-05-09 16:51:55 +03:00
Jukka Aho 503619cb44 docs(domains): add README overview for physics kernels
Summarize continuum/heat/darcy/thermo_elastic kernels with pointers to AGENTS,
extension contract, tests, and thermo-elastic walkthrough.
2026-05-09 16:51:26 +03:00
Jukka Aho f8bcd8605c refactor(domains): streamline continuum update_material_cache dispatch
Collapse duplicated trait implementations and route everything through the
`GlobalMaterialCache` overload plus explicit material-behavior methods.

- Drop standalone `ElementCache`/`AbstractGeometryCache` copies of constant /
  strain-dependent / stateful updaters; rely on `material_behavior` forwarding.
- Import `continuum_kinematics`, `SmallStrainKinematics`, and `GreenLagrangeKinematics`
  so stateful updates choose ε versus E via traits instead of ad hoc branches.
- Trim verbose CRITICAL/FIXME commentary while keeping `getfield` guidance for
  type-stable workspace access.
- Remove legacy dispatcher taking `Matrix{<:AbstractMaterialState}` state buffers.
- Minor formatting (trailing commas) and docstring refresh on the cache entry.
2026-05-09 16:51:08 +03:00
Jukka Aho d428686658 refactor(domains): refresh continuum geometry cache fill for shape functions
Align `update_geometry_cache!` with element caches that carry continuum-specific
data and surface scalar basis values needed for mass kernels.

- Remove unused `kernel::AbstractKernel` parameter and narrow `element_cache` to
  `ContinuumElementCache`.
- Evaluate `get_basis_functions` each IP, storing `N_data` beside `∇N_data`.
- Rewrite docstring around concrete fields (`X`, `N_data`, `∇N_data`, `detJ_w`)
  and zero-allocation guarantees.
2026-05-09 16:50:49 +03:00
Jukka Aho 281e5e5116 docs(domains): shorten continuum theory and formulation docstrings
Replace outdated Physics/assembly prose with kernel-centric descriptions tied to
`ContinuumKernel`, `HeatKernel`, and the assembler microkernel stack.

- Compress FullThreeD / Axisymmetric narratives and drop stale multi-domain
  `Physics(...)` examples.
- Document `ContinuumFormulation{Theory}` as the tag carried by kernels and
  point readers at `abstract.jl` / `microkernel.jl` instead of removed assembly paths.
2026-05-09 16:50:30 +03:00
Jukka Aho 8c285171ea feat(domains): extend ContinuumKernel for mass matrix and assembler microkernels
Wire continuum solids into the shared DOF-based microkernel contract while
keeping element-based assembly helpers explicit and GPU-friendly.

- Add `density::Float64` on `ContinuumKernel` (default `0`) so static-only
  callers skip mass work; constructors accept keyword `density` or infer
  `Displacement{3}` when omitted.
- Generalize `compute_stiffness_value` to `AbstractFloat`/`Tensor{4,D,F}` and
  typed `basevec`; add `SymmetricTensor{4,D,F}` overload using symmetric `B`
  operators to avoid `Tensor{4}(::SymmetricTensor)` string branches for Metal.
- Replace legacy `evaluate(...)` wrapper with `compute_block!` integrating one
  element-local block over IPs for the element-based COO path.
- Implement microkernel hooks: `qpoint_buffer_eltype`, `reference_fields`,
  `update_qpoint_buffer!`, `evaluate_entry` (DOF-layout aware, uses symmetric `𝔻`),
  and `evaluate_mass_entry` (consistent mass, component-orthogonal, ρ-gated).
- Import assembler-facing symbols explicitly from `JuliaFEM`; drop brittle
  `Main` introspection for `evaluate`/`get_tangent`.
- Refresh module banner and docstrings (density docs, reduced bold noise).
2026-05-09 16:50:14 +03:00
Jukka Aho 91ac4fd458 docs(domains): tone continuum abstract docstrings for removed files
Strip decorative markdown emphasis, drop Kirchhoff plate pointer, and remove
See-Also links to deleted formulations.jl / missing design doc paths.
2026-05-09 16:49:49 +03:00
Jukka Aho 5652282a8d refactor(domains): remove continuum/kinematics.jl helpers
Delete legacy kinematics routines relocated under geometry/materials pipelines.
2026-05-09 16:49:25 +03:00
Jukka Aho 333b190175 refactor(domains): remove continuum/formulations.jl definitions
Drop standalone formulation trait file folded intophysics/types or kernel dispatch.
2026-05-09 16:49:21 +03:00
Jukka Aho 20256eec01 refactor(domains): remove trusses/api.jl stub
Drop unused truss API placeholder pending structured truss kernels.
2026-05-09 16:49:10 +03:00
Jukka Aho 0041844e39 refactor(domains): remove shells/api.jl stub
Remove placeholder shell domain exports until a shell kernel lands.
2026-05-09 16:49:06 +03:00
Jukka Aho 6aabc33bbc refactor(domains): remove plates/dkt_basis.jl module
Delete legacy DKT basis helpers consolidated under basis/domains layout.
2026-05-09 16:49:04 +03:00
Jukka Aho b9c79fd0fd refactor(domains): remove legacy plates/dkt.jl implementation
Drop outdated DKT assembly file superseded by reorganized plate basis work.
2026-05-09 16:49:00 +03:00
Jukka Aho acd09f0099 refactor(domains): remove plates/api.jl stub ahead of plate kernel rework
Remove empty plate API entrypoint; DKT/basis material lives elsewhere now.
2026-05-09 16:48:51 +03:00
Jukka Aho 987761677d refactor(domains): remove unused common/boundary_conditions.jl stub
Delete placeholder boundary-condition helpers superseded by physics/assembler paths.
2026-05-09 16:48:47 +03:00
Jukka Aho 508985d4c5 refactor(domains): remove stub beams/api.jl placeholder
Drop unused beam domain API shell pending a real beam kernel module.
2026-05-09 16:48:42 +03:00
Jukka Aho ec600459a9 refactor(dofs): align fields.jl docs and counting with DOF{Q,E} templates
Bring module prose in line with flat `dof_indices`, `@DOFSet`, and DOFHandler-era
helpers while tightening compile-time DOF arithmetic.

- Refresh docstrings: drop markdown bold noise; document `element_dofs` /
  `field_dof_range` instead of NamedTuple-shaped `dof_indices` accessors.
- Rewrite examples to prefer `@DOFSet`; spell out NamedTuple equivalence and drop
  Tuple-based migration snippets incompatible with DOFHandler.
- Implement `field_ndofs(::Type{<:DOF}, Topo)` / `ndofs(::DOFSet, Topo)` using
  `quantity_type` / `entity_type` and generator-style sums over `fieldtypes(S)`.
- Extend `quantity_type(::Type{<:DOF})` for raw `Float64`, `Vec`, `Tensor`, and
  `SymmetricTensor` fields alongside `AbstractField` wrappers.
- Allow `field_ndofs` on raw-quantity DOFs by sizing `T` directly (pressure on
  cells/faces, etc.).
- Remove `single_field` compatibility helper and duplicate element accessors now
  canonical in `src/elements/elements.jl`.
- Point LICENSE header at LICENSE.md.
2026-05-09 16:48:26 +03:00
Jukka Aho bea37f797e test(dofs): remove misplaced extraction test under src/dofs/test
Delete stray test file from src tree; extraction belongs under test/dofs/.
2026-05-09 16:48:00 +03:00
Jukka Aho fe4fff86f0 refactor(dofs): remove unused mixed.jl placeholder module
Drop stale mixed-field scaffold superseded by @DOFSet multifield specs.
2026-05-09 16:47:53 +03:00
Jukka Aho 77fd030124 test(dofs): remove legacy simple_usage script from src/dofs/examples
Delete obsolete usage demo kept next to removed DOFManager workflows.
2026-05-09 16:47:43 +03:00
Jukka Aho 15c8af87bb test(dofs): remove generated_vs_manual_comparison example under src
Drop unmaintained benchmark-style script from src/dofs/examples; coverage lives
in test/dofs instead.
2026-05-09 16:47:30 +03:00
Jukka Aho efde9de197 refactor(dofs): remove entity_dofs convenience aliases
Drop ScalarDOF/VectorDOF/TensorDOF aliases and canned Lagrange-* constants that
duplicated patterns now expressed via `DOF{Q,E}` and `@DOFSet`.

- Eliminates Vec{1}-based scalar alias layering in favor of explicit quantities.
- Removes unused LagrangeHeat/LagrangeElasticity shorthand blocks tied to old tutorials.
2026-05-09 16:46:29 +03:00
Jukka Aho 8c1bb79659 docs(dofs): point module banner at dof_handler include path
Use LICENSE.md URL, drop decorative bold in prose, and rename the JuliaFEM.jl
late-include comment from dof_manager to dof_handler.
2026-05-09 16:45:51 +03:00
Jukka Aho ccffc984b5 refactor(dofs): remove Dict-based dof_manager.jl
Delete the legacy global numbering implementation that stored DOFs in Dicts and
registered Tuple-shaped field specs at runtime.

- Remove `mutable struct DOFManager` with `node_to_dofs`, `field_specs`, mesh
  reference, and incremental `next_dof` counters at odds with type-stable layouts.
- Drop `register_fields!`, `allocate_dofs!`, `count_field_dofs`, mesh-local
  entity counters, and `_assign_element_dofs!` variants tied to that storage.
- Remove `create_elements!` / `_build_dof_connectivity` definitions superseded by
  `dof_handler.jl` (`DOFHandler`, `_make_element_dofs`, `build_dof_connectivity`).
- Element-set helpers and BC-oriented accessors live on `DOFHandler` now; the
  `DOFManager` identifier remains only as the backward-compatible alias.
2026-05-09 16:45:32 +03:00
Jukka Aho 9341b70cd9 docs(agents): tie commit bullet guidance to patch size
Clarify that optional bullets become substantive grouped lists when the diff
is large or spans several concerns.

- Adjust the workflow-rules bullet that describes Conventional Commit bodies.
2026-05-09 16:45:00 +03:00
Jukka Aho d711cab0d3 docs(contributing): note scaled commit message bodies
Explain next to the one-file workflow that message depth should follow patch
size—grouped bullets on large or multi-concern commits.

- Adds one bullet under coding rules pointing readers at `.github/prompts/commit.prompt.md`.
2026-05-09 16:44:46 +03:00
Jukka Aho 0182fc7566 docs(git): add tracked AI commit workflow prompt
Introduce `.github/prompts/commit.prompt.md` as the contributor-facing description
of how assistants should stage, review, propose, and record commits.

- Document defaults: one file per commit, rare justified pairs, no blanket `git add`.
- Describe optional `.githooks/pre-commit` cap at two staged paths.
- Require reading the full `git diff --staged` (no truncation) before messaging.
- Spell out approval-before-commit flow and Conventional Commits subject lines.
- Scale the body to the patch: short summaries for small edits; large or
  multi-concern diffs need grouped, substantive bullets so history stays readable.
- Keep checklist items aligned with that depth expectation.
2026-05-09 16:44:31 +03:00
Jukka Aho 3af1067aeb feat(dofs): add type-stable DOFHandler implementation
Introduce `DOFHandler{M,S,NF}` with flat `field_starts::NTuple{NF,Vector{Int}}`
per field and entity id, optional `facet_maps` for Edge/Face unknowns, running
`total_dofs`, and a `dof_connectivity` slot populated after element creation.
Reserve `DOFManager` as a backward-compatible alias.

Construction and layout:

- Number DOFs in field-declaration order; within each field walk entities in id
  order (nodes, cells, or facet ids) using compile-time `dof_size` widths.
- Auto-build `AbstractFacetConnectivityMaps` for Hex8/Hex20/Tet4/Tet10/Wedge6/Pyr5
  when the DOFSet references Edge or Face; error on unsupported mesh/topology pairs.

Mixed-field helpers:

- `global_field_ranges` — contiguous global index ranges per declared field,
  checked against `handler.total_dofs`.
- `global_facet_dof` — first global DOF for a Face-owned field given facet gid.
- `saddle_point_blocks` / `saddle_point_matrix_blocks` — named views or CSC
  subblocks for two-field `u`/`p`-style matrices using those ranges.

Hot path:

- `@generated _make_element_dofs` emits an `NTuple{N,UInt64}` from handler tables:
  Vertex via element connectivity, Cell via element id, Edge/Face via
  `elem_edge_gid` / `elem_face_gid`; assert emitted length matches `N`.
- `create_elements!` builds the handler, fills `Vector{Element{K,P,S,N}}`, assigns
  DOFs with `_make_element_dofs`, then replaces `handler.dof_connectivity` via
  `build_dof_connectivity`. Support `Element{K,P,S}` with inferred `N`, and wrap a
  bare single `DOF{Q,E}` into a one-field DOFSet.

Legacy-oriented utilities:

- `get_node_dofs` collects Vertex-field DOFs for one node (allocating helper).
- `get_element_ids` resolves ids from `mesh.element_sets` by name or symbol.
2026-05-09 16:42:13 +03:00
Jukka Aho 2afd7a856a refactor(dofs): slim dof_connectivity.jl to builders + DOFHandler overload
Move struct definitions to dof_connectivity_types.jl; drop GPU matrix layout;
use DOFHandler in docs and convenience build_dof_connectivity overload.
2026-05-09 16:35:59 +03:00
Jukka Aho 0f1a1f2f4c feat(dofs): split DOF connectivity structs into dof_connectivity_types.jl
Add DOFElementConnection/DOFConnectivity definitions and empty-placeholder ctor
for handlers before create_elements!.
2026-05-09 16:35:44 +03:00
Jukka Aho 3a1c931021 docs(dofs): remove stale performance_analysis markdown
Drop superseded DOF extraction benchmark narrative from src/dofs/docs.
2026-05-09 16:34:36 +03:00
Jukka Aho f56c9f2d11 docs(dofs): refresh api.jl DOF docstrings for @DOFSet
Align module docs with flat dof_indices, LICENSE.md link, and NamedTuple caveat.
2026-05-09 16:34:16 +03:00
Jukka Aho ef38a28fb2 docs(dofs): rewrite README for DOFHandler and matrix-free connectivity
Replace outdated DOFManager/@Fields prose with current files, create_elements!,
facet-DOF notes, and assembler pointers.
2026-05-09 16:34:03 +03:00
Jukka Aho abd21331c9 docs(basis): fix LICENSE URL in vandermonde.jl header 2026-05-09 16:33:46 +03:00
Jukka Aho a43ae90891 docs(basis): fix LICENSE URL in subs.jl header 2026-05-09 16:33:39 +03:00
Jukka Aho c9d806a946 feat(basis): add reference RT0 vector fields for Tet4 and Hex8
Add Whitney-type tet face basis and hex tensor-product face constants for Piola push-forward.
2026-05-09 16:33:27 +03:00
Jukka Aho 852ee67f79 refactor(basis): remove legacy plate_elements DKT basis module
Delete AbstractPlateBasis/DKT definitions from basis/; plate handling moves elsewhere.
2026-05-09 16:33:16 +03:00
Jukka Aho 29a01c1156 refactor(basis): remove NSurf NURBS surface basis
Drop unmaintained tensor-product surface NURBS tied to removed NURBS helpers.
2026-05-09 16:33:05 +03:00