Commit Graph

55 Commits

Author SHA1 Message Date
Jukka Aho 086bc061d0 docs(topology): add module README for reference shapes
Outline topology types, aliases, and downstream consumers (`Mesh`, basis).

- Provide quick navigation for contributors touching shape definitions.
2026-05-09 18:36:33 +03:00
Jukka Aho 2be9f43bb4 refactor(topology): dedupe Wedge nnodes and exports
Apply the same `AbstractTopology{N}` node-count consolidation and LICENSE URL
fix as other volumetric topologies.

- Drop redundant `nnodes`/`export` lines from `wedges.jl`.
2026-05-09 18:22:50 +03:00
Jukka Aho 7098f78b07 refactor(topology): dedupe Triangle nnodes and exports
Remove the redundant `nnodes(::Triangle{N})` overload and duplicate `Tri*`
exports now handled centrally.

- Keep triangle geometry definitions unchanged aside from cleanup.
2026-05-09 18:22:45 +03:00
Jukka Aho d247e330a3 refactor(topology): dedupe Tetrahedron nnodes and exports
Centralize `nnodes` on `AbstractTopology{N}`, fix LICENSE URL, and trim exports
already declared in `exports.jl`.

- Drop redundant `nnodes`/`export` lines from `tetrahedra.jl`.
2026-05-09 18:22:34 +03:00
Jukka Aho 30e405ecba refactor(topology): dedupe Segment nnodes and exports
Use the generic `AbstractTopology{N}` node count, fix LICENSE URL, and remove
duplicate `Seg*` exports.

- Drop redundant `nnodes`/`export` lines from `segments.jl`.
2026-05-09 18:22:28 +03:00
Jukka Aho ca78e6a645 refactor(topology): dedupe Quadrilateral nnodes and exports
Route node counts through `AbstractTopology{N}`, fix LICENSE URL, and rely on
`exports.jl` for `Quad*` aliases.

- Drop redundant `nnodes`/`export` lines from `quadrilaterals.jl`.
2026-05-09 18:22:23 +03:00
Jukka Aho fa34183676 docs(topology): clarify pyramid support and dedupe nnodes/export
Point readers at missing higher-order pyramids, adopt `LICENSE.md`, drop the
redundant `nnodes` method, and remove duplicate exports.

- Remove `nnodes(::Pyramid{N})` and `export Pyr5` (manifest handles exports).
2026-05-09 18:22:16 +03:00
Jukka Aho 4f8c6b493c refactor(topology): centralize Hexahedron nnodes and trim exports
Rely on `nnodes(::AbstractTopology{N}) = N` from `topology/api.jl`, fix the
LICENSE deep link, and drop redundant `export` lines now covered by
`exports.jl`.

- Remove per-type `nnodes(::Hexahedron{N})` overloads and file-level exports.
2026-05-09 18:22:06 +03:00
Jukka Aho ea12d4310e docs(topology): drop bold emphasis in AbstractTopology docstring
Align the topology API prose with the repository documentation style guide.
2026-05-09 18:21:59 +03:00
Jukka Aho b9fafd4e09 refactor(topology): consolidate files and simplify documentation
Consolidate topology module by merging topology.jl into api.jl and
significantly simplify documentation across all topology files. Remove
verbose docstrings, examples, and design notes in favor of minimal,
code-focused documentation.

Major changes:
- Merge topology.jl into api.jl (delete topology.jl)
- Simplify docstrings in api.jl, triangles.jl, and tetrahedra.jl
- Remove verbose documentation from type aliases and functions
- Remove topology type parameter from entity types (Vertex, Edge, Face, Cell)
- Update all entity constructors to remove topology parameter
- Add entities dispatcher and helper functions to api.jl

File changes:
- api.jl: Simplified AbstractTopology docstring, added topological entities
  and helpers from topology.jl, added entities dispatcher
- triangles.jl: Removed verbose documentation
- tetrahedra.jl: Removed verbose documentation
- hexahedra.jl, pyramids.jl, quadrilaterals.jl, segments.jl, wedges.jl:
  Updated entity constructors to remove topology type parameter
- topology.jl: Deleted (content moved to api.jl)

