libMesh
face_tri6.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_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 
56 class Tri6 : public Tri
57 {
58 public:
59 
63  explicit
64  Tri6 (Elem * p=nullptr) :
65  Tri(Tri6::n_nodes(), p, _nodelinks_data) {}
66 
67  Tri6 (Tri6 &&) = delete;
68  Tri6 (const Tri6 &) = delete;
69  Tri6 & operator= (const Tri6 &) = delete;
70  Tri6 & operator= (Tri6 &&) = delete;
71  virtual ~Tri6() = default;
72 
76  virtual ElemType type () const override { return TRI6; }
77 
81  virtual unsigned int n_nodes() const override { return num_nodes; }
82 
86  virtual unsigned int n_sub_elem() const override { return 4; }
87 
91  virtual bool is_vertex(const unsigned int i) const override;
92 
96  virtual bool is_edge(const unsigned int i) const override;
97 
101  virtual bool is_face(const unsigned int i) const override;
102 
107  virtual bool is_node_on_side(const unsigned int n,
108  const unsigned int s) const override;
109 
110  virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;
111 
116  virtual bool is_node_on_edge(const unsigned int n,
117  const unsigned int e) const override
118  { return this->is_node_on_side(n,e); }
119 
124  virtual bool has_affine_map () const override;
125 
129  virtual Order default_order() const override;
130 
134  using Elem::key;
135 
145  virtual dof_id_type key (const unsigned int s) const override;
146 
150  virtual unsigned int which_node_am_i(unsigned int side,
151  unsigned int side_node) const override;
152 
153  virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int i,
154  bool proxy=true) override;
155 
159  virtual void build_side_ptr (std::unique_ptr<Elem> & elem,
160  const unsigned int i) override;
161 
162  virtual void connectivity(const unsigned int sf,
163  const IOPackage iop,
164  std::vector<dof_id_type> & conn) const override;
165 
169  virtual unsigned int n_second_order_adjacent_vertices (const unsigned int) const override
170  { return 2; }
171 
178  virtual unsigned short int second_order_adjacent_vertex (const unsigned int n,
179  const unsigned int v) const override;
180 
186  virtual std::pair<unsigned short int, unsigned short int>
187  second_order_child_vertex (const unsigned int n) const override;
188 
192  static const int num_nodes = 6;
193  static const int num_sides = 3;
194  static const int num_children = 4;
195  static const int nodes_per_side = 3;
196 
201  static const unsigned int side_nodes_map[num_sides][nodes_per_side];
202 
207  virtual Real volume () const override;
208 
213  virtual BoundingBox loose_bounding_box () const override;
214 
215 protected:
216 
221 
222 
223 
224 #ifdef LIBMESH_ENABLE_AMR
225 
229  virtual float embedding_matrix (const unsigned int i,
230  const unsigned int j,
231  const unsigned int k) const override
232  { return _embedding_matrix[i][j][k]; }
233 
239 
241 
242 #endif // LIBMESH_ENABLE_AMR
243 
244 private:
245 
250  static const unsigned short int _second_order_adjacent_vertices[num_sides][2];
251 
255  static const unsigned short int _second_order_vertex_child_number[num_nodes];
256 
260  static const unsigned short int _second_order_vertex_child_index[num_nodes];
261 };
262 
263 
264 } // namespace libMesh
265 
266 #endif // LIBMESH_FACE_TRI6_H
libMesh::Tri6::connectivity
virtual void connectivity(const unsigned int sf, const IOPackage iop, std::vector< dof_id_type > &conn) const override
Definition: face_tri6.C:232
libMesh::dof_id_type
uint8_t dof_id_type
Definition: id_types.h:67
libMesh::Tri6::type
virtual ElemType type() const override
Definition: face_tri6.h:76
libMesh::Tri6::is_face
virtual bool is_face(const unsigned int i) const override
Definition: face_tri6.C:116
libMesh::Tri6::num_nodes
static const int num_nodes
Geometric constants for Tri6.
Definition: face_tri6.h:192
libMesh::Tri6::_second_order_vertex_child_number
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:255
libMesh::Tri6::num_sides
static const int num_sides
Definition: face_tri6.h:193
libMesh::Tri6
The Tri6 is an element in 2D composed of 6 nodes.
Definition: face_tri6.h:56
libMesh::Tri6::n_sub_elem
virtual unsigned int n_sub_elem() const override
Definition: face_tri6.h:86
libMesh::Tri6::LIBMESH_ENABLE_TOPOLOGY_CACHES
LIBMESH_ENABLE_TOPOLOGY_CACHES
Definition: face_tri6.h:240
libMesh::IOPackage
IOPackage
libMesh interfaces with several different software packages for the purposes of creating,...
Definition: enum_io_package.h:37
libMesh::Tri6::_second_order_vertex_child_index
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:260
libMesh::BoundingBox
Defines a Cartesian bounding box by the two corner extremum.
Definition: bounding_box.h:40
libMesh::Tri6::_second_order_adjacent_vertices
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:250
libMesh::Tri6::is_node_on_side
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
Definition: face_tri6.C:121
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
libMesh::Tri6::Tri6
Tri6(Elem *p=nullptr)
Constructor.
Definition: face_tri6.h:64
libMesh::Order
Order
Definition: enum_order.h:40
libMesh::Tri6::which_node_am_i
virtual unsigned int which_node_am_i(unsigned int side, unsigned int side_node) const override
Definition: face_tri6.C:190
libMesh::Tri6::is_vertex
virtual bool is_vertex(const unsigned int i) const override
Definition: face_tri6.C:102
libMesh::Tri6::nodes_on_side
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
Definition: face_tri6.C:131
libMesh::Tri6::build_side_ptr
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=true) override
Definition: face_tri6.C:201
libMesh::Tri6::n_second_order_adjacent_vertices
virtual unsigned int n_second_order_adjacent_vertices(const unsigned int) const override
Definition: face_tri6.h:169
libMesh::Tri6::volume
virtual Real volume() const override
An optimized method for approximating the area of a TRI6 using quadrature.
Definition: face_tri6.C:380
libMesh::Tri6::second_order_adjacent_vertex
virtual unsigned short int second_order_adjacent_vertex(const unsigned int n, const unsigned int v) const override
Definition: face_tri6.C:437
libMesh::Tri6::is_edge
virtual bool is_edge(const unsigned int i) const override
Definition: face_tri6.C:109
libMesh::Tri6::~Tri6
virtual ~Tri6()=default
libMesh::Elem::key
virtual dof_id_type key() const
Definition: elem.C:410
libMesh::Tri6::is_node_on_edge
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
Definition: face_tri6.h:116
libMesh::Node
A Node is like a Point, but with more information.
Definition: node.h:52
libMesh::Tri6::default_order
virtual Order default_order() const override
Definition: face_tri6.C:155
libMesh::Tri6::n_nodes
virtual unsigned int n_nodes() const override
Definition: face_tri6.h:81
libMesh::Tri6::operator=
Tri6 & operator=(const Tri6 &)=delete
libMesh::TRI6
Definition: enum_elem_type.h:40
libMesh::Tri
The Tri is an element in 2D composed of 3 sides.
Definition: face_tri.h:47
libMesh::Tri6::second_order_child_vertex
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex(const unsigned int n) const override
Definition: face_tri6.C:458
libMesh::Elem
This is the base class from which all geometric element types are derived.
Definition: elem.h:100
libMesh::Tri6::_nodelinks_data
Node * _nodelinks_data[num_nodes]
Data for links to nodes.
Definition: face_tri6.h:220
libMesh::Tri6::num_children
static const int num_children
Definition: face_tri6.h:194
libMesh::Tri6::nodes_per_side
static const int nodes_per_side
Definition: face_tri6.h:195
libMesh::Tri::key
virtual dof_id_type key() const override final
Definition: face_tri.C:72
libMesh::Tri6::side_nodes_map
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:201
libMesh::Tri6::embedding_matrix
virtual float 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:229
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::Tri6::_embedding_matrix
static const float _embedding_matrix[num_children][num_nodes][num_nodes]
Matrix that computes new nodal locations/solution values from current nodes/solution.
Definition: face_tri6.h:238
libMesh::Tri6::has_affine_map
virtual bool has_affine_map() const override
Definition: face_tri6.C:137
libMesh::Tri6::loose_bounding_box
virtual BoundingBox loose_bounding_box() const override
Definition: face_tri6.C:349
libMesh::ElemType
ElemType
Defines an enum for geometric element types.
Definition: enum_elem_type.h:33