24#include "libmesh/libmesh_common.h"
25#include "libmesh/bounding_box.h"
26#include "libmesh/dof_object.h"
27#include "libmesh/id_types.h"
28#include "libmesh/reference_counted_object.h"
29#include "libmesh/node.h"
30#include "libmesh/enum_elem_type.h"
31#include "libmesh/multi_predicates.h"
32#include "libmesh/pointer_to_pointer_iter.h"
33#include "libmesh/int_range.h"
34#include "libmesh/simple_range.h"
35#include "libmesh/variant_filter_iterator.h"
36#include "libmesh/hashword.h"
56#ifdef LIBMESH_ENABLE_PERIODIC
57class PeriodicBoundaries;
58class PointLocatorBase;
60template <
class S
ideType,
class ParentType>
108 Elem ** elemlinkdata,
109 Node ** nodelinkdata);
191#ifdef LIBMESH_ENABLE_DEPRECATED
206 virtual void set_node (
const unsigned int i,
246 = std::numeric_limits<subdomain_id_type>::max();
349#ifdef LIBMESH_ENABLE_PERIODIC
459 unsigned int side_node)
const = 0;
469 unsigned int edge_node)
const = 0;
504 std::set<const Elem *> & neighbor_set)
const;
519 const Elem * start_elem)
const;
534 std::set<const Elem *> & neighbor_set)
const;
605 std::vector<dof_id_type> & conn)
const = 0;
633 virtual unsigned short dim ()
const = 0;
774 unsigned int n)
const
782 unsigned int n)
const;
788 virtual bool is_edge(
const unsigned int i)
const = 0;
795 virtual bool is_face(
const unsigned int i)
const = 0;
807 const unsigned int s)
const = 0;
812 virtual std::vector<unsigned int>
nodes_on_side(
const unsigned int )
const = 0;
817 virtual std::vector<unsigned int>
nodes_on_edge(
const unsigned int )
const = 0;
822 virtual std::vector<unsigned int>
sides_on_edge(
const unsigned int )
const = 0;
834 const unsigned int e)
const = 0;
840 const unsigned int s)
const = 0;
846 virtual unsigned int opposite_side(
const unsigned int s)
const;
854 const unsigned int s)
const;
879 virtual std::unique_ptr<Elem>
side_ptr (
unsigned int i) = 0;
880 std::unique_ptr<const Elem>
side_ptr (
unsigned int i)
const;
896 virtual void side_ptr (std::unique_ptr<Elem> & side,
const unsigned int i) = 0;
897 void side_ptr (std::unique_ptr<const Elem> & side,
const unsigned int i)
const;
922#ifdef LIBMESH_ENABLE_DEPRECATED
927 {
if (proxy) libmesh_error(); libmesh_deprecated();
return this->
build_side_ptr(i); }
929 std::unique_ptr<const Elem>
build_side_ptr (
const unsigned int i,
bool proxy)
const
930 {
if (proxy) libmesh_error(); libmesh_deprecated();
return this->
build_side_ptr(i); }
947 virtual void build_side_ptr (std::unique_ptr<Elem> & side,
const unsigned int i) = 0;
948 void build_side_ptr (std::unique_ptr<const Elem> & side,
const unsigned int i)
const;
980 virtual void build_edge_ptr (std::unique_ptr<Elem> & edge,
const unsigned int i) = 0;
981 void build_edge_ptr (std::unique_ptr<const Elem> & edge,
const unsigned int i)
const;
1047 { libmesh_not_implemented(); }
1110 { libmesh_not_implemented();
return std::make_pair(0.,0.); }
1316 const unsigned int n2)
const;
1339 const unsigned int v)
const;
1356 virtual std::pair<unsigned short int, unsigned short int>
1373 const bool full_ordered=
true);
1405 unsigned int level ()
const;
1412 unsigned int p_level ()
const;
1418 const unsigned int s)
const = 0;
1441#ifdef LIBMESH_ENABLE_AMR
1478 class ConstChildRefIter;
1511 const unsigned int e)
const;
1545 void family_tree (std::vector<const Elem *> & family,
1546 bool reset =
true)
const;
1559 bool reset =
true)
const;
1574 bool reset =
true)
const;
1588 bool reset =
true)
const;
1603 bool reset =
true)
const;
1618 bool reset =
true)
const;
1632 const Elem * neighbor,
1633 bool reset =
true)
const;
1647 const Elem * neighbor,
1648 bool reset =
true)
const;
1664 const Elem * neighbor,
1665 const Elem * subneighbor,
1666 bool reset =
true)
const;
1681 const Elem * neighbor,
1682 const Elem * subneighbor,
1683 bool reset =
true)
const;
1698 const Elem * neighbor,
1699 bool reset =
true)
const;
1714 const Elem * neighbor,
1718 bool reset =
true)
const;
1762 unsigned int current_min)
const;
1770 unsigned int current_min)
const;
1899#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2017#ifdef LIBMESH_ENABLE_AMR
2025 unsigned int n)
const;
2032 const std::vector<std::pair<unsigned char, unsigned char>> &
2034 unsigned int n)
const;
2041 const std::vector<std::pair<dof_id_type, dof_id_type>>
2043 unsigned int n)
const;
2050 const unsigned int child_node_num,
2051 const unsigned int parent_node_num)
const = 0;
2133 void swap3nodes(
unsigned int n1,
unsigned int n2,
unsigned int n3)
2152 void swap4nodes(
unsigned int n1,
unsigned int n2,
unsigned int n3,
2163 unsigned int n3,
unsigned int n4)
2173 template <
typename S
ide
class,
typename Sub
class>
2174 std::unique_ptr<Elem>
2180 template <
typename Sub
class>
2182 const unsigned int i,
2188 template <
typename Sub
class,
typename Map
class>
2190 const unsigned int i,
2196 template <
typename Edge
class,
typename Sub
class>
2197 std::unique_ptr<Elem>
2203 template <
typename Sub
class>
2205 const unsigned int i,
2209#ifdef LIBMESH_ENABLE_AMR
2217 std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> &
2220 static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> c;
2231 std::vector<std::vector<std::vector<signed char>>> &
2234 static std::vector<std::vector<std::vector<signed char>>> c;
2262#ifdef LIBMESH_ENABLE_AMR
2278#ifdef LIBMESH_ENABLE_AMR
2336#ifdef LIBMESH_ENABLE_AMR
2388 const unsigned int ns,
2390 Elem ** elemlinkdata,
2391 Node ** nodelinkdata) :
2392 _nodes(nodelinkdata),
2393 _elemlinks(elemlinkdata),
2395#ifdef LIBMESH_ENABLE_AMR
2396 _rflag(
Elem::DO_NOTHING),
2397 _pflag(
Elem::DO_NOTHING),
2400 _map_type(p ? p->mapping_type() : 0),
2401 _map_data(p ? p->mapping_data() : 0)
2416 libmesh_assert_equal_to(nn, p->
n_nodes());
2417 libmesh_assert_equal_to(ns, p->
n_sides());
2425 for (
unsigned int n=0; n<nn; n++)
2441 for (
unsigned int n=1; n<ns+1; n++)
2452#ifdef LIBMESH_ENABLE_AMR
2464 libmesh_assert_less (i, this->
n_nodes());
2476 libmesh_assert_less (i, this->
n_nodes());
2486 libmesh_assert_less (i, this->
n_nodes());
2518 libmesh_assert_less (i, this->
n_nodes());
2529 libmesh_assert_less (i, this->
n_nodes());
2565#ifdef LIBMESH_ENABLE_DEPRECATED
2569 libmesh_assert_less (i, this->
n_nodes());
2571 libmesh_deprecated();
2583 libmesh_assert_less (i, this->
n_nodes());
2609 return !(*
this == rhs);
2660 if (n && n->parent() ==
this)
2672 if (n && n->parent() ==
this)
2702 return {0, cast_int<unsigned short>(this->
n_nodes())};
2711 return {0, cast_int<unsigned short>(this->
n_edges())};
2720 return {0, cast_int<unsigned short>(this->
n_faces())};
2729 return {0, cast_int<unsigned short>(this->
n_sides())};
2740 Elem * me =
const_cast<Elem *
>(
this);
2749 const unsigned int i)
const
2752 Elem * me =
const_cast<Elem *
>(
this);
2753 std::unique_ptr<Elem> e {
const_cast<Elem *
>(elem.release())};
2755 elem = std::move(e);
2761std::unique_ptr<const Elem>
2766 Elem * me =
const_cast<Elem *
>(
this);
2775 const unsigned int i)
const
2778 Elem * me =
const_cast<Elem *
>(
this);
2779 std::unique_ptr<Elem> e {
const_cast<Elem *
>(elem.release())};
2781 elem = std::move(e);
2786template <
typename S
ide
class,
typename Sub
class>
2788std::unique_ptr<Elem>
2791 libmesh_assert_less (i, this->
n_sides());
2793 std::unique_ptr<Elem> face = std::make_unique<Sideclass>();
2794 for (
auto n : face->node_index_range())
2795 face->set_node(n, this->node_ptr(Subclass::side_nodes_map[i][n]));
2797 face->set_interior_parent(
this);
2798 face->inherit_data_from(*
this);
2805template <
typename Sub
class>
2809 const unsigned int i,
2812 libmesh_assert_less (i, this->
n_sides());
2814 if (!side.get() || side->type() != sidetype)
2816 Subclass & real_me = cast_ref<Subclass&>(*
this);
2817 side = real_me.Subclass::build_side_ptr(i);
2821 side->set_interior_parent(
this);
2822 side->inherit_data_from(*
this);
2823 for (
auto n : side->node_index_range())
2824 side->set_node(n, this->node_ptr(Subclass::side_nodes_map[i][n]));
2830template <
typename Sub
class,
typename Map
class>
2834 const unsigned int i,
2837 libmesh_assert_less (i, this->
n_sides());
2839 if (!side.get() || side->type() != sidetype)
2841 Subclass & real_me = cast_ref<Subclass&>(*
this);
2842 side = real_me.Subclass::side_ptr(i);
2848 for (
auto n : side->node_index_range())
2849 side->set_node(n, this->node_ptr(Mapclass::side_nodes_map[i][n]));
2856std::unique_ptr<const Elem>
2861 Elem * me =
const_cast<Elem *
>(
this);
2870 const unsigned int i)
const
2873 Elem * me =
const_cast<Elem *
>(
this);
2874 std::unique_ptr<Elem> e {
const_cast<Elem *
>(elem.release())};
2876 elem = std::move(e);
2880template <
typename Edge
class,
typename Sub
class>
2882std::unique_ptr<Elem>
2885 libmesh_assert_less (i, this->
n_edges());
2887 std::unique_ptr<Elem> edge = std::make_unique<Edgeclass>();
2889 for (
auto n : edge->node_index_range())
2890 edge->set_node(n, this->node_ptr(Subclass::edge_nodes_map[i][n]));
2892 edge->set_interior_parent(
this);
2893 edge->inherit_data_from(*
this);
2901template <
typename Sub
class>
2905 const unsigned int i,
2908 libmesh_assert_less (i, this->
n_edges());
2910 if (!edge.get() || edge->type() != edgetype)
2912 Subclass & real_me = cast_ref<Subclass&>(*
this);
2913 edge = real_me.Subclass::build_edge_ptr(i);
2917 edge->inherit_data_from(*
this);
2918 for (
auto n : edge->node_index_range())
2919 edge->set_node(n, this->node_ptr(Subclass::edge_nodes_map[i][n]));
2940 const Elem * eparent = e;
2942 while (eparent->
level() > this->level())
2944 eparent = eparent->
parent();
2960#ifdef LIBMESH_ENABLE_AMR
2978#ifdef LIBMESH_ENABLE_AMR
2983 for (
const Elem * my_ancestor = this->
parent();
2984 my_ancestor !=
nullptr;
2985 my_ancestor = my_ancestor->
parent())
2986 if (my_ancestor->active())
2998#ifdef LIBMESH_ENABLE_AMR
3012#ifdef LIBMESH_ENABLE_AMR
3017 if (c.has_children())
3027#ifdef LIBMESH_ENABLE_AMR
3032#ifdef LIBMESH_ENABLE_AMR
3033 const Elem * e = descendant;
3066 libmesh_assert_equal_to(this->
dim(), p ? p->
dim() : this->
dim());
3075 const Elem * tp =
this;
3079 while (tp->
parent() !=
nullptr)
3083 libmesh_assert_equal_to (tp->
level(), 0);
3093#ifdef LIBMESH_ENABLE_AMR
3099 if (this->
parent() ==
nullptr)
3127#ifdef LIBMESH_ENABLE_AMR
3168#ifdef LIBMESH_ENABLE_AMR
3215 for (
unsigned int c=0; c != nc; c++)
3219 libmesh_error_msg(
"ERROR: which_child_am_i() was called with a non-child!");
3237 _rflag = cast_int<unsigned char>(rflag);
3254 libmesh_assert_not_equal_to
3257 _pflag = cast_int<unsigned char>(pflag);
3271 unsigned int max_p_level =
_p_level;
3273 max_p_level = std::max(max_p_level,
3274 c.max_descendant_p_level());
3284 libmesh_assert_not_equal_to
3287 _p_level = cast_int<unsigned char>(p);
3295 _pflag = cast_int<unsigned char>(pflag);
3306 this->
flip(boundary_info);
3323 if (n0 > n1) std::swap (n0, n1);
3335 std::array<dof_id_type, 3> array = {{n0, n1, n2}};
3336 std::sort(array.begin(), array.end());
3348 std::array<dof_id_type, 4> array = {{n0, n1, n2, n3}};
3349 std::sort(array.begin(), array.end());
3362#ifdef LIBMESH_ENABLE_AMR
3433 this->_parent == other.
_parent);
3510 template <
typename PredType,
typename IterType>
3513 const PredType & p ) :
3537#define LIBMESH_ENABLE_TOPOLOGY_CACHES \
3539 std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> & \
3540 _get_bracketing_node_cache() const override \
3542 static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> c; \
3547 std::vector<std::vector<std::vector<signed char>>> & \
3548 _get_parent_indices_cache() const override \
3550 static std::vector<std::vector<std::vector<signed char>>> c; \
void ErrorVector unsigned int
The BoundaryInfo class contains information relevant to boundary conditions including storing faces,...
Defines a Cartesian bounding box by the two corner extremum.
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
processor_id_type processor_id() const
static constexpr dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
static constexpr processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
ChildRefIter(Elem *const *childpp)
ConstChildRefIter(const Elem *const *childpp)
ConstNodeRefIter(const Node *const *nodepp)
NodeRefIter(Node *const *nodepp)
The definition of the protected nested SideIter class.
bool side_on_boundary() const
Elem *& operator*() const
std::unique_ptr< Elem > _side
bool operator==(const SideIter &other) const
unsigned int _side_number
SideIter & operator=(const SideIter &other)
void _update_side_ptr() const
SideIter(const SideIter &other)
SideIter(const unsigned int side_number, Elem *parent)
This is the base class from which all geometric element types are derived.
bool has_ancestor_children() const
virtual unsigned int n_nodes_in_child(unsigned int) const
void swap4nodes(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four node_ptrs, "rotating" them.
bool operator!=(const Elem &rhs) const
void family_tree(std::vector< const Elem * > &family, bool reset=true) const
Fills the vector family with the children of this element, recursively.
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
virtual std::unique_ptr< Elem > disconnected_clone() const
void total_family_tree_by_side(std::vector< const Elem * > &family, unsigned int side, bool reset=true) const
Same as the total_family_tree() member, but only adds elements which are next to side.
std::unique_ptr< const Elem > build_side_ptr(const unsigned int i, bool proxy) const
virtual Node *& set_node(const unsigned int i)
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes(unsigned int c, unsigned int n) const
virtual Point quasicircumcenter() const
const Elem * raw_child_ptr(unsigned int i) const
virtual BoundingBox loose_bounding_box() const
void set_p_refinement_flag(const RefinementState pflag)
Sets the value of the p-refinement flag for the element.
static constexpr Real affine_tol
Default tolerance to use in has_affine_map().
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Returns a range with all neighbors of an element, usable in range-based for loops.
Elem(Elem &&)=delete
Elems are responsible for allocating and deleting space for storing pointers to their children during...
virtual void refine(MeshRefinement &mesh_refinement)
Refine the element.
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const =0
virtual std::vector< std::vector< std::vector< std::vector< std::pair< unsigned char, unsigned char > > > > > & _get_bracketing_node_cache() const
Elem subclasses which don't do their own bracketing node calculations will need to supply a static ca...
void contract()
Contract an active element, i.e.
RefinementState refinement_flag() const
static const unsigned int type_to_n_nodes_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the number of nodes in the element...
virtual unsigned int center_node_on_side(const unsigned short side) const
unsigned char _rflag
h refinement flag.
void total_family_tree_by_subneighbor(std::vector< const Elem * > &family, const Elem *neighbor, const Elem *subneighbor, bool reset=true) const
Same as the family_tree_by_subneighbor() member, but also adds any subactive descendants.
virtual std::pair< Real, Real > qual_bounds(const ElemQuality) const
bool is_ancestor_of(const Elem *descendant) const
unsigned char mapping_data() const
bool has_neighbor(const Elem *elem) const
void print_info(std::ostream &os=libMesh::out) const
Prints relevant information about the element.
virtual unsigned int n_vertices() const =0
Elem * child_neighbor(Elem *elem)
void hack_p_level_and_refinement_flag(const unsigned int p, RefinementState pflag)
Sets the value of the p-refinement level for the element without altering the p-level of its ancestor...
const Point & point(const unsigned int i) const
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const =0
const Node & node_ref(const unsigned int i) const
virtual Point true_centroid() const
virtual Point origin() const
Elem & operator=(const Elem &)=delete
static const unsigned int type_to_n_edges_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the number of edges on the element...
virtual bool is_child_on_edge(const unsigned int c, const unsigned int e) const
void set_child(unsigned int c, Elem *elem)
Sets the pointer to the child for this element.
bool has_children() const
virtual std::unique_ptr< Elem > side_ptr(unsigned int i)=0
static std::unique_ptr< Elem > build_with_id(const ElemType type, dof_id_type id)
Calls the build() method above with a nullptr parent, and additionally sets the newly-created Elem's ...
bool topologically_equal(const Elem &rhs) const
virtual unsigned int n_nodes() const =0
void active_family_tree_by_side(std::vector< const Elem * > &family, unsigned int side, bool reset=true) const
Same as the active_family_tree() member, but only adds elements which are next to side.
const Elem * parent() const
void family_tree_by_subneighbor(std::vector< const Elem * > &family, const Elem *neighbor, const Elem *subneighbor, bool reset=true) const
Same as the family_tree() member, but only adds elements which are next to subneighbor.
Elem(const Elem &)=delete
void swap2nodes(unsigned int n1, unsigned int n2)
Swaps two node_ptrs.
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex(const unsigned int n) const
void make_links_to_me_local(unsigned int n, unsigned int neighbor_side)
Resets the neighbor_side pointers of our nth neighbor (and its descendants, if appropriate) to point ...
bool operator==(const Elem &rhs) const
void set_neighbor(const unsigned int i, Elem *n)
Assigns n as the neighbor.
static ElemType complete_order_equivalent_type(const ElemType et)
virtual bool on_reference_element(const Point &p, const Real eps=TOLERANCE) const =0
void hack_p_level(const unsigned int p)
Sets the value of the p-refinement level for the element without altering the p-level of its ancestor...
void active_family_tree_by_topological_neighbor(std::vector< const Elem * > &family, const Elem *neighbor, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb, bool reset=true) const
Same as the active_family_tree_by_neighbor() member, but the neighbor here may be a topological (e....
std::unique_ptr< Elem > simple_build_side_ptr(const unsigned int i)
An implementation for simple (all sides equal) elements.
virtual unsigned int n_permutations() const =0
Returns the number of independent permutations of element nodes - e.g.
const Elem * child_ptr(unsigned int i) const
virtual const std::vector< std::pair< dof_id_type, dof_id_type > > bracketing_nodes(unsigned int c, unsigned int n) const
bool positive_edge_orientation(const unsigned int i) const
virtual void side_ptr(std::unique_ptr< Elem > &side, const unsigned int i)=0
Resets the loose element side, which may currently point to a different side than i or even a differe...
void family_tree_by_neighbor(std::vector< const Elem * > &family, const Elem *neighbor, bool reset=true) const
Same as the family_tree() member, but only adds elements which are next to neighbor.
void swap3neighbors(unsigned int n1, unsigned int n2, unsigned int n3)
Swaps three neighbor_ptrs, "rotating" them.
bool has_topological_neighbor(const Elem *elem, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
unsigned int which_neighbor_am_i(const Elem *e) const
This function tells you which neighbor e is.
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const =0
SideIter _first_side()
Side iterator helper functions.
virtual dof_id_type low_order_key(const unsigned int s) const =0
void total_family_tree_by_neighbor(std::vector< const Elem * > &family, const Elem *neighbor, bool reset=true) const
Same as the family_tree_by_neighbor() member, but also adds any subactive descendants.
bool point_test(const Point &p, Real box_tol, Real map_tol) const
Shared private implementation used by the contains_point() and close_to_point() routines.
virtual bool is_flipped() const =0
unsigned int n_neighbors() const
virtual bool is_mid_infinite_edge_node(const unsigned int) const
SimpleRange< NodeRefIter > node_ref_range()
Returns a range with all nodes of an element, usable in range-based for loops.
virtual unsigned int opposite_node(const unsigned int n, const unsigned int s) const
Node ** _nodes
Pointers to the nodes we are connected to.
virtual bool is_vertex_on_parent(unsigned int c, unsigned int n) const
RefinementState
Enumeration of possible element refinement states.
@ INVALID_REFINEMENTSTATE
virtual Order default_order() const =0
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
virtual void build_side_ptr(std::unique_ptr< Elem > &side, const unsigned int i)=0
Resets the loose element side, which may currently point to a different side than i or even a differe...
void swap2neighbors(unsigned int n1, unsigned int n2)
Swaps two neighbor_ptrs.
virtual std::vector< unsigned int > nodes_on_side(const unsigned int) const =0
virtual Order supported_nodal_order() const
void set_interior_parent(Elem *p)
Sets the pointer to the element's interior_parent.
static ElemType first_order_equivalent_type(const ElemType et)
void remove_links_to_me()
Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's approp...
bool positive_face_orientation(const unsigned int i) const
virtual unsigned int n_second_order_adjacent_vertices(const unsigned int n) const
void total_family_tree(std::vector< const Elem * > &family, bool reset=true) const
Same as the family_tree() member, but also adds any subactive descendants.
side_iterator boundary_sides_end()
virtual bool is_face(const unsigned int i) const =0
const Elem *const * ConstNeighborPtrIter
void find_point_neighbors(const Point &p, std::set< const Elem * > &neighbor_set) const
This function finds all active elements (including this one) which are in the same manifold as this e...
side_iterator boundary_sides_begin()
Iterator accessor functions.
void nullify_neighbors()
Replaces this element with nullptr for all of its neighbors.
virtual bool has_invertible_map(Real tol=TOLERANCE *TOLERANCE) const
virtual ~Elem()=default
Destructor.
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element's children.
unsigned int min_new_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
unsigned int local_node(const dof_id_type i) const
static constexpr subdomain_id_type invalid_subdomain_id
A static integral constant representing an invalid subdomain id.
void find_interior_neighbors(std::set< const Elem * > &neighbor_set) const
This function finds all active elements (not including this one) in the parent manifold of this eleme...
void swap2boundarysides(unsigned short s1, unsigned short s2, BoundaryInfo *boundary_info) const
Swaps two sides in boundary_info, if it is non-null.
unsigned char _map_data
Mapping function data; currently used when needed to store the RATIONAL_BERNSTEIN nodal weight data i...
virtual Real embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
virtual bool is_singular_node(unsigned int) const
bool contains_vertex_of(const Elem *e, bool mesh_connection=false) const
unsigned int which_child_am_i(const Elem *e) const
virtual Real hmin() const
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
static constexpr bool infinite()
bool is_semilocal(const processor_id_type my_pid) const
void libmesh_assert_valid_neighbors() const
Checks for consistent neighbor links on this element.
subdomain_id_type _sbd_id
The subdomain to which this element belongs.
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int) const =0
void orient(BoundaryInfo *boundary_info)
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=TOLERANCE) const
virtual unsigned short dim() const =0
virtual Real quality(const ElemQuality q) const
void find_edge_neighbors(const Point &p1, const Point &p2, std::set< const Elem * > &neighbor_set) const
This function finds all active elements in the same manifold as this element which touch the current ...
virtual void flip(BoundaryInfo *boundary_info)=0
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
virtual bool is_vertex_on_child(unsigned int, unsigned int n) const
virtual void permute(unsigned int perm_num)=0
Permutes the element (by swapping node and neighbor pointers) according to the specified index.
void libmesh_assert_valid_node_pointers() const
Checks for a valid id and pointers to nodes with valid ids on this element.
virtual unsigned int local_edge_node(unsigned int edge, unsigned int edge_node) const =0
Similar to Elem::local_side_node(), but instead of a side id, takes an edge id and a node id on that ...
subdomain_id_type subdomain_id() const
virtual unsigned int n_sub_elem() const =0
static const unsigned int type_to_dim_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the geometric dimension of the ele...
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
static const unsigned int type_to_n_sides_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the number of sides on the element...
void make_links_to_me_remote()
Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's approp...
virtual bool is_edge(const unsigned int i) const =0
virtual dof_id_type key() const
Elem ** _elemlinks
Pointers to this element's parent and neighbors, and for lower-dimensional elements' interior_parent.
Predicates::multi_predicate Predicate
Useful iterator typedefs.
unsigned int level() const
virtual Real hmax() const
unsigned char _map_type
Mapping function type; currently either 0 (LAGRANGE) or 1 (RATIONAL_BERNSTEIN).
ElemMappingType mapping_type() const
virtual bool is_remote() const
virtual bool runtime_topology() const
static const unsigned int max_n_nodes
The maximum number of nodes any element can contain.
void set_parent(Elem *p)
Sets the pointer to the element's parent.
unsigned int min_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
std::string get_info() const
Prints relevant information about the element to a string.
virtual Point side_vertex_average_normal(const unsigned int s) const
virtual std::vector< std::vector< std::vector< signed char > > > & _get_parent_indices_cache() const
Elem subclasses which don't do their own child-to-parent node calculations will need to supply a stat...
virtual unsigned int n_faces() const =0
virtual Order default_side_order() const
static dof_id_type compute_key(dof_id_type n0)
bool contains_edge_of(const Elem *e) const
virtual unsigned int opposite_side(const unsigned int s) const
const Node * node_ptr(const unsigned int i) const
void add_child(Elem *elem)
Adds a child pointer to the array of children of this element.
void replace_child(Elem *elem, unsigned int c)
Replaces the child pointer at the specified index in the child array.
unsigned char _p_level
p refinement level - the difference between the polynomial degree on this element and the minimum pol...
virtual unsigned int as_parent_node(unsigned int c, unsigned int n) const
virtual dof_id_type key(const unsigned int s) const =0
static const Order type_to_default_order_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the default approximation order of...
void active_family_tree(std::vector< const Elem * > &active_family, bool reset=true) const
Same as the family_tree() member, but only adds the active children.
virtual std::vector< unsigned int > sides_on_edge(const unsigned int) const =0
const Elem * reference_elem() const
bool is_internal(const unsigned int i) const
void swap3nodes(unsigned int n1, unsigned int n2, unsigned int n3)
Swaps three node_ptrs, "rotating" them.
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i)=0
const Node *const * get_nodes() const
IntRange< unsigned short > edge_index_range() const
Real length(const unsigned int n1, const unsigned int n2) const
unsigned int which_side_am_i(const Elem *e) const
This function tells you which side the boundary element e is.
void coarsen()
Coarsen the element.
virtual Real volume() const
virtual bool is_vertex(const unsigned int i) const =0
std::unique_ptr< Elem > simple_build_edge_ptr(const unsigned int i)
An implementation for simple (all edges equal) elements.
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy)
virtual unsigned int n_children() const =0
virtual unsigned int embedding_matrix_version() const
unsigned int get_node_index(const Node *node_ptr) const
void swap2boundaryedges(unsigned short e1, unsigned short e2, BoundaryInfo *boundary_info) const
Swaps two edges in boundary_info, if it is non-null.
unsigned int max_descendant_p_level() const
void write_connectivity(std::ostream &out, const IOPackage iop) const
Writes the element connectivity for various IO packages to the passed ostream "out".
virtual void build_edge_ptr(std::unique_ptr< Elem > &edge, const unsigned int i)=0
Resets the loose element edge, which may currently point to a different edge than i or even a differe...
virtual ElemType type() const =0
IntRange< unsigned short > node_index_range() const
virtual Point master_point(const unsigned int i) const =0
const Elem * interior_parent() const
unsigned char _pflag
p refinement flag.
void simple_side_ptr(std::unique_ptr< Elem > &side, const unsigned int i, ElemType sidetype)
An implementation for simple (all sides equal) elements.
Elem *const * NeighborPtrIter
Nested "classes" for use iterating over all neighbors of an element.
void set_mapping_type(const ElemMappingType type)
Sets the value of the mapping type for the element.
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const =0
virtual bool is_linear() const
bool relative_edge_face_order(const unsigned int e, const unsigned int s) const
void set_refinement_flag(const RefinementState rflag)
Sets the value of the refinement flag for the element.
virtual unsigned int n_edges() const =0
virtual ElemType side_type(const unsigned int s) const =0
virtual unsigned int n_sides() const =0
dof_id_type node_id(const unsigned int i) const
unsigned int p_level() const
IntRange< unsigned short > face_index_range() const
void active_family_tree_by_neighbor(std::vector< const Elem * > &family, const Elem *neighbor, bool reset=true) const
Same as the active_family_tree() member, but only adds elements which are next to neighbor.
const Elem * topological_neighbor(const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
void swap4neighbors(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four neighbor_ptrs, "rotating" them.
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
virtual bool has_affine_map() const
void set_mapping_data(const unsigned char data)
Sets the value of the mapping data for the element.
RefinementState p_refinement_flag() const
virtual unsigned int local_singular_node(const Point &, const Real=TOLERANCE *TOLERANCE) const
virtual unsigned short int second_order_adjacent_vertex(const unsigned int n, const unsigned int v) const
virtual bool close_to_point(const Point &p, Real tol) const
virtual bool is_edge_on_side(const unsigned int e, const unsigned int s) const =0
void set_p_level(const unsigned int p)
Sets the value of the p-refinement level for the element.
const Elem * neighbor_ptr(unsigned int i) const
virtual bool infinite() const =0
void family_tree_by_side(std::vector< const Elem * > &family, unsigned int side, bool reset=true) const
Same as the family_tree() member, but only adds elements which are next to side.
Point vertex_average() const
IntRange< unsigned short > side_index_range() const
void inherit_data_from(const Elem &src)
A helper function for copying generic element data (mapping, subdomain, processor) from an element to...
virtual std::vector< unsigned int > edges_adjacent_to_node(const unsigned int) const =0
const Elem * top_parent() const
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i)=0
The IntRange templated class is intended to make it easy to loop over integers which are indices of a...
This is the MeshBase class.
Implements (adaptive) mesh refinement algorithms for a MeshBase.
A Node is like a Point, but with more information.
We're using a class instead of a typedef to allow forward declarations and future flexibility.
This is the base class for point locators.
A Point defines a location in LIBMESH_DIM dimensional Real space.
The PointerToPointerIter templated class is intended to wrap pointer-to-pointer iterators in an inter...
This class implements reference counting.
The SimpleRange templated class is intended to make it easy to construct ranges from pairs of iterato...
Original Authors: Corwin Joy * Michael Gradman cjoy@houston.rr.com * Michael.Gradman@caminus....
uint32_t hashword2(const uint32_t &first, const uint32_t &second, uint32_t initval=0)
This is a hard-coded version of hashword for hashing exactly 2 numbers.
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval=0)
The hashword function takes an array of uint32_t's of length 'length' and computes a single key from ...
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.
ElemMappingType
Enumeration of possible element master->physical mapping types.
std::ostream & operator<<(std::ostream &os, const OrderWrapper &order)
Overload stream operators.
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
ElemQuality
Defines an enum for element quality metrics.
static constexpr Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
uint8_t processor_id_type
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
The definition of the struct used for iterating over sides.
side_iterator(const IterType &d, const IterType &e, const PredType &p)