Documentation philosophy:
- Keep docstrings minimal and code-focused
- Remove examples unless function use is unclear
- Move comprehensive documentation to website/docs, not in code
- Maintain essential type information and interface requirements
2025-12-12 22:27:09 +02:00
Jukka Aho 09eb3928db feat(topology): Add comprehensive typed entity system
- Define TopologicalEntity{D, Topo} abstract type hierarchy
- Add concrete entity types: Vertex{T}, Edge{T}, Face{T}, Cell{T}
- Implement type-based entity queries: entities(Edge{Tet4})
- Add entity dimension query: dim(::Type{<:TopologicalEntity})
- Add topology extraction: topology_type(::Type{<:TopologicalEntity})
- Add entity count helper: nentities(::Type{<:TopologicalEntity})
- Comprehensive documentation explaining entity philosophy
- Examples showing DOF system integration patterns
- Zero-allocation design: position in vector IS entity ID
2025-11-23 18:22:01 +02:00
Jukka Aho 3ab0ca3f2f refactor(topology): Modernize wedge topology implementation
- Apply Vec constructor broadcasting to both Wedge6 and Wedge15
- Convert edges() to return SVector of typed Edge{T} entities (9 edges)
- Convert faces() to return SVector of typed Face{T} entities (5 faces: 2 triangles + 3 quads)
- Add vertices() returning six Vertex{T} instances
- Add cells() returning single Cell{T} instance
- Add entity count methods: nvertices(), nedges(), nfaces()
- Clean syntax with consistent formatting
2025-11-23 18:21:05 +02:00
Jukka Aho b9a92bb364 refactor(topology): Modernize pyramid topology implementation
- Apply Vec constructor broadcasting to Pyr5
- Convert edges() to return SVector of typed Edge{T} entities (8 edges)
- Convert faces() to return SVector of typed Face{T} entities (5 faces: 1 quad base + 4 triangles)
- Add vertices() returning five Vertex{T} instances
- Add cells() returning single Cell{T} instance
- Add entity count methods: nvertices(), nedges(), nfaces()
- Clean syntax with consistent formatting
2025-11-23 18:20:47 +02:00
Jukka Aho 0e4ffb96d0 refactor(topology): Modernize hexahedron topology implementation
- Apply Vec constructor broadcasting to all 3 hexahedron types (Hex8, Hex20, Hex27)
- Convert edges() to return SVector of typed Edge{T} entities (12 edges)
- Convert faces() to return SVector of typed Face{T} entities (6 quad faces)
- Add vertices() returning eight Vertex{T} instances
- Add cells() returning single Cell{T} instance
- Add entity count methods: nvertices(), nedges(), nfaces()
- Cleaner formatting with consistent indentation
2025-11-23 18:20:26 +02:00
Jukka Aho 2f8612ee8e refactor(topology): Modernize tetrahedron topology implementation
- Apply Vec constructor broadcasting to both Tet4 and Tet10
- Convert edges() to return SVector of typed Edge{T} entities
- Convert faces() to return SVector of typed Face{T} entities
- Add vertices() returning four Vertex{T} instances
- Add cells() returning single Cell{T} instance
- Add entity count methods: nvertices(), nedges(), nfaces()
- Expand documentation with typed entity examples and DOF integration patterns
- Update all docstrings to explain typed entity system
2025-11-23 18:20:09 +02:00
Jukka Aho 3145ab1c9c refactor(topology): Modernize quadrilateral topology implementation
- Apply Vec constructor broadcasting to all 3 quadrilateral types (Quad4, Quad8, Quad9)
- Convert edges() to return SVector of typed Edge{T} entities
- Convert faces() to return SVector of typed Face{T} entity
- Add vertices() returning four Vertex{T} instances
- Add cells() returning single Cell{T} instance
- Add entity count methods: nvertices(), nedges(), nfaces()
- Consistent formatting with cleaner syntax
2025-11-23 18:19:44 +02:00
Jukka Aho 9168f2b6cf refactor(topology): Modernize triangle topology implementation
- Apply Vec constructor broadcasting to all 4 triangle types (Tri3, Tri6, Tri7, Tri10)
- Convert edges() to return SVector of typed Edge{T} entities
- Convert faces() to return SVector of typed Face{T} entity
- Add vertices() returning three Vertex{T} instances
- Add cells() returning single Cell{T} instance
- Add entity count methods: nvertices(), nedges(), nfaces()
- Update documentation to reflect typed entity returns
2025-11-23 18:19:18 +02:00
Jukka Aho 404ea66f11 refactor(topology): Modernize segment topology implementation
- Apply Vec constructor broadcasting: Vec{1,Float64}.((...))
- Convert edges() to return typed Edge{T} in SVector
- Convert faces() to return typed Vertex{T} (endpoints in 1D)
- Add vertices() method returning two Vertex{T} instances
- Add cells() method returning single Cell{T}
- Add entity count methods: nvertices(), nedges(), nfaces()
- Clean up syntax with consistent formatting
2025-11-23 18:18:52 +02:00
Jukka Aho e8c8c04075 feat(topology): Add type-level nnodes() method
- Add nnodes(::Type{<:AbstractTopology{N}}) method for type queries
- Enables compile-time node count without instantiation
- Example: nnodes(Triangle{3}) returns 3
- Complements existing instance method for dispatch consistency
2025-11-23 18:18:24 +02:00
Jukka Aho 7e3f9bddc1 refactor(topology): Update 3D element reference_coordinates to SVector of Vec
Hexahedron changes:
- Hex8: tuple of tuples → SVector of Vec{3,Float64} (8 corners)
- Added Hex20: SVector with 8 corners + 12 edge midpoints
- Added Hex27: SVector with 8 corners + 12 edge midpoints + 6 face centers + 1 volume center

