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" 92 libmesh_assert_less (s, this->
n_sides());
104 libmesh_assert_less (s, this->
n_sides());
115 unsigned int side_node)
const 117 libmesh_assert_less (side, this->
n_sides());
126 unsigned int edge_node)
const 128 libmesh_assert_less (edge, this->
n_edges());
138 libmesh_assert_less (i, this->
n_sides());
140 std::unique_ptr<Elem> face = std::make_unique<Quad4>();
142 for (
auto n : face->node_index_range())
151 const unsigned int i)
153 this->simple_side_ptr<Hex,Hex8>(side, i,
QUAD4);
159 const unsigned int s)
const 162 libmesh_assert_less (s, this->
n_sides());
168 const unsigned int node_child_map[8] = { 0, 1, 3, 2, 4, 5, 7, 6 };
170 for (
unsigned int i = 0; i != 4; ++i)
180 const unsigned int s)
const 182 libmesh_assert_less (e, this->
n_edges());
183 libmesh_assert_less (s, this->
n_sides());
192 libmesh_assert_less(e, this->
n_edges());
201 libmesh_assert_less (side_in, 6);
202 static const unsigned char hex_opposites[6] = {5, 3, 4, 1, 2, 0};
203 return hex_opposites[side_in];
209 const unsigned int side_in)
const 211 libmesh_assert_less (node_in, 26);
212 libmesh_assert_less (node_in, this->
n_nodes());
213 libmesh_assert_less (side_in, this->
n_sides());
216 static const unsigned char side05_nodes_map[] =
217 {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};
218 static const unsigned char side13_nodes_map[] =
219 {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};
220 static const unsigned char side24_nodes_map[] =
221 {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};
227 return side05_nodes_map[node_in];
230 return side13_nodes_map[node_in];
233 return side24_nodes_map[node_in];
235 libmesh_error_msg(
"Unsupported side_in = " << side_in);
276 const Real min = std::min(d06, std::min(d35, std::min(d17, d24)));
277 const Real max = std::max(d06, std::max(d35, std::max(d17, d24)));
279 libmesh_assert_not_equal_to (max, 0.0);
309 std::vector<Real> edge_ratios(12);
311 edge_ratios[0] = std::min(d01, d45) / std::max(d01, d45);
312 edge_ratios[1] = std::min(d04, d15) / std::max(d04, d15);
315 edge_ratios[2] = std::min(d15, d26) / std::max(d15, d26);
316 edge_ratios[3] = std::min(d12, d56) / std::max(d12, d56);
319 edge_ratios[4] = std::min(d67, d23) / std::max(d67, d23);
320 edge_ratios[5] = std::min(d26, d37) / std::max(d26, d37);
323 edge_ratios[6] = std::min(d04, d37) / std::max(d04, d37);
324 edge_ratios[7] = std::min(d03, d47) / std::max(d03, d47);
327 edge_ratios[8] = std::min(d01, d23) / std::max(d01, d23);
328 edge_ratios[9] = std::min(d03, d12) / std::max(d03, d12);
331 edge_ratios[10] = std::min(d45, d67) / std::max(d45, d67);
332 edge_ratios[11] = std::min(d56, d47) / std::max(d56, d47);
334 return *(std::min_element(edge_ratios.begin(), edge_ratios.end())) ;
346 const Real sqrt3 = 1.73205080756888;
355 const Real max_diag = std::max(d06, std::max(d17, std::max(d35, d24)));
357 libmesh_assert_not_equal_to ( max_diag, 0.0 );
362 std::vector<Real> edges(12);
363 edges[0] = this->
length(0,1);
364 edges[1] = this->
length(1,2);
365 edges[2] = this->
length(2,3);
366 edges[3] = this->
length(0,3);
367 edges[4] = this->
length(4,5);
368 edges[5] = this->
length(5,6);
369 edges[6] = this->
length(6,7);
370 edges[7] = this->
length(4,7);
371 edges[8] = this->
length(0,4);
372 edges[9] = this->
length(1,5);
373 edges[10] = this->
length(2,6);
374 edges[11] = this->
length(3,7);
376 const Real min_edge = *(std::min_element(edges.begin(), edges.end()));
377 return sqrt3 * min_edge / max_diag ;
399 const Point a1 = -x0 + x1 - x2 + x3 + x4 - x5 + x6 - x7;
400 const Point b1 = x0 - x1 + x2 - x3 + x4 - x5 + x6 - x7;
401 const Point c1 = x0 - x1 - x2 + x3 - x4 + x5 + x6 - x7;
402 const Point d1 = -x0 + x1 + x2 - x3 - x4 + x5 + x6 - x7;
406 const Point c2 = x0 + x1 - x2 - x3 - x4 - x5 + x6 + x7;
407 const Point d2 = -x0 - x1 + x2 + x3 - x4 - x5 + x6 + x7;
412 const Point d3 = -x0 - x1 - x2 - x3 + x4 + x5 + x6 + x7;
420 std::array<RealTensor, 8> A =
424 RealTensor(b1 + d1, b2 + d2, a3 + b3 + c3 + d3),
427 RealTensor(c1 + d1, a2 + b2 + c2 + d2, b3 + d3),
428 RealTensor(a1 + b1 + c1 + d1, a2 + b2 + c2 + d2, a3 + b3 + c3 + d3),
429 RealTensor(a1 + b1 + c1 + d1, c2 + d2, c3 + d3)
436 std::array<Real, 8> alpha;
437 for (
unsigned int k=0; k<alpha.size(); ++k)
439 alpha[k] = A[k].
det();
445 std::array<RealTensor, 8> T;
446 for (
unsigned int k=0; k<T.size(); ++k)
447 T[k] = A[k] * A[k].transpose();
454 for (
unsigned int k=0; k<T.size(); ++k)
455 den += T[k].tr() /
std::pow(alpha[k], 2./3.);
456 return (den == 0.) ? 0 : (24. / den);
460 for (
unsigned int k=0; k<T.size(); ++k)
462 return (den == 0.) ? 0 : (8. / den);
465 #endif // LIBMESH_DIM >= 3 480 std::pair<Real, Real> bounds;
537 libMesh::out <<
"Warning: Invalid quality measure chosen." << std::endl;
549 99,99,99,99,99,99,99,99,
550 0,1,2,0,0,1,2,3,4,5,6,5,
559 99,99,99,99,99,99,99,99,
560 1,2,3,3,4,5,6,7,5,6,7,7,
585 #ifdef LIBMESH_ENABLE_AMR 592 { 0, 2, 12, 10, 50, 52, 62, 60, 1, 7, 11, 5, 25, 27, 37, 35,
593 51, 57, 61, 55, 6, 26, 32, 36, 30, 56, 31},
596 { 2, 4, 14, 12, 52, 54, 64, 62, 3, 9, 13, 7, 27, 29, 39, 37,
597 53, 59, 63, 57, 8, 28, 34, 38, 32, 58, 33},
600 { 10, 12, 22, 20, 60, 62, 72, 70, 11, 17, 21, 15, 35, 37, 47, 45,
601 61, 67, 71, 65, 16, 36, 42, 46, 40, 66, 41},
604 { 12, 14, 24, 22, 62, 64, 74, 72, 13, 19, 23, 17, 37, 39, 49, 47,
605 63, 69, 73, 67, 18, 38, 44, 48, 42, 68, 43},
608 { 50, 52, 62, 60, 100, 102, 112, 110, 51, 57, 61, 55, 75, 77, 87, 85,
609 101, 107, 111, 105, 56, 76, 82, 86, 80, 106, 81},
612 { 52, 54, 64, 62, 102, 104, 114, 112, 53, 59, 63, 57, 77, 79, 89, 87,
613 103, 109, 113, 107, 58, 78, 84, 88, 82, 108, 93},
616 { 60, 62, 72, 70, 110, 112, 122, 120, 61, 67, 71, 65, 85, 87, 97, 95,
617 111, 117, 121, 115, 66, 86, 92, 96, 90, 116, 91},
620 { 62, 64, 74, 72, 112, 114, 124, 122, 63, 69, 73, 67, 87, 89, 99, 97,
621 113, 119, 123, 117, 68, 88, 94, 98, 92, 118, 103}
624 #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 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
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
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 _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 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 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
const Node * node_ptr(const unsigned int i) const
virtual Real quality(const ElemQuality q) const
virtual Real quality(const ElemQuality q) const override
static const unsigned short int _second_order_vertex_child_number[27]
Vector that names a child sharing each second order node.
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)
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_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.