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

Member Function Documentation

◆ CPPUNIT_TEST() [1/6]

AllTriTest::CPPUNIT_TEST ( testAllTriPrism18  )

◆ CPPUNIT_TEST() [2/6]

AllTriTest::CPPUNIT_TEST ( testAllTriPrism6  )

◆ CPPUNIT_TEST() [3/6]

AllTriTest::CPPUNIT_TEST ( testAllTriQuad  )

◆ CPPUNIT_TEST() [4/6]

AllTriTest::CPPUNIT_TEST ( testAllTriQuad8  )

◆ CPPUNIT_TEST() [5/6]

AllTriTest::CPPUNIT_TEST ( testAllTriQuad9  )

◆ CPPUNIT_TEST() [6/6]

AllTriTest::CPPUNIT_TEST ( testAllTriTri  )

◆ CPPUNIT_TEST_SUITE()

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.

◆ CPPUNIT_TEST_SUITE_END()

AllTriTest::CPPUNIT_TEST_SUITE_END ( )

◆ setUp()

void AllTriTest::setUp ( )
inline

Definition at line 91 of file all_tri.C.

91 {}

◆ tearDown()

void AllTriTest::tearDown ( )
inline

Definition at line 93 of file all_tri.C.

93 {}

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

45  {
46  ReplicatedMesh mesh(*TestCommWorld, /*dim=*/2);
47 
48  // Build a 2x1 TRI3 mesh and ask to split it into triangles.
49  // Should be a no-op
51  /*nx=*/2, /*ny=*/1,
52  /*xmin=*/0., /*xmax=*/1.,
53  /*ymin=*/0., /*ymax=*/1.,
54  elem_type);
55 
57 
58  // Make sure that the expected number of elements is found.
59  CPPUNIT_ASSERT_EQUAL(n_elem_expected, mesh.n_elem());
60 
61  // Make sure the expected number of BCs is found.
62  CPPUNIT_ASSERT_EQUAL(n_boundary_conds_expected, mesh.get_boundary_info().n_boundary_conds());
63  }

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.

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

69  {
70  ReplicatedMesh mesh(*TestCommWorld, /*dim=*/3);
71 
72  // Build a 2x1 TRI3 mesh and ask to split it into triangles.
73  // Should be a no-op
75  /*nx=*/1, /*ny=*/1, /*nz=*/1,
76  /*xmin=*/0., /*xmax=*/1.,
77  /*ymin=*/0., /*ymax=*/1.,
78  /*zmin=*/0., /*zmax=*/1.,
79  elem_type);
80 
82 
83  // Make sure that the expected number of elements is found.
84  CPPUNIT_ASSERT_EQUAL(n_elem_expected, mesh.n_elem());
85 
86  // Make sure the expected number of BCs is found.
87  CPPUNIT_ASSERT_EQUAL(n_boundary_conds_expected, mesh.get_boundary_info().n_boundary_conds());
88  }

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.

◆ testAllTriPrism18()

void AllTriTest::testAllTriPrism18 ( )
inline

Definition at line 111 of file all_tri.C.

111 { test_helper_3D(PRISM18, /*nelem=*/6, /*nbcs=*/12); }

References libMesh::PRISM18.

◆ testAllTriPrism6()

void AllTriTest::testAllTriPrism6 ( )
inline

Definition at line 108 of file all_tri.C.

108 { test_helper_3D(PRISM6, /*nelem=*/6, /*nbcs=*/12); }

References libMesh::PRISM6.

◆ testAllTriQuad()

void AllTriTest::testAllTriQuad ( )
inline

Definition at line 99 of file all_tri.C.

99 { test_helper_2D(QUAD4, /*nelem=*/4, /*nbcs=*/6); }

References libMesh::QUAD4.

◆ testAllTriQuad8()

void AllTriTest::testAllTriQuad8 ( )
inline

Definition at line 102 of file all_tri.C.

102 { test_helper_2D(QUAD8, /*nelem=*/4, /*nbcs=*/6); }

References libMesh::QUAD8.

◆ testAllTriQuad9()

void AllTriTest::testAllTriQuad9 ( )
inline

Definition at line 105 of file all_tri.C.

105 { test_helper_2D(QUAD9, /*nelem=*/4, /*nbcs=*/6); }

References libMesh::QUAD9.

◆ testAllTriTri()

void AllTriTest::testAllTriTri ( )
inline

Definition at line 96 of file all_tri.C.

96 { test_helper_2D(TRI3, /*nelem=*/4, /*nbcs=*/6); }

References libMesh::TRI3.


The documentation for this class was generated from the following file:
libMesh::PRISM6
Definition: enum_elem_type.h:50
libMesh::MeshBase::get_boundary_info
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
Definition: mesh_base.h:132
libMesh::BoundaryInfo::n_boundary_conds
std::size_t n_boundary_conds() const
Definition: boundary_info.C:1615
libMesh::MeshBase::n_elem
virtual dof_id_type n_elem() const =0
AllTriTest::test_helper_3D
void test_helper_3D(ElemType elem_type, dof_id_type n_elem_expected, std::size_t n_boundary_conds_expected)
Definition: all_tri.C:66
libMesh::MeshTools::Generation::build_cube
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.
Definition: mesh_generation.C:298
mesh
MeshBase & mesh
Definition: mesh_communication.C:1257
AllTriTest::test_helper_2D
void test_helper_2D(ElemType elem_type, dof_id_type n_elem_expected, std::size_t n_boundary_conds_expected)
Definition: all_tri.C:42
libMesh::ReplicatedMesh
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
Definition: replicated_mesh.h:47
libMesh::MeshTools::Generation::build_square
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.
Definition: mesh_generation.C:1501
libMesh::QUAD4
Definition: enum_elem_type.h:41
TestCommWorld
libMesh::Parallel::Communicator * TestCommWorld
Definition: driver.C:111
libMesh::TRI3
Definition: enum_elem_type.h:39
libMesh::MeshTools::Modification::all_tri
void all_tri(MeshBase &mesh)
Converts the 2D quadrilateral elements of a Mesh into triangular elements.
Definition: mesh_modification.C:280
libMesh::QUAD9
Definition: enum_elem_type.h:43
libMesh::PRISM18
Definition: enum_elem_type.h:52
libMesh::QUAD8
Definition: enum_elem_type.h:42