Pyramid changes:
- Pyr5: tuple of tuples → SVector of Vec{3,Float64} (4 base corners + 1 apex)

Wedge changes:
- Wedge6: tuple of tuples → SVector of Vec{3,Float64} (2 triangular faces)
- Added Wedge15: SVector with 6 corners + 9 edge midpoints
2025-11-21 00:32:06 +02:00
Jukka Aho 342990ce55 refactor(topology): Update Tetrahedron reference_coordinates to SVector of Vec
- Changed Tet4 and Tet10 return types in docstrings: NTuple → SVector{N, Vec{3,Float64}}
- Changed implementations: tuple of tuples → SVector of Vec{3,Float64}
- Updated reference_coordinates for Tet4 (4 nodes) and Tet10 (10 nodes)
2025-11-21 00:31:28 +02:00
Jukka Aho fa02393718 refactor(topology): Update Quadrilateral reference_coordinates to SVector of Vec
- Changed Quad4: tuple of tuples → SVector of Vec{2,Float64}
- Added Quad8: SVector with 4 corners + 4 edge midpoints
- Added Quad9: SVector with 4 corners + 4 edge midpoints + 1 center node
- All return SVector(Vec{2}(...), ...) format with comments
2025-11-21 00:31:09 +02:00
Jukka Aho 0926a7cdbe refactor(topology): Update Triangle reference_coordinates to SVector of Vec
- Changed Triangle{3,6,7,10} return types in docstrings: NTuple → SVector{N, Vec{2,Float64}}
- Changed all implementations: tuple of tuples → SVector of Vec{2,Float64}
- Updated reference_coordinates for Tri3, Tri6, Tri7, Tri10 (4 functions)
2025-11-21 00:30:52 +02:00
Jukka Aho a1d97bb1ef refactor(topology): Update Segment reference_coordinates to SVector of Vec
- Changed Segment{2}: tuple of tuples → SVector of Vec{1,Float64}
- Changed Segment{3}: tuple of tuples → SVector of Vec{1,Float64}
- Both now return SVector(Vec{1}(...), Vec{1}(...), ...) format
2025-11-21 00:30:39 +02:00
Jukka Aho 4bf7d2ef22 docs(topology): Update API documentation for new coordinate types
- Changed reference_coordinates return type docs: tuple of tuples → SVector of Vec
- Added Base.ndims alias function for Base API interoperability
- Updated docstring examples to use SVector(Vec{D}(...)) syntax
- Updated design philosophy examples: removed old Lagrange{Topology,Order} syntax, now Lagrange{Order}
- Clarified topology defines shape+nodes, basis defines interpolation
- Updated backward compatibility notes: Tri3 → Triangle{3}, etc.
2025-11-21 00:30:12 +02:00
Jukka Aho 1b18af15a1 refactor(topology): Move interface to topology/api.jl, keep helpers in topology.jl
Refactor src/topology/topology.jl from 173 to 12 lines:
- Remove all AbstractTopology{N} interface definitions (161 lines removed)
- Remove nnodes(), dim(), reference_coordinates(), edges(), faces() stubs
- Interface now defined in src/topology/api.jl (included first)
- Keep file as placeholder for future helper functions
- Add note referencing topology/api.jl for interface

