1 #include <libmesh/elem.h>     3 #include <libmesh/cell_hex20.h>     4 #include <libmesh/cell_hex27.h>     5 #include <libmesh/cell_hex8.h>     6 #include <libmesh/cell_inf_hex16.h>     7 #include <libmesh/cell_inf_hex18.h>     8 #include <libmesh/cell_inf_hex8.h>     9 #include <libmesh/cell_inf_prism12.h>    10 #include <libmesh/cell_inf_prism6.h>    11 #include <libmesh/cell_prism15.h>    12 #include <libmesh/cell_prism18.h>    13 #include <libmesh/cell_prism20.h>    14 #include <libmesh/cell_prism21.h>    15 #include <libmesh/cell_prism6.h>    16 #include <libmesh/cell_pyramid13.h>    17 #include <libmesh/cell_pyramid14.h>    18 #include <libmesh/cell_pyramid5.h>    19 #include <libmesh/cell_tet10.h>    20 #include <libmesh/cell_tet14.h>    21 #include <libmesh/cell_tet4.h>    22 #include <libmesh/edge_edge2.h>    23 #include <libmesh/edge_edge3.h>    24 #include <libmesh/edge_edge4.h>    25 #include <libmesh/edge_inf_edge2.h>    26 #include <libmesh/face_inf_quad4.h>    27 #include <libmesh/face_inf_quad6.h>    28 #include <libmesh/face_quad4.h>    29 #include <libmesh/face_quad8.h>    30 #include <libmesh/face_quad9.h>    31 #include <libmesh/face_tri3.h>    32 #include <libmesh/face_tri6.h>    33 #include <libmesh/face_tri7.h>    40   CPPUNIT_TEST( testIsNodeOnSide );             \    41   CPPUNIT_TEST( testNodesOnSide );              \    42   CPPUNIT_TEST( testSidePtr );                  \    43   CPPUNIT_TEST( testSidePtrFill );              \    44   CPPUNIT_TEST( testBuildSidePtr );             \    45   CPPUNIT_TEST( testBuildSidePtrFill );         \    50 template <
typename ElemClass, 
ElemType side_type,
    51           unsigned short indexbegin, 
unsigned short indexend>
    56   std::vector<std::unique_ptr<Node>> 
nodes;
    64 #ifdef LIBMESH_ENABLE_AMR    71     for (
auto i : elem.node_index_range())
    73         nodes.push_back(std::make_unique<Node>(dummy, i));
    74         elem.set_node(i, nodes[i].
get());
    84     for (
auto s : 
make_range(indexbegin, indexend))
    86         std::unique_ptr<Elem> side = elem.build_side_ptr(s);
    87         for (
auto n : elem.node_index_range())
    89             const Node * node = elem.node_ptr(n);
    90             bool found_node = 
false;
    91             for (
auto sn : side->node_index_range())
    92               if (node == side->node_ptr(sn))
    98             if (elem.is_node_on_side(n, s))
   100                 CPPUNIT_ASSERT(found_node);
   104                 CPPUNIT_ASSERT(!found_node);
   114     for (
auto s : 
make_range(indexbegin, indexend))
   116         std::unique_ptr<Elem> side = elem.build_side_ptr(s);
   117         std::vector<unsigned int> side_nodes = elem.nodes_on_side(s);
   119         CPPUNIT_ASSERT_EQUAL(side_nodes.size(), std::size_t(side->n_nodes()));
   121         for (
auto sn : side->node_index_range())
   123             const Node * node = side->node_ptr(sn);
   124             bool found_node = 
