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( testIsNodeOnEdge );             \    41   CPPUNIT_TEST( testNodesOnEdge );              \    42   CPPUNIT_TEST( testBuildEdgePtr );             \    47 template <
typename ElemClass, 
ElemType edge_type,
    48           unsigned short indexbegin, 
unsigned short indexend>
    53   std::vector<std::unique_ptr<Node>> 
nodes;
    61 #ifdef LIBMESH_ENABLE_AMR    68     for (
auto i : elem.node_index_range())
    70         nodes.push_back(std::make_unique<Node>(dummy, i));
    71         elem.set_node(i, nodes[i].
get());
    81     for (
auto e : 
make_range(indexbegin, indexend))
    83         std::unique_ptr<Elem> edge = elem.build_edge_ptr(e);
    84         for (
auto n : elem.node_index_range())
    86             const Node * node = elem.node_ptr(n);
    87             bool found_node = 
false;
    88             for (
auto en : edge->node_index_range())
    89               if (node == edge->node_ptr(en))
    95             if (elem.is_node_on_edge(n, e))
    97                 CPPUNIT_ASSERT(found_node);
   101                 CPPUNIT_ASSERT(!found_node);
   111     for (
auto e : 
make_range(indexbegin, indexend))
   113         std::unique_ptr<Elem> edge = elem.build_edge_ptr(e);
   114         std::vector<unsigned int> edge_nodes = elem.nodes_on_edge(e);
   116         CPPUNIT_ASSERT_EQUAL(edge_nodes.size(), std::size_t(edge->n_nodes()));
   118         for (
auto en : edge->node_index_range())
   120             const Node * node = edge->node_ptr(en);
   121             bool found_node = 
false;
   122             for (
auto ei : edge_nodes)
   123               if (node == elem.node_ptr(ei))
   128             CPPUNIT_ASSERT(found_node);
   137     for (
auto e : 
make_range(indexbegin, indexend))
   139         std::unique_ptr<Elem> edge = elem.build_edge_ptr(e);
   141         CPPUNIT_ASSERT(edge->type() == edge_type);
   142         CPPUNIT_ASSERT(edge->subdomain_id() == elem.subdomain_id());
   144 #ifdef LIBMESH_ENABLE_AMR   146         CPPUNIT_ASSERT(edge->p_level() == elem.p_level());
   153 #define INSTANTIATE_EDGETEST(elemclass, edgetype, indexbegin, indexend)                \   154   class EdgeTest_##elemclass##_##edgetype##_##indexbegin##_##indexend :                \   155     public EdgeTest<elemclass, edgetype, indexbegin, indexend> {                       \   157   EdgeTest_##elemclass##_##edgetype##_##indexbegin##_##indexend() :                    \   158     EdgeTest<elemclass,edgetype,indexbegin,indexend>() {                               \   159     if (unitlog->summarized_logs_enabled())                                            \   160       this->libmesh_suite_name = "EdgeTest";                                           \   162       this->libmesh_suite_name = "EdgeTest_" #elemclass"_" #edgetype "_" #indexbegin "_" #indexend; \   164   CPPUNIT_TEST_SUITE( EdgeTest_##elemclass##_##edgetype##_##indexbegin##_##indexend ); \   166   CPPUNIT_TEST_SUITE_END();                                                            \   169   CPPUNIT_TEST_SUITE_REGISTRATION( EdgeTest_##elemclass##_##edgetype##_##indexbegin##_##indexend );   192 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS   207 #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 QUAD8 is an element in 2D composed of 8 nodes. 
The libMesh namespace provides an interface to certain functionality in the library. 
std::string libmesh_suite_name
  The Tet14 is an element in 3D composed of 14 nodes. 
  The Tri6 is an element in 2D composed of 6 nodes. 
std::vector< std::unique_ptr< Node > > 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 QUAD9 is an element in 2D composed of 9 nodes. 
  The Prism15 is an element in 3D composed of 15 nodes. 
INSTANTIATE_EDGETEST(Hex20, EDGE3, 0, 12)
  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 Prism21 is an element in 3D composed of 21 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. 
A Point defines a location in LIBMESH_DIM dimensional Real space. 
  The InfHex18 is an infinite element in 3D composed of 18 nodes.