20 #ifndef LIBMESH_ELEM_H 21 #define LIBMESH_ELEM_H 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 57 class PeriodicBoundaries;
58 class PointLocatorBase;
60 template <
class S
ideType,
class ParentType>
108 Elem ** elemlinkdata,
109 Node ** nodelinkdata);
130 virtual ~Elem() =
default;
135 const Point &
point (
const unsigned int i)
const;
191 #ifdef LIBMESH_ENABLE_DEPRECATED 201 #endif // LIBMESH_ENABLE_DEPRECATED 206 virtual void set_node (
const unsigned int i,
348 #ifdef LIBMESH_ENABLE_PERIODIC 458 unsigned int side_node)
const = 0;
468 unsigned int edge_node)
const = 0;
470 #ifdef LIBMESH_ENABLE_DEPRECATED 475 unsigned int side_node)
const;
476 #endif // LIBMESH_ENABLE_DEPRECATED 511 std::set<const Elem *> & neighbor_set)
const;
526 const Elem * start_elem)
const;
541 std::set<const Elem *> & neighbor_set)
const;
612 std::vector<dof_id_type> & conn)
const = 0;
640 virtual unsigned short dim ()
const = 0;
655 virtual unsigned int n_nodes ()
const = 0;
692 virtual unsigned int n_sides ()
const = 0;
727 virtual unsigned int n_edges ()
const = 0;
749 virtual unsigned int n_faces ()
const = 0;
766 virtual bool is_vertex(
const unsigned int i)
const = 0;
775 unsigned int n)
const 783 unsigned int n)
const;
789 virtual bool is_edge(
const unsigned int i)
const = 0;
796 virtual bool is_face(
const unsigned int i)
const = 0;
808 const unsigned int s)
const = 0;
813 virtual std::vector<unsigned int>
nodes_on_side(
const unsigned int )
const = 0;
818 virtual std::vector<unsigned int>
nodes_on_edge(
const unsigned int )
const = 0;
823 virtual std::vector<unsigned int>
sides_on_edge(
const unsigned int )
const = 0;
835 const unsigned int e)
const = 0;
841 const unsigned int s)
const = 0;
847 virtual unsigned int opposite_side(
const unsigned int s)
const;
855 const unsigned int s)
const;
880 virtual std::unique_ptr<Elem>
side_ptr (
unsigned int i) = 0;
881 std::unique_ptr<const Elem>
side_ptr (
unsigned int i)
const;
897 virtual void side_ptr (std::unique_ptr<Elem> & side,
const unsigned int i) = 0;
898 void side_ptr (std::unique_ptr<const Elem> & side,
const unsigned int i)
const;
920 virtual std::unique_ptr<Elem>
build_side_ptr (
const unsigned int i) = 0;
921 std::unique_ptr<const Elem>
build_side_ptr (
const unsigned int i)
const;
923 #ifdef LIBMESH_ENABLE_DEPRECATED 928 {
if (proxy) libmesh_error(); libmesh_deprecated();
return this->
build_side_ptr(i); }
930 std::unique_ptr<const Elem>
build_side_ptr (
const unsigned int i,
bool proxy)
const 931 {
if (proxy) libmesh_error(); libmesh_deprecated();
return this->
build_side_ptr(i); }
948 virtual void build_side_ptr (std::unique_ptr<Elem> & side,
const unsigned int i) = 0;
949 void build_side_ptr (std::unique_ptr<const Elem> & side,
const unsigned int i)
const;
964 virtual std::unique_ptr<Elem>
build_edge_ptr (
const unsigned int i) = 0;
965 std::unique_ptr<const Elem>
build_edge_ptr (
const unsigned int i)
const;
981 virtual void build_edge_ptr (std::unique_ptr<Elem> & edge,
const unsigned int i) = 0;
982 void build_edge_ptr (std::unique_ptr<const Elem> & edge,
const unsigned int i)
const;
1014 #ifdef LIBMESH_ENABLE_DEPRECATED 1025 #endif // LIBMESH_ENABLE_DEPRECATED 1061 { libmesh_not_implemented(); }
1121 { libmesh_not_implemented();
return std::make_pair(0.,0.); }
1322 const unsigned int n2)
const;
1345 const unsigned int v)
const;
1362 virtual std::pair<unsigned short int, unsigned short int>
1379 const bool full_ordered=
true);
1411 unsigned int level ()
const;
1418 unsigned int p_level ()
const;
1424 const unsigned int s)
const = 0;
1447 #ifdef LIBMESH_ENABLE_AMR 1484 class ConstChildRefIter;
1517 const unsigned int e)
const;
1551 void family_tree (std::vector<const Elem *> & family,
1552 bool reset =
true)
const;
1565 bool reset =
true)
const;
1580 bool reset =
true)
const;
1594 bool reset =
true)
const;
1609 bool reset =
true)
const;
1623 const Elem * neighbor,
1624 bool reset =
true)
const;
1638 const Elem * neighbor,
1639 bool reset =
true)
const;
1655 const Elem * neighbor,
1656 const Elem * subneighbor,
1657 bool reset =
true)
const;
1672 const Elem * neighbor,
1673 const Elem * subneighbor,
1674 bool reset =
true)
const;
1689 const Elem * neighbor,
1690 bool reset =
true)
const;
1705 const Elem * neighbor,
1709 bool reset =
true)
const;
1753 unsigned int current_min)
const;
1761 unsigned int current_min)
const;
1890 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 1896 virtual bool infinite ()
const = 0;
1973 virtual void permute(
unsigned int perm_num) = 0;
2008 #ifdef LIBMESH_ENABLE_AMR 2016 unsigned int n)
const;
2023 const std::vector<std::pair<unsigned char, unsigned char>> &
2025 unsigned int n)
const;
2032 const std::vector<std::pair<dof_id_type, dof_id_type>>
2034 unsigned int n)
const;
2041 const unsigned int child_node_num,
2042 const unsigned int parent_node_num)
const = 0;
2053 #endif // LIBMESH_ENABLE_AMR 2124 void swap3nodes(
unsigned int n1,
unsigned int n2,
unsigned int n3)
2143 void swap4nodes(
unsigned int n1,
unsigned int n2,
unsigned int n3,
2154 unsigned int n3,
unsigned int n4)
2164 template <
typename S
ide
class,
typename Sub
class>
2165 std::unique_ptr<Elem>
2171 template <
typename Sub
class>
2173 const unsigned int i,
2179 template <
typename Sub
class,
typename Map
class>
2181 const unsigned int i,
2187 template <
typename Edge
class,
typename Sub
class>
2188 std::unique_ptr<Elem>
2194 template <
typename Sub
class>
2196 const unsigned int i,
2200 #ifdef LIBMESH_ENABLE_AMR 2208 std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> &
2211 static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> c;
2222 std::vector<std::vector<std::vector<signed char>>> &
2225 static std::vector<std::vector<std::vector<signed char>>> c;
2230 #endif // LIBMESH_ENABLE_AMR 2253 #ifdef LIBMESH_ENABLE_AMR 2269 #ifdef LIBMESH_ENABLE_AMR 2327 #ifdef LIBMESH_ENABLE_AMR 2359 #endif // LIBMESH_ENABLE_AMR 2379 const unsigned int ns,
2381 Elem ** elemlinkdata,
2382 Node ** nodelinkdata) :
2383 _nodes(nodelinkdata),
2384 _elemlinks(elemlinkdata),
2386 #ifdef LIBMESH_ENABLE_AMR
2387 _rflag(
Elem::DO_NOTHING),
2388 _pflag(
Elem::DO_NOTHING),
2391 _map_type(p ? p->mapping_type() : 0),
2392 _map_data(p ? p->mapping_data() : 0)
2407 libmesh_assert_equal_to(nn, p->
n_nodes());
2408 libmesh_assert_equal_to(ns, p->
n_sides());
2416 for (
unsigned int n=0; n<nn; n++)
2432 for (
unsigned int n=1; n<ns+1; n++)
2443 #ifdef LIBMESH_ENABLE_AMR 2455 libmesh_assert_less (i, this->
n_nodes());
2467 libmesh_assert_less (i, this->
n_nodes());
2477 libmesh_assert_less (i, this->
n_nodes());
2509 libmesh_assert_less (i, this->
n_nodes());
2520 libmesh_assert_less (i, this->
n_nodes());
2556 #ifdef LIBMESH_ENABLE_DEPRECATED 2560 libmesh_assert_less (i, this->
n_nodes());
2562 libmesh_deprecated();
2566 #endif // LIBMESH_ENABLE_DEPRECATED 2574 libmesh_assert_less (i, this->
n_nodes());
2643 if (n && n->parent() ==
this)
2655 if (n && n->parent() ==
this)
2685 return {0, cast_int<unsigned short>(this->
n_nodes())};
2694 return {0, cast_int<unsigned short>(this->
n_edges())};
2703 return {0, cast_int<unsigned short>(this->
n_faces())};
2712 return {0, cast_int<unsigned short>(this->
n_sides())};
2723 Elem * me =
const_cast<Elem *
>(
this);
2732 const unsigned int i)
const 2735 Elem * me =
const_cast<Elem *
>(
this);
2736 std::unique_ptr<Elem> e {
const_cast<Elem *
>(elem.release())};
2738 elem = std::move(e);
2744 std::unique_ptr<const Elem>
2749 Elem * me =
const_cast<Elem *
>(
this);
2758 const unsigned int i)
const 2761 Elem * me =
const_cast<Elem *
>(
this);
2762 std::unique_ptr<Elem> e {
const_cast<Elem *
>(elem.release())};
2764 elem = std::move(e);
2769 template <
typename S
ide
class,
typename Sub
class>
2771 std::unique_ptr<Elem>
2774 libmesh_assert_less (i, this->
n_sides());
2776 std::unique_ptr<Elem> face = std::make_unique<Sideclass>();
2777 for (
auto n : face->node_index_range())
2778 face->set_node(n, this->node_ptr(Subclass::side_nodes_map[i][n]));
2780 face->set_interior_parent(
this);
2781 face->inherit_data_from(*
this);
2788 template <
typename Sub
class>
2792 const unsigned int i,
2795 libmesh_assert_less (i, this->
n_sides());
2797 if (!side.get() || side->type() != sidetype)
2799 Subclass & real_me = cast_ref<Subclass&>(*this);
2800 side = real_me.Subclass::build_side_ptr(i);
2804 side->set_interior_parent(
this);
2805 side->inherit_data_from(*
this);
2806 for (
auto n : side->node_index_range())
2807 side->set_node(n, this->node_ptr(Subclass::side_nodes_map[i][n]));
2813 template <
typename Sub
class,
typename Map
class>
2817 const unsigned int i,
2820 libmesh_assert_less (i, this->
n_sides());
2822 if (!side.get() || side->type() != sidetype)
2824 Subclass & real_me = cast_ref<Subclass&>(*this);
2825 side = real_me.Subclass::side_ptr(i);
2831 for (
auto n : side->node_index_range())
2832 side->set_node(n, this->node_ptr(Mapclass::side_nodes_map[i][n]));
2839 std::unique_ptr<const Elem>
2844 Elem * me =
const_cast<Elem *
>(
this);
2853 const unsigned int i)
const 2856 Elem * me =
const_cast<Elem *
>(
this);
2857 std::unique_ptr<Elem> e {
const_cast<Elem *
>(elem.release())};
2859 elem = std::move(e);
2863 template <
typename Edge
class,
typename Sub
class>
2865 std::unique_ptr<Elem>
2868 libmesh_assert_less (i, this->
n_edges());
2870 std::unique_ptr<Elem> edge = std::make_unique<Edgeclass>();
2872 for (
auto n : edge->node_index_range())
2873 edge->set_node(n, this->node_ptr(Subclass::edge_nodes_map[i][n]));
2875 edge->set_interior_parent(
this);
2876 edge->inherit_data_from(*
this);
2884 template <
typename Sub
class>
2888 const unsigned int i,
2891 libmesh_assert_less (i, this->
n_edges());
2893 if (!edge.get() || edge->type() != edgetype)
2895 Subclass & real_me = cast_ref<Subclass&>(*this);
2896 edge = real_me.Subclass::build_edge_ptr(i);
2900 edge->inherit_data_from(*
this);
2901 for (
auto n : edge->node_index_range())
2902 edge->set_node(n, this->node_ptr(Subclass::edge_nodes_map[i][n]));
2923 const Elem * eparent = e;
2927 eparent = eparent->
parent();
2943 #ifdef LIBMESH_ENABLE_AMR 2961 #ifdef LIBMESH_ENABLE_AMR 2966 for (
const Elem * my_ancestor = this->
parent();
2967 my_ancestor !=
nullptr;
2968 my_ancestor = my_ancestor->
parent())
2969 if (my_ancestor->active())
2981 #ifdef LIBMESH_ENABLE_AMR 2995 #ifdef LIBMESH_ENABLE_AMR 3000 if (c.has_children())
3010 #ifdef LIBMESH_ENABLE_AMR
3015 #ifdef LIBMESH_ENABLE_AMR 3016 const Elem * e = descendant;
3049 libmesh_assert_equal_to(this->
dim(), p ? p->
dim() : this->
dim());
3058 const Elem * tp =
this;
3062 while (tp->
parent() !=
nullptr)
3066 libmesh_assert_equal_to (tp->
level(), 0);
3076 #ifdef LIBMESH_ENABLE_AMR 3082 if (this->
parent() ==
nullptr)
3110 #ifdef LIBMESH_ENABLE_AMR 3151 #ifdef LIBMESH_ENABLE_AMR 3198 for (
unsigned int c=0; c != nc; c++)
3202 libmesh_error_msg(
"ERROR: which_child_am_i() was called with a non-child!");
3220 _rflag = cast_int<unsigned char>(rflag);
3237 libmesh_assert_not_equal_to
3240 _pflag = cast_int<unsigned char>(pflag);
3254 unsigned int max_p_level =
_p_level;
3256 max_p_level = std::max(max_p_level,
3257 c.max_descendant_p_level());
3267 libmesh_assert_not_equal_to
3270 _p_level = cast_int<unsigned char>(p);
3278 _pflag = cast_int<unsigned char>(pflag);
3282 #endif // ifdef LIBMESH_ENABLE_AMR 3289 this->
flip(boundary_info);
3306 if (n0 > n1) std::swap (n0, n1);
3318 std::array<dof_id_type, 3> array = {{n0, n1, n2}};
3319 std::sort(array.begin(), array.end());
3331 std::array<dof_id_type, 4> array = {{n0, n1, n2, n3}};
3332 std::sort(array.begin(), array.end());
3345 #ifdef LIBMESH_ENABLE_AMR 3416 this->_parent == other.
_parent);
3493 template <
typename PredType,
typename IterType>
3496 const PredType & p ) :
3520 #define LIBMESH_ENABLE_TOPOLOGY_CACHES \ 3522 std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> & \ 3523 _get_bracketing_node_cache() const override \ 3525 static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> c; \ 3530 std::vector<std::vector<std::vector<signed char>>> & \ 3531 _get_parent_indices_cache() const override \ 3533 static std::vector<std::vector<std::vector<signed char>>> c; \ 3542 #endif // LIBMESH_ELEM_H virtual Point true_centroid() const
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...
bool has_neighbor(const Elem *elem) const
void set_p_level(const unsigned int p)
Sets the value of the p-refinement level for the element.
unsigned char mapping_data() const
virtual bool is_vertex_on_parent(unsigned int c, unsigned int n) const
std::unique_ptr< Elem > simple_build_side_ptr(const unsigned int i)
An implementation for simple (all sides equal) elements.
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...
RefinementState refinement_flag() const
ElemType
Defines an enum for geometric element types.
The SimpleRange templated class is intended to make it easy to construct ranges from pairs of iterato...
void swap2boundaryedges(unsigned short e1, unsigned short e2, BoundaryInfo *boundary_info) const
Swaps two edges in boundary_info, if it is non-null.
virtual Point quasicircumcenter() const
unsigned char _map_type
Mapping function type; currently either 0 (LAGRANGE) or 1 (RATIONAL_BERNSTEIN).
unsigned char _map_data
Mapping function data; currently used when needed to store the RATIONAL_BERNSTEIN nodal weight data i...
void write_connectivity(std::ostream &out, const IOPackage iop) const
Writes the element connectivity for various IO packages to the passed ostream "out".
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy)
const Elem * parent() const
virtual const std::vector< std::pair< dof_id_type, dof_id_type > > bracketing_nodes(unsigned int c, unsigned int n) const
Order
defines an enum for polynomial orders.
void print_info(std::ostream &os=libMesh::out) const
Prints relevant information about the element.
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...
virtual Node *& set_node(const unsigned int i)
A Node is like a Point, but with more information.
bool is_ancestor_of(const Elem *descendant) const
Node ** _nodes
Pointers to the nodes we are connected to.
Elem * child_neighbor(Elem *elem)
virtual std::vector< unsigned int > sides_on_edge(const unsigned int) const =0
static ElemType complete_order_equivalent_type(const ElemType et)
Predicates::multi_predicate Predicate
Useful iterator typedefs.
virtual Order default_side_order() const
virtual Point origin() const
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
void set_parent(Elem *p)
Sets the pointer to the element's parent.
unsigned int get_node_index(const Node *node_ptr) const
std::string get_info() const
Prints relevant information about the element to a string.
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...
Original Authors: Corwin Joy * Michael Gradman
[email protected] *
[email protected] Caminus, Suite 1150, Two Allen Center, 1200 Smith Street, Houston, TX 77002 This class is an extension of variant_bidirectional_iterator to a filter_iterator similar to boost's.
const Elem * interior_parent() const
const Elem * topological_neighbor(const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
void orient(BoundaryInfo *boundary_info)
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
void set_mapping_type(const ElemMappingType type)
Sets the value of the mapping type for the element.
virtual bool is_face(const unsigned int i) const =0
bool is_semilocal(const processor_id_type my_pid) const
unsigned char _pflag
p refinement flag.
virtual ElemType side_type(const unsigned int s) const =0
The IntRange templated class is intended to make it easy to loop over integers which are indices of a...
unsigned char _p_level
p refinement level - the difference between the polynomial degree on this element and the minimum pol...
IntRange< unsigned short > side_index_range() const
void contract()
Contract an active element, i.e.
void libmesh_assert_valid_node_pointers() const
Checks for a valid id and pointers to nodes with valid ids on this element.
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i)=0
virtual dof_id_type key() const
static constexpr Real TOLERANCE
const Elem * top_parent() const
We're using a class instead of a typedef to allow forward declarations and future flexibility...
virtual bool runtime_topology() const
virtual bool is_edge_on_side(const unsigned int e, const unsigned int s) const =0
virtual unsigned int embedding_matrix_version() const
unsigned int which_side_am_i(const Elem *e) const
This function tells you which side the boundary element e is.
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const =0
SideIter(const unsigned int side_number, Elem *parent)
virtual ~Elem()=default
Destructor.
RefinementState p_refinement_flag() const
IOPackage
libMesh interfaces with several different software packages for the purposes of creating, reading, and writing mesh files.
virtual dof_id_type low_order_key(const unsigned int s) const =0
virtual bool has_affine_map() const
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...
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...
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.
bool operator==(const SideIter &other) const
void family_tree(std::vector< const Elem *> &family, bool reset=true) const
Fills the vector family with the children of this element, recursively.
This is the base class from which all geometric element types are derived.
void add_child(Elem *elem)
Adds a child pointer to the array of children of this element.
virtual BoundingBox loose_bounding_box() const
SideIter & operator=(const SideIter &other)
virtual bool on_reference_element(const Point &p, const Real eps=TOLERANCE) const =0
unsigned int min_new_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
RefinementState
Enumeration of possible element refinement states.
void set_refinement_flag(const RefinementState rflag)
Sets the value of the refinement flag for the element.
std::ostream & operator<<(std::ostream &os, const OrderWrapper &order)
Overload stream operators.
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
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.
void swap2boundarysides(unsigned short s1, unsigned short s2, BoundaryInfo *boundary_info) const
Swaps two sides in boundary_info, if it is non-null.
virtual unsigned int n_children() const =0
ChildRefIter(Elem *const *childpp)
unsigned int _side_number
unsigned int p_level() 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 ...
side_iterator boundary_sides_end()
void make_links_to_me_remote()
Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's approp...
The libMesh namespace provides an interface to certain functionality in the library.
virtual Real hmax() const
virtual bool is_linear() const
unsigned int min_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
virtual bool is_flipped() const =0
void set_interior_parent(Elem *p)
Sets the pointer to the element's interior_parent.
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...
bool contains_vertex_of(const Elem *e, bool mesh_connection=false) const
uint8_t processor_id_type
This is the MeshBase class.
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
bool has_topological_neighbor(const Elem *elem, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
IntRange< unsigned short > edge_index_range() const
void swap3neighbors(unsigned int n1, unsigned int n2, unsigned int n3)
Swaps three neighbor_ptrs, "rotating" them.
side_iterator boundary_sides_begin()
Iterator accessor functions.
virtual Real embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
Elem *& operator*() const
virtual void refine(MeshRefinement &mesh_refinement)
Refine the element.
const Elem *const * ConstNeighborPtrIter
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const =0
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 ...
void swap3nodes(unsigned int n1, unsigned int n2, unsigned int n3)
Swaps three node_ptrs, "rotating" them.
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.
void replace_child(Elem *elem, unsigned int c)
Replaces the child pointer at the specified index in the child array.
void swap4nodes(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four node_ptrs, "rotating" them.
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.
static const subdomain_id_type invalid_subdomain_id
A static integral constant representing an invalid subdomain id.
void remove_links_to_me()
Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's approp...
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...
Elem *const * NeighborPtrIter
Nested "classes" for use iterating over all neighbors of an element.
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Implements (adaptive) mesh refinement algorithms for a MeshBase.
virtual Order supported_nodal_order() const
Real length(const unsigned int n1, const unsigned int n2) const
IntRange< unsigned short > face_index_range() const
ElemMappingType mapping_type() const
Elem & operator=(const Elem &)=delete
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 ...
void swap2nodes(unsigned int n1, unsigned int n2)
Swaps two node_ptrs.
const Node & node_ref(const unsigned int i) const
virtual Real hmin() const
virtual unsigned int n_nodes() const =0
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const =0
unsigned int which_node_am_i(unsigned int side, unsigned int side_node) const
This function is deprecated, call local_side_node(side, side_node) instead.
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...
bool contains_edge_of(const Elem *e) const
unsigned int which_neighbor_am_i(const Elem *e) const
This function tells you which neighbor e is.
virtual unsigned int as_parent_node(unsigned int c, unsigned int n) const
virtual std::vector< unsigned int > edges_adjacent_to_node(const unsigned int) const =0
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
virtual unsigned int opposite_node(const unsigned int n, const unsigned int s) const
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex(const unsigned int n) const
static constexpr bool infinite()
Elem ** _elemlinks
Pointers to this element's parent and neighbors, and for lower-dimensional elements' interior_parent...
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...
void set_mapping_data(const unsigned char data)
Sets the value of the mapping data for the 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 ...
The definition of the struct used for iterating over sides.
const Node *const * get_nodes() const
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.
void _update_side_ptr() const
bool side_on_boundary() const
The BoundaryInfo class contains information relevant to boundary conditions including storing faces...
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
const Elem * reference_elem() const
void libmesh_assert_valid_neighbors() const
Checks for consistent neighbor links on this element.
virtual bool is_remote() const
This is the base class for point locators.
virtual unsigned int n_edges() const =0
ElemQuality
Defines an enum for element quality metrics.
virtual std::unique_ptr< Elem > disconnected_clone() const
virtual unsigned int n_second_order_adjacent_vertices(const unsigned int n) const
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...
static constexpr Real affine_tol
Default tolerance to use in has_affine_map().
bool positive_edge_orientation(const unsigned int i) const
void set_neighbor(const unsigned int i, Elem *n)
Assigns n as the neighbor.
This class implements reference counting.
subdomain_id_type _sbd_id
The subdomain to which this element belongs.
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
unsigned int which_child_am_i(const Elem *e) const
unsigned int max_descendant_p_level() const
unsigned char _rflag
h refinement flag.
virtual void flip(BoundaryInfo *boundary_info)=0
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
void swap2neighbors(unsigned int n1, unsigned int n2)
Swaps two neighbor_ptrs.
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...
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int) 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.
SimpleRange< NodeRefIter > node_ref_range()
Returns a range with all nodes of an element, usable in range-based for loops.
Defines a Cartesian bounding box by the two corner extremum.
std::unique_ptr< Elem > _side
ElemMappingType
Enumeration of possible element master->physical mapping types.
ConstNodeRefIter(const Node *const *nodepp)
virtual unsigned int n_sides() const =0
bool topologically_equal(const Elem &rhs) const
const Elem * neighbor_ptr(unsigned int i) const
virtual bool close_to_point(const Point &p, Real tol) const
unsigned int level() const
const Elem * raw_child_ptr(unsigned int i) const
virtual unsigned int n_vertices() const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::unique_ptr< Elem > side_ptr(unsigned int i)=0
virtual unsigned int local_singular_node(const Point &, const Real=TOLERANCE *TOLERANCE) const
subdomain_id_type subdomain_id() const
virtual bool is_singular_node(unsigned int) const
virtual unsigned short dim() const =0
const Node * node_ptr(const unsigned int i) const
SideIter(const SideIter &other)
void coarsen()
Coarsen the element.
virtual bool is_vertex(const unsigned int i) const =0
virtual Point master_point(const unsigned int i) const =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 ...
unsigned int n_neighbors() const
virtual Real quality(const ElemQuality q) const
virtual unsigned short int second_order_adjacent_vertex(const unsigned int n, const unsigned int v) const
virtual Real volume() const
void swap4neighbors(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four neighbor_ptrs, "rotating" them.
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...
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.
virtual void permute(unsigned int perm_num)=0
Permutes the element (by swapping node and neighbor pointers) according to the specified index...
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
void set_child(unsigned int c, Elem *elem)
Sets the pointer to the child for this element.
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const =0
bool has_ancestor_children() const
virtual bool has_invertible_map(Real tol=TOLERANCE *TOLERANCE) const
IntRange< unsigned short > node_index_range() const
bool positive_face_orientation(const unsigned int i) const
unsigned int local_node(const dof_id_type i) const
virtual bool is_vertex_on_child(unsigned int, unsigned int n) const
void nullify_neighbors()
Replaces this element with nullptr for all of its neighbors.
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Returns a range with all neighbors of an element, usable in range-based for loops.
void set_p_refinement_flag(const RefinementState pflag)
Sets the value of the p-refinement flag for the element.
virtual unsigned int n_faces() const =0
void inherit_data_from(const Elem &src)
A helper function for copying generic element data (mapping, subdomain, processor) from an element to...
virtual bool infinite() const =0
virtual std::pair< Real, Real > qual_bounds(const ElemQuality) const
void simple_side_ptr(std::unique_ptr< Elem > &side, const unsigned int i, ElemType sidetype)
An implementation for simple (all sides equal) elements.
static dof_id_type compute_key(dof_id_type n0)
virtual unsigned int n_sub_elem() const =0
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.
std::unique_ptr< const Elem > build_side_ptr(const unsigned int i, bool proxy) const
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.
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i)=0
ConstChildRefIter(const Elem *const *childpp)
virtual Order default_order() const =0
std::unique_ptr< Elem > simple_build_edge_ptr(const unsigned int i)
An implementation for simple (all edges equal) elements.
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes(unsigned int c, unsigned int n) const
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...
virtual unsigned int opposite_side(const unsigned int s) const
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...
static ElemType first_order_equivalent_type(const ElemType et)
processor_id_type processor_id() const
virtual ElemType type() const =0
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
virtual Point centroid() const
Calls Elem::vertex_average() for backwards compatibility.
bool operator==(const Elem &rhs) const
side_iterator(const IterType &d, const IterType &e, const PredType &p)
bool has_children() const
virtual unsigned int center_node_on_side(const unsigned short side) const
void ErrorVector unsigned int
NodeRefIter(Node *const *nodepp)
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element's children.
virtual bool is_child_on_edge(const unsigned int c, const unsigned int e) const
virtual bool is_edge(const unsigned int i) const =0
virtual unsigned int n_permutations() const =0
Returns the number of independent permutations of element nodes - e.g.
virtual std::vector< unsigned int > nodes_on_side(const unsigned int) const =0
virtual unsigned int n_nodes_in_child(unsigned int) const
Point vertex_average() const
static const unsigned int max_n_nodes
The maximum number of nodes any element can contain.
const Elem * child_ptr(unsigned int i) const
The definition of the protected nested SideIter class.
virtual bool is_mid_infinite_edge_node(const unsigned int) const
bool is_internal(const unsigned int i) const
SideIter _first_side()
Side iterator helper functions.