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"   104   libmesh_assert_less (s, this->
n_sides());
   116   libmesh_assert_less (s, this->
n_sides());
   127                                   unsigned int side_node)
 const   129   libmesh_assert_less (side, this->
n_sides());
   138                                   unsigned int edge_node)
 const   140   libmesh_assert_less (edge, this->
n_edges());
   150   libmesh_assert_less (i, this->
n_sides());
   152   std::unique_ptr<Elem> face = std::make_unique<Quad4>();
   154   for (
auto n : face->node_index_range())
   163                     const unsigned int i)
   165   this->simple_side_ptr<Hex,Hex8>(side, i, 
QUAD4);
   171                            const unsigned int s)
 const   174   libmesh_assert_less (s, this->
n_sides());
   180   const unsigned int node_child_map[8] = { 0, 1, 3, 2, 4, 5, 7, 6 };
   182   for (
unsigned int i = 0; i != 4; ++i)
   192                           const unsigned int s)
 const   194   libmesh_assert_less (e, this->
n_edges());
   195   libmesh_assert_less (s, this->
n_sides());
   204   libmesh_assert_less(e, this->
n_edges());
   213   libmesh_assert_less (side_in, 6);
   214   static const unsigned char hex_opposites[6] = {5, 3, 4, 1, 2, 0};
   215   return hex_opposites[side_in];
   221                                 const unsigned int side_in)
 const   223   libmesh_assert_less (node_in, 26);
   224   libmesh_assert_less (node_in, this->
n_nodes());
   225   libmesh_assert_less (side_in, this->
n_sides());
   228   static const unsigned char side05_nodes_map[] =
   229     {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};
   230   static const unsigned char side13_nodes_map[] =
   231     {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};
   232   static const unsigned char side24_nodes_map[] =
   233     {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};
   239       return side05_nodes_map[node_in];
   242       return side13_nodes_map[node_in];
   245       return side24_nodes_map[node_in];
   247       libmesh_error_msg(
"Unsupported side_in = " << side_in);
   262 std::vector<unsigned int>
   265   libmesh_assert_less(n, this->
n_nodes());
   305         const Real min = std::min(d06, std::min(d35, std::min(d17, d24)));
   306         const Real max = std::max(d06, std::max(d35, std::max(d17, d24)));
   308         libmesh_assert_not_equal_to (max, 0.0);
   338         std::vector<Real> edge_ratios(12);
   340         edge_ratios[0] = std::min(d01, d45) / std::max(d01, d45);
   341         edge_ratios[1] = std::min(d04, d15) / std::max(d04, d15);
   344         edge_ratios[2] = std::min(d15, d26) / std::max(d15, d26);
   345         edge_ratios[3] = std::min(d12, d56) / std::max(d12, d56);
   348         edge_ratios[4] = std::min(d67, d23) / std::max(d67, d23);
   349         edge_ratios[5] = std::min(d26, d37) / std::max(d26, d37);
   352         edge_ratios[6] = std::min(d04, d37) / std::max(d04, d37);
   353         edge_ratios[7] = std::min(d03, d47) / std::max(d03, d47);
   356         edge_ratios[8] = std::min(d01, d23) / std::max(d01, d23);
   357         edge_ratios[9] = std::min(d03, d12) / std::max(d03, d12);
   360         edge_ratios[10] = std::min(d45, d67) / std::max(d45, d67);
   361         edge_ratios[11] = std::min(d56, d47) / std::max(d56, d47);
   363         return *(std::min_element(edge_ratios.begin(), edge_ratios.end())) ;
   375         const Real sqrt3 = 1.73205080756888;
   384         const Real max_diag = std::max(d06, std::max(d17, std::max(d35, d24)));
   386         libmesh_assert_not_equal_to ( max_diag, 0.0 );
   391         std::vector<Real> edges(12);
   392         edges[0]  = this->
length(0,1);
   393         edges[1]  = this->
length(1,2);
   394         edges[2]  = this->
length(2,3);
   395         edges[3]  = this->
length(0,3);
   396         edges[4]  = this->
