libMesh
face_tri6.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2024 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_TRI6_H
21 #define LIBMESH_FACE_TRI6_H
22 
23 // Local includes
24 #include "libmesh/libmesh_common.h"
25 #include "libmesh/face_tri.h"
26 
27 namespace libMesh
28 {
29 
61 class Tri6 : public Tri
62 {
63 public:
64 
68  explicit
69  Tri6 (Elem * p=nullptr) :
70  Tri(Tri6::n_nodes(), p, _nodelinks_data) {}
71 
72  Tri6 (Tri6 &&) = delete;
73  Tri6 (const Tri6 &) = delete;
74  Tri6 & operator= (const Tri6 &) = delete;
75  Tri6 & operator= (Tri6 &&) = delete;
76  virtual ~Tri6() = default;
77 
81  virtual ElemType type () const override { return TRI6; }
82 
86  virtual unsigned int n_nodes() const override { return num_nodes; }
87 
91  virtual unsigned int n_sub_elem() const override { return 4; }
92 
96  virtual bool is_vertex(const unsigned int i) const override;
97 
101  virtual bool is_edge(const unsigned int i) const override;
102 
106  virtual bool is_face(const unsigned int i) const override;
107 
112  virtual bool is_node_on_side(const unsigned int n,
113  const unsigned int s) const override;
114 
115  virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;
116 
117  virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;
118 
123  virtual bool is_node_on_edge(const unsigned int n,
124  const unsigned int e) const override
125  { return this->is_node_on_side(n,e); }
126 
131  virtual bool has_affine_map () const override;
132 
136  virtual Order default_order() const override;
137 
141  using Elem::key;
142 
151  virtual dof_id_type key (const unsigned int s) const override;
152 
156  virtual unsigned int local_side_node(unsigned int side,
157  unsigned int side_node) const override;
158 
159  virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int i,
160  bool proxy=false) override;
161 
165  virtual void build_side_ptr (std::unique_ptr<Elem> & elem,
166  const unsigned int i) override;
167 
168  virtual void connectivity(const unsigned int sf,
169  const IOPackage iop,
170  std::vector<dof_id_type> & conn) const override;
171 
175  virtual unsigned int n_second_order_adjacent_vertices (const unsigned int) const override
176  { return 2; }
177 
184  virtual unsigned short int second_order_adjacent_vertex (const unsigned int n,
185  const unsigned int v) const override;
186 
192  virtual std::pair<unsigned short int, unsigned short int>
193  second_order_child_vertex (const unsigned int n) const override;
194 
198  static const int num_nodes = 6;
199  static const int num_sides = 3;
200  static const int num_children = 4;
201  static const int nodes_per_side = 3;
202 
207  static const unsigned int side_nodes_map[num_sides][nodes_per_side];
208 
213  virtual Real volume () const override;
214 
219  virtual BoundingBox loose_bounding_box () const override;
220 
221  virtual void permute(unsigned int perm_num) override final;
222 
223  virtual void flip(BoundaryInfo *) override final;
224 
225  unsigned int center_node_on_side(const unsigned short side) const override final;
226 
227  ElemType side_type (const unsigned int s) const override final;
228 
229 protected:
230 
235 
236 
237 
238 #ifdef LIBMESH_ENABLE_AMR
239 
243  virtual Real embedding_matrix (const unsigned int i,
244  const unsigned int j,
245  const unsigned int k) const override
246  { return _embedding_matrix[i][j][k]; }
247 
253 
255 
256 #endif // LIBMESH_ENABLE_AMR
257 
258 private:
259 
264  static const unsigned short int _second_order_adjacent_vertices[num_sides][2];
265 
269  static const unsigned short int _second_order_vertex_child_number[num_nodes];
270 
274  static const unsigned short int _second_order_vertex_child_index[num_nodes];
275 };
276 
277 
278 } // namespace libMesh
279 
280 #endif // LIBMESH_FACE_TRI6_H
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
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_tri6.h:207
virtual unsigned int n_nodes() const override
Definition: face_tri6.h:86
virtual Real volume() const override
An optimized method for approximating the area of a TRI6 using quadrature.
Definition: face_tri6.C:328
ElemType side_type(const unsigned int s) const override final
Definition: face_tri6.C:463
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
Definition: face_tri6.C:121
Tri6(Elem *p=nullptr)
Constructor.
Definition: face_tri6.h:69
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int e) const override
Definition: face_tri6.C:138
virtual dof_id_type key() const
Definition: elem.C:563
Tri6 & operator=(const Tri6 &)=delete
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const override
Definition: face_tri6.C:199
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 Order default_order() const override
Definition: face_tri6.C:164
The Tri is an element in 2D composed of 3 sides.
Definition: face_tri.h:47
static const unsigned short int _second_order_adjacent_vertices[num_sides][2]
Matrix that tells which vertices define the location of mid-side (or second-order) nodes...
Definition: face_tri6.h:264
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_tri6.C:432
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
Definition: face_tri6.h:123
unsigned int center_node_on_side(const unsigned short side) const override final
Definition: face_tri6.C:455
The libMesh namespace provides an interface to certain functionality in the library.
static const int nodes_per_side
Definition: face_tri6.h:201
virtual bool is_face(const unsigned int i) const override
Definition: face_tri6.C:116
The Tri6 is an element in 2D composed of 6 nodes.
Definition: face_tri6.h:61
static const unsigned short int _second_order_vertex_child_number[num_nodes]
Vector that names a child sharing each second order node.
Definition: face_tri6.h:269
static const unsigned short int _second_order_vertex_child_index[num_nodes]
Vector that names the child vertex index for each second order node.
Definition: face_tri6.h:274
LIBMESH_ENABLE_TOPOLOGY_CACHES
Definition: face_tri6.h:254
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_tri6.C:445
virtual dof_id_type key() const override final
Definition: face_tri.C:93
Node * _nodelinks_data[num_nodes]
Data for links to nodes.
Definition: face_tri6.h:234
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
Definition: face_tri6.C:131
The BoundaryInfo class contains information relevant to boundary conditions including storing faces...
Definition: boundary_info.h:57
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=false) override
Definition: face_tri6.C:210
virtual unsigned int n_second_order_adjacent_vertices(const unsigned int) const override
Definition: face_tri6.h:175
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_tri6.h:252
static const int num_sides
Definition: face_tri6.h:199
virtual unsigned int n_sub_elem() const override
Definition: face_tri6.h:91
virtual unsigned short int second_order_adjacent_vertex(const unsigned int n, const unsigned int v) const override
Definition: face_tri6.C:385
Defines a Cartesian bounding box by the two corner extremum.
Definition: bounding_box.h:40
virtual bool has_affine_map() const override
Definition: face_tri6.C:143
virtual bool is_edge(const unsigned int i) const override
Definition: face_tri6.C:109
virtual BoundingBox loose_bounding_box() const override
Definition: face_tri6.C:297
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const int num_children
Definition: face_tri6.h:200
virtual void connectivity(const unsigned int sf, const IOPackage iop, std::vector< dof_id_type > &conn) const override
Definition: face_tri6.C:226
virtual ElemType type() const override
Definition: face_tri6.h:81
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex(const unsigned int n) const override
Definition: face_tri6.C:406
static const int num_nodes
Geometric constants for Tri6.
Definition: face_tri6.h:198
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_tri6.h:243
virtual bool is_vertex(const unsigned int i) const override
Definition: face_tri6.C:102
virtual ~Tri6()=default
uint8_t dof_id_type
Definition: id_types.h:67