Commit Graph

9 Commits

Author SHA1 Message Date
Jukka Aho 67d367920f docs(fields): plain headings in LocalField docstring
Replace bold markdown labels on the dynamic vs quasi-static bullet sections
with plain prose headings so field docs match the repository style guide.
2026-05-09 17:08:23 +03:00
Jukka Aho 5aa529473d chore(fields): drop FEMBase-style container fields module
Remove the old Dict-/tuple-backed field structs and helpers that lived next
to the modern quantity tags; they duplicated legacy FEMBase concepts and are
not part of the type-stable 0.x surface.

- Delete `DCTI`, `DVTI`, `DCTV`, `DVTV`, `CVTV`, `DVTId`, `DVTVd`, and the
  `field` / `interpolate`/`new_field` factories carried in this file.
- Drop `AbstractField` value/container overloads (`length`, `getindex`,
  `update_field!`, …) that assumed a `.data` payload on every subtype.
- Keep `AbstractField` definitions and docs in `fields/api.jl`; legacy
  variants remain behind `Legacy` where needed (`dcti_dvti_fields.jl`).
2026-05-09 17:08:03 +03:00
Jukka Aho 8064e86737 feat(fields): expand AbstractField tags and documentation
Extend the field vocabulary with diffusion/Darcy/mixed facet tags while
making `dofs_per_node` / `quantity_type` expectations explicit and dropping
legacy `Physics(...)` snippets.

- Clarify `dofs_per_node` as components per primary entity (historical name)
  and document `quantity_type` as part of the `AbstractField` contract.
- Add `MoistureContent`, `PressurePotential`, `RT0FaceFlux`, and `Nedelec1Edge`
  with matching `dofs_per_node` / `quantity_type` hooks.
- Point concrete usage at active kernels and grouped tests; note beam/shell
  tags as not wired in the default 0.x build.
- Prefer plain prose over bold emphasis in nearby docstrings.
2026-05-09 17:07:14 +03:00
Jukka Aho 3259d037be feat(fields): add LocalField structure for material evaluation
New 62-line LocalField structure:
- LocalField{T,G,R,GR}: field quantities at a point (value, gradient, rate, gradient_rate)
- Unified dynamic and quasi-static treatment (quasi-static: rate=0)
- Supports field values, spatial gradients, time derivatives, gradient rates
- Used for material evaluation at integration points
- Already integrated in JuliaFEM.jl (line 141)

Provides comprehensive field data structure for material constitutive evaluation.
2025-12-15 06:17:25 +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 9eb8634ed9 refactor(fields): Remove duplicate AbstractField definition
Replace abstract type definition with comment pointing to canonical definition in fields/api.jl.

Eliminates documentation replacement warning while keeping single source of truth for AbstractField supertype.
2025-11-20 18:22:59 +02:00
Jukka Aho 3227484aef feat(fields): Add DOF mapping and field extraction functions
New functions:
- get_dof_mapping!(dofs, node_ids, field) - maps nodes to global DOFs
- get_field(field) - returns field object from various inputs

Features:
- Handles 1D, 2D, 3D displacement fields
- Supports temperature fields
- Validates node IDs are positive integers
- Added @inline for performance (called per element)

These functions support the new cache update architecture.
2025-11-20 16:56:36 +02:00
Jukka Aho e9b039509c feat(fields): Add field variable API with Displacement, Temperature, and DisplacementRotation
Create src/fields/api.jl defining field-specific abstractions:
- AbstractField base type for all field variables
- Displacement{Dim} for solid mechanics (Dim DOFs per node: ux, uy, uz)
- Temperature for heat transfer (1 DOF per node: T)
- DisplacementRotation{Dim} for beams/shells (2*Dim DOFs: displacement + rotation)
- dofs_per_node() interface for DOF counting

Field type determines solution vector structure, boundary condition
interpretation, and assembly dispatch. Examples:
- Displacement{3} with ContinuumFormulation{FullThreeD} → 3D elasticity
- Temperature with ContinuumFormulation{FullThreeD} → heat transfer
- DisplacementRotation{3} with BeamFormulation → 6 DOFs (3 trans + 3 rot)

Part of systematic modular API architecture.
2025-11-15 18:40:05 +02:00
Jukka Aho 73ec910589 feat: Consolidate FEMBase.jl into JuliaFEM (Phase 1 complete)
MAJOR MILESTONE: FEMBase + FEMBasis fully consolidated, JuliaFEM loads!

Consolidated files:
- src/elements/ (3 files): elements.jl, elements_lagrange.jl, integrate.jl
- src/fields/ (1 file): fields.jl (DCTI, DVTI, DCTV, DVTV, etc.)
- src/sparse/ (1 file): sparse.jl (SparseMatrixCOO, SparseVectorCOO)
- src/assembly/ (2 files): problems.jl, assembly.jl
- src/solvers/ (1 file): solvers_base.jl
- src/analysis.jl, src/core_types.jl (Node, IP, IntegrationPoint)

Changes to JuliaFEM.jl:
- Added dependencies: Tensors, Calculus
- Removed @reexport using FEMBase (now consolidated)
- Added 20+ include statements for consolidated files
- Include order: fields → core_types → fembase_compat → sparse → elements

Compatibility layer:
- Created fembase_compat.jl: Minimal FEMBase submodule for vendor packages
- Temporarily disabled vendor-specific Mortar2D functions in solvers_modal.jl

Bug fixes:
- Changed i == 1 → isequal(i, 1) in integrate.jl (== operator overridden by fields)
- Resolved all FEMBasis. namespace references throughout codebase

Result:
-  JuliaFEM loads successfully on Julia 1.12.1
-  134 exported symbols (was 171 with separate FEMBase)
-  Core types accessible: Seg2, Quad4, Problem, AbstractProblem, etc.
- ⚠️  Vendor packages show FEMBase cache warnings (expected, harmless)

TODO:
- Re-enable Mortar2D functions after vendor consolidation
- Field system == operator override needs redesign (Phase 4)
- Continue Phase 2: Consolidate remaining vendor packages
2025-11-08 09:39:16 +02:00