libMesh
Loading...
Searching...
No Matches
Public Member Functions | List of all members
MeshSmootherTest Class Reference
Inheritance diagram for MeshSmootherTest:
[legend]

Public Member Functions

 LIBMESH_CPPUNIT_TEST_SUITE (MeshSmootherTest)
 The goal of this test is to verify proper operation of the MeshSmoother subclasses.
 
 CPPUNIT_TEST (testLaplaceQuad)
 
 CPPUNIT_TEST (testLaplaceTri)
 
 CPPUNIT_TEST (testConstraintLinePlane)
 
 CPPUNIT_TEST (testConstraintNearlyParallelPlanes)
 
 CPPUNIT_TEST (testVariationalEdge2)
 
 CPPUNIT_TEST (testVariationalEdge3)
 
 CPPUNIT_TEST (testVariationalEdge3MultipleSubdomains)
 
 CPPUNIT_TEST (testVariationalQuad4)
 
 CPPUNIT_TEST (testVariationalQuad4MultipleSubdomains)
 
 CPPUNIT_TEST (testVariationalQuad8)
 
 CPPUNIT_TEST (testVariationalQuad9)
 
 CPPUNIT_TEST (testVariationalQuad9MultipleSubdomains)
 
 CPPUNIT_TEST (testVariationalQuad4Tangled)
 
 CPPUNIT_TEST (testVariationalTri3)
 
 CPPUNIT_TEST (testVariationalTri6)
 
 CPPUNIT_TEST (testVariationalTri6MultipleSubdomains)
 
 CPPUNIT_TEST (testVariationalHex8)
 
 CPPUNIT_TEST (testVariationalHex20)
 
 CPPUNIT_TEST (testVariationalHex27)
 
 CPPUNIT_TEST (testVariationalHex27Tangled)
 
 CPPUNIT_TEST (testVariationalHex27MultipleSubdomains)
 
 CPPUNIT_TEST (testVariationalPyramid5)
 
 CPPUNIT_TEST (testVariationalPyramid13)
 
 CPPUNIT_TEST (testVariationalPyramid14)
 
 CPPUNIT_TEST (testVariationalPyramid18)
 
 CPPUNIT_TEST (testVariationalPyramid18MultipleSubdomains)
 
 CPPUNIT_TEST (testVariationalPrism6)
 
 CPPUNIT_TEST (testVariationalPrism15)
 
 CPPUNIT_TEST (testVariationalPrism18)
 
 CPPUNIT_TEST (testVariationalPrism20)
 
 CPPUNIT_TEST (testVariationalPrism21)
 
 CPPUNIT_TEST (testVariationalPrism21MultipleSubdomains)
 
 CPPUNIT_TEST (testVariationalTet4)
 
 CPPUNIT_TEST (testVariationalTet10)
 
 CPPUNIT_TEST (testVariationalTet14)
 
 CPPUNIT_TEST (testVariationalTet14MultipleSubdomains)
 
 CPPUNIT_TEST (testVariationalMixed2D)
 
 CPPUNIT_TEST (testVariationalMixed3D)
 
 CPPUNIT_TEST (testVariationalQuadratureHourglass)
 
 CPPUNIT_TEST_SUITE_END ()
 
void setUp ()
 
void tearDown ()
 
void testLaplaceSmoother (ReplicatedMesh &mesh, MeshSmoother &smoother, ElemType type)
 
std::pair< unsigned int, unsigned int > numCenteredAndFacedDimensions (const Point &point, const Real &side_length, const Real &tol)
 
bool pointIsCubeCenter (const Point &point, const Real &side_length, const Real &tol=TOLERANCE)
 
bool pointIsCubeVertex (const Point &point, const Real &side_length, const Real &tol=TOLERANCE)
 
bool pointIsCubeFaceCenter (const Point &point, const Real &side_length, const Real &tol=TOLERANCE)
 
void testVariationalSmoother (Mesh &mesh, VariationalMeshSmoother &smoother, const ElemType type, const bool multiple_subdomains=false, const bool tangle_mesh=false, const Real tangle_damping_factor=1.0)
 
void testVariationalSmootherRegression (const ReplicatedMesh &gold_mesh)
 
void testLaplaceQuad ()
 
void testLaplaceTri ()
 
void testConstraintLinePlane ()
 
void testConstraintNearlyParallelPlanes ()
 
void testVariationalEdge2 ()
 
void testVariationalEdge3 ()
 
void testVariationalEdge3MultipleSubdomains ()
 
void testVariationalQuad4 ()
 
void testVariationalQuad4MultipleSubdomains ()
 
void testVariationalQuad8 ()
 
void testVariationalQuad9 ()
 
void testVariationalQuad9MultipleSubdomains ()
 
void testVariationalQuad4Tangled ()
 
void testVariationalTri3 ()
 
void testVariationalTri6 ()
 
void testVariationalTri6MultipleSubdomains ()
 
void testVariationalHex8 ()
 
void testVariationalHex20 ()
 
void testVariationalHex27 ()
 
void testVariationalHex27MultipleSubdomains ()
 
void testVariationalHex27Tangled ()
 
void testVariationalPyramid5 ()
 
void testVariationalPyramid13 ()
 
void testVariationalPyramid14 ()
 
void testVariationalPyramid18 ()
 
void testVariationalPyramid18MultipleSubdomains ()
 
void testVariationalPrism6 ()
 
void testVariationalPrism15 ()
 
void testVariationalPrism18 ()
 
void testVariationalPrism20 ()
 
void testVariationalPrism21 ()
 
void testVariationalPrism21MultipleSubdomains ()
 
void testVariationalTet4 ()
 
void testVariationalTet10 ()
 
void testVariationalTet14 ()
 
void testVariationalTet14MultipleSubdomains ()
 
void testVariationalMixed2D ()
 
void testVariationalQuadratureHourglass ()
 
void testVariationalMixed3D ()
 

Detailed Description

Definition at line 223 of file mesh_smoother_test.C.

Member Function Documentation

◆ CPPUNIT_TEST() [1/39]

MeshSmootherTest::CPPUNIT_TEST ( testConstraintLinePlane  )

◆ CPPUNIT_TEST() [2/39]

MeshSmootherTest::CPPUNIT_TEST ( testConstraintNearlyParallelPlanes  )

◆ CPPUNIT_TEST() [3/39]

MeshSmootherTest::CPPUNIT_TEST ( testLaplaceQuad  )

◆ CPPUNIT_TEST() [4/39]

MeshSmootherTest::CPPUNIT_TEST ( testLaplaceTri  )

◆ CPPUNIT_TEST() [5/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalEdge2  )

◆ CPPUNIT_TEST() [6/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalEdge3  )

◆ CPPUNIT_TEST() [7/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalEdge3MultipleSubdomains  )

◆ CPPUNIT_TEST() [8/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalHex20  )

◆ CPPUNIT_TEST() [9/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalHex27  )

◆ CPPUNIT_TEST() [10/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalHex27MultipleSubdomains  )

◆ CPPUNIT_TEST() [11/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalHex27Tangled  )

◆ CPPUNIT_TEST() [12/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalHex8  )

◆ CPPUNIT_TEST() [13/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalMixed2D  )

◆ CPPUNIT_TEST() [14/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalMixed3D  )

◆ CPPUNIT_TEST() [15/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalPrism15  )

◆ CPPUNIT_TEST() [16/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalPrism18  )

◆ CPPUNIT_TEST() [17/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalPrism20  )

◆ CPPUNIT_TEST() [18/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalPrism21  )

◆ CPPUNIT_TEST() [19/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalPrism21MultipleSubdomains  )

◆ CPPUNIT_TEST() [20/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalPrism6  )

◆ CPPUNIT_TEST() [21/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalPyramid13  )

◆ CPPUNIT_TEST() [22/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalPyramid14  )

◆ CPPUNIT_TEST() [23/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalPyramid18  )

◆ CPPUNIT_TEST() [24/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalPyramid18MultipleSubdomains  )

◆ CPPUNIT_TEST() [25/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalPyramid5  )

◆ CPPUNIT_TEST() [26/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalQuad4  )

◆ CPPUNIT_TEST() [27/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalQuad4MultipleSubdomains  )

◆ CPPUNIT_TEST() [28/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalQuad4Tangled  )

◆ CPPUNIT_TEST() [29/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalQuad8  )

◆ CPPUNIT_TEST() [30/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalQuad9  )

◆ CPPUNIT_TEST() [31/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalQuad9MultipleSubdomains  )

◆ CPPUNIT_TEST() [32/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalQuadratureHourglass  )

◆ CPPUNIT_TEST() [33/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalTet10  )

◆ CPPUNIT_TEST() [34/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalTet14  )

◆ CPPUNIT_TEST() [35/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalTet14MultipleSubdomains  )

◆ CPPUNIT_TEST() [36/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalTet4  )

◆ CPPUNIT_TEST() [37/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalTri3  )

◆ CPPUNIT_TEST() [38/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalTri6  )

◆ CPPUNIT_TEST() [39/39]

MeshSmootherTest::CPPUNIT_TEST ( testVariationalTri6MultipleSubdomains  )

◆ CPPUNIT_TEST_SUITE_END()

MeshSmootherTest::CPPUNIT_TEST_SUITE_END ( )