false;
   125             for (
auto si : side_nodes)
   126               if (node == elem.node_ptr(si))
   131             CPPUNIT_ASSERT(found_node);
   140     for (
auto s : 
make_range(indexbegin, indexend))
   142         std::unique_ptr<Elem> side = elem.side_ptr(s);
   144         CPPUNIT_ASSERT(side->type() ==
   153     std::unique_ptr<Elem> side;
   155     for (
auto s : 
make_range(indexbegin, indexend))
   157         elem.side_ptr(side, s);
   159         CPPUNIT_ASSERT(side->type() ==
   168     for (
auto s : 
make_range(indexbegin, indexend))
   170         std::unique_ptr<Elem> side = elem.build_side_ptr(s);
   172         CPPUNIT_ASSERT(side->type() == side_type);
   173         CPPUNIT_ASSERT(side->subdomain_id() == elem.subdomain_id());
   175 #ifdef LIBMESH_ENABLE_AMR   177         CPPUNIT_ASSERT(side->p_level() == elem.p_level());
   186     std::unique_ptr<Elem> side;
   188     for (
auto s : 
make_range(indexbegin, indexend))
   190         elem.build_side_ptr(side, s);
   191         std::unique_ptr<Elem> side_new = elem.build_side_ptr(s);
   193         CPPUNIT_ASSERT(side->type() == side_type);
   194         CPPUNIT_ASSERT(*side == *side_new);
   201 #define INSTANTIATE_SIDETEST(elemclass, sidetype, indexbegin, indexend)                \   202   class SideTest_##elemclass##_##sidetype##_##indexbegin##_##indexend :                \   203     public SideTest<elemclass, sidetype, indexbegin, indexend> {                       \   205   SideTest_##elemclass##_##sidetype##_##indexbegin##_##indexend() :                    \   206     SideTest<elemclass,sidetype,indexbegin,indexend>() {                               \   207     if (unitlog->summarized_logs_enabled())                                            \   208       this->libmesh_suite_name = "SideTest";                                           \   210       this->libmesh_suite_name = "SideTest_" #elemclass"_" #sidetype "_" #indexbegin "_" #indexend; \   212   CPPUNIT_TEST_SUITE( SideTest_##elemclass##_##sidetype##_##indexbegin##_##indexend ); \   214   CPPUNIT_TEST_SUITE_END();                                                            \   217   CPPUNIT_TEST_SUITE_REGISTRATION( SideTest_##elemclass##_##sidetype##_##indexbegin##_##indexend );   256 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS   272 #endif // LIBMESH_ENABLE_INFINITE_ELEMENTS   The Prism20 is an element in 3D composed of 20 nodes. 
  The Tri3 is an element in 2D composed of 3 nodes. 
ElemType
Defines an enum for geometric element types. 
  The InfHex8 is an infinite element in 3D composed of 8 nodes. 
A Node is like a Point, but with more information. 
  The QUAD4 is an element in 2D composed of 4 nodes. 
  The Hex8 is an element in 3D composed of 8 nodes. 
  The INFQUAD4 is an infinite element in 2D composed of 4 nodes. 
  The Prism6 is an element in 3D composed of 6 nodes. 
  The Hex20 is an element in 3D composed of 20 nodes. 
  The InfEdge2 is an infinite element in 1D composed of 2 nodes. 
  The QUAD8 is an element in 2D composed of 8 nodes. 
std::vector< std::unique_ptr< Node > > nodes
The libMesh namespace provides an interface to certain functionality in the library. 
  The Tet14 is an element in 3D composed of 14 nodes. 
void testBuildSidePtrFill()
  The Tri6 is an element in 2D composed of 6 nodes. 
  The InfPrism12 is an infinite element in 3D composed of 12 nodes. 
  The InfHex16 is an infinite element in 3D composed of 16 nodes. 
  The INFQUAD6 is an infinite element in 2D composed of 6 nodes. 
  The Edge3 is an element in 1D composed of 3 nodes. 
INSTANTIATE_SIDETEST(Hex20, QUAD8, 0, 6)
std::string libmesh_suite_name
  The QUAD9 is an element in 2D composed of 9 nodes. 
  The Prism15 is an element in 3D composed of 15 nodes. 
  The Pyramid13 is an element in 3D composed of 13 nodes, designed to interface with a QUAD8 element ...
  The Hex27 is an element in 3D composed of 27 nodes. 
  The Tet10 is an element in 3D composed of 10 nodes. 
  The Prism18 is an element in 3D composed of 18 nodes. 
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
  The Edge2 is an element in 1D composed of 2 nodes. 
  The Prism21 is an element in 3D composed of 21 nodes. 
  The Edge4 is an element in 1D composed of 4 nodes. 
  The Tet4 is an element in 3D composed of 4 nodes. 
  The InfPrism6 is an infinite element in 3D composed of 6 nodes. 
  The Tri7 is an element in 2D composed of 7 nodes. 
  The Pyramid14 is an element in 3D composed of 14 nodes, designed to interface with a QUAD9 element ...
  The Pyramid5 is an element in 3D composed of 5 nodes. 
static ElemType first_order_equivalent_type(const ElemType et)
A Point defines a location in LIBMESH_DIM dimensional Real space. 
  The InfHex18 is an infinite element in 3D composed of 18 nodes.