length(4,5);
   397         edges[5]  = this->
length(5,6);
   398         edges[6]  = this->
length(6,7);
   399         edges[7]  = this->
length(4,7);
   400         edges[8]  = this->
length(0,4);
   401         edges[9]  = this->
length(1,5);
   402         edges[10] = this->
length(2,6);
   403         edges[11] = this->
length(3,7);
   405         const Real min_edge = *(std::min_element(edges.begin(), edges.end()));
   406         return sqrt3 * min_edge / max_diag ;
   428         const Point a1 = -x0 + x1 - x2 + x3 + x4 - x5 + x6 - x7;
   429         const Point b1 =  x0 - x1 + x2 - x3 + x4 - x5 + x6 - x7;
   430         const Point c1 =  x0 - x1 - x2 + x3 - x4 + x5 + x6 - x7;
   431         const Point d1 = -x0 + x1 + x2 - x3 - x4 + x5 + x6 - x7;
   435         const Point c2 =  x0 + x1 - x2 - x3 - x4 - x5 + x6 + x7;
   436         const Point d2 = -x0 - x1 + x2 + x3 - x4 - x5 + x6 + x7;
   441         const Point d3 = -x0 - x1 - x2 - x3 + x4 + x5 + x6 + x7;
   449         std::array<RealTensor, 8> A =
   453             RealTensor(b1 + d1, b2 + d2, a3 + b3 + c3 + d3),
   456             RealTensor(c1 + d1, a2 + b2 + c2 + d2, b3 + d3),
   457             RealTensor(a1 + b1 + c1 + d1, a2 + b2 + c2 + d2, a3 + b3 + c3 + d3),
   458             RealTensor(a1 + b1 + c1 + d1, c2 + d2, c3 + d3)
   465         std::array<Real, 8> alpha;
   466         for (
unsigned int k=0; k<alpha.size(); ++k)
   468             alpha[k] = A[k].
det();
   474         std::array<RealTensor, 8> T;
   475         for (
unsigned int k=0; k<T.size(); ++k)
   476           T[k] = A[k] * A[k].transpose();
   483             for (
unsigned int k=0; k<T.size(); ++k)
   484               den += T[k].tr() / 
std::pow(alpha[k], 2./3.);
   485             return (den == 0.) ? 0 : (24. / den);
   489             for (
unsigned int k=0; k<T.size(); ++k)
   490               den += 
std::pow(std::sqrt(T[k](0,0) * T[k](1,1) * T[k](2,2)) / alpha[k], 2./3.);
   491             return (den == 0.) ? 0 : (8. / den);
   494 #endif // LIBMESH_DIM >= 3   509   std::pair<Real, Real> bounds;
   567       libMesh::out << 
"Warning: Invalid quality measure chosen." << std::endl;
   578                                const Real eps)
 const   580   const Real & xi = p(0);
   581   const Real & eta = p(1);
   582   const Real & zeta = p(2);
   585   return ((xi   >= -1.-eps) &&
   597     99,99,99,99,99,99,99,99, 
   598     0,1,2,0,0,1,2,3,4,5,6,5, 
   607     99,99,99,99,99,99,99,99, 
   608     1,2,3,3,4,5,6,7,5,6,7,7, 
   633 #ifdef LIBMESH_ENABLE_AMR   640     { 0, 2, 12, 10,  50, 52, 62, 60,  1, 7, 11, 5,  25, 27, 37, 35,
   641       51, 57, 61, 55,  6,  26, 32, 36, 30,  56,  31},
   644     { 2, 4, 14, 12,  52, 54, 64, 62,  3, 9, 13, 7,  27, 29, 39, 37,
   645       53, 59, 63, 57,  8,  28, 34, 38, 32,  58,  33},
   648     { 10, 12, 22, 20,  60, 62, 72, 70,  11, 17, 21, 15,  35, 37, 47, 45,
   649       61, 67, 71, 65,  16,  36, 42, 46, 40,  66,  41},
   652     { 12, 14, 24, 22,  62, 64, 74, 72,  13, 19, 23, 17,  37, 39, 49, 47,
   653       63, 69, 73, 67,  18,  38, 44, 48, 42,  68,  43},
   656     { 50, 52, 62, 60,  100, 102, 112, 110,  51, 57, 61, 55,  75, 77, 87, 85,
   657       101, 107, 111, 105,  56,  76, 82, 86, 80,  106,  81},
   660     { 52, 54, 64, 62,  102, 104, 114, 112,  53, 59, 63, 57,  77, 79, 89, 87,
   661       103, 109, 113, 107,  58,  78, 84, 88, 82,  108,  93},
   664     { 60, 62, 72, 70,  110, 112, 122, 120,  61, 67, 71, 65,  85, 87, 97, 95,
   665       111, 117, 121, 115,  66,  86, 92, 96, 90,  116,  91},
   668     { 62, 64, 74, 72,  112, 114, 124, 122,  63, 69, 73, 67,  87, 89, 99, 97,
   669       113, 119, 123, 117,  68,  88, 94, 98, 92,  118,  103}
   672 #endif // LIBMESH_ENABLE_AMR virtual unsigned int opposite_side(const unsigned int s) const override final