◆ LIBMESH_CPPUNIT_TEST_SUITE()

MeshSmootherTest::LIBMESH_CPPUNIT_TEST_SUITE ( MeshSmootherTest  )

The goal of this test is to verify proper operation of the MeshSmoother subclasses.

◆ numCenteredAndFacedDimensions()

std::pair< unsigned int, unsigned int > MeshSmootherTest::numCenteredAndFacedDimensions ( const Point &  point,
const Real &  side_length,
const Real &  tol 
)
inline

Definition at line 362 of file mesh_smoother_test.C.

363 {
364 const auto half_length = 0.5 * side_length;
365 unsigned int num_centered = 0;
366 unsigned int num_face = 0;
367 for (const auto d : make_range(3))
368 {
369 const auto num_half_lengths = point(d) / half_length;
370 if (std::abs(num_half_lengths - std::round(num_half_lengths)) > tol)
371 // This coordinante does not occur at a sub-cube face or center
372 continue;
373
374 if (std::lround(num_half_lengths) % 2)
375 // An odd number of half lengths means point(d) is at a sub-cube center
376 ++num_centered;
377 else
378 // An odd number of half lengths means point(d) is on a sub-cube face
379 ++num_face;
380 }
381
382 return std::make_pair(num_centered, num_face);
383 }
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition int_range.h:176

References libMesh::make_range().

Referenced by pointIsCubeCenter(), pointIsCubeFaceCenter(), and pointIsCubeVertex().

◆ pointIsCubeCenter()

bool MeshSmootherTest::pointIsCubeCenter ( const Point &  point,
const Real &  side_length,
const Real &  tol = TOLERANCE 
)
inline

Definition at line 387 of file mesh_smoother_test.C.

388 {
389 return numCenteredAndFacedDimensions(point, side_length, tol).first == 3;
390 }
std::pair< unsigned int, unsigned int > numCenteredAndFacedDimensions(const Point &point, const Real &side_length, const Real &tol)

References numCenteredAndFacedDimensions().

Referenced by testVariationalSmoother().

◆ pointIsCubeFaceCenter()

bool MeshSmootherTest::pointIsCubeFaceCenter ( const Point &  point,
const Real &  side_length,
const Real &  tol = TOLERANCE 
)
inline

Definition at line 401 of file mesh_smoother_test.C.

402 {
403 const auto result = numCenteredAndFacedDimensions(point, side_length, tol);
404 return (result.first == 2) && (result.second == 1);
405 }

References numCenteredAndFacedDimensions().

Referenced by testVariationalSmoother().

◆ pointIsCubeVertex()

bool MeshSmootherTest::pointIsCubeVertex ( const Point &  point,
const Real &  side_length,
const Real &  tol = TOLERANCE 
)
inline

Definition at line 394 of file mesh_smoother_test.C.

395 {
396 return numCenteredAndFacedDimensions(point, side_length, tol).second == 3;
397 }

References numCenteredAndFacedDimensions().

Referenced by testVariationalSmoother().

◆ setUp()

void MeshSmootherTest::setUp ( )
inline

Definition at line 289 of file mesh_smoother_test.C.

289{}

◆ tearDown()

void MeshSmootherTest::tearDown ( )
inline

Definition at line 291 of file mesh_smoother_test.C.

291{}

◆ testConstraintLinePlane()

void MeshSmootherTest::testConstraintLinePlane ( )
inline

Definition at line 1092 of file mesh_smoother_test.C.

1093 {
1094 LOG_UNIT_TEST;
1095
1096 const PlaneConstraint plane(Point(0, 0, 0), Point(0, 0, 1));
1097 const LineConstraint line(Point(0, 0, 1), Point(1, 0, -1).unit());
1098 CPPUNIT_ASSERT(!line.is_parallel(plane));
1099
1100 for (const auto & intersection :
1101 {intersect_constraints(plane, line), intersect_constraints(line, plane)})
1102 {
1103 CPPUNIT_ASSERT(std::holds_alternative<PointConstraint>(intersection));
1104 CPPUNIT_ASSERT(
1105 std::get<PointConstraint>(intersection).point().absolute_fuzzy_equals(Point(1, 0, 0)));
1106 }
1107 }
Represents a line constraint defined by a base point and direction vector.
Represents a plane constraint defined by a point and normal vector.
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition point.h:41
bool absolute_fuzzy_equals(const T &var1, const T2 &var2, const Real tol=TOLERANCE *TOLERANCE)
Function to check whether two variables are equal within an absolute tolerance.
ConstraintVariant intersect_constraints(const ConstraintVariant &a, const ConstraintVariant &b)
Dispatch intersection between two constraint variants.

References libMesh::absolute_fuzzy_equals(), libMesh::intersect_constraints(), and libMesh::LineConstraint::is_parallel().

◆ testConstraintNearlyParallelPlanes()

void MeshSmootherTest::testConstraintNearlyParallelPlanes ( )
inline

Definition at line 1113 of file mesh_smoother_test.C.

1114 {
1115 LOG_UNIT_TEST;
1116
1117 // Angle between the plane normals, chosen so that angle > tol > angle^2
1118 // for the default tolerance TOLERANCE^2
1119 const Real angle = TOLERANCE;
1120 const PlaneConstraint plane1(Point(0, 0, 0), Point(0, 0, 1));
1121 const PlaneConstraint plane2(Point(0, 0, 0), Point(std::sin(angle), 0, std::cos(angle)));
1122 CPPUNIT_ASSERT(!(plane1 == plane2));
1123 CPPUNIT_ASSERT(!plane1.is_parallel(plane2));
1124
1125 const auto intersection = intersect_constraints(plane1, plane2);
1126 CPPUNIT_ASSERT(std::holds_alternative<LineConstraint>(intersection));
1127 const auto & line = std::get<LineConstraint>(intersection);
1128 CPPUNIT_ASSERT(line.direction().absolute_fuzzy_equals(Point(0, 1, 0)));
1129 CPPUNIT_ASSERT(line.contains_point(PointConstraint(Point(0, 0, 0))));
1130 }
Represents a fixed point constraint.
static constexpr Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

References libMesh::intersect_constraints(), libMesh::PlaneConstraint::is_parallel(), libMesh::Real, and libMesh::TOLERANCE.

◆ testLaplaceQuad()

void MeshSmootherTest::testLaplaceQuad ( )
inline

Definition at line 1074 of file mesh_smoother_test.C.

1075 {
1076 ReplicatedMesh mesh(*TestCommWorld);
1077 LaplaceMeshSmoother laplace(mesh, 8);
1078
1079 testLaplaceSmoother(mesh, laplace, QUAD4);
1080 }
void testLaplaceSmoother(ReplicatedMesh &mesh, MeshSmoother &smoother, ElemType type)
This class defines the data structures necessary for Laplace smoothing.
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
MeshBase & mesh

References mesh, libMesh::QUAD4, TestCommWorld, and testLaplaceSmoother().

◆ testLaplaceSmoother()

void MeshSmootherTest::testLaplaceSmoother ( ReplicatedMesh &  mesh,
MeshSmoother &  smoother,
ElemType  type 
)
inline

Definition at line 293 of file mesh_smoother_test.C.

294 {
295 LOG_UNIT_TEST;
296
297 constexpr unsigned int n_elems_per_side = 4;
298
300 mesh, n_elems_per_side, n_elems_per_side, 0., 1., 0., 1., type);
301
302 // Move it around so we have something that needs smoothing
303 DistortSquare ds;
305
306 // Assert the distortion is as expected
307 auto center_distortion_is =
308 [](const Node & node, int d, bool distortion, Real distortion_tol = TOLERANCE) {
309 const Real r = node(d);
310 const Real R = r * n_elems_per_side;
311 CPPUNIT_ASSERT_GREATER(-TOLERANCE * TOLERANCE, r);
312 CPPUNIT_ASSERT_GREATER(-TOLERANCE * TOLERANCE, 1 - r);
313
314 // If we're at the boundaries we should *never* be distorted
315 if (std::abs(node(0)) < TOLERANCE * TOLERANCE ||
316 std::abs(node(0) - 1) < TOLERANCE * TOLERANCE)
317 {
318 const Real R1 = node(1) * n_elems_per_side;
319 CPPUNIT_ASSERT_LESS(TOLERANCE * TOLERANCE, std::abs(R1 - std::round(R1)));
320 return true;
321 }
322
323 if (std::abs(node(1)) < TOLERANCE * TOLERANCE ||
324 std::abs(node(1) - 1) < TOLERANCE * TOLERANCE)
325 {
326 const Real R0 = node(0) * n_elems_per_side;
327 CPPUNIT_ASSERT_LESS(TOLERANCE * TOLERANCE, std::abs(R0 - std::round(R0)));
328
329 return true;
330 }
331
332 // If we're at the center we're fine
333 if (std::abs(r - 0.5) < TOLERANCE * TOLERANCE)
334 return true;
335
336 return ((std::abs(R - std::round(R)) > distortion_tol) == distortion);
337 };
338
339 for (auto node : mesh.node_ptr_range())
340 {
341 CPPUNIT_ASSERT(center_distortion_is(*node, 0, true));
342 CPPUNIT_ASSERT(center_distortion_is(*node, 1, true));
343 }
344
345 // Enough iterations to mostly fix us up. Laplace seems to be at 1e-3
346 // tolerance by iteration 6, so hopefully everything is there on any
347 // system by 8.
348 for (unsigned int i = 0; i != 8; ++i)
349 smoother.smooth();
350
351 // Make sure we're not too distorted anymore.
352 for (auto node : mesh.node_ptr_range())
353 {
354 CPPUNIT_ASSERT(center_distortion_is(*node, 0, false, 1e-3));
355 CPPUNIT_ASSERT(center_distortion_is(*node, 1, false, 1e-3));
356 }
357 }
virtual void smooth()=0
Function which actually performs the smoothing operations.
A Node is like a Point, but with more information.
Definition node.h:55
void build_square(UnstructuredMesh &mesh, const unsigned int nx, const unsigned int ny, const Real xmin=0., const Real xmax=1., const Real ymin=0., const Real ymax=1., const ElemType type=INVALID_ELEM, const bool gauss_lobatto_grid=false)
A specialized build_cube() for 2D meshes.
void redistribute(MeshBase &mesh, const FunctionBase< Real > &mapfunc)
Deterministically perturb the nodal locations.

