@@ -342,6 +342,18 @@ public:
342342 }
343343
344344
345+ void testTriangulatorTrapMesh (UnstructuredMesh & mesh )
346+ {
347+ // A non-square quad, so we don't have ambiguity about which
348+ // diagonal a Delaunay algorithm will pick.
349+ // Manually-numbered points, so we can use the point numbering as
350+ // a segment ordering even on DistributedMesh.
351+ mesh .add_point (Point (0 ,0 ), 0 );
352+ mesh .add_point (Point (1 ,0 ), 1 );
353+ mesh .add_point (Point (1 ,2 ), 2 );
354+ mesh .add_point (Point (0 ,1 ), 3 );
355+ }
356+
345357
346358 void testTriangulatorInterp (UnstructuredMesh & mesh ,
347359 TriangulatorInterface & triangulator ,
@@ -353,7 +365,7 @@ public:
353365 commonSettings (triangulator );
354366
355367 if (!mesh .n_nodes ())
356- testPoly2TriTrapMesh (mesh );
368+ testTriangulatorTrapMesh (mesh );
357369
358370 // Interpolate points!
359371 triangulator .set_interpolate_boundary_points (interpolate_boundary_points );
@@ -868,19 +880,6 @@ public:
868880 testTriangulatorSegments (mesh , p2t_tri );
869881 }
870882
871-
872- void testPoly2TriTrapMesh (UnstructuredMesh & mesh )
873- {
874- // A non-square quad, so we don't have ambiguity about which
875- // diagonal a Delaunay algorithm will pick.
876- // Manually-numbered points, so we can use the point numbering as
877- // a segment ordering even on DistributedMesh.
878- mesh .add_point (Point (0 ,0 ), 0 );
879- mesh .add_point (Point (1 ,0 ), 1 );
880- mesh .add_point (Point (1 ,2 ), 2 );
881- mesh .add_point (Point (0 ,1 ), 3 );
882- }
883-
884883 void testPoly2TriRefinementBase
885884 (UnstructuredMesh & mesh ,
886885 const std ::vector < TriangulatorInterface ::Hole * > * holes ,
@@ -941,7 +940,7 @@ public:
941940 LOG_UNIT_TEST ;
942941
943942 Mesh mesh (* TestCommWorld );
944- testPoly2TriTrapMesh (mesh );
943+ testTriangulatorTrapMesh (mesh );
945944 testPoly2TriRefinementBase (mesh , nullptr , 1.5 , 15 );
946945 }
947946
@@ -950,7 +949,7 @@ public:
950949 LOG_UNIT_TEST ;
951950
952951 Mesh mesh (* TestCommWorld );
953- testPoly2TriTrapMesh (mesh );
952+ testTriangulatorTrapMesh (mesh );
954953 // Make sure we see 0 as "don't refine", not "infinitely refine"
955954 testPoly2TriRefinementBase (mesh , nullptr , 1.5 , 2 , 0 );
956955 }
@@ -961,15 +960,15 @@ public:
961960 LOG_UNIT_TEST ;
962961
963962 Mesh mesh (* TestCommWorld );
964- testPoly2TriTrapMesh (mesh );
963+ testTriangulatorTrapMesh (mesh );
965964 testPoly2TriRefinementBase (mesh , nullptr , 1.5 , 150 , 0.01 );
966965 }
967966
968967 void testPoly2TriNonUniformRefined ()
969968 {
970969 ParsedFunction < Real > var_area {"0.002*(1+2*x)*(1+2*y)" };
971970 Mesh mesh (* TestCommWorld );
972- testPoly2TriTrapMesh (mesh );
971+ testTriangulatorTrapMesh (mesh );
973972 testPoly2TriRefinementBase (mesh , nullptr , 1.5 , 150 , 0 , & var_area );
974973 }
975974
@@ -982,7 +981,7 @@ public:
982981 const std ::vector < TriangulatorInterface ::Hole * > holes { & diamond };
983982
984983 Mesh mesh (* TestCommWorld );
985- testPoly2TriTrapMesh (mesh );
984+ testTriangulatorTrapMesh (mesh );
986985 testPoly2TriRefinementBase (mesh , & holes , 1.25 , 13 );
987986 }
988987
@@ -991,7 +990,7 @@ public:
991990 LOG_UNIT_TEST ;
992991
993992 Mesh mesh (* TestCommWorld );
994- testPoly2TriTrapMesh (mesh );
993+ testTriangulatorTrapMesh (mesh );
995994 Poly2TriTriangulator p2t_tri (mesh );
996995
997996 Real total_area = 1.5 ;
@@ -1040,7 +1039,7 @@ public:
10401039 // Doing extra refinement here to ensure that we had the
10411040 // *opportunity* to refine the hole boundaries.
10421041 Mesh mesh (* TestCommWorld );
1043- testPoly2TriTrapMesh (mesh );
1042+ testTriangulatorTrapMesh (mesh );
10441043 testPoly2TriRefinementBase (mesh , & holes , 1.25 , n_original_elem , desired_area );
10451044
10461045 // Checking that we have more outer boundary sides than we started
@@ -1078,7 +1077,7 @@ public:
10781077 const std ::vector < TriangulatorInterface ::Hole * > holes { & diamond };
10791078
10801079 Mesh mesh (* TestCommWorld );
1081- testPoly2TriTrapMesh (mesh );
1080+ testTriangulatorTrapMesh (mesh );
10821081 testPoly2TriRefinementBase (mesh , & holes , 1.25 , 125 , 0.01 );
10831082 }
10841083
@@ -1090,7 +1089,7 @@ public:
10901089
10911090 ParsedFunction < Real > var_area {"0.002*(0.25+2*x)*(0.25+2*y)" };
10921091 Mesh mesh (* TestCommWorld );
1093- testPoly2TriTrapMesh (mesh );
1092+ testTriangulatorTrapMesh (mesh );
10941093 testPoly2TriRefinementBase (mesh , & holes , 1.25 , 150 , 0 , & var_area );
10951094 }
10961095
0 commit comments