libMesh
face_quad4.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_QUAD4_H
21 #define LIBMESH_FACE_QUAD4_H
22 
23 // Local includes
24 #include "libmesh/libmesh_common.h"
25 #include "libmesh/face_quad.h"
26 
27 namespace libMesh
28 {
29 
53 class Quad4 : public Quad
54 {
55 public:
56 
60  explicit
61  Quad4 (Elem * p=nullptr) :
63 
64  Quad4 (Quad4 &&) = delete;
65  Quad4 (const Quad4 &) = delete;
66  Quad4 & operator= (const Quad4 &) = delete;
67  Quad4 & operator= (Quad4 &&) = delete;
68  virtual ~Quad4() = default;
69 
73  virtual ElemType type () const override { return QUAD4; }
74 
78  virtual unsigned int n_sub_elem() const override { return 1; }
79 
83  virtual bool is_vertex(const unsigned int i) const override;
84 
88  virtual bool is_edge(const unsigned int i) const override;
89 
93  virtual bool is_face(const unsigned int i) const override;
94 
99  virtual bool is_node_on_side(const unsigned int n,
100  const unsigned int s) const override;
101 
102  virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;
103 
104  virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;
105 
110  virtual bool is_node_on_edge(const unsigned int n,
111  const unsigned int e) const override
112  { return this->is_node_on_side(n,e); }
113 
118  virtual bool has_affine_map () const override;
119 
123  virtual bool has_invertible_map(Real tol) const override;
124 
128  virtual Order default_order() const override;
129 
130  virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int i) override;
131 
135  virtual void build_side_ptr (std::unique_ptr<Elem> & elem,
136  const unsigned int i) override;
137 
138  // Avoid hiding deprecated version with different signature
139  using Elem::build_side_ptr;
140 
141  virtual void connectivity(const unsigned int sf,
142  const IOPackage iop,
143  std::vector<dof_id_type> & conn) const override;
144 
148  static const int num_nodes = 4;
149  static const int nodes_per_side = 2;
150 
155  static const unsigned int side_nodes_map[num_sides][nodes_per_side];
156 
161  virtual Point true_centroid () const override;
162 
168  virtual Real volume () const override;
169 
173  virtual BoundingBox loose_bounding_box () const override;
174 
175  virtual void permute(unsigned int perm_num) override final;
176 
177  virtual void flip(BoundaryInfo *) override final;
178 
179  ElemType side_type (const unsigned int s) const override final;
180 
181 protected:
182 
187 
188 
189 
190 #ifdef LIBMESH_ENABLE_AMR
191 
195  virtual Real embedding_matrix (const unsigned int i,
196  const unsigned int j,
197  const unsigned int k) const override
198  { return _embedding_matrix[i][j][k]; }
199 
205 
207 
208 #endif // LIBMESH_ENABLE_AMR
209 
210 };
211 
212 
213 } // namespace libMesh
214 
215 #endif // LIBMESH_FACE_QUAD4_H
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
Definition: face_quad4.C:109
Node * _nodelinks_data[num_nodes]
Data for links to nodes.
Definition: face_quad4.h:186
ElemType
Defines an enum for geometric element types.
Order
defines an enum for polynomial orders.
Definition: enum_order.h:40
A Node is like a Point, but with more information.
Definition: node.h:52
virtual ElemType type() const override
Definition: face_quad4.h:73
The QUAD4 is an element in 2D composed of 4 nodes.
Definition: face_quad4.h:53
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
Definition: face_quad4.h:155
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i)=0
virtual Real embedding_matrix(const unsigned int i, const unsigned int j, const unsigned int k) const override
Matrix used to create the elements children.
Definition: face_quad4.h:195
IOPackage
libMesh interfaces with several different software packages for the purposes of creating, reading, and writing mesh files.
This is the base class from which all geometric element types are derived.
Definition: elem.h:94
virtual bool has_invertible_map(Real tol) const override
Definition: face_quad4.C:139
virtual bool has_affine_map() const override
Definition: face_quad4.C:131
virtual bool is_edge(const unsigned int i) const override
Definition: face_quad4.C:99
LIBMESH_ENABLE_TOPOLOGY_CACHES
Definition: face_quad4.h:206
The libMesh namespace provides an interface to certain functionality in the library.
ElemType side_type(const unsigned int s) const override final
Definition: face_quad4.C:380
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
Definition: face_quad4.h:110
virtual bool is_vertex(const unsigned int i) const override
Definition: face_quad4.C:93
virtual ~Quad4()=default
virtual Order default_order() const override
Definition: face_quad4.C:205
virtual BoundingBox loose_bounding_box() const override
Builds a bounding box out of the nodal positions.
Definition: face_quad4.C:350
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
Definition: face_quad4.C:119
The BoundaryInfo class contains information relevant to boundary conditions including storing faces...
Definition: boundary_info.h:57
static const int nodes_per_side
Definition: face_quad4.h:149
Quad4(Elem *p=nullptr)
Constructor.
Definition: face_quad4.h:61
static const int num_nodes
Geometric constants for Quad4.
Definition: face_quad4.h:148
Defines a Cartesian bounding box by the two corner extremum.
Definition: bounding_box.h:40
static const int num_sides
Geometric constants for Quad4.
Definition: face_quad.h:85
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real volume() const override
An optimized method for computing the area of a 4-node quad with straight sides, but not necessarily ...
Definition: face_quad4.C:312
The QUAD is an element in 2D composed of 4 sides.
Definition: face_quad.h:48
virtual Point true_centroid() const override
An optimized method for computing the centroid of a 4-node quad with straight sides.
Definition: face_quad4.C:264
virtual void flip(BoundaryInfo *) override final
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
Definition: face_quad4.C:368
virtual void permute(unsigned int perm_num) override final
Permutes the element (by swapping node and neighbor pointers) according to the specified index...
Definition: face_quad4.C:356
static const Real _embedding_matrix[num_children][num_nodes][num_nodes]
Matrix that computes new nodal locations/solution values from current nodes/solution.
Definition: face_quad4.h:204
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i) override
Definition: face_quad4.C:212
virtual bool is_face(const unsigned int i) const override
Definition: face_quad4.C:104
Quad4 & operator=(const Quad4 &)=delete
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
static const int num_children
Definition: face_quad.h:86
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int e) const override
Definition: face_quad4.C:126
virtual unsigned int n_sub_elem() const override
Definition: face_quad4.h:78
virtual void connectivity(const unsigned int sf, const IOPackage iop, std::vector< dof_id_type > &conn) const override
Definition: face_quad4.C:227