Loading [MathJax]/extensions/tex2jax.js
libMesh
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
cell_prism.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2025 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_PRISM_H
21 #define LIBMESH_CELL_PRISM_H
22 
23 // Local includes
24 #include "libmesh/cell.h"
25 
26 namespace libMesh
27 {
28 
36 class Prism : public Cell
37 {
38 public:
39 
44  Prism(const unsigned int nn, Elem * p, Node ** nodelinkdata) :
45  Cell(nn, num_sides, p, _elemlinks_data, nodelinkdata)
46  {
47  // Make sure the interior parent isn't undefined
48  if (LIBMESH_DIM > 3)
49  this->set_interior_parent(nullptr);
50  }
51 
52  Prism (Prism &&) = delete;
53  Prism (const Prism &) = delete;
54  Prism & operator= (const Prism &) = delete;
55  Prism & operator= (Prism &&) = delete;
56  virtual ~Prism() = default;
57 
62  virtual Point master_point (const unsigned int i) const override final
63  {
64  libmesh_assert_less(i, this->n_nodes());
65  return Point(_master_points[i][0],
66  _master_points[i][1],
67  _master_points[i][2]);
68  }
69 
73  static const int num_sides = 5;
74  static const int num_edges = 9;
75  static const int num_children = 8;
76 
81  virtual unsigned int n_nodes() const override { return 6; }
82 
86  virtual unsigned int n_sides() const override final { return 5; }
87 
91  virtual unsigned int n_vertices() const override final { return 6; }
92 
96  virtual unsigned int n_edges() const override final { return 9; }
97 
101  virtual unsigned int n_faces() const override final { return 5; }
102 
106  virtual unsigned int n_children() const override final { return 8; }
107 
111  virtual bool is_child_on_side(const unsigned int c,
112  const unsigned int s) const override final;
113 
117  virtual bool is_edge_on_side(const unsigned int e,
118  const unsigned int s) const override final;
119 
123  using Elem::key;
124 
129  virtual dof_id_type key (const unsigned int s) const override;
130 
137  virtual dof_id_type low_order_key (const unsigned int s) const override;
138 
142  virtual unsigned int local_side_node(unsigned int side,
143  unsigned int side_node) const override;
144 
148  virtual unsigned int local_edge_node(unsigned int edge,
149  unsigned int edge_node) const override;
150 
154  virtual std::unique_ptr<Elem> side_ptr (const unsigned int i) override final;
155 
159  virtual void side_ptr (std::unique_ptr<Elem> & side, const unsigned int i) override final;
160 
161  virtual std::vector<unsigned int> sides_on_edge(const unsigned int e) const override final;
162 
166  virtual unsigned int n_permutations() const override final { return 6; }
167 
168  virtual bool is_flipped() const override final;
169 
170  virtual std::vector<unsigned int> edges_adjacent_to_node(const unsigned int n) const override;
171 
175  static const unsigned int edge_sides_map[9][2];
176 
177  virtual bool on_reference_element(const Point & p,
178  const Real eps = TOLERANCE) const override final;
179 
180 protected:
181 
185  Elem * _elemlinks_data[6+(LIBMESH_DIM>3)];
186 
193  static const unsigned short int _second_order_adjacent_vertices[9][2];
194 
198  static const unsigned short int _second_order_vertex_child_number[18];
199 
203  static const unsigned short int _second_order_vertex_child_index[18];
204 
208  static const Real _master_points[18][3];
209 
217  static const unsigned int adjacent_edges_map[/*num_vertices*/6][/*n_adjacent_edges*/3];
218 };
219 
220 } // namespace libMesh
221 
222 #endif // LIBMESH_CELL_PRISM_H
Prism(const unsigned int nn, Elem *p, Node **nodelinkdata)
Default prismatic element, takes number of nodes and parent.
Definition: cell_prism.h:44
Elem * _elemlinks_data[6+(LIBMESH_DIM >3)]
Data for links to parent/neighbor/interior_parent elements.
Definition: cell_prism.h:185
A Node is like a Point, but with more information.
Definition: node.h:52
static const int num_edges
Definition: cell_prism.h:74
virtual dof_id_type low_order_key(const unsigned int s) const override
Definition: cell_prism.C:112
virtual unsigned int n_permutations() const override final
Two triangular sides, three orientations.
Definition: cell_prism.h:166
virtual unsigned int n_nodes() const override
Definition: cell_prism.h:81
virtual dof_id_type key() const
Definition: elem.C:624
static constexpr Real TOLERANCE
virtual unsigned int n_sides() const override final
Definition: cell_prism.h:86
This is the base class from which all geometric element types are derived.
Definition: elem.h:94
virtual std::unique_ptr< Elem > side_ptr(const unsigned int i) override final
Definition: cell_prism.C:166
virtual ~Prism()=default
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const override
Definition: cell_prism.C:139
virtual unsigned int n_faces() const override final
Definition: cell_prism.h:101
The libMesh namespace provides an interface to certain functionality in the library.
void set_interior_parent(Elem *p)
Sets the pointer to the element&#39;s interior_parent.
Definition: elem.C:1119
static const int num_children
Definition: cell_prism.h:75
static const unsigned short int _second_order_adjacent_vertices[9][2]
Matrix that tells which vertices define the location of mid-side (or second-order) nodes...
Definition: cell_prism.h:193
virtual unsigned int n_children() const override final
Definition: cell_prism.h:106
virtual Point master_point(const unsigned int i) const override final
Definition: cell_prism.h:62
virtual bool is_flipped() const override final
Definition: cell_prism.C:279
static const Real _master_points[18][3]
Master element node locations.
Definition: cell_prism.h:208
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const override final
Definition: cell_prism.C:245
static const unsigned int adjacent_edges_map[6][3]
This maps the Prism vertex to the (in this case) 3 edge ids adjacent to the node.
Definition: cell_prism.h:217
static const unsigned short int _second_order_vertex_child_index[18]
Vector that names the child vertex index for each second order node.
Definition: cell_prism.h:203
virtual std::vector< unsigned int > sides_on_edge(const unsigned int e) const override final
Definition: cell_prism.C:270
virtual unsigned int local_edge_node(unsigned int edge, unsigned int edge_node) const override
Definition: cell_prism.C:155
The Cell is an abstract element type that lives in three dimensions.
Definition: cell.h:38
The Prism is an element in 3D with 5 sides.
Definition: cell_prism.h:36
virtual unsigned int n_vertices() const override final
Definition: cell_prism.h:91
virtual bool is_edge_on_side(const unsigned int e, const unsigned int s) const override final
Definition: cell_prism.C:259
static const unsigned short int _second_order_vertex_child_number[18]
Vector that names a child sharing each second order node.
Definition: cell_prism.h:198
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned int n_edges() const override final
Definition: cell_prism.h:96
static const unsigned int edge_sides_map[9][2]
This maps each edge to the sides that contain said edge.
Definition: cell_prism.h:175
static const int num_sides
Geometric constants for all Prisms.
Definition: cell_prism.h:73
Prism & operator=(const Prism &)=delete
virtual bool on_reference_element(const Point &p, const Real eps=TOLERANCE) const override final
Definition: cell_prism.C:306
virtual std::vector< unsigned int > edges_adjacent_to_node(const unsigned int n) const override
Definition: cell_prism.C:288
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
uint8_t dof_id_type
Definition: id_types.h:67