Skip to content

Commit 3a0c628

Browse files
committed
fix
1 parent e50e94f commit 3a0c628

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed

tests/mesh/mesh_smoother.C

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,42 +29,58 @@ private:
2929
{
3030
// load input mesh
3131
ReplicatedMesh in_mesh(*TestCommWorld);
32-
ExodusII_IO exii(in_mesh);
32+
ExodusII_IO in_exii(in_mesh);
3333
if (in_mesh.processor_id() == 0)
34-
exii.read(in_file);
34+
in_exii.read(in_file);
35+
in_mesh.allow_renumbering(false);
3536
MeshCommunication().broadcast(in_mesh);
36-
in_mesh.prepare_for_use();
3737

3838
// load gold file
3939
ReplicatedMesh gold_mesh(*TestCommWorld);
40-
ExodusII_IO exii(gold_mesh);
40+
ExodusII_IO gold_exii(gold_mesh);
4141
if (gold_mesh.processor_id() == 0)
42-
exii.read(gold_file);
42+
gold_exii.read(gold_file);
43+
gold_mesh.allow_renumbering(false);
4344
MeshCommunication().broadcast(gold_mesh);
44-
gold_mesh.prepare_for_use();
4545

4646
// run mesh smoother for 100 iterations
4747
LaplaceMeshSmoother lms(static_cast<UnstructuredMesh &>(in_mesh), move_nodes);
4848
lms.smooth(100);
4949

5050
// compare node positions
51-
for (const auto & node : in_mesh.node_ref_range())
52-
{
53-
Point a = node;
54-
Point b = gold_mesh.node_ref(node->id());
55-
CPPUNIT_ASSERT((a-b).norm() < 1e-6);
56-
}
51+
for (const auto &node : in_mesh.node_ptr_range())
52+
{
53+
Point a = *node;
54+
Point b = gold_mesh.node_ref(node->id());
55+
CPPUNIT_ASSERT((a - b).norm() < 1e-6);
56+
}
5757
}
5858

5959
public:
6060
void setUp() {}
6161

6262
void tearDown() {}
6363

64-
void laplace_smooth_2d_fixed_boundary_nodes() { LOG_UNIT_TEST; test("meshes/smooth2d_in.e", "smooth2d_nomove.e", false); }
65-
void laplace_smooth_2d_movable_boundary_nodes() { LOG_UNIT_TEST; test("meshes/smooth2d_in.e", "smooth2d_move.e", true); }
66-
void laplace_smooth_3d_fixed_boundary_nodes() { LOG_UNIT_TEST; test("meshes/smooth3d_in.e", "smooth3d_nomove.e", false); }
67-
void laplace_smooth_3d_movable_boundary_nodes() { LOG_UNIT_TEST; test("meshes/smooth3d_in.e", "smooth3d_move.e", true); }
64+
void laplace_smooth_2d_fixed_boundary_nodes()
65+
{
66+
LOG_UNIT_TEST;
67+
test("meshes/smooth2d_in.e", "meshes/smooth2d_nomove.e", false);
68+
}
69+
void laplace_smooth_2d_movable_boundary_nodes()
70+
{
71+
LOG_UNIT_TEST;
72+
test("meshes/smooth2d_in.e", "meshes/smooth2d_move.e", true);
73+
}
74+
void laplace_smooth_3d_fixed_boundary_nodes()
75+
{
76+
LOG_UNIT_TEST;
77+
test("meshes/smooth3d_in.e", "meshes/smooth3d_nomove.e", false);
78+
}
79+
void laplace_smooth_3d_movable_boundary_nodes()
80+
{
81+
LOG_UNIT_TEST;
82+
test("meshes/smooth3d_in.e", "meshes/smooth3d_move.e", true);
83+
}
6884
};
6985

70-
CPPUNIT_TEST_SUITE_REGISTRATION(CopyNodesAndElementsTest);
86+
CPPUNIT_TEST_SUITE_REGISTRATION(SmoothMeshTest);

0 commit comments

Comments
 (0)