libMesh
face_inf_quad.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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, InfQuad::n_sides(), p, _elemlinks_data, nodelinkdata)
68  {
69  // Make sure the interior parent isn't undefined
70  if (LIBMESH_DIM > 2)
72  }
73 
78  virtual Point master_point (const unsigned int i) const libmesh_override
79  {
80  libmesh_assert_less(i, this->n_nodes());
81  return Point(_master_points[i][0],
82  _master_points[i][1],
83  _master_points[i][2]);
84  }
85 
89  virtual unsigned int dim() const libmesh_override { return 2; }
90 
96  virtual unsigned int n_sides() const libmesh_override { return 3; }
97 
101  virtual unsigned int n_vertices() const libmesh_override { return 4; }
102 
107  virtual unsigned int n_edges() const libmesh_override { return 3; }
108 
112  virtual unsigned int n_faces() const libmesh_override { return 0; }
113 
117  virtual unsigned int n_children() const libmesh_override { return 2; }
118 
123  virtual bool is_mid_infinite_edge_node(const unsigned int i) const
124  libmesh_override { return (i > 2 && i < 4); }
125 
129  virtual bool is_child_on_side(const unsigned int c,
130  const unsigned int s) const libmesh_override;
131 
135  using Elem::key;
136 
142  virtual dof_id_type key (const unsigned int s) const libmesh_override;
143 
147  virtual unsigned int which_node_am_i(unsigned int side,
148  unsigned int side_node) const libmesh_override;
149 
153  virtual UniquePtr<Elem> side_ptr (const unsigned int i) libmesh_override;
154 
158  virtual UniquePtr<Elem> build_edge_ptr (const unsigned int i) libmesh_override
159  { return build_side_ptr(i); }
160 
164  virtual bool is_edge_on_side(const unsigned int e,
165  const unsigned int s) const libmesh_override
166  { return (e == s); }
167 
172  virtual Real quality (const ElemQuality q) const libmesh_override;
173 
179  virtual std::pair<Real, Real> qual_bounds (const ElemQuality q) const libmesh_override;
180 
185  virtual bool infinite () const libmesh_override { return true; }
186 
190  virtual Point origin () const libmesh_override
191  {
192  return ( this->point(0)*2 - this->point(this->n_vertices()/2) );
193  }
194 
195 
196 protected:
197 
201  Elem * _elemlinks_data[4+(LIBMESH_DIM>2)];
202 
206  static const Real _master_points[6][3];
207 };
208 
209 } // namespace libMesh
210 
211 
212 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
213 
214 #endif // LIBMESH_FACE_INF_QUAD_H
virtual Real quality(const ElemQuality q) const libmesh_override
virtual unsigned int n_faces() const libmesh_override
virtual UniquePtr< Elem > build_side_ptr(const unsigned int i, bool proxy=true)=0
A Node is like a Point, but with more information.
Definition: node.h:52
virtual UniquePtr< Elem > side_ptr(const unsigned int i) libmesh_override
Definition: face_inf_quad.C:76
virtual unsigned int dim() const libmesh_override
Definition: face_inf_quad.h:89
virtual UniquePtr< Elem > build_edge_ptr(const unsigned int i) libmesh_override
build_edge_ptr() and build_side_ptr() are identical in 2D.
UniquePtr< Elem > side(const unsigned int i) const
Definition: elem.h:2105
virtual Point master_point(const unsigned int i) const libmesh_override
Definition: face_inf_quad.h:78
virtual Point origin() const libmesh_override
This is the base class from which all geometric element types are derived.
Definition: elem.h:89
static const Real _master_points[6][3]
Master element node locations.
const class libmesh_nullptr_t libmesh_nullptr
virtual unsigned int n_edges() const libmesh_override
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:1003
virtual unsigned int n_children() const libmesh_override
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
virtual unsigned int n_nodes() const =0
virtual bool is_mid_infinite_edge_node(const unsigned int i) const libmesh_override
virtual dof_id_type key() const
Definition: elem.C:503
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const libmesh_override
The InfQuad is an abstract element type that lives in two dimensions.
Definition: face_inf_quad.h:56
InfQuad(const unsigned int nn, Elem *p, Node **nodelinkdata)
Constructor.
Definition: face_inf_quad.h:64
virtual bool infinite() const libmesh_override
virtual std::pair< Real, Real > qual_bounds(const ElemQuality q) const libmesh_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.
const Point & point(const unsigned int i) const
Definition: elem.h:1809
virtual bool is_edge_on_side(const unsigned int e, const unsigned int s) const libmesh_override
is_edge_on_side is trivial in 2D.
ElemQuality
Defines an enum for element quality metrics.
virtual unsigned int n_vertices() const libmesh_override
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
virtual unsigned int which_node_am_i(unsigned int side, unsigned int side_node) const libmesh_override
Definition: face_inf_quad.C:65
virtual unsigned int n_sides() const libmesh_override
Definition: face_inf_quad.h:96
uint8_t dof_id_type
Definition: id_types.h:64