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

Public Member Functions

 LIBMESH_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 (testAllTriPrism20)
 
 CPPUNIT_TEST (testAllTriPrism21)
 
 CPPUNIT_TEST_SUITE_END ()
 
void setUp ()
 
void tearDown ()
 
void testAllTriTri ()
 
void testAllTriQuad ()
 
void testAllTriQuad8 ()
 
void testAllTriQuad9 ()
 
void testAllTriPrism6 ()
 
void testAllTriPrism18 ()
 
void testAllTriPrism20 ()
 
void testAllTriPrism21 ()
 

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 14 of file all_tri.C.

Member Function Documentation

◆ CPPUNIT_TEST() [1/8]

AllTriTest::CPPUNIT_TEST ( testAllTriTri  )

◆ CPPUNIT_TEST() [2/8]

AllTriTest::CPPUNIT_TEST ( testAllTriQuad  )

◆ CPPUNIT_TEST() [3/8]

AllTriTest::CPPUNIT_TEST ( testAllTriQuad8  )

◆ CPPUNIT_TEST() [4/8]

AllTriTest::CPPUNIT_TEST ( testAllTriQuad9  )

◆ CPPUNIT_TEST() [5/8]

AllTriTest::CPPUNIT_TEST ( testAllTriPrism6  )

◆ CPPUNIT_TEST() [6/8]

AllTriTest::CPPUNIT_TEST ( testAllTriPrism18  )

◆ CPPUNIT_TEST() [7/8]

AllTriTest::CPPUNIT_TEST ( testAllTriPrism20  )

◆ CPPUNIT_TEST() [8/8]

AllTriTest::CPPUNIT_TEST ( testAllTriPrism21  )

◆ CPPUNIT_TEST_SUITE_END()

AllTriTest::CPPUNIT_TEST_SUITE_END ( )

◆ LIBMESH_CPPUNIT_TEST_SUITE()

AllTriTest::LIBMESH_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.

◆ setUp()

void AllTriTest::setUp ( )
inline

Definition at line 94 of file all_tri.C.

94 {}

◆ tearDown()

void AllTriTest::tearDown ( )
inline

Definition at line 96 of file all_tri.C.

96 {}

◆ test_helper_2D()

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

Definition at line 45 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::MeshBase::n_elem(), and TestCommWorld.

48  {
49  ReplicatedMesh mesh(*TestCommWorld, /*dim=*/2);
50 
51  // Build a 2x1 TRI3 mesh and ask to split it into triangles.
52  // Should be a no-op
54  /*nx=*/2, /*ny=*/1,
55  /*xmin=*/0., /*xmax=*/1.,
56  /*ymin=*/0., /*ymax=*/1.,
57  elem_type);
58 
60 
61  // Make sure that the expected number of elements is found.
62  CPPUNIT_ASSERT_EQUAL(n_elem_expected, mesh.n_elem());
63 
64  // Make sure the expected number of BCs is found.
65  CPPUNIT_ASSERT_EQUAL(n_boundary_conds_expected, mesh.get_boundary_info().n_boundary_conds());
66  }
std::size_t n_boundary_conds() const
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
libMesh::Parallel::Communicator * TestCommWorld
Definition: driver.C:159
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.
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
Definition: mesh_base.h:159
void all_tri(MeshBase &mesh)
Converts the 2D quadrilateral elements of a Mesh into triangular elements.
virtual dof_id_type n_elem() const =0

◆ test_helper_3D()

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

Definition at line 69 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::MeshBase::n_elem(), and TestCommWorld.

72  {
73  ReplicatedMesh mesh(*TestCommWorld, /*dim=*/3);
74 
75  // Build a 2x1 TRI3 mesh and ask to split it into triangles.
76  // Should be a no-op
78  /*nx=*/1, /*ny=*/1, /*nz=*/1,
79  /*xmin=*/0., /*xmax=*/1.,
80  /*ymin=*/0., /*ymax=*/1.,
81  /*zmin=*/0., /*zmax=*/1.,
82  elem_type);
83 
85 
86  // Make sure that the expected number of elements is found.
87  CPPUNIT_ASSERT_EQUAL(n_elem_expected, mesh.n_elem());
88 
89  // Make sure the expected number of BCs is found.
90  CPPUNIT_ASSERT_EQUAL(n_boundary_conds_expected, mesh.get_boundary_info().n_boundary_conds());
91  }
std::size_t n_boundary_conds() const
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
libMesh::Parallel::Communicator * TestCommWorld
Definition: driver.C:159
MeshBase & mesh
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
Definition: mesh_base.h:159
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.

◆ testAllTriPrism18()

void AllTriTest::testAllTriPrism18 ( )
inline

Definition at line 112 of file all_tri.C.

References libMesh::PRISM18.

112 { LOG_UNIT_TEST; 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:69

◆ testAllTriPrism20()

void AllTriTest::testAllTriPrism20 ( )
inline

Definition at line 113 of file all_tri.C.

References libMesh::PRISM20.

113 { LOG_UNIT_TEST; test_helper_3D(PRISM20, /*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:69

◆ testAllTriPrism21()

void AllTriTest::testAllTriPrism21 ( )
inline

Definition at line 114 of file all_tri.C.

References libMesh::PRISM21.

114 { LOG_UNIT_TEST; test_helper_3D(PRISM21, /*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:69

◆ testAllTriPrism6()

void AllTriTest::testAllTriPrism6 ( )
inline

Definition at line 111 of file all_tri.C.

References libMesh::PRISM6.

111 { LOG_UNIT_TEST; 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:69

◆ testAllTriQuad()

void AllTriTest::testAllTriQuad ( )
inline

Definition at line 102 of file all_tri.C.

References libMesh::QUAD4.

102 { LOG_UNIT_TEST; 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:45

◆ testAllTriQuad8()

void AllTriTest::testAllTriQuad8 ( )
inline

Definition at line 105 of file all_tri.C.

References libMesh::QUAD8.

105 { LOG_UNIT_TEST; 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:45

◆ testAllTriQuad9()

void AllTriTest::testAllTriQuad9 ( )
inline

Definition at line 108 of file all_tri.C.

References libMesh::QUAD9.

108 { LOG_UNIT_TEST; 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:45

◆ testAllTriTri()

void AllTriTest::testAllTriTri ( )
inline

Definition at line 99 of file all_tri.C.

References libMesh::TRI3.

99 { LOG_UNIT_TEST; 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:45

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