This completes separation of interface (api.jl) from implementations.
Topology/topology.jl previously mixed interface and helpers - now
clean separation following systematic modular architecture pattern.

Part of systematic modular API refactoring.
2025-11-15 18:44:48 +02:00
Jukka Aho 2e41f9502d feat(topology): Add element topology API with 17 reference element types
Create src/topology/api.jl defining element topology abstractions:
- AbstractTopology{N} base type (N = node count from mesh connectivity)
- Interface: nnodes(), dim(), reference_coordinates(), edges(), faces()
- 7 shape families: Segment, Triangle, Quadrilateral, Tetrahedron, Hexahedron, Pyramid, Wedge
- 17 concrete types: Seg2/3, Tri3/6/7, Quad4/8/9, Tet4/10, Hex8/20/27, Pyr5, Wedge6/15

Key design: Topology defines SHAPE (triangle), not node count. Node count
comes from basis order: Triangle + Lagrange{Triangle,1} → 3 nodes (Tri3),
Triangle + Lagrange{Triangle,2} → 6 nodes (Tri6). This enables clean
separation: Topology (shape) ≠ Basis (interpolation) ≠ Integration (quadrature).

Reference element coordinates defined for all topologies. Zero-allocation
API using tuples. Backward compatibility: Tri3/Quad4/Tet10 aliased to
shape names with implied basis.

Comprehensive documentation with theory and examples.
Part of systematic modular API architecture.
2025-11-15 18:41:34 +02:00
Jukka Aho 81440d7265 refactor(topology): Remove old per-variant topology files
Remove individual topology files replaced by parametric variants.

Deleted files (16 total):
- Hexahedra: hex8.jl, hex20.jl, hex27.jl → hexahedra.jl with Hexahedron{N}
- Segments: seg2.jl, seg3.jl → segments.jl with Segment{N}
- Quadrilaterals: quad4.jl, quad8.jl, quad9.jl → quadrilaterals.jl with Quadrilateral{N}
- Triangles: tri3.jl, tri6.jl, tri7.jl → triangles.jl with Triangle{N}
- Tetrahedra: tet4.jl, tet10.jl → tetrahedra.jl with Tetrahedron{N}
- Pyramids: pyr5.jl → pyramids.jl with Pyramid{N}
- Wedges: wedge6.jl, wedge15.jl → wedges.jl with Wedge{N}

Each topology type now handles all node count variants via type parameter {N}.
Implements ADR-002 (November 13, 2025): node count from mesh connectivity.
2025-11-15 05:34:51 +02:00
Jukka Aho 75735ea63c refactor(topology): Implement Wedge{N} with type parameter
Update Wedge to use node count type parameter per ADR-002.

Changes:
- struct Wedge → struct Wedge{N} <: AbstractTopology{N}
- Aliases: Wedge6 = Wedge{6}, Wedge15 = Wedge{15}
- Simplified implementation following same pattern
- Remove old design documentation

Implements ADR-002 (November 13, 2025): node count from mesh, not basis.

Old files removed: wedge6.jl, wedge15.jl
New file: Single wedges.jl handles all variants via {N}
2025-11-15 04:07:28 +02:00
Jukka Aho a9e31c1ed2 refactor(topology): Implement Pyramid{N} with type parameter
Update Pyramid to use node count type parameter per ADR-002.

Changes:
- struct Pyramid → struct Pyramid{N} <: AbstractTopology{N}
- Alias: Pyr5 = Pyramid{5}
- Simplified implementation following same pattern
- Remove old design documentation

Implements ADR-002 (November 13, 2025): node count from mesh, not basis.

Old file removed: pyr5.jl
New file: Single pyramids.jl handles all variants via {N}
2025-11-15 03:55:02 +02:00
Jukka Aho 2c6d6dc620 refactor(topology): Implement Tetrahedron{N} with type parameter
Update Tetrahedron to use node count type parameter per ADR-002.

