20#include "libmesh/cell_pyramid5.h"
21#include "libmesh/edge_edge2.h"
22#include "libmesh/face_tri3.h"
23#include "libmesh/face_quad4.h"
24#include "libmesh/enum_io_package.h"
25#include "libmesh/enum_order.h"
26#include "libmesh/cell_hex8.h"
60 const unsigned int s)
const
62 libmesh_assert_less (s,
n_sides());
71 libmesh_assert_less(s,
n_sides());
72 auto trim = (s == 4) ? 0 : 1;
79 libmesh_assert_less(e,
n_edges());
84 const unsigned int e)
const
86 libmesh_assert_less (e,
n_edges());
112 libmesh_assert_less (i, this->
n_sides());
114 std::unique_ptr<Elem> face;
123 face = std::make_unique<Tri3>();
128 face = std::make_unique<Quad4>();
132 libmesh_error_msg(
"Invalid side i = " << i);
136 for (
auto n : face->node_index_range())
139 face->set_interior_parent(
this);
140 face->inherit_data_from(*
this);
148 const unsigned int i)
151 side->set_interior_parent(
this);
152 side->inherit_data_from(*
this);
159 return this->simple_build_edge_ptr<Edge2,Pyramid5>(i);
166 this->simple_build_edge_ptr<Pyramid5>(edge, i,
EDGE2);
173 std::vector<dof_id_type> & conn)
const
207 libmesh_error_msg(
"Unsupported IO package " << iop);
259 libmesh_assert_less (perm_num, 4);
261 for (
unsigned int i = 0; i != perm_num; ++i)
285 libmesh_assert_less (s, 5);
295 libmesh_assert_less (s, 5);
310 return pointing_out.
unit();
323 const Point normal_at_vertex = current_edge.
cross(next_edge);
324 normal += normal_at_vertex;
325 current_edge = next_edge;
328 return normal.
unit();
331 libmesh_error_msg(
"Invalid side s = " << s);
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.
virtual BoundingBox loose_bounding_box() const
const Point & point(const unsigned int i) const
void swap2nodes(unsigned int n1, unsigned int n2)
Swaps two node_ptrs.
Node ** _nodes
Pointers to the nodes we are connected to.
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
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.
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...
A Point defines a location in LIBMESH_DIM dimensional Real space.
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int e) const override
virtual void flip(BoundaryInfo *) override final
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
static constexpr unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i) override
Builds a QUAD4 or TRI3 built coincident with face i.
virtual bool is_vertex(const unsigned int i) const override
virtual bool is_edge(const unsigned int i) const override
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i) override
Builds a EDGE2 built coincident with edge i.
virtual Point true_centroid() const override
We compute the centroid of the Pyramid by treating it as a degenerate Hex8 element.
static const int num_nodes
Geometric constants for Pyramid5.
virtual void permute(unsigned int perm_num) override final
Permutes the element (by swapping node and neighbor pointers) according to the specified index.
virtual BoundingBox loose_bounding_box() const override
Builds a bounding box out of the nodal positions.
static const int nodes_per_side
virtual Order default_order() const override
virtual bool is_face(const unsigned int i) const override
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
virtual Real volume() const override
Specialization for computing the volume of a pyramid.
virtual unsigned int n_sub_elem() const override
ElemType side_type(const unsigned int s) const override final
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
virtual Point side_vertex_average_normal(const unsigned int s) const override final
static const int nodes_per_edge
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
virtual bool has_affine_map() const override
virtual unsigned int n_sides() const override
virtual unsigned int n_edges() const override
virtual std::unique_ptr< Elem > side_ptr(const unsigned int i) override
TypeVector< typename CompareTypes< T, T2 >::supertype > cross(const TypeVector< T2 > &v) const
LIBMESH_DEVICE_INLINE TypeVector< T > unit() const
The libMesh namespace provides an interface to certain functionality in the library.
IOPackage
libMesh interfaces with several different software packages for the purposes of creating,...
LIBMESH_DEVICE_INLINE T triple_product(const TypeVector< T > &a, const TypeVector< T > &b, const TypeVector< T > &c)
ElemType
Defines an enum for geometric element types.
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...