libMesh
face_quad.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 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
Elem * _elemlinks_data[5+(LIBMESH_DIM >2)]
Data for links to parent/neighbor/interior_parent elements.
Definition: face_quad.h:184
static const Real _master_points[9][3]
Master element node locations.
Definition: face_quad.h:207
virtual unsigned int n_vertices() const override final
Definition: face_quad.h:96
A Node is like a Point, but with more information.
Definition: node.h:52
static const unsigned short int _second_order_vertex_child_index[9]
Vector that names the child vertex index for each second order node.
Definition: face_quad.h:202
The Face is an abstract element type that lives in two dimensions.
Definition: face.h:37
virtual dof_id_type key() const
This is the base class from which all geometric element types are derived.
Definition: elem.h:101
virtual Point master_point(const unsigned int i) const override final
Definition: face_quad.h:74
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const override final
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.
virtual std::unique_ptr< Elem > side_ptr(const unsigned int i) override final
virtual unsigned int n_children() const override final
Definition: face_quad.h:106
static const int _child_node_lookup[4][9]
Lookup table from child id, child node id to "possible node location" (a simple dictionary-index in a...
Definition: face_quad.h:213
virtual unsigned int opposite_node(const unsigned int n, const unsigned int s) const override final
static const unsigned short int _second_order_adjacent_vertices[4][2]
Matrix that tells which vertices define the location of mid-side (or second-order) nodes...
Definition: face_quad.h:192
virtual unsigned int which_node_am_i(unsigned int side, unsigned int side_node) const override
virtual unsigned int opposite_side(const unsigned int s) const override final
virtual Real quality(const ElemQuality q) const override
virtual dof_id_type key() const override
ElemQuality
Defines an enum for element quality metrics.
virtual unsigned int n_sides() const override final
Definition: face_quad.h:91
Quad(const unsigned int nn, Elem *p, Node **nodelinkdata)
Default quadrilateral element, takes number of nodes and parent.
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
The QUAD is an element in 2D composed of 4 sides.
Definition: face_quad.h:48
static const unsigned short int _second_order_vertex_child_number[9]
Vector that names a child sharing each second order node.
Definition: face_quad.h:197
virtual unsigned int n_nodes() const override
Definition: face_quad.h:86
Quad & operator=(const Quad &)=delete
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
virtual std::pair< Real, Real > qual_bounds(const ElemQuality q) const override
uint8_t dof_id_type
Definition: id_types.h:67