face_quad.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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_QUAD_H
21 #define LIBMESH_FACE_QUAD_H
22 
23 
24 // Local includes
25 #include "libmesh/libmesh_common.h"
26 #include "libmesh/face.h"
27 
28 namespace libMesh
29 {
30 
48 class Quad : public Face
49 {
50 public:
51 
56  Quad (const unsigned int nn, Elem * p, Node ** nodelinkdata) :
57  Face(nn, Quad::n_sides(), p, _elemlinks_data, nodelinkdata)
58  {
59  // Make sure the interior parent isn't undefined
60  if (LIBMESH_DIM > 2)
61  this->set_interior_parent(nullptr);
62  }
63 
64  Quad (Quad &&) = delete;
65  Quad (const Quad &) = delete;
66  Quad & operator= (const Quad &) = delete;
67  Quad & operator= (Quad &&) = delete;
68  virtual ~Quad() = default;
69 
74  virtual Point master_point (const unsigned int i) const override final
75  {
76  libmesh_assert_less(i, this->n_nodes());
77  return Point(_master_points[i][0],
78  _master_points[i][1],
79  _master_points[i][2]);
80  }
81 
86  virtual unsigned int n_nodes() const override { return 4; }
87 
91  virtual unsigned int n_sides() const override final { return 4; }
92 
96  virtual unsigned int n_vertices() const override final { return 4; }
97 
101  virtual unsigned int n_edges() const override final { return 4; }
102 
106  virtual unsigned int n_children() const override final { return 4; }
107 
112  virtual bool is_child_on_side(const unsigned int c,
113  const unsigned int s) const override final;
114 
119  virtual unsigned int opposite_side(const unsigned int s) const override final;
120 
126  virtual unsigned int opposite_node(const unsigned int n,
127  const unsigned int s) const override final;
128 
132  using Elem::key;
133 
139  virtual dof_id_type key (const unsigned int s) const override;
140 
146  virtual dof_id_type key () const override;
147 
151  virtual unsigned int which_node_am_i(unsigned int side,
152  unsigned int side_node) const override;
153 
157  virtual std::unique_ptr<Elem> side_ptr (const unsigned int i) override final;
158 
162  virtual void side_ptr (std::unique_ptr<Elem> & elem,
163  const unsigned int i) override final;
164 
169  virtual Real quality (const ElemQuality q) const override;
170 
176  virtual std::pair<Real, Real> qual_bounds (const ElemQuality q) const override;
177 
178 
179 protected:
180 
184  Elem * _elemlinks_data[5+(LIBMESH_DIM>2)];
185 
192  static const unsigned short int _second_order_adjacent_vertices[4][2];
193 
197  static const unsigned short int _second_order_vertex_child_number[9];
198 
202  static const unsigned short int _second_order_vertex_child_index[9];
203 
207  static const Real _master_points[9][3];
208 
213  static const int _child_node_lookup[4][9];
214 };
215 
216 } // namespace libMesh
217 
218 #endif // LIBMESH_FACE_QUAD_H
virtual std::pair< Real, Real > qual_bounds(const ElemQuality q) const override
Definition: face_quad.C:299
Elem * _elemlinks_data[5+(LIBMESH_DIM >2)]
Definition: face_quad.h:184
virtual unsigned int n_vertices() const override final
Definition: face_quad.h:96
A geometric point in (x,y,z) space associated with a DOF.
Definition: node.h:52
The base class for all 2D geometric element types.
Definition: face.h:37
static const int _child_node_lookup[4][9]
Definition: face_quad.h:213
virtual dof_id_type key() const
Definition: elem.C:401
virtual std::unique_ptr< Elem > side_ptr(const unsigned int i) override final
Definition: face_quad.C:86
The base class for all geometric element types.
Definition: elem.h:100
virtual Point master_point(const unsigned int i) const override final
Definition: face_quad.h:74
virtual dof_id_type key() const override
Definition: face_quad.C:76
static const Real _master_points[9][3]
Definition: face_quad.h:207
void set_interior_parent(Elem *p)
Definition: elem.C:856
virtual unsigned int n_children() const override final
Definition: face_quad.h:106
static const unsigned short int _second_order_vertex_child_index[9]
Definition: face_quad.h:202
static const unsigned short int _second_order_vertex_child_number[9]
Definition: face_quad.h:197
static const unsigned short int _second_order_adjacent_vertices[4][2]
Definition: face_quad.h:192
virtual Real quality(const ElemQuality q) const override
Definition: face_quad.C:158
virtual unsigned int n_sides() const override final
Definition: face_quad.h:91
Quad(const unsigned int nn, Elem *p, Node **nodelinkdata)
Definition: face_quad.h:56
virtual unsigned int n_edges() const override final
Definition: face_quad.h:101
virtual ~Quad()=default
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned int which_node_am_i(unsigned int side, unsigned int side_node) const override
Definition: face_quad.C:65
The base class for all quadrilateral element types.
Definition: face_quad.h:48
virtual unsigned int opposite_side(const unsigned int s) const override final
Definition: face_quad.C:122
virtual unsigned int opposite_node(const unsigned int n, const unsigned int s) const override final
Definition: face_quad.C:131
virtual unsigned int n_nodes() const override
Definition: face_quad.h:86
Quad & operator=(const Quad &)=delete
A geometric point in (x,y,z) space.
Definition: point.h:38
std::unique_ptr< Elem > side(const unsigned int i) const
Definition: elem.h:2202
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const override final
Definition: face_quad.C:108
uint8_t dof_id_type
Definition: id_types.h:64