libMesh
Loading...
Searching...
No Matches
cell_pyramid.h
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3
4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public
6// License as published by the Free Software Foundation; either
7// version 2.1 of the License, or (at your option) any later version.
8
9// This library is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12// Lesser General Public License for more details.
13
14// You should have received a copy of the GNU Lesser General Public
15// License along with this library; if not, write to the Free Software
16// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18
19
20#ifndef LIBMESH_CELL_PYRAMID_H
21#define LIBMESH_CELL_PYRAMID_H
22
23// Local includes
24#include "libmesh/cell.h"
25
26namespace libMesh
27{
28
29
30
31
39class Pyramid : public Cell
40{
41public:
42
48 Pyramid(const unsigned int nn, Elem * p, Node ** nodelinkdata) :
49 Cell(nn, num_sides, p, _elemlinks_data, nodelinkdata)
50 {
51 // Make sure the interior parent isn't undefined
52 if (LIBMESH_DIM > 3)
53 this->set_interior_parent(nullptr);
54 }
55
56 Pyramid (Pyramid &&) = delete;
57 Pyramid (const Pyramid &) = delete;
58 Pyramid & operator= (const Pyramid &) = delete;
59 Pyramid & operator= (Pyramid &&) = delete;
60 virtual ~Pyramid() = default;
61
66 virtual Point master_point (const unsigned int i) const override
67 {
68 libmesh_assert_less(i, this->n_nodes());
69 return Point(_master_points[i][0],
70 _master_points[i][1],
71 _master_points[i][2]);
72 }
73
77 static const int num_sides = 5;
78 static const int num_edges = 8;
79 static const int num_children = 0; // not implemented
80
85 virtual unsigned int n_nodes() const override { return 5; }
86
90 virtual unsigned int n_sides() const override { return 5; }
91
95 virtual unsigned int n_vertices() const override { return 5; }
96
100 virtual unsigned int n_edges() const override { return 8; }
101
105 virtual unsigned int n_faces() const override { return 5; }
106
110 virtual unsigned int n_children() const override { return 10; }
111
116 virtual bool is_child_on_side(const unsigned int c,
117 const unsigned int s) const override;
118
122 virtual bool is_edge_on_side(const unsigned int e,
123 const unsigned int s) const override;
124
128 using Elem::key;
129
134 virtual dof_id_type key (const unsigned int s) const override;
135
142 virtual dof_id_type low_order_key (const unsigned int s) const override;
143
147 virtual unsigned int local_side_node(unsigned int side,
148 unsigned int side_node) const override;
149
153 virtual unsigned int local_edge_node(unsigned int edge,
154 unsigned int edge_node) const override;
155
159 virtual std::unique_ptr<Elem> side_ptr (const unsigned int i) override;
160
164 virtual void side_ptr (std::unique_ptr<Elem> & side, const unsigned int i) override;
165
166 virtual std::vector<unsigned int> sides_on_edge(const unsigned int e) const override final;
167
179 unsigned int local_singular_node(const Point & p, const Real tol = TOLERANCE*TOLERANCE) const override final;
180
185 virtual bool is_singular_node(unsigned int node_idx) const override final { return (node_idx == 4); }
186
190 virtual unsigned int n_permutations() const override final { return 4; }
191
192 virtual bool is_flipped() const override final;
193
194 virtual std::vector<unsigned int> edges_adjacent_to_node(const unsigned int n) const override;
195
199 static const unsigned int edge_sides_map[8][2];
200
201 virtual bool on_reference_element(const Point & p,
202 const Real eps = TOLERANCE) const override final;
203
204protected:
205
209 Elem * _elemlinks_data[6+(LIBMESH_DIM>3)];
210
214 static const Real _master_points[14][3];
215
216#ifdef LIBMESH_ENABLE_AMR
217
221 unsigned int side_children_matrix (const unsigned int,
222 const unsigned int) const
223 { libmesh_not_implemented(); return 0; }
224
225#endif
226
235 static const unsigned int adjacent_edges_map[/*num_vertices*/5][/*max_adjacent_edges*/4];
236};
237
238} // namespace libMesh
239
240#endif // LIBMESH_CELL_PYRAMID_H
The Cell is an abstract element type that lives in three dimensions.
Definition cell.h:39
This is the base class from which all geometric element types are derived.
Definition elem.h:96
void set_interior_parent(Elem *p)
Sets the pointer to the element's interior_parent.
Definition elem.C:1222
virtual dof_id_type key(const unsigned int s) const =0
A Node is like a Point, but with more information.
Definition node.h:55
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition point.h:40
The Pyramid is an element in 3D with 5 sides.
static const unsigned int edge_sides_map[8][2]
This maps each edge to the sides that contain said edge.
virtual unsigned int n_nodes() const override
virtual bool is_edge_on_side(const unsigned int e, const unsigned int s) const override
Pyramid & operator=(const Pyramid &)=delete
virtual unsigned int n_children() const override
virtual std::vector< unsigned int > sides_on_edge(const unsigned int e) const override final
virtual unsigned int n_sides() const override
virtual dof_id_type low_order_key(const unsigned int s) const override
static const Real _master_points[14][3]
Master element node locations.
virtual unsigned int n_edges() const override
unsigned int side_children_matrix(const unsigned int, const unsigned int) const
Matrix that allows children to inherit boundary conditions.
virtual bool is_flipped() const override final
Elem * _elemlinks_data[6+(LIBMESH_DIM >3)]
Data for links to parent/neighbor/interior_parent elements.
Pyramid(const unsigned int nn, Elem *p, Node **nodelinkdata)
Default pyramid, one quad face, four triangular faces, takes number of nodes and parent.
unsigned int local_singular_node(const Point &p, const Real tol=TOLERANCE *TOLERANCE) const override final
virtual std::vector< unsigned int > edges_adjacent_to_node(const unsigned int n) const override
virtual dof_id_type key() const
Don't hide Elem::key() defined in the base class.
Definition elem.C:738
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const override
virtual Point master_point(const unsigned int i) const override
virtual unsigned int n_faces() const override
virtual ~Pyramid()=default
Pyramid(const Pyramid &)=delete
virtual std::unique_ptr< Elem > side_ptr(const unsigned int i) override
static const unsigned int adjacent_edges_map[5][4]
This maps the node to the 3 or 4 edge ids adjacent to the node.
Pyramid(Pyramid &&)=delete
static const int num_edges
static const int num_sides
Geometric constants for all Pyramids.
virtual unsigned int n_permutations() const override final
One quad side, four orientations.
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const override
virtual unsigned int local_edge_node(unsigned int edge, unsigned int edge_node) const override
virtual unsigned int n_vertices() const override
virtual bool on_reference_element(const Point &p, const Real eps=TOLERANCE) const override final
virtual bool is_singular_node(unsigned int node_idx) const override final
static const int num_children
The libMesh namespace provides an interface to certain functionality in the library.
static constexpr Real TOLERANCE
uint8_t dof_id_type
Definition id_types.h:67
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real