19 #include "libmesh/edge_edge2.h" 20 #include "libmesh/face_quad4.h" 21 #include "libmesh/enum_io_package.h" 22 #include "libmesh/enum_order.h" 43 #ifdef LIBMESH_ENABLE_AMR 110 const unsigned int s)
const 112 libmesh_assert_less (s,
n_sides());
118 std::vector<unsigned>
121 libmesh_assert_less(s,
n_sides());
125 std::vector<unsigned>
179 std::array<Real, 4> vertex_vals;
180 unsigned int ctr = 0;
181 for (
unsigned int i=0; i<2; ++i)
182 for (
unsigned int j=0; j<2; ++j)
183 vertex_vals[ctr++] = n * (v1 +
Real(i)*v2 +
Real(j)*v3);
191 auto result = std::minmax_element(vertex_vals.begin(), vertex_vals.end());
192 Real min_vertex = *(result.first);
193 Real max_vertex = *(result.second);
200 return ((max_vertex > 0 && min_vertex > 0) || (max_vertex < 0 && min_vertex < 0));
214 return this->simple_build_side_ptr<Edge2, Quad4>(i);
220 const unsigned int i)
222 this->simple_build_side_ptr<Quad4>(side, i,
EDGE2);
229 std::vector<dof_id_type> & conn)
const 258 libmesh_error_msg(
"Unsupported IO package " << iop);
279 a1 = x0 - x1 + x2 - x3,
280 b1 = -x0 + x1 + x2 - x3,
282 b2 = -x0 - x1 + x2 + x3;
288 const Real q[2] = {-std::sqrt(
Real(3))/3, std::sqrt(
Real(3))/3.};
293 for (
const auto & xi : q)
294 for (
const auto & eta : q)
298 A0 += jxw * (1-xi) * (1-eta);
299 A1 += jxw * (1+xi) * (1-eta);
300 A2 += jxw * (1+xi) * (1+eta);
301 A3 += jxw * (1-xi) * (1+eta);
306 x0(1)*
A0 + x1(1)*
A1 + x2(1)*
A2 + x3(1)*
A3,
325 a1 = x0/4 - x1/4 + x2/4 - x3/4,
326 b1 = -x0/4 + x1/4 + x2/4 - x3/4,
328 b2 = -x0/4 - x1/4 + x2/4 + x3/4;
332 return 4. * b1.
cross(b2).norm();
338 const Real q[2] = {-std::sqrt(
Real(3))/3, std::sqrt(
Real(3))/3.};
341 for (
unsigned int i=0; i<2; ++i)
342 for (
unsigned int j=0; j<2; ++j)
358 libmesh_assert_less (perm_num, 4);
360 for (
unsigned int i = 0; i != perm_num; ++i)
382 libmesh_assert_less (s, 4);
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
ElemType
Defines an enum for geometric element types.
void swap2boundaryedges(unsigned short e1, unsigned short e2, BoundaryInfo *boundary_info) const
Swaps two edges in boundary_info, if it is non-null.
Order
defines an enum for polynomial orders.
auto norm() const -> decltype(std::norm(T()))
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
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, reading, and writing mesh files.
virtual bool has_invertible_map(Real tol) const override
virtual BoundingBox loose_bounding_box() const
virtual bool has_affine_map() const override
void swap2boundarysides(unsigned short s1, unsigned short s2, BoundaryInfo *boundary_info) const
Swaps two sides in boundary_info, if it is non-null.
virtual bool is_edge(const unsigned int i) const override
The libMesh namespace provides an interface to certain functionality in the library.
ElemType side_type(const unsigned int s) const override final
virtual bool is_vertex(const unsigned int i) const override
void swap4nodes(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four node_ptrs, "rotating" them.
virtual Order default_order() const override
ElemMappingType mapping_type() const
void swap2nodes(unsigned int n1, unsigned int n2)
Swaps two node_ptrs.
virtual BoundingBox loose_bounding_box() const override
Builds a bounding box out of the nodal positions.
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
The BoundaryInfo class contains information relevant to boundary conditions including storing faces...
TypeVector< typename CompareTypes< T, T2 >::supertype > cross(const TypeVector< T2 > &v) const
static constexpr Real affine_tol
Default tolerance to use in has_affine_map().
static const int nodes_per_side
virtual unsigned int n_sides() const override final
void swap2neighbors(unsigned int n1, unsigned int n2)
Swaps two neighbor_ptrs.
static const int num_nodes
Geometric constants for Quad4.
Defines a Cartesian bounding box by the two corner extremum.
static const int num_sides
Geometric constants for Quad4.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real volume() const override
An optimized method for computing the area of a 4-node quad with straight sides, but not necessarily ...
void swap4neighbors(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four neighbor_ptrs, "rotating" them.
virtual Point true_centroid() const override
An optimized method for computing the centroid of a 4-node quad with straight sides.
virtual void flip(BoundaryInfo *) override final
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
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 Real _embedding_matrix[num_children][num_nodes][num_nodes]
Matrix that computes new nodal locations/solution values from current nodes/solution.
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i) override
virtual bool is_face(const unsigned int i) const override
A Point defines a location in LIBMESH_DIM dimensional Real space.
dof_id_type node_id(const unsigned int i) const
const Point & point(const unsigned int i) const
bool relative_fuzzy_equals(const TypeVector< T > &rhs, Real tol=TOLERANCE) const
static const int num_children
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int e) const override
virtual unsigned int n_sub_elem() const override
virtual void connectivity(const unsigned int sf, const IOPackage iop, std::vector< dof_id_type > &conn) const override