forked from libMesh/libmesh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#include <libmesh/replicated_mesh.h> | ||
#include <libmesh/distributed_mesh.h> | ||
#include <libmesh/mesh_generation.h> | ||
#include <libmesh/libmesh_config.h> | ||
#include <libmesh/mesh_modification.h> | ||
#include <libmesh/mesh_smoother_laplace.h> | ||
|
||
#include "test_comm.h" | ||
#include "libmesh_cppunit.h" | ||
|
||
using namespace libMesh; | ||
|
||
class SmoothMeshTest : public CppUnit::TestCase | ||
{ | ||
public: | ||
LIBMESH_CPPUNIT_TEST_SUITE( CopyNodesAndElementsTest ); | ||
|
||
CPPUNIT_TEST( laplace_smooth_2d_fixed_boundary_nodes ); | ||
CPPUNIT_TEST( laplace_smooth_2d_movable_boundary_nodes ); | ||
CPPUNIT_TEST( laplace_smooth_3d_fixed_boundary_nodes ); | ||
CPPUNIT_TEST( laplace_smooth_3d_movable_boundary_nodes ); | ||
|
||
CPPUNIT_TEST_SUITE_END(); | ||
|
||
private: | ||
template <typename T> | ||
void test(const std::string in_file, const std::string gold_file, bool move_nodes) | ||
{ | ||
Mesh in_mesh(*TestCommWorld); | ||
ExodusII_IO exii(in_mesh); | ||
if (in_mesh.processor_id() == 0) | ||
exii.read(in_file); | ||
MeshCommunication().broadcast(in_mesh); | ||
in_mesh.prepare_for_use(); | ||
|
||
Mesh gold_mesh(*TestCommWorld); | ||
ExodusII_IO exii(gold_mesh); | ||
if (gold_mesh.processor_id() == 0) | ||
exii.read(gold_file); | ||
MeshCommunication().broadcast(gold_mesh); | ||
gold_mesh.prepare_for_use(); | ||
|
||
LaplaceMeshSmoother lms(static_cast<UnstructuredMesh &>(in_mesh), move_nodes); | ||
lms.smooth(_iterations); | ||
} | ||
|
||
public: | ||
void setUp() {} | ||
|
||
void tearDown() {} | ||
|
||
void laplace_smooth_2d_fixed_boundary_nodes() { LOG_UNIT_TEST; test("meshes/smooth2d_in.e", "smooth2d_nomove.e", false); } | ||
void laplace_smooth_2d_movable_boundary_nodes() { LOG_UNIT_TEST; test("meshes/smooth2d_in.e", "smooth2d_move.e", true); } | ||
void laplace_smooth_3d_fixed_boundary_nodes() { LOG_UNIT_TEST; test("meshes/smooth3d_in.e", "smooth3d_nomove.e", false); } | ||
void laplace_smooth_3d_movable_boundary_nodes() { LOG_UNIT_TEST; test("meshes/smooth3d_in.e", "smooth3d_move.e", true); } | ||
}; | ||
|
||
|
||
CPPUNIT_TEST_SUITE_REGISTRATION( CopyNodesAndElementsTest ); |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.