23 #include "libmesh/cell_hex.h" 
   24 #include "libmesh/cell_hex8.h" 
   25 #include "libmesh/face_quad4.h" 
   26 #include "libmesh/enum_elem_quality.h" 
   27 #include "libmesh/tensor_value.h" 
   78   libmesh_assert_less (s, this->
n_sides());
 
   89                                   unsigned int side_node)
 const 
   91   libmesh_assert_less (side, this->
n_sides());
 
   92   libmesh_assert_less (side_node, 4);
 
  101   libmesh_assert_less (i, this->
n_sides());
 
  103   std::unique_ptr<Elem> face = libmesh_make_unique<Quad4>();
 
  105   for (
auto n : face->node_index_range())
 
  114                     const unsigned int i)
 
  116   this->simple_side_ptr<Hex,Hex8>(side, i, 
QUAD4);
 
  122                            const unsigned int s)
 const 
  125   libmesh_assert_less (s, this->
n_sides());
 
  131   const unsigned int node_child_map[8] = { 0, 1, 3, 2, 4, 5, 7, 6 };
 
  133   for (
unsigned int i = 0; i != 4; ++i)
 
  143                           const unsigned int s)
 const 
  145   libmesh_assert_less (e, this->
n_edges());
 
  146   libmesh_assert_less (s, this->
n_sides());
 
  156   libmesh_assert_less (side_in, 6);
 
  157   static const unsigned char hex_opposites[6] = {5, 3, 4, 1, 2, 0};
 
  158   return hex_opposites[side_in];
 
  164                                 const unsigned int side_in)
 const 
  166   libmesh_assert_less (node_in, 26);
 
  167   libmesh_assert_less (node_in, this->
n_nodes());
 
  168   libmesh_assert_less (side_in, this->
n_sides());
 
  171   static const unsigned char side05_nodes_map[] =
 
  172     {4, 5, 6, 7, 0, 1, 2, 3, 16, 17, 18, 19, 255, 255, 255, 255, 8, 9, 10, 11, 25, 255, 255, 255, 255, 20};
 
  173   static const unsigned char side13_nodes_map[] =
 
  174     {3, 2, 1, 0, 7, 6, 5, 4, 10, 255, 8, 255, 15, 14, 13, 12, 18, 255, 16, 255, 255, 23, 255, 21, 255, 255};
 
  175   static const unsigned char side24_nodes_map[] =
 
  176     {1, 0, 3, 2, 5, 4, 7, 6, 255, 11, 255, 9, 13, 12, 15, 14, 255, 19, 255, 17, 255, 255, 24, 255, 22, 255};
 
  182       return side05_nodes_map[node_in];
 
  185       return side13_nodes_map[node_in];
 
  188       return side24_nodes_map[node_in];
 
  190       libmesh_error_msg(
"Unsupported side_in = " << side_in);
 
  221         const Real min = std::min(d06, std::min(d35, std::min(d17, d24)));
 
  222         const Real max = std::max(d06, std::max(d35, std::max(d17, d24)));
 
  224         libmesh_assert_not_equal_to (max, 0.0);
 
  254         std::vector<Real> edge_ratios(12);
 
  256         edge_ratios[0] = std::min(d01, d45) / std::max(d01, d45);
 
  257         edge_ratios[1] = std::min(d04, d15) / std::max(d04, d15);
 
  260         edge_ratios[2] = std::min(d15, d26) / std::max(d15, d26);
 
  261         edge_ratios[3] = std::min(d12, d56) / std::max(d12, d56);
 
  264         edge_ratios[4] = std::min(d67, d23) / std::max(d67, d23);
 
  265         edge_ratios[5] = std::min(d26, d37) / std::max(d26, d37);
 
  268         edge_ratios[6] = std::min(d04, d37) / std::max(d04, d37);
 
  269         edge_ratios[7] = std::min(d03, d47) / std::max(d03, d47);
 
  272         edge_ratios[8] = std::min(d01, d23) / std::max(d01, d23);
 
  273         edge_ratios[9] = std::min(d03, d12) / std::max(d03, d12);
 
  276         edge_ratios[10] = std::min(d45, d67) / std::max(d45, d67);
 
  277         edge_ratios[11] = std::min(d56, d47) / std::max(d56, d47);
 
  279         return *(std::min_element(edge_ratios.begin(), edge_ratios.end())) ;
 
  291         const Real sqrt3 = 1.73205080756888;
 
  300         const Real max_diag = std::max(d06, std::max(d17, std::max(d35, d24)));
 
  302         libmesh_assert_not_equal_to ( max_diag, 0.0 );
 
  307         std::vector<Real> edges(12);
 
  308         edges[0]  = this->
length(0,1);
 
  309         edges[1]  = this->
length(1,2);
 
  310         edges[2]  = this->
length(2,3);
 
  311         edges[3]  = this->
length(0,3);
 
  312         edges[4]  = this->
length(4,5);
 
  313         edges[5]  = this->
length(5,6);
 
  314         edges[6]  = this->
