libMesh
Loading...
Searching...
No Matches
cell_inf_prism.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_INF_PRISM_H
21#define LIBMESH_CELL_INF_PRISM_H
22
23#include "libmesh/libmesh_config.h"
24
25#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
26
27// Local includes
28#include "libmesh/cell_inf.h"
29
30namespace libMesh
31{
32
46class InfPrism : public InfCell
47{
48public:
49
54 InfPrism(const unsigned int nn, Elem * p, Node ** nodelinkdata) :
55 InfCell(nn, num_sides, p, _elemlinks_data, nodelinkdata)
56 {}
57
58 InfPrism (InfPrism &&) = delete;
59 InfPrism (const InfPrism &) = delete;
60 InfPrism & operator= (const InfPrism &) = delete;
62 virtual ~InfPrism() = default;
63
68 virtual Point master_point (const unsigned int i) const override final
69 {
70 libmesh_assert_less(i, this->n_nodes());
71 return Point(_master_points[i][0],
72 _master_points[i][1],
73 _master_points[i][2]);
74 }
75
79 static const int num_sides = 4;
80 static const int num_edges = 6;
81 static const int num_children = 4;
82
88 virtual unsigned int n_sides() const override final { return 4; }
89
94 virtual unsigned int n_vertices() const override final { return 6; }
95
100 virtual unsigned int n_edges() const override final { return 6; }
101
105 virtual unsigned int n_faces() const override final { return 4; }
106
110 virtual unsigned int n_children() const override final { return 4; }
111
115 virtual bool is_vertex(const unsigned int i) const override final { return (i < 6); }
116
120 virtual bool is_edge(const unsigned int i) const override final { return (i >= 6 && i < 9); }
121
125 virtual bool is_face(const unsigned int i) const override final { return (i >= 9 && i < 12); }
126
131 virtual bool is_mid_infinite_edge_node(const unsigned int i) const
132 override final { return (i > 2 && i < 6); }
133
137 virtual bool is_child_on_side(const unsigned int c,
138 const unsigned int s) const override final;
139
143 virtual bool is_edge_on_side(const unsigned int e,
144 const unsigned int s) const override final;
145
149 using Elem::key;
150
155 virtual dof_id_type key (const unsigned int s) const override;
156
163 virtual dof_id_type low_order_key (const unsigned int s) const override;
164
168 virtual unsigned int local_side_node(unsigned int side,
169 unsigned int side_node) const override;
170
174 virtual unsigned int local_edge_node(unsigned int edge,
175 unsigned int edge_node) const override;
176
181 virtual std::unique_ptr<Elem> side_ptr (const unsigned int i) override final;
182
187 virtual void side_ptr (std::unique_ptr<Elem> & side, const unsigned int i) override final;
188
194 virtual bool contains_point (const Point & p, Real tol=TOLERANCE) const override;
195
199 virtual unsigned int n_permutations() const override final { return 3; }
200
201 std::vector<unsigned int> sides_on_edge(const unsigned int e) const override final;
202
203 virtual bool is_flipped() const override final;
204
205 virtual std::vector<unsigned int> edges_adjacent_to_node(const unsigned int n) const override;
206
210 static const unsigned int edge_sides_map[6][2];
211
212 virtual bool on_reference_element(const Point & p,
213 const Real eps = TOLERANCE) const override final;
214
215protected:
216
220 Elem * _elemlinks_data[5+(LIBMESH_DIM>3)];
221
225 static const Real _master_points[12][3];
226
235 static const unsigned int adjacent_edges_map[/*num_vertices*/6][/*max_adjacent_edges*/3];
236};
237
238} // namespace libMesh
239
240#endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
241
242#endif // LIBMESH_CELL_INF_PRISM_H
This is the base class from which all geometric element types are derived.
Definition elem.h:96
virtual unsigned int n_nodes() const =0
virtual dof_id_type key(const unsigned int s) const =0
The InfCell is an abstract element type that lives in three dimensions.
Definition cell_inf.h:43
The InfPrism is an element in 3D with 4 sides.
virtual Point master_point(const unsigned int i) const override final
std::vector< unsigned int > sides_on_edge(const unsigned int e) const override final
virtual unsigned int n_vertices() const override final
static const Real _master_points[12][3]
Master element node locations.
virtual std::unique_ptr< Elem > side_ptr(const unsigned int i) override final
static const int num_edges
InfPrism(const InfPrism &)=delete
virtual unsigned int n_edges() const override final
virtual unsigned int n_permutations() const override final
One non-infinite side, three orientations.
static const int num_sides
Geometric constants for all InfPrisms.
virtual unsigned int local_edge_node(unsigned int edge, unsigned int edge_node) const override
virtual std::vector< unsigned int > edges_adjacent_to_node(const unsigned int n) const override
virtual bool is_flipped() const override final
InfPrism & operator=(const InfPrism &)=delete
virtual bool is_mid_infinite_edge_node(const unsigned int i) const override final
virtual bool on_reference_element(const Point &p, const Real eps=TOLERANCE) const override final
virtual bool is_vertex(const unsigned int i) const override final
We number vertices first.
virtual unsigned int n_faces() const override final
virtual bool is_edge_on_side(const unsigned int e, const unsigned int s) const override final
static const unsigned int adjacent_edges_map[6][3]
This maps the node to the 3 (or fewer) edge ids adjacent to the node.
virtual dof_id_type key() const
Don't hide Elem::key() defined in the base class.
Definition elem.C:738
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const override final
virtual unsigned int n_sides() const override final
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const override
virtual dof_id_type low_order_key(const unsigned int s) const override
Elem * _elemlinks_data[5+(LIBMESH_DIM >3)]
Data for links to parent/neighbor/interior_parent elements.
static const unsigned int edge_sides_map[6][2]
This maps each edge to the sides that contain said edge.
InfPrism(const unsigned int nn, Elem *p, Node **nodelinkdata)
Default infinite prism element, takes number of nodes and parent.
virtual unsigned int n_children() const override final
virtual bool is_edge(const unsigned int i) const override final
We number edges next.
virtual ~InfPrism()=default
static const int num_children
virtual bool is_face(const unsigned int i) const override final
We number faces last.
InfPrism(InfPrism &&)=delete
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const override
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 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