virtual std::vector< unsigned int > sides_on_edge(const unsigned int e) const override final
static const Real _master_points[27][3]
Master element node locations. 
virtual std::vector< unsigned int > edges_adjacent_to_node(const unsigned int n) const override
virtual bool is_face(const unsigned int i) const =0
virtual dof_id_type key() const
virtual std::pair< Real, Real > qual_bounds(const ElemQuality q) const override
virtual bool is_flipped() const override final
static const unsigned short int _second_order_adjacent_vertices[12][2]
Matrix that tells which vertices define the location of mid-side (or second-order) nodes...
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
RealTensorValue RealTensor
virtual unsigned int n_children() const override final
The libMesh namespace provides an interface to certain functionality in the library. 
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the  node of the  side to element node numbers. 
virtual unsigned int local_edge_node(unsigned int edge, unsigned int edge_node) const override
T triple_product(const TypeVector< T > &a, const TypeVector< T > &b, const TypeVector< T > &c)
Real length(const unsigned int n1, const unsigned int n2) const
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const override final
virtual unsigned int n_nodes() const =0
static const int num_edges
static const int _child_node_lookup[8][27]
Lookup table from child id, child node id to "possible node location" (a simple dictionary-index in a...
static const int num_children
static const unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the  node of the  edge to element node numbers. 
static const int nodes_per_edge
virtual std::unique_ptr< Elem > side_ptr(const unsigned int i) override final
ElemQuality
Defines an enum for element quality metrics. 
virtual unsigned int n_edges() const override final
static const int nodes_per_side
virtual unsigned int n_vertices() const override final
virtual dof_id_type low_order_key(const unsigned int s) const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned int n_sides() const override final
virtual bool is_vertex(const unsigned int i) const =0
virtual Real quality(const ElemQuality q) const
virtual Real quality(const ElemQuality q) const override
static const int num_sides
Geometric constants for all Hexes. 
static const unsigned short int _second_order_vertex_child_number[27]
Vector that names a child sharing each second order node. 
virtual bool on_reference_element(const Point &p, const Real eps=TOLERANCE) const override final
static const unsigned short int _second_order_vertex_child_index[27]
Vector that names the child vertex index for each second order node. 
virtual unsigned int opposite_node(const unsigned int n, const unsigned int s) const override final
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const override
static dof_id_type compute_key(dof_id_type n0)
static const unsigned int adjacent_edges_map[8][3]
This maps the  node to the (in this case) 3 edge ids adjacent to the node. 
A Point defines a location in LIBMESH_DIM dimensional Real space. 
dof_id_type node_id(const unsigned int i) const
const Point & point(const unsigned int i) const
virtual bool is_edge(const unsigned int i) const =0
virtual bool is_edge_on_side(const unsigned int e, const unsigned int s) const override final
static const unsigned int edge_sides_map[12][2]
This maps each edge to the sides that contain said edge. 
bool is_internal(const unsigned int i) const