References libMesh::MeshTools::Generation::build_square(), mesh, libMesh::Real, libMesh::MeshTools::Modification::redistribute(), libMesh::MeshSmoother::smooth(), and libMesh::TOLERANCE.

Referenced by testLaplaceQuad(), and testLaplaceTri().

◆ testLaplaceTri()

void MeshSmootherTest::testLaplaceTri ( )
inline

Definition at line 1082 of file mesh_smoother_test.C.

1083 {
1084 ReplicatedMesh mesh(*TestCommWorld);
1085 LaplaceMeshSmoother laplace(mesh, 8);
1086
1087 testLaplaceSmoother(mesh, laplace, TRI3);
1088 }

References mesh, TestCommWorld, testLaplaceSmoother(), and libMesh::TRI3.

◆ testVariationalEdge2()

void MeshSmootherTest::testVariationalEdge2 ( )
inline

Definition at line 1133 of file mesh_smoother_test.C.

1134 {
1135 Mesh mesh(*TestCommWorld);
1136 VariationalMeshSmoother variational(mesh);
1137
1138 testVariationalSmoother(mesh, variational, EDGE2);
1139 }
void testVariationalSmoother(Mesh &mesh, VariationalMeshSmoother &smoother, const ElemType type, const bool multiple_subdomains=false, const bool tangle_mesh=false, const Real tangle_damping_factor=1.0)
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
Definition mesh.h:51
This is an implementation of Larisa Branets' smoothing algorithms.

References libMesh::EDGE2, mesh, TestCommWorld, and testVariationalSmoother().

◆ testVariationalEdge3()

void MeshSmootherTest::testVariationalEdge3 ( )
inline

Definition at line 1141 of file mesh_smoother_test.C.

1142 {
1143 Mesh mesh(*TestCommWorld);
1144 VariationalMeshSmoother variational(mesh);
1145
1146 testVariationalSmoother(mesh, variational, EDGE3);
1147 }

References libMesh::EDGE3, mesh, TestCommWorld, and testVariationalSmoother().

◆ testVariationalEdge3MultipleSubdomains()

void MeshSmootherTest::testVariationalEdge3MultipleSubdomains ( )
inline

Definition at line 1149 of file mesh_smoother_test.C.

1150 {
1151 Mesh mesh(*TestCommWorld);
1152 VariationalMeshSmoother variational(mesh);
1153
1154 testVariationalSmoother(mesh, variational, EDGE3, true);
1155 }

References libMesh::EDGE3, mesh, TestCommWorld, and testVariationalSmoother().

◆ testVariationalHex20()

void MeshSmootherTest::testVariationalHex20 ( )
inline

Definition at line 1245 of file mesh_smoother_test.C.

1246 {
1247 Mesh mesh(*TestCommWorld);
1248 VariationalMeshSmoother variational(mesh);
1249
1250 testVariationalSmoother(mesh, variational, HEX20);
1251 }

References libMesh::HEX20, mesh, TestCommWorld, and testVariationalSmoother().

◆ testVariationalHex27()

void MeshSmootherTest::testVariationalHex27 ( )
inline

Definition at line 1253 of file mesh_smoother_test.C.

1254 {
1255 Mesh mesh(*TestCommWorld);
1256 VariationalMeshSmoother variational(mesh);
1257
1258 testVariationalSmoother(mesh, variational, HEX27);
1259 }

References libMesh::HEX27, mesh, TestCommWorld, and testVariationalSmoother().

◆ testVariationalHex27MultipleSubdomains()

void MeshSmootherTest::testVariationalHex27MultipleSubdomains ( )
inline

Definition at line 1261 of file mesh_smoother_test.C.

1262 {
1263 Mesh mesh(*TestCommWorld);
1264 VariationalMeshSmoother variational(mesh);
1265
1266 testVariationalSmoother(mesh, variational, HEX27, true);
1267 }

References libMesh::HEX27, mesh, TestCommWorld, and testVariationalSmoother().

◆ testVariationalHex27Tangled()

void MeshSmootherTest::testVariationalHex27Tangled ( )
inline

Definition at line 1269 of file mesh_smoother_test.C.

1270 {
1271 Mesh mesh(*TestCommWorld);
1272 VariationalMeshSmoother variational(mesh);
1273
1274 testVariationalSmoother(mesh, variational, HEX27, false, true, 0.55);
1275 }

References libMesh::HEX27, mesh, TestCommWorld, and testVariationalSmoother().

◆ testVariationalHex8()

void MeshSmootherTest::testVariationalHex8 ( )
inline

Definition at line 1237 of file mesh_smoother_test.C.

1238 {
1239 Mesh mesh(*TestCommWorld);
1240 VariationalMeshSmoother variational(mesh);
1241
1242 testVariationalSmoother(mesh, variational, HEX8);
1243 }

References libMesh::HEX8, mesh, TestCommWorld, and testVariationalSmoother().

◆ testVariationalMixed2D()

void MeshSmootherTest::testVariationalMixed2D ( )
inline

Definition at line 1409 of file mesh_smoother_test.C.

1410 {
1411 ReplicatedMesh mesh(*TestCommWorld);
1412 mesh.read("meshes/quad4_tri3_smoothed.xda.gz");
1413
1415 }
void testVariationalSmootherRegression(const ReplicatedMesh &gold_mesh)
virtual void read(const std::string &name, void *mesh_data=nullptr, bool skip_renumber_nodes_and_elements=false, bool skip_find_neighbors=false, bool skip_detect_interior_parents=false)=0
Interfaces for reading/writing a mesh to/from a file.

References mesh, libMesh::MeshBase::read(), TestCommWorld, and testVariationalSmootherRegression().

◆ testVariationalMixed3D()

void MeshSmootherTest::testVariationalMixed3D ( )
inline

Definition at line 1473 of file mesh_smoother_test.C.

1474 {
1475 ReplicatedMesh mesh(*TestCommWorld);
1476 mesh.read("meshes/hex8_prism6_smoothed.xda.gz");
1477
1479 }

References mesh, libMesh::MeshBase::read(), TestCommWorld, and testVariationalSmootherRegression().

◆ testVariationalPrism15()

void MeshSmootherTest::testVariationalPrism15 ( )
inline

Definition at line 1325 of file mesh_smoother_test.C.

1326 {
1327 Mesh mesh(*TestCommWorld);
1328 VariationalMeshSmoother variational(mesh);
1329
1330 testVariationalSmoother(mesh, variational, PRISM15);
1331 }

References mesh, libMesh::PRISM15, TestCommWorld, and testVariationalSmoother().

◆ testVariationalPrism18()

void MeshSmootherTest::testVariationalPrism18 ( )
inline

Definition at line 1333 of file mesh_smoother_test.C.

1334 {
1335 Mesh mesh(*TestCommWorld);
1336 VariationalMeshSmoother variational(
1337 mesh, 0.5, true, TOLERANCE * TOLERANCE, 10 * TOLERANCE * TOLERANCE);
1338
1339 testVariationalSmoother(mesh, variational, PRISM18);
1340 }

References mesh, libMesh::PRISM18, TestCommWorld, testVariationalSmoother(), and libMesh::TOLERANCE.

◆ testVariationalPrism20()

void MeshSmootherTest::testVariationalPrism20 ( )
inline

Definition at line 1342 of file mesh_smoother_test.C.

1343 {
1344 Mesh mesh(*TestCommWorld);
1345 VariationalMeshSmoother variational(
1346 mesh, 0.5, true, TOLERANCE * TOLERANCE, 10 * TOLERANCE * TOLERANCE);
1347
1348 testVariationalSmoother(mesh, variational, PRISM20);
1349 }

References mesh, libMesh::PRISM20, TestCommWorld, testVariationalSmoother(), and libMesh::TOLERANCE.

◆ testVariationalPrism21()

void MeshSmootherTest::testVariationalPrism21 ( )
inline

Definition at line 1351 of file mesh_smoother_test.C.

1352 {
1353 Mesh mesh(*TestCommWorld);
1354 VariationalMeshSmoother variational(
1355 mesh, 0.5, true, TOLERANCE * TOLERANCE, 10 * TOLERANCE * TOLERANCE);
1356
1357 testVariationalSmoother(mesh, variational, PRISM21);
1358 }

