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"
81 const unsigned int s)
const
83 libmesh_assert_less (s,
n_sides());
92 libmesh_assert_less(s,
n_sides());
93 auto trim = (s == 4) ? 0 : 1;
100 libmesh_assert_less(e,
n_edges());
105 const unsigned int e)
const
107 libmesh_assert_less (e,
n_edges());
133 libmesh_assert_less (i, this->
n_sides());
135 std::unique_ptr<Elem> face;
144 face = std::make_unique<Tri3>();
149 face = std::make_unique<Quad4>();
153 libmesh_error_msg(
"Invalid side i = " << i);
157 for (
auto n : face->node_index_range())
160 face->set_interior_parent(
this);
161 face->inherit_data_from(*
this);
169 const unsigned int i)
172 side->set_interior_parent(
this);
173 side->inherit_data_from(*
this);
180 return this->simple_build_edge_ptr<Edge2,Pyramid5>(i);
187 this->simple_build_edge_ptr<Pyramid5>(edge, i,
EDGE2);
194 std::vector<dof_id_type> & conn)
const
228 libmesh_error_msg(
"Unsupported IO package " << iop);
280 libmesh_assert_less (perm_num, 4);
282 for (
unsigned int i = 0; i != perm_num; ++i)
306 libmesh_assert_less (s, 5);
316 libmesh_assert_less (s, 5);
331 return pointing_out.
unit();
344 const Point normal_at_vertex = current_edge.
cross(next_edge);
345 normal += normal_at_vertex;
346 current_edge = next_edge;
349 return normal.
unit();
352 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...
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
static const unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
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 const 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
static const int num_edges
static const int num_sides
Geometric constants for all Pyramids.
TypeVector< typename CompareTypes< T, T2 >::supertype > cross(const TypeVector< T2 > &v) const
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,...
ElemType
Defines an enum for geometric element types.
T triple_product(const TypeVector< T > &a, const TypeVector< T > &b, const TypeVector< T > &c)
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...