GRINS-0.8.0
List of all members | Public Member Functions | Private Member Functions
GRINSTesting::MeshBuilderTest Class Reference
Inheritance diagram for GRINSTesting::MeshBuilderTest:
Inheritance graph
[legend]
Collaboration diagram for GRINSTesting::MeshBuilderTest:
Collaboration graph
[legend]

Public Member Functions

 CPPUNIT_TEST_SUITE (MeshBuilderTest)
 
 CPPUNIT_TEST (test_build_1d_mesh)
 
 CPPUNIT_TEST (test_build_2d_mesh)
 
 CPPUNIT_TEST (test_build_3d_mesh)
 
 CPPUNIT_TEST_SUITE_END ()
 
void test_build_1d_mesh ()
 
void test_build_2d_mesh ()
 
void test_build_3d_mesh ()
 

Private Member Functions

GRINS::SharedPtr< libMesh::UnstructuredMesh > build_mesh (const GetPot &input)
 
void test_elem_type (const libMesh::MeshBase &mesh, GRINSEnums::ElemType elem_type_expected)
 

Detailed Description

Definition at line 49 of file mesh_builder.C.

Member Function Documentation

GRINS::SharedPtr<libMesh::UnstructuredMesh> GRINSTesting::MeshBuilderTest::build_mesh ( const GetPot &  input)
inlineprivate

Definition at line 92 of file mesh_builder.C.

References GRINS::MeshBuilder::build(), and TestCommWorld.

Referenced by test_build_1d_mesh(), test_build_2d_mesh(), and test_build_3d_mesh().

93  {
94  GRINS::MeshBuilder mesh_builder;
95  return mesh_builder.build( input, *TestCommWorld );
96  }
libMesh::Parallel::Communicator * TestCommWorld
Definition: unit_driver.C:70
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.
Definition: mesh_builder.C:46
GRINSTesting::MeshBuilderTest::CPPUNIT_TEST ( test_build_1d_mesh  )
GRINSTesting::MeshBuilderTest::CPPUNIT_TEST ( test_build_2d_mesh  )
GRINSTesting::MeshBuilderTest::CPPUNIT_TEST ( test_build_3d_mesh  )
GRINSTesting::MeshBuilderTest::CPPUNIT_TEST_SUITE ( MeshBuilderTest  )
GRINSTesting::MeshBuilderTest::CPPUNIT_TEST_SUITE_END ( )
void GRINSTesting::MeshBuilderTest::test_build_1d_mesh ( )
inline

Definition at line 62 of file mesh_builder.C.

References build_mesh(), and test_elem_type().

63  {
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());
68  this->test_elem_type(*mesh,GRINSEnums::EDGE2);
69  }
GRINS::SharedPtr< libMesh::UnstructuredMesh > build_mesh(const GetPot &input)
Definition: mesh_builder.C:92
void test_elem_type(const libMesh::MeshBase &mesh, GRINSEnums::ElemType elem_type_expected)
Definition: mesh_builder.C:98
void GRINSTesting::MeshBuilderTest::test_build_2d_mesh ( )
inline

Definition at line 71 of file mesh_builder.C.

References build_mesh(), and test_elem_type().

72  {
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());
77  this->test_elem_type(*mesh,GRINSEnums::QUAD9);
78 
79  }
GRINS::SharedPtr< libMesh::UnstructuredMesh > build_mesh(const GetPot &input)
Definition: mesh_builder.C:92
void test_elem_type(const libMesh::MeshBase &mesh, GRINSEnums::ElemType elem_type_expected)
Definition: mesh_builder.C:98
void GRINSTesting::MeshBuilderTest::test_build_3d_mesh ( )
inline

Definition at line 81 of file mesh_builder.C.

References build_mesh(), and test_elem_type().

82  {
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());
87  this->test_elem_type(*mesh,GRINSEnums::HEX8);
88  }
GRINS::SharedPtr< libMesh::UnstructuredMesh > build_mesh(const GetPot &input)
Definition: mesh_builder.C:92
void test_elem_type(const libMesh::MeshBase &mesh, GRINSEnums::ElemType elem_type_expected)
Definition: mesh_builder.C:98
void GRINSTesting::MeshBuilderTest::test_elem_type ( const libMesh::MeshBase &  mesh,
GRINSEnums::ElemType  elem_type_expected 
)
inlineprivate

Definition at line 98 of file mesh_builder.C.

Referenced by test_build_1d_mesh(), test_build_2d_mesh(), and test_build_3d_mesh().

99  {
100  for( libMesh::MeshBase::const_element_iterator e = mesh.active_elements_begin();
101  e != mesh.active_elements_end(); ++ e )
102  {
103  const libMesh::Elem* elem = *e;
104  GRINSEnums::ElemType elem_type_computed = elem->type();
105  CPPUNIT_ASSERT_EQUAL( elem_type_expected, elem_type_computed);
106  }
107  }

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

Generated on Tue Dec 19 2017 12:47:32 for GRINS-0.8.0 by  doxygen 1.8.9.1