length(6,7);
 
  315         edges[7]  = this->
length(4,7);
 
  316         edges[8]  = this->
length(0,4);
 
  317         edges[9]  = this->
length(1,5);
 
  318         edges[10] = this->
length(2,6);
 
  319         edges[11] = this->
length(3,7);
 
  321         const Real min_edge = *(std::min_element(edges.begin(), edges.end()));
 
  322         return sqrt3 * min_edge / max_diag ;
 
  344         const Point a1 = -x0 + x1 - x2 + x3 + x4 - x5 + x6 - x7;
 
  345         const Point b1 =  x0 - x1 + x2 - x3 + x4 - x5 + x6 - x7;
 
  346         const Point c1 =  x0 - x1 - x2 + x3 - x4 + x5 + x6 - x7;
 
  347         const Point d1 = -x0 + x1 + x2 - x3 - x4 + x5 + x6 - x7;
 
  351         const Point c2 =  x0 + x1 - x2 - x3 - x4 - x5 + x6 + x7;
 
  352         const Point d2 = -x0 - x1 + x2 + x3 - x4 - x5 + x6 + x7;
 
  357         const Point d3 = -x0 - x1 - x2 - x3 + x4 + x5 + x6 + x7;
 
  365         std::array<RealTensor, 8> 
A =
 
  369             RealTensor(b1 + d1, b2 + d2, a3 + b3 + c3 + d3),
 
  372             RealTensor(c1 + d1, a2 + b2 + c2 + d2, b3 + d3),
 
  373             RealTensor(a1 + b1 + c1 + d1, a2 + b2 + c2 + d2, a3 + b3 + c3 + d3),
 
  374             RealTensor(a1 + b1 + c1 + d1, c2 + d2, c3 + d3)
 
  381         std::array<Real, 8> alpha;
 
  382         for (
unsigned int k=0; k<alpha.size(); ++k)
 
  384             alpha[k] = 
A[k].det();
 
  390         std::array<RealTensor, 8> T;
 
  391         for (
unsigned int k=0; k<T.size(); ++k)
 
  392           T[k] = 
A[k] * 
A[k].transpose();
 
  399             for (
unsigned int k=0; k<T.size(); ++k)
 
  400               den += T[k].tr() / 
std::pow(alpha[k], 2./3.);
 
  401             return (den == 0.) ? 0 : (24. / den);
 
  405             for (
unsigned int k=0; k<T.size(); ++k)
 
  407             return (den == 0.) ? 0 : (8. / den);
 
  410 #endif // LIBMESH_DIM >= 3 
  425   std::pair<Real, Real> bounds;
 
  482       libMesh::out << 
"Warning: Invalid quality measure chosen." << std::endl;
 
  494     99,99,99,99,99,99,99,99, 
 
  495     0,1,2,0,0,1,2,3,4,5,6,5, 
 
  504     99,99,99,99,99,99,99,99, 
 
  505     1,2,3,3,4,5,6,7,5,6,7,7, 
 
  530 #ifdef LIBMESH_ENABLE_AMR 
  537     { 0, 2, 12, 10,  50, 52, 62, 60,  1, 7, 11, 5,  25, 27, 37, 35,
 
  538       51, 57, 61, 55,  6,  26, 32, 36, 30,  56,  31},
 
  541     { 2, 4, 14, 12,  52, 54, 64, 62,  3, 9, 13, 7,  27, 29, 39, 37,
 
  542       53, 59, 63, 57,  8,  28, 34, 38, 32,  58,  33},
 
  545     { 10, 12, 22, 20,  60, 62, 72, 70,  11, 17, 21, 15,  35, 37, 47, 45,
 
  546       61, 67, 71, 65,  16,  36, 42, 46, 40,  66,  41},
 
  549     { 12, 14, 24, 22,  62, 64, 74, 72,  13, 19, 23, 17,  37, 39, 49, 47,
 
  550       63, 69, 73, 67,  18,  38, 44, 48, 42,  68,  43},
 
  553     { 50, 52, 62, 60,  100, 102, 112, 110,  51, 57, 61, 55,  75, 77, 87, 85,
 
  554       101, 107, 111, 105,  56,  76, 82, 86, 80,  106,  81},
 
  557     { 52, 54, 64, 62,  102, 104, 114, 112,  53, 59, 63, 57,  77, 79, 89, 87,
 
  558       103, 109, 113, 107,  58,  78, 84, 88, 82,  108,  93},
 
  561     { 60, 62, 72, 70,  110, 112, 122, 120,  61, 67, 71, 65,  85, 87, 97, 95,
 
  562       111, 117, 121, 115,  66,  86, 92, 96, 90,  116,  91},
 
  565     { 62, 64, 74, 72,  112, 114, 124, 122,  63, 69, 73, 67,  87, 89, 99, 97,
 
  566       113, 119, 123, 117,  68,  88, 94, 98, 92,  118,  103}
 
  569 #endif // LIBMESH_ENABLE_AMR