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;
480 unsigned int side_node);
490 unsigned int edge_node);
525 std::set<const Elem *> & neighbor_set)
const;
540 const Elem * start_elem)
const;
555 std::set<const Elem *> & neighbor_set)
const;
626 std::vector<dof_id_type> & conn)
const = 0;
654 virtual unsigned short dim ()
const = 0;
780 const unsigned int s);
873 unsigned int n)
const
881 unsigned int n)
const;
887 virtual bool is_edge(
const unsigned int i)
const = 0;
894 virtual bool is_face(
const unsigned int i)
const = 0;
906 const unsigned int s)
const = 0;
911 virtual std::vector<unsigned int>
nodes_on_side(
const unsigned int )
const = 0;
916 virtual std::vector<unsigned int>
nodes_on_edge(
const unsigned int )
const = 0;
921 virtual std::vector<unsigned int>
sides_on_edge(
const unsigned int )
const = 0;
933 const unsigned int e)
const = 0;
939 const unsigned int s)
const = 0;
945 virtual unsigned int opposite_side(
const unsigned int s)
const;
953 const unsigned int s)
const;
978 virtual std::unique_ptr<Elem>
side_ptr (
unsigned int i) = 0;
979 std::unique_ptr<const Elem>
side_ptr (
unsigned int i)
const;
995 virtual void side_ptr (std::unique_ptr<Elem> & side,
const unsigned int i) = 0;
996 void side_ptr (std::unique_ptr<const Elem> & side,
const unsigned int i)
const;
1021#ifdef LIBMESH_ENABLE_DEPRECATED
1026 {
if (proxy) libmesh_error(); libmesh_deprecated();
return this->
build_side_ptr(i); }
1029 {
if (proxy) libmesh_error(); libmesh_deprecated();
return this->
build_side_ptr(i); }
1046 virtual void build_side_ptr (std::unique_ptr<Elem> & side,
const unsigned int i) = 0;
1047 void build_side_ptr (std::unique_ptr<const Elem> & side,
const unsigned int i)
const;
1079 virtual void build_edge_ptr (std::unique_ptr<Elem> & edge,
const unsigned int i) = 0;
1080 void build_edge_ptr (std::unique_ptr<const Elem> & edge,
const unsigned int i)
const;
1146 { libmesh_not_implemented(); }
1209 { libmesh_not_implemented();
return std::make_pair(0.,0.); }
1437 const unsigned int n2)
const;
1460 const unsigned int v)
const;
1477 virtual std::pair<unsigned short int, unsigned short int>
1494 const bool full_ordered=
true);
1526 unsigned int level ()
const;
1533 unsigned int p_level ()
const;
1539 const unsigned int s)
const = 0;
1562#ifdef LIBMESH_ENABLE_AMR
1599 class ConstChildRefIter;
1632 const unsigned int e)
const;
1666 void family_tree (std::vector<const Elem *> & family,
1667 bool reset =
true)
const;
1680 bool reset =
true)
const;
1695 bool reset =
true)
const;
1709 bool reset =
true)
const;
1724 bool reset =
true)
const;
1739 bool reset =
true)
const;
1753 const Elem * neighbor,
1754 bool reset =
true)
const;
1768 const Elem * neighbor,
1769 bool reset =
true)
const;
1785 const Elem * neighbor,
1786 const Elem * subneighbor,
1787 bool reset =
true)
const;
1802 const Elem * neighbor,
1803 const Elem * subneighbor,
1804 bool reset =
true)
const;
1819 const Elem * neighbor,
1820 bool reset =
true)
const;
1835 const Elem * neighbor,
1839 bool reset =
true)
const;
1883 unsigned int current_min)
const;
1891 unsigned int current_min)
const;
2020#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2138#ifdef LIBMESH_ENABLE_AMR
2146 unsigned int n)
const;
2153 const std::vector<std::pair<unsigned char, unsigned char>> &
2155 unsigned int n)
const;
2162 const std::vector<std::pair<dof_id_type, dof_id_type>>
2164 unsigned int n)
const;
2171 const unsigned int child_node_num,
2172 const unsigned int parent_node_num)
const = 0;
2254 void swap3nodes(
unsigned int n1,
unsigned int n2,
unsigned int n3)
2273 void swap4nodes(
unsigned int n1,
unsigned int n2,
unsigned int n3,
2284 unsigned int n3,
unsigned int n4)
2294 template <
typename S
ide
class,
typename Sub
class>
2295 std::unique_ptr<Elem>
2301 template <
typename Sub
class>
2303 const unsigned int i,
2309 template <
typename Sub
class,
typename Map
class>
2311 const unsigned int i,
2317 template <
typename Edge
class,
typename Sub
class>
2318 std::unique_ptr<Elem>
2324 template <
typename Sub
class>
2326 const unsigned int i,
2330#ifdef LIBMESH_ENABLE_AMR
2338 std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> &
2341 static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> c;
2352 std::vector<std::vector<std::vector<signed char>>> &
2355 static std::vector<std::vector<std::vector<signed char>>> c;
2383#ifdef LIBMESH_ENABLE_AMR
2399#ifdef LIBMESH_ENABLE_AMR
2457#ifdef LIBMESH_ENABLE_AMR
2509 const unsigned int ns,
2511 Elem ** elemlinkdata,
2512 Node ** nodelinkdata) :
2513 _nodes(nodelinkdata),
2514 _elemlinks(elemlinkdata),
2516#ifdef LIBMESH_ENABLE_AMR
2517 _rflag(
Elem::DO_NOTHING),
2518 _pflag(
Elem::DO_NOTHING),
2521 _map_type(p ? p->mapping_type() : 0),
2522 _map_data(p ? p->mapping_data() : 0)
2537 libmesh_assert_equal_to(nn, p->
n_nodes());
2538 libmesh_assert_equal_to(ns, p->
n_sides());
2546 for (
unsigned int n=0; n<nn; n++)
2562 for (
unsigned int n=1; n<ns+1; n++)
2573#ifdef LIBMESH_ENABLE_AMR
2585 libmesh_assert_less (i, this->
n_nodes());
2597 libmesh_assert_less (i, this->
n_nodes());
2607 libmesh_assert_less (i, this->
n_nodes());
2639 libmesh_assert_less (i, this->
n_nodes());
2650 libmesh_assert_less (i, this->
n_nodes());
2686#ifdef LIBMESH_ENABLE_DEPRECATED
2690 libmesh_assert_less (i, this->
n_nodes());
2692 libmesh_deprecated();
2704 libmesh_assert_less (i, this->
n_nodes());
2730 return !(*
this == rhs);
2781 if (n && n->parent() ==
this)
2793 if (n && n->parent() ==
this)
2823 return {0, cast_int<unsigned short>(this->
n_nodes())};
2832 return {0, cast_int<unsigned short>(this->
n_edges())};
2841 return {0, cast_int<unsigned short>(this->
n_faces())};
2850 return {0, cast_int<unsigned short>(this->
n_sides())};
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);
2882std::unique_ptr<const Elem>
2887 Elem * me =
const_cast<Elem *
>(
this);
2896 const unsigned int i)
const
2899 Elem * me =
const_cast<Elem *
>(
this);
2900 std::unique_ptr<Elem> e {
const_cast<Elem *
>(elem.release())};
2902 elem = std::move(e);
2907template <
typename S
ide
class,
typename Sub
class>
2909std::unique_ptr<Elem>
2912 libmesh_assert_less (i, this->
n_sides());
2914 std::unique_ptr<Elem> face = std::make_unique<Sideclass>();
2915 for (
auto n : face->node_index_range())
2916 face->set_node(n, this->node_ptr(Subclass::side_nodes_map[i][n]));
2918 face->set_interior_parent(
this);
2919 face->inherit_data_from(*
this);
2926template <
typename Sub
class>
2930 const unsigned int i,
2933 libmesh_assert_less (i, this->
n_sides());
2935 if (!side.get() || side->type() != sidetype)
2937 Subclass & real_me = cast_ref<Subclass&>(*
this);
2938 side = real_me.Subclass::build_side_ptr(i);
2942 side->set_interior_parent(
this);
2943 side->inherit_data_from(*
this);
2944 for (
auto n : side->node_index_range())
2945 side->set_node(n, this->node_ptr(Subclass::side_nodes_map[i][n]));
2951template <
typename Sub
class,
typename Map
class>
2955 const unsigned int i,
2958 libmesh_assert_less (i, this->
n_sides());
2960 if (!side.get() || side->type() != sidetype)
2962 Subclass & real_me = cast_ref<Subclass&>(*
this);
2963 side = real_me.Subclass::side_ptr(i);
2969 for (
auto n : side->node_index_range())
2970 side->set_node(n, this->node_ptr(Mapclass::side_nodes_map[i][n]));
2977std::unique_ptr<const Elem>
2982 Elem * me =
const_cast<Elem *
>(
this);
2991 const unsigned int i)
const
2994 Elem * me =
const_cast<Elem *
>(
this);
2995 std::unique_ptr<Elem> e {
const_cast<Elem *
>(elem.release())};
2997 elem = std::move(e);
3001template <
typename Edge
class,
typename Sub
class>
3003std::unique_ptr<Elem>
3006 libmesh_assert_less (i, this->
n_edges());
3008 std::unique_ptr<Elem> edge = std::make_unique<Edgeclass>();
3010 for (
auto n : edge->node_index_range())
3011 edge->set_node(n, this->node_ptr(Subclass::edge_nodes_map[i][n]));
3013 edge->set_interior_parent(
this);
3014 edge->inherit_data_from(*
this);
3022template <
typename Sub
class>
3026 const unsigned int i,
3029 libmesh_assert_less (i, this->
n_edges());
3031 if (!edge.get() || edge->type() != edgetype)
3033 Subclass & real_me = cast_ref<Subclass&>(*
this);
3034 edge = real_me.Subclass::build_edge_ptr(i);
3038 edge->inherit_data_from(*
this);
3039 for (
auto n : edge->node_index_range())
3040 edge->set_node(n, this->node_ptr(Subclass::edge_nodes_map[i][n]));
3061 const Elem * eparent = e;
3063 while (eparent->
level() > this->level())
3065 eparent = eparent->
parent();
3081#ifdef LIBMESH_ENABLE_AMR
3099#ifdef LIBMESH_ENABLE_AMR
3104 for (
const Elem * my_ancestor = this->
parent();
3105 my_ancestor !=
nullptr;
3106 my_ancestor = my_ancestor->
parent())
3107 if (my_ancestor->active())
3119#ifdef LIBMESH_ENABLE_AMR
3133#ifdef LIBMESH_ENABLE_AMR
3138 if (c.has_children())
3148#ifdef LIBMESH_ENABLE_AMR
3153#ifdef LIBMESH_ENABLE_AMR
3154 const Elem * e = descendant;
3187 libmesh_assert_equal_to(this->
dim(), p ? p->
dim() : this->
dim());
3196 const Elem * tp =
this;
3200 while (tp->
parent() !=
nullptr)
3204 libmesh_assert_equal_to (tp->
level(), 0);
3214#ifdef LIBMESH_ENABLE_AMR
3220 if (this->
parent() ==
nullptr)
3248#ifdef LIBMESH_ENABLE_AMR
3289#ifdef LIBMESH_ENABLE_AMR
3336 for (
unsigned int c=0; c != nc; c++)
3340 libmesh_error_msg(
"ERROR: which_child_am_i() was called with a non-child!");
3358 _rflag = cast_int<unsigned char>(rflag);
3375 libmesh_assert_not_equal_to
3378 _pflag = cast_int<unsigned char>(pflag);
3392 unsigned int max_p_level =
_p_level;
3394 max_p_level = std::max(max_p_level,
3395 c.max_descendant_p_level());
3405 libmesh_assert_not_equal_to
3408 _p_level = cast_int<unsigned char>(p);
3416 _pflag = cast_int<unsigned char>(pflag);
3427 this->
flip(boundary_info);
3444 if (n0 > n1) std::swap (n0, n1);
3456 std::array<dof_id_type, 3> array = {{n0, n1, n2}};
3457 std::sort(array.begin(), array.end());
3469 std::array<dof_id_type, 4> array = {{n0, n1, n2, n3}};
3470 std::sort(array.begin(), array.end());
3483#ifdef LIBMESH_ENABLE_AMR
3554 this->_parent == other.
_parent);
3631 template <
typename PredType,
typename IterType>
3634 const PredType & p ) :
3658#define LIBMESH_ENABLE_TOPOLOGY_CACHES \
3660 std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> & \
3661 _get_bracketing_node_cache() const override \
3663 static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> c; \
3668 std::vector<std::vector<std::vector<signed char>>> & \
3669 _get_parent_indices_cache() const override \
3671 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
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
static ElemType edge_type(const ElemType t)
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.
static constexpr 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...
std::vector< unsigned int > oriented_face_vertices(const unsigned int i) const
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
unsigned int face_orientation(const unsigned int i) const
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
[email protected] * 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)