References mesh, libMesh::PRISM21, TestCommWorld, testVariationalSmoother(), and libMesh::TOLERANCE.

◆ testVariationalPrism21MultipleSubdomains()

void MeshSmootherTest::testVariationalPrism21MultipleSubdomains ( )
inline

Definition at line 1360 of file mesh_smoother_test.C.

1361 {
1362 Mesh mesh(*TestCommWorld);
1363 mesh.allow_renumbering(false);
1364 VariationalMeshSmoother variational(mesh);
1365
1366 testVariationalSmoother(mesh, variational, PRISM21, true);
1367 }
void allow_renumbering(bool allow)
If false is passed in then this mesh will no longer be renumbered when being prepared for use.
Definition mesh_base.h:1367

References libMesh::MeshBase::allow_renumbering(), mesh, libMesh::PRISM21, TestCommWorld, and testVariationalSmoother().

◆ testVariationalPrism6()

void MeshSmootherTest::testVariationalPrism6 ( )
inline

Definition at line 1317 of file mesh_smoother_test.C.

1318 {
1319 Mesh mesh(*TestCommWorld);
1320 VariationalMeshSmoother variational(mesh);
1321
1322 testVariationalSmoother(mesh, variational, PRISM6);
1323 }

References mesh, libMesh::PRISM6, TestCommWorld, and testVariationalSmoother().

◆ testVariationalPyramid13()

void MeshSmootherTest::testVariationalPyramid13 ( )
inline

Definition at line 1285 of file mesh_smoother_test.C.

1286 {
1287 Mesh mesh(*TestCommWorld);
1288 VariationalMeshSmoother variational(mesh);
1289
1290 testVariationalSmoother(mesh, variational, PYRAMID13);
1291 }

References mesh, libMesh::PYRAMID13, TestCommWorld, and testVariationalSmoother().

◆ testVariationalPyramid14()

void MeshSmootherTest::testVariationalPyramid14 ( )
inline

Definition at line 1293 of file mesh_smoother_test.C.

1294 {
1295 Mesh mesh(*TestCommWorld);
1296 VariationalMeshSmoother variational(mesh);
1297
1298 testVariationalSmoother(mesh, variational, PYRAMID14);
1299 }

References mesh, libMesh::PYRAMID14, TestCommWorld, and testVariationalSmoother().

◆ testVariationalPyramid18()

void MeshSmootherTest::testVariationalPyramid18 ( )
inline

Definition at line 1301 of file mesh_smoother_test.C.

1302 {
1303 Mesh mesh(*TestCommWorld);
1304 VariationalMeshSmoother variational(mesh);
1305
1306 testVariationalSmoother(mesh, variational, PYRAMID18);
1307 }

References mesh, libMesh::PYRAMID18, TestCommWorld, and testVariationalSmoother().

◆ testVariationalPyramid18MultipleSubdomains()

void MeshSmootherTest::testVariationalPyramid18MultipleSubdomains ( )
inline

Definition at line 1309 of file mesh_smoother_test.C.

1310 {
1311 Mesh mesh(*TestCommWorld);
1312 VariationalMeshSmoother variational(mesh, 0.0);
1313
1314 testVariationalSmoother(mesh, variational, PYRAMID18, true);
1315 }

References mesh, libMesh::PYRAMID18, TestCommWorld, and testVariationalSmoother().

◆ testVariationalPyramid5()

void MeshSmootherTest::testVariationalPyramid5 ( )
inline

Definition at line 1277 of file mesh_smoother_test.C.

1278 {
1279 Mesh mesh(*TestCommWorld);
1280 VariationalMeshSmoother variational(mesh);
1281
1282 testVariationalSmoother(mesh, variational, PYRAMID5);
1283 }

References mesh, libMesh::PYRAMID5, TestCommWorld, and testVariationalSmoother().

◆ testVariationalQuad4()

void MeshSmootherTest::testVariationalQuad4 ( )
inline

Definition at line 1157 of file mesh_smoother_test.C.

1158 {
1159 Mesh mesh(*TestCommWorld);
1160 VariationalMeshSmoother variational(mesh, 0.5, true, TOLERANCE * TOLERANCE, TOLERANCE * TOLERANCE, 100);
1161
1162 // High verbosity for a 3D mesh to increase code coverage, but silence the output
1163 // If we want to save the output for processing later, send it somewhere
1164 // besides nullptr
1165 std::streambuf * out_buf = libMesh::out.rdbuf(nullptr);
1166
1167 testVariationalSmoother(mesh, variational, QUAD4);
1168
1169 // Reset stdout
1170 libMesh::out.rdbuf(out_buf);
1171 }
streambufT * rdbuf() const
Get the associated stream buffer.
OStreamProxy out

References mesh, libMesh::out, libMesh::QUAD4, libMesh::BasicOStreamProxy< charT, traits >::rdbuf(), TestCommWorld, testVariationalSmoother(), and libMesh::TOLERANCE.

◆ testVariationalQuad4MultipleSubdomains()

void MeshSmootherTest::testVariationalQuad4MultipleSubdomains ( )
inline

Definition at line 1173 of file mesh_smoother_test.C.

1174 {
1175 Mesh mesh(*TestCommWorld);
1176 VariationalMeshSmoother variational(mesh);
1177
1178 testVariationalSmoother(mesh, variational, QUAD4, true);
1179 }

References mesh, libMesh::QUAD4, TestCommWorld, and testVariationalSmoother().

◆ testVariationalQuad4Tangled()

void MeshSmootherTest::testVariationalQuad4Tangled ( )
inline

Definition at line 1205 of file mesh_smoother_test.C.

1206 {
1207 Mesh mesh(*TestCommWorld);
1208 VariationalMeshSmoother variational(mesh);
1209
1210 testVariationalSmoother(mesh, variational, QUAD4, false, true, 0.65);
1211 }

References mesh, libMesh::QUAD4, TestCommWorld, and testVariationalSmoother().

◆ testVariationalQuad8()

void MeshSmootherTest::testVariationalQuad8 ( )
inline

Definition at line 1181 of file mesh_smoother_test.C.

1182 {
1183 Mesh mesh(*TestCommWorld);
1184 VariationalMeshSmoother variational(mesh);
1185
1186 testVariationalSmoother(mesh, variational, QUAD8);
1187 }

References mesh, libMesh::QUAD8, TestCommWorld, and testVariationalSmoother().

◆ testVariationalQuad9()

void MeshSmootherTest::testVariationalQuad9 ( )
inline

Definition at line 1189 of file mesh_smoother_test.C.

1190 {
1191 Mesh mesh(*TestCommWorld);
1192 VariationalMeshSmoother variational(mesh);
1193
1194 testVariationalSmoother(mesh, variational, QUAD9);
1195 }

References mesh, libMesh::QUAD9, TestCommWorld, and testVariationalSmoother().

◆ testVariationalQuad9MultipleSubdomains()

void MeshSmootherTest::testVariationalQuad9MultipleSubdomains ( )
inline

Definition at line 1197 of file mesh_smoother_test.C.

1198 {
1199 Mesh mesh(*TestCommWorld);
1200 VariationalMeshSmoother variational(mesh);
1201
1202 testVariationalSmoother(mesh, variational, QUAD9, true);
1203 }

References mesh, libMesh::QUAD9, TestCommWorld, and testVariationalSmoother().

◆ testVariationalQuadratureHourglass()

void MeshSmootherTest::testVariationalQuadratureHourglass ( )
inline

Definition at line 1434 of file mesh_smoother_test.C.

1435 {
1436 LOG_UNIT_TEST;
1437
1438 auto count_non_invertible = [](const MeshBase & m) {
1439 unsigned int n_bad = 0;
1440 for (const auto * elem : m.active_element_ptr_range())
1441 if (!elem->has_invertible_map())
1442 ++n_bad;
1443 return n_bad;
1444 };
1445
1446 // (1) Default Gauss rule: characterizes the bug. At least one element folds
1447 // into an hourglass and loses its invertible map. (If a future change to the
1448 // default smoother fixes this on its own, this assertion should be revisited.)
1449 {
1450 ReplicatedMesh mesh(*TestCommWorld);
1451 mesh.read("meshes/quad4_tri3_hourglass.xda.gz");
1452
1453 VariationalMeshSmoother smoother(mesh, 0.5, true);
1454 smoother.smooth();
1455
1456 CPPUNIT_ASSERT(count_non_invertible(mesh) > 0);
1457 }
1458
1459 // (2) Vertex-sampling rule (QNODAL): the metric now "sees" the corners, so
1460 // every element keeps an invertible map.
1461 {
1462 ReplicatedMesh mesh(*TestCommWorld);
1463 mesh.read("meshes/quad4_tri3_hourglass.xda.gz");
1464
1465 VariationalMeshSmoother smoother(mesh, 0.5, true);
1466 smoother.set_quadrature_type(QNODAL);
1467 smoother.smooth();
1468
1469 CPPUNIT_ASSERT_EQUAL(0u, count_non_invertible(mesh));
1470 }
1471 }
This is the MeshBase class.
Definition mesh_base.h:81

References mesh, libMesh::QNODAL, libMesh::MeshBase::read(), libMesh::VariationalMeshSmoother::set_quadrature_type(), libMesh::VariationalMeshSmoother::smooth(), and TestCommWorld.

