20#include "libmesh/cell_tet4.h"
21#include "libmesh/edge_edge2.h"
22#include "libmesh/face_tri3.h"
23#include "libmesh/tensor_value.h"
24#include "libmesh/enum_io_package.h"
25#include "libmesh/enum_order.h"
58 const unsigned int e)
const
60 libmesh_assert_less (e,
n_edges());
69#ifdef LIBMESH_ENABLE_AMR
73 const unsigned int s)
const
78 const unsigned int nodes_opposite[4][3] =
93 const unsigned int )
const
95 libmesh_not_implemented();
105 return this->
volume() > tol;
111 const unsigned int s)
const
113 libmesh_assert_less (s,
n_sides());
122 libmesh_assert_less(s,
n_sides());
129 libmesh_assert_less(e,
n_edges());
140 return this->simple_build_side_ptr<Tri3, Tet4>(i);
146 const unsigned int i)
148 this->simple_build_side_ptr<Tet4>(side, i,
TRI3);
155 return this->simple_build_edge_ptr<Edge2,Tet4>(i);
162 this->simple_build_edge_ptr<Tet4>(edge, i,
EDGE2);
169 std::vector<dof_id_type> & conn)
const
203 libmesh_error_msg(
"Unsupported IO package " << iop);
209#ifdef LIBMESH_ENABLE_AMR
216 {1.0, 0.0, 0.0, 0.0},
217 {0.5, 0.5, 0.0, 0.0},
218 {0.5, 0.0, 0.5, 0.0},
225 {0.5, 0.5, 0.0, 0.0},
226 {0.0, 1.0, 0.0, 0.0},
227 {0.0, 0.5, 0.5, 0.0},
234 {0.5, 0.0, 0.5, 0.0},
235 {0.0, 0.5, 0.5, 0.0},
236 {0.0, 0.0, 1.0, 0.0},
243 {0.5, 0.0, 0.0, 0.5},
244 {0.0, 0.5, 0.0, 0.5},
245 {0.0, 0.0, 0.5, 0.5},
252 {0.5, 0.5, 0.0, 0.0},
253 {0.0, 0.5, 0.0, 0.5},
254 {0.5, 0.0, 0.5, 0.0},
261 {0.5, 0.5, 0.0, 0.0},
262 {0.0, 0.5, 0.5, 0.0},
263 {0.5, 0.0, 0.5, 0.0},
270 {0.5, 0.0, 0.5, 0.0},
271 {0.0, 0.5, 0.5, 0.0},
272 {0.0, 0.0, 0.5, 0.5},
279 {0.5, 0.0, 0.5, 0.0},
280 {0.0, 0.5, 0.0, 0.5},
281 {0.0, 0.0, 0.5, 0.5},
330 Real dihedral_angles[6];
333 for (
unsigned int k=0,i=0; i<4; ++i)
334 for (
unsigned int j=i+1; j<4; ++j,k+=1)
335 dihedral_angles[k] = std::acos(n[i]*n[j] / n[i].norm() / n[j].
norm());
338 return std::make_pair(*std::min_element(dihedral_angles, dihedral_angles+6),
339 *std::max_element(dihedral_angles, dihedral_angles+6));
369 col1(1), col2(1), col3(1),
370 col1(2), col2(2), col3(2)).solve(p -
point(0), r);
386 r(0) + r(1) + r(2) < 1.0 + tol;
391#ifdef LIBMESH_ENABLE_AMR
393 const unsigned int j,
394 const unsigned int k)
const
563 libmesh_assert_less (perm_num, 12);
565 const unsigned int side = perm_num % 4;
566 const unsigned int rotate = perm_num / 4;
568 for (
unsigned int i = 0; i != rotate; ++i)
609 libmesh_assert_less (s, 4);
617 libmesh_assert_less (s, 4);
623 return pointing_out.
unit();
The BoundaryInfo class contains information relevant to boundary conditions including storing faces,...
A class representing a solver's failure to converge, to be thrown by "libmesh_convergence_failure();"...
const Point & point(const unsigned int i) const
void swap2nodes(unsigned int n1, unsigned int n2)
Swaps two node_ptrs.
void swap3neighbors(unsigned int n1, unsigned int n2, unsigned int n3)
Swaps three neighbor_ptrs, "rotating" them.
Node ** _nodes
Pointers to the nodes we are connected to.
void swap2neighbors(unsigned int n1, unsigned int n2)
Swaps two neighbor_ptrs.
void swap2boundarysides(unsigned short s1, unsigned short s2, BoundaryInfo *boundary_info) const
Swaps two sides in boundary_info, if it is non-null.
static dof_id_type compute_key(dof_id_type n0)
void swap3nodes(unsigned int n1, unsigned int n2, unsigned int n3)
Swaps three node_ptrs, "rotating" them.
void swap2boundaryedges(unsigned short e1, unsigned short e2, BoundaryInfo *boundary_info) const
Swaps two edges in boundary_info, if it is non-null.
dof_id_type node_id(const unsigned int i) const
Point vertex_average() const
A Point defines a location in LIBMESH_DIM dimensional Real space.
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i) override
Builds a TRI3 built coincident with face i.
static const int nodes_per_side
virtual Order default_order() const override
virtual bool is_vertex(const unsigned int i) const override
static constexpr unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
virtual dof_id_type key() const override
virtual bool is_face(const unsigned int i) const override
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i) override
Builds a EDGE2 built coincident with face i.
virtual void permute(unsigned int perm_num) override final
Permutes the element (by swapping node and neighbor pointers) according to the specified index.
virtual Point side_vertex_average_normal(const unsigned int s) const override final
virtual bool has_invertible_map(Real tol) const override
static const int num_nodes
Geometric constants for Tet4.
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const override
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int e) const override
virtual Point true_centroid() const override
The centroid of a 4-node tetrahedron is simply given by the average of its vertex positions.
static const Real _embedding_matrix[num_children][num_nodes][num_nodes]
Matrix that computes new nodal locations/solution values from current nodes/solution.
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.
virtual unsigned int n_sub_elem() const override
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
ElemType side_type(const unsigned int s) const override final
virtual Real volume() const override
An optimized method for computing the area of a 4-node tetrahedron.
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
virtual void flip(BoundaryInfo *) override final
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
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.
static const int nodes_per_edge
std::pair< Real, Real > min_and_max_angle() const
virtual bool is_edge(const unsigned int i) const override
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
virtual unsigned int n_edges() const override final
void choose_diagonal() const
Derived classes use this function to select an initial diagonal during refinement.
bool is_child_on_side_helper(const unsigned int c, const unsigned int s, const unsigned int checked_nodes[][3]) const
Called by descendant classes with appropriate data to determine if child c is on side s.
virtual unsigned int n_sides() const override final
Diagonal _diagonal_selection
The currently-selected diagonal used during refinement.
static const int num_children
TypeVector< typename CompareTypes< T, T2 >::supertype > cross(const TypeVector< T2 > &v) const
LIBMESH_DEVICE_INLINE TypeVector< T > unit() const
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,...
LIBMESH_DEVICE_INLINE T triple_product(const TypeVector< T > &a, const TypeVector< T > &b, const TypeVector< T > &c)
ElemType
Defines an enum for geometric element types.
TensorValue< Real > RealTensorValue
Useful typedefs to allow transparent switching between Real and Complex data types.
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real