libMesh
cell_inf_hex.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_INF_HEX_H
21 #define LIBMESH_CELL_INF_HEX_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 
30 namespace libMesh
31 {
32 
46 class InfHex : public InfCell
47 {
48 public:
49 
54  InfHex(const unsigned int nn, Elem * p, Node ** nodelinkdata) :
55  InfCell(nn, num_sides, p, _elemlinks_data, nodelinkdata)
56  {
57  // Make sure the interior parent isn't undefined
58  if (LIBMESH_DIM > 3)
59  this->set_interior_parent(nullptr);
60  }
61 
62  InfHex (InfHex &&) = delete;
63  InfHex (const InfHex &) = delete;
64  InfHex & operator= (const InfHex &) = delete;
65  InfHex & operator= (InfHex &&) = delete;
66  virtual ~InfHex() = default;
67 
72  virtual Point master_point (const unsigned int i) const override final
73  {
74  libmesh_assert_less(i, this->n_nodes());
75  return Point(_master_points[i][0],
76  _master_points[i][1],
77  _master_points[i][2]);
78  }
79 
83  static const int num_sides = 5;
84  static const int num_edges = 8;
85  static const int num_children = 4;
86 
92  virtual unsigned int n_sides() const override final { return 5; }
93 
99  virtual unsigned int n_vertices() const override final { return 8; }
100 
105  virtual bool is_mid_infinite_edge_node(const unsigned int i) const
106  override final { return (i > 3 && i < 8); }
107 
112  virtual unsigned int n_edges() const override final { return 8; }
113 
117  virtual unsigned int n_faces() const override final { return 5; }
118 
122  virtual unsigned int n_children() const override final { return 4; }
123 
127  virtual bool is_vertex(const unsigned int i) const override final { return (i < 8); }
128 
132  virtual bool is_edge(const unsigned int i) const override final { return (i >= 8 && i < 12); }
133 
137  virtual bool is_face(const unsigned int i) const override final { return (i >= 12 && i < 17); }
138 
143  virtual bool is_child_on_side(const unsigned int c,
144  const unsigned int s) const override final;
145 
149  virtual bool is_edge_on_side(const unsigned int e,
150  const unsigned int s) const override final;
151 
152  virtual std::vector<unsigned int> sides_on_edge(const unsigned int e) const override final;
153 
157  using Elem::key;
158 
163  virtual dof_id_type key (const unsigned int s) const override;
164 
171  virtual dof_id_type low_order_key (const unsigned int s) const override;
172 
176  virtual unsigned int local_side_node(unsigned int side,
177  unsigned int side_node) const override;
178 
182  virtual unsigned int local_edge_node(unsigned int edge,
183  unsigned int edge_node) const override;
184 
188  virtual std::unique_ptr<Elem> side_ptr (const unsigned int i) override final;
189 
193  virtual void side_ptr (std::unique_ptr<Elem> & side, const unsigned int i) override final;
194 
199  virtual Real quality (const ElemQuality q) const override;
200 
206  virtual std::pair<Real, Real> qual_bounds (const ElemQuality q) const override;
207 
213  virtual bool contains_point (const Point & p, Real tol=TOLERANCE) const override;
214 
218  virtual unsigned int n_permutations() const override final { return 4; }
219 
220  virtual bool is_flipped() const override final;
221 
222  virtual std::vector<unsigned int> edges_adjacent_to_node(const unsigned int n) const override;
223 
227  static const unsigned int edge_sides_map[8][2];
228 
229  virtual bool on_reference_element(const Point & p,
230  const Real eps = TOLERANCE) const override final;
231 
232 protected:
233 
237  Elem * _elemlinks_data[6+(LIBMESH_DIM>3)];
238 
239 
240 
250  static const unsigned short int _second_order_adjacent_vertices[8][2];
251 
255  static const unsigned short int _second_order_vertex_child_number[18];
256 
260  static const unsigned short int _second_order_vertex_child_index[18];
261 
265  static const Real _master_points[18][3];
266 
275  static const unsigned int adjacent_edges_map[/*num_vertices*/8][/*max_adjacent_edges*/3];
276 };
277 
278 
279 } // namespace libMesh
280 
281 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
282 
283 #endif // LIBMESH_CELL_INF_HEX_H
Elem * _elemlinks_data[6+(LIBMESH_DIM >3)]
Data for links to parent/neighbor/interior_parent elements.
Definition: cell_inf_hex.h:237
static const int num_children
Definition: cell_inf_hex.h:85
virtual std::vector< unsigned int > sides_on_edge(const unsigned int e) const override final
Definition: cell_inf_hex.C:264
InfHex & operator=(const InfHex &)=delete
A Node is like a Point, but with more information.
Definition: node.h:52
static const int num_sides
Geometric constants for all InfHexes.
Definition: cell_inf_hex.h:83
virtual Point master_point(const unsigned int i) const override final
Definition: cell_inf_hex.h:72
virtual dof_id_type low_order_key(const unsigned int s) const override
Definition: cell_inf_hex.C:110
virtual dof_id_type key() const
Definition: elem.C:753
static constexpr Real TOLERANCE
virtual bool is_face(const unsigned int i) const override final
We number faces last.
Definition: cell_inf_hex.h:137
This is the base class from which all geometric element types are derived.
Definition: elem.h:94
virtual std::pair< Real, Real > qual_bounds(const ElemQuality q) const override
Definition: cell_inf_hex.C:413
virtual bool is_edge_on_side(const unsigned int e, const unsigned int s) const override final
Definition: cell_inf_hex.C:253
The libMesh namespace provides an interface to certain functionality in the library.
virtual unsigned int local_edge_node(unsigned int edge, unsigned int edge_node) const override
Definition: cell_inf_hex.C:135
void set_interior_parent(Elem *p)
Sets the pointer to the element&#39;s interior_parent.
Definition: elem.C:1248
static const unsigned short int _second_order_adjacent_vertices[8][2]
For higher-order elements, namely InfHex16 and InfHex18, the matrices for adjacent vertices of second...
Definition: cell_inf_hex.h:250
The InfCell is an abstract element type that lives in three dimensions.
Definition: cell_inf.h:42
virtual ~InfHex()=default
virtual bool is_mid_infinite_edge_node(const unsigned int i) const override final
Definition: cell_inf_hex.h:105
virtual std::unique_ptr< Elem > side_ptr(const unsigned int i) override final
Definition: cell_inf_hex.C:146
static const int num_edges
Definition: cell_inf_hex.h:84
static const Real _master_points[18][3]
Master element node locations.
Definition: cell_inf_hex.h:265
virtual unsigned int n_nodes() const =0
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const override
Definition: cell_inf_hex.C:124
InfHex(const unsigned int nn, Elem *p, Node **nodelinkdata)
Default infinite brick element, takes number of nodes and parent.
Definition: cell_inf_hex.h:54
virtual bool is_edge(const unsigned int i) const override final
We number edges next.
Definition: cell_inf_hex.h:132
The InfHex is an element in 3D with 5 sides.
Definition: cell_inf_hex.h:46
virtual unsigned int n_vertices() const override final
Definition: cell_inf_hex.h:99
ElemQuality
Defines an enum for element quality metrics.
virtual unsigned int n_children() const override final
Definition: cell_inf_hex.h:122
static const unsigned int adjacent_edges_map[8][3]
This maps the node to the 3 (or fewer) edge ids adjacent to the node.
Definition: cell_inf_hex.h:275
virtual unsigned int n_faces() const override final
Definition: cell_inf_hex.h:117
virtual bool is_vertex(const unsigned int i) const override final
We number vertices first.
Definition: cell_inf_hex.h:127
virtual bool is_flipped() const override final
Definition: cell_inf_hex.C:273
static const unsigned int edge_sides_map[8][2]
This maps each edge to the sides that contain said edge.
Definition: cell_inf_hex.h:227
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_inf_hex.h:260
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::vector< unsigned int > edges_adjacent_to_node(const unsigned int n) const override
Definition: cell_inf_hex.C:281
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const override
Definition: cell_inf_hex.C:459
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const override final
Definition: cell_inf_hex.C:242
virtual bool on_reference_element(const Point &p, const Real eps=TOLERANCE) const override final
Definition: cell_inf_hex.C:541
virtual Real quality(const ElemQuality q) const override
Definition: cell_inf_hex.C:302
virtual unsigned int n_edges() const override final
Definition: cell_inf_hex.h:112
virtual unsigned int n_permutations() const override final
One non-infinite side, four orientations.
Definition: cell_inf_hex.h:218
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
static const unsigned short int _second_order_vertex_child_number[18]
Vector that names a child sharing each second order node.
Definition: cell_inf_hex.h:255
uint8_t dof_id_type
Definition: id_types.h:67
virtual unsigned int n_sides() const override final
Definition: cell_inf_hex.h:92