20 #include "libmesh/side.h" 21 #include "libmesh/cell_hex8.h" 22 #include "libmesh/edge_edge2.h" 23 #include "libmesh/face_quad4.h" 24 #include "libmesh/enum_io_package.h" 25 #include "libmesh/enum_order.h" 26 #include "libmesh/fe_lagrange_shape_1D.h" 91 const unsigned int s)
const 93 libmesh_assert_less (s,
n_sides());
102 libmesh_assert_less(s,
n_sides());
106 std::vector<unsigned>
109 libmesh_assert_less(e,
n_edges());
114 const unsigned int e)
const 116 libmesh_assert_less (e,
n_edges());
152 return this->simple_build_side_ptr<Quad4, Hex8>(i, proxy);
158 const unsigned int i)
160 this->simple_build_side_ptr<Hex8>(side, i,
QUAD4);
167 return this->simple_build_edge_ptr<Edge2,Hex8>(i);
174 this->simple_build_edge_ptr<Hex8>(edge, i,
EDGE2);
181 std::vector<dof_id_type> & conn)
const 212 libmesh_error_msg(
"Unsupported IO package " << iop);
218 #ifdef LIBMESH_ENABLE_AMR 231 { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
232 { 0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
233 { .25, .25, .25, .25, 0.0, 0.0, 0.0, 0.0},
234 { 0.5, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0},
235 { 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0},
236 { .25, .25, 0.0, 0.0, .25, .25, 0.0, 0.0},
237 {.125, .125, .125, .125, .125, .125, .125, .125},
238 { .25, 0.0, 0.0, .25, .25, 0.0, 0.0, .25}
244 { 0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
245 { 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
246 { 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0},
247 { .25, .25, .25, .25, 0.0, 0.0, 0.0, 0.0},
248 { .25, .25, 0.0, 0.0, .25, .25, 0.0, 0.0},
249 { 0.0, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0},
250 { 0.0, .25, .25, 0.0, 0.0, .25, .25, 0.0},
251 {.125, .125, .125, .125, .125, .125, .125, .125}
257 { 0.5, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0},
258 { .25, .25, .25, .25, 0.0, 0.0, 0.0, 0.0},
259 { 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0},
260 { 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0},
261 { .25, 0.0, 0.0, .25, .25, 0.0, 0.0, .25},
262 {.125, .125, .125, .125, .125, .125, .125, .125},
263 { 0.0, 0.0, .25, .25, 0.0, 0.0, .25, .25},
264 { 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5}
270 { .25, .25, .25, .25, 0.0, 0.0, 0.0, 0.0},
271 { 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0},
272 { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0},
273 { 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0},
274 {.125, .125, .125, .125, .125, .125, .125, .125},
275 { 0.0, .25, .25, 0.0, 0.0, .25, .25, 0.0},
276 { 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0},
277 { 0.0, 0.0, .25, .25, 0.0, 0.0, .25, .25}
283 { 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0},
284 { .25, .25, 0.0, 0.0, .25, .25, 0.0, 0.0},
285 {.125, .125, .125, .125, .125, .125, .125, .125},
286 { .25, 0.0, 0.0, .25, .25, 0.0, 0.0, .25},
287 { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0},
288 { 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0},
289 { 0.0, 0.0, 0.0, 0.0, .25, .25, .25, .25},
290 { 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.5}
296 { .25, .25, 0.0, 0.0, .25, .25, 0.0, 0.0},
297 { 0.0, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0},
298 { 0.0, .25, .25, 0.0, 0.0, .25, .25, 0.0},
299 {.125, .125, .125, .125, .125, .125, .125, .125},
300 { 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0},
301 { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0},
302 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0},
303 { 0.0, 0.0, 0.0, 0.0, .25, .25, .25, .25}
309 { .25, 0.0, 0.0, .25, .25, 0.0, 0.0, .25},
310 {.125, .125, .125, .125, .125, .125, .125, .125},
311 { 0.0, 0.0, .25, .25, 0.0, 0.0, .25, .25},
312 { 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5},
313 { 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.5},
314 { 0.0, 0.0, 0.0, 0.0, .25, .25, .25, .25},
315 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5},
316 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0}
322 {.125, .125, .125, .125, .125, .125, .125, .125},
323 { 0.0, .25, .25, 0.0, 0.0, .25, .25, 0.0},
324 { 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0},
325 { 0.0, 0.0, .25, .25, 0.0, 0.0, .25, .25},
326 { 0.0, 0.0, 0.0, 0.0, .25, .25, .25, .25},
327 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0},
328 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0},
329 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5}
355 a1 = -x0 + x1 - x2 + x3 + x4 - x5 + x6 - x7,
360 b1 = x0 - x1 + x2 - x3 + x4 - x5 + x6 - x7,
362 b3 = x0 - x1 - x2 + x3 - x4 + x5 + x6 - x7;
366 c2 = x0 + x1 - x2 - x3 - x4 - x5 + x6 + x7,
370 d1 = -x0 + x1 + x2 - x3 - x4 + x5 + x6 - x7,
371 d2 = -x0 - x1 + x2 + x3 - x4 - x5 + x6 + x7,
372 d3 = -x0 - x1 - x2 - x3 + x4 + x5 + x6 + x7;
382 static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
383 static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
384 static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
387 std::array<Real, Hex8::num_nodes> V{};
389 for (
const auto & xi : q)
390 for (
const auto & eta : q)
391 for (
const auto & zeta : q)
394 a2*xi*zeta + b2*xi + c2*zeta + d2,
395 a3*xi*eta + b3*xi + c3*eta + d3);
406 (x0*V[0] + x1*V[1] + x2*V[2] + x3*V[3] + x4*V[4] + x5*V[5] + x6*V[6] + x7*V[7]) /
407 (V[0] + V[1] + V[2] + V[3] + V[4] + V[5] + V[6] + V[7]);
436 x0 - x1 + x2 - x3 + x4 - x5 + x6 - x7,
437 x0 - x1 - x2 + x3 - x4 + x5 + x6 - x7,
438 -x0 + x1 + x2 - x3 - x4 + x5 + x6 - x7,
439 x0 + x1 - x2 - x3 - x4 - x5 + x6 + x7,
440 -x0 - x1 + x2 + x3 - x4 - x5 + x6 + x7,
441 -x0 - x1 - x2 - x3 + x4 + x5 + x6 + x7
463 libmesh_assert_less (perm_num, 24);
464 const unsigned int side = perm_num % 6;
465 const unsigned int rotate = perm_num / 6;
467 for (
unsigned int i = 0; i !=
rotate; ++i)
530 libmesh_assert_less (s, 6);
static const int num_nodes
Geometric constants for Hex8.
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
static const int num_sides
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i) override
Builds a EDGE2 built coincident with edge i.
ElemType
Defines an enum for geometric element types.
void swap2boundaryedges(unsigned short e1, unsigned short e2, BoundaryInfo *boundary_info) const
Swaps two edges in boundary_info, if it is non-null.
Order
defines an enum for polynomial orders.
Node ** _nodes
Pointers to the nodes we are connected to.
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
static const int num_edges
IOPackage
libMesh interfaces with several different software packages for the purposes of creating, reading, and writing mesh files.
virtual BoundingBox loose_bounding_box() const
virtual Real volume() const override
A specialization for computing the area of a hexahedron with flat sides.
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int e) const override
void swap2boundarysides(unsigned short s1, unsigned short s2, BoundaryInfo *boundary_info) const
Swaps two sides in boundary_info, if it is non-null.
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
The libMesh namespace provides an interface to certain functionality in the library.
virtual unsigned int n_sub_elem() const override
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
static const Real _embedding_matrix[num_children][num_nodes][num_nodes]
Matrix that computes new nodal locations/solution values from current nodes/solution.
ElemType side_type(const unsigned int s) const override final
virtual Order default_order() const override
T triple_product(const TypeVector< T > &a, const TypeVector< T > &b, const TypeVector< T > &c)
void swap4nodes(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four node_ptrs, "rotating" them.
void swap2nodes(unsigned int n1, unsigned int n2)
Swaps two node_ptrs.
static const unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
The BoundaryInfo class contains information relevant to boundary conditions including storing faces...
static const int nodes_per_edge
virtual void permute(unsigned int perm_num) override final
Permutes the element (by swapping node and neighbor pointers) according to the specified index...
static constexpr Real affine_tol
Default tolerance to use in has_affine_map().
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=false) override
Builds a QUAD4 built coincident with face i.
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
virtual bool has_affine_map() const override
virtual unsigned int n_edges() const override final
virtual bool is_face(const unsigned int i) const override
virtual Point true_centroid() const override
We compute the centroid of the Hex using a customized numerical quadrature approach that avoids unnec...
void swap2neighbors(unsigned int n1, unsigned int n2)
Swaps two neighbor_ptrs.
static const int nodes_per_side
Defines a Cartesian bounding box by the two corner extremum.
virtual void flip(BoundaryInfo *) override final
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
virtual bool is_edge(const unsigned int i) const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
virtual unsigned int n_sides() const override final
void swap4neighbors(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four neighbor_ptrs, "rotating" them.
virtual BoundingBox loose_bounding_box() const override
Builds a bounding box out of the nodal positions.
static Point centroid_from_points(const Point &x0, const Point &x1, const Point &x2, const Point &x3, const Point &x4, const Point &x5, const Point &x6, const Point &x7)
Class static helper function that computes the centroid of a hexahedral region from a set of input po...
virtual bool is_vertex(const unsigned int i) const override
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
bool relative_fuzzy_equals(const TypeVector< T > &rhs, Real tol=TOLERANCE) const
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
static const int num_children
Real fe_lagrange_1D_linear_shape(const unsigned int i, const Real xi)