diff --git a/src/topology/hexahedra.jl b/src/topology/hexahedra.jl index ea90af4..2a1f582 100644 --- a/src/topology/hexahedra.jl +++ b/src/topology/hexahedra.jl @@ -21,11 +21,51 @@ nnodes(::Hexahedron{N}) where {N} = N dim(::Hexahedron{N}) where {N} = 3 function reference_coordinates(::Hexahedron{8}) - return ( - (-1.0, -1.0, -1.0), (1.0, -1.0, -1.0), - (1.0, 1.0, -1.0), (-1.0, 1.0, -1.0), - (-1.0, -1.0, 1.0), (1.0, -1.0, 1.0), - (1.0, 1.0, 1.0), (-1.0, 1.0, 1.0) + return SVector( + Vec{3,Float64}((-1.0, -1.0, -1.0)), Vec{3,Float64}((1.0, -1.0, -1.0)), + Vec{3,Float64}((1.0, 1.0, -1.0)), Vec{3,Float64}((-1.0, 1.0, -1.0)), + Vec{3,Float64}((-1.0, -1.0, 1.0)), Vec{3,Float64}((1.0, -1.0, 1.0)), + Vec{3,Float64}((1.0, 1.0, 1.0)), Vec{3,Float64}((-1.0, 1.0, 1.0)) + ) +end + +function reference_coordinates(::Hexahedron{20}) + return SVector( + # 8 corner nodes + Vec{3,Float64}((-1.0, -1.0, -1.0)), Vec{3,Float64}((1.0, -1.0, -1.0)), + Vec{3,Float64}((1.0, 1.0, -1.0)), Vec{3,Float64}((-1.0, 1.0, -1.0)), + Vec{3,Float64}((-1.0, -1.0, 1.0)), Vec{3,Float64}((1.0, -1.0, 1.0)), + Vec{3,Float64}((1.0, 1.0, 1.0)), Vec{3,Float64}((-1.0, 1.0, 1.0)), + # 12 edge midpoint nodes + Vec{3,Float64}((0.0, -1.0, -1.0)), Vec{3,Float64}((1.0, 0.0, -1.0)), + Vec{3,Float64}((0.0, 1.0, -1.0)), Vec{3,Float64}((-1.0, 0.0, -1.0)), + Vec{3,Float64}((0.0, -1.0, 1.0)), Vec{3,Float64}((1.0, 0.0, 1.0)), + Vec{3,Float64}((0.0, 1.0, 1.0)), Vec{3,Float64}((-1.0, 0.0, 1.0)), + Vec{3,Float64}((-1.0, -1.0, 0.0)), Vec{3,Float64}((1.0, -1.0, 0.0)), + Vec{3,Float64}((1.0, 1.0, 0.0)), Vec{3,Float64}((-1.0, 1.0, 0.0)) + ) +end + +function reference_coordinates(::Hexahedron{27}) + return SVector( + # 8 corner nodes + Vec{3,Float64}((-1.0, -1.0, -1.0)), Vec{3,Float64}((1.0, -1.0, -1.0)), + Vec{3,Float64}((1.0, 1.0, -1.0)), Vec{3,Float64}((-1.0, 1.0, -1.0)), + Vec{3,Float64}((-1.0, -1.0, 1.0)), Vec{3,Float64}((1.0, -1.0, 1.0)), + Vec{3,Float64}((1.0, 1.0, 1.0)), Vec{3,Float64}((-1.0, 1.0, 1.0)), + # 12 edge midpoint nodes + Vec{3,Float64}((0.0, -1.0, -1.0)), Vec{3,Float64}((1.0, 0.0, -1.0)), + Vec{3,Float64}((0.0, 1.0, -1.0)), Vec{3,Float64}((-1.0, 0.0, -1.0)), + Vec{3,Float64}((0.0, -1.0, 1.0)), Vec{3,Float64}((1.0, 0.0, 1.0)), + Vec{3,Float64}((0.0, 1.0, 1.0)), Vec{3,Float64}((-1.0, 0.0, 1.0)), + Vec{3,Float64}((-1.0, -1.0, 0.0)), Vec{3,Float64}((1.0, -1.0, 0.0)), + Vec{3,Float64}((1.0, 1.0, 0.0)), Vec{3,Float64}((-1.0, 1.0, 0.0)), + # 6 face center nodes + Vec{3,Float64}((0.0, 0.0, -1.0)), Vec{3,Float64}((0.0, 0.0, 1.0)), + Vec{3,Float64}((0.0, -1.0, 0.0)), Vec{3,Float64}((0.0, 1.0, 0.0)), + Vec{3,Float64}((-1.0, 0.0, 0.0)), Vec{3,Float64}((1.0, 0.0, 0.0)), + # 1 volume center node + Vec{3,Float64}((0.0, 0.0, 0.0)) ) end diff --git a/src/topology/pyramids.jl b/src/topology/pyramids.jl index c897ee5..4866872 100644 --- a/src/topology/pyramids.jl +++ b/src/topology/pyramids.jl @@ -18,9 +18,12 @@ nnodes(::Pyramid{N}) where {N} = N dim(::Pyramid{N}) where {N} = 3 function reference_coordinates(::Pyramid{5}) - return ( - (-1.0, -1.0, 0.0), (1.0, -1.0, 0.0), (1.0, 1.0, 0.0), (-1.0, 1.0, 0.0), - (0.0, 0.0, 1.0) + return SVector( + Vec{3,Float64}((-1.0, -1.0, 0.0)), + Vec{3,Float64}((1.0, -1.0, 0.0)), + Vec{3,Float64}((1.0, 1.0, 0.0)), + Vec{3,Float64}((-1.0, 1.0, 0.0)), + Vec{3,Float64}((0.0, 0.0, 1.0)) ) end diff --git a/src/topology/wedges.jl b/src/topology/wedges.jl index a698ad6..71ae3f8 100644 --- a/src/topology/wedges.jl +++ b/src/topology/wedges.jl @@ -19,9 +19,35 @@ nnodes(::Wedge{N}) where {N} = N dim(::Wedge{N}) where {N} = 3 function reference_coordinates(::Wedge{6}) - return ( - (0.0, 0.0, -1.0), (1.0, 0.0, -1.0), (0.0, 1.0, -1.0), - (0.0, 0.0, 1.0), (1.0, 0.0, 1.0), (0.0, 1.0, 1.0) + return SVector( + Vec{3,Float64}((0.0, 0.0, -1.0)), + Vec{3,Float64}((1.0, 0.0, -1.0)), + Vec{3,Float64}((0.0, 1.0, -1.0)), + Vec{3,Float64}((0.0, 0.0, 1.0)), + Vec{3,Float64}((1.0, 0.0, 1.0)), + Vec{3,Float64}((0.0, 1.0, 1.0)) + ) +end + +function reference_coordinates(::Wedge{15}) + return SVector( + # 6 corner nodes + Vec{3,Float64}((0.0, 0.0, -1.0)), + Vec{3,Float64}((1.0, 0.0, -1.0)), + Vec{3,Float64}((0.0, 1.0, -1.0)), + Vec{3,Float64}((0.0, 0.0, 1.0)), + Vec{3,Float64}((1.0, 0.0, 1.0)), + Vec{3,Float64}((0.0, 1.0, 1.0)), + # 9 edge midpoint nodes + Vec{3,Float64}((0.5, 0.0, -1.0)), # Bottom triangle edges + Vec{3,Float64}((0.5, 0.5, -1.0)), + Vec{3,Float64}((0.0, 0.5, -1.0)), + Vec{3,Float64}((0.5, 0.0, 1.0)), # Top triangle edges + Vec{3,Float64}((0.5, 0.5, 1.0)), + Vec{3,Float64}((0.0, 0.5, 1.0)), + Vec{3,Float64}((0.0, 0.0, 0.0)), # Vertical edges + Vec{3,Float64}((1.0, 0.0, 0.0)), + Vec{3,Float64}((0.0, 1.0, 0.0)) ) end