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 const unsigned int side_nodes_map[num_sides][nodes_per_side];
196
201 static const unsigned int edge_nodes_map[num_edges][nodes_per_edge];
202
207 virtual Point true_centroid () const override;
208
213 virtual Real volume () const override;
214
224 std::pair<Real, Real> min_and_max_angle() const;
225
229 using Tet::key;
230
236 virtual dof_id_type key () const override;
237
242 virtual bool contains_point (const Point & p, Real tol) const override;
243
244 virtual void permute(unsigned int perm_num) override final;
245
246 virtual void flip(BoundaryInfo *) override final;
247
248 ElemType side_type (const unsigned int s) const override final;
249
250 virtual Point side_vertex_average_normal(const unsigned int s) const override final;
251
252protected:
253
258
259
260
261#ifdef LIBMESH_ENABLE_AMR
262
266 virtual Real embedding_matrix (const unsigned int i,
267 const unsigned int j,
268 const unsigned int k) const override;
269
275
277
278#endif
279
280};
281
282} // namespace libMesh
283
284
285#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:40
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:156
virtual ~Tet4()=default
Node * _nodelinks_data[num_nodes]
Data for links to nodes.
Definition cell_tet4.h:257
static const int nodes_per_side
Definition cell_tet4.h:188
virtual Order default_order() const override
Definition cell_tet4.C:151
static const 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 bool is_vertex(const unsigned int i) const override
Definition cell_tet4.C:59
virtual dof_id_type key() const override
Definition cell_tet4.C:363
virtual bool is_face(const unsigned int i) const override
Definition cell_tet4.C:70
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:171
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:579
virtual Point side_vertex_average_normal(const unsigned int s) const override final
Definition cell_tet4.C:633
Tet4(Tet4 &&)=delete
LIBMESH_ENABLE_TOPOLOGY_CACHES
Definition cell_tet4.h:276
Tet4(Elem *p=nullptr)
Constructor.
Definition cell_tet4.h:67
virtual bool has_invertible_map(Real tol) const override
Definition cell_tet4.C:121
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:90
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:75
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int e) const override
Definition cell_tet4.C:145
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:310
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:274
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:410
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:138
ElemType side_type(const unsigned int s) const override final
Definition cell_tet4.C:625
virtual Real volume() const override
An optimized method for computing the area of a 4-node tetrahedron.
Definition cell_tet4.C:317
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:185
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:613
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:373
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:338
virtual bool is_edge(const unsigned int i) const override
Definition cell_tet4.C:65
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:128
static const 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:201
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:738
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