◆ testVariationalSmoother()

void MeshSmootherTest::testVariationalSmoother ( Mesh &  mesh,
VariationalMeshSmoother &  smoother,
const ElemType  type,
const bool  multiple_subdomains = false,
const bool  tangle_mesh = false,
const Real  tangle_damping_factor = 1.0 
)
inline

Definition at line 407 of file mesh_smoother_test.C.

413 {
414 LOG_UNIT_TEST;
415
416 if (multiple_subdomains && tangle_mesh)
417 libmesh_not_implemented_msg(
418 "Arbitrary mesh tangling with multiple subdomains is not supported.");
419
420 // Get mesh dimension, determine whether type is triangular
421 const auto * ref_elem = &(ReferenceElem::get(type));
422 const auto dim = ref_elem->dim();
423 const bool type_is_tri = Utility::enum_to_string(type).compare(0, 3, "TRI") == 0;
424 const bool type_is_pyramid = Utility::enum_to_string(type).compare(0, 7, "PYRAMID") == 0;
425 const bool type_is_prism = Utility::enum_to_string(type).compare(0, 5, "PRISM") == 0;
426 const bool type_is_tet = Utility::enum_to_string(type).compare(0, 3, "TET") == 0;
427
428 // Used fewer elems for higher order types, as extra midpoint nodes will add
429 // enough complexity
430 unsigned int n_elems_per_side = 4 / Elem::type_to_default_order_map[type];
431 const auto side_length = 1.0 / n_elems_per_side;
432
433 switch (dim)
434 {
435 case 1:
436 MeshTools::Generation::build_line(mesh, n_elems_per_side, 0., 1., type);
437 break;
438 case 2:
440 mesh, n_elems_per_side, n_elems_per_side, 0., 1., 0., 1., type);
441 break;
442
443 case 3:
445 n_elems_per_side,
446 n_elems_per_side,
447 n_elems_per_side,
448 0.,
449 1.,
450 0.,
451 1.,
452 0.,
453 1.,
454 type);
455 break;
456
457 default:
458 libmesh_error_msg("Unsupported dimension " << dim);
459 }
460
461 // Move it around so we have something that needs smoothing
462 DistortHyperCube dh(dim);
464
465 const auto & boundary_info = mesh.get_boundary_info();
466 const auto & proc_id = mesh.processor_id();
467
468 if (tangle_mesh)
469 {
470 // We tangle the mesh by (partially) swapping the locations of 2 nodes.
471 // If the n-dimentional hypercube is represented as a grid with
472 // (undistorted) divisions occuring at integer numbers, we will
473 // (partially) swap the nodes nearest p1 = (1,1,1) and p2 = (2,1,2).
474
475 // Define p1 and p2 given the integer indices
476 // Undistorted elem side length
477 const Real dr = 1. / (n_elems_per_side * Elem::type_to_default_order_map[type]);
478 const Point p1 = Point(dr, dim > 1 ? dr : 0, dim > 2 ? dr : 0);
479 const Point p2 = Point(2. * dr, dim > 1 ? dr : 0, dim > 2 ? 2. * dr : 0);
480
481 // We need to find the nodes of the mesh that are closest to p1 and p2.
482 // This will require some parallel communication for distributed meshes.
483
484 // Distances between local mesh nodes and p1
485 std::map<dof_id_type, Real> dist1_map;
486 // Distances between local mesh nodes and p2
487 std::map<dof_id_type, Real> dist2_map;
488
489 for (const auto * node : mesh.local_node_ptr_range())
490 {
491 dist1_map[node->id()] = (*node - p1).norm();
492 dist2_map[node->id()] = (*node - p2).norm();
493 }
494
495 // Helper function to analyze a dist_map accross all processors and
496 // return the node id and spatial coordinates for the node with the
497 // smallest distance
498 auto get_closet_point_accross_all_procs =
499 [&mesh, &proc_id](const std::map<dof_id_type, Real> &dist_map) {
500
501 processor_id_type broadcasting_proc = 0;
502 Real d_min_local = std::numeric_limits<Real>::max();
504
505 // Only execute this if this proc owns any nodes. Otherwise,
506 // use default values defined above
507 if (dist_map.size())
508 {
509 // Iterator to the map entry with the smallest distance
510 auto min_it =
511 std::min_element(dist_map.begin(), dist_map.end(),
512 [](const auto &a, const auto &b) {
513 return a.second < b.second;
514 });
515
516 node_id = min_it->first;
517 d_min_local = min_it->second;
518 }
519
520 // Get the smallest distance accross all procs
521 auto d_min_global = d_min_local;
522 mesh.comm().min(d_min_global);
523
524 // Find the proc id, node_id, and spatial coordinantes for the
525 // node with the smallest distance
526 Point node;
527 if (d_min_local == d_min_global) {
528 broadcasting_proc = proc_id;
529 node = mesh.node_ref(node_id);
530 }
531
532 mesh.comm().max(broadcasting_proc);
533 // Broadcast information about this node to all procs
534 mesh.comm().broadcast(node_id, broadcasting_proc);
535 mesh.comm().broadcast(node, broadcasting_proc);
536
537 return std::pair(node_id, node);
538 };
539
540 const auto [node_id1, node1] =
541 get_closet_point_accross_all_procs(dist1_map);
542 const auto [node_id2, node2] =
543 get_closet_point_accross_all_procs(dist2_map);
544
545 // modify the nodes if they are on this proc
546 const auto displacement = tangle_damping_factor * (node1 - node2);
547 if (mesh.query_node_ptr(node_id1))
548 mesh.node_ref(node_id1) -= displacement;
549 if (mesh.query_node_ptr(node_id2))
550 mesh.node_ref(node_id2) += displacement;
551
552 SyncNodalPositions sync_object(mesh);
554 mesh.nodes_end(), sync_object);
555
556 // Make sure the mesh is tangled
557 // Need this to create the system we are about to access
558 smoother.setup();
559 const auto &unsmoothed_info = smoother.get_mesh_info();
560 CPPUNIT_ASSERT(unsmoothed_info.mesh_is_tangled);
561 }
562
563 // Add multiple subdomains if requested
564 std::unordered_map<subdomain_id_type, Real> distorted_subdomain_volumes;
565 subdomain_id_type highest_subdomain_id = 0;
566 if (multiple_subdomains)
567 {
568 // Modify the subdomain ids in an interesting way
569 for (auto * elem : mesh.active_element_ptr_range())
570 {
571 unsigned int subdomain_id = 0;
572 for (const auto d : make_range(dim))
573 if (elem->vertex_average()(d) > 0.5)
574 ++subdomain_id;
575 elem->subdomain_id() += subdomain_id;
576 }
577
578 // This loop should NOT be combined with the one above because we need to
579 // finish checking and updating subdomain ids for all elements before
580 // recording the final subdomain volumes.
581 for (auto *elem : mesh.active_element_ptr_range()) {
582 const auto sub_id = elem->subdomain_id();
583 // Don't double count an element's volume on multiple procs
584 if (elem->processor_id() != proc_id)
585 continue;
586 distorted_subdomain_volumes[sub_id] += elem->volume();
587 highest_subdomain_id = std::max(sub_id, highest_subdomain_id);
588 }
589
590 // Parallel communication
591 mesh.comm().max(highest_subdomain_id);
592 for (const auto sub_id : make_range(highest_subdomain_id + 1)) {
593 // Make sure sub_id exists in the map on this proc
594 if (distorted_subdomain_volumes.find(sub_id) ==
595 distorted_subdomain_volumes.end())
596 distorted_subdomain_volumes[sub_id] = 0.;
597
598 mesh.comm().sum(distorted_subdomain_volumes[sub_id]);
599 }
600 }
601
602 // We may have just invalidated the get_mesh_subdomains() cache by
603 // adding a new one, and libMesh marked our spatial_dimension()
604 // cache as invalidated in redistribute(). Just rebuild our
605 // caches before we start asking for anything like
606 // elem_default_orders().
608
609 // Get the mesh order
610 const auto & elem_orders = mesh.elem_default_orders();
611 libmesh_error_msg_if(elem_orders.size() != 1,
612 "The variational smoother cannot be used for mixed-order meshes!");
613 // For pyramids, the factor 2 accounts for the account that cubes of side
614 // length s are divided into pyramids of base side length s and height s/2.
615 // The factor 4 lets us catch triangular face midpoint nodes for PYRAMID18 elements.
616 // Similar reasoning for tets.
617 const auto scale_factor = *elem_orders.begin() * ((type_is_pyramid || type_is_tet) ? 2 * 4 : 1);
618
619 // Function to assert the node distortion is as expected
620 auto node_distortion_is = [&n_elems_per_side, &dim, &boundary_info, &scale_factor, &type_is_prism](
621 const Node & node, bool distortion, Real distortion_tol = TOLERANCE) {
622 // Get boundary ids associated with the node
623 std::vector<boundary_id_type> boundary_ids;
624 boundary_info.boundary_ids(&node, boundary_ids);
625
626 // This tells us what type of node we are: internal, sliding, or fixed
627 const auto num_dofs = dim - boundary_ids.size();
628 /*
629 * The following cases of num_dofs are possible, ASSUMING all boundaries
630 * are non-overlapping
631 * 3D: 3-0, 3-1, 3-2, 3-3
632 * = 3 2 1 0
633 * internal sliding, sliding, fixed
634 * 2D: 2-0, 2-1, 2-2
635 * = 2 1 0
636 * internal sliding, fixed
637 * 1D: 1-0, 1-1
638 * = 1 0
639 * internal fixed
640 *
641 * We expect that R is an integer in [0, n_elems_per_side] for
642 * num_dofs of the node's cooridinantes, while the remaining coordinates
643 * are fixed to the boundary with value 0 or 1. In other words, at LEAST
644 * dim - num_dofs coordinantes should be 0 or 1.
645 */
646
647 std::size_t num_zero_or_one = 0;
648
649 bool distorted = false;
650 for (const auto d : make_range(dim))
651 {
652 const Real r = node(d);
653 const Real R = r * n_elems_per_side * scale_factor;
654 CPPUNIT_ASSERT_GREATER(-distortion_tol * distortion_tol, r);
655 CPPUNIT_ASSERT_GREATER(-distortion_tol * distortion_tol, 1 - r);
656
657 bool d_distorted = std::abs(R - std::round(R)) > distortion_tol;
658 if (type_is_prism && (scale_factor == 3))
659 {
660 // Adjustment required for triangular face nodes of PRISM20/21 elements.
661 // These elements have fe_order 3. This takes care of nodes occuring at
662 // thirds, but not halves.
663 const Real R_prism = R / scale_factor * 2;
664 const bool d_distorted_prism =
665 std::abs(R_prism - std::round(R_prism)) > distortion_tol;
666 d_distorted &= d_distorted_prism;
667 }
668 distorted |= d_distorted;
669 num_zero_or_one += (absolute_fuzzy_equals(r, 0.) || absolute_fuzzy_equals(r, 1.));
670 }
671
672 CPPUNIT_ASSERT_GREATEREQUAL(dim - num_dofs, num_zero_or_one);
673
674 // We can never expect a fixed node to be distorted
675 if (num_dofs == 0)
676 // if (num_dofs < dim)
677 return true;
678 return distorted == distortion;
679 };
680
681 // Make sure our DistortHyperCube transformation has distorted the mesh
682 for (auto node : mesh.node_ptr_range())
683 CPPUNIT_ASSERT(node_distortion_is(*node, true));
684
685 // Transform the square mesh of triangles to a parallelogram mesh of
686 // triangles. This will allow the Variational Smoother to smooth the mesh
687 // to the optimal case of equilateral triangles
688 if (type_is_tri)
689 {
690 // Transform the square mesh of triangles to a parallelogram mesh of
691 // triangles. This will allow the Variational Smoother to smooth the mesh
692 // to the optimal case of equilateral triangles
693 SquareToParallelogram stp;
695 }
696 else if (type_is_prism)
697 {
698 // Transform the cube mesh of prisms to a parallelepiped mesh of
699 // prisms. This will allow the Variational Smoother to smooth the mesh
700 // to the optimal case of equilateral triangular prisms
701 CubeToParallelepiped ctp;
703 }
704
705 smoother.smooth();
706
707 if (type_is_tri)
708 {
709 // Transform the parallelogram mesh back to a square mesh. In the case of
710 // the Variational Smoother, equilateral triangules will be transformed
711 // into right triangules that align with the original undistorted mesh.
712 ParallelogramToSquare pts;
714 }
715 else if (type_is_prism)
716 {
717 // Transform the parallelepiped mesh back to a cube mesh. In the case of
718 // the Variational Smoother, equilateral triangular prisms will be transformed
719 // into right triangular prisms that align with the original undistorted mesh.
720 ParallelepipedToCube ptc;
722 }
723
724 if (multiple_subdomains)
725 {
726 // Make sure the subdomain volumes didn't change. Although this doesn't
727 // guarantee that the subdomain didn't change, it is a good indicator
728 // and is friedly to sliding subdomain boundary nodes.
729 std::unordered_map<subdomain_id_type, Real> smoothed_subdomain_volumes;
730 for (auto *elem : mesh.active_element_ptr_range()) {
731 // Don't double count an element's volume on multiple procs
732 if (elem->processor_id() != proc_id)
733 continue;
734 smoothed_subdomain_volumes[elem->subdomain_id()] += elem->volume();
735 }
736
737 // Parallel communication
738 for (const auto sub_id : make_range(highest_subdomain_id + 1)) {
739 // Make sure sub_id exists in the map on this proc
740 if (smoothed_subdomain_volumes.find(sub_id) ==
741 smoothed_subdomain_volumes.end())
742 smoothed_subdomain_volumes[sub_id] = 0.;
743
744 mesh.comm().sum(smoothed_subdomain_volumes[sub_id]);
745 }
746
747 for (const auto sub_id : make_range(highest_subdomain_id + 1))
748 CPPUNIT_ASSERT(relative_fuzzy_equals(
749 libmesh_map_find(distorted_subdomain_volumes, sub_id),
750 libmesh_map_find(smoothed_subdomain_volumes, sub_id), TOLERANCE));
751 }
752 else
753 {
754 std::unordered_map<dof_id_type, std::vector<const Elem *>> nodes_to_elem_map;
755 MeshTools::build_nodes_to_elem_map(mesh, nodes_to_elem_map);
756
757 // Make sure we're not too distorted anymore, using the given
758 // tolerance.
759 std::set<dof_id_type> nodes_checked;
760 const Real tol = TOLERANCE;
761
762 for (const auto * elem : mesh.active_element_ptr_range())
763 {
764 for (const auto local_node_id : make_range(elem->n_nodes()))
765 {
766 const auto & node = elem->node_ref(local_node_id);
767 if (nodes_checked.find(node.id()) != nodes_checked.end())
768 continue;
769
770 nodes_checked.insert(node.id());
771
772 // Check for special case where pyramidal base-to-apex midpoint
773 // nodes are not smoothed to the actual midpoints.
774 if (type_is_pyramid)
775 {
776 if (local_node_id > 8 && local_node_id < 13)
777 {
778 // Base-Apex midpoint nodes
779 //
780 // Due to the nature of the pyramidal target element and the
781 // cubic nature of the test mesh, for a dilation weight o
782 // 0.5, smoothed base-apex midpoint nodes are smoothed to
783 // the point base + x * (apex - base) instead of
784 // base + 0.5 (apex - base), where x is in (0,1) and
785 // depends on the number of nodes in the element.
786 // We hard-code this check below.
787
788 const auto & base = elem->node_ref(local_node_id - 9);
789 const auto & apex = elem->node_ref(4);
790 const Real x = (type == PYRAMID18) ? 0.56646084 : 0.54985875;
791
792 CPPUNIT_ASSERT(node.absolute_fuzzy_equals(base + x * (apex - base), tol));
793 continue;
794 }
795 else if (local_node_id > 13)
796 {
797 // Triangular face midpoint nodes
798 //
799 // Due to the nature of the pyramidal target element and the
800 // cubic nature of the test mesh, for a dilation weight o
801 // 0.5, smoothed triangular face midpoint nodes are
802 // smoothed a weighted average of the constituent
803 // vertices instead of an unweighted average.
804 // We hard-code this check below.
805 const auto & base1 = elem->node_ref(local_node_id - 14);
806 const auto & base2 = elem->node_ref((local_node_id - 13) % 4);
807 const auto & apex = elem->node_ref(4);
808
809 const auto node_approx =
810 (0.31401599 * base1 + 0.31401599 * base2 + 0.37196802 * apex);
811 CPPUNIT_ASSERT(node.absolute_fuzzy_equals(node_approx, tol));
812 continue;
813 }
814 }
815
816 // Check for special case where some tet midpoint nodes are not
817 // smoothed to the actual midpoints.
818 else if (type_is_tet && !elem->is_vertex(local_node_id))
819 {
820 // We have a non-vertex node. Determine what "type" of
821 // midpoint node with respect to the mesh geometry.
822 // First, get the nodes that neighbor this node
823 std::vector<const Node *> neighbors;
825 mesh, node, nodes_to_elem_map, neighbors);
826
827 switch (neighbors.size())
828 {
829 case 2: {
830 // Midpoint node
831 // Determine what "type" of midpoint node
832
833 // Is one of the neighbors at the center of a sub-cube?
834 const auto is_0_cube_center =
835 pointIsCubeCenter(*neighbors[0], side_length);
836 const auto is_1_cube_center =
837 pointIsCubeCenter(*neighbors[1], side_length);
838 libmesh_assert(!(is_0_cube_center && is_1_cube_center));
839
840 if (is_0_cube_center || is_1_cube_center)
841 {
842 const auto & cube_center =
843 is_0_cube_center ? *neighbors[0] : *neighbors[1];
844 const auto & other =
845 is_0_cube_center ? *neighbors[1] : *neighbors[0];
846
847 // Since one neighbor is a sub-cube center, the
848 // other will either be a sub-cube face center or
849 // a sub-cube vertex. Determine which one.
850 if (pointIsCubeFaceCenter(other, side_length))
851 {
852 const Real x = (type == TET10) ? 0.42895041 : 0.41486385;
853 CPPUNIT_ASSERT(node.absolute_fuzzy_equals(
854 other + x * (cube_center - other), tol));
855 }
856
857 else if (pointIsCubeVertex(other, side_length))
858 {
859 const Real x = (type == TET10) ? 0.55388920 : 0.58093516;
860 CPPUNIT_ASSERT(node.absolute_fuzzy_equals(
861 other + x * (cube_center - other), tol));
862 }
863 }
864
865 else
866 {
867 // The remaining possibilities are
868 // cube-vertex-to-cube-vertex midpoints and
869 // cube-vertex-to-cube-face-center midpoints.
870 const auto is_0_cube_vertex =
871 pointIsCubeVertex(*neighbors[0], side_length);
872 const auto is_1_cube_vertex =
873 pointIsCubeVertex(*neighbors[1], side_length);
874 const auto is_0_cube_face_center =
875 pointIsCubeFaceCenter(*neighbors[0], side_length);
876 const auto is_1_cube_face_center =
877 pointIsCubeFaceCenter(*neighbors[1], side_length);
878
879 if (is_0_cube_vertex && is_1_cube_vertex)
880 // Due to symmetry, this type of midpoint is
881 // the geometric midpoint. Let the
882 // node_distortion_is function check it
883 CPPUNIT_ASSERT(node_distortion_is(node, false));
884
885 else
886 {
887 libmesh_error_msg_if(
888 (is_0_cube_center || is_0_cube_face_center) &&
889 (is_1_cube_center || is_1_cube_face_center),
890 "We should never get here!");
891 const auto & cube_vertex =
892 is_0_cube_vertex ? *neighbors[0] : *neighbors[1];
893 const auto & cube_face_center =
894 is_0_cube_face_center ? *neighbors[0] : *neighbors[1];
895 const Real x = (type == TET10) ? 0.61299101 : 0.65125580;
896 CPPUNIT_ASSERT(node.absolute_fuzzy_equals(
897 cube_vertex + x * (cube_face_center - cube_vertex), tol));
898 }
899 }
900
901 continue;
902 break;
903 }
904
905 case 6: {
906 // Face node
907 // Only keep the face vertex nodes
908 neighbors.erase(std::remove_if(neighbors.begin(),
909 neighbors.end(),
910 [&elem](const Node * n) {
911 return !elem->is_vertex(
912 elem->local_node(n->id()));
913 }),
914 neighbors.end());
915
916 // There are three types of faces:
917 //
918 // 1) Isoscelese triangle with vertices at two
919 // sub-cube vertices and the sub-cube center,
920 // 2) Isosceles triangle with vertices at two
921 // sub-cube vertices and a sub-cube face center,
922 // 3) Scalene triangle with vertices at a sub-cube
923 // center, a sub-cube vertex, and a sub-cube face
924 // center.
925 //
926 // Determine which kind of face this node belongs to based on the vertex
927 // neighbors
928
929 unsigned int num_vertices_at_cube_center = 0;
930 unsigned int num_vertices_at_cube_vertices = 0;
931 unsigned int num_vertices_at_cube_face_centers = 0;
932 for (const auto * neighbor : neighbors)
933 {
934 if (pointIsCubeCenter(*neighbor, side_length))
935 num_vertices_at_cube_center += 1;
936 else if (pointIsCubeVertex(*neighbor, side_length))
937 num_vertices_at_cube_vertices += 1;
938 else if (pointIsCubeFaceCenter(*neighbor, side_length))
939 num_vertices_at_cube_face_centers += 1;
940 }
941
942 // We will express the face node at a linear
943 // combination of the face vertices
944 Node node_approx = Node(0, 0, 0);
945
946 // Isosceles triangular face
947 if (num_vertices_at_cube_vertices == 2)
948 {
949 // Isosceles triangular face (type 1)
950 if (num_vertices_at_cube_center)
951 for (const auto * neighbor : neighbors)
952 {
953 Real weight;
954 if (pointIsCubeVertex(*neighbor, side_length))
955 weight = 0.30600747;
956 else if (pointIsCubeCenter(*neighbor, side_length))
957 weight = 0.38798506;
958 else
959 libmesh_error_msg("We should never get here!");
960
961 node_approx += weight * (*neighbor);
962 }
963
964 // Isosceles triangular face (type 2)
965 else if (num_vertices_at_cube_face_centers)
966 for (const auto * neighbor : neighbors)
967 {
968 Real weight;
969 if (pointIsCubeVertex(*neighbor, side_length))
970 weight = 0.28078090;
971 else if (pointIsCubeFaceCenter(*neighbor, side_length))
972 weight = 0.43843820;
973 else
974 libmesh_error_msg("We should never get here!");
975
976 node_approx += weight * (*neighbor);
977 }
978
979 else
980 libmesh_error_msg("We should never get here!");
981 }
982
983 // Scalene triangular face (type 3)
984 else if (num_vertices_at_cube_center && num_vertices_at_cube_vertices &&
985 num_vertices_at_cube_face_centers)
986 for (const auto * neighbor : neighbors)
987 {
988 Real weight;
989 if (pointIsCubeCenter(*neighbor, side_length))
990 weight = 0.33102438;
991 else if (pointIsCubeVertex(*neighbor, side_length))
992 weight = 0.27147230;
993 else if (pointIsCubeFaceCenter(*neighbor, side_length))
994 weight = 0.39750332;
995 else
996 libmesh_error_msg("We should never get here!");
997
998 node_approx += weight * (*neighbor);
999 }
1000
1001 else
1002 libmesh_error_msg("We should never get here!");
1003
1004 CPPUNIT_ASSERT(node.absolute_fuzzy_equals(node_approx, tol));
1005
1006 continue;
1007 break;
1008 }
1009 default: {
1010 libmesh_error_msg(node << " has unexpected number of neighbors ("
1011 << neighbors.size() << ")");
1012 break;
1013 }
1014 } // switch (neighbors.size())
1015 } // if (type_is_tet)
1016
1017 CPPUNIT_ASSERT(node_distortion_is(node, false));
1018
1019 }
1020 }
1021 }
1022 }
unsigned int dim
bool pointIsCubeFaceCenter(const Point &point, const Real &side_length, const Real &tol=TOLERANCE)
bool pointIsCubeCenter(const Point &point, const Real &side_length, const Real &tol=TOLERANCE)
bool pointIsCubeVertex(const Point &point, const Real &side_length, const Real &tol=TOLERANCE)
void max(const T &r, T &o, Request &req) const
void min(const T &r, T &o, Request &req) const
void broadcast(T &data, const unsigned int root_id=0, const bool identical_sizes=false) const
static constexpr dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition dof_object.h:473
static const Order type_to_default_order_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the default approximation order of...
Definition elem.h:1089
virtual const Node & node_ref(const dof_id_type i) const
Definition mesh_base.h:750
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
Definition mesh_base.h:178
virtual const Node * query_node_ptr(const dof_id_type i) const =0
const std::set< Order > & elem_default_orders() const
Definition mesh_base.h:2809
processor_id_type processor_id() const
const Parallel::Communicator & comm() const
virtual void smooth() override
Redefinition of the smooth function from the base class.
const MeshQualityInfo & get_mesh_info() const
Getter for the _system's _mesh_info attribute.
virtual void setup()
Setup method that creates equation systems, system, and constraints, to be called just prior to smoot...
static const Real b
void build_line(UnstructuredMesh &mesh, const unsigned int nx, const Real xmin=0., const Real xmax=1., const ElemType type=INVALID_ELEM, const bool gauss_lobatto_grid=false)
A specialized build_cube() for 1D meshes.
void build_cube(UnstructuredMesh &mesh, const unsigned int nx=0, const unsigned int ny=0, const unsigned int nz=0, const Real xmin=0., const Real xmax=1., const Real ymin=0., const Real ymax=1., const Real zmin=0., const Real zmax=1., const ElemType type=INVALID_ELEM, const bool gauss_lobatto_grid=false)
Builds a (elements) cube.
dof_id_type weight(const MeshBase &mesh, const processor_id_type pid)
Definition mesh_tools.C:508
void build_nodes_to_elem_map(const MeshBase &mesh, std::vector< std::vector< dof_id_type > > &nodes_to_elem_map)
After calling this function the input vector nodes_to_elem_map will contain the node to element conne...
Definition mesh_tools.C:520
void find_nodal_or_face_neighbors(const MeshBase &mesh, const Node &node, const std::unordered_map< dof_id_type, std::vector< const Elem * > > &nodes_to_elem_map, std::vector< const Node * > &neighbors)
Given a mesh and a node in the mesh, the vector will be filled with every node directly attached to t...
void sync_dofobject_data_by_id(const Communicator &comm, const Iterator &range_begin, const Iterator &range_end, SyncFunctor &sync)
Request data about a range of ghost dofobjects uniquely identified by their id.
const Elem & get(const ElemType type_in)
LIBMESH_DEVICE_INLINE auto norm(const T &a)
std::string enum_to_string(const T e)
bool relative_fuzzy_equals(const T &var1, const T2 &var2, const Real tol=TOLERANCE *TOLERANCE)
Function to check whether two variables are equal within a relative tolerance.
libmesh_assert(ctx)
uint8_t dof_id_type
Definition id_types.h:67
uint8_t processor_id_type
Definition id_types.h:104
const dof_id_type n_nodes
Definition tecplot_io.C:67