Changes:
- struct Tetrahedron → struct Tetrahedron{N} <: AbstractTopology{N}
- Aliases: Tet4 = Tetrahedron{4}, Tet10 = Tetrahedron{10}
- Simplified implementation following same pattern
- Remove old design documentation

Implements ADR-002 (November 13, 2025): node count from mesh, not basis.

Old files removed: tet4.jl, tet10.jl
New file: Single tetrahedra.jl handles all variants via {N}
2025-11-15 02:56:52 +02:00
Jukka Aho 568f09090a refactor(topology): Implement Triangle{N} with type parameter
Update Triangle to use node count type parameter per ADR-002.

Changes:
- struct Triangle → struct Triangle{N} <: AbstractTopology{N}
- Aliases: Tri3 = Triangle{3}, Tri6 = Triangle{6}, Tri7 = Triangle{7}, Tri10 = Triangle{10}
- Simplified implementation following same pattern
- Remove old design documentation

Implements ADR-002 (November 13, 2025): node count from mesh, not basis.

Old files removed: tri3.jl, tri6.jl, tri7.jl
New file: Single triangles.jl handles all variants via {N}
2025-11-15 02:47:04 +02:00
Jukka Aho 4bf21edda8 refactor(topology): Implement Quadrilateral{N} with type parameter
Update Quadrilateral to use node count type parameter per ADR-002.

Changes:
- struct Quadrilateral → struct Quadrilateral{N} <: AbstractTopology{N}
- Aliases: Quad4 = Quadrilateral{4}, Quad8 = Quadrilateral{8}, Quad9 = Quadrilateral{9}
- Simplified implementation following same pattern as Hexahedron and Segment
- Remove 140+ lines of old design documentation

Implements ADR-002 (November 13, 2025): node count from mesh, not basis.

Old files removed: quad4.jl, quad8.jl, quad9.jl
New file: Single quadrilaterals.jl handles all variants via {N}
2025-11-15 02:29:36 +02:00
Jukka Aho be550320b5 refactor(topology): Implement Segment{N} with type parameter
Update Segment to use node count type parameter per ADR-002.

Changes:
- struct Segment → struct Segment{N} <: AbstractTopology{N}
- Aliases: Seg2 = Segment{2}, Seg3 = Segment{3}
- Add nnodes(), dim() implementations
- reference_coordinates() for Segment{2} and Segment{3}
- Generic edges() and faces() for any N
- Remove 100+ lines of old design documentation

Implements ADR-002 (November 13, 2025): node count from mesh, not basis.

Old files removed: seg2.jl, seg3.jl
New file: Single segments.jl handles all variants via {N}
2025-11-15 02:27:02 +02:00
Jukka Aho 4c49570cec refactor(topology): Implement Hexahedron{N} with type parameter
Update Hexahedron to use node count type parameter per ADR-002.

Changes:
- struct Hexahedron → struct Hexahedron{N} <: AbstractTopology{N}
- Aliases now specify node count: Hex8 = Hexahedron{8}
- Add nnodes() implementation: returns N from type parameter
- Simplify documentation: remove 150+ lines explaining old design
- Keep reference_coordinates() for Hexahedron{8} only
- Generic edges() and faces() work for any N

Benefits:
- Type system encodes node count (compile-time)
- Hex8, Hex20, Hex27 are distinct types (better dispatch)
- Matches mesh file reality (mesh specifies node count)
- Implements ADR-002 decision (November 13, 2025)

Old files removed: hex8.jl, hex20.jl, hex27.jl (separate files)
New file: Single hexahedra.jl handles all variants via {N}
2025-11-15 02:24:53 +02:00
Jukka Aho b2d25e9491 refactor(topology): Add node count type parameter to AbstractTopology
Change AbstractTopology to AbstractTopology{N} where N is node count.

This implements ADR-002 (November 13, 2025) decision: node count comes
from mesh connectivity and should be captured in the type for
compile-time optimization.

Benefits:
- Enables Val(N) for zero-allocation ntuple operations
- Allows loop unrolling for small N (8, 20, 27 nodes typical)
- Type-stable operations based on node count
- Node count known from mesh before basis selection

Documentation updates:
- Add Type Parameter section with examples
- Add Rationale section explaining performance benefits
- Reference ADR-002 for design decision details

