libMesh
Loading...
Searching...
No Matches
cell_tet4.h
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 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_CELL_TET4_H
21#define LIBMESH_CELL_TET4_H
22
23// Local includes
24#include "libmesh/cell_tet.h"
25
26namespace libMesh
27{
28
59class Tet4 final : public Tet
60{
61public:
62
66 explicit
67 Tet4 (Elem * p=nullptr) :
69 {}
70
71 Tet4 (Tet4 &&) = delete;
72 Tet4 (const Tet4 &) = delete;
73 Tet4 & operator= (const Tet4 &) = delete;
74 Tet4 & operator= (Tet4 &&) = delete;
75 virtual ~Tet4() = default;
76
80 virtual ElemType type () const override { return TET4; }
81
85 virtual unsigned int n_nodes() const override { return num_nodes; }
86
90 virtual unsigned int n_sub_elem() const override { return 1; }
91
95 virtual bool is_vertex(const unsigned int i) const override;
96
100 virtual bool is_edge(const unsigned int i) const override;
101
105 virtual bool is_face(const unsigned int i) const override;
106
111 virtual bool is_node_on_side(const unsigned int n,
112 const unsigned int s) const override;
113
114 virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;
115
116 virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;
117
122 virtual bool is_node_on_edge(const unsigned int n,
123 const unsigned int e) const override;
124
129 virtual bool is_child_on_side(const unsigned int c,
130 const unsigned int s) const override;
131
136 virtual bool has_affine_map () const override { return true; }
137
141 virtual bool has_invertible_map(Real tol) const override;
142
147 virtual bool is_linear () const override { return true; }
148
152 virtual Order default_order() const override;
153
158 virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int i) override;
159
163 virtual void build_side_ptr (std::unique_ptr<Elem> & elem,
164 const unsigned int i) override;
165
166 // Avoid hiding deprecated version with different signature
168
173 virtual std::unique_ptr<Elem> build_edge_ptr (const unsigned int i) override;
174
178 virtual void build_edge_ptr (std::unique_ptr<Elem> & edge, const unsigned int i) override;
179
180 virtual void connectivity(const unsigned int sc,
181 const IOPackage iop,
182 std::vector<dof_id_type> & conn) const override;
183
187 static const int num_nodes = 4;
188 static const int nodes_per_side = 3;
189 static const int nodes_per_edge = 2;
190
195 static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side] =
196 {
197 {0, 2, 1}, // Side 0
198 {0, 1, 3}, // Side 1
199 {1, 2, 3}, // Side 2
200 {2, 0, 3} // Side 3
201 };
202
207 static constexpr unsigned int edge_nodes_map[num_edges][nodes_per_edge] =
208 {
209 {0, 1}, // Edge 0
210 {1, 2}, // Edge 1
211 {0, 2}, // Edge 2
212 {0, 3}, // Edge 3
213 {1, 3}, // Edge 4
214 {2, 3} // Edge 5
215 };
216
221 virtual Point true_centroid () const override;
222
227 virtual Real volume () const override;
228
238 std::pair<Real, Real> min_and_max_angle() const;
239
243 using Tet::key;
244
250 virtual dof_id_type key () const override;
251
256 virtual bool contains_point (const Point & p, Real tol) const override;
257
258 virtual void permute(unsigned int perm_num) override final;
259
260 virtual void flip(BoundaryInfo *) override final;
261
262 ElemType side_type (const unsigned int s) const override final;
263
264 virtual Point side_vertex_average_normal(const unsigned int s) const override final;
265
266protected:
267
272
273
274
275#ifdef LIBMESH_ENABLE_AMR
276
280 virtual Real embedding_matrix (const unsigned int i,
281 const unsigned int j,
282 const unsigned int k) const override;
283
289
291
292#endif
293
294};
295
296} // namespace libMesh
297
298
299#endif // LIBMESH_CELL_TET4_H
The BoundaryInfo class contains information relevant to boundary conditions including storing faces,...
This is the base class from which all geometric element types are derived.
Definition elem.h:96
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i)=0
A Node is like a Point, but with more information.
Definition node.h:55
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition point.h:41
The Tet4 is an element in 3D composed of 4 nodes.
Definition cell_tet4.h:60
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i) override
Builds a TRI3 built coincident with face i.
Definition cell_tet4.C:138
virtual ~Tet4()=default
Node * _nodelinks_data[num_nodes]
Data for links to nodes.
Definition cell_tet4.h:271
static const int nodes_per_side
Definition cell_tet4.h:188
virtual Order default_order() const override
Definition cell_tet4.C:133
virtual bool is_vertex(const unsigned int i) const override
Definition cell_tet4.C:41
static constexpr unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
Definition cell_tet4.h:207
virtual dof_id_type key() const override
Definition cell_tet4.C:345
virtual bool is_face(const unsigned int i) const override
Definition cell_tet4.C:52
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
Definition cell_tet4.h:195
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i) override
Builds a EDGE2 built coincident with face i.
Definition cell_tet4.C:153
virtual void permute(unsigned int perm_num) override final
Permutes the element (by swapping node and neighbor pointers) according to the specified index.
Definition cell_tet4.C:561
virtual Point side_vertex_average_normal(const unsigned int s) const override final
Definition cell_tet4.C:615
Tet4(Tet4 &&)=delete
LIBMESH_ENABLE_TOPOLOGY_CACHES
Definition cell_tet4.h:290
Tet4(Elem *p=nullptr)
Constructor.
Definition cell_tet4.h:67
virtual bool has_invertible_map(Real tol) const override
Definition cell_tet4.C:103
static const int num_nodes
Geometric constants for Tet4.
Definition cell_tet4.h:187
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const override
Definition cell_tet4.C:72
Tet4 & operator=(const Tet4 &)=delete
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
Definition cell_tet4.C:57
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int e) const override
Definition cell_tet4.C:127
virtual Point true_centroid() const override
The centroid of a 4-node tetrahedron is simply given by the average of its vertex positions.
Definition cell_tet4.C:292
static const Real _embedding_matrix[num_children][num_nodes][num_nodes]
Matrix that computes new nodal locations/solution values from current nodes/solution.
Definition cell_tet4.h:288
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 cell_tet4.C:392
virtual unsigned int n_sub_elem() const override
Definition cell_tet4.h:90
virtual bool is_linear() const override
Definition cell_tet4.h:147
virtual bool has_affine_map() const override
Definition cell_tet4.h:136
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
Definition cell_tet4.C:120
ElemType side_type(const unsigned int s) const override final
Definition cell_tet4.C:607
virtual Real volume() const override
An optimized method for computing the area of a 4-node tetrahedron.
Definition cell_tet4.C:299
virtual ElemType type() const override
Definition cell_tet4.h:80
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
Definition cell_tet4.C:167
virtual void flip(BoundaryInfo *) override final
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
Definition cell_tet4.C:595
virtual bool contains_point(const Point &p, Real tol) const override
Uses simple geometric tests to determine if the point p is inside the tetrahedron.
Definition cell_tet4.C:355
Tet4(const Tet4 &)=delete
static const int nodes_per_edge
Definition cell_tet4.h:189
std::pair< Real, Real > min_and_max_angle() const
Definition cell_tet4.C:320
virtual bool is_edge(const unsigned int i) const override
Definition cell_tet4.C:47
virtual unsigned int n_nodes() const override
Definition cell_tet4.h:85
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
Definition cell_tet4.C:110
The Tet is an element in 3D composed of 4 sides.
Definition cell_tet.h:37
static const int num_edges
Definition cell_tet.h:75
static const int num_sides
Geometric constants for all Tets.
Definition cell_tet.h:74
virtual dof_id_type key() const
Don't hide Elem::key() defined in the base class.
Definition elem.C:678
static const int num_children
Definition cell_tet.h:76
The libMesh namespace provides an interface to certain functionality in the library.
IOPackage
libMesh interfaces with several different software packages for the purposes of creating,...
ElemType
Defines an enum for geometric element types.
uint8_t dof_id_type
Definition id_types.h:67
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real