25 #include "grins_config.h"
27 #ifdef GRINS_HAVE_CPPUNIT
29 #include <libmesh/ignore_warnings.h>
30 #include <cppunit/extensions/HelperMacros.h>
31 #include <cppunit/TestCase.h>
32 #include <libmesh/restore_warnings.h>
35 #include "grins_test_paths.h"
42 #include "libmesh/elem.h"
45 #include <libmesh/ignore_warnings.h>
64 std::string filename = std::string(GRINS_TEST_UNIT_INPUT_SRCDIR)+
"/mesh_build_1d.in";
65 GetPot input(filename);
66 GRINS::SharedPtr<libMesh::UnstructuredMesh> mesh = this->
build_mesh(input);
67 CPPUNIT_ASSERT_EQUAL((libMesh::dof_id_type)22,mesh->n_elem());
73 std::string filename = std::string(GRINS_TEST_UNIT_INPUT_SRCDIR)+
"/mesh_build_2d.in";
74 GetPot input(filename);
75 GRINS::SharedPtr<libMesh::UnstructuredMesh> mesh = this->
build_mesh(input);
76 CPPUNIT_ASSERT_EQUAL((libMesh::dof_id_type)100,mesh->n_elem());
83 std::string filename = std::string(GRINS_TEST_UNIT_INPUT_SRCDIR)+
"/mesh_build_3d.in";
84 GetPot input(filename);
85 GRINS::SharedPtr<libMesh::UnstructuredMesh> mesh = this->
build_mesh(input);
86 CPPUNIT_ASSERT_EQUAL((libMesh::dof_id_type)125,mesh->n_elem());
92 GRINS::SharedPtr<libMesh::UnstructuredMesh>
build_mesh(
const GetPot& input )
98 void test_elem_type(
const libMesh::MeshBase& mesh, GRINSEnums::ElemType elem_type_expected )
100 for( libMesh::MeshBase::const_element_iterator e = mesh.active_elements_begin();
101 e != mesh.active_elements_end(); ++ e )
103 const libMesh::Elem* elem = *e;
104 GRINSEnums::ElemType elem_type_computed = elem->type();
105 CPPUNIT_ASSERT_EQUAL( elem_type_expected, elem_type_computed);
114 #endif // GRINS_HAVE_CPPUNIT
CPPUNIT_TEST_SUITE_REGISTRATION(AntiochAirNASA9ThermoTest)
void test_build_3d_mesh()
GRINS::SharedPtr< libMesh::UnstructuredMesh > build_mesh(const GetPot &input)
libMesh::Parallel::Communicator * TestCommWorld
CPPUNIT_TEST_SUITE(MeshBuilderTest)
void test_build_2d_mesh()
void test_build_1d_mesh()
CPPUNIT_TEST(test_build_1d_mesh)
SharedPtr< libMesh::UnstructuredMesh > build(const GetPot &input, const libMesh::Parallel::Communicator &comm LIBMESH_CAN_DEFAULT_TO_COMMWORLD)
Builds the libMesh::Mesh according to input options.
void test_elem_type(const libMesh::MeshBase &mesh, GRINSEnums::ElemType elem_type_expected)