@@ -17,6 +17,20 @@ abstract type AbstractSimplex{Dimension, N, T} <: StaticVector{Dimension, T} end
17
17
18
18
GeometryTypes. @fixed_vector Point AbstractPoint
19
19
20
+ """
21
+ Face index, connecting points to form a simplex
22
+ """
23
+ GeometryTypes. @fixed_vector SimplexFace AbstractFace
24
+
25
+ """
26
+ Face index, connecting points to form an Ngon
27
+ """
28
+ GeometryTypes. @fixed_vector NgonFace AbstractFace
29
+ const TriangleFace{T} = NgonFace{3 , T}
30
+ function element_type (P:: Type{<: AbstractPoint{Dim, T}} , :: Type{<: NgonFace{N}} ) where {N, Dim, T}
31
+ NGon{Dim, T, N, P}
32
+ end
33
+
20
34
"""
21
35
Fixed Size Polygon, e.g.
22
36
N 1-2 : Illegal!
@@ -168,6 +182,10 @@ struct Mesh{
168
182
simplices:: V
169
183
end
170
184
185
+ function Mesh (elements:: AbstractVector{<: Polytope{Dim, T}} ) where {Dim, T}
186
+ Mesh {Dim, T, eltype(elements), typeof(elements)} (elements)
187
+ end
188
+
171
189
"""
172
190
FaceView enables to link one array of points via a face array, to generate one
173
191
abstract array of elements.
@@ -195,6 +213,13 @@ struct FaceView{
195
213
points:: P
196
214
faces:: F
197
215
end
216
+ function FaceView (points:: AbstractVector{P} , faces:: AbstractVector{F} ) where {P <: AbstractPoint , F <: AbstractFace }
217
+ Element = element_type (P, F)
218
+ FaceView {Element, P, F, typeof(points), typeof(faces)} (points, faces)
219
+ end
198
220
221
+ function Mesh (points:: AbstractVector{<: AbstractPoint} , faces:: AbstractVector{<: AbstractFace} )
222
+ Mesh (FaceView (points, faces))
223
+ end
199
224
200
225
end # module
0 commit comments