References libMesh::absolute_fuzzy_equals(), b, libMesh::Parallel::Communicator::broadcast(), libMesh::MeshTools::Generation::build_cube(), libMesh::MeshTools::Generation::build_line(), libMesh::MeshTools::build_nodes_to_elem_map(), libMesh::MeshTools::Generation::build_square(), libMesh::MeshBase::cache_elem_data(), libMesh::ParallelObject::comm(), dim, libMesh::MeshBase::elem_default_orders(), libMesh::Utility::enum_to_string(), libMesh::MeshTools::find_nodal_or_face_neighbors(), libMesh::ReferenceElem::get(), libMesh::MeshBase::get_boundary_info(), libMesh::VariationalMeshSmoother::get_mesh_info(), libMesh::DofObject::invalid_id, libMesh::libmesh_assert(), libMesh::make_range(), libMesh::Parallel::Communicator::max(), mesh, libMesh::Parallel::Communicator::min(), libMesh::MeshBase::node_ref(), pointIsCubeCenter(), pointIsCubeFaceCenter(), pointIsCubeVertex(), libMesh::ParallelObject::processor_id(), libMesh::PYRAMID18, libMesh::MeshBase::query_node_ptr(), libMesh::Real, libMesh::MeshTools::Modification::redistribute(), libMesh::relative_fuzzy_equals(), libMesh::VariationalMeshSmoother::setup(), libMesh::VariationalMeshSmoother::smooth(), libMesh::Parallel::Communicator::sum(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::TET10, libMesh::TOLERANCE, and libMesh::Elem::type_to_default_order_map.

Referenced by testVariationalEdge2(), testVariationalEdge3(), testVariationalEdge3MultipleSubdomains(), testVariationalHex20(), testVariationalHex27(), testVariationalHex27MultipleSubdomains(), testVariationalHex27Tangled(), testVariationalHex8(), testVariationalPrism15(), testVariationalPrism18(), testVariationalPrism20(), testVariationalPrism21(), testVariationalPrism21MultipleSubdomains(), testVariationalPrism6(), testVariationalPyramid13(), testVariationalPyramid14(), testVariationalPyramid18(), testVariationalPyramid18MultipleSubdomains(), testVariationalPyramid5(), testVariationalQuad4(), testVariationalQuad4MultipleSubdomains(), testVariationalQuad4Tangled(), testVariationalQuad8(), testVariationalQuad9(), testVariationalQuad9MultipleSubdomains(), testVariationalTet10(), testVariationalTet14(), testVariationalTet14MultipleSubdomains(), testVariationalTet4(), testVariationalTri3(), testVariationalTri6(), and testVariationalTri6MultipleSubdomains().

◆ testVariationalSmootherRegression()

void MeshSmootherTest::testVariationalSmootherRegression ( const ReplicatedMesh &  gold_mesh)
inline

Definition at line 1026 of file mesh_smoother_test.C.

1027 {
1028 // Make a copy of the gold mesh to distort and then smooth
1029 ReplicatedMesh mesh(gold_mesh);
1030
1031 // Move it around so we have something that needs smoothing
1032 DistortHyperCube dh(mesh.mesh_dimension());
1034
1035 // Function to assert the distortion is as expected
1036 auto mesh_distortion_is = [](const ReplicatedMesh & gold_mesh,
1037 const ReplicatedMesh & mesh,
1038 const bool distortion,
1039 Real distortion_tol = TOLERANCE) {
1040
1041 CPPUNIT_ASSERT(gold_mesh.n_nodes() == mesh.n_nodes());
1042 for (const auto node_id : make_range(gold_mesh.n_nodes()))
1043 {
1044 const auto & gold_node = gold_mesh.node_ref(node_id);
1045 const auto & node = mesh.node_ref(node_id);
1046 for (const auto d : make_range(gold_mesh.mesh_dimension()))
1047 {
1048 const bool d_distorted = std::abs(gold_node(d) - node(d)) > distortion_tol;
1049 if (d_distorted)
1050 // mesh is distorted from gold_mesh
1051 return distortion;
1052 }
1053 }
1054
1055 // mesh is not distorted from gold_mesh
1056 return !distortion;
1057 };
1058
1059 // Make sure the mesh has been distorted
1060 CPPUNIT_ASSERT(mesh_distortion_is(gold_mesh, mesh, true));
1061
1062 // Turn off subdomain boundary preservation because DistortHyperCube
1063 // does not preserve subdomain boundaries
1064 // Also set dilation coefficient to 0 because the reference volume of the
1065 // distorted mesh won't be equal to the reference volume of the smoothed
1066 // mesh and will smooth to a slightly different solution.
1067 VariationalMeshSmoother smoother(mesh, 0.0, false);
1068 smoother.smooth();
1069
1070 // Make sure the mesh has been smoothed to the gold mesh
1071 CPPUNIT_ASSERT(mesh_distortion_is(gold_mesh, mesh, false));
1072 }
unsigned int mesh_dimension() const
Definition mesh_base.C:515
virtual dof_id_type n_nodes() const =0
virtual dof_id_type n_nodes() const override final

References libMesh::make_range(), mesh, libMesh::MeshBase::mesh_dimension(), libMesh::MeshBase::n_nodes(), libMesh::ReplicatedMesh::n_nodes(), libMesh::MeshBase::node_ref(), libMesh::Real, libMesh::MeshTools::Modification::redistribute(), libMesh::VariationalMeshSmoother::smooth(), and libMesh::TOLERANCE.

Referenced by testVariationalMixed2D(), and testVariationalMixed3D().

◆ testVariationalTet10()

void MeshSmootherTest::testVariationalTet10 ( )
inline

Definition at line 1385 of file mesh_smoother_test.C.

1386 {
1387 Mesh mesh(*TestCommWorld);
1388 VariationalMeshSmoother variational(mesh);
1389
1390 testVariationalSmoother(mesh, variational, TET10);
1391 }

References mesh, TestCommWorld, testVariationalSmoother(), and libMesh::TET10.

◆ testVariationalTet14()

void MeshSmootherTest::testVariationalTet14 ( )
inline

Definition at line 1393 of file mesh_smoother_test.C.

1394 {
1395 Mesh mesh(*TestCommWorld);
1396 VariationalMeshSmoother variational(mesh);
1397
1398 testVariationalSmoother(mesh, variational, TET14);
1399 }

References mesh, TestCommWorld, testVariationalSmoother(), and libMesh::TET14.

◆ testVariationalTet14MultipleSubdomains()

void MeshSmootherTest::testVariationalTet14MultipleSubdomains ( )
inline

Definition at line 1401 of file mesh_smoother_test.C.

1402 {
1403 Mesh mesh(*TestCommWorld);
1404 VariationalMeshSmoother variational(mesh);
1405
1406 testVariationalSmoother(mesh, variational, TET14, true);
1407 }

References mesh, TestCommWorld, testVariationalSmoother(), and libMesh::TET14.

◆ testVariationalTet4()

void MeshSmootherTest::testVariationalTet4 ( )
inline

Definition at line 1369 of file mesh_smoother_test.C.

1370 {
1371 Mesh mesh(*TestCommWorld);
1372 VariationalMeshSmoother variational(mesh, 0.5, true, TOLERANCE * TOLERANCE, TOLERANCE * TOLERANCE, 100);
1373
1374 // High verbosity for a 3D mesh to increase code coverage, but silence the output
1375 // If we want to save the output for processing later, send it somewhere
1376 // besides nullptr
1377 std::streambuf * out_buf = libMesh::out.rdbuf(nullptr);
1378
1379 testVariationalSmoother(mesh, variational, TET4);
1380
1381 // Reset stdout
1382 libMesh::out.rdbuf(out_buf);
1383 }

References mesh, libMesh::out, libMesh::BasicOStreamProxy< charT, traits >::rdbuf(), TestCommWorld, testVariationalSmoother(), libMesh::TET4, and libMesh::TOLERANCE.

◆ testVariationalTri3()

void MeshSmootherTest::testVariationalTri3 ( )
inline

Definition at line 1213 of file mesh_smoother_test.C.

1214 {
1215 Mesh mesh(*TestCommWorld);
1216 VariationalMeshSmoother variational(mesh);
1217
1218 testVariationalSmoother(mesh, variational, TRI3);
1219 }

References mesh, TestCommWorld, testVariationalSmoother(), and libMesh::TRI3.

◆ testVariationalTri6()

void MeshSmootherTest::testVariationalTri6 ( )
inline

Definition at line 1221 of file mesh_smoother_test.C.

1222 {
1223 Mesh mesh(*TestCommWorld);
1224 VariationalMeshSmoother variational(mesh);
1225
1226 testVariationalSmoother(mesh, variational, TRI6);
1227 }

References mesh, TestCommWorld, testVariationalSmoother(), and libMesh::TRI6.

◆ testVariationalTri6MultipleSubdomains()

void MeshSmootherTest::testVariationalTri6MultipleSubdomains ( )
inline

Definition at line 1229 of file mesh_smoother_test.C.

1230 {
1231 Mesh mesh(*TestCommWorld);
1232 VariationalMeshSmoother variational(mesh);
1233
1234 testVariationalSmoother(mesh, variational, TRI3, true);
1235 }

References mesh, TestCommWorld, testVariationalSmoother(), and libMesh::TRI3.


The documentation for this class was generated from the following file: