libMesh
face_inf_quad.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_FACE_INF_QUAD_H
21 #define LIBMESH_FACE_INF_QUAD_H
22 
23 #include "libmesh/libmesh_config.h"
24 
25 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
26 
27 // Local includes
28 #include "libmesh/elem.h"
29 
30 namespace libMesh
31 {
32 
56 class InfQuad : public Elem
57 {
58 public:
59 
63  explicit
64  InfQuad (const unsigned int nn,
65  Elem * p,
66  Node ** nodelinkdata) :
67  Elem(nn, num_sides, p, _elemlinks_data, nodelinkdata)
68  {
69  // Make sure the interior parent isn't undefined
70  if (LIBMESH_DIM > 2)
71  this->set_interior_parent(nullptr);
72  }
73 
74  InfQuad (InfQuad &&) = delete;
75  InfQuad (const InfQuad &) = delete;
76  InfQuad & operator= (const InfQuad &) = delete;
77  InfQuad & operator= (InfQuad &&) = delete;
78  virtual ~InfQuad() = default;
79 
84  virtual Point master_point (const unsigned int i) const override final
85  {
86  libmesh_assert_less(i, this->n_nodes());
87  return Point(_master_points[i][0],
88  _master_points[i][1],
89  _master_points[i][2]);
90  }
91 
95  static const int num_sides = 3;
96  static const int num_children = 2;
97 
101  virtual unsigned short dim() const override final { return 2; }
102 
108  virtual unsigned int n_sides() const override final { return 3; }
109 
113  virtual unsigned int n_vertices() const override final { return 4; }
114 
119  virtual unsigned int n_edges() const override final { return 3; }
120 
124  virtual unsigned int n_faces() const override final { return 0; }
125 
129  virtual unsigned int n_children() const override final { return 2; }
130 
134  virtual bool is_vertex(const unsigned int i) const override final { return (i < 4); }
135 
139  virtual bool is_edge(const unsigned int i) const override final { return (i >= 4 && i < 5); }
140 
144  virtual bool is_face(const unsigned int i) const override final { return (i >= 5); }
145 
150  virtual bool is_mid_infinite_edge_node(const unsigned int i) const
151  override final { return (i > 2 && i < 4); }
152 
156  virtual bool is_child_on_side(const unsigned int c,
157  const unsigned int s) const override final;
158 
162  using Elem::key;
163 
168  virtual dof_id_type key (const unsigned int s) const override;
169 
176  virtual dof_id_type low_order_key (const unsigned int s) const override;
177 
181  virtual unsigned int local_side_node(unsigned int side,
182  unsigned int side_node) const override;
183 
189  virtual unsigned int local_edge_node(unsigned int edge,
190  unsigned int edge_node) const override;
191 
195  virtual std::unique_ptr<Elem> side_ptr (const unsigned int i) override final;
196 
200  virtual void side_ptr (std::unique_ptr<Elem> & side, const unsigned int i) override final;
201 
205  virtual std::unique_ptr<Elem> build_edge_ptr (const unsigned int i) override final
206  { return build_side_ptr(i); }
207 
211  virtual void build_edge_ptr (std::unique_ptr<Elem> & edge, const unsigned int i) override final
212  { build_side_ptr(edge, i); }
213 
214  // Avoid hiding deprecated version with different signature
215  using Elem::build_side_ptr;
216 
220  virtual bool is_edge_on_side(const unsigned int e,
221  const unsigned int s) const override final
222  { return (e == s); }
223 
227  virtual std::vector<unsigned int> sides_on_edge(const unsigned int e) const override final
228  { return {e}; }
229 
234  virtual Real quality (const ElemQuality q) const override;
235 
241  virtual std::pair<Real, Real> qual_bounds (const ElemQuality q) const override;
242 
247  virtual bool infinite () const override final { return true; }
248 
252  virtual Point origin () const override final
253  {
254  return ( this->point(0)*2 - this->point(this->n_vertices()/2) );
255  }
256 
261  virtual unsigned int n_permutations() const override final { return 0; }
262 
263  virtual void permute(unsigned int) override final { libmesh_error(); }
264 
265  virtual bool is_flipped() const override final;
266 
267  virtual std::vector<unsigned int> edges_adjacent_to_node(const unsigned int n) const override;
268 
269  virtual bool on_reference_element(const Point & p,
270  const Real eps = TOLERANCE) const override final;
271 
272 protected:
273 
277  Elem * _elemlinks_data[4+(LIBMESH_DIM>2)];
278 
282  static const Real _master_points[6][3];
283 
292  static const unsigned int adjacent_sides_map[/*num_vertices*/4][/*max_adjacent_sides*/2];
293 };
294 
295 } // namespace libMesh
296 
297 
298 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
299 
300 #endif // LIBMESH_FACE_INF_QUAD_H
virtual unsigned int n_permutations() const override final
One non-infinite side; any orientation change flips the mapping Jacobian negative.
virtual bool is_edge(const unsigned int i) const override final
We number edges next.
virtual bool is_face(const unsigned int i) const override final
We number faces last.
virtual std::pair< Real, Real > qual_bounds(const ElemQuality q) const override
virtual unsigned int n_faces() const override final
virtual std::vector< unsigned int > edges_adjacent_to_node(const unsigned int n) const override
A Node is like a Point, but with more information.
Definition: node.h:52
virtual ~InfQuad()=default
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const override
Definition: face_inf_quad.C:85
virtual bool on_reference_element(const Point &p, const Real eps=TOLERANCE) const override final
virtual unsigned int n_edges() const override final
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i)=0
virtual dof_id_type key() const
Definition: elem.C:753
static constexpr Real TOLERANCE
This is the base class from which all geometric element types are derived.
Definition: elem.h:94
static const Real _master_points[6][3]
Master element node locations.
virtual bool is_vertex(const unsigned int i) const override final
We number vertices first.
static const int num_sides
Geometric constants for all InfQuads.
Definition: face_inf_quad.h:95
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i) override final
build_edge_ptr() and build_side_ptr() are identical in 2D.
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:1248
virtual bool is_edge_on_side(const unsigned int e, const unsigned int s) const override final
is_edge_on_side is trivial in 2D.
virtual unsigned int n_vertices() const override final
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const override final
virtual Point origin() const override final
virtual unsigned int n_nodes() const =0
static const unsigned int adjacent_sides_map[4][2]
This maps the node to the one or two side id(s) adjacent to the node.
virtual unsigned short dim() const override final
The InfQuad is an abstract element type that lives in two dimensions.
Definition: face_inf_quad.h:56
ElemQuality
Defines an enum for element quality metrics.
virtual void build_edge_ptr(std::unique_ptr< Elem > &edge, const unsigned int i) override final
side and edge are identical for faces.
InfQuad(const unsigned int nn, Elem *p, Node **nodelinkdata)
Constructor.
Definition: face_inf_quad.h:64
virtual bool is_mid_infinite_edge_node(const unsigned int i) const override final
virtual Real quality(const ElemQuality q) const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Elem * _elemlinks_data[4+(LIBMESH_DIM >2)]
Data for links to parent/neighbor/interior_parent elements.
virtual bool infinite() const override final
virtual unsigned int n_sides() const override final
virtual bool is_flipped() const override final
virtual unsigned int n_children() const override final
virtual dof_id_type low_order_key(const unsigned int s) const override
Definition: face_inf_quad.C:73
virtual Point master_point(const unsigned int i) const override final
Definition: face_inf_quad.h:84
static const int num_children
Definition: face_inf_quad.h:96
virtual unsigned int local_edge_node(unsigned int edge, unsigned int edge_node) const override
Calls local_side_node(edge, edge_node).
Definition: face_inf_quad.C:96
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
const Point & point(const unsigned int i) const
Definition: elem.h:2453
virtual std::vector< unsigned int > sides_on_edge(const unsigned int e) const override final
sides_on_edge is trivial in 2D.
virtual void permute(unsigned int) override final
Permutes the element (by swapping node and neighbor pointers) according to the specified index...
virtual std::unique_ptr< Elem > side_ptr(const unsigned int i) override final
InfQuad & operator=(const InfQuad &)=delete
uint8_t dof_id_type
Definition: id_types.h:67