Concrete types updated in subsequent commits:
  Hexahedron{N}, Tetrahedron{N}, Triangle{N}, etc.
2025-11-15 02:24:01 +02:00
Jukka Aho 07f1c690d2 refactor(topology): Update AbstractTopology documentation for separation of concerns
Modified src/topology/topology.jl to reflect new architecture:
- Clarify topology defines geometric shape only, not node count
- Document that node count comes from basis functions
- Add examples showing same topology with different bases (Quad4/8/9)
- Update docstring to reference new topology types (Segment, Triangle, etc.)
- Emphasize corner nodes only in topology API
- Remove references to old node-count-baked types (Tri3, Quad4, etc.)
2025-11-12 00:53:02 +02:00
Jukka Aho a4d5b235ca feat(topology): Add Wedge 3D topology with Wedge6/Wedge15 aliases
New file implementing 3D wedge/prism topology:
- Wedge struct with dim=3, 6 corner nodes (triangular prism)
- reference_coordinates() with bottom triangle at z=-1, top at z=1
- edges() returns 9 edges (3 bottom + 3 top + 3 vertical)
- faces() returns 5 faces (2 triangular ends + 3 quadrilateral sides)
- Backward compatibility aliases: Wedge6 (linear), Wedge15 (quadratic)
- Zero-allocation tuple-based design
2025-11-12 00:52:38 +02:00
Jukka Aho f7d778d960 feat(topology): Add Pyramid 3D topology with Pyr5 alias
New file implementing 3D pyramidal topology:
- Pyramid struct with dim=3, 5 corner nodes (square base + apex)
- reference_coordinates() with base at z=0 and apex at (0,0,1)
- edges() returns 8 edges (4 base + 4 to apex)
- faces() returns 5 faces (1 quadrilateral base + 4 triangular sides)
- Backward compatibility alias: Pyr5 (linear)
- Zero-allocation tuple-based design
2025-11-12 00:52:26 +02:00
Jukka Aho 0231b2e33a feat(topology): Add Hexahedron 3D topology with Hex8/Hex20/Hex27 aliases
New file implementing 3D hexahedral topology:
- Hexahedron struct with dim=3, 8 corner nodes (3D tensor product)
- reference_coordinates() in [-1,1]³ cube
- edges() returns 12 edges, faces() returns 6 quadrilateral faces
- Backward compatibility aliases: Hex8, Hex20 (Serendipity), Hex27 (Lagrange)
- Supports trilinear, serendipity (no interior), and full tensor product bases
- Zero-allocation tuple-based design
2025-11-12 00:52:13 +02:00
Jukka Aho 02e40946ef feat(topology): Add Tetrahedron 3D topology with Tet4/Tet10 aliases
New file implementing 3D tetrahedral topology:
- Tetrahedron struct with dim=3, 4 corner nodes (3D simplex)
- reference_coordinates() at (0,0,0), (1,0,0), (0,1,0), (0,0,1)
- edges() returns 6 edges, faces() returns 4 triangular faces
- Backward compatibility aliases: Tet4 (linear), Tet10 (quadratic)
- Zero-allocation tuple-based design
2025-11-12 00:52:00 +02:00
Jukka Aho 6a5a87daef feat(topology): Add Quadrilateral 2D topology with Quad4/Quad8/Quad9 aliases
New file implementing 2D quadrilateral topology:
- Quadrilateral struct with dim=2, 4 corner nodes at (-1,-1), (1,-1), (1,1), (-1,1)
- edges() returns 4 edges, faces() returns element itself
- Backward compatibility aliases: Quad4, Quad8 (Serendipity), Quad9 (Lagrange)
- Supports bilinear, serendipity (no center), and full tensor product bases
- Zero-allocation tuple-based design
2025-11-12 00:51:47 +02:00
Jukka Aho 1ab8f3f30c feat(topology): Add Triangle 2D topology with Tri3/Tri6/Tri7 aliases
New file implementing 2D triangular topology:
- Triangle struct with dim=2, 3 corner nodes
- reference_coordinates() at (0,0), (1,0), (0,1)
- edges() returns 3 edges, faces() returns element itself
- Backward compatibility aliases: Tri3, Tri6, Tri7 (same topology, different basis)
- Zero-allocation tuple-based design
- Separation: topology is geometric shape, basis determines node count
2025-11-12 00:51:25 +02:00
Jukka Aho f547f547e8 feat(topology): Add Segment 1D topology with Seg2/Seg3 aliases
New file implementing 1D line segment topology:
- Segment struct with dim=1, 2 corner nodes
- reference_coordinates() returns (-1.0,) and (1.0,)
- edges() and faces() for topology connectivity
- Backward compatibility aliases: Seg2, Seg3 (same topology, different basis)
- Zero-allocation design using tuples
- Separation of concerns: topology defines shape, basis determines node count
2025-11-12 00:50:58 +02:00
Jukka Aho 41e09b2c92 feat(compat): Add compatibility shim for old mutable field API
Implements compatibility layer to allow old test code to run with new
immutable element design (though fields won't actually update).

src/elements/elements.jl:
- Replaced has_dfield/get_dfield to work with new fields API
- Fixed get_sfield/get_dfield to handle empty Tuple{} fields
- All dfield functions now map to element.fields (immutable NamedTuple)

src/topology/*.jl (seg2, tri3, quad4, tet4, hex8):
- Added nnodes() implementation for each topology type
- Returns corner node count (backwards compatibility)
- Example: nnodes(::Triangle) = 3, nnodes(::Hexahedron) = 8
- Note: Actual node count depends on basis degree in new architecture

Test Results:
- test_topology_standalone.jl: 36/36 tests passing ✓
- Full test suite: 43 errors (same as before)
- Error breakdown:
  * 40+ tests: Problem types not defined (Elasticity, Heat, Mortar)
  * 2 tests: Mesh readers not defined (aster_read_mesh)
  * 1 test: Tries to mutate empty element (test_elasticity_1d)

Next Steps:
- Tests that create empty elements then mutate need rewriting
- Pattern: Element(Seg2, (1,2)) + update!() → not compatible
- New pattern: Element(..., fields=(geometry=X, displacement=u))
- See docs/design/IMMUTABILITY.md for migration guide
2025-11-09 18:08:39 +02:00
Jukka Aho dcc7f69a75 refactor(topology): Rename Wedge6 to Wedge, remove hardcoded node count
- Changed struct name from Wedge6 to Wedge
- Removed nnodes() method (node count now determined by basis)
- Updated all function signatures to use Wedge
- Added Wedge6 as backwards compatibility alias
- Added note explaining basis determines node count (P1=6, P2=15 nodes)
2025-11-09 09:28:29 +02:00
Jukka Aho ca7c8a4c75 refactor(topology): Rename Pyr5 to Pyramid, remove hardcoded node count
- Changed struct name from Pyr5 to Pyramid
- Removed nnodes() method (node count now determined by basis)
- Updated all function signatures to use Pyramid
- Added Pyr5 as backwards compatibility alias
- Added note explaining basis determines node count (P1=5, P2=13, P3=29)
2025-11-09 09:28:17 +02:00
Jukka Aho 835aac9962 refactor(topology): Rename Hex8 to Hexahedron, remove hardcoded node count
- Changed struct name from Hex8 to Hexahedron
- Removed nnodes() method (node count now determined by basis)
- Updated all function signatures to use Hexahedron
- Added Hex8 as backwards compatibility alias
- Added note explaining basis determines node count (Q1=8, Q2=27 nodes)
2025-11-09 09:28:07 +02:00
Jukka Aho 260ea0b170 refactor(topology): Rename Tet4 to Tetrahedron, remove hardcoded node count
- Changed struct name from Tet4 to Tetrahedron
- Removed nnodes() method (node count now determined by basis)
- Updated all function signatures to use Tetrahedron
- Added Tet4 as backwards compatibility alias
- Added note explaining basis determines node count (P1=4, P2=10 nodes)
2025-11-09 09:27:54 +02:00
Jukka Aho 7d5966c3d3 refactor(topology): Rename Seg2 to Segment, remove hardcoded node count
- Changed struct name from Seg2 to Segment
- Removed nnodes() method (node count now determined by basis)
- Updated all function signatures to use Segment instead of Seg2
- Added Seg2 as backwards compatibility alias
- Added note explaining basis determines node count
2025-11-09 09:27:43 +02:00