libMesh
Public Member Functions | Protected Member Functions | List of all members
AllTriTest Class Reference
Inheritance diagram for AllTriTest:
[legend]

Public Member Functions

 CPPUNIT_TEST_SUITE (AllTriTest)
 The goal of this test is to verify proper operation of the Mesh Extruder with the optional object callback for setting custom subdomain IDs. More...
 
 CPPUNIT_TEST (testAllTriTri)
 
 CPPUNIT_TEST (testAllTriQuad)
 
 CPPUNIT_TEST (testAllTriQuad8)
 
 CPPUNIT_TEST (testAllTriQuad9)
 
 CPPUNIT_TEST (testAllTriPrism6)
 
 CPPUNIT_TEST (testAllTriPrism18)
 
 CPPUNIT_TEST_SUITE_END ()
 
void setUp ()
 
void tearDown ()
 
void testAllTriTri ()
 
void testAllTriQuad ()
 
void testAllTriQuad8 ()
 
void testAllTriQuad9 ()
 
void testAllTriPrism6 ()
 
void testAllTriPrism18 ()
 

Protected Member Functions

void test_helper_2D (ElemType elem_type, dof_id_type n_elem_expected, std::size_t n_boundary_conds_expected)
 
void test_helper_3D (ElemType elem_type, dof_id_type n_elem_expected, std::size_t n_boundary_conds_expected)
 

Detailed Description

Definition at line 27 of file all_tri.C.

Member Function Documentation

AllTriTest::CPPUNIT_TEST ( testAllTriTri  )
AllTriTest::CPPUNIT_TEST ( testAllTriQuad  )
AllTriTest::CPPUNIT_TEST ( testAllTriQuad8  )
AllTriTest::CPPUNIT_TEST ( testAllTriQuad9  )
AllTriTest::CPPUNIT_TEST ( testAllTriPrism6  )
AllTriTest::CPPUNIT_TEST ( testAllTriPrism18  )
AllTriTest::CPPUNIT_TEST_SUITE ( AllTriTest  )

The goal of this test is to verify proper operation of the Mesh Extruder with the optional object callback for setting custom subdomain IDs.

We pass a custom object for generating subdomains based on the old element ID and the current layer and assert the proper values.

AllTriTest::CPPUNIT_TEST_SUITE_END ( )
void AllTriTest::setUp ( )

Definition at line 101 of file all_tri.C.

101 {}
void AllTriTest::tearDown ( )

Definition at line 103 of file all_tri.C.

103 {}
void AllTriTest::test_helper_2D ( ElemType  elem_type,
dof_id_type  n_elem_expected,
std::size_t  n_boundary_conds_expected 
)
protected

Definition at line 52 of file all_tri.C.

References libMesh::MeshTools::Modification::all_tri(), libMesh::MeshTools::Generation::build_square(), libMesh::MeshBase::get_boundary_info(), mesh, libMesh::BoundaryInfo::n_boundary_conds(), libMesh::ReplicatedMesh::n_elem(), and TestCommWorld.

55  {
56  ReplicatedMesh mesh(*TestCommWorld, /*dim=*/2);
57 
58  // Build a 2x1 TRI3 mesh and ask to split it into triangles.
59  // Should be a no-op
61  /*nx=*/2, /*ny=*/1,
62  /*xmin=*/0., /*xmax=*/1.,
63  /*ymin=*/0., /*ymax=*/1.,
64  elem_type);
65 
67 
68  // Make sure that the expected number of elements is found.
69  CPPUNIT_ASSERT_EQUAL(n_elem_expected, mesh.n_elem());
70 
71  // Make sure the expected number of BCs is found.
72  CPPUNIT_ASSERT_EQUAL(n_boundary_conds_expected, mesh.get_boundary_info().n_boundary_conds());
73  }
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
Definition: mesh_base.h:117
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
libMesh::Parallel::Communicator * TestCommWorld
Definition: driver.C:28
MeshBase & mesh
void build_square(UnstructuredMesh &mesh, const unsigned int nx, const unsigned int ny, const Real xmin=0., const Real xmax=1., const Real ymin=0., const Real ymax=1., const ElemType type=INVALID_ELEM, const bool gauss_lobatto_grid=false)
A specialized build_cube() for 2D meshes.
std::size_t n_boundary_conds() const
void all_tri(MeshBase &mesh)
Converts the 2D quadrilateral elements of a Mesh into triangular elements.
virtual dof_id_type n_elem() const =0
void AllTriTest::test_helper_3D ( ElemType  elem_type,
dof_id_type  n_elem_expected,
std::size_t  n_boundary_conds_expected 
)
protected

