libMesh
face_tri3.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_TRI3_H
21 #define LIBMESH_FACE_TRI3_H
22 
23 
24 // Local includes
25 #include "libmesh/libmesh_common.h"
26 #include "libmesh/face_tri.h"
27 
28 // C++ includes
29 #include <cstddef>
30 
31 namespace libMesh
32 {
33 
54 class Tri3 : public Tri
55 {
56 public:
57 
61  explicit
63  Tri(Tri3::n_nodes(), p, _nodelinks_data) {}
64 
68  virtual ElemType type () const libmesh_override { return TRI3; }
69 
73  virtual unsigned int n_sub_elem() const libmesh_override { return 1; }
74 
78  virtual bool is_vertex(const unsigned int i) const libmesh_override;
79 
83  virtual bool is_edge(const unsigned int i) const libmesh_override;
84 
88  virtual bool is_face(const unsigned int i) const libmesh_override;
89 
94  virtual bool is_node_on_side(const unsigned int n,
95  const unsigned int s) const libmesh_override;
96 
101  virtual bool is_node_on_edge(const unsigned int n,
102  const unsigned int e) const libmesh_override
103  { return this->is_node_on_side(n,e); }
104 
109  virtual bool has_affine_map () const libmesh_override { return true; }
110 
115  virtual bool is_linear () const libmesh_override { return true; }
116 
120  virtual Order default_order() const libmesh_override { return FIRST; }
121 
122  virtual UniquePtr<Elem> build_side_ptr (const unsigned int i,
123  bool proxy) libmesh_override;
124 
125  virtual void connectivity(const unsigned int sf,
126  const IOPackage iop,
127  std::vector<dof_id_type> & conn) const libmesh_override;
128 
133  static const unsigned int side_nodes_map[3][2];
134 
135 
139  virtual Real volume () const libmesh_override;
140 
146  std::pair<Real, Real> min_and_max_angle() const;
147 
152  virtual bool contains_point (const Point & p, Real tol) const libmesh_override;
153 
154 protected:
155 
160 
161 
162 
163 #ifdef LIBMESH_ENABLE_AMR
164 
168  virtual float embedding_matrix (const unsigned int i,
169  const unsigned int j,
170  const unsigned int k) const libmesh_override
171  { return _embedding_matrix[i][j][k]; }
172 
177  static const float _embedding_matrix[4][3][3];
178 
180 
181 #endif // LIBMESH_ENABLE_AMR
182 
183 };
184 
185 } // namespace libMesh
186 
187 #endif // LIBMESH_FACE_TRI3_H
Node * _nodelinks_data[3]
Data for links to nodes.
Definition: face_tri3.h:159
The Tri3 is an element in 2D composed of 3 nodes.
Definition: face_tri3.h:54
virtual bool has_affine_map() const libmesh_override
Definition: face_tri3.h:109
A Node is like a Point, but with more information.
Definition: node.h:52
virtual Real volume() const libmesh_override
An optimized method for computing the area of a 3-node triangle.
Definition: face_tri3.C:172
Tri3(Elem *p=libmesh_nullptr)
Constructor.
Definition: face_tri3.h:62
virtual bool is_edge(const unsigned int i) const libmesh_override
Definition: face_tri3.C:89
ElemType
Defines an enum for geometric element types.
virtual unsigned int n_sub_elem() const libmesh_override
Definition: face_tri3.h:73
This is the base class from which all geometric element types are derived.
Definition: elem.h:89
The Tri is an element in 2D composed of 3 sides.
Definition: face_tri.h:47
const class libmesh_nullptr_t libmesh_nullptr
std::pair< Real, Real > min_and_max_angle() const
Definition: face_tri3.C:181
The libMesh namespace provides an interface to certain functionality in the library.
static const unsigned int side_nodes_map[3][2]
This maps the node of the side to element node numbers.
Definition: face_tri3.h:133
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
virtual bool is_linear() const libmesh_override
Definition: face_tri3.h:115
virtual bool contains_point(const Point &p, Real tol) const libmesh_override
Specialization for tri3 elements.
Definition: face_tri3.C:206
virtual float embedding_matrix(const unsigned int i, const unsigned int j, const unsigned int k) const libmesh_override
Matrix used to create the elements children.
Definition: face_tri3.h:168
LIBMESH_ENABLE_TOPOLOGY_CACHES
Definition: face_tri3.h:179
virtual UniquePtr< Elem > build_side_ptr(const unsigned int i, bool proxy) libmesh_override
Definition: face_tri3.C:109
static const float _embedding_matrix[4][3][3]
Matrix that computes new nodal locations/solution values from current nodes/solution.
Definition: face_tri3.h:177
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Order default_order() const libmesh_override
Definition: face_tri3.h:120
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const libmesh_override
Definition: face_tri3.h:101
virtual void connectivity(const unsigned int sf, const IOPackage iop, std::vector< dof_id_type > &conn) const libmesh_override
Definition: face_tri3.C:134
Order
defines an enum for polynomial orders.
Definition: enum_order.h:32
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const libmesh_override
Definition: face_tri3.C:99
virtual ElemType type() const libmesh_override
Definition: face_tri3.h:68
virtual unsigned int n_nodes() const libmesh_override
Definition: face_tri.h:81
virtual bool is_vertex(const unsigned int i) const libmesh_override
Definition: face_tri3.C:84
IOPackage
libMesh interfaces with several different software packages for the purposes of creating, reading, and writing mesh files.
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
virtual bool is_face(const unsigned int i) const libmesh_override
Definition: face_tri3.C:94