GRINS-0.7.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 44 of file mesh_builder.C.

Member Function Documentation

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

Definition at line 87 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().

88  {
89  GRINS::MeshBuilder mesh_builder;
90  return mesh_builder.build( input, *TestCommWorld );
91  }
libMesh::Parallel::Communicator * TestCommWorld
Definition: unit_driver.C:65
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 57 of file mesh_builder.C.

References build_mesh(), and test_elem_type().

58  {
59  std::string filename = std::string(GRINS_TEST_UNIT_INPUT_SRCDIR)+"/mesh_build_1d.in";
60  GetPot input(filename);
61  GRINS::SharedPtr<libMesh::UnstructuredMesh> mesh = this->build_mesh(input);
62  CPPUNIT_ASSERT_EQUAL((libMesh::dof_id_type)22,mesh->n_elem());
63  this->test_elem_type(*mesh,GRINSEnums::EDGE2);
64  }
GRINS::SharedPtr< libMesh::UnstructuredMesh > build_mesh(const GetPot &input)
Definition: mesh_builder.C:87
void test_elem_type(const libMesh::MeshBase &mesh, GRINSEnums::ElemType elem_type_expected)
Definition: mesh_builder.C:93
void GRINSTesting::MeshBuilderTest::test_build_2d_mesh ( )
inline

Definition at line 66 of file mesh_builder.C.

References build_mesh(), and test_elem_type().

67  {
68  std::string filename = std::string(GRINS_TEST_UNIT_INPUT_SRCDIR)+"/mesh_build_2d.in";
69  GetPot input(filename);
70  GRINS::SharedPtr<libMesh::UnstructuredMesh> mesh = this->build_mesh(input);
71  CPPUNIT_ASSERT_EQUAL((libMesh::dof_id_type)100,mesh->n_elem());
72  this->test_elem_type(*mesh,GRINSEnums::QUAD9);
73 
74  }
GRINS::SharedPtr< libMesh::UnstructuredMesh > build_mesh(const GetPot &input)
Definition: mesh_builder.C:87
void test_elem_type(const libMesh::MeshBase &mesh, GRINSEnums::ElemType elem_type_expected)
Definition: mesh_builder.C:93
void GRINSTesting::MeshBuilderTest::test_build_3d_mesh ( )
inline

Definition at line 76 of file mesh_builder.C.

References build_mesh(), and test_elem_type().

77  {
78  std::string filename = std::string(GRINS_TEST_UNIT_INPUT_SRCDIR)+"/mesh_build_3d.in";
79  GetPot input(filename);
80  GRINS::SharedPtr<libMesh::UnstructuredMesh> mesh = this->build_mesh(input);
81  CPPUNIT_ASSERT_EQUAL((libMesh::dof_id_type)125,mesh->n_elem());
82  this->test_elem_type(*mesh,GRINSEnums::HEX8);
83  }
GRINS::SharedPtr< libMesh::UnstructuredMesh > build_mesh(const GetPot &input)
Definition: mesh_builder.C:87
void test_elem_type(const libMesh::MeshBase &mesh, GRINSEnums::ElemType elem_type_expected)
Definition: mesh_builder.C:93
void GRINSTesting::MeshBuilderTest::test_elem_type ( const libMesh::MeshBase &  mesh,
GRINSEnums::ElemType  elem_type_expected 
)
inlineprivate

Definition at line 93 of file mesh_builder.C.

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

94  {
95  for( libMesh::MeshBase::const_element_iterator e = mesh.active_elements_begin();
96  e != mesh.active_elements_end(); ++ e )
97  {
98  const libMesh::Elem* elem = *e;
99  GRINSEnums::ElemType elem_type_computed = elem->type();
100  CPPUNIT_ASSERT_EQUAL( elem_type_expected, elem_type_computed);
101  }
102  }

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

Generated on Thu Jun 2 2016 21:52:33 for GRINS-0.7.0 by  doxygen 1.8.10