19#include "libmesh/edge_edge3.h"
20#include "libmesh/face_quad9.h"
21#include "libmesh/enum_io_package.h"
22#include "libmesh/enum_order.h"
44#ifdef LIBMESH_ENABLE_AMR
51 { 1.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000 },
52 { 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000, 0.00000, 0.00000, 0.00000 },
53 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000 },
54 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000 },
55 { 0.375000, -0.125000, 0.00000, 0.00000, 0.750000, 0.00000, 0.00000, 0.00000, 0.00000 },
56 { 0.00000, 0.00000, 0.00000, 0.00000, 0.375000, 0.00000, -0.125000, 0.00000, 0.750000 },
57 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, -0.125000, 0.00000, 0.375000, 0.750000 },
58 { 0.375000, 0.00000, 0.00000, -0.125000, 0.00000, 0.00000, 0.00000, 0.750000, 0.00000 },
59 { 0.140625, -0.0468750, 0.0156250, -0.0468750, 0.281250, -0.0937500, -0.0937500, 0.281250, 0.562500 }
65 { 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000, 0.00000, 0.00000, 0.00000 },
66 { 0.00000, 1.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000 },
67 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000, 0.00000, 0.00000 },
68 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000 },
69 { -0.125000, 0.375000, 0.00000, 0.00000, 0.750000, 0.00000, 0.00000, 0.00000, 0.00000 },
70 { 0.00000, 0.375000, -0.125000, 0.00000, 0.00000, 0.750000, 0.00000, 0.00000, 0.00000 },
71 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.375000, 0.00000, -0.125000, 0.750000 },
72 { 0.00000, 0.00000, 0.00000, 0.00000, 0.375000, 0.00000, -0.125000, 0.00000, 0.750000 },
73 { -0.0468750, 0.140625, -0.0468750, 0.0156250, 0.281250, 0.281250, -0.0937500, -0.0937500, 0.562500 }
79 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000 },
80 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000 },
81 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000, 0.00000 },
82 { 0.00000, 0.00000, 0.00000, 1.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000 },
83 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, -0.125000, 0.00000, 0.375000, 0.750000 },
84 { 0.00000, 0.00000, 0.00000, 0.00000, -0.125000, 0.00000, 0.375000, 0.00000, 0.750000 },
85 { 0.00000, 0.00000, -0.125000, 0.375000, 0.00000, 0.00000, 0.750000, 0.00000, 0.00000 },
86 { -0.125000, 0.00000, 0.00000, 0.375000, 0.00000, 0.00000, 0.00000, 0.750000, 0.00000 },
87 { -0.0468750, 0.0156250, -0.0468750, 0.140625, -0.0937500, -0.0937500, 0.281250, 0.281250, 0.562500 }
93 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000 },
94 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000, 0.00000, 0.00000 },
95 { 0.00000, 0.00000, 1.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000 },
96 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000, 0.00000 },
97 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.375000, 0.00000, -0.125000, 0.750000 },
98 { 0.00000, -0.125000, 0.375000, 0.00000, 0.00000, 0.750000, 0.00000, 0.00000, 0.00000 },
99 { 0.00000, 0.00000, 0.375000, -0.125000, 0.00000, 0.00000, 0.750000, 0.00000, 0.00000 },
100 { 0.00000, 0.00000, 0.00000, 0.00000, -0.125000, 0.00000, 0.375000, 0.00000, 0.750000 },
101 { 0.0156250, -0.0468750, 0.140625, -0.0468750, -0.0937500, 0.281250, 0.281250, -0.0937500, 0.562500 }
136 const unsigned int s)
const
138 libmesh_assert_less (s,
n_sides());
147 libmesh_assert_less(s,
n_sides());
189 libmesh_assert_less (s, this->
n_sides());
214 libmesh_error_msg(
"Invalid side s = " << s);
228 unsigned int side_node)
const
230 libmesh_assert_less (side, this->
n_sides());
240 return this->simple_build_side_ptr<Edge3, Quad9>(i);
246 const unsigned int i)
248 this->simple_build_side_ptr<Quad9>(side, i,
EDGE3);
255 std::vector<dof_id_type> & conn)
const
301 libmesh_error_msg(
"Invalid sf = " << sf);
314 libmesh_error_msg(
"Unsupported IO package " << iop);
331 for (
unsigned d=0; d<LIBMESH_DIM; ++d)
334 Real hd = std::abs(center - this->
point(0)(d));
335 for (
unsigned int p=0; p != 8; ++p)
336 hd = std::max(hd, std::abs(center - this->
point(p)(d)));
338 pmin(d) = center - hd;
339 pmax(d) = center + hd;
365 a1 = x0/2 + x1/2 + x2/2 + x3/2 - x4 - x5 - x6 - x7 + 2*x8,
366 b1 = -x0/4 + x1/4 + x2/4 - x3/4 - x5/2 + x7/2,
367 c1 = -x0/2 - x1/2 + x2/2 + x3/2 + x4 - x6,
369 e1 = x0/4 - x1/4 + x2/4 - x3/4,
372 b2 = -x0/4 - x1/4 + x2/4 + x3/4 + x4/2 - x6/2,
373 c2 = -x0/2 + x1/2 + x2/2 - x3/2 - x5 + x7,
374 d2 = x0/4 - x1/4 + x2/4 - x3/4,
379 const unsigned int N = 3;
380 const Real q[N] = {-std::sqrt(15)/5., 0., std::sqrt(15)/5.};
381 const Real w[N] = {5./9, 8./9, 5./9};
384 for (
unsigned int i=0; i<N; ++i)
385 for (
unsigned int j=0; j<N; ++j)
387 cross_norm(q[i]*q[j]*q[j]*a1 + q[j]*q[j]*b1 + q[j]*q[i]*c1 + q[i]*d1 + q[j]*e1 + f1,
388 q[i]*q[i]*q[j]*a2 + q[i]*q[i]*b2 + q[j]*q[i]*c2 + q[i]*d2 + q[j]*e2 + f2);
410 libmesh_error_msg(
"Invalid n = " << n);
417 const unsigned int v)
const
419 libmesh_assert_greater_equal (n, this->
n_vertices());
420 libmesh_assert_less (n, this->
n_nodes());
426 libmesh_assert_less (v, 4);
427 return static_cast<unsigned short int>(v);
432 libmesh_assert_less (v, 2);
441std::pair<unsigned short int, unsigned short int>
444 libmesh_assert_greater_equal (n, this->
n_vertices());
445 libmesh_assert_less (n, this->
n_nodes());
451 return std::pair<unsigned short int, unsigned short int>
459 libmesh_assert_less (perm_num, 4);
461 for (
unsigned int i = 0; i != perm_num; ++i)
492 libmesh_assert_less (s, 4);
The BoundaryInfo class contains information relevant to boundary conditions including storing faces,...
Defines a Cartesian bounding box by the two corner extremum.
void swap4nodes(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four node_ptrs, "rotating" them.
static constexpr Real affine_tol
Default tolerance to use in has_affine_map().
const Point & point(const unsigned int i) const
void swap2nodes(unsigned int n1, unsigned int n2)
Swaps two node_ptrs.
void swap2neighbors(unsigned int n1, unsigned int n2)
Swaps two neighbor_ptrs.
void swap2boundarysides(unsigned short s1, unsigned short s2, BoundaryInfo *boundary_info) const
Swaps two sides in boundary_info, if it is non-null.
ElemMappingType mapping_type() const
static dof_id_type compute_key(dof_id_type n0)
virtual Real volume() const
void swap2boundaryedges(unsigned short e1, unsigned short e2, BoundaryInfo *boundary_info) const
Swaps two edges in boundary_info, if it is non-null.
dof_id_type node_id(const unsigned int i) const
void swap4neighbors(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four neighbor_ptrs, "rotating" them.
A Point defines a location in LIBMESH_DIM dimensional Real space.
virtual bool is_vertex(const unsigned int i) const override
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
virtual Real volume() const override
An optimized method for approximating the area of a QUAD9 using quadrature.
virtual BoundingBox loose_bounding_box() const override
static const int nodes_per_side
unsigned int center_node_on_side(const unsigned short side) const override final
virtual bool is_edge(const unsigned int i) const override
static const int num_nodes
Geometric constants for Quad9.
virtual dof_id_type key() const override
Compute a unique key for this element which is suitable for hashing (not necessarily unique,...
static const Real _embedding_matrix[num_children][num_nodes][num_nodes]
Matrix that computes new nodal locations/solution values from current nodes/solution.
virtual unsigned int n_second_order_adjacent_vertices(const unsigned int n) const override
virtual bool is_face(const unsigned int i) const override
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int e) 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.
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex(const unsigned int n) const override
virtual unsigned int n_sub_elem() const override
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const override
virtual bool has_affine_map() const override
virtual unsigned int n_nodes() const override
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i) override
virtual Order default_order() const override
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
virtual unsigned short int second_order_adjacent_vertex(const unsigned int n, const unsigned int v) const override
virtual void permute(unsigned int perm_num) override final
Permutes the element (by swapping node and neighbor pointers) according to the specified index.
virtual void flip(BoundaryInfo *) override final
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
virtual void connectivity(const unsigned int sf, const IOPackage iop, std::vector< dof_id_type > &conn) const override
ElemType side_type(const unsigned int s) const override final
virtual unsigned int n_vertices() const override final
static const int num_children
static const int num_sides
Geometric constants for Quad4.
virtual unsigned int n_sides() const override final
static const unsigned short int _second_order_adjacent_vertices[4][2]
Matrix that tells which vertices define the location of mid-side (or second-order) nodes.
static const unsigned short int _second_order_vertex_child_number[9]
Vector that names a child sharing each second order node.
static const unsigned short int _second_order_vertex_child_index[9]
Vector that names the child vertex index for each second order node.
bool relative_fuzzy_equals(const TypeVector< T > &rhs, Real tol=TOLERANCE) const
The libMesh namespace provides an interface to certain functionality in the library.
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
IOPackage
libMesh interfaces with several different software packages for the purposes of creating,...
ElemType
Defines an enum for geometric element types.
T cross_norm(const TypeVector< T > &b, const TypeVector< T > &c)
Calls cross_norm_sq() and takes the square root of the result.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real