19#include "libmesh/edge_edge2.h"
20#include "libmesh/face_tri3.h"
21#include "libmesh/enum_io_package.h"
22#include "libmesh/enum_order.h"
34#ifdef LIBMESH_ENABLE_AMR
95 const unsigned int s)
const
97 libmesh_assert_less (s,
n_sides());
106 libmesh_assert_less(s,
n_sides());
123 return this->
volume() > tol;
128 return this->simple_build_side_ptr<Edge2, Tri3>(i);
134 const unsigned int i)
136 this->simple_build_side_ptr<Tri3>(side, i,
EDGE2);
143 std::vector<dof_id_type> & conn)
const
170 libmesh_error_msg(
"Unsupported IO package " << iop);
208 theta0=std::acos(( v10*v20)/len_10/len_20),
209 theta1=std::acos((-v10*v21)/len_10/len_21),
213 libmesh_assert_greater (theta0, 0.);
214 libmesh_assert_greater (theta1, 0.);
215 libmesh_assert_greater (theta2, 0.);
217 return std::make_pair(std::min(theta0, std::min(theta1,theta2)),
218 std::max(theta0, std::max(theta1,theta2)));
232 Real dot00 = v0 * v0;
233 Real dot01 = v0 * v1;
234 Real dot02 = v0 * v2;
235 Real dot11 = v1 * v1;
236 Real dot12 = v1 * v2;
239 if (std::abs(
triple_product(v2, v0, v1)) / std::max(dot00, dot11) > tol)
243 Real invDenom = 1 / (dot00 * dot11 - dot01 * dot01);
244 Real u = (dot11 * dot02 - dot01 * dot12) * invDenom;
245 Real v = (dot00 * dot12 - dot01 * dot02) * invDenom;
248 return (u > -tol) && (v > -tol) && (u + v < 1 + tol);
260 libmesh_assert_less (perm_num, 3);
262 for (
unsigned int i = 0; i != perm_num; ++i)
284 libmesh_assert_less (s, 3);
292 libmesh_assert_less (s, 3);
295 const unsigned int another_side = s > 1 ? 0 : s + 1;
298 const Point pointing_up = side_t.
cross(other_side_t);
The BoundaryInfo class contains information relevant to boundary conditions including storing faces,...
Defines a Cartesian bounding box by the two corner extremum.
virtual BoundingBox loose_bounding_box() const
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.
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.
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 Point true_centroid() const override
The centroid of a 3-node triangle is simply given by the average of its vertex positions.
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int e) const override
static const int nodes_per_side
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
std::pair< Real, Real > min_and_max_angle() const
virtual Order default_order() 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 is_edge(const unsigned int i) const override
virtual void connectivity(const unsigned int sf, const IOPackage iop, std::vector< dof_id_type > &conn) const override
virtual Real volume() const override
An optimized method for computing the area of a 3-node triangle.
virtual bool is_vertex(const unsigned int i) const override
virtual BoundingBox loose_bounding_box() const override
Builds a bounding box out of the nodal positions.
virtual bool contains_point(const Point &p, Real tol) const override
Specialization for tri3 elements.
static const Real _embedding_matrix[num_children][num_nodes][num_nodes]
Matrix that computes new nodal locations/solution values from current nodes/solution.
virtual unsigned int n_sub_elem() const override
virtual bool has_invertible_map(Real tol) const override
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
virtual Point side_vertex_average_normal(const unsigned int s) const override final
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
static const int num_nodes
Geometric constants for Tri3.
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i) override
virtual bool is_face(const unsigned int i) const override
ElemType side_type(const unsigned int s) const override final
virtual void permute(unsigned int perm_num) override final
Permutes the element (by swapping node and neighbor pointers) according to the specified index.
static const int num_children
virtual unsigned int n_sides() const override final
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.
LIBMESH_DEVICE_INLINE T cross_norm(const TypeVector< T > &b, const TypeVector< T > &c)
Calls cross_norm_sq() and takes the square root of the result.
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.
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