Skip to content

Commit 4905c2e

Browse files
authored
Merge pull request #3572 from roystgnr/poly2tri_work
Poly2TriTriangulator refinement fixes
2 parents 49a13c5 + 001fa48 commit 4905c2e

29 files changed

Lines changed: 657 additions & 247 deletions

include/geom/cell_hex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class Hex : public Cell
172172
*/
173173
virtual unsigned int n_permutations() const override final { return 24; }
174174

175-
virtual void orient(BoundaryInfo *) override final;
175+
virtual bool is_flipped() const override final;
176176

177177
/**
178178
* This maps each edge to the sides that contain said edge.

include/geom/cell_inf_hex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class InfHex : public InfCell
187187
*/
188188
virtual unsigned int n_permutations() const override final { return 4; }
189189

190-
virtual void orient(BoundaryInfo *) override final;
190+
virtual bool is_flipped() const override final;
191191

192192
/**
193193
* This maps each edge to the sides that contain said edge.

include/geom/cell_inf_prism.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class InfPrism : public InfCell
171171

172172
std::vector<unsigned int> sides_on_edge(const unsigned int e) const override final;
173173

174-
virtual void orient(BoundaryInfo *) override final;
174+
virtual bool is_flipped() const override final;
175175

176176
/**
177177
* This maps each edge to the sides that contain said edge.

include/geom/cell_prism.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class Prism : public Cell
151151
*/
152152
virtual unsigned int n_permutations() const override final { return 6; }
153153

154-
virtual void orient(BoundaryInfo *) override final;
154+
virtual bool is_flipped() const override final;
155155

156156
/**
157157
* This maps each edge to the sides that contain said edge.

include/geom/cell_pyramid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class Pyramid : public Cell
175175
*/
176176
virtual unsigned int n_permutations() const override final { return 4; }
177177

178-
virtual void orient(BoundaryInfo *) override final;
178+
virtual bool is_flipped() const override final;
179179

180180
/**
181181
* This maps each edge to the sides that contain said edge.

include/geom/cell_tet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class Tet : public Cell
196196
*/
197197
virtual unsigned int n_permutations() const override final { return 12; }
198198

199-
virtual void orient(BoundaryInfo *) override final;
199+
virtual bool is_flipped() const override final;
200200

201201
/**
202202
* This maps each edge to the sides that contain said edge.

include/geom/edge.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class Edge : public Elem
202202

203203
virtual void permute(unsigned int) override final { libmesh_error(); }
204204

205-
virtual void orient(BoundaryInfo *) override final;
205+
virtual bool is_flipped() const override final;
206206

207207
unsigned int center_node_on_side(const unsigned short side) const override final;
208208

include/geom/elem.h

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1798,13 +1798,25 @@ class Elem : public ReferenceCountedObject<Elem>,
17981798
*/
17991799
virtual void flip(BoundaryInfo * boundary_info) = 0;
18001800

1801+
/**
1802+
* \returns Whether the element is flipped compared to standard
1803+
* libMesh (e.g. clockwise for 2D elements) node orientations.
1804+
*
1805+
* Always returns \p false if a 2D element is not in the XY plane or
1806+
* a 1D element is not on the X axis; user code designed to work for
1807+
* embedded manifolds should handle any consistent orientation, and
1808+
* determining whether an orientation is consistent is not a local
1809+
* operation.
1810+
*/
1811+
virtual bool is_flipped() const = 0;
1812+
18011813
/**
18021814
* Flips the element (by swapping node and neighbor pointers) to
18031815
* have a mapping Jacobian of opposite sign, iff we find a negative
18041816
* orientation. This only fixes flipped elements; for tangled
18051817
* elements the only fixes possible are non-local.
18061818
*/
1807-
virtual void orient(BoundaryInfo * boundary_info) = 0;
1819+
void orient(BoundaryInfo * boundary_info);
18081820

18091821
#ifdef LIBMESH_ENABLE_AMR
18101822

@@ -3079,6 +3091,14 @@ void Elem::hack_p_level_and_refinement_flag (unsigned int p,
30793091
#endif // ifdef LIBMESH_ENABLE_AMR
30803092

30813093

3094+
inline
3095+
void Elem::orient(BoundaryInfo * boundary_info)
3096+
{
3097+
if (this->is_flipped())
3098+
this->flip(boundary_info);
3099+
}
3100+
3101+
30823102
inline
30833103
dof_id_type Elem::compute_key (dof_id_type n0)
30843104
{

include/geom/face_inf_quad.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class InfQuad : public Elem
231231

232232
virtual void permute(unsigned int) override final { libmesh_error(); }
233233

234-
virtual void orient(BoundaryInfo *) override final;
234+
virtual bool is_flipped() const override final;
235235

236236
protected:
237237

include/geom/face_quad.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class Quad : public Face
188188
*/
189189
virtual unsigned int n_permutations() const override final { return 4; }
190190

191-
virtual void orient(BoundaryInfo *) override final;
191+
virtual bool is_flipped() const override final;
192192

193193
protected:
194194

0 commit comments

Comments
 (0)