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"
76 const unsigned int e)
const
78 libmesh_assert_less (e,
n_edges());
87#ifdef LIBMESH_ENABLE_AMR
91 const unsigned int s)
const
96 const unsigned int nodes_opposite[4][3] =
111 const unsigned int )
const
113 libmesh_not_implemented();
123 return this->
volume() > tol;
129 const unsigned int s)
const
131 libmesh_assert_less (s,
n_sides());
140 libmesh_assert_less(s,
n_sides());
147 libmesh_assert_less(e,
n_edges());
158 return this->simple_build_side_ptr<Tri3, Tet4>(i);
164 const unsigned int i)
166 this->simple_build_side_ptr<Tet4>(side, i,
TRI3);
173 return this->simple_build_edge_ptr<Edge2,Tet4>(i);
180 this->simple_build_edge_ptr<Tet4>(edge, i,
EDGE2);
187 std::vector<dof_id_type> & conn)
const
221 libmesh_error_msg(
"Unsupported IO package " << iop);
227#ifdef LIBMESH_ENABLE_AMR
234 {1.0, 0.0, 0.0, 0.0},
235 {0.5, 0.5, 0.0, 0.0},
236 {0.5, 0.0, 0.5, 0.0},
243 {0.5, 0.5, 0.0, 0.0},
244 {0.0, 1.0, 0.0, 0.0},
245 {0.0, 0.5, 0.5, 0.0},
252 {0.5, 0.0, 0.5, 0.0},
253 {0.0, 0.5, 0.5, 0.0},
254 {0.0, 0.0, 1.0, 0.0},
261 {0.5, 0.0, 0.0, 0.5},
262 {0.0, 0.5, 0.0, 0.5},
263 {0.0, 0.0, 0.5, 0.5},
270 {0.5, 0.5, 0.0, 0.0},
271 {0.0, 0.5, 0.0, 0.5},
272 {0.5, 0.0, 0.5, 0.0},
279 {0.5, 0.5, 0.0, 0.0},
280 {0.0, 0.5, 0.5, 0.0},
281 {0.5, 0.0, 0.5, 0.0},
288 {0.5, 0.0, 0.5, 0.0},
289 {0.0, 0.5, 0.5, 0.0},
290 {0.0, 0.0, 0.5, 0.5},
297 {0.5, 0.0, 0.5, 0.0},
298 {0.0, 0.5, 0.0, 0.5},
299 {0.0, 0.0, 0.5, 0.5},
348 Real dihedral_angles[6];
351 for (
unsigned int k=0,i=0; i<4; ++i)
352 for (
unsigned int j=i+1; j<4; ++j,k+=1)
353 dihedral_angles[k] = std::acos(n[i]*n[j] / n[i].norm() / n[j].
norm());
356 return std::make_pair(*std::min_element(dihedral_angles, dihedral_angles+6),
357 *std::max_element(dihedral_angles, dihedral_angles+6));
387 col1(1), col2(1), col3(1),
388 col1(2), col2(2), col3(2)).solve(p -
point(0), r);
404 r(0) + r(1) + r(2) < 1.0 + tol;
409#ifdef LIBMESH_ENABLE_AMR
411 const unsigned int j,
412 const unsigned int k)
const
581 libmesh_assert_less (perm_num, 12);
583 const unsigned int side = perm_num % 4;
584 const unsigned int rotate = perm_num / 4;
586 for (
unsigned int i = 0; i != rotate; ++i)
627 libmesh_assert_less (s, 4);
635 libmesh_assert_less (s, 4);
641 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
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
virtual bool is_vertex(const unsigned int i) const override
virtual dof_id_type key() const override
virtual bool is_face(const unsigned int i) const override
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
static const unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
static const int num_edges
virtual unsigned int n_edges() const override final
void choose_diagonal() const
Derived classes use this function to select an initial diagonal during refinement.
static const int num_sides
Geometric constants for all Tets.
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
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,...
ElemType
Defines an enum for geometric element types.
TensorValue< Real > RealTensorValue
Useful typedefs to allow transparent switching between Real and Complex data types.
T triple_product(const TypeVector< T > &a, const TypeVector< T > &b, const TypeVector< T > &c)
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