Definition at line 76 of file all_tri.C.

References libMesh::MeshTools::Modification::all_tri(), libMesh::MeshTools::Generation::build_cube(), libMesh::MeshBase::get_boundary_info(), mesh, libMesh::BoundaryInfo::n_boundary_conds(), libMesh::ReplicatedMesh::n_elem(), and TestCommWorld.

79  {
80  ReplicatedMesh mesh(*TestCommWorld, /*dim=*/3);
81 
82  // Build a 2x1 TRI3 mesh and ask to split it into triangles.
83  // Should be a no-op
85  /*nx=*/1, /*ny=*/1, /*nz=*/1,
86  /*xmin=*/0., /*xmax=*/1.,
87  /*ymin=*/0., /*ymax=*/1.,
88  /*zmin=*/0., /*zmax=*/1.,
89  elem_type);
90 
92 
93  // Make sure that the expected number of elements is found.
94  CPPUNIT_ASSERT_EQUAL(n_elem_expected, mesh.n_elem());
95 
96  // Make sure the expected number of BCs is found.
97  CPPUNIT_ASSERT_EQUAL(n_boundary_conds_expected, mesh.get_boundary_info().n_boundary_conds());
98  }
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
Definition: mesh_base.h:117
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
libMesh::Parallel::Communicator * TestCommWorld
Definition: driver.C:28
MeshBase & mesh
std::size_t n_boundary_conds() const
void all_tri(MeshBase &mesh)
Converts the 2D quadrilateral elements of a Mesh into triangular elements.
virtual dof_id_type n_elem() const =0
void build_cube(UnstructuredMesh &mesh, const unsigned int nx=0, const unsigned int ny=0, const unsigned int nz=0, const Real xmin=0., const Real xmax=1., const Real ymin=0., const Real ymax=1., const Real zmin=0., const Real zmax=1., const ElemType type=INVALID_ELEM, const bool gauss_lobatto_grid=false)
Builds a (elements) cube.
void AllTriTest::testAllTriPrism18 ( )

Definition at line 121 of file all_tri.C.

References CPPUNIT_TEST_SUITE_REGISTRATION(), and libMesh::PRISM18.

121 { test_helper_3D(PRISM18, /*nelem=*/6, /*nbcs=*/12); }
void test_helper_3D(ElemType elem_type, dof_id_type n_elem_expected, std::size_t n_boundary_conds_expected)
Definition: all_tri.C:76
void AllTriTest::testAllTriPrism6 ( )

Definition at line 118 of file all_tri.C.

References libMesh::PRISM6.

118 { test_helper_3D(PRISM6, /*nelem=*/6, /*nbcs=*/12); }
void test_helper_3D(ElemType elem_type, dof_id_type n_elem_expected, std::size_t n_boundary_conds_expected)
Definition: all_tri.C:76
void AllTriTest::testAllTriQuad ( )

Definition at line 109 of file all_tri.C.

References libMesh::QUAD4.

109 { test_helper_2D(QUAD4, /*nelem=*/4, /*nbcs=*/6); }
void test_helper_2D(ElemType elem_type, dof_id_type n_elem_expected, std::size_t n_boundary_conds_expected)
Definition: all_tri.C:52
void AllTriTest::testAllTriQuad8 ( )

Definition at line 112 of file all_tri.C.

References libMesh::QUAD8.

112 { test_helper_2D(QUAD8, /*nelem=*/4, /*nbcs=*/6); }
void test_helper_2D(ElemType elem_type, dof_id_type n_elem_expected, std::size_t n_boundary_conds_expected)
Definition: all_tri.C:52
void AllTriTest::testAllTriQuad9 ( )

Definition at line 115 of file all_tri.C.

References libMesh::QUAD9.

115 { test_helper_2D(QUAD9, /*nelem=*/4, /*nbcs=*/6); }
void test_helper_2D(ElemType elem_type, dof_id_type n_elem_expected, std::size_t n_boundary_conds_expected)
Definition: all_tri.C:52
void AllTriTest::testAllTriTri ( )

Definition at line 106 of file all_tri.C.

References libMesh::TRI3.

106 { test_helper_2D(TRI3, /*nelem=*/4, /*nbcs=*/6); }
void test_helper_2D(ElemType elem_type, dof_id_type n_elem_expected, std::size_t n_boundary_conds_expected)
Definition: all_tri.C:52

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