libMesh
face_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_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)
62  }
63 
68  virtual Point master_point (const unsigned int i) const libmesh_override
69  {
70  libmesh_assert_less(i, this->n_nodes());
71  return Point(_master_points[i][0],
72  _master_points[i][1],
73  _master_points[i][2]);
74  }
75 
80  virtual unsigned int n_nodes() const libmesh_override { return 4; }
81 
85  virtual unsigned int n_sides() const libmesh_override { return 4; }
86 
90  virtual unsigned int n_vertices() const libmesh_override { return 4; }
91 
95  virtual unsigned int n_edges() const libmesh_override { return 4; }
96 
100  virtual unsigned int n_children() const libmesh_override { return 4; }
101 
106  virtual bool is_child_on_side(const unsigned int c,
107  const unsigned int s) const libmesh_override;
108 
113  virtual unsigned int opposite_side(const unsigned int s) const libmesh_override;
114 
120  virtual unsigned int opposite_node(const unsigned int n,
121  const unsigned int s) const libmesh_override;
122 
126  using Elem::key;
127 
133  virtual dof_id_type key (const unsigned int s) const libmesh_override;
134 
140  virtual dof_id_type key () const libmesh_override;
141 
145  virtual unsigned int which_node_am_i(unsigned int side,
146  unsigned int side_node) const libmesh_override;
147 
151  virtual UniquePtr<Elem> side_ptr (const unsigned int i) libmesh_override;
152 
157  virtual Real quality (const ElemQuality q) const libmesh_override;
158 
164  virtual std::pair<Real, Real> qual_bounds (const ElemQuality q) const libmesh_override;
165 
166 
167 protected:
168 
172  Elem * _elemlinks_data[5+(LIBMESH_DIM>2)];
173 
180  static const unsigned short int _second_order_adjacent_vertices[4][2];
181 
185  static const unsigned short int _second_order_vertex_child_number[9];
186 
190  static const unsigned short int _second_order_vertex_child_index[9];
191 
195  static const Real _master_points[9][3];
196 
201  static const int _child_node_lookup[4][9];
202 };
203 
204 } // namespace libMesh
205 
206 #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:172
virtual unsigned int opposite_node(const unsigned int n, const unsigned int s) const libmesh_override
Definition: face_quad.C:121
A Node is like a Point, but with more information.
Definition: node.h:52
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const libmesh_override
Definition: face_quad.C:98
The Face is an abstract element type that lives in two dimensions.
Definition: face.h:37
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:201
virtual dof_id_type key() const libmesh_override
Definition: face_quad.C:74
virtual Real quality(const ElemQuality q) const libmesh_override
Definition: face_quad.C:151
UniquePtr< Elem > side(const unsigned int i) const
Definition: elem.h:2105
This is the base class from which all geometric element types are derived.
Definition: elem.h:89
const class libmesh_nullptr_t libmesh_nullptr
static const Real _master_points[9][3]
Master element node locations.
Definition: face_quad.h:195
The libMesh namespace provides an interface to certain functionality in the library.
virtual UniquePtr< Elem > side_ptr(const unsigned int i) libmesh_override
Definition: face_quad.C:84
void set_interior_parent(Elem *p)
Sets the pointer to the element&#39;s interior_parent.
Definition: elem.C:1003
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
virtual unsigned int n_vertices() const libmesh_override
Definition: face_quad.h:90
virtual dof_id_type key() const
Definition: elem.C:503
virtual unsigned int opposite_side(const unsigned int s) const libmesh_override
Definition: face_quad.C:112
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:190
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:185
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:180
virtual unsigned int n_edges() const libmesh_override
Definition: face_quad.h:95
virtual unsigned int which_node_am_i(unsigned int side, unsigned int side_node) const libmesh_override
Definition: face_quad.C:63
virtual unsigned int n_nodes() const libmesh_override
Definition: face_quad.h:80
Quad(const unsigned int nn, Elem *p, Node **nodelinkdata)
Default quadrilateral element, takes number of nodes and parent.
Definition: face_quad.h:56
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned int n_children() const libmesh_override
Definition: face_quad.h:100
virtual Point master_point(const unsigned int i) const libmesh_override
Definition: face_quad.h:68
The QUAD is an element in 2D composed of 4 sides.
Definition: face_quad.h:48
virtual unsigned int n_sides() const libmesh_override
Definition: face_quad.h:85
ElemQuality
Defines an enum for element quality metrics.
virtual std::pair< Real, Real > qual_bounds(const ElemQuality q) const libmesh_override
Definition: face_quad.C:196
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
uint8_t dof_id_type
Definition: id_types.h:64