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)
This commit is contained in:
Jukka Aho
2025-11-09 09:28:29 +02:00
parent ca7c8a4c75
commit dcc7f69a75
+18 -12
View File
@@ -2,9 +2,9 @@
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE
"""
Wedge6 <: AbstractTopology
Wedge <: AbstractTopology
6-node linear prismatic/wedge element.
Wedge/prism element topology (3D triangular extrusion).
Reference element in 3D with triangular cross-section in (u,v) plane
extruded along w direction from -1 to +1.
@@ -30,23 +30,29 @@ extruded along w direction from -1 to +1.
Triangle base at w=-1, triangle top at w=+1.
**Note:** Node count determined by basis function degree:
- Lagrange{Wedge, 1}: 6 nodes (P1)
- Lagrange{Wedge, 2}: 15 nodes (P2)
**Zero allocation:** All functions return compile-time sized tuples.
"""
struct Wedge6 <: AbstractTopology end
struct Wedge <: AbstractTopology end
nnodes(::Wedge6) = 6
dim(::Wedge6) = 3
dim(::Wedge) = 3
# Backwards compatibility alias
const Wedge6 = Wedge
"""
reference_coordinates(::Wedge6) -> NTuple{6, NTuple{3, Float64}}
reference_coordinates(::Wedge) -> NTuple{6, NTuple{3, Float64}}
Reference coordinates for 6-node wedge:
Reference coordinates for wedge vertices:
- Bottom triangle (w=-1): (0,0,-1), (1,0,-1), (0,1,-1)
- Top triangle (w=+1): (0,0,+1), (1,0,+1), (0,1,+1)
**Zero allocation:** Returns tuple of tuples (stack allocated).
"""
reference_coordinates(::Wedge6) = (
reference_coordinates(::Wedge) = (
(0.0, 0.0, -1.0), # N1
(1.0, 0.0, -1.0), # N2
(0.0, 1.0, -1.0), # N3
@@ -56,20 +62,20 @@ reference_coordinates(::Wedge6) = (
)
"""
edges(::Wedge6) -> NTuple{9, Tuple{Int, Int}}
edges(::Wedge) -> NTuple{9, Tuple{Int, Int}}
Edge connectivity for wedge (3 bottom + 3 top + 3 vertical = 9 edges).
**Zero allocation:** Returns tuple of tuples (stack allocated).
"""
edges(::Wedge6) = (
edges(::Wedge) = (
(1, 2), (2, 3), (3, 1), # Bottom triangle
(4, 5), (5, 6), (6, 4), # Top triangle
(1, 4), (2, 5), (3, 6), # Vertical edges
)
"""
faces(::Wedge6) -> NTuple{5, Tuple{Vararg{Int}}}
faces(::Wedge) -> NTuple{5, Tuple{Vararg{Int}}}
Face connectivity for wedge:
- 2 triangular faces (top and bottom)
@@ -77,7 +83,7 @@ Face connectivity for wedge:
**Zero allocation:** Returns tuple of tuples (stack allocated).
"""
faces(::Wedge6) = (
faces(::Wedge) = (
(1, 3, 2), # Bottom triangle
(4, 5, 6), # Top triangle
(1, 2, 5, 4), # Side quad