Loading [MathJax]/extensions/MathEvents.js
libMesh
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
libMesh::Pyramid18 Class Referencefinal


The Pyramid18 is an element in 3D composed of 18 nodes, designed to interface with a QUAD9 element on the base and a TRI7 element on each of the triangular faces. More...

#include <cell_pyramid18.h>

Inheritance diagram for libMesh::Pyramid18:
[legend]

Public Types

enum  RefinementState {
  COARSEN = 0, DO_NOTHING, REFINE, JUST_REFINED,
  JUST_COARSENED, INACTIVE, COARSEN_INACTIVE, INVALID_REFINEMENTSTATE
}
 Enumeration of possible element refinement states. More...
 
typedef Elem *const * NeighborPtrIter
 Nested "classes" for use iterating over all neighbors of an element. More...
 
typedef const Elem *const * ConstNeighborPtrIter
 
typedef Predicates::multi_predicate Predicate
 Useful iterator typedefs. More...
 

Public Member Functions

 Pyramid18 (Elem *p=nullptr)
 Constructor. More...
 
 Pyramid18 (Pyramid18 &&)=delete
 
 Pyramid18 (const Pyramid18 &)=delete
 
Pyramid18operator= (const Pyramid18 &)=delete
 
Pyramid18operator= (Pyramid18 &&)=delete
 
virtual ~Pyramid18 ()=default
 
virtual unsigned int n_nodes () const override
 
virtual ElemType type () const override
 
virtual unsigned int n_sub_elem () const override
 FIXME: we don't yet have a refinement pattern for pyramids... More...
 
virtual bool is_vertex (const unsigned int i) const override
 
virtual bool is_edge (const unsigned int i) const override
 
virtual bool is_face (const unsigned int i) const override
 
virtual bool is_node_on_side (const unsigned int n, const unsigned int s) const override
 
virtual std::vector< unsigned intnodes_on_side (const unsigned int s) const override
 
virtual std::vector< unsigned intnodes_on_edge (const unsigned int e) const override
 
virtual bool is_node_on_edge (const unsigned int n, const unsigned int e) const override
 
virtual bool has_affine_map () const override
 
virtual Order default_order () const override
 
virtual dof_id_type key (const unsigned int s) const override
 
virtual unsigned int local_side_node (unsigned int side, unsigned int side_node) const override
 
virtual unsigned int local_edge_node (unsigned int edge, unsigned int edge_node) const override
 
virtual std::unique_ptr< Elembuild_side_ptr (const unsigned int i, bool proxy=false) override
 Builds a QUAD9 or TRI7 coincident with face i. More...
 
virtual void build_side_ptr (std::unique_ptr< Elem > &elem, const unsigned int i) override
 Rebuilds a QUAD9 or TRI7 built coincident with face i. More...
 
virtual std::unique_ptr< Elembuild_edge_ptr (const unsigned int i) override
 Builds a EDGE3 coincident with edge i. More...
 
virtual void build_edge_ptr (std::unique_ptr< Elem > &edge, const unsigned int i) override
 Rebuilds a EDGE3 coincident with edge i. More...
 
virtual void connectivity (const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
 
virtual unsigned int n_second_order_adjacent_vertices (const unsigned int n) const override
 
virtual unsigned short int second_order_adjacent_vertex (const unsigned int n, const unsigned int v) const override
 
virtual void permute (unsigned int perm_num) override final
 Permutes the element (by swapping node and neighbor pointers) according to the specified index. More...
 
virtual void flip (BoundaryInfo *) override final
 Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sign. More...
 
unsigned int center_node_on_side (const unsigned short side) const override final
 
ElemType side_type (const unsigned int s) const override final
 
virtual dof_id_type key (const unsigned int s) const override
 Don't hide Pyramid::key() defined in the base class. More...
 
virtual dof_id_type key (const unsigned int s) const =0
 Don't hide Pyramid::key() defined in the base class. More...
 
virtual dof_id_type key () const
 Don't hide Pyramid::key() defined in the base class. More...
 
virtual Point master_point (const unsigned int i) const override
 
virtual unsigned int n_sides () const override
 
virtual unsigned int n_vertices () const override
 
virtual unsigned int n_edges () const override
 
virtual unsigned int n_faces () const override
 
virtual unsigned int n_children () const override
 
virtual bool is_child_on_side (const unsigned int c, const unsigned int s) const override
 
virtual bool is_edge_on_side (const unsigned int e, const unsigned int s) const override
 
virtual dof_id_type key () const
 
virtual dof_id_type low_order_key (const unsigned int s) const override
 
virtual std::unique_ptr< Elemside_ptr (const unsigned int i) override
 
virtual void side_ptr (std::unique_ptr< Elem > &side, const unsigned int i) override
 Rebuilds a primitive triangle or quad for face i. More...
 
std::unique_ptr< const Elemside_ptr (unsigned int i) const
 
void side_ptr (std::unique_ptr< const Elem > &side, const unsigned int i) const
 
virtual std::vector< unsigned intsides_on_edge (const unsigned int e) const override final
 
unsigned int local_singular_node (const Point &p, const Real tol=TOLERANCE *TOLERANCE) const override final
 
virtual bool is_singular_node (unsigned int node_idx) const override final
 
virtual unsigned int n_permutations () const override final
 One quad side, four orientations. More...
 
virtual bool is_flipped () const override final
 
virtual std::vector< unsigned intedges_adjacent_to_node (const unsigned int n) const override
 
virtual bool on_reference_element (const Point &p, const Real eps=TOLERANCE) const override final
 
virtual unsigned short dim () const override
 
virtual BoundingBox loose_bounding_box () const override
 
virtual bool infinite () const override
 
const Pointpoint (const unsigned int i) const
 
Pointpoint (const unsigned int i)
 
dof_id_type node_id (const unsigned int i) const
 
unsigned int local_node (const dof_id_type i) const
 
unsigned int get_node_index (const Node *node_ptr) const
 
const Node *const * get_nodes () const
 
const Nodenode_ptr (const unsigned int i) const
 
Nodenode_ptr (const unsigned int i)
 
const Nodenode_ref (const unsigned int i) const
 
Nodenode_ref (const unsigned int i)
 
virtual Node *& set_node (const unsigned int i)
 
virtual void set_node (const unsigned int i, Node *node)
 Sets local Node i to refer to node. More...
 
SimpleRange< NodeRefIternode_ref_range ()
 Returns a range with all nodes of an element, usable in range-based for loops. More...
 
SimpleRange< ConstNodeRefIternode_ref_range () const
 
subdomain_id_type subdomain_id () const
 
subdomain_id_typesubdomain_id ()
 
virtual bool runtime_topology () const
 
const Elemreference_elem () const
 
bool operator== (const Elem &rhs) const
 
bool topologically_equal (const Elem &rhs) const
 
const Elemneighbor_ptr (unsigned int i) const
 
Elemneighbor_ptr (unsigned int i)
 
SimpleRange< NeighborPtrIterneighbor_ptr_range ()
 Returns a range with all neighbors of an element, usable in range-based for loops. More...
 
SimpleRange< ConstNeighborPtrIterneighbor_ptr_range () const
 
const Elemtopological_neighbor (const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
 
Elemtopological_neighbor (const unsigned int i, MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb)
 
bool has_topological_neighbor (const Elem *elem, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
 
void set_neighbor (const unsigned int i, Elem *n)
 Assigns n as the i^{th} neighbor. More...
 
bool has_neighbor (const Elem *elem) const
 
Elemchild_neighbor (Elem *elem)
 
const Elemchild_neighbor (const Elem *elem) const
 
bool on_boundary () const
 
bool is_semilocal (const processor_id_type my_pid) const
 
unsigned int which_neighbor_am_i (const Elem *e) const
 This function tells you which neighbor e is. More...
 
unsigned int which_side_am_i (const Elem *e) const
 This function tells you which side the boundary element e is. More...
 
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. More...
 
bool contains_vertex_of (const Elem *e, bool mesh_connection=false) const
 
bool contains_edge_of (const Elem *e) const
 
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 element and which touch the current active element at the specified point, which should be a point in the current element. More...
 
void find_point_neighbors (std::set< const Elem *> &neighbor_set) const
 This function finds all active elements (including this one) in the same manifold as this element which touch this active element at any point. More...
 
void find_point_neighbors (std::set< const Elem *> &neighbor_set, const Elem *start_elem) const
 This function finds all active elements (including this one) in the same manifold as start_elem (which must be active and must touch this element) which touch this element at any point. More...
 
void find_point_neighbors (std::set< Elem *> &neighbor_set, Elem *start_elem)
 Non-const version of function above. More...
 
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 active element along the whole edge defined by the two points p1 and p2. More...
 
void find_edge_neighbors (std::set< const Elem *> &neighbor_set) const
 This function finds all active elements in the same manifold as this element which touch the current active element along any edge (more precisely, at at least two points). More...
 
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 element whose intersection with this element has non-zero measure. More...
 
void find_interior_neighbors (std::set< Elem *> &neighbor_set)
 Non-const version of function above that fills up a vector of non-const Elem pointers instead. More...
 
void remove_links_to_me ()
 Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's appropriate pointers to point to null instead of to this. More...
 
void make_links_to_me_remote ()
 Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's appropriate pointers to point to the global remote_elem instead of this. More...
 
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 to this Elem instead of to the global remote_elem. More...
 
virtual bool is_remote () const
 
void write_connectivity (std::ostream &out, const IOPackage iop) const
 Writes the element connectivity for various IO packages to the passed ostream "out". More...
 
IntRange< unsigned short > node_index_range () const
 
virtual unsigned int n_nodes_in_child (unsigned int) const
 
IntRange< unsigned short > side_index_range () const
 
unsigned int n_neighbors () const
 
IntRange< unsigned short > edge_index_range () const
 
virtual bool is_vertex_on_child (unsigned int, unsigned int n) const
 
virtual bool is_vertex_on_parent (unsigned int c, unsigned int n) const
 
bool is_internal (const unsigned int i) const
 
virtual unsigned int opposite_side (const unsigned int s) const
 
virtual unsigned int opposite_node (const unsigned int n, const unsigned int s) const
 
std::unique_ptr< const Elembuild_side_ptr (const unsigned int i, bool proxy=false) const
 
void build_side_ptr (std::unique_ptr< const Elem > &side, const unsigned int i) const
 
std::unique_ptr< const Elembuild_edge_ptr (const unsigned int i) const
 
void build_edge_ptr (std::unique_ptr< const Elem > &edge, const unsigned int i) const
 
virtual Order supported_nodal_order () const
 
virtual Order default_side_order () const
 
virtual Point centroid () const
 Calls Elem::vertex_average() for backwards compatibility. More...
 
virtual Point true_centroid () const
 
Point vertex_average () const
 
virtual Point quasicircumcenter () const
 
virtual Real hmin () const
 
virtual Real hmax () const
 
virtual Real volume () const
 
virtual Real quality (const ElemQuality q) const
 
virtual std::pair< Real, Realqual_bounds (const ElemQuality) const
 
virtual bool contains_point (const Point &p, Real tol=TOLERANCE) const
 
virtual bool close_to_point (const Point &p, Real tol) const
 
bool positive_edge_orientation (const unsigned int i) const
 
bool positive_face_orientation (const unsigned int i) const
 
virtual bool has_invertible_map (Real tol=TOLERANCE *TOLERANCE) const
 
virtual bool is_linear () const
 
void print_info (std::ostream &os=libMesh::out) const
 Prints relevant information about the element. More...
 
std::string get_info () const
 Prints relevant information about the element to a string. More...
 
bool active () const
 
bool ancestor () const
 
bool subactive () const
 
bool has_children () const
 
bool has_ancestor_children () const
 
bool is_ancestor_of (const Elem *descendant) const
 
const Elemparent () const
 
Elemparent ()
 
void set_parent (Elem *p)
 Sets the pointer to the element's parent. More...
 
const Elemtop_parent () const
 
const Eleminterior_parent () const
 
Eleminterior_parent ()
 
void set_interior_parent (Elem *p)
 Sets the pointer to the element's interior_parent. More...
 
Real length (const unsigned int n1, const unsigned int n2) const
 
virtual std::pair< unsigned short int, unsigned short intsecond_order_child_vertex (const unsigned int n) const
 
unsigned int level () const
 
unsigned int p_level () const
 
ElemMappingType mapping_type () const
 
void set_mapping_type (const ElemMappingType type)
 Sets the value of the mapping type for the element. More...
 
unsigned char mapping_data () const
 
void set_mapping_data (const unsigned char data)
 Sets the value of the mapping data for the element. More...
 
const Elemraw_child_ptr (unsigned int i) const
 
const Elemchild_ptr (unsigned int i) const
 
Elemchild_ptr (unsigned int i)
 
SimpleRange< ChildRefIterchild_ref_range ()
 Returns a range with all children of a parent element, usable in range-based for loops. More...
 
SimpleRange< ConstChildRefIterchild_ref_range () const
 
unsigned int which_child_am_i (const Elem *e) const
 
virtual bool is_child_on_edge (const unsigned int c, const unsigned int e) const
 
void add_child (Elem *elem)
 Adds a child pointer to the array of children of this element. More...
 
void add_child (Elem *elem, unsigned int c)
 Adds a new child pointer to the specified index in the array of children of this element. More...
 
void replace_child (Elem *elem, unsigned int c)
 Replaces the child pointer at the specified index in the child array. More...
 
void family_tree (std::vector< const Elem *> &family, bool reset=true) const
 Fills the vector family with the children of this element, recursively. More...
 
void family_tree (std::vector< Elem *> &family, bool reset=true)
 Non-const version of function above; fills a vector of non-const pointers. More...
 
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. More...
 
void total_family_tree (std::vector< Elem *> &family, bool reset=true)
 Non-const version of function above; fills a vector of non-const pointers. More...
 
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. More...
 
void active_family_tree (std::vector< Elem *> &active_family, bool reset=true)
 Non-const version of function above; fills a vector of non-const pointers. More...
 
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. More...
 
void family_tree_by_side (std::vector< Elem *> &family, unsigned int side, bool reset=true)
 Non-const version of function above; fills a vector of non-const pointers. More...
 
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. More...
 
void active_family_tree_by_side (std::vector< Elem *> &family, unsigned int side, bool reset=true)
 Non-const version of function above; fills a vector of non-const pointers. More...
 
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. More...
 
void family_tree_by_neighbor (std::vector< Elem *> &family, Elem *neighbor, bool reset=true)
 Non-const version of function above; fills a vector of non-const pointers. More...
 
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. More...
 
void total_family_tree_by_neighbor (std::vector< Elem *> &family, Elem *neighbor, bool reset=true)
 Non-const version of function above; fills a vector of non-const pointers. More...
 
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. More...
 
void family_tree_by_subneighbor (std::vector< Elem *> &family, Elem *neighbor, Elem *subneighbor, bool reset=true)
 Non-const version of function above; fills a vector of non-const pointers. More...
 
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. More...
 
void total_family_tree_by_subneighbor (std::vector< Elem *> &family, Elem *neighbor, Elem *subneighbor, bool reset=true)
 Non-const version of function above; fills a vector of non-const pointers. More...
 
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. More...
 
void active_family_tree_by_neighbor (std::vector< Elem *> &family, Elem *neighbor, bool reset=true)
 Non-const version of function above; fills a vector of non-const pointers. More...
 
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.g. More...
 
void active_family_tree_by_topological_neighbor (std::vector< Elem *> &family, Elem *neighbor, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb, bool reset=true)
 Non-const version of function above; fills a vector of non-const pointers. More...
 
RefinementState refinement_flag () const
 
void set_refinement_flag (const RefinementState rflag)
 Sets the value of the refinement flag for the element. More...
 
RefinementState p_refinement_flag () const
 
void set_p_refinement_flag (const RefinementState pflag)
 Sets the value of the p-refinement flag for the element. More...
 
unsigned int max_descendant_p_level () const
 
unsigned int min_p_level_by_neighbor (const Elem *neighbor, unsigned int current_min) const
 
unsigned int min_new_p_level_by_neighbor (const Elem *neighbor, unsigned int current_min) const
 
void set_p_level (const unsigned int p)
 Sets the value of the p-refinement level for the element. More...
 
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 ancestors. More...
 
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 ancestors; also sets the p_refinement_flag, simultaneously so that they can be safely checked for mutual consistency. More...
 
virtual void refine (MeshRefinement &mesh_refinement)
 Refine the element. More...
 
void coarsen ()
 Coarsen the element. More...
 
void contract ()
 Contract an active element, i.e. More...
 
void libmesh_assert_valid_neighbors () const
 Checks for consistent neighbor links on this element. More...
 
void libmesh_assert_valid_node_pointers () const
 Checks for a valid id and pointers to nodes with valid ids on this element. More...
 
side_iterator boundary_sides_begin ()
 Iterator accessor functions. More...
 
side_iterator boundary_sides_end ()
 
virtual bool is_mid_infinite_edge_node (const unsigned int) const
 
virtual Point origin () const
 
virtual std::unique_ptr< Elemdisconnected_clone () const
 
void orient (BoundaryInfo *boundary_info)
 Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sign, iff we find a negative orientation. More...
 
virtual unsigned int as_parent_node (unsigned int c, unsigned int n) const
 
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes (unsigned int c, unsigned int n) const
 
virtual const std::vector< std::pair< dof_id_type, dof_id_type > > bracketing_nodes (unsigned int c, unsigned int n) const
 
virtual unsigned int embedding_matrix_version () const
 
void nullify_neighbors ()
 Replaces this element with nullptr for all of its neighbors. More...
 
DofObjectget_old_dof_object ()
 Pointer accessor for previously public old_dof_object. More...
 
const DofObjectget_old_dof_object () const
 
DofObjectget_old_dof_object_ref ()
 As above, but do not use in situations where the old_dof_object may be nullptr, since this function asserts that the old_dof_object is valid before returning a reference to it. More...
 
const DofObjectget_old_dof_object_ref () const
 
void clear_old_dof_object ()
 Sets the old_dof_object to nullptr. More...
 
void set_old_dof_object ()
 Sets the old_dof_object to a copy of this. More...
 
void clear_dofs ()
 Clear the DofMap data structures holding degree of freedom data. More...
 
void invalidate_dofs (const unsigned int sys_num=libMesh::invalid_uint)
 Sets all degree of freedom numbers to invalid_id. More...
 
void invalidate_id ()
 Sets the id to invalid_id. More...
 
void invalidate_processor_id ()
 Sets the processor id to invalid_processor_id. More...
 
void invalidate ()
 Invalidates all the indices for this DofObject. More...
 
unsigned int n_dofs (const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
 
dof_id_type id () const
 
dof_id_typeset_id ()
 
void set_id (const dof_id_type dofid)
 Sets the id for this DofObject. More...
 
unique_id_type unique_id () const
 
unique_id_typeset_unique_id ()
 
void set_unique_id (unique_id_type new_id)
 Sets the unique_id for this DofObject. More...
 
bool valid_id () const
 
bool valid_unique_id () const
 
processor_id_type processor_id () const
 
processor_id_typeprocessor_id ()
 
void processor_id (const processor_id_type pid)
 Sets the processor_id for this DofObject. More...
 
bool valid_processor_id () const
 
unsigned int n_systems () const
 
unsigned int n_pseudo_systems () const
 
void set_n_systems (const unsigned int s)
 Sets the number of systems for this DofObject. More...
 
void set_extra_integer (const unsigned int index, const dof_id_type value)
 Sets the value on this object of the extra integer associated with index, which should have been obtained via a call to MeshBase::add_elem_integer or MeshBase::add_node_integer. More...
 
dof_id_type get_extra_integer (const unsigned int index) const
 Gets the value on this object of the extra integer associated with index, which should have been obtained via a call to MeshBase::add_elem_integer or MeshBase::add_node_integer. More...
 
template<typename T >
void set_extra_datum (const unsigned int index, const T value)
 Sets the value on this object of the extra datum associated with index, which should have been obtained via a call to MeshBase::add_elem_datum or MeshBase::add_node_datum using the same type T. More...
 
template<typename T >
get_extra_datum (const unsigned int index) const
 Gets the value on this object of the extra datum associated with index, which should have been obtained via a call to MeshBase::add_elem_datum or MeshBase::add_node_datum using the same type T. More...
 
void add_system ()
 Adds an additional system to the DofObject. More...
 
unsigned int n_var_groups (const unsigned int s) const
 
unsigned int n_vars (const unsigned int s, const unsigned int vg) const
 
unsigned int n_vars (const unsigned int s) const
 
void set_n_vars_per_group (const unsigned int s, const std::vector< unsigned int > &nvpg)
 Sets number of variables in each group associated with system s for this DofObject. More...
 
unsigned int n_comp (const unsigned int s, const unsigned int var) const
 
unsigned int n_comp_group (const unsigned int s, const unsigned int vg) const
 
void set_n_comp (const unsigned int s, const unsigned int var, const unsigned int ncomp)
 Sets the number of components for Variable var of system s associated with this DofObject. More...
 
void set_n_comp_group (const unsigned int s, const unsigned int vg, const unsigned int ncomp)
 Sets the number of components for VariableGroup vg of system s associated with this DofObject. More...
 
dof_id_type dof_number (const unsigned int s, const unsigned int var, const unsigned int comp) const
 
dof_id_type dof_number (const unsigned int s, const unsigned int vg, const unsigned int vig, const unsigned int comp, const unsigned int n_comp) const
 
std::pair< unsigned int, unsigned intvar_to_vg_and_offset (const unsigned int s, const unsigned int var) const
 
void set_dof_number (const unsigned int s, const unsigned int var, const unsigned int comp, const dof_id_type dn)
 Sets the global degree of freedom number for variable var, component comp for system s associated with this DofObject. More...
 
bool has_dofs (const unsigned int s=libMesh::invalid_uint) const
 
void set_vg_dof_base (const unsigned int s, const unsigned int vg, const dof_id_type db)
 VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base. More...
 
dof_id_type vg_dof_base (const unsigned int s, const unsigned int vg) const
 VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base. More...
 
void add_extra_integers (const unsigned int n_integers)
 Assigns a set of extra integers to this DofObject. More...
 
void add_extra_integers (const unsigned int n_integers, const std::vector< dof_id_type > &default_values)
 Assigns a set of extra integers to this DofObject. More...
 
unsigned int n_extra_integers () const
 Returns how many extra integers are associated to the DofObject. More...
 
bool has_extra_integers () const
 Returns whether extra integers are associated to the DofObject. More...
 
unsigned int packed_indexing_size () const
 If we pack our indices into an buffer for communications, how many ints do we need? More...
 
void unpack_indexing (std::vector< largest_id_type >::const_iterator begin)
 A method for creating our index buffer from packed data - basically with our current implementation we investigate the size term and then copy. More...
 
void pack_indexing (std::back_insert_iterator< std::vector< largest_id_type >> target) const
 A method for creating packed data from our index buffer - basically a copy with prepended size with our current implementation. More...
 
void debug_buffer () const
 Print our buffer for debugging. More...
 
void print_dof_info () const
 Print out info for debugging. More...
 
void set_buffer (const std::vector< dof_id_type > &buf)
 

Static Public Member Functions

static constexpr bool infinite ()
 
static void print_info (std::ostream &out_stream=libMesh::out)
 Prints the reference information, by default to libMesh::out. More...
 
static void print_info (std::ostream &out_stream=libMesh::out)
 Prints the reference information, by default to libMesh::out. More...
 
static std::string get_info ()
 Gets a string containing the reference information. More...
 
static std::string get_info ()
 Gets a string containing the reference information. More...
 
static ElemType second_order_equivalent_type (const ElemType et, const bool full_ordered=true)
 
static ElemType first_order_equivalent_type (const ElemType et)
 
static ElemType complete_order_equivalent_type (const ElemType et)
 
static std::unique_ptr< Elembuild (const ElemType type, Elem *p=nullptr)
 
static std::unique_ptr< Elembuild_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 id. More...
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. More...
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. More...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() More...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() More...
 
static void disable_print_counter_info ()
 
static void disable_print_counter_info ()
 
static unsigned int unpackable_indexing_size (std::vector< largest_id_type >::const_iterator begin)
 If we have indices packed into an buffer for communications, how much of that buffer applies to this dof object? More...
 

Static Public Attributes

static const int num_nodes = 18
 Geometric constants for Pyramid18. More...
 
static const int nodes_per_side = 9
 
static const int nodes_per_edge = 3
 
static const unsigned int side_nodes_map [num_sides][nodes_per_side]
 This maps the j^{th} node of the i^{th} side to element node numbers. More...
 
static const unsigned int edge_nodes_map [num_edges][nodes_per_edge]
 This maps the j^{th} node of the i^{th} edge to element node numbers. More...
 
static const int num_sides = 5
 Geometric constants for all Pyramids. More...
 
static const int num_edges = 8
 
static const int num_children = 0
 
static const unsigned int edge_sides_map [8][2]
 This maps each edge to the sides that contain said edge. More...
 
static const subdomain_id_type invalid_subdomain_id = std::numeric_limits<subdomain_id_type>::max()
 A static integral constant representing an invalid subdomain id. More...
 
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 element. More...
 
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. More...
 
static const unsigned int max_n_nodes = 27
 The maximum number of nodes any element can contain. More...
 
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. More...
 
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. More...
 
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 elements of that type. More...
 
static const dof_id_type invalid_id = static_cast<dof_id_type>(-1)
 An invalid id to distinguish an uninitialized DofObject. More...
 
static const unique_id_type invalid_unique_id = static_cast<unique_id_type>(-1)
 An invalid unique_id to distinguish an uninitialized DofObject. More...
 
static const processor_id_type invalid_processor_id = static_cast<processor_id_type>(-1)
 An invalid processor_id to distinguish DoFs that have not been assigned to a processor. More...
 

Protected Types

typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 Data structure to log the information. More...
 
typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 Data structure to log the information. More...
 

Protected Member Functions

virtual Real embedding_matrix (const unsigned int, const unsigned int, const unsigned int) const override
 Matrix used to create the elements children. More...
 
unsigned int side_children_matrix (const unsigned int, const unsigned int) const
 Matrix that allows children to inherit boundary conditions. More...
 
void swap2nodes (unsigned int n1, unsigned int n2)
 Swaps two node_ptrs. More...
 
void swap2neighbors (unsigned int n1, unsigned int n2)
 Swaps two neighbor_ptrs. More...
 
void swap2boundarysides (unsigned short s1, unsigned short s2, BoundaryInfo *boundary_info) const
 Swaps two sides in boundary_info, if it is non-null. More...
 
void swap2boundaryedges (unsigned short e1, unsigned short e2, BoundaryInfo *boundary_info) const
 Swaps two edges in boundary_info, if it is non-null. More...
 
void swap3nodes (unsigned int n1, unsigned int n2, unsigned int n3)
 Swaps three node_ptrs, "rotating" them. More...
 
void swap3neighbors (unsigned int n1, unsigned int n2, unsigned int n3)
 Swaps three neighbor_ptrs, "rotating" them. More...
 
void swap4nodes (unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
 Swaps four node_ptrs, "rotating" them. More...
 
void swap4neighbors (unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
 Swaps four neighbor_ptrs, "rotating" them. More...
 
template<typename Sideclass , typename Subclass >
std::unique_ptr< Elemsimple_build_side_ptr (const unsigned int i, bool proxy)
 An implementation for simple (all sides equal) elements. More...
 
template<typename Subclass >
void simple_build_side_ptr (std::unique_ptr< Elem > &side, const unsigned int i, ElemType sidetype)
 An implementation for simple (all sides equal) elements. More...
 
template<typename Subclass , typename Mapclass >
void simple_side_ptr (std::unique_ptr< Elem > &side, const unsigned int i, ElemType sidetype)
 An implementation for simple (all sides equal) elements. More...
 
template<typename Edgeclass , typename Subclass >
std::unique_ptr< Elemsimple_build_edge_ptr (const unsigned int i)
 An implementation for simple (all edges equal) elements. More...
 
template<typename Subclass >
void simple_build_edge_ptr (std::unique_ptr< Elem > &edge, const unsigned int i, ElemType edgetype)
 An implementation for simple (all edges equal) elements. More...
 
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 cache, since the default calculation is slow. More...
 
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 static cache, since the default calculation is slow. More...
 
void increment_constructor_count (const std::string &name) noexcept
 Increments the construction counter. More...
 
void increment_constructor_count (const std::string &name) noexcept
 Increments the construction counter. More...
 
void increment_destructor_count (const std::string &name) noexcept
 Increments the destruction counter. More...
 
void increment_destructor_count (const std::string &name) noexcept
 Increments the destruction counter. More...
 

Static Protected Member Functions

static dof_id_type compute_key (dof_id_type n0)
 
static dof_id_type compute_key (dof_id_type n0, dof_id_type n1)
 
static dof_id_type compute_key (dof_id_type n0, dof_id_type n1, dof_id_type n2)
 
static dof_id_type compute_key (dof_id_type n0, dof_id_type n1, dof_id_type n2, dof_id_type n3)
 

Protected Attributes

Node_nodelinks_data [num_nodes]
 Data for links to nodes. More...
 
 LIBMESH_ENABLE_TOPOLOGY_CACHES
 
Elem_elemlinks_data [6+(LIBMESH_DIM >3)]
 Data for links to parent/neighbor/interior_parent elements. More...
 
Node ** _nodes
 Pointers to the nodes we are connected to. More...
 
Elem ** _elemlinks
 Pointers to this element's parent and neighbors, and for lower-dimensional elements' interior_parent. More...
 
std::unique_ptr< Elem *[]> _children
 unique_ptr to array of this element's children. More...
 
subdomain_id_type _sbd_id
 The subdomain to which this element belongs. More...
 
unsigned char _rflag
 h refinement flag. More...
 
unsigned char _pflag
 p refinement flag. More...
 
unsigned char _p_level
 p refinement level - the difference between the polynomial degree on this element and the minimum polynomial degree on the mesh. More...
 
unsigned char _map_type
 Mapping function type; currently either 0 (LAGRANGE) or 1 (RATIONAL_BERNSTEIN). More...
 
unsigned char _map_data
 Mapping function data; currently used when needed to store the RATIONAL_BERNSTEIN nodal weight data index. More...
 
std::unique_ptr< DofObjectold_dof_object
 This object on the last mesh. More...
 

Static Protected Attributes

static const Real _master_points [14][3]
 Master element node locations. More...
 
static const unsigned int adjacent_edges_map [5][4]
 This maps the j^{th} node to the 3 or 4 edge ids adjacent to the node. More...
 
static constexpr Real affine_tol = TOLERANCE*TOLERANCE
 Default tolerance to use in has_affine_map(). More...
 
static Counts _counts
 Actually holds the data. More...
 
static Counts _counts
 Actually holds the data. More...
 
static Threads::atomic< unsigned int_n_objects
 The number of objects. More...
 
static Threads::atomic< unsigned int_n_objects
 The number of objects. More...
 
static Threads::spin_mutex _mutex
 Mutual exclusion object to enable thread-safe reference counting. More...
 
static Threads::spin_mutex _mutex
 Mutual exclusion object to enable thread-safe reference counting. More...
 
static bool _enable_print_counter = true
 Flag to control whether reference count information is printed when print_info is called. More...
 
static bool _enable_print_counter = true
 Flag to control whether reference count information is printed when print_info is called. More...
 

Detailed Description


The Pyramid18 is an element in 3D composed of 18 nodes, designed to interface with a QUAD9 element on the base and a TRI7 element on each of the triangular faces.

Cubit will generate hybrid meshes with linear pyramids, but as of version 18 will not export quadratic pyramids. Paraview may support 13-node pyramids, but does not render 18-node pyramids correctly. So even if this element works in libmesh, we are currently limited in what we can do with it outside the library...

The node numbering for the pyramid18 is given below:

*   PYRAMID18:
*                       o 4
*                     //|\
*                    // | \
*                   //  |  \
*                  //   |   \
*              12 o/    |    o 11
*                //     |     \
*               /o 9    o 10   \
*              //       |       \          zeta
*             //        |        \          ^   eta (into page)
*          3 o/.......o.|........o 2        | /
*           ./       7  |       /           |/
*          ./           |      /            o---> xi
*         ./            |     /
*        ./             |    /
*     8 o/       o      |   o 6
*      ./        13     |  /
*     ./                | /
*    ./                 |/
*    o--------o---------o
*    0        5         1
* 

And it also includes four triangle face nodes: Node 14, centroid on side 0, arithmetic mean of 0/1/4 or 5/9/10 Node 15, centroid on side 1, arithmetic mean of 1/2/4 or 6/10/11 Node 16, centroid on side 2, arithmetic mean of 2/3/4 or 7/11/12 Node 17, centroid on side 3, arithmetic mean of 0/3/4 or 8/9/12

(xi, eta, zeta): { zeta-1 <= xi <= 1-zeta { zeta-1 <= eta <= 1-zeta { 0 <= zeta <= 1 are the reference element coordinates associated with the given numbering.

Author
Roy H. Stogner
Date
2022 A 3D pyramid element with 18 nodes.

Definition at line 82 of file cell_pyramid18.h.

Member Typedef Documentation

◆ ConstNeighborPtrIter

typedef const Elem* const* libMesh::Elem::ConstNeighborPtrIter
inherited

Definition at line 334 of file elem.h.

◆ Counts [1/2]

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts
protectedinherited

Data structure to log the information.

The log is identified by the class name.

Definition at line 119 of file reference_counter.h.

◆ Counts [2/2]

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts
protectedinherited

Data structure to log the information.

The log is identified by the class name.

Definition at line 119 of file reference_counter.h.

◆ NeighborPtrIter

typedef Elem* const* libMesh::Elem::NeighborPtrIter
inherited

Nested "classes" for use iterating over all neighbors of an element.

Definition at line 333 of file elem.h.

◆ Predicate

Useful iterator typedefs.

Definition at line 1841 of file elem.h.

Member Enumeration Documentation

◆ RefinementState

Enumeration of possible element refinement states.

Enumerator
COARSEN 
DO_NOTHING 
REFINE 
JUST_REFINED 
JUST_COARSENED 
INACTIVE 
COARSEN_INACTIVE 
INVALID_REFINEMENTSTATE 

Definition at line 1433 of file elem.h.

Constructor & Destructor Documentation

◆ Pyramid18() [1/3]

libMesh::Pyramid18::Pyramid18 ( Elem p = nullptr)
inlineexplicit

Constructor.

By default this element has no parent.

Definition at line 90 of file cell_pyramid18.h.

90  :
92  {}
static const int num_nodes
Geometric constants for Pyramid18.
Pyramid(const unsigned int nn, Elem *p, Node **nodelinkdata)
Default pyramid, one quad face, four triangular faces, takes number of nodes and parent.
Definition: cell_pyramid.h:48
Node * _nodelinks_data[num_nodes]
Data for links to nodes.

◆ Pyramid18() [2/3]

libMesh::Pyramid18::Pyramid18 ( Pyramid18 &&  )
delete

◆ Pyramid18() [3/3]

libMesh::Pyramid18::Pyramid18 ( const Pyramid18 )
delete

◆ ~Pyramid18()

virtual libMesh::Pyramid18::~Pyramid18 ( )
virtualdefault

Member Function Documentation

◆ _get_bracketing_node_cache()

virtual std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char> > > > >& libMesh::Elem::_get_bracketing_node_cache ( ) const
inlineprotectedvirtualinherited

Elem subclasses which don't do their own bracketing node calculations will need to supply a static cache, since the default calculation is slow.

Definition at line 2191 of file elem.h.

Referenced by libMesh::Elem::parent_bracketing_nodes().

2192  {
2193  static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> c;
2194  libmesh_error();
2195  return c;
2196  }

◆ _get_parent_indices_cache()

virtual std::vector<std::vector<std::vector<signed char> > >& libMesh::Elem::_get_parent_indices_cache ( ) const
inlineprotectedvirtualinherited

Elem subclasses which don't do their own child-to-parent node calculations will need to supply a static cache, since the default calculation is slow.

Definition at line 2205 of file elem.h.

Referenced by libMesh::Elem::as_parent_node().

2206  {
2207  static std::vector<std::vector<std::vector<signed char>>> c;
2208  libmesh_error();
2209  return c;
2210  }

◆ active()

bool libMesh::Elem::active ( ) const
inlineinherited
Returns
true if the element is active (i.e. has no active descendants) or AMR is disabled, false otherwise.
Note
It suffices to check the first child only.

Definition at line 2938 of file elem.h.

References libMesh::Elem::COARSEN_INACTIVE, libMesh::Elem::INACTIVE, and libMesh::Elem::refinement_flag().

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::HPCoarsenTest::add_projection(), libMesh::Elem::ancestor(), assemble_ellipticdg(), libMesh::Patch::build_around_element(), libMesh::Elem::coarsen(), compute_jacobian(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), compute_residual(), libMesh::Elem::contract(), libMesh::DofMap::dof_indices(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), libMesh::Elem::get_info(), libMesh::ErrorVector::is_active_elem(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_local(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::max_descendant_p_level(), libMesh::DofMap::merge_ghost_functor_outputs(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::PointLocatorTree::operator()(), libMesh::EquationSystems::redundant_added_side(), libMesh::Elem::refine(), libMesh::Elem::subactive(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::MeshRefinement::test_level_one(), EquationSystemsTest::testRefineThenReinitPreserveFlags(), and libMesh::BoundaryInfo::transfer_boundary_ids_from_children().

2939 {
2940 #ifdef LIBMESH_ENABLE_AMR
2941  if ((this->refinement_flag() == INACTIVE) ||
2942  (this->refinement_flag() == COARSEN_INACTIVE))
2943  return false;
2944  else
2945  return true;
2946 #else
2947  return true;
2948 #endif
2949 }
RefinementState refinement_flag() const
Definition: elem.h:3207

◆ active_family_tree() [1/2]

void libMesh::Elem::active_family_tree ( std::vector< const Elem *> &  active_family,
bool  reset = true 
) const
inherited

Same as the family_tree() member, but only adds the active children.

Can be thought of as removing all the inactive elements from the vector created by family_tree, but is implemented more efficiently.

Definition at line 2136 of file elem.C.

References libMesh::ElemInternal::active_family_tree().

Referenced by libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::merge_ghost_functor_outputs(), and libMesh::SiblingCoupling::operator()().

2138 {
2139  ElemInternal::active_family_tree(this, active_family, reset);
2140 }
void active_family_tree(T elem, std::vector< T > &active_family, bool reset=true)
Definition: elem_internal.h:90

◆ active_family_tree() [2/2]

void libMesh::Elem::active_family_tree ( std::vector< Elem *> &  active_family,
bool  reset = true 
)
inherited

Non-const version of function above; fills a vector of non-const pointers.

Definition at line 2144 of file elem.C.

References libMesh::ElemInternal::active_family_tree().

2146 {
2147  ElemInternal::active_family_tree(this, active_family, reset);
2148 }
void active_family_tree(T elem, std::vector< T > &active_family, bool reset=true)
Definition: elem_internal.h:90

◆ active_family_tree_by_neighbor() [1/2]

void libMesh::Elem::active_family_tree_by_neighbor ( std::vector< const Elem *> &  family,
const Elem neighbor,
bool  reset = true 
) const
inherited

Same as the active_family_tree() member, but only adds elements which are next to neighbor.

Definition at line 2264 of file elem.C.

References libMesh::ElemInternal::active_family_tree_by_neighbor().

Referenced by libMesh::DefaultCoupling::operator()().

2267 {
2268  ElemInternal::active_family_tree_by_neighbor(this, family, neighbor, reset);
2269 }
void active_family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)

◆ active_family_tree_by_neighbor() [2/2]

void libMesh::Elem::active_family_tree_by_neighbor ( std::vector< Elem *> &  family,
Elem neighbor,
bool  reset = true 
)
inherited

Non-const version of function above; fills a vector of non-const pointers.

Definition at line 2273 of file elem.C.

References libMesh::ElemInternal::active_family_tree_by_neighbor().

2276 {
2277  ElemInternal::active_family_tree_by_neighbor(this, family, neighbor, reset);
2278 }
void active_family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)

◆ active_family_tree_by_side() [1/2]

void libMesh::Elem::active_family_tree_by_side ( std::vector< const Elem *> &  family,
unsigned int  side,
bool  reset = true 
) const
inherited

Same as the active_family_tree() member, but only adds elements which are next to side.

Definition at line 2170 of file elem.C.

References libMesh::ElemInternal::active_family_tree_by_side().

Referenced by libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::Nemesis_IO_Helper::write_sidesets(), and libMesh::ExodusII_IO_Helper::write_sidesets().

2173 {
2174  ElemInternal::active_family_tree_by_side(this, family, side, reset);
2175 }
void active_family_tree_by_side(T elem, std::vector< T > &family, unsigned int side, bool reset=true)

◆ active_family_tree_by_side() [2/2]

void libMesh::Elem::active_family_tree_by_side ( std::vector< Elem *> &  family,
unsigned int  side,
bool  reset = true 
)
inherited

Non-const version of function above; fills a vector of non-const pointers.

Definition at line 2179 of file elem.C.

References libMesh::ElemInternal::active_family_tree_by_side().

2182 {
2183  ElemInternal::active_family_tree_by_side(this, family, side, reset);
2184 }
void active_family_tree_by_side(T elem, std::vector< T > &family, unsigned int side, bool reset=true)

◆ active_family_tree_by_topological_neighbor() [1/2]

void libMesh::Elem::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
inherited

Same as the active_family_tree_by_neighbor() member, but the neighbor here may be a topological (e.g.

periodic boundary condition) neighbor, not just a local neighbor.

Definition at line 2282 of file elem.C.

References libMesh::ElemInternal::active_family_tree_by_topological_neighbor(), and mesh.

Referenced by libMesh::GhostPointNeighbors::operator()(), and libMesh::DefaultCoupling::operator()().

2288 {
2290  mesh, point_locator, pb,
2291  reset);
2292 }
MeshBase & mesh
void active_family_tree_by_topological_neighbor(T elem, std::vector< T > &family, T neighbor_in, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb, bool reset=true)

◆ active_family_tree_by_topological_neighbor() [2/2]

void libMesh::Elem::active_family_tree_by_topological_neighbor ( std::vector< Elem *> &  family,
Elem neighbor,
const MeshBase mesh,
const PointLocatorBase point_locator,
const PeriodicBoundaries pb,
bool  reset = true 
)
inherited

Non-const version of function above; fills a vector of non-const pointers.

Definition at line 2296 of file elem.C.

References libMesh::ElemInternal::active_family_tree_by_topological_neighbor(), and mesh.

2302 {
2304  mesh, point_locator, pb,
2305  reset);
2306 }
MeshBase & mesh
void active_family_tree_by_topological_neighbor(T elem, std::vector< T > &family, T neighbor_in, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb, bool reset=true)

◆ add_child() [1/2]

void libMesh::Elem::add_child ( Elem elem)
inherited

Adds a child pointer to the array of children of this element.

If this is the first child to be added, this method allocates memory in the parent's _children array, otherwise, it just sets the pointer.

Definition at line 2047 of file elem.C.

References libMesh::Elem::_children, libMesh::Elem::n_children(), libMesh::Elem::parent(), libMesh::remote_elem, and libMesh::Elem::set_child().

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::CheckpointIO::read_connectivity(), and libMesh::CheckpointIO::read_remote_elem().

2048 {
2049  const unsigned int nc = this->n_children();
2050 
2051  if (!_children)
2052  {
2053  _children = std::make_unique<Elem *[]>(nc);
2054 
2055  for (unsigned int c = 0; c != nc; c++)
2056  this->set_child(c, nullptr);
2057  }
2058 
2059  for (unsigned int c = 0; c != nc; c++)
2060  {
2061  if (this->_children[c] == nullptr || this->_children[c] == remote_elem)
2062  {
2063  libmesh_assert_equal_to (this, elem->parent());
2064  this->set_child(c, elem);
2065  return;
2066  }
2067  }
2068 
2069  libmesh_error_msg("Error: Tried to add a child to an element with full children array");
2070 }
virtual unsigned int n_children() const =0
void set_child(unsigned int c, Elem *elem)
Sets the pointer to the child for this element.
Definition: elem.h:3179
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2243
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ add_child() [2/2]

void libMesh::Elem::add_child ( Elem elem,
unsigned int  c 
)
inherited

Adds a new child pointer to the specified index in the array of children of this element.

If this is the first child to be added, this method allocates memory in the parent's _children array, otherwise, it just sets the pointer.

Definition at line 2074 of file elem.C.

References libMesh::Elem::_children, libMesh::Elem::child_ptr(), libMesh::Elem::has_children(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::Elem::parent(), libMesh::remote_elem, and libMesh::Elem::set_child().

2075 {
2076  if (!this->has_children())
2077  {
2078  const unsigned int nc = this->n_children();
2079  _children = std::make_unique<Elem *[]>(nc);
2080 
2081  for (unsigned int i = 0; i != nc; i++)
2082  this->set_child(i, nullptr);
2083  }
2084 
2085  libmesh_assert (this->_children[c] == nullptr || this->child_ptr(c) == remote_elem);
2086  libmesh_assert (elem == remote_elem || this == elem->parent());
2087 
2088  this->set_child(c, elem);
2089 }
const Elem * parent() const
Definition: elem.h:3027
virtual unsigned int n_children() const =0
libmesh_assert(ctx)
void set_child(unsigned int c, Elem *elem)
Sets the pointer to the child for this element.
Definition: elem.h:3179
bool has_children() const
Definition: elem.h:2976
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2243
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:3160
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ add_extra_integers() [1/2]

void libMesh::DofObject::add_extra_integers ( const unsigned int  n_integers)
inherited

Assigns a set of extra integers to this DofObject.

There will now be n_integers associated; this replaces, not augments, any previous count.

Any newly-added values will initially be DofObject::invalid_id

If non-integer data is in the set, each datum of type T should be counted sizeof(T)/sizeof(dof_id_type) times in n_integers.

Definition at line 490 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::invalid_id, and libMesh::DofObject::n_extra_integers().

Referenced by libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::DofObject::add_extra_integers(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::UnstructuredMesh::create_submesh(), libMesh::ReplicatedMesh::insert_elem(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_node(), DofObjectTest< Node >::testAddExtraData(), DofObjectTest< Node >::testAddSystemExtraInts(), DofObjectTest< Node >::testSetNSystemsExtraInts(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

491 {
492  if (_idx_buf.empty())
493  {
494  if (n_integers)
495  {
496  _idx_buf.resize(n_integers+1, DofObject::invalid_id);
497  _idx_buf[0] = dof_id_type(-1);
498  }
499  return;
500  }
501  else
502  {
503  const int hdr = dof_id_signed_type(_idx_buf[0]);
504 
505  // We already have some extra integers, but may need more or
506  // less now.
507  if (hdr < 0)
508  {
509  const unsigned int old_n_integers = this->n_extra_integers();
510  if (n_integers != old_n_integers)
511  {
512  // Make or remove space as needed by count change
513  _idx_buf.resize(_idx_buf.size()+n_integers-old_n_integers, DofObject::invalid_id);
514 
515  // The start index for the extra integers is unchanged.
516  }
517  }
518  else if (n_integers)
519  // We had no extra integers, but need to add some
520  {
521  // Mark the DofObject as holding extra integers
522  _idx_buf[0] = dof_id_type(-hdr-1);
523 
524  // Insert the integer start position
525  DofObject::index_buffer_t::iterator it = _idx_buf.begin() + hdr;
526  _idx_buf.insert(it, _idx_buf.size()+1);
527 
528  // Increment the previous system start positions to account
529  // for the new header entry creating an offset
530  for (int i=1; i<hdr; i++)
531  _idx_buf[i]++;
532 
533  // Append space for extra integers
534  _idx_buf.resize(_idx_buf.size()+n_integers, DofObject::invalid_id);
535  }
536  }
537 }
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482
int8_t dof_id_signed_type
Definition: id_types.h:68
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1170
index_buffer_t _idx_buf
Definition: dof_object.h:680
uint8_t dof_id_type
Definition: id_types.h:67

◆ add_extra_integers() [2/2]

void libMesh::DofObject::add_extra_integers ( const unsigned int  n_integers,
const std::vector< dof_id_type > &  default_values 
)
inherited

Assigns a set of extra integers to this DofObject.

There will now be n_integers associated; this replaces, not augments, any previous count.

Any newly-added values will be copied from default_values.

If non-integer data is in the set, each datum of type T should be counted sizeof(T)/sizeof(dof_id_type) times in n_integers, and its data should be expressed in default_values as per memcpy.

Definition at line 542 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::add_extra_integers(), and libMesh::DofObject::n_extra_integers().

544 {
545  libmesh_assert_equal_to(n_integers, default_values.size());
546 
547  const unsigned int n_old_integers = this->n_extra_integers();
548  this->add_extra_integers(n_integers);
549  if (n_integers > n_old_integers)
550  {
551  const unsigned int n_more_integers = n_integers - n_old_integers;
552  std::copy(default_values.begin()+n_old_integers,
553  default_values.end(),
554  _idx_buf.end()-n_more_integers);
555  }
556 }
void add_extra_integers(const unsigned int n_integers)
Assigns a set of extra integers to this DofObject.
Definition: dof_object.C:490
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1170
index_buffer_t _idx_buf
Definition: dof_object.h:680

◆ add_system()

void libMesh::DofObject::add_system ( )
inherited

Adds an additional system to the DofObject.

Definition at line 195 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::has_extra_integers(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), and libMesh::DofObject::set_n_systems().

Referenced by DofObjectTest< Node >::testAddSystemExtraInts().

196 {
197  // quick return?
198  if (this->n_systems() == 0)
199  {
200  this->set_n_systems(1);
201  return;
202  }
203 
204  // cache this value before we screw it up!
205  const unsigned int ns_orig = this->n_systems();
206 
207  DofObject::index_buffer_t::iterator it = _idx_buf.begin() + ns_orig;
208 
209  // Create the entry for the new system indicating 0 variables.
210  //
211  // increment the number of systems and the offsets for each of
212  // the systems including the new one we just added.
213  if (this->has_extra_integers())
214  {
215  // this inserts the extra_integers' start position as the start
216  // position for the new system. We'll increment all those
217  // counts in one sweep next, to account for header expansion.
218  _idx_buf.insert(it, *it);
219 
220  _idx_buf[0]--;
221  for (unsigned int i=1; i<ns_orig+2; i++)
222  {
223  libmesh_assert_less(i, _idx_buf.size());
224  _idx_buf[i]++;
225  }
226  }
227  else
228  {
229  // this inserts the current vector size at the position for the
230  // new system
231  _idx_buf.insert(it, cast_int<dof_id_type>(_idx_buf.size()));
232 
233  for (unsigned int i=0; i<ns_orig+1; i++)
234  {
235  libmesh_assert_less(i, _idx_buf.size());
236  _idx_buf[i]++;
237  }
238  }
239 
240  libmesh_assert_equal_to (this->n_systems(), (ns_orig+1));
241  libmesh_assert_equal_to (this->n_vars(ns_orig), 0);
242  libmesh_assert_equal_to (this->n_var_groups(ns_orig), 0);
243 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:957
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:967
unsigned int n_systems() const
Definition: dof_object.h:937
bool has_extra_integers() const
Returns whether extra integers are associated to the DofObject.
Definition: dof_object.h:1188
void set_n_systems(const unsigned int s)
Sets the number of systems for this DofObject.
Definition: dof_object.C:150
index_buffer_t _idx_buf
Definition: dof_object.h:680

◆ ancestor()

bool libMesh::Elem::ancestor ( ) const
inherited
Returns
true if the element is an ancestor (i.e. has an active child or ancestor child), false otherwise or when AMR is disabled.

Definition at line 2013 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ref_range(), libMesh::Elem::has_children(), libMesh::libmesh_assert(), libMesh::remote_elem, and libMesh::Elem::subactive().

Referenced by libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), and libMesh::Elem::refine().

2014 {
2015 #ifdef LIBMESH_ENABLE_AMR
2016 
2017  // Use a fast, DistributedMesh-safe definition
2018  const bool is_ancestor =
2019  !this->active() && !this->subactive();
2020 
2021  // But check for inconsistencies if we have time
2022 #ifdef DEBUG
2023  if (!is_ancestor && this->has_children())
2024  {
2025  for (auto & c : this->child_ref_range())
2026  {
2027  if (&c != remote_elem)
2028  {
2029  libmesh_assert(!c.active());
2030  libmesh_assert(!c.ancestor());
2031  }
2032  }
2033  }
2034 #endif // DEBUG
2035 
2036  return is_ancestor;
2037 
2038 #else
2039  return false;
2040 #endif
2041 }
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:2328
libmesh_assert(ctx)
bool subactive() const
Definition: elem.h:2956
bool active() const
Definition: elem.h:2938
bool has_children() const
Definition: elem.h:2976
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ as_parent_node()

unsigned int libMesh::Elem::as_parent_node ( unsigned int  c,
unsigned int  n 
) const
virtualinherited
Returns
The local node id on the parent which corresponds to node n of child c, or invalid_uint if no such parent node exists.

Definition at line 2389 of file elem.C.

References libMesh::Elem::_get_parent_indices_cache(), libMesh::Elem::embedding_matrix(), libMesh::Elem::embedding_matrix_version(), libMesh::invalid_uint, libMesh::Elem::n_children(), libMesh::Elem::n_nodes(), libMesh::Elem::n_nodes_in_child(), libMesh::parent_indices_mutex, and libMesh::Real.

Referenced by libMesh::MeshRefinement::add_node(), and libMesh::Elem::parent_bracketing_nodes().

2391 {
2392  const unsigned int nc = this->n_children();
2393  libmesh_assert_less(child, nc);
2394 
2395  // Cached return values, indexed first by embedding_matrix version,
2396  // then by child number, then by child node number.
2397  std::vector<std::vector<std::vector<signed char>>> &
2398  cached_parent_indices = this->_get_parent_indices_cache();
2399 
2400  unsigned int em_vers = this->embedding_matrix_version();
2401 
2402  // We may be updating the cache on one thread, and while that
2403  // happens we can't safely access the cache from other threads.
2404  Threads::spin_mutex::scoped_lock lock(parent_indices_mutex);
2405 
2406  if (em_vers >= cached_parent_indices.size())
2407  cached_parent_indices.resize(em_vers+1);
2408 
2409  if (child >= cached_parent_indices[em_vers].size())
2410  {
2411  const signed char nn = cast_int<signed char>(this->n_nodes());
2412 
2413  cached_parent_indices[em_vers].resize(nc);
2414 
2415  for (unsigned int c = 0; c != nc; ++c)
2416  {
2417  const unsigned int ncn = this->n_nodes_in_child(c);
2418  cached_parent_indices[em_vers][c].resize(ncn);
2419  for (unsigned int cn = 0; cn != ncn; ++cn)
2420  {
2421  for (signed char n = 0; n != nn; ++n)
2422  {
2423  const Real em_val = this->embedding_matrix
2424  (c, cn, n);
2425  if (em_val == 1)
2426  {
2427  cached_parent_indices[em_vers][c][cn] = n;
2428  break;
2429  }
2430 
2431  if (em_val != 0)
2432  {
2433  cached_parent_indices[em_vers][c][cn] =
2434  -1;
2435  break;
2436  }
2437 
2438  // We should never see an all-zero embedding matrix
2439  // row
2440  libmesh_assert_not_equal_to (n+1, nn);
2441  }
2442  }
2443  }
2444  }
2445 
2446  const signed char cache_val =
2447  cached_parent_indices[em_vers][child][child_node];
2448  if (cache_val == -1)
2449  return libMesh::invalid_uint;
2450 
2451  return cached_parent_indices[em_vers][child][child_node];
2452 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:310
virtual unsigned int embedding_matrix_version() const
Definition: elem.h:2032
Threads::spin_mutex parent_indices_mutex
Definition: elem.C:97
virtual unsigned int n_children() const =0
virtual Real embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
virtual std::vector< std::vector< std::vector< signed char > > > & _get_parent_indices_cache() const
Elem subclasses which don&#39;t do their own child-to-parent node calculations will need to supply a stat...
Definition: elem.h:2205
virtual unsigned int n_nodes() const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:674

◆ boundary_sides_begin()

Elem::side_iterator libMesh::Elem::boundary_sides_begin ( )
inherited

Iterator accessor functions.

Definition at line 3414 of file elem.C.

References libMesh::Elem::_first_side(), and libMesh::Elem::_last_side().

3415 {
3416  Predicates::BoundarySide<SideIter> bsp;
3417  return side_iterator(this->_first_side(), this->_last_side(), bsp);
3418 }
SideIter _last_side()
Definition: elem.h:3461
SideIter _first_side()
Side iterator helper functions.
Definition: elem.h:3453

◆ boundary_sides_end()

Elem::side_iterator libMesh::Elem::boundary_sides_end ( )
inherited

Definition at line 3423 of file elem.C.

References libMesh::Elem::_last_side().

3424 {
3425  Predicates::BoundarySide<SideIter> bsp;
3426  return side_iterator(this->_last_side(), this->_last_side(), bsp);
3427 }
SideIter _last_side()
Definition: elem.h:3461

◆ bracketing_nodes()

const std::vector< std::pair< dof_id_type, dof_id_type > > libMesh::Elem::bracketing_nodes ( unsigned int  c,
unsigned int  n 
) const
virtualinherited
Returns
All the pairs of nodes (indexed by global node id) which should bracket node n of child c.

Definition at line 2660 of file elem.C.

References libMesh::Elem::build(), libMesh::Elem::child_ptr(), libMesh::Elem::default_order(), libMesh::FIRST, libMesh::HEX20, libMesh::DofObject::invalid_id, libMesh::make_range(), libMesh::Elem::n_nodes(), libMesh::Elem::n_nodes_in_child(), libMesh::Elem::node_id(), libMesh::Elem::parent_bracketing_nodes(), libMesh::Elem::second_order_equivalent_type(), and libMesh::Elem::type().

Referenced by libMesh::MeshRefinement::add_node(), and libMesh::TopologyMap::fill().

2662 {
2663  std::vector<std::pair<dof_id_type, dof_id_type>> returnval;
2664 
2665  const std::vector<std::pair<unsigned char, unsigned char>> & pbc =
2666  this->parent_bracketing_nodes(child,child_node);
2667 
2668  for (const auto & pb : pbc)
2669  {
2670  const unsigned short n_n = this->n_nodes();
2671  if (pb.first < n_n && pb.second < n_n)
2672  returnval.emplace_back(this->node_id(pb.first), this->node_id(pb.second));
2673  else
2674  {
2675  // We must be on a non-full-order higher order element...
2676  libmesh_assert_not_equal_to(this->default_order(), FIRST);
2677  libmesh_assert_not_equal_to
2678  (second_order_equivalent_type (this->type(), true),
2679  this->type());
2680  libmesh_assert_equal_to
2681  (second_order_equivalent_type (this->type(), false),
2682  this->type());
2683 
2684  // And that's a shame, because this is a nasty search:
2685 
2686  // Build the full-order type
2687  ElemType full_type =
2688  second_order_equivalent_type(this->type(), /*full_ordered=*/ true);
2689  std::unique_ptr<Elem> full_elem = Elem::build(full_type);
2690 
2693 
2694  // Find the bracketing nodes by figuring out what
2695  // already-created children will have them.
2696 
2697  // This only doesn't break horribly because we add children
2698  // and nodes in straightforward + hierarchical orders...
2699  for (unsigned int c=0; c <= child; ++c)
2700  for (auto n : make_range(this->n_nodes_in_child(c)))
2701  {
2702  if (c == child && n == child_node)
2703  break;
2704 
2705  if (pb.first == full_elem->as_parent_node(c,n))
2706  {
2707  // We should be consistent
2708  if (pt1 != DofObject::invalid_id)
2709  libmesh_assert_equal_to(pt1, this->child_ptr(c)->node_id(n));
2710 
2711  pt1 = this->child_ptr(c)->node_id(n);
2712  }
2713 
2714  if (pb.second == full_elem->as_parent_node(c,n))
2715  {
2716  // We should be consistent
2717  if (pt2 != DofObject::invalid_id)
2718  libmesh_assert_equal_to(pt2, this->child_ptr(c)->node_id(n));
2719 
2720  pt2 = this->child_ptr(c)->node_id(n);
2721  }
2722  }
2723 
2724  // We should *usually* find all bracketing nodes by the time
2725  // we query them (again, because of the child & node add
2726  // order)
2727  //
2728  // The exception is if we're a HEX20, in which case we will
2729  // find pairs of vertex nodes and edge nodes bracketing the
2730  // new central node but we *won't* find the pairs of face
2731  // nodes which we would have had on a HEX27. In that case
2732  // we'll still have enough bracketing nodes for a
2733  // topological lookup, but we won't be able to make the
2734  // following assertions.
2735  if (this->type() != HEX20)
2736  {
2737  libmesh_assert_not_equal_to (pt1, DofObject::invalid_id);
2738  libmesh_assert_not_equal_to (pt2, DofObject::invalid_id);
2739  }
2740 
2741  if (pt1 != DofObject::invalid_id &&
2742  pt2 != DofObject::invalid_id)
2743  returnval.emplace_back(pt1, pt2);
2744  }
2745  }
2746 
2747  return returnval;
2748 }
ElemType
Defines an enum for geometric element types.
virtual unsigned int n_nodes() const =0
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition: elem.C:447
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
Definition: elem.C:3138
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...
Definition: int_range.h:140
virtual Order default_order() const =0
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes(unsigned int c, unsigned int n) const
Definition: elem.C:2457
virtual ElemType type() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2444
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:674
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:3160
uint8_t dof_id_type
Definition: id_types.h:67

◆ build()

std::unique_ptr< Elem > libMesh::Elem::build ( const ElemType  type,
Elem p = nullptr 
)
staticinherited
Returns
An Elem of type type wrapped in a smart pointer.

Definition at line 447 of file elem.C.

References libMesh::C0POLYGON, libMesh::C0POLYHEDRON, libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::Utility::enum_to_string(), libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::INFEDGE2, libMesh::INFHEX16, libMesh::INFHEX18, libMesh::INFHEX8, libMesh::INFPRISM12, libMesh::INFPRISM6, libMesh::INFQUAD4, libMesh::INFQUAD6, libMesh::NODEELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM20, libMesh::PRISM21, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID18, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::QUADSHELL9, libMesh::TET10, libMesh::TET14, libMesh::TET4, libMesh::TRI3, libMesh::TRI3SUBDIVISION, libMesh::TRI6, libMesh::TRI7, libMesh::TRISHELL3, and libMesh::Elem::type().

Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), add_cube_convex_hull_to_mesh(), libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Modification::all_tri(), AllSecondOrderTest::allCompleteOrderMixed(), AllSecondOrderTest::allCompleteOrderRange(), AllSecondOrderTest::allSecondOrderMixed(), AllSecondOrderTest::allSecondOrderRange(), libMesh::Elem::bracketing_nodes(), libMesh::MeshTools::Generation::build_cube(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::InfElemBuilder::build_inf_elem(), MixedDimensionMeshTest::build_mesh(), ExtraIntegersTest::build_mesh(), MeshfunctionDFEM::build_mesh(), MixedDimensionNonUniformRefinement::build_mesh(), MixedDimensionNonUniformRefinementTriangle::build_mesh(), MixedDimensionNonUniformRefinement3D::build_mesh(), libMesh::Elem::build_with_id(), VolumeTest::construct_elem(), ContainsPointTest::containsPointTri3Helper(), libMesh::MeshBase::copy_constraint_rows(), libMesh::TriangleWrapper::copy_tri_to_mesh(), libMesh::Elem::disconnected_clone(), libMesh::UNVIO::elements_in(), libMesh::MeshTools::Modification::flatten(), libMesh::ExodusII_IO_Helper::init_conversion_map(), main(), libMesh::Elem::parent_bracketing_nodes(), libMesh::TetGenMeshInterface::pointset_convexhull(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::VTKIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::ExodusII_IO_Helper::read_edge_blocks(), libMesh::AbaqusIO::read_elements(), libMesh::UCDIO::read_implementation(), libMesh::DynaIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::OFFIO::read_stream(), libMesh::Elem::refine(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::C0Polyhedron::retriangulate(), PerElemTest< elem_type >::setUp(), RationalMapTest< elem_type >::setUp(), libMesh::MeshTools::Generation::surface_octahedron(), ContainsPointTest::testContainsPointNodeElem(), ContainsPointTest::testContainsPointTet4(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), SystemsTest::testDofCouplingWithVarGroups(), DofMapTest::testDofOwner(), MeshTriangulationTest::testEdgesMesh(), MeshTriangulationTest::testHalfDomain(), QuadratureTest::testNodalQuadrature(), MeshTriangulationTest::testPoly2TriBad1DMultiBoundary(), MeshTriangulationTest::testPoly2TriBad2DMultiBoundary(), MeshTriangulationTest::testPoly2TriBadEdges(), QuadratureTest::testPolynomials(), EquationSystemsTest::testReinitWithNodeElem(), SystemsTest::testSetSystemParameterOverEquationSystem(), BoundaryInfoTest::testShellFaceConstraints(), MeshTetTest::testTetsToTets(), MeshSubdomainIDTest::testUnpartitioned(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), libMesh::TetGenMeshInterface::triangulate_pointset(), and libMesh::GMVIO::write_ascii_old_impl().

449 {
450  switch (type)
451  {
452  // 0D elements
453  case NODEELEM:
454  return std::make_unique<NodeElem>(p);
455 
456  // 1D elements
457  case EDGE2:
458  return std::make_unique<Edge2>(p);
459  case EDGE3:
460  return std::make_unique<Edge3>(p);
461  case EDGE4:
462  return std::make_unique<Edge4>(p);
463 
464  // 2D elements
465  case TRI3:
466  return std::make_unique<Tri3>(p);
467  case TRISHELL3:
468  return std::make_unique<TriShell3>(p);
469  case TRI3SUBDIVISION:
470  return std::make_unique<Tri3Subdivision>(p);
471  case TRI6:
472  return std::make_unique<Tri6>(p);
473  case TRI7:
474  return std::make_unique<Tri7>(p);
475  case QUAD4:
476  return std::make_unique<Quad4>(p);
477  case QUADSHELL4:
478  return std::make_unique<QuadShell4>(p);
479  case QUAD8:
480  return std::make_unique<Quad8>(p);
481  case QUADSHELL8:
482  return std::make_unique<QuadShell8>(p);
483  case QUAD9:
484  return std::make_unique<Quad9>(p);
485  case QUADSHELL9:
486  return std::make_unique<QuadShell9>(p);
487 
488  // Well, a hexagon is *a* polygon...
489  case C0POLYGON:
490  return std::make_unique<C0Polygon>(6, p);
491 
492  // Building a polyhedron can't currently be done without creating
493  // its nodes first
494  case C0POLYHEDRON:
495  libmesh_not_implemented_msg
496  ("Polyhedra cannot be built via Elem::build()");
497 
498  // 3D elements
499  case TET4:
500  return std::make_unique<Tet4>(p);
501  case TET10:
502  return std::make_unique<Tet10>(p);
503  case TET14:
504  return std::make_unique<Tet14>(p);
505  case HEX8:
506  return std::make_unique<Hex8>(p);
507  case HEX20:
508  return std::make_unique<Hex20>(p);
509  case HEX27:
510  return std::make_unique<Hex27>(p);
511  case PRISM6:
512  return std::make_unique<Prism6>(p);
513  case PRISM15:
514  return std::make_unique<Prism15>(p);
515  case PRISM18:
516  return std::make_unique<Prism18>(p);
517  case PRISM20:
518  return std::make_unique<Prism20>(p);
519  case PRISM21:
520  return std::make_unique<Prism21>(p);
521  case PYRAMID5:
522  return std::make_unique<Pyramid5>(p);
523  case PYRAMID13:
524  return std::make_unique<Pyramid13>(p);
525  case PYRAMID14:
526  return std::make_unique<Pyramid14>(p);
527  case PYRAMID18:
528  return std::make_unique<Pyramid18>(p);
529 
530 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
531  // 1D infinite elements
532  case INFEDGE2:
533  return std::make_unique<InfEdge2>(p);
534 
535  // 2D infinite elements
536  case INFQUAD4:
537  return std::make_unique<InfQuad4>(p);
538  case INFQUAD6:
539  return std::make_unique<InfQuad6>(p);
540 
541  // 3D infinite elements
542  case INFHEX8:
543  return std::make_unique<InfHex8>(p);
544  case INFHEX16:
545  return std::make_unique<InfHex16>(p);
546  case INFHEX18:
547  return std::make_unique<InfHex18>(p);
548  case INFPRISM6:
549  return std::make_unique<InfPrism6>(p);
550  case INFPRISM12:
551  return std::make_unique<InfPrism12>(p);
552 #endif
553 
554  default:
555  libmesh_error_msg("ERROR: Undefined element type == " << Utility::enum_to_string(type));
556  }
557 }
std::string enum_to_string(const T e)
virtual ElemType type() const =0

◆ build_edge_ptr() [1/4]

std::unique_ptr< Elem > libMesh::Pyramid18::build_edge_ptr ( const unsigned int  i)
overridevirtual

Builds a EDGE3 coincident with edge i.

The std::unique_ptr<Elem> handles the memory aspect.

Implements libMesh::Elem.

Definition at line 312 of file cell_pyramid18.C.

313 {
314  return this->simple_build_edge_ptr<Edge3,Pyramid18>(i);
315 }

◆ build_edge_ptr() [2/4]

void libMesh::Pyramid18::build_edge_ptr ( std::unique_ptr< Elem > &  edge,
const unsigned int  i 
)
overridevirtual

Rebuilds a EDGE3 coincident with edge i.

Implements libMesh::Elem.

Definition at line 319 of file cell_pyramid18.C.

References libMesh::EDGE3.

320 {
321  this->simple_build_edge_ptr<Pyramid18>(edge, i, EDGE3);
322 }

◆ build_edge_ptr() [3/4]

std::unique_ptr< const Elem > libMesh::Elem::build_edge_ptr ( const unsigned int  i) const
inlineinherited

Definition at line 2828 of file elem.h.

References libMesh::Elem::build_edge_ptr().

2829 {
2830  // Call the non-const version of this function, return the result as
2831  // a std::unique_ptr<const Elem>.
2832  Elem * me = const_cast<Elem *>(this);
2833  const Elem * e = const_cast<const Elem *>(me->build_edge_ptr(i).release());
2834  return std::unique_ptr<const Elem>(e);
2835 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360

◆ build_edge_ptr() [4/4]

void libMesh::Elem::build_edge_ptr ( std::unique_ptr< const Elem > &  edge,
const unsigned int  i 
) const
inlineinherited

Definition at line 2841 of file elem.h.

References libMesh::Elem::build_edge_ptr().

2843 {
2844  // Hand off to the non-const version of this function
2845  Elem * me = const_cast<Elem *>(this);
2846  std::unique_ptr<Elem> e {const_cast<Elem *>(elem.release())};
2847  me->build_edge_ptr(e, i);
2848  elem = std::move(e);
2849 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360

◆ build_side_ptr() [1/4]

std::unique_ptr< Elem > libMesh::Pyramid18::build_side_ptr ( const unsigned int  i,
bool  proxy = false 
)
overridevirtual

Builds a QUAD9 or TRI7 coincident with face i.

The std::unique_ptr<Elem> handles the memory aspect.

Implements libMesh::Elem.

Definition at line 193 of file cell_pyramid18.C.

References libMesh::Elem::mapping_type(), libMesh::Pyramid::n_sides(), libMesh::Elem::p_level(), side_nodes_map, and libMesh::Elem::subdomain_id().

Referenced by build_side_ptr().

194 {
195  libmesh_assert_less (i, this->n_sides());
196 
197  std::unique_ptr<Elem> face;
198  if (proxy)
199  {
200 #ifdef LIBMESH_ENABLE_DEPRECATED
201  libmesh_deprecated();
202  switch (i)
203  {
204  case 0:
205  case 1:
206  case 2:
207  case 3:
208  {
209  face = std::make_unique<Side<Tri7,Pyramid18>>(this,i);
210  break;
211  }
212 
213  case 4:
214  {
215  face = std::make_unique<Side<Quad9,Pyramid18>>(this,i);
216  break;
217  }
218 
219  default:
220  libmesh_error_msg("Invalid side i = " << i);
221  }
222 #else
223  libmesh_error();
224 #endif // LIBMESH_ENABLE_DEPRECATED
225  }
226 
227  else
228  {
229  switch (i)
230  {
231  case 0: // triangular face 1
232  case 1: // triangular face 2
233  case 2: // triangular face 3
234  case 3: // triangular face 4
235  {
236  face = std::make_unique<Tri7>();
237  break;
238  }
239  case 4: // the quad face at z=0
240  {
241  face = std::make_unique<Quad9>();
242  break;
243  }
244  default:
245  libmesh_error_msg("Invalid side i = " << i);
246  }
247 
248  // Set the nodes
249  for (auto n : face->node_index_range())
250  face->set_node(n, this->node_ptr(Pyramid18::side_nodes_map[i][n]));
251  }
252 
253 #ifdef LIBMESH_ENABLE_DEPRECATED
254  if (!proxy) // proxy sides used to leave parent() set
255 #endif
256  face->set_parent(nullptr);
257  face->set_interior_parent(this);
258 
259  face->subdomain_id() = this->subdomain_id();
260  face->set_mapping_type(this->mapping_type());
261 #ifdef LIBMESH_ENABLE_AMR
262  face->set_p_level(this->p_level());
263 #endif
264 
265  return face;
266 }
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
unsigned int p_level() const
Definition: elem.h:3105
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:90
ElemMappingType mapping_type() const
Definition: elem.h:3117
subdomain_id_type subdomain_id() const
Definition: elem.h:2551

◆ build_side_ptr() [2/4]

void libMesh::Pyramid18::build_side_ptr ( std::unique_ptr< Elem > &  elem,
const unsigned int  i 
)
overridevirtual

Rebuilds a QUAD9 or TRI7 built coincident with face i.

Implements libMesh::Elem.

Definition at line 270 of file cell_pyramid18.C.

References build_side_ptr(), libMesh::Elem::mapping_type(), libMesh::Pyramid::n_sides(), libMesh::QUAD9, side_nodes_map, libMesh::Elem::subdomain_id(), and libMesh::TRI7.

272 {
273  libmesh_assert_less (i, this->n_sides());
274 
275  switch (i)
276  {
277  case 0: // triangular face 1
278  case 1: // triangular face 2
279  case 2: // triangular face 3
280  case 3: // triangular face 4
281  {
282  if (!side.get() || side->type() != TRI7)
283  {
284  side = this->build_side_ptr(i, false);
285  return;
286  }
287  break;
288  }
289  case 4: // the quad face at z=0
290  {
291  if (!side.get() || side->type() != QUAD9)
292  {
293  side = this->build_side_ptr(i, false);
294  return;
295  }
296  break;
297  }
298  default:
299  libmesh_error_msg("Invalid side i = " << i);
300  }
301 
302  side->subdomain_id() = this->subdomain_id();
303  side->set_mapping_type(this->mapping_type());
304 
305  // Set the nodes
306  for (auto n : side->node_index_range())
307  side->set_node(n, this->node_ptr(Pyramid18::side_nodes_map[i][n]));
308 }
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:90
ElemMappingType mapping_type() const
Definition: elem.h:3117
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=false) override
Builds a QUAD9 or TRI7 coincident with face i.
subdomain_id_type subdomain_id() const
Definition: elem.h:2551

◆ build_side_ptr() [3/4]

std::unique_ptr< const Elem > libMesh::Elem::build_side_ptr ( const unsigned int  i,
bool  proxy = false 
) const
inlineinherited

Definition at line 2706 of file elem.h.

References libMesh::Elem::build_side_ptr().

2707 {
2708  // Call the non-const version of this function, return the result as
2709  // a std::unique_ptr<const Elem>.
2710  Elem * me = const_cast<Elem *>(this);
2711  const Elem * s = const_cast<const Elem *>(me->build_side_ptr(i, proxy).release());
2712  return std::unique_ptr<const Elem>(s);
2713 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360

◆ build_side_ptr() [4/4]

void libMesh::Elem::build_side_ptr ( std::unique_ptr< const Elem > &  side,
const unsigned int  i 
) const
inlineinherited

Definition at line 2719 of file elem.h.

References libMesh::Elem::build_side_ptr().

2721 {
2722  // Hand off to the non-const version of this function
2723  Elem * me = const_cast<Elem *>(this);
2724  std::unique_ptr<Elem> e {const_cast<Elem *>(elem.release())};
2725  me->build_side_ptr(e, i);
2726  elem = std::move(e);
2727 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360

◆ build_with_id()

std::unique_ptr< Elem > libMesh::Elem::build_with_id ( const ElemType  type,
dof_id_type  id 
)
staticinherited

Calls the build() method above with a nullptr parent, and additionally sets the newly-created Elem's id.

This can be useful when adding pre-numbered Elems to a Mesh via add_elem() calls.

Definition at line 561 of file elem.C.

References libMesh::Elem::build(), and libMesh::Elem::type().

Referenced by libMesh::MeshTools::Subdivision::all_subdivision(), libMesh::MeshTools::Generation::build_cube(), GetBoundaryPointsTest::build_mesh(), SlitMeshTest::build_mesh(), OverlappingTestBase::build_quad_mesh(), libMesh::TetGenIO::element_in(), libMesh::Poly2TriTriangulator::insert_refinement_points(), libMesh::GmshIO::read_mesh(), libMesh::MatlabIO::read_stream(), NodalNeighborsTest::testOrientation(), EquationSystemsTest::testPostInitAddElem(), SystemsTest::testProjectMatrix3D(), InfFERadialTest::testRefinement(), libMesh::NetGenMeshInterface::triangulate(), and libMesh::Poly2TriTriangulator::triangulate_current_points().

563 {
564  // Call the other build() method with nullptr parent, then set the
565  // required id.
566  auto temp = Elem::build(type, nullptr);
567  temp->set_id(id);
568  return temp;
569 }
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition: elem.C:447
virtual ElemType type() const =0

◆ center_node_on_side()

unsigned int libMesh::Pyramid18::center_node_on_side ( const unsigned short  side) const
finaloverridevirtual
Returns
The local index of the center node on the side side.

A center node is a node that is located at the centroid of the given side. If the given side does not have a center node, this will return invalid_uint.

Reimplemented from libMesh::Elem.

Definition at line 492 of file cell_pyramid18.C.

References libMesh::Pyramid::num_sides.

493 {
494  libmesh_assert_less (side, Pyramid18::num_sides);
495  return side == 4 ? 13 : side+14;
496 }
static const int num_sides
Geometric constants for all Pyramids.
Definition: cell_pyramid.h:77

◆ centroid()

Point libMesh::Elem::centroid ( ) const
virtualinherited

Calls Elem::vertex_average() for backwards compatibility.

Definition at line 581 of file elem.C.

References libMesh::err, and libMesh::Elem::vertex_average().

582 {
583  libmesh_do_once(libMesh::err
584  << "Elem::centroid() has been deprecated. Replace with either "
585  << "Elem::vertex_average() to maintain existing behavior, or "
586  << "the more expensive Elem::true_centroid() "
587  << "in cases where the true 'geometric' centroid is required."
588  << std::endl);
589  libmesh_deprecated();
590 
591  return Elem::vertex_average();
592 }
OStreamProxy err
Point vertex_average() const
Definition: elem.C:691

◆ child_neighbor() [1/2]

Elem * libMesh::Elem::child_neighbor ( Elem elem)
inlineinherited
Returns
If elem is a neighbor of a child of this element, a pointer to that child, otherwise nullptr.

Definition at line 2609 of file elem.h.

References libMesh::Elem::neighbor_ptr_range().

2610 {
2611  for (auto n : elem->neighbor_ptr_range())
2612  if (n && n->parent() == this)
2613  return n;
2614 
2615  return nullptr;
2616 }

◆ child_neighbor() [2/2]

const Elem * libMesh::Elem::child_neighbor ( const Elem elem) const
inlineinherited
Returns
If elem is a neighbor of a child of this element, a pointer to that child, otherwise nullptr.

Definition at line 2621 of file elem.h.

References libMesh::Elem::neighbor_ptr_range().

2622 {
2623  for (auto n : elem->neighbor_ptr_range())
2624  if (n && n->parent() == this)
2625  return n;
2626 
2627  return nullptr;
2628 }

◆ child_ptr() [1/2]

const Elem * libMesh::Elem::child_ptr ( unsigned int  i) const
inlineinherited
Returns
A constant pointer to the i^{th} child for this element. Do not call if this element has no children, i.e. is active.

Definition at line 3160 of file elem.h.

References libMesh::Elem::_children, and libMesh::libmesh_assert().

Referenced by libMesh::Elem::add_child(), libMesh::UnstructuredMesh::all_first_order(), libMesh::Elem::bracketing_nodes(), libMesh::Elem::coarsen(), libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), libMesh::TopologyMap::fill(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::is_child_on_edge(), libMesh::Elem::is_vertex_on_parent(), libMesh::Elem::make_links_to_me_remote(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectEdges::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectSides::operator()(), libMesh::Elem::refine(), libMesh::Elem::replace_child(), libMesh::Parallel::sync_element_data_by_parent_id(), InfFERadialTest::testRefinement(), EquationSystemsTest::testRefineThenReinitPreserveFlags(), libMesh::BoundaryInfo::transfer_boundary_ids_from_children(), libMesh::Elem::which_child_am_i(), and libMesh::CheckpointIO::write_remote_elem().

3161 {
3164 
3165  return _children[i];
3166 }
libmesh_assert(ctx)
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2243

◆ child_ptr() [2/2]

Elem * libMesh::Elem::child_ptr ( unsigned int  i)
inlineinherited
Returns
A non-constant pointer to the i^{th} child for this element. Do not call if this element has no children, i.e. is active.

Definition at line 3169 of file elem.h.

References libMesh::Elem::_children, and libMesh::libmesh_assert().

3170 {
3173 
3174  return _children[i];
3175 }
libmesh_assert(ctx)
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2243

◆ child_ref_range() [1/2]

SimpleRange< Elem::ChildRefIter > libMesh::Elem::child_ref_range ( )
inlineinherited

Returns a range with all children of a parent element, usable in range-based for loops.

The exact type of the return value here may be subject to change in future libMesh releases, but the iterators will always dereference to produce a reference to a child element.

Definition at line 2328 of file elem.h.

References libMesh::Elem::_children, libMesh::libmesh_assert(), and libMesh::Elem::n_children().

Referenced by libMesh::HPCoarsenTest::add_projection(), libMesh::Elem::ancestor(), libMesh::OldSolutionBase< Output, point_output >::check_old_context(), libMesh::Elem::coarsen(), libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), libMesh::connect_children(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::Elem::has_ancestor_children(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_remote(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::Elem::set_p_level(), and libMesh::Partitioner::set_parent_processor_ids().

2329 {
2331  return {_children.get(), _children.get() + this->n_children()};
2332 }
virtual unsigned int n_children() const =0
libmesh_assert(ctx)
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2243

◆ child_ref_range() [2/2]

SimpleRange< Elem::ConstChildRefIter > libMesh::Elem::child_ref_range ( ) const
inlineinherited

Definition at line 2336 of file elem.h.

References libMesh::Elem::_children, libMesh::libmesh_assert(), and libMesh::Elem::n_children().

2337 {
2339  return {_children.get(), _children.get() + this->n_children()};
2340 }
virtual unsigned int n_children() const =0
libmesh_assert(ctx)
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2243

◆ clear_dofs()

void libMesh::DofObject::clear_dofs ( )
inlineinherited

Clear the DofMap data structures holding degree of freedom data.

If any extra integers are associated with this DofObject, their count and values are unchanged.

Definition at line 798 of file dof_object.h.

References libMesh::DofObject::set_n_systems().

799 {
800  this->set_n_systems(0);
801 }
void set_n_systems(const unsigned int s)
Sets the number of systems for this DofObject.
Definition: dof_object.C:150

◆ clear_old_dof_object()

void libMesh::DofObject::clear_old_dof_object ( )
inherited

Sets the old_dof_object to nullptr.

Definition at line 128 of file dof_object.C.

References libMesh::DofObject::old_dof_object.

Referenced by libMesh::DofObject::operator=(), libMesh::DofObject::set_old_dof_object(), and libMesh::DofObject::unpack_indexing().

129 {
130  this->old_dof_object.reset(nullptr);
131 }
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88

◆ close_to_point()

bool libMesh::Elem::close_to_point ( const Point p,
Real  tol 
) const
virtualinherited
Returns
true if this element is "close" to the point p, where "close" is determined by the tolerance tol.

Reimplemented in libMesh::NodeElem.

Definition at line 2779 of file elem.C.

References libMesh::Elem::point_test().

Referenced by assemble_SchroedingerEquation(), libMesh::PointLocatorNanoflann::operator()(), and libMesh::PointLocatorTree::operator()().

2780 {
2781  // This test uses the user's passed-in tolerance for the
2782  // bounding box test as well, thereby allowing the routine to
2783  // find points which are not only "in" the element, but also
2784  // "nearby" to within some tolerance.
2785  return this->point_test(p, tol, tol);
2786 }
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.
Definition: elem.C:2791

◆ coarsen()

void libMesh::Elem::coarsen ( )
inherited

Coarsen the element.

This function is non-virtual since it is the same for all element types.

Definition at line 163 of file elem_refinement.C.

References libMesh::Elem::active(), libMesh::TypeVector< T >::add_scaled(), libMesh::Elem::child_ptr(), libMesh::Elem::child_ref_range(), libMesh::Elem::COARSEN, libMesh::Elem::COARSEN_INACTIVE, libMesh::Elem::embedding_matrix(), libMesh::Elem::INACTIVE, libMesh::Elem::JUST_COARSENED, libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::Elem::n_nodes(), libMesh::Elem::node_index_range(), libMesh::Elem::point(), libMesh::Real, libMesh::Elem::refinement_flag(), libMesh::remote_elem, libMesh::Elem::set_p_level(), and libMesh::Elem::set_refinement_flag().

164 {
165  libmesh_assert_equal_to (this->refinement_flag(), Elem::COARSEN_INACTIVE);
166  libmesh_assert (!this->active());
167 
168  // We no longer delete children until MeshRefinement::contract()
169 
170  unsigned int parent_p_level = 0;
171 
172  const unsigned int n_n = this->n_nodes();
173 
174  // re-compute hanging node nodal locations
175  for (unsigned int c = 0, nc = this->n_children(); c != nc; ++c)
176  {
177  Elem * mychild = this->child_ptr(c);
178  if (mychild == remote_elem)
179  continue;
180  for (auto cnode : mychild->node_index_range())
181  {
182  Point new_pos;
183  bool calculated_new_pos = false;
184 
185  for (unsigned int n=0; n<n_n; n++)
186  {
187  // The value from the embedding matrix
188  const Real em_val = this->embedding_matrix(c,cnode,n);
189 
190  // The node location is somewhere between existing vertices
191  if ((em_val != 0.) && (em_val != 1.))
192  {
193  new_pos.add_scaled (this->point(n), em_val);
194  calculated_new_pos = true;
195  }
196  }
197 
198  if (calculated_new_pos)
199  {
200  //Move the existing node back into it's original location
201  for (unsigned int i=0; i<LIBMESH_DIM; i++)
202  {
203  Point & child_node = mychild->point(cnode);
204  child_node(i)=new_pos(i);
205  }
206  }
207  }
208  }
209 
210  for (auto & mychild : this->child_ref_range())
211  {
212  if (&mychild == remote_elem)
213  continue;
214  libmesh_assert_equal_to (mychild.refinement_flag(), Elem::COARSEN);
215  mychild.set_refinement_flag(Elem::INACTIVE);
216  if (mychild.p_level() > parent_p_level)
217  parent_p_level = mychild.p_level();
218  }
219 
221  this->set_p_level(parent_p_level);
222 
223  libmesh_assert (this->active());
224 }
void set_p_level(const unsigned int p)
Sets the value of the p-refinement level for the element.
RefinementState refinement_flag() const
Definition: elem.h:3207
void set_refinement_flag(const RefinementState rflag)
Sets the value of the refinement flag for the element.
Definition: elem.h:3215
virtual unsigned int n_children() const =0
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:2328
virtual Real embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
virtual unsigned int n_nodes() const =0
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool active() const
Definition: elem.h:2938
const Point & point(const unsigned int i) const
Definition: elem.h:2422
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:3160
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ complete_order_equivalent_type()

ElemType libMesh::Elem::complete_order_equivalent_type ( const ElemType  et)
staticinherited
Returns
The ElemType of the associated "complete" order element (which will be the same as the input if the input is already a complete-order ElemType), or INVALID_ELEM for elements that cannot be converted into complete-order equivalents.

The "complete" version of an element is an element which can represent the same geometry but which has nodes available to restore degrees of freedom on any vertex, edge, or face.

For example, when this is a TET4, then TET14 is returned.

Definition at line 3322 of file elem.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::Utility::enum_to_string(), libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::INFEDGE2, libMesh::INFHEX16, libMesh::INFHEX18, libMesh::INFHEX8, libMesh::INFPRISM12, libMesh::INFPRISM6, libMesh::INFQUAD4, libMesh::INFQUAD6, libMesh::NODEELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM20, libMesh::PRISM21, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID18, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::QUADSHELL9, libMesh::TET10, libMesh::TET14, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, libMesh::TRI7, and libMesh::TRISHELL3.

Referenced by libMesh::UnstructuredMesh::all_complete_order_range().

3323 {
3324  switch (et)
3325  {
3326  case NODEELEM:
3327  return NODEELEM;
3328  case EDGE2:
3329  case EDGE3:
3330  return EDGE3;
3331 
3332  case EDGE4:
3333  return EDGE4;
3334 
3335  case TRI3:
3336  case TRI6:
3337  case TRI7:
3338  return TRI7;
3339 
3340  // Currently there is no TRISHELL6, so similarly to other types
3341  // where this is the case, we just return the input.
3342  case TRISHELL3:
3343  return TRISHELL3;
3344 
3345  case QUAD4:
3346  case QUAD8:
3347  case QUAD9:
3348  return QUAD9;
3349 
3350  case QUADSHELL4:
3351  case QUADSHELL8:
3352  case QUADSHELL9:
3353  return QUADSHELL9;
3354 
3355  case TET4:
3356  case TET10:
3357  case TET14:
3358  return TET14;
3359 
3360  case HEX8:
3361  case HEX20:
3362  case HEX27:
3363  return HEX27;
3364 
3365  // We don't strictly need the 21st node for DoFs, but some code
3366  // depends on it for e.g. refinement patterns
3367  case PRISM6:
3368  case PRISM15:
3369  case PRISM18:
3370  case PRISM20:
3371  case PRISM21:
3372  return PRISM21;
3373 
3374  case PYRAMID5:
3375  case PYRAMID13:
3376  case PYRAMID14:
3377  case PYRAMID18:
3378  return PYRAMID18;
3379 
3380 
3381 
3382 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
3383  case INFEDGE2:
3384  return INFEDGE2;
3385 
3386  case INFQUAD4:
3387  case INFQUAD6:
3388  return INFQUAD6;
3389 
3390  case INFHEX8:
3391  case INFHEX16:
3392  case INFHEX18:
3393  return INFHEX18;
3394 
3395  // Probably ought to implement INFPRISM13 and/or 14; until then
3396  // we'll just return the not-complete-order ElemType, in
3397  // accordance which what seems like bad precedent...
3398  case INFPRISM6:
3399  case INFPRISM12:
3400  return INFPRISM12;
3401 #endif // LIBMESH_ENABLE_INFINITE_ELEMENTS
3402 
3403  default:
3404  {
3405  // what did we miss?
3406  libmesh_error_msg("No complete order equivalent element type for et = "
3407  << Utility::enum_to_string(et));
3408  }
3409  }
3410 }
std::string enum_to_string(const T e)

◆ compute_key() [1/4]

dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0)
inlinestaticprotectedinherited

◆ compute_key() [2/4]

dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0,
dof_id_type  n1 
)
inlinestaticprotectedinherited
Returns
A hash key computed from two node ids.

Definition at line 3299 of file elem.h.

References libMesh::Utility::hashword2().

3301 {
3302  // Order the two so that n0 < n1
3303  if (n0 > n1) std::swap (n0, n1);
3304 
3305  return Utility::hashword2(n0, n1);
3306 }
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.
Definition: hashword.h:215

◆ compute_key() [3/4]

dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0,
dof_id_type  n1,
dof_id_type  n2 
)
inlinestaticprotectedinherited
Returns
A hash key computed from three node ids.

Definition at line 3311 of file elem.h.

References libMesh::Utility::hashword().

3314 {
3315  std::array<dof_id_type, 3> array = {{n0, n1, n2}};
3316  std::sort(array.begin(), array.end());
3317  return Utility::hashword(array);
3318 }
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval=0)
The hashword function takes an array of uint32_t&#39;s of length &#39;length&#39; and computes a single key from ...
Definition: hashword.h:158

◆ compute_key() [4/4]

dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0,
dof_id_type  n1,
dof_id_type  n2,
dof_id_type  n3 
)
inlinestaticprotectedinherited
Returns
A hash key computed from four node ids.

Definition at line 3323 of file elem.h.

References libMesh::Utility::hashword().

3327 {
3328  std::array<dof_id_type, 4> array = {{n0, n1, n2, n3}};
3329  std::sort(array.begin(), array.end());
3330  return Utility::hashword(array);
3331 }
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval=0)
The hashword function takes an array of uint32_t&#39;s of length &#39;length&#39; and computes a single key from ...
Definition: hashword.h:158

◆ connectivity()

void libMesh::Pyramid18::connectivity ( const unsigned int  sc,
const IOPackage  iop,
std::vector< dof_id_type > &  conn 
) const
overridevirtual
Returns
The connectivity for this element in a specific format, which is specified by the IOPackage tag.

Implements libMesh::Elem.

Definition at line 326 of file cell_pyramid18.C.

References libMesh::Elem::_nodes, libMesh::INVALID_IO_PACKAGE, libMesh::libmesh_assert(), n_sub_elem(), libMesh::TECPLOT, and libMesh::VTK.

329 {
331  libmesh_assert_less (sc, this->n_sub_elem());
332  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
333 
334  switch (iop)
335  {
336  case TECPLOT:
337  {
338  // TODO
339  libmesh_not_implemented();
340  }
341 
342  case VTK:
343  {
344  // TODO
345  libmesh_not_implemented();
346  }
347 
348  default:
349  libmesh_error_msg("Unsupported IO package " << iop);
350  }
351 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2227
virtual unsigned int n_sub_elem() const override
FIXME: we don&#39;t yet have a refinement pattern for pyramids...
libmesh_assert(ctx)

◆ contains_edge_of()

bool libMesh::Elem::contains_edge_of ( const Elem e) const
inherited
Returns
true if an edge of e is contained in this element. (Internally, this is done by checking whether at least two vertices of e are contained in this element).

Definition at line 975 of file elem.C.

References libMesh::Elem::contains_point(), libMesh::make_range(), libMesh::Elem::n_vertices(), and libMesh::Elem::point().

Referenced by libMesh::Elem::find_edge_neighbors().

976 {
977  unsigned int num_contained_edges = 0;
978 
979  // Our vertices are the first numbered nodes
980  for (auto n : make_range(e->n_vertices()))
981  {
982  if (this->contains_point(e->point(n)))
983  {
984  num_contained_edges++;
985  if (num_contained_edges>=2)
986  {
987  return true;
988  }
989  }
990  }
991  return false;
992 }
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2754
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...
Definition: int_range.h:140

◆ contains_point()

bool libMesh::Elem::contains_point ( const Point p,
Real  tol = TOLERANCE 
) const
virtualinherited
Returns
true if the physical point p is contained in this element, false otherwise.

For linear elements, performs an initial tight bounding box check (as an optimization step) and (if that passes) then uses the user-defined tolerance "tol" in a call to inverse_map() to actually test if the point is in the element. For quadratic elements, the bounding box optimization is skipped, and only the inverse_map() steps are performed.

Note
This routine should not be used to determine if a point is merely "nearby" an element to within some tolerance. For that, use Elem::close_to_point() instead.

Reimplemented in libMesh::NodeElem, libMesh::Tet4, libMesh::InfHex, libMesh::InfPrism, libMesh::Tri3, and libMesh::InfQuad4.

Definition at line 2754 of file elem.C.

References libMesh::err, libMesh::Elem::point_test(), and libMesh::TOLERANCE.

Referenced by libMesh::Elem::contains_edge_of(), libMesh::Elem::contains_vertex_of(), libMesh::Elem::find_edge_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_constraints(), libMesh::PointLocatorNanoflann::operator()(), libMesh::PointLocatorTree::operator()(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), NavierSystem::side_constraint(), RationalMapTest< elem_type >::testContainsPoint(), PointLocatorTest::testLocator(), and PointLocatorTest::testPlanar().

2755 {
2756  // We currently allow the user to enlarge the bounding box by
2757  // providing a tol > TOLERANCE (so this routine is identical to
2758  // Elem::close_to_point()), but print a warning so that the
2759  // user can eventually switch his code over to calling close_to_point()
2760  // instead, which is intended to be used for this purpose.
2761  if (tol > TOLERANCE)
2762  {
2763  libmesh_do_once(libMesh::err
2764  << "WARNING: Resizing bounding box to match user-specified tolerance!\n"
2765  << "In the future, calls to Elem::contains_point() with tol > TOLERANCE\n"
2766  << "will be more optimized, but should not be used\n"
2767  << "to search for points 'close to' elements!\n"
2768  << "Instead, use Elem::close_to_point() for this purpose.\n"
2769  << std::endl;);
2770  return this->point_test(p, tol, tol);
2771  }
2772  else
2773  return this->point_test(p, TOLERANCE, tol);
2774 }
OStreamProxy err
static constexpr Real TOLERANCE
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.
Definition: elem.C:2791

◆ contains_vertex_of()

bool libMesh::Elem::contains_vertex_of ( const Elem e,
bool  mesh_connection = false 
) const
inherited
Returns
true if a vertex of e is contained in this element. If mesh_connection is true, looks specifically for containment possibilities of an element e that is connected to this via membership in the same manifold of the same mesh.

Definition at line 937 of file elem.C.

References libMesh::Elem::contains_point(), libMesh::Elem::level(), libMesh::make_range(), libMesh::Elem::n_vertices(), libMesh::Elem::node_ptr(), libMesh::Elem::node_ref(), and libMesh::Elem::point().

938 {
939  // Our vertices are the first numbered nodes
940  const unsigned int nv = e->n_vertices();
941  const unsigned int my_nv = this->n_vertices();
942 
943  // Check for vertex-to-vertex containment first; contains_point() is
944  // expensive
945  for (auto n : make_range(nv))
946  {
947  const Node * vertex = e->node_ptr(n);
948  for (auto my_n : make_range(my_nv))
949  if (&this->node_ref(my_n) == vertex)
950  return true;
951  }
952 
953  // If e is in our mesh, then we might be done testing
954  if (mesh_connection)
955  {
956  const unsigned int l = this->level();
957  const unsigned int el = e->level();
958 
959  if (l >= el)
960  return false;
961 
962  // We could also return false for l==el-1 iff we knew we had no
963  // triangular faces, but we don't have an API to check that.
964  }
965 
966  // Our vertices are the first numbered nodes
967  for (auto n : make_range(nv))
968  if (this->contains_point(e->point(n)))
969  return true;
970  return false;
971 }
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2754
const Node & node_ref(const unsigned int i) const
Definition: elem.h:2498
unsigned int level() const
Definition: elem.h:3071
virtual unsigned int n_vertices() const =0
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...
Definition: int_range.h:140

◆ contract()

void libMesh::Elem::contract ( )
inherited

Contract an active element, i.e.

remove pointers to any subactive children. This should only be called via MeshRefinement::contract, which will also remove subactive children from the mesh.

Definition at line 228 of file elem_refinement.C.

References libMesh::Elem::_children, libMesh::Elem::active(), libMesh::Elem::DO_NOTHING, libMesh::Elem::JUST_COARSENED, libMesh::libmesh_assert(), libMesh::Elem::refinement_flag(), and libMesh::Elem::set_refinement_flag().

229 {
230  // Subactive elements get deleted entirely, not contracted
231  libmesh_assert (this->active());
232 
233  // Active contracted elements no longer can have children
234  _children.reset(nullptr);
235 
236  if (this->refinement_flag() == Elem::JUST_COARSENED)
238 }
RefinementState refinement_flag() const
Definition: elem.h:3207
void set_refinement_flag(const RefinementState rflag)
Sets the value of the refinement flag for the element.
Definition: elem.h:3215
libmesh_assert(ctx)
bool active() const
Definition: elem.h:2938
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2243

◆ debug_buffer()

void libMesh::DofObject::debug_buffer ( ) const
inherited

Print our buffer for debugging.

Definition at line 660 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::MeshTools::Generation::Private::idx(), and libMesh::out.

661 {
662  libMesh::out << " [ ";
663  for (const auto & idx : _idx_buf)
664  libMesh::out << idx << " ";
665  libMesh::out << "]\n";
666 }
OStreamProxy out
index_buffer_t _idx_buf
Definition: dof_object.h:680
unsigned int idx(const ElemType type, const unsigned int nx, const unsigned int i, const unsigned int j)
A useful inline function which replaces the macros used previously.

◆ default_order()

Order libMesh::Pyramid18::default_order ( ) const
overridevirtual
Returns
SECOND.

Implements libMesh::Elem.

Definition at line 137 of file cell_pyramid18.C.

References libMesh::THIRD.

138 {
139  return THIRD;
140 }

◆ default_side_order()

virtual Order libMesh::Elem::default_side_order ( ) const
inlinevirtualinherited
Returns
The default approximation order for side elements of this element type. This may be lower for elements with 'bubble functions' in the Lagrange basis.

Reimplemented in libMesh::Tri7.

Definition at line 1003 of file elem.h.

References libMesh::Elem::default_order().

Referenced by libMesh::FEAbstract::compute_node_constraints(), and libMesh::FEAbstract::compute_periodic_node_constraints().

1003 { return default_order(); }
virtual Order default_order() const =0

◆ dim()

virtual unsigned short libMesh::Cell::dim ( ) const
inlineoverridevirtualinherited
Returns
3, the dimensionality of the object.

Implements libMesh::Elem.

Definition at line 61 of file cell.h.

61 { return 3; }

◆ disable_print_counter_info() [1/2]

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 100 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

101 {
102  _enable_print_counter = false;
103  return;
104 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...

◆ disable_print_counter_info() [2/2]

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 100 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

101 {
102  _enable_print_counter = false;
103  return;
104 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...

◆ disconnected_clone()

std::unique_ptr< Elem > libMesh::Elem::disconnected_clone ( ) const
virtualinherited
Returns
An Elem of the same type as this, wrapped in a smart pointer.

This is not a complete clone() method (since e.g. it does not set node pointers; the standard use case reassigns node pointers from a different mesh), but it is necessary to use this instead of build() for runtime-polymorphic elements like Polygon subtypes whose "type" depends on more than their type(), and it is useful to use this for elements whose id, unique_id, extra integers, etc. should be preserved in the near-clone.

Reimplemented in libMesh::C0Polyhedron.

Definition at line 412 of file elem.C.

References libMesh::Elem::build(), libMesh::C0POLYGON, libMesh::DofObject::id(), libMesh::Elem::mapping_data(), libMesh::Elem::mapping_type(), libMesh::DofObject::n_extra_integers(), libMesh::Elem::n_sides(), libMesh::DofObject::processor_id(), libMesh::Elem::subdomain_id(), libMesh::Elem::type(), libMesh::DofObject::unique_id(), and libMesh::DofObject::valid_unique_id().

Referenced by libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::Polyhedron::side_clones(), libMesh::Polyhedron::side_ptr(), and libMesh::Elem::true_centroid().

413 {
414  std::unique_ptr<Elem> returnval;
415 
416  switch (this->type())
417  {
418  case C0POLYGON:
419  returnval = std::make_unique<C0Polygon>(this->n_sides());
420  break;
421 
422  default:
423  returnval = Elem::build(this->type());
424  }
425 
426  returnval->set_id() = this->id();
427 #ifdef LIBMESH_ENABLE_UNIQUE_ID
428  if (this->valid_unique_id())
429  returnval->set_unique_id(this->unique_id());
430 #endif
431  returnval->subdomain_id() = this->subdomain_id();
432  returnval->processor_id() = this->processor_id();
433 
434  const auto n_elem_ints = this->n_extra_integers();
435  returnval->add_extra_integers(n_elem_ints);
436  for (unsigned int i = 0; i != n_elem_ints; ++i)
437  returnval->set_extra_integer(i, this->get_extra_integer(i));
438 
439  returnval->set_mapping_type(this->mapping_type());
440  returnval->set_mapping_data(this->mapping_data());
441 
442  return returnval;
443 }
unsigned char mapping_data() const
Definition: elem.h:3133
unique_id_type unique_id() const
Definition: dof_object.h:844
ElemMappingType mapping_type() const
Definition: elem.h:3117
dof_id_type id() const
Definition: dof_object.h:828
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition: elem.C:447
bool valid_unique_id() const
Definition: dof_object.h:893
virtual unsigned int n_sides() const =0
subdomain_id_type subdomain_id() const
Definition: elem.h:2551
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1170
processor_id_type processor_id() const
Definition: dof_object.h:905
virtual ElemType type() const =0

◆ dof_number() [1/2]

dof_id_type libMesh::DofObject::dof_number ( const unsigned int  s,
const unsigned int  var,
const unsigned int  comp 
) const
inlineinherited
Returns
The global degree of freedom number for variable var, component comp for system s associated with this DofObject

When partitioning and DoF numbering have been performed by libMesh, every current DoF on this DofObject will belong to its processor.

Definition at line 1032 of file dof_object.h.

References libMesh::DofObject::n_comp(), libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), and libMesh::DofObject::var_to_vg_and_offset().

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::DofMap::allgather_recursive_constraints(), assemble_matrix_and_rhs(), assemble_shell(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::Nemesis_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::Nemesis_IO::copy_nodal_solution(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::dof_indices(), libMesh::DofObject::DofObject(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_mixed_derivatives(), libMesh::OldSolutionValue< Output, point_output >::eval_mixed_derivatives(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), fill_dirichlet_bc(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::local_variable_indices(), main(), libMesh::DofMap::old_dof_indices(), libMesh::BuildProjectionList::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectEdges::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectSides::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectInteriors::operator()(), libMesh::DofObject::operator=(), libMesh::DofObject::print_dof_info(), libMesh::DofMap::process_mesh_constraint_rows(), LinearElasticityWithContact::residual_and_jacobian(), libMesh::HPCoarsenTest::select_refinement(), libMesh::DofObject::set_dof_number(), libMesh::DofMap::set_nonlocal_dof_objects(), ParsedFEMFunctionTest::setUp(), DofObjectTest< Node >::testJensEftangBug(), DofObjectTest< Node >::testManualDofCalculation(), libMesh::BoundaryVolumeSolutionTransfer::transfer_boundary_volume(), libMesh::DTKAdapter::update_variable_values(), and libMesh::Nemesis_IO_Helper::write_nodal_solution().

1035 {
1036  libmesh_assert_less (s, this->n_systems());
1037  libmesh_assert_less (var, this->n_vars(s));
1038  libmesh_assert_less (comp, this->n_comp(s,var));
1039 
1040  const std::pair<unsigned int, unsigned int>
1041  vg_vig = this->var_to_vg_and_offset(s,var);
1042 
1043  const unsigned int
1044  n_comp = this->n_comp_group(s,vg_vig.first);
1045 
1046  return this->dof_number(s, vg_vig.first, vg_vig.second,
1047  comp, n_comp);
1048 }
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:1032
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:1002
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:967
unsigned int n_systems() const
Definition: dof_object.h:937
std::pair< unsigned int, unsigned int > var_to_vg_and_offset(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:1200
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1015

◆ dof_number() [2/2]

dof_id_type libMesh::DofObject::dof_number ( const unsigned int  s,
const unsigned int  vg,
const unsigned int  vig,
const unsigned int  comp,
const unsigned int  n_comp 
) const
inlineinherited
Returns
The global degree of freedom number for variable group vg, variable index vig within the group, component comp out of n_comp, for system s on this DofObject

Even users who need to call dof_number from user code probably don't want to call this overload.

Definition at line 1053 of file dof_object.h.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::invalid_id, libMesh::DofObject::n_comp(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), and libMesh::DofObject::start_idx().

1058 {
1059  libmesh_assert_less (s, this->n_systems());
1060  libmesh_assert_less (vg, this->n_var_groups(s));
1061  libmesh_assert_less (vig, this->n_vars(s,vg));
1062 
1063  const unsigned int
1064  start_idx_sys = this->start_idx(s);
1065 
1066  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1067 
1068  const dof_id_type
1069  base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
1070 
1071  // if the first component is invalid, they
1072  // are all invalid
1073  if (base_idx == invalid_id)
1074  return invalid_id;
1075 
1076  // otherwise the index is the first component
1077  // index augmented by the component number
1078  else
1079  return cast_int<dof_id_type>(base_idx + vig*n_comp + comp);
1080 }
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:1002
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:957
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:967
unsigned int n_systems() const
Definition: dof_object.h:937
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1249
index_buffer_t _idx_buf
Definition: dof_object.h:680
uint8_t dof_id_type
Definition: id_types.h:67

◆ edge_index_range()

IntRange< unsigned short > libMesh::Elem::edge_index_range ( ) const
inlineinherited
Returns
An integer range from 0 up to (but not including) the number of edges this element has.

Definition at line 2661 of file elem.h.

References libMesh::Elem::n_edges().

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), libMesh::BoundaryInfo::copy_boundary_ids(), libMesh::ElemCutter::find_intersection_points(), and libMesh::Elem::quality().

2662 {
2663  return {0, cast_int<unsigned short>(this->n_edges())};
2664 }
virtual unsigned int n_edges() const =0

◆ edges_adjacent_to_node()

std::vector< unsigned int > libMesh::Pyramid::edges_adjacent_to_node ( const unsigned int  int) const
overridevirtualinherited
Returns
the (local) edge numbers that touch the specified node

Implements libMesh::Elem.

Definition at line 278 of file cell_pyramid.C.

References libMesh::Pyramid::adjacent_edges_map, libMesh::Elem::is_edge(), libMesh::Elem::is_face(), libMesh::Elem::is_vertex(), libMesh::libmesh_assert(), libMesh::Pyramid::n_nodes(), and libMesh::Pyramid::n_vertices().

279 {
280  libmesh_assert_less(n, this->n_nodes());
281  if (this->is_vertex(n))
282  {
283  auto trim = (n < 4) ? 1 : 0;
284  return {std::begin(adjacent_edges_map[n]), std::end(adjacent_edges_map[n]) - trim};
285  }
286  else if (this->is_edge(n))
287  return {n - this->n_vertices()};
288 
289  // Not a vertex or edge node, so must be one of the face nodes.
290  libmesh_assert(this->is_face(n));
291  return {};
292 }
virtual bool is_face(const unsigned int i) const =0
virtual unsigned int n_vertices() const override
Definition: cell_pyramid.h:95
libmesh_assert(ctx)
virtual unsigned int n_nodes() const override
Definition: cell_pyramid.h:85
virtual bool is_vertex(const unsigned int i) const =0
static const unsigned int adjacent_edges_map[5][4]
This maps the node to the 3 or 4 edge ids adjacent to the node.
Definition: cell_pyramid.h:235
virtual bool is_edge(const unsigned int i) const =0

◆ embedding_matrix()

virtual Real libMesh::Pyramid18::embedding_matrix ( const unsigned int  ,
const unsigned int  ,
const unsigned int   
) const
inlineoverrideprotectedvirtual

Matrix used to create the elements children.

Implements libMesh::Elem.

Definition at line 269 of file cell_pyramid18.h.

272  { libmesh_not_implemented(); return 0.; }

◆ embedding_matrix_version()

virtual unsigned int libMesh::Elem::embedding_matrix_version ( ) const
inlinevirtualinherited
Returns
A "version number" that identifies which embedding matrix is in use.

Some element types may use a different embedding matrix depending on their geometric characteristics.

Reimplemented in libMesh::Tet.

Definition at line 2032 of file elem.h.

Referenced by libMesh::Elem::as_parent_node(), and libMesh::Elem::parent_bracketing_nodes().

2032 { return 0; }

◆ enable_print_counter_info() [1/2]

void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

Methods to enable/disable the reference counter output from print_info()

Definition at line 94 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

95 {
96  _enable_print_counter = true;
97  return;
98 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...

◆ enable_print_counter_info() [2/2]

void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

Methods to enable/disable the reference counter output from print_info()

Definition at line 94 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

95 {
96  _enable_print_counter = true;
97  return;
98 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...

◆ family_tree() [1/2]

void libMesh::Elem::family_tree ( std::vector< const Elem *> &  family,
bool  reset = true 
) const
inherited

Fills the vector family with the children of this element, recursively.

Calling this method on a twice-refined element will give you the element itself, its direct children, and their children, etc... When the optional parameter reset is true, the vector will be cleared before the element and its descendants are added.

The family tree only includes ancestor and active elements. To include subactive elements as well, use total_family_tree().

Definition at line 2104 of file elem.C.

References libMesh::ElemInternal::family_tree().

2106 {
2107  ElemInternal::family_tree(this, family, reset);
2108 }
void family_tree(T elem, std::vector< T > &family, bool reset=true)
Definition: elem_internal.h:41

◆ family_tree() [2/2]

void libMesh::Elem::family_tree ( std::vector< Elem *> &  family,
bool  reset = true 
)
inherited

Non-const version of function above; fills a vector of non-const pointers.

Definition at line 2112 of file elem.C.

References libMesh::ElemInternal::family_tree().

2114 {
2115  ElemInternal::family_tree(this, family, reset);
2116 }
void family_tree(T elem, std::vector< T > &family, bool reset=true)
Definition: elem_internal.h:41

◆ family_tree_by_neighbor() [1/2]

void libMesh::Elem::family_tree_by_neighbor ( std::vector< const Elem *> &  family,
const Elem neighbor,
bool  reset = true 
) const
inherited

Same as the family_tree() member, but only adds elements which are next to neighbor.

Definition at line 2188 of file elem.C.

References libMesh::ElemInternal::family_tree_by_neighbor().

2191 {
2192  ElemInternal::family_tree_by_neighbor(this, family, neighbor, reset);
2193 }
void family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)

◆ family_tree_by_neighbor() [2/2]

void libMesh::Elem::family_tree_by_neighbor ( std::vector< Elem *> &  family,
Elem neighbor,
bool  reset = true 
)
inherited

Non-const version of function above; fills a vector of non-const pointers.

Definition at line 2197 of file elem.C.

References libMesh::ElemInternal::family_tree_by_neighbor().

2200 {
2201  ElemInternal::family_tree_by_neighbor(this, family, neighbor, reset);
2202 }
void family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)

◆ family_tree_by_side() [1/2]

void libMesh::Elem::family_tree_by_side ( std::vector< const Elem *> &  family,
unsigned int  side,
bool  reset = true 
) const
inherited

Same as the family_tree() member, but only adds elements which are next to side.

Definition at line 2152 of file elem.C.

References libMesh::ElemInternal::family_tree_by_side().

Referenced by libMesh::Elem::make_links_to_me_local().

2155 {
2156  ElemInternal::family_tree_by_side(this, family, side, reset);
2157 }
void family_tree_by_side(T elem, std::vector< T > &family, unsigned int s, bool reset)

◆ family_tree_by_side() [2/2]

void libMesh::Elem::family_tree_by_side ( std::vector< Elem *> &  family,
unsigned int  side,
bool  reset = true 
)
inherited

Non-const version of function above; fills a vector of non-const pointers.

Definition at line 2161 of file elem.C.

References libMesh::ElemInternal::family_tree_by_side().

2164 {
2165  ElemInternal::family_tree_by_side(this, family, side, reset);
2166 }
void family_tree_by_side(T elem, std::vector< T > &family, unsigned int s, bool reset)

◆ family_tree_by_subneighbor() [1/2]

void libMesh::Elem::family_tree_by_subneighbor ( std::vector< const Elem *> &  family,
const Elem neighbor,
const Elem subneighbor,
bool  reset = true 
) const
inherited

Same as the family_tree() member, but only adds elements which are next to subneighbor.

Only applicable when this->has_neighbor(neighbor) and neighbor->is_ancestor(subneighbor)

Definition at line 2224 of file elem.C.

References libMesh::ElemInternal::family_tree_by_subneighbor().

2228 {
2229  ElemInternal::family_tree_by_subneighbor(this, family, neighbor, subneighbor, reset);
2230 }
void family_tree_by_subneighbor(T elem, std::vector< T > &family, T neighbor_in, T subneighbor, bool reset=true)

◆ family_tree_by_subneighbor() [2/2]

void libMesh::Elem::family_tree_by_subneighbor ( std::vector< Elem *> &  family,
Elem neighbor,
Elem subneighbor,
bool  reset = true 
)
inherited

Non-const version of function above; fills a vector of non-const pointers.

Definition at line 2234 of file elem.C.

References libMesh::ElemInternal::family_tree_by_subneighbor().

2238 {
2239  ElemInternal::family_tree_by_subneighbor(this, family, neighbor, subneighbor, reset);
2240 }
void family_tree_by_subneighbor(T elem, std::vector< T > &family, T neighbor_in, T subneighbor, bool reset=true)

◆ find_edge_neighbors() [1/2]

void libMesh::Elem::find_edge_neighbors ( const Point p1,
const Point p2,
std::set< const Elem *> &  neighbor_set 
) const
inherited

This function finds all active elements in the same manifold as this element which touch the current active element along the whole edge defined by the two points p1 and p2.

Definition at line 1086 of file elem.C.

References libMesh::Elem::contains_point(), libMesh::Elem::find_point_neighbors(), and libMesh::libmesh_assert().

Referenced by libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement().

1089 {
1090  // Simple but perhaps suboptimal code: find elements containing the
1091  // first point, then winnow this set down by removing elements which
1092  // don't also contain the second point
1093 
1094  libmesh_assert(this->contains_point(p2));
1095  this->find_point_neighbors(p1, neighbor_set);
1096 
1097  std::set<const Elem *>::iterator it = neighbor_set.begin();
1098  const std::set<const Elem *>::iterator end = neighbor_set.end();
1099 
1100  while (it != end)
1101  {
1102  // As of C++11, set::erase returns an iterator to the element
1103  // following the erased element, or end.
1104  if (!(*it)->contains_point(p2))
1105  it = neighbor_set.erase(it);
1106  else
1107  ++it;
1108  }
1109 }
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2754
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...
Definition: elem.C:996
libmesh_assert(ctx)

◆ find_edge_neighbors() [2/2]

void libMesh::Elem::find_edge_neighbors ( std::set< const Elem *> &  neighbor_set) const
inherited

This function finds all active elements in the same manifold as this element which touch the current active element along any edge (more precisely, at at least two points).

In this case, elements are included even if they do not touch a whole edge of this element.

Definition at line 1113 of file elem.C.

References libMesh::Elem::contains_edge_of(), and libMesh::remote_elem.

1114 {
1115  neighbor_set.clear();
1116  neighbor_set.insert(this);
1117 
1118  std::set<const Elem *> untested_set, next_untested_set;
1119  untested_set.insert(this);
1120 
1121  while (!untested_set.empty())
1122  {
1123  // Loop over all the elements in the patch that haven't already
1124  // been tested
1125  for (const auto & elem : untested_set)
1126  {
1127  for (auto current_neighbor : elem->neighbor_ptr_range())
1128  {
1129  if (current_neighbor &&
1130  current_neighbor != remote_elem) // we have a real neighbor on this side
1131  {
1132  if (current_neighbor->active()) // ... if it is active
1133  {
1134  if (this->contains_edge_of(current_neighbor) // ... and touches us
1135  || current_neighbor->contains_edge_of(this))
1136  {
1137  // Make sure we'll test it
1138  if (!neighbor_set.count(current_neighbor))
1139  next_untested_set.insert (current_neighbor);
1140 
1141  // And add it
1142  neighbor_set.insert (current_neighbor);
1143  }
1144  }
1145 #ifdef LIBMESH_ENABLE_AMR
1146  else // ... the neighbor is *not* active,
1147  { // ... so add *all* neighboring
1148  // active children
1149  std::vector<const Elem *> active_neighbor_children;
1150 
1151  current_neighbor->active_family_tree_by_neighbor
1152  (active_neighbor_children, elem);
1153 
1154  for (const auto & current_child : active_neighbor_children)
1155  if (this->contains_edge_of(current_child) || current_child->contains_edge_of(this))
1156  {
1157  // Make sure we'll test it
1158  if (!neighbor_set.count(current_child))
1159  next_untested_set.insert (current_child);
1160 
1161  neighbor_set.insert (current_child);
1162  }
1163  }
1164 #endif // #ifdef LIBMESH_ENABLE_AMR
1165  }
1166  }
1167  }
1168  untested_set.swap(next_untested_set);
1169  next_untested_set.clear();
1170  }
1171 }
bool contains_edge_of(const Elem *e) const
Definition: elem.C:975
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ find_interior_neighbors() [1/2]

void libMesh::Elem::find_interior_neighbors ( std::set< const Elem *> &  neighbor_set) const
inherited

This function finds all active elements (not including this one) in the parent manifold of this element whose intersection with this element has non-zero measure.

Definition at line 1175 of file elem.C.

References libMesh::ElemInternal::find_interior_neighbors().

1176 {
1177  ElemInternal::find_interior_neighbors(this, neighbor_set);
1178 }
void find_interior_neighbors(T this_elem, std::set< T > &neighbor_set)

◆ find_interior_neighbors() [2/2]

void libMesh::Elem::find_interior_neighbors ( std::set< Elem *> &  neighbor_set)
inherited

Non-const version of function above that fills up a vector of non-const Elem pointers instead.

Definition at line 1182 of file elem.C.

References libMesh::ElemInternal::find_interior_neighbors().

1183 {
1184  ElemInternal::find_interior_neighbors(this, neighbor_set);
1185 }
void find_interior_neighbors(T this_elem, std::set< T > &neighbor_set)

◆ find_point_neighbors() [1/4]

void libMesh::Elem::find_point_neighbors ( const Point p,
std::set< const Elem *> &  neighbor_set 
) const
inherited

This function finds all active elements (including this one) which are in the same manifold as this element and which touch the current active element at the specified point, which should be a point in the current element.

Elements which are not "in the same manifold" (e.g. the interior_parent of a boundary element) will not be found with this method.

Elements which overlap the specified point but which are only connected to the current element via elements which do not overlap that point (e.g. in a folded or tangled mesh) are not considered to "touch" the current element and will not be found with this method.

Definition at line 996 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::contains_point(), libMesh::libmesh_assert(), and libMesh::remote_elem.

Referenced by libMesh::MeshFunction::check_found_elem(), libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::Elem::find_edge_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::ReplicatedMesh::get_boundary_points(), libMesh::Elem::is_semilocal(), libMesh::GhostPointNeighbors::operator()(), and InfFERadialTest::testRefinement().

998 {
999  libmesh_assert(this->contains_point(p));
1000  libmesh_assert(this->active());
1001 
1002  neighbor_set.clear();
1003  neighbor_set.insert(this);
1004 
1005  std::set<const Elem *> untested_set, next_untested_set;
1006  untested_set.insert(this);
1007 
1008 #ifdef LIBMESH_ENABLE_AMR
1009  std::vector<const Elem *> active_neighbor_children;
1010 #endif // #ifdef LIBMESH_ENABLE_AMR
1011 
1012  while (!untested_set.empty())
1013  {
1014  // Loop over all the elements in the patch that haven't already
1015  // been tested
1016  for (const auto & elem : untested_set)
1017  for (auto current_neighbor : elem->neighbor_ptr_range())
1018  {
1019  if (current_neighbor &&
1020  current_neighbor != remote_elem) // we have a real neighbor on this side
1021  {
1022  if (current_neighbor->active()) // ... if it is active
1023  {
1024  auto it = neighbor_set.lower_bound(current_neighbor);
1025  if ((it == neighbor_set.end() || *it != current_neighbor) &&
1026  current_neighbor->contains_point(p)) // ... don't have and touches p
1027  {
1028  // Add it and test it
1029  next_untested_set.insert(current_neighbor);
1030  neighbor_set.emplace_hint(it, current_neighbor);
1031  }
1032  }
1033 #ifdef LIBMESH_ENABLE_AMR
1034  else // ... the neighbor is *not* active,
1035  { // ... so add *all* neighboring
1036  // active children that touch p
1037  active_neighbor_children.clear();
1038  current_neighbor->active_family_tree_by_neighbor
1039  (active_neighbor_children, elem);
1040 
1041  for (const auto & current_child : active_neighbor_children)
1042  {
1043  auto it = neighbor_set.lower_bound(current_child);
1044  if ((it == neighbor_set.end() || *it != current_child) &&
1045  current_child->contains_point(p))
1046  {
1047  // Add it and test it
1048  next_untested_set.insert(current_child);
1049  neighbor_set.emplace_hint(it, current_child);
1050  }
1051  }
1052  }
1053 #endif // #ifdef LIBMESH_ENABLE_AMR
1054  }
1055  }
1056  untested_set.swap(next_untested_set);
1057  next_untested_set.clear();
1058  }
1059 }
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2754
libmesh_assert(ctx)
bool active() const
Definition: elem.h:2938
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ find_point_neighbors() [2/4]

void libMesh::Elem::find_point_neighbors ( std::set< const Elem *> &  neighbor_set) const
inherited

This function finds all active elements (including this one) in the same manifold as this element which touch this active element at any point.

Definition at line 1063 of file elem.C.

References libMesh::Elem::find_point_neighbors().

1064 {
1065  this->find_point_neighbors(neighbor_set, this);
1066 }
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...
Definition: elem.C:996

◆ find_point_neighbors() [3/4]

void libMesh::Elem::find_point_neighbors ( std::set< const Elem *> &  neighbor_set,
const Elem start_elem 
) const
inherited

This function finds all active elements (including this one) in the same manifold as start_elem (which must be active and must touch this element) which touch this element at any point.

Definition at line 1070 of file elem.C.

References libMesh::ElemInternal::find_point_neighbors().

1072 {
1073  ElemInternal::find_point_neighbors(this, neighbor_set, start_elem);
1074 }
void find_point_neighbors(T this_elem, std::set< T > &neighbor_set, T start_elem)

◆ find_point_neighbors() [4/4]

void libMesh::Elem::find_point_neighbors ( std::set< Elem *> &  neighbor_set,
Elem start_elem 
)
inherited

Non-const version of function above.

Fills a set of non-const Elem pointers.

Definition at line 1078 of file elem.C.

References libMesh::ElemInternal::find_point_neighbors().

1080 {
1081  ElemInternal::find_point_neighbors(this, neighbor_set, start_elem);
1082 }
void find_point_neighbors(T this_elem, std::set< T > &neighbor_set, T start_elem)

◆ first_order_equivalent_type()

ElemType libMesh::Elem::first_order_equivalent_type ( const ElemType  et)
staticinherited
Returns
The element type of the associated first-order element, or INVALID_ELEM for first-order or other elements that cannot be converted into lower order equivalents.

For example, when this is a TET10, then TET4 is returned.

Definition at line 3069 of file elem.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::INFEDGE2, libMesh::INFHEX16, libMesh::INFHEX18, libMesh::INFHEX8, libMesh::INFPRISM12, libMesh::INFPRISM6, libMesh::INFQUAD4, libMesh::INFQUAD6, libMesh::INVALID_ELEM, libMesh::NODEELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM20, libMesh::PRISM21, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID18, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::QUADSHELL9, libMesh::TET10, libMesh::TET14, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, libMesh::TRI7, and libMesh::TRISHELL3.

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::ExodusII_IO_Helper::read_edge_blocks(), SideTest< ElemClass, side_type, indexbegin, indexend >::testSidePtr(), SideTest< ElemClass, side_type, indexbegin, indexend >::testSidePtrFill(), and libMesh::GMVIO::write_ascii_old_impl().

3070 {
3071  switch (et)
3072  {
3073  case NODEELEM:
3074  return NODEELEM;
3075  case EDGE2:
3076  case EDGE3:
3077  case EDGE4:
3078  return EDGE2;
3079  case TRI3:
3080  case TRI6:
3081  case TRI7:
3082  return TRI3;
3083  case TRISHELL3:
3084  return TRISHELL3;
3085  case QUAD4:
3086  case QUAD8:
3087  case QUAD9:
3088  return QUAD4;
3089  case QUADSHELL4:
3090  case QUADSHELL8:
3091  case QUADSHELL9:
3092  return QUADSHELL4;
3093  case TET4:
3094  case TET10:
3095  case TET14:
3096  return TET4;
3097  case HEX8:
3098  case HEX27:
3099  case HEX20:
3100  return HEX8;
3101  case PRISM6:
3102  case PRISM15:
3103  case PRISM18:
3104  case PRISM20:
3105  case PRISM21:
3106  return PRISM6;
3107  case PYRAMID5:
3108  case PYRAMID13:
3109  case PYRAMID14:
3110  case PYRAMID18:
3111  return PYRAMID5;
3112 
3113 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
3114 
3115  case INFEDGE2:
3116  return INFEDGE2;
3117  case INFQUAD4:
3118  case INFQUAD6:
3119  return INFQUAD4;
3120  case INFHEX8:
3121  case INFHEX16:
3122  case INFHEX18:
3123  return INFHEX8;
3124  case INFPRISM6:
3125  case INFPRISM12:
3126  return INFPRISM6;
3127 
3128 #endif
3129 
3130  default:
3131  // unknown element
3132  return INVALID_ELEM;
3133  }
3134 }

◆ flip()

void libMesh::Pyramid18::flip ( BoundaryInfo boundary_info)
finaloverridevirtual

Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sign.

This is useful for automatically fixing up elements that have been newly created (e.g. from extrusions) with a negative Jacobian.

If boundary_info is not null, swap boundary side/edge ids consistently.

Implements libMesh::Elem.

Definition at line 474 of file cell_pyramid18.C.

References libMesh::libmesh_assert(), libMesh::Elem::swap2boundaryedges(), libMesh::Elem::swap2boundarysides(), libMesh::Elem::swap2neighbors(), and libMesh::Elem::swap2nodes().

475 {
476  libmesh_assert(boundary_info);
477 
478  swap2nodes(0,1);
479  swap2nodes(2,3);
480  swap2nodes(6,8);
481  swap2nodes(9,10);
482  swap2nodes(11,12);
483  swap2nodes(15,17);
484  swap2neighbors(1,3);
485  swap2boundarysides(1,3,boundary_info);
486  swap2boundaryedges(1,3,boundary_info);
487  swap2boundaryedges(4,5,boundary_info);
488  swap2boundaryedges(6,7,boundary_info);
489 }
void swap2boundaryedges(unsigned short e1, unsigned short e2, BoundaryInfo *boundary_info) const
Swaps two edges in boundary_info, if it is non-null.
Definition: elem.C:3553
void swap2boundarysides(unsigned short s1, unsigned short s2, BoundaryInfo *boundary_info) const
Swaps two sides in boundary_info, if it is non-null.
Definition: elem.C:3537
void swap2nodes(unsigned int n1, unsigned int n2)
Swaps two node_ptrs.
Definition: elem.h:2073
libmesh_assert(ctx)
void swap2neighbors(unsigned int n1, unsigned int n2)
Swaps two neighbor_ptrs.
Definition: elem.h:2083

◆ get_extra_datum()

template<typename T >
T libMesh::DofObject::get_extra_datum ( const unsigned int  index) const
inlineinherited

Gets the value on this object of the extra datum associated with index, which should have been obtained via a call to MeshBase::add_elem_datum or MeshBase::add_node_datum using the same type T.

Definition at line 1146 of file dof_object.h.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_systems(), and libMesh::DofObject::start_idx_ints().

Referenced by libMesh::Elem::get_info(), libMesh::VTKIO::nodes_to_vtk(), libMesh::rational_fe_shape(), libMesh::rational_fe_shape_deriv(), libMesh::rational_fe_shape_second_deriv(), libMesh::rational_fe_weighted_shapes(), libMesh::rational_fe_weighted_shapes_derivs(), libMesh::ExodusII_IO::read(), and DofObjectTest< Node >::testAddExtraData().

1147 {
1148 #ifndef NDEBUG
1149  const unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
1150 #endif
1151  libmesh_assert_less(index+n_more_integers, this->n_extra_integers());
1152  libmesh_assert_less(this->n_systems(), _idx_buf.size());
1153 
1154  const unsigned int start_idx_i = this->start_idx_ints();
1155 
1156  libmesh_assert_less(start_idx_i+index+n_more_integers, _idx_buf.size());
1157  T returnval;
1158  std::memcpy(&returnval, &_idx_buf[start_idx_i+index], sizeof(T));
1159  return returnval;
1160 }
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1273
unsigned int n_systems() const
Definition: dof_object.h:937
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1170
index_buffer_t _idx_buf
Definition: dof_object.h:680
uint8_t dof_id_type
Definition: id_types.h:67

◆ get_extra_integer()

dof_id_type libMesh::DofObject::get_extra_integer ( const unsigned int  index) const
inlineinherited

Gets the value on this object of the extra integer associated with index, which should have been obtained via a call to MeshBase::add_elem_integer or MeshBase::add_node_integer.

Definition at line 1102 of file dof_object.h.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_systems(), and libMesh::DofObject::start_idx_ints().

Referenced by libMesh::MeshTools::Modification::all_tri(), WriteElemsetData::checkByCentroid(), libMesh::MeshTools::Modification::flatten(), libMesh::SyncElementIntegers::gather_data(), libMesh::XdrIO::pack_element(), libMesh::CheckpointIO::read_connectivity(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::DofObject::set_n_vars_per_group(), DofObjectTest< Node >::testAddExtraData(), DofObjectTest< Node >::testAddSystemExtraInts(), ExtraIntegersTest::testExtraIntegersExodusReading(), DofObjectTest< Node >::testSetNSystemsExtraInts(), DofObjectTest< Node >::testSetNVariableGroupsExtraInts(), and libMesh::XdrIO::write_serialized_nodes().

1103 {
1104  libmesh_assert_less(index, this->n_extra_integers());
1105  libmesh_assert_less(this->n_systems(), _idx_buf.size());
1106 
1107  const unsigned int start_idx_i = this->start_idx_ints();
1108 
1109  libmesh_assert_less(start_idx_i+index, _idx_buf.size());
1110  return _idx_buf[start_idx_i+index];
1111 }
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1273
unsigned int n_systems() const
Definition: dof_object.h:937
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1170
index_buffer_t _idx_buf
Definition: dof_object.h:680

◆ get_info() [1/3]

std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

References libMesh::ReferenceCounter::_counts, and libMesh::Quality::name().

Referenced by libMesh::ReferenceCounter::print_info().

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (const auto & [name, cd] : _counts)
59  oss << "| " << name << " reference count information:\n"
60  << "| Creations: " << cd.first << '\n'
61  << "| Destructions: " << cd.second << '\n';
62 
63  oss << " ---------------------------------------------------------------------------- \n";
64 
65  return oss.str();
66 
67 #else
68 
69  return "";
70 
71 #endif
72 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
static Counts _counts
Actually holds the data.

◆ get_info() [2/3]

std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

References libMesh::ReferenceCounter::_counts, and libMesh::Quality::name().

Referenced by libMesh::ReferenceCounter::print_info().

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (const auto & [name, cd] : _counts)
59  oss << "| " << name << " reference count information:\n"
60  << "| Creations: " << cd.first << '\n'
61  << "| Destructions: " << cd.second << '\n';
62 
63  oss << " ---------------------------------------------------------------------------- \n";
64 
65  return oss.str();
66 
67 #else
68 
69  return "";
70 
71 #endif
72 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
static Counts _counts
Actually holds the data.

◆ get_info() [3/3]

std::string libMesh::Elem::get_info ( ) const
inherited

Prints relevant information about the element to a string.

Definition at line 2926 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::ancestor(), libMesh::Elem::dim(), libMesh::DofObject::dof_number(), libMesh::Utility::enum_to_string(), libMesh::DofObject::get_extra_datum(), libMesh::Elem::has_children(), libMesh::Elem::hmax(), libMesh::Elem::hmin(), libMesh::DofObject::id(), libMesh::Elem::infinite(), libMesh::Elem::level(), libMesh::make_range(), libMesh::Elem::mapping_data(), libMesh::Elem::mapping_type(), libMesh::DofObject::n_comp(), libMesh::Elem::n_nodes(), libMesh::Elem::n_sides(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_index_range(), libMesh::Elem::node_ref(), libMesh::Elem::origin(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::parent(), libMesh::DofObject::processor_id(), libMesh::RATIONAL_BERNSTEIN_MAP, libMesh::Real, libMesh::Elem::refinement_flag(), libMesh::Elem::side_index_range(), libMesh::Elem::subactive(), libMesh::Elem::subdomain_id(), libMesh::Elem::type(), libMesh::DofObject::unique_id(), libMesh::DofObject::valid_id(), libMesh::DofObject::valid_unique_id(), and libMesh::Elem::volume().

Referenced by libMesh::Elem::print_info().

2927 {
2928  std::ostringstream oss;
2929 
2930  oss << " Elem Information" << '\n'
2931  << " id()=";
2932 
2933  if (this->valid_id())
2934  oss << this->id();
2935  else
2936  oss << "invalid";
2937 
2938 #ifdef LIBMESH_ENABLE_UNIQUE_ID
2939  oss << ", unique_id()=";
2940  if (this->valid_unique_id())
2941  oss << this->unique_id();
2942  else
2943  oss << "invalid";
2944 #endif
2945 
2946  oss << ", subdomain_id()=" << this->subdomain_id();
2947  oss << ", processor_id()=" << this->processor_id() << '\n';
2948 
2949  oss << " type()=" << Utility::enum_to_string(this->type()) << '\n'
2950  << " dim()=" << this->dim() << '\n'
2951  << " n_nodes()=" << this->n_nodes() << '\n';
2952 
2953  oss << " mapping=" << Utility::enum_to_string(this->mapping_type()) << '\n';
2954 
2955  for (auto n : this->node_index_range())
2956  {
2957  oss << " " << n << this->node_ref(n);
2958  if (this->mapping_type() == RATIONAL_BERNSTEIN_MAP)
2959  {
2960  const unsigned char datum_index = this->mapping_data();
2961  oss << " weight=" <<
2962  this->node_ref(n).get_extra_datum<Real>(datum_index) << '\n';
2963  }
2964  }
2965 
2966  oss << " n_sides()=" << this->n_sides() << '\n';
2967 
2968  for (auto s : this->side_index_range())
2969  {
2970  oss << " neighbor(" << s << ")=";
2971  if (this->neighbor_ptr(s))
2972  oss << this->neighbor_ptr(s)->id() << '\n';
2973  else
2974  oss << "nullptr\n";
2975  }
2976 
2977  if (!this->infinite())
2978  {
2979  oss << " hmin()=" << this->hmin()
2980  << ", hmax()=" << this->hmax() << '\n'
2981  << " volume()=" << this->volume() << '\n';
2982  }
2983  oss << " active()=" << this->active()
2984  << ", ancestor()=" << this->ancestor()
2985  << ", subactive()=" << this->subactive()
2986  << ", has_children()=" << this->has_children() << '\n'
2987  << " parent()=";
2988  if (this->parent())
2989  oss << this->parent()->id() << '\n';
2990  else
2991  oss << "nullptr\n";
2992  oss << " level()=" << this->level()
2993  << ", p_level()=" << this->p_level() << '\n'
2994 #ifdef LIBMESH_ENABLE_AMR
2995  << " refinement_flag()=" << Utility::enum_to_string(this->refinement_flag()) << '\n'
2996  << " p_refinement_flag()=" << Utility::enum_to_string(this->p_refinement_flag()) << '\n'
2997 #endif
2998 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2999  << " infinite()=" << this->infinite() << '\n';
3000  if (this->infinite())
3001  oss << " origin()=" << this->origin() << '\n'
3002 #endif
3003  ;
3004 
3005  oss << " DoFs=";
3006  for (auto s : make_range(this->n_systems()))
3007  for (auto v : make_range(this->n_vars(s)))
3008  for (auto c : make_range(this->n_comp(s,v)))
3009  oss << '(' << s << '/' << v << '/' << this->dof_number(s,v,c) << ") ";
3010 
3011 
3012  return oss.str();
3013 }
unsigned char mapping_data() const
Definition: elem.h:3133
RefinementState refinement_flag() const
Definition: elem.h:3207
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:1032
const Elem * parent() const
Definition: elem.h:3027
virtual Point origin() const
Definition: elem.h:1895
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:1002
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2670
RefinementState p_refinement_flag() const
Definition: elem.h:3223
unique_id_type unique_id() const
Definition: dof_object.h:844
unsigned int p_level() const
Definition: elem.h:3105
virtual Real hmax() const
Definition: elem.C:725
bool ancestor() const
Definition: elem.C:2013
ElemMappingType mapping_type() const
Definition: elem.h:3117
const Node & node_ref(const unsigned int i) const
Definition: elem.h:2498
dof_id_type id() const
Definition: dof_object.h:828
virtual Real hmin() const
Definition: elem.C:705
virtual unsigned int n_nodes() const =0
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:967
unsigned int n_systems() const
Definition: dof_object.h:937
bool valid_unique_id() const
Definition: dof_object.h:893
std::string enum_to_string(const T e)
virtual unsigned int n_sides() const =0
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2567
unsigned int level() const
Definition: elem.h:3071
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
subdomain_id_type subdomain_id() const
Definition: elem.h:2551
bool valid_id() const
Definition: dof_object.h:885
virtual unsigned short dim() const =0
bool subactive() const
Definition: elem.h:2956
virtual Real volume() const
Definition: elem.C:3432
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...
Definition: int_range.h:140
IntRange< unsigned short > node_index_range() const
Definition: elem.h:2652
T get_extra_datum(const unsigned int index) const
Gets the value on this object of the extra datum associated with index, which should have been obtain...
Definition: dof_object.h:1146
virtual bool infinite() const =0
bool active() const
Definition: elem.h:2938
processor_id_type processor_id() const
Definition: dof_object.h:905
virtual ElemType type() const =0
bool has_children() const
Definition: elem.h:2976

◆ get_node_index()

unsigned int libMesh::Elem::get_node_index ( const Node node_ptr) const
inlineinherited
Returns
The local index for the Node pointer node_ptr, or invalid_uint if node_ptr is not a local node.

Definition at line 2514 of file elem.h.

References libMesh::Elem::_nodes, libMesh::invalid_uint, libMesh::make_range(), libMesh::Elem::n_nodes(), and libMesh::Elem::node_ptr().

Referenced by libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::ElemCutter::find_intersection_points(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::C0Polyhedron::retriangulate(), and VolumeTest::testC0PolyhedronMethods().

2515 {
2516  for (auto n : make_range(this->n_nodes()))
2517  if (this->_nodes[n] == node_ptr)
2518  return n;
2519 
2520  return libMesh::invalid_uint;
2521 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2227
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:310
virtual unsigned int n_nodes() const =0
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2476
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...
Definition: int_range.h:140

◆ get_nodes()

const Node *const * libMesh::Elem::get_nodes ( ) const
inlineinherited
Returns
A pointer to an array of local node pointers.

Definition at line 2468 of file elem.h.

References libMesh::Elem::_nodes.

Referenced by libMesh::DofMap::dof_indices(), and libMesh::DofMap::old_dof_indices().

2469 {
2470  return _nodes;
2471 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2227

◆ get_old_dof_object() [1/2]

DofObject* libMesh::DofObject::get_old_dof_object ( )
inlineinherited

◆ get_old_dof_object() [2/2]

const DofObject* libMesh::DofObject::get_old_dof_object ( ) const
inlineinherited

Definition at line 97 of file dof_object.h.

References libMesh::DofObject::old_dof_object.

97 { return old_dof_object.get(); }
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88

◆ get_old_dof_object_ref() [1/2]

DofObject& libMesh::DofObject::get_old_dof_object_ref ( )
inlineinherited

As above, but do not use in situations where the old_dof_object may be nullptr, since this function asserts that the old_dof_object is valid before returning a reference to it.

Definition at line 104 of file dof_object.h.

References libMesh::libmesh_assert(), and libMesh::DofObject::old_dof_object.

Referenced by libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), and libMesh::DofMap::old_dof_indices().

105  {
107  return *old_dof_object;
108  }
libmesh_assert(ctx)
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88

◆ get_old_dof_object_ref() [2/2]

const DofObject& libMesh::DofObject::get_old_dof_object_ref ( ) const
inlineinherited

Definition at line 110 of file dof_object.h.

References libMesh::libmesh_assert(), and libMesh::DofObject::old_dof_object.

111  {
113  return *old_dof_object;
114  }
libmesh_assert(ctx)
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88

◆ hack_p_level()

void libMesh::Elem::hack_p_level ( const unsigned int  p)
inlineinherited

Sets the value of the p-refinement level for the element without altering the p-level of its ancestors.

Definition at line 3261 of file elem.h.

References libMesh::Elem::_p_level, libMesh::Elem::JUST_REFINED, and libMesh::Elem::p_refinement_flag().

Referenced by libMesh::Elem::hack_p_level_and_refinement_flag(), libMesh::HPCoarsenTest::select_refinement(), and libMesh::Elem::set_p_level().

3262 {
3263  if (p == 0)
3264  libmesh_assert_not_equal_to
3266 
3267  _p_level = cast_int<unsigned char>(p);
3268 }
unsigned char _p_level
p refinement level - the difference between the polynomial degree on this element and the minimum pol...
Definition: elem.h:2272
RefinementState p_refinement_flag() const
Definition: elem.h:3223

◆ hack_p_level_and_refinement_flag()

void libMesh::Elem::hack_p_level_and_refinement_flag ( const unsigned int  p,
RefinementState  pflag 
)
inlineinherited

Sets the value of the p-refinement level for the element without altering the p-level of its ancestors; also sets the p_refinement_flag, simultaneously so that they can be safely checked for mutual consistency.

Definition at line 3272 of file elem.h.

References libMesh::Elem::_pflag, and libMesh::Elem::hack_p_level().

3274 {
3275  _pflag = cast_int<unsigned char>(pflag);
3276  this->hack_p_level(p);
3277 }
unsigned char _pflag
p refinement flag.
Definition: elem.h:2262
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...
Definition: elem.h:3261

◆ has_affine_map()

bool libMesh::Pyramid18::has_affine_map ( ) const
overridevirtual
Returns
true if the element map is definitely affine within numerical tolerances.

Reimplemented from libMesh::Elem.

Definition at line 128 of file cell_pyramid18.C.

129 {
130  // TODO: If the base is a parallelogram and all the triangular faces are planar,
131  // the map should be linear, but I need to test this theory...
132  return false;
133 }

◆ has_ancestor_children()

bool libMesh::Elem::has_ancestor_children ( ) const
inlineinherited
Returns
true if the element has any descendants other than its immediate children, false otherwise, or if AMR is disabled.

Definition at line 2990 of file elem.h.

References libMesh::Elem::_children, and libMesh::Elem::child_ref_range().

2991 {
2992 #ifdef LIBMESH_ENABLE_AMR
2993  if (!_children)
2994  return false;
2995  else
2996  for (auto & c : child_ref_range())
2997  if (c.has_children())
2998  return true;
2999 #endif
3000  return false;
3001 }
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:2328
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2243

◆ has_children()

bool libMesh::Elem::has_children ( ) const
inlineinherited

◆ has_dofs()

bool libMesh::DofObject::has_dofs ( const unsigned int  s = libMesh::invalid_uint) const
inlineinherited
Returns
true if any system has variables which have been assigned, false otherwise.

Definition at line 1226 of file dof_object.h.

References libMesh::invalid_uint, libMesh::make_range(), libMesh::DofObject::n_systems(), and libMesh::DofObject::n_vars().

Referenced by libMesh::DofMap::old_dof_indices().

1227 {
1228  if (sys == libMesh::invalid_uint)
1229  {
1230  for (auto s : make_range(this->n_systems()))
1231  if (this->n_vars(s))
1232  return true;
1233  }
1234 
1235  else
1236  {
1237  libmesh_assert_less (sys, this->n_systems());
1238 
1239  if (this->n_vars(sys))
1240  return true;
1241  }
1242 
1243  return false;
1244 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:310
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:967
unsigned int n_systems() const
Definition: dof_object.h:937
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...
Definition: int_range.h:140

◆ has_extra_integers()

bool libMesh::DofObject::has_extra_integers ( ) const
inlineinherited

◆ has_invertible_map()

bool libMesh::Elem::has_invertible_map ( Real  tol = TOLERANCE*TOLERANCE) const
virtualinherited
Returns
true if the element map is invertible everywhere on the element, to within a user-specified tolerance. The tolerance is generally used in comparisons against zero, so it should be an absolute rather than a relative tolerance. Throws a libmesh_not_implemented() error unless specialized by derived classes.

Reimplemented in libMesh::NodeElem, libMesh::Tet4, libMesh::Tri3, libMesh::Edge4, libMesh::Edge3, libMesh::Quad4, and libMesh::Edge2.

Definition at line 2884 of file elem.C.

References libMesh::FEMap::compute_map(), libMesh::Elem::dim(), libMesh::FEMap::get_jacobian(), libMesh::index_range(), libMesh::FEMap::init_reference_to_physical_map(), libMesh::Elem::is_singular_node(), and libMesh::Elem::n_nodes().

Referenced by VolumeTest::testEdge4Invertible().

2885 {
2886  QNodal qnodal {this->dim()};
2887  FEMap fe_map;
2888  auto & jac = fe_map.get_jacobian();
2889 
2890  // We have a separate check for is_singular_node() below, so in this
2891  // case its "OK" to do nodal quadrature on pyramids.
2892  qnodal.allow_nodal_pyramid_quadrature = true;
2893  qnodal.init(*this);
2894  auto & qp = qnodal.get_points();
2895  libmesh_assert_equal_to(qp.size(), this->n_nodes());
2896 
2897  std::vector<Point> one_point(1);
2898  std::vector<Real> one_weight(1,1);
2899  for (auto i : index_range(qp))
2900  {
2901  if (this->is_singular_node(i))
2902  continue;
2903 
2904  one_point[0] = qp[i];
2905 
2906  fe_map.init_reference_to_physical_map(this->dim(), one_point, this);
2907  fe_map.compute_map(this->dim(), one_weight, this, false);
2908 
2909  if (jac[0] <= 0)
2910  return false;
2911  }
2912 
2913  return true;
2914 }
virtual unsigned int n_nodes() const =0
virtual bool is_singular_node(unsigned int) const
Definition: elem.h:1819
virtual unsigned short dim() const =0
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:117

◆ has_neighbor()

bool libMesh::Elem::has_neighbor ( const Elem elem) const
inlineinherited
Returns
true if the element elem in question is a neighbor of this element, false otherwise.

Definition at line 2597 of file elem.h.

References libMesh::Elem::neighbor_ptr_range().

Referenced by libMesh::Elem::has_topological_neighbor(), libMesh::MeshRefinement::has_topological_neighbor(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), and libMesh::Elem::on_boundary().

2598 {
2599  for (auto n : this->neighbor_ptr_range())
2600  if (n == elem)
2601  return true;
2602 
2603  return false;
2604 }
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Returns a range with all neighbors of an element, usable in range-based for loops.
Definition: elem.h:3486

◆ has_topological_neighbor()

bool libMesh::Elem::has_topological_neighbor ( const Elem elem,
const MeshBase mesh,
const PointLocatorBase point_locator,
const PeriodicBoundaries pb 
) const
inherited
Returns
true if the element elem in question is a neighbor or topological neighbor of this element, false otherwise.

Definition at line 1353 of file elem.C.

References libMesh::Elem::has_neighbor(), mesh, libMesh::Elem::side_index_range(), and libMesh::Elem::topological_neighbor().

Referenced by libMesh::MeshRefinement::has_topological_neighbor().

1357 {
1358  // First see if this is a normal "interior" neighbor
1359  if (has_neighbor(elem))
1360  return true;
1361 
1362  for (auto n : this->side_index_range())
1363  if (this->topological_neighbor(n, mesh, point_locator, pb))
1364  return true;
1365 
1366  return false;
1367 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2597
const Elem * topological_neighbor(const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
Definition: elem.C:1316
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2670
MeshBase & mesh

◆ hmax()

Real libMesh::Elem::hmax ( ) const
virtualinherited
Returns
The maximum vertex separation for the element.

Definition at line 725 of file elem.C.

References libMesh::Elem::n_vertices(), libMesh::Elem::point(), and libMesh::Real.

Referenced by libMesh::DiscontinuityMeasure::boundary_side_integration(), libMesh::KellyErrorEstimator::boundary_side_integration(), libMesh::OldSolutionBase< Output, point_output >::check_old_context(), libMesh::Elem::get_info(), libMesh::LaplacianErrorEstimator::internal_side_integration(), libMesh::DiscontinuityMeasure::internal_side_integration(), libMesh::KellyErrorEstimator::internal_side_integration(), and libMesh::Elem::point_test().

726 {
727  Real h_max=0;
728 
729  // Avoid calling a virtual a lot of times
730  const auto n_vertices = this->n_vertices();
731 
732  for (unsigned int n_outer=0; n_outer<n_vertices; n_outer++)
733  for (unsigned int n_inner=n_outer+1; n_inner<n_vertices; n_inner++)
734  {
735  const auto diff = (this->point(n_outer) - this->point(n_inner));
736 
737  h_max = std::max(h_max, diff.norm_sq());
738  }
739 
740  return std::sqrt(h_max);
741 }
virtual unsigned int n_vertices() const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Point & point(const unsigned int i) const
Definition: elem.h:2422

◆ hmin()

Real libMesh::Elem::hmin ( ) const
virtualinherited
Returns
The minimum vertex separation for the element.

Definition at line 705 of file elem.C.

References libMesh::Elem::n_vertices(), libMesh::Elem::point(), and libMesh::Real.

Referenced by compute_enriched_soln(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), compute_tau(), libMesh::MeshTools::Modification::distort(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), libMesh::FEMSystem::numerical_jacobian(), and libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()().

706 {
707  Real h_min=std::numeric_limits<Real>::max();
708 
709  // Avoid calling a virtual a lot of times
710  const auto n_vertices = this->n_vertices();
711 
712  for (unsigned int n_outer=0; n_outer<n_vertices; n_outer++)
713  for (unsigned int n_inner=n_outer+1; n_inner<n_vertices; n_inner++)
714  {
715  const auto diff = (this->point(n_outer) - this->point(n_inner));
716 
717  h_min = std::min(h_min, diff.norm_sq());
718  }
719 
720  return std::sqrt(h_min);
721 }
virtual unsigned int n_vertices() const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Point & point(const unsigned int i) const
Definition: elem.h:2422

◆ id()

dof_id_type libMesh::DofObject::id ( ) const
inlineinherited
Returns
The id for this DofObject

Definition at line 828 of file dof_object.h.

References libMesh::DofObject::_id.

Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), add_cube_convex_hull_to_mesh(), libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::TopologyMap::add_node(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::ClawSystem::assemble_avg_coupling_matrices(), assemble_ellipticdg(), libMesh::ClawSystem::assemble_jump_coupling_matrix(), libMesh::Node::build(), libMesh::MeshTools::Generation::build_cube(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::EquationSystems::build_parallel_solution_vector(), compute_jacobian(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), compute_residual(), libMesh::InfFE< Dim, T_radial, T_map >::compute_shape_functions(), libMesh::FEMap::compute_single_point_map(), libMesh::MeshBase::copy_constraint_rows(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::ReplicatedMesh::delete_elem(), libMesh::DistributedMesh::delete_elem(), libMesh::ReplicatedMesh::delete_node(), libMesh::DistributedMesh::delete_node(), libMesh::C0Polyhedron::disconnected_clone(), libMesh::Elem::disconnected_clone(), libMesh::DTKAdapter::DTKAdapter(), libMesh::UNVIO::elements_out(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_error_tolerance(), libMesh::MeshTools::Modification::flatten(), libMesh::ReplicatedMesh::get_boundary_points(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::MeshBase::get_info(), libMesh::ParmetisPartitioner::initialize(), libMesh::TreeNode< N >::insert(), libMesh::TriangulatorInterface::insert_any_extra_boundary_points(), libMesh::ReplicatedMesh::insert_elem(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_node(), libMesh::Poly2TriTriangulator::insert_refinement_points(), EIM_F::interior_assembly(), AssemblyEIM::interior_assembly(), libMesh::Elem::interior_parent(), libMesh::FEMap::inverse_map(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_constraint_rows(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::Tri3Subdivision::local_node_number(), main(), ExodusTest< elem_type >::meshes_equal_enough(), LinearElasticityWithContact::move_mesh(), libMesh::MeshTools::n_connected_components(), libMesh::Elem::node_id(), libMesh::TriangulatorInterface::nodes_to_segments(), libMesh::VTKIO::nodes_to_vtk(), libMesh::CompareElemIdsByLevel::operator()(), libMesh::GhostPointNeighbors::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::CompareDofObjectsByID::operator()(), libMesh::CompareDofObjectsByPIDAndThenID::operator()(), libMesh::BoundaryInfo::operator==(), libMesh::DistributedMesh::own_node(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::MetisPartitioner::partition_range(), libMesh::DofObject::print_dof_info(), libMesh::DofMap::process_mesh_constraint_rows(), libMesh::DistributedMesh::query_elem_ptr(), libMesh::query_ghosting_functors(), libMesh::DistributedMesh::query_node_ptr(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::VariationalMeshSmoother::readgr(), libMesh::EquationSystems::redundant_added_side(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::DistributedMesh::renumber_elem(), libMesh::DistributedMesh::renumber_node(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::C0Polyhedron::retriangulate(), libMesh::DofMap::scatter_constraints(), libMesh::StaticCondensation::set_current_elem(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), FETestBase< order, family, elem_type, 1 >::setUp(), libMesh::MeshTools::Modification::smooth(), libMesh::BoundaryInfo::sync(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id_once(), ElemTest< elem_type >::test_orient_elements(), DefaultCouplingTest::testCoupling(), MixedDimensionMeshTest::testPointLocatorTree(), InfFERadialTest::testRefinement(), DofObjectTest< Node >::testSetId(), libMesh::Elem::topologically_equal(), libMesh::NetGenMeshInterface::triangulate(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), libMesh::Poly2TriTriangulator::triangulate_current_points(), libMesh::MeshTetInterface::volume_to_surface_mesh(), libMesh::GmshIO::write_mesh(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), and libMesh::XdrIO::write_serialized_nodes().

829 {
830  return _id;
831 }
dof_id_type _id
The id of the DofObject.
Definition: dof_object.h:583

◆ increment_constructor_count() [1/2]

void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
inlineprotectednoexceptinherited

Increments the construction counter.

Should be called in the constructor of any derived class that will be reference counted.

Definition at line 183 of file reference_counter.h.

References libMesh::err, libMesh::BasicOStreamProxy< charT, traits >::get(), libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

184 {
185  libmesh_try
186  {
187  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188  std::pair<unsigned int, unsigned int> & p = _counts[name];
189  p.first++;
190  }
191  libmesh_catch (...)
192  {
193  auto stream = libMesh::err.get();
194  stream->exceptions(stream->goodbit); // stream must not throw
195  libMesh::err << "Encountered unrecoverable error while calling "
196  << "ReferenceCounter::increment_constructor_count() "
197  << "for a(n) " << name << " object." << std::endl;
198  std::terminate();
199  }
200 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
OStreamProxy err
static Counts _counts
Actually holds the data.
streamT * get()
Rather than implement every ostream/ios/ios_base function, we&#39;ll be lazy and make esoteric uses go th...
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:30

◆ increment_constructor_count() [2/2]

void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
inlineprotectednoexceptinherited

Increments the construction counter.

Should be called in the constructor of any derived class that will be reference counted.

Definition at line 183 of file reference_counter.h.

References libMesh::err, libMesh::BasicOStreamProxy< charT, traits >::get(), libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

184 {
185  libmesh_try
186  {
187  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188  std::pair<unsigned int, unsigned int> & p = _counts[name];
189  p.first++;
190  }
191  libmesh_catch (...)
192  {
193  auto stream = libMesh::err.get();
194  stream->exceptions(stream->goodbit); // stream must not throw
195  libMesh::err << "Encountered unrecoverable error while calling "
196  << "ReferenceCounter::increment_constructor_count() "
197  << "for a(n) " << name << " object." << std::endl;
198  std::terminate();
199  }
200 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
OStreamProxy err
static Counts _counts
Actually holds the data.
streamT * get()
Rather than implement every ostream/ios/ios_base function, we&#39;ll be lazy and make esoteric uses go th...
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:30

◆ increment_destructor_count() [1/2]

void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
inlineprotectednoexceptinherited

Increments the destruction counter.

Should be called in the destructor of any derived class that will be reference counted.

Definition at line 207 of file reference_counter.h.

References libMesh::err, libMesh::BasicOStreamProxy< charT, traits >::get(), libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

208 {
209  libmesh_try
210  {
211  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
212  std::pair<unsigned int, unsigned int> & p = _counts[name];
213  p.second++;
214  }
215  libmesh_catch (...)
216  {
217  auto stream = libMesh::err.get();
218  stream->exceptions(stream->goodbit); // stream must not throw
219  libMesh::err << "Encountered unrecoverable error while calling "
220  << "ReferenceCounter::increment_destructor_count() "
221  << "for a(n) " << name << " object." << std::endl;
222  std::terminate();
223  }
224 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
OStreamProxy err
static Counts _counts
Actually holds the data.
streamT * get()
Rather than implement every ostream/ios/ios_base function, we&#39;ll be lazy and make esoteric uses go th...
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:30

◆ increment_destructor_count() [2/2]

void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
inlineprotectednoexceptinherited

Increments the destruction counter.

Should be called in the destructor of any derived class that will be reference counted.

Definition at line 207 of file reference_counter.h.

References libMesh::err, libMesh::BasicOStreamProxy< charT, traits >::get(), libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

208 {
209  libmesh_try
210  {
211  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
212  std::pair<unsigned int, unsigned int> & p = _counts[name];
213  p.second++;
214  }
215  libmesh_catch (...)
216  {
217  auto stream = libMesh::err.get();
218  stream->exceptions(stream->goodbit); // stream must not throw
219  libMesh::err << "Encountered unrecoverable error while calling "
220  << "ReferenceCounter::increment_destructor_count() "
221  << "for a(n) " << name << " object." << std::endl;
222  std::terminate();
223  }
224 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
OStreamProxy err
static Counts _counts
Actually holds the data.
streamT * get()
Rather than implement every ostream/ios/ios_base function, we&#39;ll be lazy and make esoteric uses go th...
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:30

◆ infinite() [1/2]

virtual bool libMesh::Cell::infinite ( ) const
inlineoverridevirtualinherited
Returns
false. All classes derived from Cell are finite elements.

Implements libMesh::Elem.

Definition at line 75 of file cell.h.

75 { return false; }

◆ infinite() [2/2]

static constexpr bool libMesh::Elem::infinite ( )
inlinestaticinherited

Definition at line 1899 of file elem.h.

1899 { return false; }

◆ interior_parent() [1/2]

const Elem * libMesh::Elem::interior_parent ( ) const
inherited
Returns
The higher-dimensional Elem for which this Elem is a face.

In some cases it is desirable to extract the boundary (or a subset thereof) of a D-dimensional mesh as a (D-1)-dimensional manifold. In this case we may want to know the 'parent' element from which the manifold elements were extracted. We can easily do that for the level-0 manifold elements by storing the D-dimensional parent. This method provides access to that element.

This method returns nullptr if this->dim() == LIBMESH_DIM; in such cases no data storage for an interior parent pointer has been allocated.

Definition at line 1189 of file elem.C.

References libMesh::Elem::_elemlinks, libMesh::Elem::dim(), libMesh::DofObject::id(), libMesh::DofObject::invalid_id, libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::n_sides(), and libMesh::remote_elem.

Referenced by libMesh::FEMap::compute_face_map(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::InfFE< Dim, T_radial, T_map >::init_face_shape_functions(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::GhostPointNeighbors::operator()(), BoundaryMeshTest::sanityCheck(), libMesh::Elem::topologically_equal(), libMesh::BoundaryVolumeSolutionTransfer::transfer_boundary_volume(), and libMesh::BoundaryVolumeSolutionTransfer::transfer_volume_boundary().

1190 {
1191  // interior parents make no sense for full-dimensional elements.
1192  if (this->dim() >= LIBMESH_DIM)
1193  return nullptr;
1194 
1195  // they USED TO BE only good for level-0 elements, but we now
1196  // support keeping interior_parent() valid on refined boundary
1197  // elements.
1198  // if (this->level() != 0)
1199  // return this->parent()->interior_parent();
1200 
1201  // We store the interior_parent pointer after both the parent
1202  // neighbor and neighbor pointers
1203  Elem * interior_p = _elemlinks[1+this->n_sides()];
1204 
1205  // If we have an interior_parent, we USED TO assume it was a
1206  // one-higher-dimensional interior element, but we now allow e.g.
1207  // edge elements to have a 3D interior_parent with no
1208  // intermediate 2D element.
1209  // libmesh_assert (!interior_p ||
1210  // interior_p->dim() == (this->dim()+1));
1211  libmesh_assert (!interior_p ||
1212  (interior_p == remote_elem) ||
1213  (interior_p->dim() > this->dim()));
1214 
1215  // If an element in a multi-dimensional mesh has an interior_parent
1216  // link, it should be at our level or coarser, just like a neighbor
1217  // link. Our collect_families() code relies on this, but it might
1218  // be tempting for users to manually assign something that breaks
1219  // it.
1220  //
1221  // However, we *also* create temporary side elements, and we don't
1222  // bother with creating ancestors for those, so they can be at level
1223  // 0 even when they're sides of non-level-0 elements.
1224  libmesh_assert (!interior_p ||
1225  (interior_p->level() <= this->level()) ||
1226  (this->level() == 0 &&
1227  this->id() == DofObject::invalid_id));
1228 
1229  return interior_p;
1230 }
dof_id_type id() const
Definition: dof_object.h:828
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2233
libmesh_assert(ctx)
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360
virtual unsigned int n_sides() const =0
unsigned int level() const
Definition: elem.h:3071
virtual unsigned short dim() const =0
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ interior_parent() [2/2]

Elem * libMesh::Elem::interior_parent ( )
inherited

Definition at line 1234 of file elem.C.

References libMesh::Elem::_elemlinks, libMesh::Elem::dim(), libMesh::libmesh_assert(), libMesh::Elem::n_sides(), and libMesh::remote_elem.

1235 {
1236  // See the const version for comments
1237  if (this->dim() >= LIBMESH_DIM)
1238  return nullptr;
1239 
1240  Elem * interior_p = _elemlinks[1+this->n_sides()];
1241 
1242  libmesh_assert (!interior_p ||
1243  (interior_p == remote_elem) ||
1244  (interior_p->dim() > this->dim()));
1245 
1246  return interior_p;
1247 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2233
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360
virtual unsigned int n_sides() const =0
virtual unsigned short dim() const =0
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ invalidate()

void libMesh::DofObject::invalidate ( )
inlineinherited

Invalidates all the indices for this DofObject.

Definition at line 788 of file dof_object.h.

References libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::invalidate_id(), and libMesh::DofObject::invalidate_processor_id().

Referenced by libMesh::DofObject::DofObject().

789 {
790  this->invalidate_dofs ();
791  this->invalidate_id ();
792  this->invalidate_processor_id ();
793 }
void invalidate_id()
Sets the id to invalid_id.
Definition: dof_object.h:772
void invalidate_processor_id()
Sets the processor id to invalid_processor_id.
Definition: dof_object.h:780
void invalidate_dofs(const unsigned int sys_num=libMesh::invalid_uint)
Sets all degree of freedom numbers to invalid_id.
Definition: dof_object.h:751

◆ invalidate_dofs()

void libMesh::DofObject::invalidate_dofs ( const unsigned int  sys_num = libMesh::invalid_uint)
inlineinherited

Sets all degree of freedom numbers to invalid_id.

Definition at line 751 of file dof_object.h.

References libMesh::DofObject::invalid_id, libMesh::make_range(), libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), and libMesh::DofObject::set_vg_dof_base().

Referenced by libMesh::DofObject::invalidate().

752 {
753  const unsigned int n_sys = this->n_systems();
754  // If the user does not specify the system number...
755  if (sys_num >= n_sys)
756  {
757  for (auto s : make_range(n_sys))
758  for (auto vg : make_range(this->n_var_groups(s)))
759  if (this->n_comp_group(s,vg))
760  this->set_vg_dof_base(s,vg,invalid_id);
761  }
762  // ...otherwise invalidate the dofs for all systems
763  else
764  for (auto vg : make_range(this->n_var_groups(sys_num)))
765  if (this->n_comp_group(sys_num,vg))
766  this->set_vg_dof_base(sys_num,vg,invalid_id);
767 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:957
void set_vg_dof_base(const unsigned int s, const unsigned int vg, const dof_id_type db)
VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for di...
Definition: dof_object.h:1297
unsigned int n_systems() const
Definition: dof_object.h:937
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482
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...
Definition: int_range.h:140
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1015

◆ invalidate_id()

void libMesh::DofObject::invalidate_id ( )
inlineinherited

Sets the id to invalid_id.

Definition at line 772 of file dof_object.h.

References libMesh::DofObject::invalid_id, and libMesh::DofObject::set_id().

Referenced by libMesh::DofObject::invalidate(), and DofObjectTest< Node >::testInvalidateId().

773 {
774  this->set_id (invalid_id);
775 }
dof_id_type & set_id()
Definition: dof_object.h:836
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482

◆ invalidate_processor_id()

void libMesh::DofObject::invalidate_processor_id ( )
inlineinherited

Sets the processor id to invalid_processor_id.

Definition at line 780 of file dof_object.h.

References libMesh::DofObject::invalid_processor_id, and libMesh::DofObject::processor_id().

Referenced by libMesh::DofObject::invalidate(), libMesh::Partitioner::set_parent_processor_ids(), and DofObjectTest< Node >::testInvalidateProcId().

781 {
783 }
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
Definition: dof_object.h:493
processor_id_type processor_id() const
Definition: dof_object.h:905

◆ is_ancestor_of()

bool libMesh::Elem::is_ancestor_of ( const Elem descendant) const
inlineinherited
Returns
true if descendant is a child of this, or a child of a child of this, etc., false otherwise or if AMR is disabled.

Definition at line 3006 of file elem.h.

References libMesh::Elem::parent().

Referenced by libMesh::UnstructuredMesh::find_neighbors().

3011 {
3012 #ifdef LIBMESH_ENABLE_AMR
3013  const Elem * e = descendant;
3014  while (e)
3015  {
3016  if (this == e)
3017  return true;
3018  e = e->parent();
3019  }
3020 #endif
3021  return false;
3022 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360

◆ is_child_on_edge()

bool libMesh::Elem::is_child_on_edge ( const unsigned int  c,
const unsigned int  e 
) const
virtualinherited
Returns
true if the specified child is on the specified edge.

Definition at line 2309 of file elem.C.

References libMesh::Elem::build_edge_ptr(), libMesh::Elem::child_ptr(), libMesh::Elem::n_children(), and libMesh::Elem::n_edges().

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), libMesh::BoundaryInfo::edge_boundary_ids(), and libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectEdges::operator()().

2311 {
2312  libmesh_assert_less (c, this->n_children());
2313  libmesh_assert_less (e, this->n_edges());
2314 
2315  std::unique_ptr<const Elem> my_edge = this->build_edge_ptr(e);
2316  std::unique_ptr<const Elem> child_edge = this->child_ptr(c)->build_edge_ptr(e);
2317 
2318  // We're assuming that an overlapping child edge has the same
2319  // number and orientation as its parent
2320  return (child_edge->node_id(0) == my_edge->node_id(0) ||
2321  child_edge->node_id(1) == my_edge->node_id(1));
2322 }
virtual unsigned int n_children() const =0
virtual unsigned int n_edges() const =0
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i)=0
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:3160

◆ is_child_on_side()

bool libMesh::Pyramid::is_child_on_side ( const unsigned int  c,
const unsigned int  s 
) const
overridevirtualinherited
Returns
true if the specified child is on the specified side.

Implements libMesh::Elem.

Definition at line 237 of file cell_pyramid.C.

References libMesh::Pyramid::n_children(), libMesh::Pyramid::n_sides(), and libMesh::Pyramid5::side_nodes_map.

239 {
240  libmesh_assert_less (c, this->n_children());
241  libmesh_assert_less (s, this->n_sides());
242 
243  for (unsigned int i = 0; i != 4; ++i)
244  if (Pyramid5::side_nodes_map[s][i] == c)
245  return true;
246  return false;
247 }
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:90
virtual unsigned int n_children() const override
Definition: cell_pyramid.h:110
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.

◆ is_edge()

bool libMesh::Pyramid18::is_edge ( const unsigned int  i) const
overridevirtual
Returns
true if the specified (local) node number is an edge.

Implements libMesh::Elem.

Definition at line 73 of file cell_pyramid18.C.

74 {
75  if (i < 5)
76  return false;
77  if (i > 12)
78  return false;
79  return true;
80 }

◆ is_edge_on_side()

bool libMesh::Pyramid::is_edge_on_side ( const unsigned int  e,
const unsigned int  s 
) const
overridevirtualinherited
Returns
true if the specified edge is on the specified side.

Implements libMesh::Elem.

Definition at line 251 of file cell_pyramid.C.

References libMesh::Pyramid::edge_sides_map, libMesh::Pyramid::n_edges(), and libMesh::Pyramid::n_sides().

253 {
254  libmesh_assert_less (e, this->n_edges());
255  libmesh_assert_less (s, this->n_sides());
256 
257  return (edge_sides_map[e][0] == s || edge_sides_map[e][1] == s);
258 }
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:90
virtual unsigned int n_edges() const override
Definition: cell_pyramid.h:100
static const unsigned int edge_sides_map[8][2]
This maps each edge to the sides that contain said edge.
Definition: cell_pyramid.h:199

◆ is_face()

bool libMesh::Pyramid18::is_face ( const unsigned int  i) const
overridevirtual
Returns
true if the specified (local) node number is a face.

Implements libMesh::Elem.

Definition at line 84 of file cell_pyramid18.C.

85 {
86  if (i > 12)
87  return true;
88  return false;
89 }

◆ is_flipped()

bool libMesh::Pyramid::is_flipped ( ) const
finaloverridevirtualinherited
Returns
Whether the element is flipped compared to standard libMesh (e.g. clockwise for 2D elements) node orientations.

Always returns false if a 2D element is not in the XY plane or a 1D element is not on the X axis; user code designed to work for embedded manifolds should handle any consistent orientation, and determining whether an orientation is consistent is not a local operation.

Implements libMesh::Elem.

Definition at line 270 of file cell_pyramid.C.

References libMesh::Elem::point(), and libMesh::triple_product().

271 {
272  return (triple_product(this->point(1)-this->point(0),
273  this->point(3)-this->point(0),
274  this->point(4)-this->point(0)) < 0);
275 }
T triple_product(const TypeVector< T > &a, const TypeVector< T > &b, const TypeVector< T > &c)
Definition: type_vector.h:1029
const Point & point(const unsigned int i) const
Definition: elem.h:2422

◆ is_internal()

bool libMesh::Elem::is_internal ( const unsigned int  i) const
inherited
Returns
true if the specified (local) node number is an internal node.

Definition at line 3569 of file elem.C.

References libMesh::Elem::dim(), libMesh::Elem::is_edge(), libMesh::Elem::is_face(), and libMesh::Elem::is_vertex().

Referenced by libMesh::Prism::edges_adjacent_to_node(), libMesh::Hex::edges_adjacent_to_node(), libMesh::InfPrism::edges_adjacent_to_node(), and libMesh::InfHex::edges_adjacent_to_node().

3570 {
3571  switch (this->dim())
3572  {
3573  case 0:
3574  return false;
3575 
3576  case 1:
3577  return !this->is_vertex(i);
3578 
3579  case 2:
3580  return !this->is_vertex(i) && !this->is_edge(i);
3581 
3582  case 3:
3583  return !this->is_vertex(i) && !this->is_edge(i) && !this->is_face(i);
3584 
3585  default:
3586  libmesh_error_msg("impossible element dimension " << std::to_string(this->dim()));
3587  return 0;
3588  }
3589 }
virtual bool is_face(const unsigned int i) const =0
virtual unsigned short dim() const =0
virtual bool is_vertex(const unsigned int i) const =0
virtual bool is_edge(const unsigned int i) const =0

◆ is_linear()

virtual bool libMesh::Elem::is_linear ( ) const
inlinevirtualinherited
Returns
true if the Lagrange shape functions on this element are linear.

Reimplemented in libMesh::NodeElem, libMesh::Tet4, libMesh::Tri3, libMesh::Edge2, and libMesh::Tri3Subdivision.

Definition at line 1194 of file elem.h.

Referenced by libMesh::FEMap::init_reference_to_physical_map().

1194 { return false; }

◆ is_mid_infinite_edge_node()

virtual bool libMesh::Elem::is_mid_infinite_edge_node ( const unsigned int  ) const
inlinevirtualinherited
Returns
true if the specified (local) node number is a "mid-edge" node on an infinite element edge.

This is false for all nodes on non-infinite elements, so we won't make it pure virtual, to simplify their code.

Reimplemented in libMesh::InfEdge2, libMesh::InfQuad, libMesh::InfPrism, and libMesh::InfHex.

Definition at line 1886 of file elem.h.

References libMesh::Elem::infinite(), and libMesh::libmesh_assert().

Referenced by libMesh::Elem::parent_bracketing_nodes().

1887  { libmesh_assert (!this->infinite()); return false; }
libmesh_assert(ctx)
virtual bool infinite() const =0

◆ is_node_on_edge()

bool libMesh::Pyramid18::is_node_on_edge ( const unsigned int  n,
const unsigned int  e 
) const
overridevirtual
Returns
true if the specified (local) node number is on the specified edge.

Implements libMesh::Elem.

Definition at line 117 of file cell_pyramid18.C.

References edge_nodes_map, and libMesh::Pyramid::n_edges().

119 {
120  libmesh_assert_less (e, n_edges());
121  return std::find(std::begin(edge_nodes_map[e]),
122  std::end(edge_nodes_map[e]),
123  n) != std::end(edge_nodes_map[e]);
124 }
static const unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
virtual unsigned int n_edges() const override
Definition: cell_pyramid.h:100

◆ is_node_on_side()

bool libMesh::Pyramid18::is_node_on_side ( const unsigned int  n,
const unsigned int  s 
) const
overridevirtual
Returns
true if the specified (local) node number is on the specified side.

Implements libMesh::Elem.

Definition at line 93 of file cell_pyramid18.C.

References libMesh::Pyramid::n_sides(), and side_nodes_map.

95 {
96  libmesh_assert_less (s, n_sides());
97  return std::find(std::begin(side_nodes_map[s]),
98  std::end(side_nodes_map[s]),
99  n) != std::end(side_nodes_map[s]);
100 }
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:90

◆ is_remote()

virtual bool libMesh::Elem::is_remote ( ) const
inlinevirtualinherited
Returns
true if this element is remote, false otherwise.

A remote element (see RemoteElem) is a syntactic convenience – it is a placeholder for an element which exists on some other processor. Local elements are required to have valid neighbors, and these ghost elements may have remote neighbors for data structure consistency. The use of remote elements helps ensure that any element we may access has a nullptr neighbor only if it lies on the physical boundary of the domain.

Reimplemented in libMesh::RemoteElem.

Definition at line 603 of file elem.h.

Referenced by libMesh::Elem::make_links_to_me_local().

604  { return false; }

◆ is_semilocal()

bool libMesh::Elem::is_semilocal ( const processor_id_type  my_pid) const
inherited
Returns
true if this element is "semilocal" to the calling processor, which must specify its rank.

This method is discouraged, as it uses the old definition of semilocal (elements which are not local but which are point neighbors of something local) rather than any of the new definitions discussed in ghosting_functor.h

Definition at line 858 of file elem.C.

References libMesh::Elem::find_point_neighbors().

859 {
860  std::set<const Elem *> point_neighbors;
861 
862  this->find_point_neighbors(point_neighbors);
863 
864  for (const auto & elem : point_neighbors)
865  if (elem->processor_id() == my_pid)
866  return true;
867 
868  return false;
869 }
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...
Definition: elem.C:996

◆ is_singular_node()

virtual bool libMesh::Pyramid::is_singular_node ( unsigned int  node_idx) const
inlinefinaloverridevirtualinherited
Returns
true iff the node at the given index has a singular mapping; i.e. is the degree-4 node on a Pyramid.

Reimplemented from libMesh::Elem.

Definition at line 185 of file cell_pyramid.h.

185 { return (node_idx == 4); }

◆ is_vertex()

bool libMesh::Pyramid18::is_vertex ( const unsigned int  i) const
overridevirtual
Returns
true if the specified (local) node number is a vertex.

Implements libMesh::Elem.

Definition at line 64 of file cell_pyramid18.C.

65 {
66  if (i < 5)
67  return true;
68  return false;
69 }

◆ is_vertex_on_child()

virtual bool libMesh::Elem::is_vertex_on_child ( unsigned  int,
unsigned int  n 
) const
inlinevirtualinherited
Returns
true if the specified child has a vertex at the specified (child-local) node number. Except in odd cases like pyramid refinement the child will have the same local structure as the parent element.

Definition at line 768 of file elem.h.

References libMesh::Elem::is_vertex().

Referenced by libMesh::Elem::parent_bracketing_nodes().

770  { return this->is_vertex(n); }
virtual bool is_vertex(const unsigned int i) const =0

◆ is_vertex_on_parent()

bool libMesh::Elem::is_vertex_on_parent ( unsigned int  c,
unsigned int  n 
) const
virtualinherited
Returns
true if this element has a vertex at the specified (child-local) node number n of the specified child c.

Definition at line 3490 of file elem.C.

References libMesh::Elem::child_ptr(), libMesh::libmesh_ignore(), libMesh::Elem::n_vertices(), and libMesh::Elem::node_ptr().

Referenced by libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()().

3492 {
3493 #ifdef LIBMESH_ENABLE_AMR
3494 
3495  unsigned int my_n_vertices = this->n_vertices();
3496  for (unsigned int n_parent = 0; n_parent != my_n_vertices;
3497  ++n_parent)
3498  if (this->node_ptr(n_parent) == this->child_ptr(c)->node_ptr(n))
3499  return true;
3500  return false;
3501 
3502 #else
3503 
3504  // No AMR?
3505  libmesh_ignore(c,n);
3506  libmesh_error_msg("ERROR: AMR disabled, how did we get here?");
3507  return true;
3508 
3509 #endif
3510 }
void libmesh_ignore(const Args &...)
virtual unsigned int n_vertices() const =0
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2476
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:3160

◆ key() [1/5]

dof_id_type libMesh::Elem::key

Don't hide Pyramid::key() defined in the base class.

Definition at line 756 of file elem.C.

757 {
758  const unsigned short n_n = this->n_nodes();
759 
760  std::array<dof_id_type, Elem::max_n_nodes> node_ids;
761 
762  for (unsigned short n=0; n != n_n; ++n)
763  node_ids[n] = this->node_id(n);
764 
765  // Always sort, so that different local node numberings hash to the
766  // same value.
767  std::sort (node_ids.begin(), node_ids.begin()+n_n);
768 
769  return Utility::hashword(node_ids.data(), n_n);
770 }
virtual unsigned int n_nodes() const override
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval=0)
The hashword function takes an array of uint32_t&#39;s of length &#39;length&#39; and computes a single key from ...
Definition: hashword.h:158
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2444

◆ key() [2/5]

dof_id_type libMesh::Pyramid::key
override

Don't hide Pyramid::key() defined in the base class.

Definition at line 77 of file cell_pyramid.C.

78 {
79  libmesh_assert_less (s, this->n_sides());
80 
81  switch (s)
82  {
83  case 0: // triangular face 1
84  case 1: // triangular face 2
85  case 2: // triangular face 3
86  case 3: // triangular face 4
87  return this->compute_key (this->node_id(Pyramid5::side_nodes_map[s][0]),
88  this->node_id(Pyramid5::side_nodes_map[s][1]),
89  this->node_id(Pyramid5::side_nodes_map[s][2]));
90 
91  case 4: // the quad face at z=0
92  return this->compute_key (this->node_id(Pyramid5::side_nodes_map[s][0]),
93  this->node_id(Pyramid5::side_nodes_map[s][1]),
94  this->node_id(Pyramid5::side_nodes_map[s][2]),
95  this->node_id(Pyramid5::side_nodes_map[s][3]));
96 
97  default:
98  libmesh_error_msg("Invalid side s = " << s);
99  }
100 }
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:90
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
static dof_id_type compute_key(dof_id_type n0)
Definition: elem.h:3291
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2444

◆ key() [3/5]

virtual dof_id_type libMesh::Elem::key

Don't hide Pyramid::key() defined in the base class.

◆ key() [4/5]

dof_id_type libMesh::Pyramid18::key ( const unsigned int  s) const
overridevirtual
Returns
An id associated with the s side of this element. The id is not necessarily unique, but should be close.

We reimplement this method here for the Pyramid18 since we can use the center node of the base face to provide a perfect (unique) key.

Reimplemented from libMesh::Pyramid.

Definition at line 144 of file cell_pyramid18.C.

References libMesh::Elem::compute_key(), libMesh::Pyramid::n_sides(), and libMesh::Elem::node_id().

145 {
146  libmesh_assert_less (s, this->n_sides());
147 
148  switch (s)
149  {
150  case 0: // triangular face 1
151  case 1: // triangular face 2
152  case 2: // triangular face 3
153  case 3: // triangular face 4
154  return this->compute_key (this->node_id(s+14));
155 
156  case 4: // the quad face at z=0
157  return this->compute_key (this->node_id(13));
158 
159  default:
160  libmesh_error_msg("Invalid side s = " << s);
161  }
162 }
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:90
static dof_id_type compute_key(dof_id_type n0)
Definition: elem.h:3291
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2444

◆ key() [5/5]

dof_id_type libMesh::Elem::key ( ) const
virtualinherited
Returns
An id associated with the global node ids of this element. The id is not necessarily unique, but should be close. Uses the same hash as the key(s) function, so for example if "tri3" is side 0 of "tet4", then tri3->key()==tet4->key(0).

Reimplemented in libMesh::Tet4, libMesh::Edge3, libMesh::Edge4, libMesh::Edge2, libMesh::Quad9, libMesh::Quad, libMesh::Polyhedron, libMesh::Polygon, and libMesh::Tri.

Definition at line 756 of file elem.C.

References libMesh::Utility::hashword(), libMesh::Elem::n_nodes(), and libMesh::Elem::node_id().

Referenced by libMesh::InfQuad6::key(), libMesh::Prism18::key(), libMesh::Pyramid14::key(), and libMesh::InfHex18::key().

757 {
758  const unsigned short n_n = this->n_nodes();
759 
760  std::array<dof_id_type, Elem::max_n_nodes> node_ids;
761 
762  for (unsigned short n=0; n != n_n; ++n)
763  node_ids[n] = this->node_id(n);
764 
765  // Always sort, so that different local node numberings hash to the
766  // same value.
767  std::sort (node_ids.begin(), node_ids.begin()+n_n);
768 
769  return Utility::hashword(node_ids.data(), n_n);
770 }
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval=0)
The hashword function takes an array of uint32_t&#39;s of length &#39;length&#39; and computes a single key from ...
Definition: hashword.h:158
virtual unsigned int n_nodes() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2444

◆ length()

Real libMesh::Elem::length ( const unsigned int  n1,
const unsigned int  n2 
) const
inherited
Returns
The distance between nodes n1 and n2.

Useful for computing the lengths of the sides of elements.

Definition at line 745 of file elem.C.

References libMesh::Elem::n_vertices(), and libMesh::Elem::point().

Referenced by libMesh::Hex::quality(), libMesh::Quad::quality(), and libMesh::InfHex::quality().

747 {
748  libmesh_assert_less ( n1, this->n_vertices() );
749  libmesh_assert_less ( n2, this->n_vertices() );
750 
751  return (this->point(n1) - this->point(n2)).norm();
752 }
virtual unsigned int n_vertices() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:2422

◆ level()

unsigned int libMesh::Elem::level ( ) const
inlineinherited
Returns
The refinement level of the current element.

If the element's parent is nullptr then by convention it is at level 0, otherwise it is simply at one level greater than its parent.

Definition at line 3071 of file elem.h.

References libMesh::Elem::dim(), libMesh::Elem::level(), and libMesh::Elem::parent().

Referenced by libMesh::BoundaryInfo::add_edge(), libMesh::BoundaryInfo::add_shellface(), libMesh::BoundaryInfo::add_side(), assemble_ellipticdg(), libMesh::BoundaryInfo::boundary_ids(), libMesh::EquationSystems::build_discontinuous_solution_vector(), compute_jacobian(), libMesh::FEAbstract::compute_node_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), compute_residual(), libMesh::Elem::contains_vertex_of(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::Elem::get_info(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_constraints(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_node_constraints(), libMesh::Poly2TriTriangulator::insert_refinement_points(), libMesh::Elem::interior_parent(), libMesh::Elem::level(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::nullify_neighbors(), libMesh::CompareElemIdsByLevel::operator()(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::BoundaryInfo::remove_edge(), libMesh::Elem::remove_links_to_me(), libMesh::BoundaryInfo::remove_shellface(), libMesh::BoundaryInfo::remove_side(), BoundaryMeshTest::sanityCheck(), libMesh::BoundaryInfo::shellface_boundary_ids(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::BoundaryInfo::sides_with_boundary_id(), libMesh::UnstructuredMesh::stitching_helper(), libMesh::MeshRefinement::test_level_one(), libMesh::Elem::top_parent(), libMesh::Elem::topological_neighbor(), libMesh::MeshTetInterface::volume_to_surface_mesh(), and libMesh::Elem::which_neighbor_am_i().

3072 {
3073 #ifdef LIBMESH_ENABLE_AMR
3074 
3075  // if I don't have a parent I was
3076  // created directly from file
3077  // or by the user, so I am a
3078  // level-0 element
3079  if (this->parent() == nullptr)
3080  return 0;
3081 
3082  // if the parent and this element are of different
3083  // dimensionality we are at the same level as
3084  // the parent (e.g. we are the 2D side of a
3085  // 3D element)
3086  if (this->dim() != this->parent()->dim())
3087  return this->parent()->level();
3088 
3089  // otherwise we are at a level one
3090  // higher than our parent
3091  return (this->parent()->level() + 1);
3092 
3093 #else
3094 
3095  // Without AMR all elements are
3096  // at level 0.
3097  return 0;
3098 
3099 #endif
3100 }
const Elem * parent() const
Definition: elem.h:3027
unsigned int level() const
Definition: elem.h:3071
virtual unsigned short dim() const =0

◆ libmesh_assert_valid_neighbors()

void libMesh::Elem::libmesh_assert_valid_neighbors ( ) const
inherited

Checks for consistent neighbor links on this element.

Definition at line 1386 of file elem.C.

References libMesh::Elem::dim(), libMesh::libmesh_assert(), libMesh::Elem::n_neighbors(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::parent(), libMesh::remote_elem, libMesh::Elem::side_index_range(), libMesh::Elem::subactive(), and libMesh::Elem::which_neighbor_am_i().

1387 {
1388  for (auto n : this->side_index_range())
1389  {
1390  const Elem * neigh = this->neighbor_ptr(n);
1391 
1392  // Any element might have a remote neighbor; checking
1393  // to make sure that's not inaccurate is tough.
1394  if (neigh == remote_elem)
1395  continue;
1396 
1397  if (neigh)
1398  {
1399  // Only subactive elements have subactive neighbors
1400  libmesh_assert (this->subactive() || !neigh->subactive());
1401 
1402  const Elem * elem = this;
1403 
1404  // If we're subactive but our neighbor isn't, its
1405  // return neighbor link will be to our first active
1406  // ancestor OR to our inactive ancestor of the same
1407  // level as neigh,
1408  if (this->subactive() && !neigh->subactive())
1409  {
1410  for (elem = this; !elem->active();
1411  elem = elem->parent())
1412  libmesh_assert(elem);
1413  }
1414  else
1415  {
1416  unsigned int rev = neigh->which_neighbor_am_i(elem);
1417  libmesh_assert_less (rev, neigh->n_neighbors());
1418 
1419  if (this->subactive() && !neigh->subactive())
1420  {
1421  while (neigh->neighbor_ptr(rev) != elem)
1422  {
1423  libmesh_assert(elem->parent());
1424  elem = elem->parent();
1425  }
1426  }
1427  else
1428  {
1429  const Elem * nn = neigh->neighbor_ptr(rev);
1430  libmesh_assert(nn);
1431 
1432  for (; elem != nn; elem = elem->parent())
1433  libmesh_assert(elem);
1434  }
1435  }
1436  }
1437  // If we don't have a neighbor and we're not subactive, our
1438  // ancestors shouldn't have any neighbors in this same
1439  // direction.
1440  else if (!this->subactive())
1441  {
1442  const Elem * my_parent = this->parent();
1443  if (my_parent &&
1444  // A parent with a different dimension isn't really one of
1445  // our ancestors, it means we're on a boundary mesh and this
1446  // is an interior mesh element for which we're on a side.
1447  // Nothing to test for in that case.
1448  (my_parent->dim() == this->dim()))
1449  libmesh_assert (!my_parent->neighbor_ptr(n));
1450  }
1451  }
1452 }
const Elem * parent() const
Definition: elem.h:3027
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2670
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2567
virtual unsigned short dim() const =0
bool subactive() const
Definition: elem.h:2956
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ libmesh_assert_valid_node_pointers()

void libMesh::Elem::libmesh_assert_valid_node_pointers ( ) const
inherited

Checks for a valid id and pointers to nodes with valid ids on this element.

Definition at line 1374 of file elem.C.

References libMesh::libmesh_assert(), libMesh::Elem::node_index_range(), libMesh::Elem::node_ptr(), and libMesh::DofObject::valid_id().

1375 {
1376  libmesh_assert(this->valid_id());
1377  for (auto n : this->node_index_range())
1378  {
1379  libmesh_assert(this->node_ptr(n));
1380  libmesh_assert(this->node_ptr(n)->valid_id());
1381  }
1382 }
libmesh_assert(ctx)
bool valid_id() const
Definition: dof_object.h:885
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2476
IntRange< unsigned short > node_index_range() const
Definition: elem.h:2652

◆ local_edge_node()

unsigned int libMesh::Pyramid18::local_edge_node ( unsigned int  edge,
unsigned int  edge_node 
) const
overridevirtual
Returns
Pyramid18::edge_nodes_map[edge][edge_node] after doing some range checking.

Reimplemented from libMesh::Pyramid.

Definition at line 182 of file cell_pyramid18.C.

References edge_nodes_map, libMesh::Pyramid::n_edges(), and nodes_per_edge.

184 {
185  libmesh_assert_less(edge, this->n_edges());
186  libmesh_assert_less(edge_node, Pyramid18::nodes_per_edge);
187 
188  return Pyramid18::edge_nodes_map[edge][edge_node];
189 }
static const unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
virtual unsigned int n_edges() const override
Definition: cell_pyramid.h:100
static const int nodes_per_edge

◆ local_node()

unsigned int libMesh::Elem::local_node ( const dof_id_type  i) const
inlineinherited
Returns
The local id number of global Node id i, or invalid_uint if Node id i is not local.

Definition at line 2456 of file elem.h.

References libMesh::invalid_uint, libMesh::make_range(), libMesh::Elem::n_nodes(), and libMesh::Elem::node_id().

Referenced by libMesh::UnstructuredMesh::stitching_helper().

2457 {
2458  for (auto n : make_range(this->n_nodes()))
2459  if (this->node_id(n) == i)
2460  return n;
2461 
2462  return libMesh::invalid_uint;
2463 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:310
virtual unsigned int n_nodes() const =0
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...
Definition: int_range.h:140
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2444

◆ local_side_node()

unsigned int libMesh::Pyramid18::local_side_node ( unsigned int  side,
unsigned int  side_node 
) const
overridevirtual
Returns
Pyramid18::side_nodes_map[side][side_node] after doing some range checking.

Reimplemented from libMesh::Pyramid.

Definition at line 166 of file cell_pyramid18.C.

References libMesh::libmesh_assert(), libMesh::Pyramid::n_sides(), nodes_per_side, and side_nodes_map.

168 {
169  libmesh_assert_less (side, this->n_sides());
170 
171  // Never more than 9 nodes per side.
172  libmesh_assert_less(side_node, Pyramid18::nodes_per_side);
173 
174  // Some sides have 7 nodes.
175  libmesh_assert(side == 4 || side_node < 7);
176 
177  return Pyramid18::side_nodes_map[side][side_node];
178 }
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
static const int nodes_per_side
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:90
libmesh_assert(ctx)

◆ local_singular_node()

unsigned int libMesh::Pyramid::local_singular_node ( const Point p,
const Real  tol = TOLERANCE*TOLERANCE 
) const
finaloverridevirtualinherited
Returns
Node 4 (the apex) if is at the apex within the tolerance tol. If is not at the apex within the tolerance tol, will return invalid_uint.

The Jacobian at the apex is singular because directional derivatives are defined in four directions, independently (four edges meet). Therefore, we can check for this in a caught, failed inverse mapping and return the correct point without failure if it is the apex. This behavior does require exceptions to be enabled.

Reimplemented from libMesh::Elem.

Definition at line 294 of file cell_pyramid.C.

References libMesh::TypeVector< T >::absolute_fuzzy_equals(), libMesh::invalid_uint, and libMesh::Elem::node_ref().

295 {
296  return this->node_ref(4).absolute_fuzzy_equals(p, tol) ? 4 : invalid_uint;
297 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:310
const Node & node_ref(const unsigned int i) const
Definition: elem.h:2498
bool absolute_fuzzy_equals(const TypeVector< T > &rhs, Real tol=TOLERANCE) const
Definition: type_vector.h:972

◆ loose_bounding_box()

BoundingBox libMesh::Cell::loose_bounding_box ( ) const
overridevirtualinherited
Returns
A bounding box (not necessarily the minimal bounding box) containing the geometric element.

Reimplemented from libMesh::Elem.

Reimplemented in libMesh::Hex8, libMesh::Prism6, and libMesh::Pyramid5.

Definition at line 26 of file cell.C.

References libMesh::Elem::build_side_ptr(), libMesh::Elem::n_sides(), libMesh::Elem::side_ptr(), and libMesh::BoundingBox::union_with().

27 {
28  // This might have curved sides, but it's definitely *not* curving
29  // through 4-D space, so the full bounding box is just the merger of
30  // the sides' bounding boxes.
31 
32  std::unique_ptr<const Elem> side_ptr { this->build_side_ptr(0, false) };
33  BoundingBox bbox = side_ptr->loose_bounding_box();
34  unsigned int my_n_sides = this->n_sides();
35  for (unsigned s=1; s < my_n_sides; ++s)
36  {
37  this->build_side_ptr(side_ptr, s);
38  bbox.union_with(side_ptr->loose_bounding_box());
39  }
40 
41  return bbox;
42 }
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=false)=0
virtual unsigned int n_sides() const =0
virtual std::unique_ptr< Elem > side_ptr(unsigned int i)=0

◆ low_order_key()

dof_id_type libMesh::Pyramid::low_order_key ( const unsigned int  s) const
overridevirtualinherited
Returns
An id associated with the s side of this element, as defined solely by element vertices. The id is not necessarily unique, but should be close. This is particularly useful in the MeshBase::find_neighbors() routine.

Implements libMesh::Elem.

Definition at line 104 of file cell_pyramid.C.

References libMesh::Elem::compute_key(), libMesh::Pyramid::n_sides(), libMesh::Elem::node_id(), and libMesh::Pyramid5::side_nodes_map.

105 {
106  libmesh_assert_less (s, this->n_sides());
107 
108  switch (s)
109  {
110  case 0: // triangular face 1
111  case 1: // triangular face 2
112  case 2: // triangular face 3
113  case 3: // triangular face 4
114  return this->compute_key (this->node_id(Pyramid5::side_nodes_map[s][0]),
115  this->node_id(Pyramid5::side_nodes_map[s][1]),
116  this->node_id(Pyramid5::side_nodes_map[s][2]));
117 
118  case 4: // the quad face at z=0
119  return this->compute_key (this->node_id(Pyramid5::side_nodes_map[s][0]),
120  this->node_id(Pyramid5::side_nodes_map[s][1]),
121  this->node_id(Pyramid5::side_nodes_map[s][2]),
122  this->node_id(Pyramid5::side_nodes_map[s][3]));
123 
124  default:
125  libmesh_error_msg("Invalid side s = " << s);
126  }
127 }
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:90
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
static dof_id_type compute_key(dof_id_type n0)
Definition: elem.h:3291
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2444

◆ make_links_to_me_local()

void libMesh::Elem::make_links_to_me_local ( unsigned int  n,
unsigned int  neighbor_side 
)
inherited

Resets the neighbor_side pointers of our nth neighbor (and its descendants, if appropriate) to point to this Elem instead of to the global remote_elem.

Used by the library when a formerly remote element is being added to the local processor.

Definition at line 1458 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::family_tree_by_side(), libMesh::Elem::has_children(), libMesh::Elem::is_remote(), libMesh::Elem::JUST_REFINED, libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::parent(), libMesh::Elem::refinement_flag(), libMesh::remote_elem, and libMesh::Elem::subactive().

1459 {
1460  Elem * neigh = this->neighbor_ptr(n);
1461 
1462  // Don't bother calling this function unless it's necessary
1463  libmesh_assert(neigh);
1464  libmesh_assert(!neigh->is_remote());
1465 
1466  // We never have neighbors more refined than us
1467  libmesh_assert_less_equal (neigh->level(), this->level());
1468 
1469  // We never have subactive neighbors of non subactive elements
1470  libmesh_assert(!neigh->subactive() || this->subactive());
1471 
1472  // If we have a neighbor less refined than us then it must not
1473  // have any more refined descendants we could have pointed to
1474  // instead.
1475  libmesh_assert((neigh->level() == this->level()) ||
1476  (neigh->active() && !this->subactive()) ||
1477  (!neigh->has_children() && this->subactive()));
1478 
1479  // If neigh is at our level, then its family might have
1480  // remote_elem neighbor links which need to point to us
1481  // instead, but if not, then we're done.
1482  if (neigh->level() != this->level())
1483  return;
1484 
1485  // What side of neigh are we on? nn.
1486  //
1487  // We can't use the usual Elem method because we're in the middle of
1488  // restoring topology. We can't compare side_ptr nodes because
1489  // users want to abuse neighbor_ptr to point to
1490  // not-technically-neighbors across mesh slits. We can't compare
1491  // node locations because users want to move those
1492  // not-technically-neighbors until they're
1493  // not-even-geometrically-neighbors.
1494 
1495  // Find any elements that ought to point to elem
1496  std::vector<Elem *> neigh_family;
1497 #ifdef LIBMESH_ENABLE_AMR
1498  if (this->active())
1499  neigh->family_tree_by_side(neigh_family, nn);
1500  else
1501 #endif
1502  neigh_family.push_back(neigh);
1503 
1504  // And point them to elem
1505  for (auto & neigh_family_member : neigh_family)
1506  {
1507  // Only subactive elements point to other subactive elements
1508  if (this->subactive() && !neigh_family_member->subactive())
1509  continue;
1510 
1511  // Ideally, the neighbor link ought to either be correct
1512  // already or ought to be to remote_elem.
1513  //
1514  // However, if we're redistributing a newly created elem,
1515  // after an AMR step but before find_neighbors has fixed up
1516  // neighbor links, we might have an out of date neighbor
1517  // link to elem's parent instead.
1518 #ifdef LIBMESH_ENABLE_AMR
1519  libmesh_assert((neigh_family_member->neighbor_ptr(nn) &&
1520  (neigh_family_member->neighbor_ptr(nn)->active() ||
1521  neigh_family_member->neighbor_ptr(nn)->is_ancestor_of(this))) ||
1522  (neigh_family_member->neighbor_ptr(nn) == remote_elem) ||
1523  ((this->refinement_flag() == JUST_REFINED) &&
1524  (this->parent() != nullptr) &&
1525  (neigh_family_member->neighbor_ptr(nn) == this->parent())));
1526 #else
1527  libmesh_assert((neigh_family_member->neighbor_ptr(nn) == this) ||
1528  (neigh_family_member->neighbor_ptr(nn) == remote_elem));
1529 #endif
1530 
1531  neigh_family_member->set_neighbor(nn, this);
1532  }
1533 }
RefinementState refinement_flag() const
Definition: elem.h:3207
const Elem * parent() const
Definition: elem.h:3027
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2567
unsigned int level() const
Definition: elem.h:3071
bool subactive() const
Definition: elem.h:2956
bool active() const
Definition: elem.h:2938
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ make_links_to_me_remote()

void libMesh::Elem::make_links_to_me_remote ( )
inherited

Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's appropriate pointers to point to the global remote_elem instead of this.

Used by the library before an element becomes remote on the local processor.

Definition at line 1536 of file elem.C.

References libMesh::Elem::child_ptr(), libMesh::Elem::child_ref_range(), libMesh::Elem::dim(), libMesh::Elem::has_children(), libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::neighbor_ptr_range(), libMesh::Elem::parent(), libMesh::remote_elem, libMesh::Elem::set_child(), libMesh::Elem::subactive(), and libMesh::Elem::which_child_am_i().

Referenced by libMesh::MeshCommunication::delete_remote_elements().

1537 {
1538  libmesh_assert_not_equal_to (this, remote_elem);
1539 
1540  // We need to have handled any children first
1541 #if defined(LIBMESH_ENABLE_AMR) && defined(DEBUG)
1542  if (this->has_children())
1543  for (auto & child : this->child_ref_range())
1544  libmesh_assert_equal_to (&child, remote_elem);
1545 #endif
1546 
1547  // Remotify any neighbor links
1548  for (auto neigh : this->neighbor_ptr_range())
1549  {
1550  if (neigh && neigh != remote_elem)
1551  {
1552  // My neighbor should never be more refined than me; my real
1553  // neighbor would have been its parent in that case.
1554  libmesh_assert_greater_equal (this->level(), neigh->level());
1555 
1556  if (this->level() == neigh->level() &&
1557  neigh->has_neighbor(this))
1558  {
1559 #ifdef LIBMESH_ENABLE_AMR
1560  // My neighbor may have descendants which also consider me a
1561  // neighbor
1562  std::vector<Elem *> family;
1563  neigh->total_family_tree_by_neighbor (family, this);
1564 
1565  // FIXME - There's a lot of ugly const_casts here; we
1566  // may want to make remote_elem non-const
1567  for (auto & n : family)
1568  {
1569  libmesh_assert (n);
1570  if (n == remote_elem)
1571  continue;
1572  unsigned int my_s = n->which_neighbor_am_i(this);
1573  libmesh_assert_less (my_s, n->n_neighbors());
1574  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1575  n->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1576  }
1577 #else
1578  unsigned int my_s = neigh->which_neighbor_am_i(this);
1579  libmesh_assert_less (my_s, neigh->n_neighbors());
1580  libmesh_assert_equal_to (neigh->neighbor_ptr(my_s), this);
1581  neigh->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1582 #endif
1583  }
1584 #ifdef LIBMESH_ENABLE_AMR
1585  // Even if my neighbor doesn't link back to me, it might
1586  // have subactive descendants which do
1587  else if (neigh->has_children())
1588  {
1589  // If my neighbor at the same level doesn't have me as a
1590  // neighbor, I must be subactive
1591  libmesh_assert(this->level() > neigh->level() ||
1592  this->subactive());
1593 
1594  // My neighbor must have some ancestor of mine as a
1595  // neighbor
1596  Elem * my_ancestor = this->parent();
1597  libmesh_assert(my_ancestor);
1598  while (!neigh->has_neighbor(my_ancestor))
1599  {
1600  my_ancestor = my_ancestor->parent();
1601  libmesh_assert(my_ancestor);
1602  }
1603 
1604  // My neighbor may have descendants which consider me a
1605  // neighbor
1606  std::vector<Elem *> family;
1607  neigh->total_family_tree_by_subneighbor (family, my_ancestor, this);
1608 
1609  for (auto & n : family)
1610  {
1611  libmesh_assert (n);
1612  if (n->is_remote())
1613  continue;
1614  unsigned int my_s = n->which_neighbor_am_i(this);
1615  libmesh_assert_less (my_s, n->n_neighbors());
1616  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1617  // TODO: we may want to make remote_elem non-const.
1618  n->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1619  }
1620  }
1621 #endif
1622  }
1623  }
1624 
1625 #ifdef LIBMESH_ENABLE_AMR
1626  // Remotify parent's child link
1627  Elem * my_parent = this->parent();
1628  if (my_parent &&
1629  // As long as it's not already remote
1630  my_parent != remote_elem &&
1631  // And it's a real parent, not an interior parent
1632  this->dim() == my_parent->dim())
1633  {
1634  unsigned int me = my_parent->which_child_am_i(this);
1635  libmesh_assert_equal_to (my_parent->child_ptr(me), this);
1636  my_parent->set_child(me, const_cast<RemoteElem *>(remote_elem));
1637  }
1638 #endif
1639 }
const Elem * parent() const
Definition: elem.h:3027
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:2328
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360
unsigned int level() const
Definition: elem.h:3071
virtual unsigned short dim() const =0
bool subactive() const
Definition: elem.h:2956
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Returns a range with all neighbors of an element, usable in range-based for loops.
Definition: elem.h:3486
bool has_children() const
Definition: elem.h:2976
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ mapping_data()

unsigned char libMesh::Elem::mapping_data ( ) const
inlineinherited

◆ mapping_type()

ElemMappingType libMesh::Elem::mapping_type ( ) const
inlineinherited
Returns
The value of the mapping type for the element.

Definition at line 3117 of file elem.h.

References libMesh::Elem::_map_type.

Referenced by libMesh::MeshTools::Modification::all_tri(), libMesh::InfHex8::build_edge_ptr(), libMesh::InfPrism6::build_edge_ptr(), libMesh::InfHex18::build_edge_ptr(), libMesh::InfPrism12::build_edge_ptr(), libMesh::InfHex16::build_edge_ptr(), libMesh::InfQuad4::build_side_ptr(), libMesh::InfHex8::build_side_ptr(), libMesh::InfPrism6::build_side_ptr(), libMesh::InfHex18::build_side_ptr(), libMesh::Pyramid5::build_side_ptr(), libMesh::InfQuad6::build_side_ptr(), libMesh::Prism6::build_side_ptr(), libMesh::InfPrism12::build_side_ptr(), libMesh::InfHex16::build_side_ptr(), libMesh::C0Polygon::build_side_ptr(), libMesh::Pyramid13::build_side_ptr(), libMesh::Prism15::build_side_ptr(), libMesh::Prism18::build_side_ptr(), libMesh::Pyramid14::build_side_ptr(), libMesh::Polyhedron::build_side_ptr(), libMesh::Prism20::build_side_ptr(), libMesh::Prism21::build_side_ptr(), build_side_ptr(), libMesh::MeshTools::clear_spline_nodes(), libMesh::C0Polyhedron::disconnected_clone(), libMesh::Elem::disconnected_clone(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::get_info(), libMesh::Quad4::has_invertible_map(), libMesh::Edge3::has_invertible_map(), libMesh::Edge4::has_invertible_map(), libMesh::QComposite< QSubCell >::init(), libMesh::FEMap::map_fe_type(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::FE< Dim, LAGRANGE_VEC >::reinit(), libMesh::Edge::side_ptr(), libMesh::Elem::simple_build_edge_ptr(), libMesh::Elem::simple_build_side_ptr(), libMesh::C0Polyhedron::true_centroid(), libMesh::C0Polygon::true_centroid(), libMesh::C0Polyhedron::volume(), libMesh::C0Polygon::volume(), libMesh::Quad8::volume(), libMesh::Quad9::volume(), libMesh::Tri6::volume(), libMesh::Pyramid13::volume(), libMesh::Hex20::volume(), libMesh::Tet10::volume(), libMesh::Prism15::volume(), libMesh::Pyramid14::volume(), libMesh::Hex27::volume(), and libMesh::Prism18::volume().

3118 {
3119  return static_cast<ElemMappingType>(_map_type);
3120 }
unsigned char _map_type
Mapping function type; currently either 0 (LAGRANGE) or 1 (RATIONAL_BERNSTEIN).
Definition: elem.h:2279
ElemMappingType
Enumeration of possible element master->physical mapping types.

◆ master_point()

virtual Point libMesh::Pyramid::master_point ( const unsigned int  i) const
inlineoverridevirtualinherited
Returns
The Point associated with local Node i, in master element rather than physical coordinates.

Implements libMesh::Elem.

Definition at line 66 of file cell_pyramid.h.

References libMesh::Pyramid::_master_points, and libMesh::Pyramid::n_nodes().

67  {
68  libmesh_assert_less(i, this->n_nodes());
69  return Point(_master_points[i][0],
70  _master_points[i][1],
71  _master_points[i][2]);
72  }
virtual unsigned int n_nodes() const override
Definition: cell_pyramid.h:85
static const Real _master_points[14][3]
Master element node locations.
Definition: cell_pyramid.h:214

◆ max_descendant_p_level()

unsigned int libMesh::Elem::max_descendant_p_level ( ) const
inlineinherited
Returns
The maximum value of the p-refinement levels of an ancestor element's descendants.

Definition at line 3243 of file elem.h.

References libMesh::Elem::_p_level, libMesh::Elem::active(), libMesh::Elem::child_ref_range(), libMesh::libmesh_assert(), libMesh::Elem::p_level(), and libMesh::Elem::subactive().

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values().

3244 {
3245  // This is undefined for subactive elements,
3246  // which have no active descendants
3247  libmesh_assert (!this->subactive());
3248  if (this->active())
3249  return this->p_level();
3250 
3251  unsigned int max_p_level = _p_level;
3252  for (auto & c : child_ref_range())
3253  max_p_level = std::max(max_p_level,
3254  c.max_descendant_p_level());
3255  return max_p_level;
3256 }
unsigned char _p_level
p refinement level - the difference between the polynomial degree on this element and the minimum pol...
Definition: elem.h:2272
unsigned int p_level() const
Definition: elem.h:3105
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:2328
libmesh_assert(ctx)
bool subactive() const
Definition: elem.h:2956
bool active() const
Definition: elem.h:2938

◆ min_new_p_level_by_neighbor()

unsigned int libMesh::Elem::min_new_p_level_by_neighbor ( const Elem neighbor,
unsigned int  current_min 
) const
inherited
Returns
The minimum new p-refinement level (i.e. after refinement and coarsening is done) of elements which are descended from this element and which share a side with the active neighbor.

Definition at line 2355 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ref_range(), libMesh::Elem::COARSEN, libMesh::Elem::has_neighbor(), libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::REFINE, libMesh::remote_elem, and libMesh::Elem::subactive().

2357 {
2358  libmesh_assert(!this->subactive());
2359  libmesh_assert(neighbor_in->active());
2360 
2361  // If we're an active element this is simple
2362  if (this->active())
2363  {
2364  unsigned int new_p_level = this->p_level();
2365  if (this->p_refinement_flag() == Elem::REFINE)
2366  new_p_level += 1;
2367  if (this->p_refinement_flag() == Elem::COARSEN)
2368  {
2369  libmesh_assert_greater (new_p_level, 0);
2370  new_p_level -= 1;
2371  }
2372  return std::min(current_min, new_p_level);
2373  }
2374 
2375  libmesh_assert(has_neighbor(neighbor_in));
2376 
2377  unsigned int min_p_level = current_min;
2378 
2379  for (auto & c : this->child_ref_range())
2380  if (&c != remote_elem && c.has_neighbor(neighbor_in))
2381  min_p_level =
2382  c.min_new_p_level_by_neighbor(neighbor_in, min_p_level);
2383 
2384  return min_p_level;
2385 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2597
RefinementState p_refinement_flag() const
Definition: elem.h:3223
unsigned int p_level() const
Definition: elem.h:3105
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:2328
libmesh_assert(ctx)
bool subactive() const
Definition: elem.h:2956
bool active() const
Definition: elem.h:2938
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ min_p_level_by_neighbor()

unsigned int libMesh::Elem::min_p_level_by_neighbor ( const Elem neighbor,
unsigned int  current_min 
) const
inherited
Returns
The minimum p-refinement level of elements which are descended from this element, and which share a side with the active neighbor.

Definition at line 2326 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ref_range(), libMesh::Elem::has_neighbor(), libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::remote_elem, and libMesh::Elem::subactive().

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), and libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints().

2328 {
2329  libmesh_assert(!this->subactive());
2330  libmesh_assert(neighbor_in->active());
2331 
2332  // If we're an active element this is simple
2333  if (this->active())
2334  return std::min(current_min, this->p_level());
2335 
2336  libmesh_assert(has_neighbor(neighbor_in));
2337 
2338  // The p_level() of an ancestor element is already the minimum
2339  // p_level() of its children - so if that's high enough, we don't
2340  // need to examine any children.
2341  if (current_min <= this->p_level())
2342  return current_min;
2343 
2344  unsigned int min_p_level = current_min;
2345 
2346  for (auto & c : this->child_ref_range())
2347  if (&c != remote_elem && c.has_neighbor(neighbor_in))
2348  min_p_level =
2349  c.min_p_level_by_neighbor(neighbor_in, min_p_level);
2350 
2351  return min_p_level;
2352 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2597
unsigned int p_level() const
Definition: elem.h:3105
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:2328
libmesh_assert(ctx)
bool subactive() const
Definition: elem.h:2956
bool active() const
Definition: elem.h:2938
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ n_children()

virtual unsigned int libMesh::Pyramid::n_children ( ) const
inlineoverridevirtualinherited
Returns
10.

Implements libMesh::Elem.

Definition at line 110 of file cell_pyramid.h.

Referenced by libMesh::Pyramid::is_child_on_side().

110 { return 10; }

◆ n_comp()

unsigned int libMesh::DofObject::n_comp ( const unsigned int  s,
const unsigned int  var 
) const
inlineinherited
Returns
The number of components for variable var of system s associated with this DofObject. For example, the HIERARCHIC shape functions may have multiple DoFs associated with one node. Another example is the MONOMIALs, where only the elements hold the DoFs. For the different spatial directions, and orders, see FE.

Definition at line 1002 of file dof_object.h.

References libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), and libMesh::DofObject::var_to_vg().

Referenced by libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::Nemesis_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::Nemesis_IO::copy_nodal_solution(), libMesh::DofMap::distribute_dofs(), libMesh::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_mixed_derivatives(), libMesh::OldSolutionValue< Output, point_output >::eval_mixed_derivatives(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::local_variable_indices(), main(), libMesh::DofObject::n_dofs(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectSides::operator()(), libMesh::DofObject::operator=(), libMesh::DofObject::print_dof_info(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), and libMesh::Nemesis_IO_Helper::write_nodal_solution().

1004 {
1005  libmesh_assert_less (s, this->n_systems());
1006  libmesh_assert_less (var, this->n_vars(s));
1007 
1008  return this->n_comp_group(s,this->var_to_vg(s,var));
1009 }
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in...
Definition: dof_object.h:1341
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:967
unsigned int n_systems() const
Definition: dof_object.h:937
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1015

◆ n_comp_group()

unsigned int libMesh::DofObject::n_comp_group ( const unsigned int  s,
const unsigned int  vg 
) const
inlineinherited
Returns
The number of components for VariableGroup vg of system s associated with this DofObject. For example, the HIERARCHIC shape functions may have multiple DoFs associated with one node. Another example is the MONOMIALs, where only the elements hold the DoFs. For the different spatial directions, and orders, see FE.

Definition at line 1015 of file dof_object.h.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::ncv_magic, and libMesh::DofObject::start_idx().

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::n_comp(), libMesh::DofMap::old_dof_indices(), libMesh::BuildProjectionList::operator()(), libMesh::DofMap::reinit(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_vars_per_group(), and libMesh::DofMap::set_nonlocal_dof_objects().

1017 {
1018  libmesh_assert_less (s, this->n_systems());
1019  libmesh_assert_less (vg, this->n_var_groups(s));
1020 
1021  const unsigned int
1022  start_idx_sys = this->start_idx(s);
1023 
1024  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
1025 
1026  return (_idx_buf[start_idx_sys + 2*vg] % ncv_magic);
1027 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:957
unsigned int n_systems() const
Definition: dof_object.h:937
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1249
index_buffer_t _idx_buf
Definition: dof_object.h:680
static const index_t ncv_magic
Above we introduced the chimera ncv, which is a hybrid of the form ncv = ncv_magic*nv + nc where nv a...
Definition: dof_object.h:691

◆ n_dofs()

unsigned int libMesh::DofObject::n_dofs ( const unsigned int  s,
const unsigned int  var = libMesh::invalid_uint 
) const
inlineinherited
Returns
The number of degrees of freedom associated with system s directly stored on this object. Optionally only degrees of freedom for variable number var are counted. Does not count degrees of freedom only indirectly associated with this object, such as those stored on an element's nodes when n_dofs() is called on the element itself.

Definition at line 806 of file dof_object.h.

References libMesh::invalid_uint, libMesh::make_range(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_systems(), and libMesh::DofObject::n_vars().

Referenced by libMesh::PetscDMWrapper::add_dofs_helper(), and libMesh::EquationSystems::build_parallel_solution_vector().

808 {
809  libmesh_assert_less (s, this->n_systems());
810 
811  unsigned int num = 0;
812 
813  // Count all variables
814  if (var == libMesh::invalid_uint)
815  for (auto v : make_range(this->n_vars(s)))
816  num += this->n_comp(s,v);
817 
818  // Only count specified variable
819  else
820  num = this->n_comp(s,var);
821 
822  return num;
823 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:310
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:1002
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:967
unsigned int n_systems() const
Definition: dof_object.h:937
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...
Definition: int_range.h:140

◆ n_edges()

virtual unsigned int libMesh::Pyramid::n_edges ( ) const
inlineoverridevirtualinherited

◆ n_extra_integers()

unsigned int libMesh::DofObject::n_extra_integers ( ) const
inlineinherited

Returns how many extra integers are associated to the DofObject.

If non-integer data has been associated, each datum of type T counts for sizeof(T)/sizeof(dof_id_type) times in the return value.

Definition at line 1170 of file dof_object.h.

References libMesh::DofObject::_idx_buf, and libMesh::DofObject::start_idx_ints().

Referenced by libMesh::DofObject::add_extra_integers(), libMesh::MeshTools::Modification::all_tri(), libMesh::C0Polyhedron::disconnected_clone(), libMesh::Elem::disconnected_clone(), libMesh::MeshTools::Modification::flatten(), libMesh::DofObject::get_extra_datum(), libMesh::DofObject::get_extra_integer(), libMesh::CheckpointIO::read_connectivity(), libMesh::CheckpointIO::read_nodes(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::Elem::refine(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::DofObject::set_extra_datum(), libMesh::DofObject::set_extra_integer(), libMesh::DofObject::set_n_systems(), libMesh::DofObject::set_n_vars_per_group(), DofObjectTest< Node >::testAddExtraData(), DofObjectTest< Node >::testAddSystemExtraInts(), DofObjectTest< Node >::testSetNSystemsExtraInts(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

1171 {
1172  if (_idx_buf.empty())
1173  return 0;
1174 
1175  const int hdr = dof_id_signed_type(_idx_buf[0]);
1176  if (hdr >= 0)
1177  return 0;
1178 
1179  const unsigned int start_idx_i = this->start_idx_ints();
1180 
1181  return _idx_buf.size() - start_idx_i;
1182 }
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1273
int8_t dof_id_signed_type
Definition: id_types.h:68
index_buffer_t _idx_buf
Definition: dof_object.h:680

◆ n_faces()

virtual unsigned int libMesh::Pyramid::n_faces ( ) const
inlineoverridevirtualinherited
Returns
5. All pyramids have 5 faces.

Implements libMesh::Elem.

Definition at line 105 of file cell_pyramid.h.

105 { return 5; }

◆ n_neighbors()

unsigned int libMesh::Elem::n_neighbors ( ) const
inlineinherited
Returns
The number of neighbors the element that has been derived from this class has.

Only face (or edge in 2D) neighbors are stored, so this method returns n_sides(). At one point we intended to allow derived classes to override this, but too much current libMesh code assumes n_neighbors==n_sides.

Definition at line 714 of file elem.h.

References libMesh::Elem::n_sides().

Referenced by libMesh::Elem::_last_side(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::Tri3Subdivision::get_ordered_valence(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::neighbor_ptr_range(), libMesh::Elem::nullify_neighbors(), libMesh::Elem::set_neighbor(), libMesh::Elem::topological_neighbor(), and libMesh::Elem::topologically_equal().

715  { return this->n_sides(); }
virtual unsigned int n_sides() const =0

◆ n_nodes()

virtual unsigned int libMesh::Pyramid18::n_nodes ( ) const
inlineoverridevirtual
Returns
18.

Reimplemented from libMesh::Pyramid.

Definition at line 103 of file cell_pyramid18.h.

References num_nodes.

Referenced by second_order_adjacent_vertex().

103 { return num_nodes; }
static const int num_nodes
Geometric constants for Pyramid18.

◆ n_nodes_in_child()

virtual unsigned int libMesh::Elem::n_nodes_in_child ( unsigned  int) const
inlinevirtualinherited
Returns
The number of nodes the given child of this element contains. Except in odd cases like pyramid refinement this will be the same as the number of nodes in the parent element.

Definition at line 674 of file elem.h.

References libMesh::Elem::n_nodes().

Referenced by libMesh::Elem::as_parent_node(), libMesh::Elem::bracketing_nodes(), and libMesh::Elem::parent_bracketing_nodes().

675  { return this->n_nodes(); }
virtual unsigned int n_nodes() const =0

◆ n_objects() [1/2]

static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited

Prints the number of outstanding (created, but not yet destroyed) objects.

Definition at line 85 of file reference_counter.h.

References libMesh::ReferenceCounter::_n_objects.

Referenced by libMesh::LibMeshInit::~LibMeshInit().

86  { return _n_objects; }
static Threads::atomic< unsigned int > _n_objects
The number of objects.

◆ n_objects() [2/2]

static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited

Prints the number of outstanding (created, but not yet destroyed) objects.

Definition at line 85 of file reference_counter.h.

References libMesh::ReferenceCounter::_n_objects.

Referenced by libMesh::LibMeshInit::~LibMeshInit().

86  { return _n_objects; }
static Threads::atomic< unsigned int > _n_objects
The number of objects.

◆ n_permutations()

virtual unsigned int libMesh::Pyramid::n_permutations ( ) const
inlinefinaloverridevirtualinherited

One quad side, four orientations.

Implements libMesh::Elem.

Definition at line 190 of file cell_pyramid.h.

190 { return 4; }

◆ n_pseudo_systems()

unsigned int libMesh::DofObject::n_pseudo_systems ( ) const
inlineinherited
Returns
The total number of pseudo-systems associated with this DofObject : n_systems(), plus one iff this->has_extra_integers()

Definition at line 947 of file dof_object.h.

References libMesh::DofObject::_idx_buf.

Referenced by libMesh::DofObject::end_idx(), libMesh::DofObject::set_extra_datum(), and libMesh::DofObject::set_extra_integer().

948 {
949  const int hdr = _idx_buf.empty() ?
950  0 : cast_int<int>(dof_id_signed_type(_idx_buf[0]));
951  return std::abs(hdr);
952 }
int8_t dof_id_signed_type
Definition: id_types.h:68
index_buffer_t _idx_buf
Definition: dof_object.h:680

◆ n_second_order_adjacent_vertices()

unsigned int libMesh::Pyramid18::n_second_order_adjacent_vertices ( const unsigned int  n) const
overridevirtual
Returns
2 for all edge nodes, 4 for quad face nodes, 3 for tri face nodes.

Reimplemented from libMesh::Elem.

Definition at line 355 of file cell_pyramid18.C.

356 {
357  switch (n)
358  {
359  case 5:
360  case 6:
361  case 7:
362  case 8:
363  case 9:
364  case 10:
365  case 11:
366  case 12:
367  return 2;
368 
369  case 13:
370  return 4;
371 
372  case 14:
373  case 15:
374  case 16:
375  case 17:
376  return 3;
377 
378  default:
379  libmesh_error_msg("Invalid node n = " << n);
380  }
381 }

◆ n_sides()

virtual unsigned int libMesh::Pyramid::n_sides ( ) const
inlineoverridevirtualinherited

◆ n_sub_elem()

virtual unsigned int libMesh::Pyramid18::n_sub_elem ( ) const
inlineoverridevirtual

FIXME: we don't yet have a refinement pattern for pyramids...

Returns
1.

Implements libMesh::Elem.

Definition at line 114 of file cell_pyramid18.h.

Referenced by connectivity().

114 { return 1; }

◆ n_systems()

unsigned int libMesh::DofObject::n_systems ( ) const
inlineinherited
Returns
The number of systems associated with this DofObject

Definition at line 937 of file dof_object.h.

References libMesh::DofObject::_idx_buf.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofObject::add_system(), libMesh::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::DofObject::end_idx(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::DofObject::get_extra_datum(), libMesh::DofObject::get_extra_integer(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofObject::has_dofs(), libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_dofs(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), libMesh::DofMap::old_dof_indices(), libMesh::DofObject::operator=(), libMesh::DofObject::print_dof_info(), libMesh::Elem::refine(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_comp(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_systems(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofObject::set_vg_dof_base(), libMesh::DofObject::start_idx(), libMesh::DofObject::start_idx_ints(), DofObjectTest< Node >::testAddSystemExtraInts(), DofObjectTest< Node >::testSetNSystems(), DofObjectTest< Node >::testSetNSystemsExtraInts(), and libMesh::DofObject::vg_dof_base().

938 {
939  const int hdr = _idx_buf.empty() ?
940  0 : cast_int<int>(dof_id_signed_type(_idx_buf[0]));
941  return hdr >= 0 ? hdr : (-hdr-1);
942 }
int8_t dof_id_signed_type
Definition: id_types.h:68
index_buffer_t _idx_buf
Definition: dof_object.h:680

◆ n_var_groups()

unsigned int libMesh::DofObject::n_var_groups ( const unsigned int  s) const
inlineinherited

◆ n_vars() [1/2]

unsigned int libMesh::DofObject::n_vars ( const unsigned int  s,
const unsigned int  vg 
) const
inlineinherited
Returns
The number of Variable variables associated with VariableGroup vg in system s for this DofObject

Definition at line 967 of file dof_object.h.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::ncv_magic_exp, and libMesh::DofObject::start_idx().

Referenced by libMesh::DofObject::add_system(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::DofMap::distribute_dofs(), libMesh::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_mixed_derivatives(), libMesh::OldSolutionValue< Output, point_output >::eval_mixed_derivatives(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofObject::has_dofs(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_dofs(), libMesh::DofObject::n_vars(), libMesh::BuildProjectionList::operator()(), libMesh::DofObject::operator=(), libMesh::DofObject::print_dof_info(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_comp(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_systems(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::DofObject::system_var_to_vg_var(), DofObjectTest< Node >::testAddSystemExtraInts(), DofObjectTest< Node >::testSetNVariableGroups(), DofObjectTest< Node >::testSetNVariableGroupsExtraInts(), libMesh::DofObject::var_to_vg(), and libMesh::DofObject::var_to_vg_and_offset().

969 {
970  libmesh_assert_less (s, this->n_systems());
971  libmesh_assert_less (vg, this->n_var_groups(s));
972 
973  const unsigned int start_idx_sys = this->start_idx(s);
974 
975  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
976 
977  return (cast_int<unsigned int>
978  (_idx_buf[start_idx_sys + 2*vg]) >> ncv_magic_exp);
979 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:957
unsigned int n_systems() const
Definition: dof_object.h:937
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1249
index_buffer_t _idx_buf
Definition: dof_object.h:680
static const index_t ncv_magic_exp
Definition: dof_object.h:692

◆ n_vars() [2/2]

unsigned int libMesh::DofObject::n_vars ( const unsigned int  s) const
inlineinherited
Returns
The number of Variable variables associated with system s for this DofObject

Definition at line 984 of file dof_object.h.

References libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), and libMesh::DofObject::n_vars().

985 {
986  libmesh_assert_less (s, this->n_systems());
987 
988  const unsigned int nvg = this->n_var_groups(s);
989 
990  unsigned int val=0;
991 
992  for (unsigned int vg=0; vg<nvg; vg++)
993  val += this->n_vars(s,vg);
994 
995  return val;
996 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:957
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:967
unsigned int n_systems() const
Definition: dof_object.h:937

◆ n_vertices()

virtual unsigned int libMesh::Pyramid::n_vertices ( ) const
inlineoverridevirtualinherited

◆ neighbor_ptr() [1/2]

const Elem * libMesh::Elem::neighbor_ptr ( unsigned int  i) const
inlineinherited
Returns
A const pointer to the i^{th} neighbor of this element, or nullptr if MeshBase::find_neighbors() has not been called.
Note
If MeshBase::find_neighbors() has been called and this function still returns nullptr, then the side is on a boundary of the domain.

Definition at line 2567 of file elem.h.

References libMesh::Elem::_elemlinks, and libMesh::Elem::n_neighbors().

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::BoundaryInfo::add_elements(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::MeshTools::Modification::all_tri(), libMesh::ClawSystem::assemble_avg_coupling_matrices(), assemble_ellipticdg(), libMesh::ClawSystem::assemble_jump_coupling_matrix(), assemble_SchroedingerEquation(), assembly_with_dg_fem_context(), libMesh::BoundaryInfo::boundary_ids(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::clear_stitched_boundary_side_ids(), compute_enriched_soln(), compute_jacobian(), libMesh::FEAbstract::compute_node_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), compute_residual(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::Subdivision::find_one_ring(), libMesh::MeshTools::Modification::flatten(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), libMesh::Elem::get_info(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_constraints(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_node_constraints(), libMesh::RBEIMConstruction::initialize_qp_data(), libMesh::Poly2TriTriangulator::insert_refinement_points(), libMesh::Poly2TriTriangulator::is_refine_boundary_allowed(), libMesh::HDGProblem::jacobian(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::nullify_neighbors(), libMesh::DefaultCoupling::operator()(), libMesh::C0Polygon::permute(), libMesh::CheckpointIO::read_remote_elem(), libMesh::EquationSystems::redundant_added_side(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::InfFE< Dim, T_radial, T_map >::reinit(), libMesh::FE< Dim, LAGRANGE_VEC >::reinit(), libMesh::FEXYZ< Dim >::reinit(), libMesh::HDGProblem::residual(), libMesh::C0Polyhedron::retriangulate(), libMesh::FE< Dim, LAGRANGE_VEC >::side_map(), libMesh::Elem::SideIter::side_on_boundary(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::BoundaryInfo::sides_with_boundary_id(), libMesh::MeshTools::Modification::smooth(), libMesh::UnstructuredMesh::stitching_helper(), libMesh::Elem::swap2neighbors(), ElemTest< elem_type >::test_orient_elements(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), MeshBaseTest::testMeshBaseVerifyIsPrepared(), InfFERadialTest::testSides(), libMesh::Elem::topological_neighbor(), libMesh::MeshRefinement::topological_neighbor(), libMesh::Elem::topologically_equal(), libMesh::MeshTetInterface::volume_to_surface_mesh(), libMesh::Elem::which_neighbor_am_i(), and libMesh::CheckpointIO::write_remote_elem().

2568 {
2569  libmesh_assert_less (i, this->n_neighbors());
2570 
2571  return _elemlinks[i+1];
2572 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2233
unsigned int n_neighbors() const
Definition: elem.h:714

◆ neighbor_ptr() [2/2]

Elem * libMesh::Elem::neighbor_ptr ( unsigned int  i)
inlineinherited
Returns
A non-const pointer to the i^{th} neighbor of this element.

Definition at line 2577 of file elem.h.

References libMesh::Elem::_elemlinks, and libMesh::Elem::n_neighbors().

2578 {
2579  libmesh_assert_less (i, this->n_neighbors());
2580 
2581  return _elemlinks[i+1];
2582 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2233
unsigned int n_neighbors() const
Definition: elem.h:714

◆ neighbor_ptr_range() [1/2]

SimpleRange< Elem::NeighborPtrIter > libMesh::Elem::neighbor_ptr_range ( )
inlineinherited

Returns a range with all neighbors of an element, usable in range-based for loops.

The exact type of the return value here may be subject to change in future libMesh releases, but the iterators will always dereference to produce a pointer to a neighbor element (or a null pointer, for sides which have no neighbors).

Definition at line 3486 of file elem.h.

References libMesh::Elem::_elemlinks, and libMesh::Elem::n_neighbors().

Referenced by ContrivedPartitioner::_do_partition(), libMesh::MeshTetInterface::check_hull_integrity(), libMesh::Elem::child_neighbor(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::has_neighbor(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_constraints(), libMesh::Elem::make_links_to_me_remote(), libMesh::Elem::remove_links_to_me(), and DistributedMeshTest::testRemoteElemError().

3487 {
3488  return {_elemlinks+1, _elemlinks + 1 + this->n_neighbors()};
3489 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2233
unsigned int n_neighbors() const
Definition: elem.h:714

◆ neighbor_ptr_range() [2/2]

SimpleRange< Elem::ConstNeighborPtrIter > libMesh::Elem::neighbor_ptr_range ( ) const
inlineinherited

Definition at line 3493 of file elem.h.

References libMesh::Elem::_elemlinks, and libMesh::Elem::n_neighbors().

3494 {
3495  return {_elemlinks+1, _elemlinks + 1 + this->n_neighbors()};
3496 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2233
unsigned int n_neighbors() const
Definition: elem.h:714

◆ node_id()

dof_id_type libMesh::Elem::node_id ( const unsigned int  i) const
inlineinherited
Returns
The global id number of local Node i.

Definition at line 2444 of file elem.h.

References libMesh::Elem::_nodes, libMesh::DofObject::id(), libMesh::DofObject::invalid_id, libMesh::libmesh_assert(), and libMesh::Elem::n_nodes().

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), assemble_stokes(), libMesh::Elem::bracketing_nodes(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::FEMap::compute_face_map(), libMesh::InfQuad4::connectivity(), libMesh::InfEdge2::connectivity(), libMesh::Edge2::connectivity(), libMesh::Edge3::connectivity(), libMesh::Quad4::connectivity(), libMesh::InfHex8::connectivity(), libMesh::Edge4::connectivity(), libMesh::InfQuad6::connectivity(), libMesh::InfPrism6::connectivity(), libMesh::Tri3::connectivity(), libMesh::Pyramid5::connectivity(), libMesh::Prism6::connectivity(), libMesh::Hex8::connectivity(), libMesh::Quad8::connectivity(), libMesh::InfPrism12::connectivity(), libMesh::Quad9::connectivity(), libMesh::Tri6::connectivity(), libMesh::InfHex16::connectivity(), libMesh::Tri7::connectivity(), libMesh::Tet4::connectivity(), libMesh::InfHex18::connectivity(), libMesh::Hex20::connectivity(), libMesh::Tet10::connectivity(), libMesh::Prism15::connectivity(), libMesh::Tet14::connectivity(), libMesh::Hex27::connectivity(), libMesh::Prism18::connectivity(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::Tri3Subdivision::get_ordered_node(), libMesh::Tri3Subdivision::get_ordered_valence(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::MeshTools::SidesToElemMap::get_sorted_vertex_ids(), libMesh::LaplaceMeshSmoother::init(), libMesh::Tet::key(), libMesh::InfQuad6::key(), libMesh::Prism::key(), libMesh::Pyramid::key(), libMesh::Hex::key(), libMesh::Tri::key(), libMesh::Polygon::key(), libMesh::Quad8::key(), libMesh::Quad9::key(), libMesh::Edge::key(), libMesh::Tri6::key(), libMesh::Quad::key(), libMesh::InfPrism::key(), libMesh::Tri7::key(), libMesh::Hex27::key(), libMesh::InfHex::key(), libMesh::Prism18::key(), libMesh::Pyramid14::key(), libMesh::InfQuad::key(), libMesh::Edge2::key(), libMesh::Prism20::key(), libMesh::InfHex18::key(), libMesh::Prism21::key(), key(), libMesh::Edge4::key(), libMesh::Edge3::key(), libMesh::Tet4::key(), libMesh::Elem::key(), libMesh::MeshTools::libmesh_assert_equal_connectivity(), libMesh::Elem::local_node(), libMesh::Tri3Subdivision::local_node_number(), libMesh::Tet::low_order_key(), libMesh::Prism::low_order_key(), libMesh::Pyramid::low_order_key(), libMesh::Hex::low_order_key(), libMesh::Tri::low_order_key(), libMesh::Polygon::low_order_key(), libMesh::Edge::low_order_key(), libMesh::Polyhedron::low_order_key(), libMesh::Quad::low_order_key(), libMesh::InfPrism::low_order_key(), libMesh::InfHex::low_order_key(), libMesh::InfQuad::low_order_key(), libMesh::Elem::operator==(), libMesh::XdrIO::pack_element(), libMesh::CheckpointIO::read_connectivity(), libMesh::Elem::topologically_equal(), libMesh::Elem::write_connectivity(), and libMesh::ExodusII_IO_Helper::write_elements().

2445 {
2446  libmesh_assert_less (i, this->n_nodes());
2447  libmesh_assert(_nodes[i]);
2448  libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);
2449 
2450  return _nodes[i]->id();
2451 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2227
dof_id_type id() const
Definition: dof_object.h:828
virtual unsigned int n_nodes() const =0
libmesh_assert(ctx)
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482

◆ node_index_range()

IntRange< unsigned short > libMesh::Elem::node_index_range ( ) const
inlineinherited

◆ node_ptr() [1/2]

const Node * libMesh::Elem::node_ptr ( const unsigned int  i) const
inlineinherited
Returns
A const pointer to local Node i.

Definition at line 2476 of file elem.h.

References libMesh::Elem::_nodes, libMesh::libmesh_assert(), and libMesh::Elem::n_nodes().

Referenced by libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::BoundaryInfo::add_elements(), libMesh::MeshRefinement::add_node(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), assemble_shell(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::C0Polygon::build_side_ptr(), libMesh::Edge::build_side_ptr(), libMesh::BoundaryInfo::clear_stitched_boundary_side_ids(), libMesh::FEMap::compute_affine_map(), libMesh::FEMap::compute_map(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::Elem::contains_vertex_of(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::MeshTools::Subdivision::find_one_ring(), libMesh::MeshTools::Modification::flatten(), libMesh::ReplicatedMesh::get_boundary_points(), libMesh::Elem::get_node_index(), libMesh::Elem::is_vertex_on_parent(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::Elem::libmesh_assert_valid_node_pointers(), libMesh::MeshTools::n_connected_components(), libMesh::Elem::node_ref(), libMesh::C0Polygon::permute(), libMesh::Tri3Subdivision::prepare_subdivision_properties(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::C0Polyhedron::retriangulate(), libMesh::FE< Dim, LAGRANGE_VEC >::shape(), libMesh::Polyhedron::side_clones(), libMesh::Edge::side_ptr(), libMesh::Polygon::side_ptr(), libMesh::Polyhedron::side_ptr(), libMesh::MeshTools::Modification::smooth(), libMesh::UnstructuredMesh::stitching_helper(), libMesh::Elem::swap2nodes(), SystemsTest::testDofCouplingWithVarGroups(), InfFERadialTest::testInfQuants_numericDeriv(), and InfFERadialTest::testSides().

2477 {
2478  libmesh_assert_less (i, this->n_nodes());
2479  libmesh_assert(_nodes[i]);
2480 
2481  return _nodes[i];
2482 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2227
virtual unsigned int n_nodes() const =0
libmesh_assert(ctx)

◆ node_ptr() [2/2]

Node * libMesh::Elem::node_ptr ( const unsigned int  i)
inlineinherited
Returns
A non-const pointer to local Node i.

Definition at line 2487 of file elem.h.

References libMesh::Elem::_nodes, libMesh::libmesh_assert(), and libMesh::Elem::n_nodes().

2488 {
2489  libmesh_assert_less (i, this->n_nodes());
2490  libmesh_assert(_nodes[i]);
2491 
2492  return _nodes[i];
2493 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2227
virtual unsigned int n_nodes() const =0
libmesh_assert(ctx)

◆ node_ref() [1/2]

const Node & libMesh::Elem::node_ref ( const unsigned int  i) const
inlineinherited

◆ node_ref() [2/2]

Node & libMesh::Elem::node_ref ( const unsigned int  i)
inlineinherited
Returns
A writable reference to local Node i.

Definition at line 2506 of file elem.h.

References libMesh::Elem::node_ptr().

2507 {
2508  return *this->node_ptr(i);
2509 }
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2476

◆ node_ref_range() [1/2]

SimpleRange< Elem::NodeRefIter > libMesh::Elem::node_ref_range ( )
inlineinherited

◆ node_ref_range() [2/2]

SimpleRange< Elem::ConstNodeRefIter > libMesh::Elem::node_ref_range ( ) const
inlineinherited

Definition at line 2643 of file elem.h.

References libMesh::Elem::_nodes, and libMesh::Elem::n_nodes().

2644 {
2645  return {_nodes, _nodes+this->n_nodes()};
2646 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2227
virtual unsigned int n_nodes() const =0

◆ nodes_on_edge()

std::vector< unsigned > libMesh::Pyramid18::nodes_on_edge ( const unsigned int  int) const
overridevirtual
Returns
the (local) node numbers on the specified edge

Implements libMesh::Elem.

Definition at line 111 of file cell_pyramid18.C.

References edge_nodes_map, and libMesh::Pyramid::n_edges().

112 {
113  libmesh_assert_less(e, n_edges());
114  return {std::begin(edge_nodes_map[e]), std::end(edge_nodes_map[e])};
115 }
static const unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
virtual unsigned int n_edges() const override
Definition: cell_pyramid.h:100

◆ nodes_on_side()

std::vector< unsigned > libMesh::Pyramid18::nodes_on_side ( const unsigned int  int) const
overridevirtual
Returns
the (local) node numbers on the specified side

Implements libMesh::Elem.

Definition at line 103 of file cell_pyramid18.C.

References libMesh::Pyramid::n_sides(), and side_nodes_map.

104 {
105  libmesh_assert_less(s, n_sides());
106  auto trim = (s == 4) ? 0 : 2;
107  return {std::begin(side_nodes_map[s]), std::end(side_nodes_map[s]) - trim};
108 }
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:90

◆ nullify_neighbors()

void libMesh::Elem::nullify_neighbors ( )
inherited

Replaces this element with nullptr for all of its neighbors.

This is useful when deleting an element.

Definition at line 3017 of file elem.C.

References libMesh::Elem::level(), libMesh::Elem::n_neighbors(), libMesh::Elem::neighbor_ptr(), libMesh::remote_elem, libMesh::Elem::set_neighbor(), libMesh::Elem::side_index_range(), and libMesh::Elem::which_neighbor_am_i().

3018 {
3019  // Tell any of my neighbors about my death...
3020  // Looks strange, huh?
3021  for (auto n : this->side_index_range())
3022  {
3023  Elem * current_neighbor = this->neighbor_ptr(n);
3024  if (current_neighbor && current_neighbor != remote_elem)
3025  {
3026  // Note: it is possible that I see the neighbor
3027  // (which is coarser than me)
3028  // but they don't see me, so avoid that case.
3029  if (current_neighbor->level() == this->level())
3030  {
3031  const unsigned int w_n_a_i = current_neighbor->which_neighbor_am_i(this);
3032  libmesh_assert_less (w_n_a_i, current_neighbor->n_neighbors());
3033  current_neighbor->set_neighbor(w_n_a_i, nullptr);
3034  this->set_neighbor(n, nullptr);
3035  }
3036  }
3037  }
3038 }
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2670
void set_neighbor(const unsigned int i, Elem *n)
Assigns n as the neighbor.
Definition: elem.h:2587
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2567
unsigned int level() const
Definition: elem.h:3071
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ on_boundary()

bool libMesh::Elem::on_boundary ( ) const
inlineinherited
Returns
true if this element has a side coincident with a boundary (indicated by a nullptr neighbor), false otherwise.

Definition at line 2906 of file elem.h.

References libMesh::Elem::has_neighbor().

2907 {
2908  // By convention, the element is on the boundary
2909  // if it has a nullptr neighbor.
2910  return this->has_neighbor(nullptr);
2911 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2597

◆ on_reference_element()

bool libMesh::Pyramid::on_reference_element ( const Point p,
const Real  eps = TOLERANCE 
) const
finaloverridevirtualinherited
Returns
true if the master-space point p is contained in the reference element corresponding to this element, false otherwise.

Since we are doing floating point comparisons here the parameter eps can be specified to indicate a tolerance. For example, x \le 1 becomes x \le 1 + \epsilon .

Implements libMesh::Elem.

Definition at line 300 of file cell_pyramid.C.

References libMesh::Real.

302 {
303  const Real & xi = p(0);
304  const Real & eta = p(1);
305  const Real & zeta = p(2);
306 
307  // Check that the point is on the same side of all the faces
308  // by testing whether:
309  //
310  // n_i.(x - x_i) <= 0
311  //
312  // for each i, where:
313  // n_i is the outward normal of face i,
314  // x_i is a point on face i.
315  return ((-eta - 1. + zeta <= 0.+eps) &&
316  ( xi - 1. + zeta <= 0.+eps) &&
317  ( eta - 1. + zeta <= 0.+eps) &&
318  ( -xi - 1. + zeta <= 0.+eps) &&
319  ( zeta >= 0.-eps));
320 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ operator=() [1/2]

Pyramid18& libMesh::Pyramid18::operator= ( const Pyramid18 )
delete

◆ operator=() [2/2]

Pyramid18& libMesh::Pyramid18::operator= ( Pyramid18 &&  )
delete

◆ operator==()

bool libMesh::Elem::operator== ( const Elem rhs) const
inherited
Returns
true if two elements are equivalent, false otherwise. This is true if the elements are connected to identical global nodes, regardless of how those nodes might be numbered local to the elements.

Definition at line 774 of file elem.C.

References libMesh::Elem::n_nodes(), libMesh::Elem::node_id(), and libMesh::Elem::type().

775 {
776  // If the elements aren't the same type, they aren't equal
777  if (this->type() != rhs.type())
778  return false;
779 
780  const unsigned short n_n = this->n_nodes();
781  libmesh_assert_equal_to(n_n, rhs.n_nodes());
782 
783  // Make two sorted arrays of global node ids and compare them for
784  // equality.
785  std::array<dof_id_type, Elem::max_n_nodes> this_ids, rhs_ids;
786 
787  for (unsigned short n = 0; n != n_n; n++)
788  {
789  this_ids[n] = this->node_id(n);
790  rhs_ids[n] = rhs.node_id(n);
791  }
792 
793  // Sort the vectors to rule out different local node numberings.
794  std::sort(this_ids.begin(), this_ids.begin()+n_n);
795  std::sort(rhs_ids.begin(), rhs_ids.begin()+n_n);
796 
797  // If the node ids match, the elements are equal!
798  for (unsigned short n = 0; n != n_n; ++n)
799  if (this_ids[n] != rhs_ids[n])
800  return false;
801  return true;
802 }
virtual unsigned int n_nodes() const =0
virtual ElemType type() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2444

◆ opposite_node()

unsigned int libMesh::Elem::opposite_node ( const unsigned int  n,
const unsigned int  s 
) const
virtualinherited
Returns
The local node number for the node opposite to node n on side opposite_side(s) (for a tensor product element), or throws an error otherwise.

Reimplemented in libMesh::Quad, libMesh::Edge, libMesh::Polyhedron, libMesh::Hex, and libMesh::C0Polygon.

Definition at line 3522 of file elem.C.

3524 {
3525  // If the subclass didn't rederive this, using it is an error
3526  libmesh_not_implemented();
3527 }

◆ opposite_side()

unsigned int libMesh::Elem::opposite_side ( const unsigned int  s) const
virtualinherited
Returns
The side number opposite to s (for a tensor product element), or throws an error otherwise.

Reimplemented in libMesh::Quad, libMesh::Polyhedron, libMesh::Edge, libMesh::Polygon, and libMesh::Hex.

Definition at line 3514 of file elem.C.

Referenced by VolumeTest::testC0PolygonMethods().

3515 {
3516  // If the subclass didn't rederive this, using it is an error
3517  libmesh_not_implemented();
3518 }

◆ orient()

void libMesh::Elem::orient ( BoundaryInfo boundary_info)
inlineinherited

Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sign, iff we find a negative orientation.

This only fixes flipped elements; for tangled elements the only fixes possible are non-local.

Definition at line 3283 of file elem.h.

References libMesh::Elem::flip(), and libMesh::Elem::is_flipped().

Referenced by libMesh::MeshTools::Modification::orient_elements().

3284 {
3285  if (this->is_flipped())
3286  this->flip(boundary_info);
3287 }
virtual bool is_flipped() const =0
virtual void flip(BoundaryInfo *boundary_info)=0
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...

◆ origin()

virtual Point libMesh::Elem::origin ( ) const
inlinevirtualinherited
Returns
The origin for an infinite element.

Currently, all infinite elements used in a mesh share the same origin. Override this in infinite element classes.

Reimplemented in libMesh::InfQuad, libMesh::InfEdge2, and libMesh::InfCell.

Definition at line 1895 of file elem.h.

Referenced by InfFERadialTest::base_point(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), libMesh::InfFE< Dim, T_radial, T_map >::compute_shape_functions(), libMesh::Elem::get_info(), libMesh::InfFEMap::inverse_map(), libMesh::InfFEMap::map(), InfFERadialTest::testInfQuants(), and InfFERadialTest::testInfQuants_numericDeriv().

1895 { libmesh_not_implemented(); return Point(); }

◆ p_level()

unsigned int libMesh::Elem::p_level ( ) const
inlineinherited
Returns
The value of the p refinement level of an active element, or the minimum value of the p refinement levels of an ancestor element's descendants.

Definition at line 3105 of file elem.h.

References libMesh::Elem::_p_level.

Referenced by libMesh::InfHex8::build_edge_ptr(), libMesh::InfPrism6::build_edge_ptr(), libMesh::InfHex18::build_edge_ptr(), libMesh::InfPrism12::build_edge_ptr(), libMesh::InfHex16::build_edge_ptr(), libMesh::InfQuad4::build_side_ptr(), libMesh::InfHex8::build_side_ptr(), libMesh::InfPrism6::build_side_ptr(), libMesh::InfHex18::build_side_ptr(), libMesh::Pyramid5::build_side_ptr(), libMesh::InfQuad6::build_side_ptr(), libMesh::Prism6::build_side_ptr(), libMesh::InfPrism12::build_side_ptr(), libMesh::InfHex16::build_side_ptr(), libMesh::C0Polygon::build_side_ptr(), libMesh::Pyramid13::build_side_ptr(), libMesh::Prism15::build_side_ptr(), libMesh::Prism18::build_side_ptr(), libMesh::Pyramid14::build_side_ptr(), libMesh::Polyhedron::build_side_ptr(), libMesh::Prism20::build_side_ptr(), libMesh::Prism21::build_side_ptr(), build_side_ptr(), libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::DofMap::dof_indices(), libMesh::FE< Dim, LAGRANGE_VEC >::dofs_on_edge(), libMesh::FE< Dim, LAGRANGE_VEC >::dofs_on_side(), libMesh::FE< Dim, LAGRANGE_VEC >::edge_map(), libMesh::FE< Dim, LAGRANGE_VEC >::edge_reinit(), libMesh::Elem::Elem(), libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::Elem::get_info(), libMesh::QBase::init(), libMesh::InfFE< Dim, T_radial, T_map >::init_face_shape_functions(), libMesh::lagrange_nodal_soln(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::LIBMESH_DEFAULT_VECTORIZED_FE(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::FEInterface::n_dofs(), libMesh::FEInterface::n_dofs_at_node(), libMesh::FEInterface::n_dofs_per_elem(), libMesh::FEInterface::n_shape_functions(), libMesh::DofMap::old_dof_indices(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectEdges::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectSides::operator()(), libMesh::XdrIO::pack_element(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), libMesh::rational_fe_shape(), libMesh::rational_fe_shape_deriv(), libMesh::rational_fe_shape_second_deriv(), libMesh::rational_fe_weighted_shapes(), libMesh::rational_fe_weighted_shapes_derivs(), libMesh::Elem::refine(), libMesh::InfFE< Dim, T_radial, T_map >::reinit(), libMesh::FE< Dim, LAGRANGE_VEC >::reinit(), libMesh::FEXYZ< Dim >::reinit(), libMesh::FE< Dim, LAGRANGE_VEC >::reinit_dual_shape_coeffs(), libMesh::HPCoarsenTest::select_refinement(), libMesh::Elem::set_p_level(), libMesh::Elem::set_p_refinement_flag(), libMesh::FE< Dim, LAGRANGE_VEC >::shape(), libMesh::InfFE< Dim, T_radial, T_map >::shape(), libMesh::InfFE< Dim, T_radial, T_map >::shape_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_second_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::side_map(), libMesh::Elem::simple_build_edge_ptr(), libMesh::Elem::simple_build_side_ptr(), libMesh::SparsityPattern::Build::sorted_connected_dofs(), libMesh::MeshRefinement::test_level_one(), and libMesh::Elem::true_centroid().

3106 {
3107 #ifdef LIBMESH_ENABLE_AMR
3108  return _p_level;
3109 #else
3110  return 0;
3111 #endif
3112 }
unsigned char _p_level
p refinement level - the difference between the polynomial degree on this element and the minimum pol...
Definition: elem.h:2272

◆ p_refinement_flag()

Elem::RefinementState libMesh::Elem::p_refinement_flag ( ) const
inlineinherited

◆ pack_indexing()

void libMesh::DofObject::pack_indexing ( std::back_insert_iterator< std::vector< largest_id_type >>  target) const
inherited

A method for creating packed data from our index buffer - basically a copy with prepended size with our current implementation.

Definition at line 642 of file dof_object.C.

References libMesh::DofObject::_idx_buf, and libMesh::DofObject::old_dof_object.

643 {
644 #ifdef LIBMESH_ENABLE_AMR
645  // We might need to pack old_dof_object too
646  *target++ = (old_dof_object == nullptr) ? 0 : 1;
647 #endif
648 
649  *target++ = _idx_buf.size();
650  std::copy(_idx_buf.begin(), _idx_buf.end(), target);
651 
652 #ifdef LIBMESH_ENABLE_AMR
653  if (old_dof_object)
654  old_dof_object->pack_indexing(target);
655 #endif
656 }
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88
index_buffer_t _idx_buf
Definition: dof_object.h:680

◆ packed_indexing_size()

unsigned int libMesh::DofObject::packed_indexing_size ( ) const
inherited

If we pack our indices into an buffer for communications, how many ints do we need?

Definition at line 560 of file dof_object.C.

References libMesh::DofObject::_idx_buf, and libMesh::DofObject::old_dof_object.

Referenced by libMesh::Node::packed_size().

561 {
562  return
563  cast_int<unsigned int> (
564 #ifdef LIBMESH_ENABLE_AMR
565  ((old_dof_object == nullptr) ? 0 : old_dof_object->packed_indexing_size()) + 2 +
566 #else
567  1 +
568 #endif
569  _idx_buf.size());
570 }
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88
index_buffer_t _idx_buf
Definition: dof_object.h:680

◆ parent() [1/2]

const Elem * libMesh::Elem::parent ( ) const
inlineinherited
Returns
A const pointer to the element's parent, or nullptr if the element was not created via refinement.

Definition at line 3027 of file elem.h.

References libMesh::Elem::_elemlinks.

Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::Elem::add_child(), libMesh::BoundaryInfo::add_elements(), libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::BoundaryInfo::boundary_ids(), libMesh::OldSolutionBase< Output, point_output >::check_old_context(), libMesh::FEAbstract::compute_node_constraints(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::DistributedMesh::delete_elem(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::Elem::Elem(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_error_tolerance(), libMesh::Elem::get_info(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_constraints(), libMesh::Elem::is_ancestor_of(), libMesh::Elem::level(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_remote_elems(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::SiblingCoupling::operator()(), libMesh::BuildProjectionList::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::BoundaryInfo::raw_boundary_ids(), libMesh::BoundaryInfo::raw_edge_boundary_ids(), libMesh::BoundaryInfo::raw_shellface_boundary_ids(), libMesh::CheckpointIO::read_connectivity(), libMesh::Elem::refine(), libMesh::Elem::remove_links_to_me(), libMesh::HPCoarsenTest::select_refinement(), libMesh::Elem::set_p_level(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::BoundaryInfo::shellface_boundary_ids(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::BoundaryInfo::sides_with_boundary_id(), libMesh::MeshTools::Modification::smooth(), libMesh::Elem::subactive(), libMesh::Parallel::sync_element_data_by_parent_id(), ElemTest< elem_type >::test_n_refinements(), libMesh::Elem::top_parent(), libMesh::Elem::topological_neighbor(), libMesh::Elem::topologically_equal(), and libMesh::Elem::which_neighbor_am_i().

3028 {
3029  return _elemlinks[0];
3030 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2233

◆ parent() [2/2]

Elem * libMesh::Elem::parent ( )
inlineinherited
Returns
A pointer to the element's parent, or nullptr if the element was not created via refinement.

Definition at line 3035 of file elem.h.

References libMesh::Elem::_elemlinks.

3036 {
3037  return _elemlinks[0];
3038 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2233

◆ parent_bracketing_nodes()

const std::vector< std::pair< unsigned char, unsigned char > > & libMesh::Elem::parent_bracketing_nodes ( unsigned int  c,
unsigned int  n 
) const
virtualinherited
Returns
All the pairs of nodes (indexed by local node id) which should bracket node n of child c.

Reimplemented in libMesh::Prism21, libMesh::Prism20, libMesh::Tet14, and libMesh::Tri7.

Definition at line 2457 of file elem.C.

References libMesh::Elem::_get_bracketing_node_cache(), libMesh::TypeVector< T >::absolute_fuzzy_equals(), libMesh::TypeVector< T >::add_scaled(), libMesh::Elem::as_parent_node(), libMesh::Elem::build(), libMesh::Elem::default_order(), libMesh::Elem::embedding_matrix(), libMesh::Elem::embedding_matrix_version(), libMesh::FIRST, libMesh::invalid_uint, libMesh::Elem::is_mid_infinite_edge_node(), libMesh::Elem::is_vertex_on_child(), libMesh::libmesh_assert(), libMesh::Elem::master_point(), libMesh::Elem::n_children(), libMesh::Elem::n_nodes(), libMesh::Elem::n_nodes_in_child(), libMesh::parent_bracketing_nodes_mutex, libMesh::Real, libMesh::Elem::second_order_equivalent_type(), and libMesh::Elem::type().

Referenced by libMesh::Elem::bracketing_nodes(), and main().

2459 {
2460  // Indexed first by embedding matrix type, then by child id, then by
2461  // child node, then by bracketing pair
2462  std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> &
2463  cached_bracketing_nodes = this->_get_bracketing_node_cache();
2464 
2465  const unsigned int em_vers = this->embedding_matrix_version();
2466 
2467  // We may be updating the cache on one thread, and while that
2468  // happens we can't safely access the cache from other threads.
2469  Threads::spin_mutex::scoped_lock lock(parent_bracketing_nodes_mutex);
2470 
2471  if (cached_bracketing_nodes.size() <= em_vers)
2472  cached_bracketing_nodes.resize(em_vers+1);
2473 
2474  const unsigned int nc = this->n_children();
2475 
2476  // If we haven't cached the bracketing nodes corresponding to this
2477  // embedding matrix yet, let's do so now.
2478  if (cached_bracketing_nodes[em_vers].size() < nc)
2479  {
2480  // If we're a second-order element but we're not a full-order
2481  // element, then some of our bracketing nodes may not exist
2482  // except on the equivalent full-order element. Let's build an
2483  // equivalent full-order element and make a copy of its cache to
2484  // use.
2485  if (this->default_order() != FIRST &&
2486  second_order_equivalent_type(this->type(), /*full_ordered=*/ true) != this->type())
2487  {
2488  // Check that we really are the non-full-order type
2489  libmesh_assert_equal_to
2490  (second_order_equivalent_type (this->type(), false),
2491  this->type());
2492 
2493  // Build the full-order type
2494  ElemType full_type =
2495  second_order_equivalent_type(this->type(), /*full_ordered=*/ true);
2496  std::unique_ptr<Elem> full_elem = Elem::build(full_type);
2497 
2498  // This won't work for elements with multiple
2499  // embedding_matrix versions, but every such element is full
2500  // order anyways.
2501  libmesh_assert_equal_to(em_vers, 0);
2502 
2503  // Make sure its cache has been built. We temporarily
2504  // release our mutex lock so that the inner call can
2505  // re-acquire it.
2506  lock.release();
2507  full_elem->parent_bracketing_nodes(0,0);
2508 
2509  // And then we need to lock again, so that if someone *else*
2510  // grabbed our lock before we did we don't risk accessing
2511  // cached_bracketing_nodes while they're working on it.
2512  // Threading is hard.
2513  lock.acquire(parent_bracketing_nodes_mutex);
2514 
2515  // Copy its cache
2516  cached_bracketing_nodes =
2517  full_elem->_get_bracketing_node_cache();
2518 
2519  // Now we don't need to build the cache ourselves.
2520  return cached_bracketing_nodes[em_vers][child][child_node];
2521  }
2522 
2523  cached_bracketing_nodes[em_vers].resize(nc);
2524 
2525  const unsigned int nn = this->n_nodes();
2526 
2527  // We have to examine each child
2528  for (unsigned int c = 0; c != nc; ++c)
2529  {
2530  const unsigned int ncn = this->n_nodes_in_child(c);
2531 
2532  cached_bracketing_nodes[em_vers][c].resize(ncn);
2533 
2534  // We have to examine each node in that child
2535  for (unsigned int n = 0; n != ncn; ++n)
2536  {
2537  // If this child node isn't a vertex or an infinite
2538  // child element's mid-infinite-edge node, then we need
2539  // to find bracketing nodes on the child.
2540  if (!this->is_vertex_on_child(c, n)
2541 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2542  && !this->is_mid_infinite_edge_node(n)
2543 #endif
2544  )
2545  {
2546  // Use the embedding matrix to find the child node
2547  // location in parent master element space
2548  Point bracketed_pt;
2549 
2550  for (unsigned int pn = 0; pn != nn; ++pn)
2551  {
2552  const Real em_val =
2553  this->embedding_matrix(c,n,pn);
2554 
2555  libmesh_assert_not_equal_to (em_val, 1);
2556  if (em_val != 0.)
2557  bracketed_pt.add_scaled(this->master_point(pn), em_val);
2558  }
2559 
2560  // Check each pair of nodes on the child which are
2561  // also both parent nodes
2562  for (unsigned int n1 = 0; n1 != ncn; ++n1)
2563  {
2564  if (n1 == n)
2565  continue;
2566 
2567  unsigned int parent_n1 =
2568  this->as_parent_node(c,n1);
2569 
2570  if (parent_n1 == libMesh::invalid_uint)
2571  continue;
2572 
2573  Point p1 = this->master_point(parent_n1);
2574 
2575  for (unsigned int n2 = n1+1; n2 < nn; ++n2)
2576  {
2577  if (n2 == n)
2578  continue;
2579 
2580  unsigned int parent_n2 =
2581  this->as_parent_node(c,n2);
2582 
2583  if (parent_n2 == libMesh::invalid_uint)
2584  continue;
2585 
2586  Point p2 = this->master_point(parent_n2);
2587 
2588  Point pmid = (p1 + p2)/2;
2589 
2590  if (pmid == bracketed_pt)
2591  {
2592  cached_bracketing_nodes[em_vers][c][n].emplace_back(parent_n1, parent_n2);
2593  break;
2594  }
2595  else
2596  libmesh_assert(!pmid.absolute_fuzzy_equals(bracketed_pt));
2597  }
2598  }
2599  }
2600  // If this child node is a parent node, we need to
2601  // find bracketing nodes on the parent.
2602  else
2603  {
2604  unsigned int parent_node = this->as_parent_node(c,n);
2605 
2606  Point bracketed_pt;
2607 
2608  // If we're not a parent node, use the embedding
2609  // matrix to find the child node location in parent
2610  // master element space
2611  if (parent_node == libMesh::invalid_uint)
2612  {
2613  for (unsigned int pn = 0; pn != nn; ++pn)
2614  {
2615  const Real em_val =
2616  this->embedding_matrix(c,n,pn);
2617 
2618  libmesh_assert_not_equal_to (em_val, 1);
2619  if (em_val != 0.)
2620  bracketed_pt.add_scaled(this->master_point(pn), em_val);
2621  }
2622  }
2623  // If we're a parent node then we need no arithmetic
2624  else
2625  bracketed_pt = this->master_point(parent_node);
2626 
2627  for (unsigned int n1 = 0; n1 != nn; ++n1)
2628  {
2629  if (n1 == parent_node)
2630  continue;
2631 
2632  Point p1 = this->master_point(n1);
2633 
2634  for (unsigned int n2 = n1+1; n2 < nn; ++n2)
2635  {
2636  if (n2 == parent_node)
2637  continue;
2638 
2639  Point pmid = (p1 + this->master_point(n2))/2;
2640 
2641  if (pmid == bracketed_pt)
2642  {
2643  cached_bracketing_nodes[em_vers][c][n].emplace_back(n1, n2);
2644  break;
2645  }
2646  else
2647  libmesh_assert(!pmid.absolute_fuzzy_equals(bracketed_pt));
2648  }
2649  }
2650  }
2651  }
2652  }
2653  }
2654 
2655  return cached_bracketing_nodes[em_vers][child][child_node];
2656 }
ElemType
Defines an enum for geometric element types.
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:310
virtual unsigned int embedding_matrix_version() const
Definition: elem.h:2032
virtual unsigned int n_children() const =0
virtual Real embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
virtual unsigned int n_nodes() const =0
virtual unsigned int as_parent_node(unsigned int c, unsigned int n) const
Definition: elem.C:2389
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition: elem.C:447
libmesh_assert(ctx)
Threads::spin_mutex parent_bracketing_nodes_mutex
Definition: elem.C:98
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
Definition: elem.C:3138
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Point master_point(const unsigned int i) const =0
virtual bool is_vertex_on_child(unsigned int, unsigned int n) const
Definition: elem.h:768
virtual Order default_order() 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&#39;t do their own bracketing node calculations will need to supply a static ca...
Definition: elem.h:2191
virtual ElemType type() const =0
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:674
virtual bool is_mid_infinite_edge_node(const unsigned int) const
Definition: elem.h:1886

◆ permute()

void libMesh::Pyramid18::permute ( unsigned int  perm_num)
finaloverridevirtual

Permutes the element (by swapping node and neighbor pointers) according to the specified index.

This is useful for regression testing, by making it easy to make a structured mesh behave more like an arbitrarily unstructured mesh.

This is so far only used for regression testing, so we do not currently provide a way to permute any boundary side/edge ids along with the element permutation.

Implements libMesh::Elem.

Definition at line 459 of file cell_pyramid18.C.

References libMesh::Elem::swap4neighbors(), and libMesh::Elem::swap4nodes().

460 {
461  libmesh_assert_less (perm_num, 4);
462 
463  for (unsigned int i = 0; i != perm_num; ++i)
464  {
465  swap4nodes(0,1,2,3);
466  swap4nodes(5,6,7,8);
467  swap4nodes(9,10,11,12);
468  swap4nodes(14,15,16,17);
469  swap4neighbors(0,1,2,3);
470  }
471 }
void swap4nodes(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four node_ptrs, "rotating" them.
Definition: elem.h:2124
void swap4neighbors(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four neighbor_ptrs, "rotating" them.
Definition: elem.h:2134

◆ point() [1/2]

const Point & libMesh::Elem::point ( const unsigned int  i) const
inlineinherited
Returns
The Point associated with local Node i.

Definition at line 2422 of file elem.h.

References libMesh::Elem::_nodes, libMesh::DofObject::invalid_id, libMesh::libmesh_assert(), and libMesh::Elem::n_nodes().

Referenced by libMesh::PostscriptIO::_compute_edge_bezier_coeffs(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::BoundaryInfo::add_elements(), libMesh::MeshRefinement::add_node(), libMesh::C0Polyhedron::add_tet(), libMesh::MeshTools::Modification::all_tri(), assemble_stokes(), libMesh::Tet::choose_diagonal(), libMesh::Elem::coarsen(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), libMesh::FEMap::compute_edge_map(), libMesh::FEMap::compute_face_map(), libMesh::Elem::contains_edge_of(), libMesh::InfQuad4::contains_point(), libMesh::Tri3::contains_point(), libMesh::InfPrism::contains_point(), libMesh::InfHex::contains_point(), libMesh::Tet4::contains_point(), libMesh::NodeElem::contains_point(), libMesh::Elem::contains_vertex_of(), libMesh::Polyhedron::convex(), libMesh::ElemCutter::cut_2D(), libMesh::ElemCutter::cut_3D(), libMesh::FEMContext::elem_position_get(), libMesh::Edge3::has_affine_map(), libMesh::Quad4::has_affine_map(), libMesh::Edge4::has_affine_map(), libMesh::Quad8::has_affine_map(), libMesh::Quad9::has_affine_map(), libMesh::Prism6::has_affine_map(), libMesh::Hex8::has_affine_map(), libMesh::Tri6::has_affine_map(), libMesh::Tri7::has_affine_map(), libMesh::C0Polygon::has_affine_map(), libMesh::Hex20::has_affine_map(), libMesh::Hex27::has_affine_map(), libMesh::Tet10::has_affine_map(), libMesh::Prism15::has_affine_map(), libMesh::Prism18::has_affine_map(), libMesh::Tet14::has_affine_map(), libMesh::Prism20::has_affine_map(), libMesh::Prism21::has_affine_map(), libMesh::Quad4::has_invertible_map(), libMesh::Edge3::has_invertible_map(), libMesh::Edge4::has_invertible_map(), libMesh::Elem::hmax(), libMesh::Elem::hmin(), libMesh::Prism::is_flipped(), libMesh::Hex::is_flipped(), libMesh::Polygon::is_flipped(), libMesh::Tri::is_flipped(), libMesh::Pyramid::is_flipped(), libMesh::InfPrism::is_flipped(), libMesh::Quad::is_flipped(), libMesh::Tet::is_flipped(), libMesh::InfHex::is_flipped(), libMesh::Edge::is_flipped(), libMesh::Polyhedron::is_flipped(), libMesh::InfQuad::is_flipped(), libMesh::Elem::length(), libMesh::Edge4::loose_bounding_box(), libMesh::Edge3::loose_bounding_box(), libMesh::Quad8::loose_bounding_box(), libMesh::Quad9::loose_bounding_box(), libMesh::Tri7::loose_bounding_box(), libMesh::Tri6::loose_bounding_box(), libMesh::Elem::loose_bounding_box(), main(), libMesh::InfFEMap::map(), libMesh::FEMap::map(), libMesh::FEMap::map_deriv(), libMesh::Polyhedron::master_point(), libMesh::Tri3::min_and_max_angle(), libMesh::Tet4::min_and_max_angle(), libMesh::FEMSystem::numerical_jacobian(), libMesh::Polyhedron::on_reference_element(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::InfCell::origin(), libMesh::InfEdge2::origin(), libMesh::InfQuad::origin(), libMesh::PostscriptIO::plot_linear_elem(), libMesh::Polyhedron::Polyhedron(), libMesh::Elem::positive_edge_orientation(), libMesh::Elem::positive_face_orientation(), libMesh::Hex::quality(), libMesh::Tri::quality(), libMesh::Quad::quality(), libMesh::Elem::quality(), libMesh::Face::quasicircumcenter(), libMesh::Edge::quasicircumcenter(), libMesh::NodeElem::quasicircumcenter(), libMesh::FE< Dim, LAGRANGE_VEC >::reinit(), libMesh::C0Polygon::retriangulate(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_second_deriv(), libMesh::SimplexRefiner::should_refine_elem(), libMesh::Poly2TriTriangulator::should_refine_elem(), libMesh::MeshTools::Modification::smooth(), ExtraIntegersTest::test_final_integers(), BoundaryInfoTest::testShellFaceConstraints(), VolumeTest::testTwistedVolume(), libMesh::Edge2::true_centroid(), libMesh::Quad4::true_centroid(), libMesh::C0Polyhedron::true_centroid(), libMesh::Pyramid5::true_centroid(), libMesh::C0Polygon::true_centroid(), libMesh::Prism6::true_centroid(), libMesh::Hex8::true_centroid(), libMesh::Elem::true_centroid(), libMesh::Edge2::volume(), libMesh::C0Polyhedron::volume(), libMesh::Quad4::volume(), libMesh::Edge3::volume(), libMesh::C0Polygon::volume(), libMesh::Tri3::volume(), libMesh::Pyramid5::volume(), libMesh::Edge4::volume(), libMesh::Quad8::volume(), libMesh::Hex8::volume(), libMesh::Quad9::volume(), libMesh::Tet4::volume(), libMesh::Tri6::volume(), libMesh::Pyramid13::volume(), libMesh::Hex20::volume(), libMesh::Tet10::volume(), libMesh::Prism15::volume(), libMesh::Pyramid14::volume(), libMesh::Hex27::volume(), libMesh::Prism18::volume(), and libMesh::Elem::which_side_am_i().

2423 {
2424  libmesh_assert_less (i, this->n_nodes());
2425  libmesh_assert(_nodes[i]);
2426  libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);
2427 
2428  return *_nodes[i];
2429 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2227
virtual unsigned int n_nodes() const =0
libmesh_assert(ctx)
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482

◆ point() [2/2]

Point & libMesh::Elem::point ( const unsigned int  i)
inlineinherited
Returns
The Point associated with local Node i as a writable reference.

Definition at line 2434 of file elem.h.

References libMesh::Elem::_nodes, and libMesh::Elem::n_nodes().

2435 {
2436  libmesh_assert_less (i, this->n_nodes());
2437 
2438  return *_nodes[i];
2439 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2227
virtual unsigned int n_nodes() const =0

◆ positive_edge_orientation()

bool libMesh::Elem::positive_edge_orientation ( const unsigned int  i) const
inherited
Returns
true if edge i is positively oriented. An edge is positively oriented iff its first vertex (i.e. zeroth node) is lexicographically greater than its second vertex (i.e. first node).

Definition at line 3592 of file elem.C.

References libMesh::Elem::local_edge_node(), libMesh::Elem::n_edges(), and libMesh::Elem::point().

Referenced by libMesh::FE< Dim, LAGRANGE_VEC >::shape(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv(), and libMesh::FE< Dim, LAGRANGE_VEC >::shape_second_deriv().

3593 {
3594  libmesh_assert_less (i, this->n_edges());
3595 
3596  return this->point(this->local_edge_node(i, 0)) >
3597  this->point(this->local_edge_node(i, 1));
3598 }
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 ...
virtual unsigned int n_edges() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:2422

◆ positive_face_orientation()

bool libMesh::Elem::positive_face_orientation ( const unsigned int  i) const
inherited
Returns
true if face i is positively oriented. A face is positively oriented iff the triangle defined by the lexicographically least vertex and its two adjacent vertices on the same face is positively oriented. Said triangle is positively oriented iff its vertices are an odd permutation of their lexicographic ordering.

Definition at line 3601 of file elem.C.

References distance(), libMesh::Elem::n_faces(), libMesh::Elem::nodes_on_side(), libMesh::Elem::point(), and libMesh::Elem::side_ptr().

Referenced by libMesh::FE< Dim, LAGRANGE_VEC >::shape(), and libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv().

3602 {
3603  libmesh_assert_less (i, this->n_faces());
3604 
3605  // Get the number of vertices N of face i. Note that for 3d elements, i.e.
3606  // elements for which this->n_faces() > 0, the number of vertices on any of
3607  // its sides (or faces) is just the number of that face's sides (or edges).
3608  auto side_i = this->side_ptr(i);
3609  const unsigned int N = side_i->n_sides();
3610 
3611  const std::vector<unsigned int> nodes = this->nodes_on_side(i);
3612 
3613  auto cmp = [&](const unsigned int & m, const unsigned int & n) -> bool
3614  { return this->point(m) < this->point(n); };
3615 
3616  const unsigned int V = std::distance(nodes.begin(),
3617  std::min_element(nodes.begin(), nodes.begin() + N, cmp));
3618 
3619  return cmp(nodes[(V + N - 1) % N], nodes[(V + 1) % N]);
3620 }
Real distance(const Point &p)
virtual std::unique_ptr< Elem > side_ptr(unsigned int i)=0
virtual unsigned int n_faces() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:2422
virtual std::vector< unsigned int > nodes_on_side(const unsigned int) const =0

◆ print_dof_info()

void libMesh::DofObject::print_dof_info ( ) const
inherited

Print out info for debugging.

Definition at line 670 of file dof_object.C.

References libMesh::DofObject::dof_number(), libMesh::DofObject::id(), libMesh::make_range(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), and libMesh::out.

671 {
672  libMesh::out << this->id() << " [ ";
673 
674  for (auto s : make_range(this->n_systems()))
675  {
676  libMesh::out << "s:" << s << " ";
677  for (auto var : make_range(this->n_vars(s)))
678  {
679  libMesh::out << "v:" << var << " ";
680  for (auto comp : make_range(this->n_comp(s,var)))
681  {
682  libMesh::out << "c:" << comp << " dof:" << this->dof_number(s,var,comp) << " ";
683  }
684  }
685  }
686 
687  libMesh::out << "]\n";
688 }
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:1032
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:1002
dof_id_type id() const
Definition: dof_object.h:828
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:967
unsigned int n_systems() const
Definition: dof_object.h:937
OStreamProxy out
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...
Definition: int_range.h:140

◆ print_info() [1/3]

void libMesh::ReferenceCounter::print_info ( std::ostream &  out_stream = libMesh::out)
staticinherited

Prints the reference information, by default to libMesh::out.

Definition at line 81 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter, and libMesh::ReferenceCounter::get_info().

Referenced by libMesh::LibMeshInit::~LibMeshInit().

82 {
84  out_stream << ReferenceCounter::get_info();
85 }
static std::string get_info()
Gets a string containing the reference information.
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...

◆ print_info() [2/3]

void libMesh::ReferenceCounter::print_info ( std::ostream &  out_stream = libMesh::out)
staticinherited

Prints the reference information, by default to libMesh::out.

Definition at line 81 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter, and libMesh::ReferenceCounter::get_info().

Referenced by libMesh::LibMeshInit::~LibMeshInit().

82 {
84  out_stream << ReferenceCounter::get_info();
85 }
static std::string get_info()
Gets a string containing the reference information.
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...

◆ print_info() [3/3]

void libMesh::Elem::print_info ( std::ostream &  os = libMesh::out) const
inherited

Prints relevant information about the element.

Definition at line 2918 of file elem.C.

References libMesh::Elem::get_info().

Referenced by libMesh::FEMap::compute_single_point_map(), libMesh::FEMap::inverse_map(), and libMesh::operator<<().

2919 {
2920  os << this->get_info()
2921  << std::endl;
2922 }
std::string get_info() const
Prints relevant information about the element to a string.
Definition: elem.C:2926

◆ processor_id() [1/3]

processor_id_type libMesh::DofObject::processor_id ( ) const
inlineinherited
Returns
The processor that this DofObject belongs to.

When partitioning and DoF numbering have been performed by libMesh, every current DoF on this DofObject will belong to its processor.

Definition at line 905 of file dof_object.h.

References libMesh::DofObject::_processor_id.

Referenced by NonManifoldTestPartitioner::_do_partition(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::DistributedMesh::add_node(), libMesh::MeshRefinement::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::DistributedMesh::add_point(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Patch::build_around_element(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::MeshFunction::check_found_elem(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubProjector::construct_projection(), libMesh::MeshBase::copy_constraint_rows(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::DistributedMesh::delete_elem(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::C0Polyhedron::disconnected_clone(), libMesh::Elem::disconnected_clone(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::Elem::Elem(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::Modification::flatten(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::RBEIMConstruction::initialize_qp_data(), libMesh::DistributedMesh::insert_elem(), libMesh::DofObject::invalidate_processor_id(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), AugmentSparsityOnInterface::mesh_reinit(), ExodusTest< elem_type >::meshes_equal_enough(), libMesh::PeriodicBoundaries::neighbor(), libMesh::RBEIMEvaluation::node_distribute_bfs(), OverlappingCouplingFunctor::operator()(), AugmentSparsityOnInterface::operator()(), AugmentSparsityOnNodes::operator()(), libMesh::GhostPointNeighbors::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SortAndCopy::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectEdges::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectSides::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectInteriors::operator()(), libMesh::CompareDofObjectsByPIDAndThenID::operator()(), libMesh::DistributedMesh::own_node(), libMesh::XdrIO::pack_element(), libMesh::LinearPartitioner::partition_range(), libMesh::SFCPartitioner::partition_range(), libMesh::CentroidPartitioner::partition_range(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), libMesh::DofMap::process_mesh_constraint_rows(), libMesh::DofObject::processor_id(), libMesh::CheckpointIO::read_connectivity(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::DofMap::scatter_constraints(), libMesh::Partitioner::set_interface_node_processor_ids_BFS(), libMesh::Partitioner::set_interface_node_processor_ids_linear(), libMesh::Partitioner::set_interface_node_processor_ids_petscpartitioner(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), ParsedFEMFunctionTest::setUp(), libMesh::Partitioner::single_partition_range(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id_once(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), DofObjectTest< Node >::testInvalidateProcId(), EquationSystemsTest::testPostInitAddElem(), DofObjectTest< Node >::testSetProcId(), BoundaryInfoTest::testShellFaceConstraints(), DofObjectTest< Node >::testValidProcId(), libMesh::DTKAdapter::update_variable_values(), NonManifoldGhostingFunctorTest::verify_send_list_entries_helper(), libMesh::GmshIO::write_mesh(), and libMesh::Nemesis_IO_Helper::write_sidesets().

906 {
907  return _processor_id;
908 }
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:594

◆ processor_id() [2/3]

processor_id_type & libMesh::DofObject::processor_id ( )
inlineinherited
Returns
The processor that this DofObject belongs to as a writable reference.

Definition at line 913 of file dof_object.h.

References libMesh::DofObject::_processor_id.

914 {
915  return _processor_id;
916 }
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:594

◆ processor_id() [3/3]

void libMesh::DofObject::processor_id ( const processor_id_type  pid)
inlineinherited

Sets the processor_id for this DofObject.

Definition at line 921 of file dof_object.h.

References libMesh::DofObject::processor_id().

922 {
923  this->processor_id() = pid;
924 }
processor_id_type processor_id() const
Definition: dof_object.h:905

◆ qual_bounds()

virtual std::pair<Real,Real> libMesh::Elem::qual_bounds ( const ElemQuality  ) const
inlinevirtualinherited
Returns
The suggested quality bounds for the Elem based on quality measure q.

These are the values suggested by the CUBIT User's Manual. Since this function can have no possible meaning for an abstract Elem, it is an error in the base class.

Reimplemented in libMesh::InfQuad, libMesh::Polyhedron, libMesh::InfHex, libMesh::Quad, libMesh::Tri, libMesh::Polygon, libMesh::Hex, and libMesh::Tet.

Definition at line 1111 of file elem.h.

Referenced by main().

1112  { libmesh_not_implemented(); return std::make_pair(0.,0.); }

◆ quality()

Real libMesh::Elem::quality ( const ElemQuality  q) const
virtualinherited
Returns
A quantitative assessment of element quality based on the quality metric q specified by the user. Not all ElemQuality metrics are supported for all Elem types; consult the Elem::quality() overrides for specific Elem types to determine which quality metrics are supported. The ElemQuality metrics with generic support for all Elems with dimension > 1 are: .) EDGE_LENGTH_RATIO - ratio of maximum to minimum edge (in 2D, side) length, where the min/max is taken over all Elem edges. .) MIN,MAX_ANGLE - The minimum (respectively maximum) angle between all pairs of adjacent Elem edges, in degrees. Note that, in 3D, these are not the dihedral angles (angle between adjacent planar faces of the element), which we plan to add support for in the future. In 2D, we compute the angle between adjacent sides for this metric.

Reimplemented in libMesh::InfQuad, libMesh::InfHex, libMesh::Quad, libMesh::Tri, libMesh::Hex, and libMesh::Tet.

Definition at line 1777 of file elem.C.

References libMesh::cross_norm(), libMesh::Elem::dim(), libMesh::Elem::edge_index_range(), libMesh::EDGE_LENGTH_RATIO, libMesh::Elem::edges_adjacent_to_node(), libMesh::Utility::enum_to_string(), libMesh::err, libMesh::index_range(), libMesh::JACOBIAN, libMesh::Elem::local_edge_node(), libMesh::make_range(), libMesh::MAX_ANGLE, libMesh::MAX_DIHEDRAL_ANGLE, libMesh::MIN_ANGLE, libMesh::MIN_DIHEDRAL_ANGLE, libMesh::Elem::n_edges(), libMesh::Elem::node_index_range(), libMesh::Elem::nodes_on_side(), libMesh::TensorTools::norm(), libMesh::pi, libMesh::Elem::point(), libMesh::Real, libMesh::SCALED_JACOBIAN, libMesh::Elem::sides_on_edge(), libMesh::triple_product(), libMesh::Elem::type(), and libMesh::TypeVector< T >::unit().

Referenced by libMesh::Tet::quality(), libMesh::Hex::quality(), libMesh::Tri::quality(), libMesh::Quad::quality(), libMesh::InfHex::quality(), and libMesh::InfQuad::quality().

1778 {
1779  switch (q)
1780  {
1781  // Return the maximum ratio of edge lengths, or zero if that
1782  // maximum would otherwise be infinity.
1783  case EDGE_LENGTH_RATIO:
1784  {
1785  if (this->dim() < 2)
1786  return 1;
1787 
1788  std::vector<Real> edge_lengths(this->n_edges());
1789  for (auto e : index_range(edge_lengths))
1790  edge_lengths[e] = (this->point(this->local_edge_node(e,1)) -
1791  this->point(this->local_edge_node(e,0))).norm();
1792 
1793  auto [min, max] =
1794  std::minmax_element(edge_lengths.begin(), edge_lengths.end());
1795 
1796  if (*min == 0.)
1797  return 0.;
1798  else
1799  return *max / *min;
1800  }
1801 
1802  case MIN_ANGLE:
1803  case MAX_ANGLE:
1804  {
1805  // 1D elements don't have interior angles, so just return some
1806  // dummy value in that case.
1807  if (this->dim() < 2)
1808  return 0.;
1809 
1810  // Initialize return values
1811  Real min_angle = std::numeric_limits<Real>::max();
1812  Real max_angle = -std::numeric_limits<Real>::max();
1813 
1814  for (auto n : this->node_index_range())
1815  {
1816  // Get list of edge ids adjacent to this node.
1817  const auto adjacent_edge_ids = this->edges_adjacent_to_node(n);
1818 
1819  // Skip any nodes with fewer than 2 adjacent edges. You
1820  // need at least two adjacent edges to form an interior
1821  // element angle.
1822  auto N = adjacent_edge_ids.size();
1823  if (N < 2)
1824  continue;
1825 
1826  // Consider all possible pairs of edges adjacent to node n
1827  for (unsigned int first = 0; first < N-1; ++first)
1828  for (unsigned int second = first+1; second < N; ++second)
1829  {
1830  // Get ids of first and second edges
1831  auto first_edge = adjacent_edge_ids[first];
1832  auto second_edge = adjacent_edge_ids[second];
1833 
1834  // Get node ids of first and second edge
1835  auto first_edge_node_0 = this->local_edge_node(first_edge, 0);
1836  auto first_edge_node_1 = this->local_edge_node(first_edge, 1);
1837  auto second_edge_node_0 = this->local_edge_node(second_edge, 0);
1838  auto second_edge_node_1 = this->local_edge_node(second_edge, 1);
1839 
1840  // Orient both edges so that edge node 0 == n
1841  if (first_edge_node_0 != n)
1842  std::swap(first_edge_node_0, first_edge_node_1);
1843  if (second_edge_node_0 != n)
1844  std::swap(second_edge_node_0, second_edge_node_1);
1845 
1846  libmesh_assert_equal_to(first_edge_node_0, n);
1847  libmesh_assert_equal_to(second_edge_node_0, n);
1848 
1849  // Locally oriented edge vectors
1850  Point
1851  first_ev = this->point(first_edge_node_1) - this->point(first_edge_node_0),
1852  second_ev = this->point(second_edge_node_1) - this->point(second_edge_node_0);
1853 
1854  // Angle between them in the range [0, pi]
1855  Real theta = std::acos(first_ev.unit() * second_ev.unit());
1856 
1857  // Track min and max angles seen
1858  min_angle = std::min(theta, min_angle);
1859  max_angle = std::max(theta, max_angle);
1860  }
1861  }
1862 
1863  // Return requested extreme value (in degrees)
1864  return Real(180)/libMesh::pi * ((q == MIN_ANGLE) ? min_angle : max_angle);
1865  }
1866 
1867  case MIN_DIHEDRAL_ANGLE:
1868  case MAX_DIHEDRAL_ANGLE:
1869  {
1870  // For 1D and 2D elements, just call this function with MIN,MAX_ANGLE instead.
1871  if (this->dim() < 3)
1872  return this->quality((q == MIN_DIHEDRAL_ANGLE) ? MIN_ANGLE : MAX_ANGLE);
1873 
1874  // Initialize return values
1875  Real min_angle = std::numeric_limits<Real>::max();
1876  Real max_angle = -std::numeric_limits<Real>::max();
1877 
1878  // Algorithm for computing dihedral angles:
1879  // .) Loop over the edges, use the edge_sides_map to get the
1880  // two sides adjacent to the edge.
1881  // .) For each adjacent side, use the side_nodes_map to get the
1882  // list of three (or more) node ids on that side.
1883  // .) Use the node ids to compute the (approximate) inward
1884  // normal for the side. Note: this is approximate since 3D
1885  // elements with four-sided faces and quadratic tetrahedra
1886  // do not necessarily have planar faces.
1887  // .) Compute the dihedral angle for the current edge, compare
1888  // it to the current min and max dihedral angles.
1889  for (auto e : this->edge_index_range())
1890  {
1891  // Get list of edge ids adjacent to this node.
1892  const auto adjacent_side_ids = this->sides_on_edge(e);
1893 
1894  // All 3D elements should have exactly two sides adjacent to each edge.
1895  libmesh_assert_equal_to(adjacent_side_ids.size(), 2);
1896 
1897  // Get lists of node ids on each side
1898  const auto side_0_node_ids = this->nodes_on_side(adjacent_side_ids[0]);
1899  const auto side_1_node_ids = this->nodes_on_side(adjacent_side_ids[1]);
1900 
1901  // All 3D elements have at least three nodes on each side
1902  libmesh_assert_greater_equal(side_0_node_ids.size(), 3);
1903  libmesh_assert_greater_equal(side_1_node_ids.size(), 3);
1904 
1905  // Construct (approximate) inward normal on each adjacent side
1906  const auto side_0_normal =
1907  (this->point(side_0_node_ids[2]) - this->point(side_0_node_ids[0])).cross
1908  (this->point(side_0_node_ids[1]) - this->point(side_0_node_ids[0])).unit();
1909  const auto side_1_normal =
1910  (this->point(side_1_node_ids[2]) - this->point(side_1_node_ids[0])).cross
1911  (this->point(side_1_node_ids[1]) - this->point(side_1_node_ids[0])).unit();
1912 
1913  // Compute dihedral angle between the planes.
1914  // Using the absolute value ensures that we get the same result
1915  // even if the orientation of one of the planes is flipped, i.e.
1916  // it always gives us a value in the range [0, pi/2].
1917  // https://en.wikipedia.org/wiki/Dihedral_angle
1918  Real theta = std::acos(std::abs(side_0_normal * side_1_normal));
1919 
1920  // Track min and max angles seen
1921  min_angle = std::min(theta, min_angle);
1922  max_angle = std::max(theta, max_angle);
1923  }
1924 
1925  // Return requested extreme value (in degrees)
1926  return Real(180)/libMesh::pi * ((q == MIN_DIHEDRAL_ANGLE) ? min_angle : max_angle);
1927  }
1928 
1929  case JACOBIAN:
1930  case SCALED_JACOBIAN:
1931  {
1932  // 1D elements don't have interior corners, so this metric
1933  // does not really apply to them.
1934  const auto N = this->dim();
1935  if (N < 2)
1936  return 1.;
1937 
1938  // Initialize return value
1939  Real min_node_area = std::numeric_limits<Real>::max();
1940 
1941  for (auto n : this->node_index_range())
1942  {
1943  // Get list of edge ids adjacent to this node.
1944  auto adjacent_edge_ids = this->edges_adjacent_to_node(n);
1945 
1946  // Skip any nodes that don't have dim() adjacent edges. In 2D,
1947  // you need at least two adjacent edges to compute the cross
1948  // product, and in 3D, you need at least three adjacent edges
1949  // to compute the scalar triple product. The only element
1950  // type which has an unusual topology in this regard is the
1951  // Pyramid element in 3D, where 4 edges meet at the apex node.
1952  // For now, we just skip this node when computing the JACOBIAN
1953  // metric for Pyramids.
1954  if (adjacent_edge_ids.size() != N)
1955  continue;
1956 
1957  // Construct oriented edges
1958  std::vector<Point> oriented_edges(N);
1959  for (auto i : make_range(N))
1960  {
1961  auto node_0 = this->local_edge_node(adjacent_edge_ids[i], 0);
1962  auto node_1 = this->local_edge_node(adjacent_edge_ids[i], 1);
1963  if (node_0 != n)
1964  std::swap(node_0, node_1);
1965  oriented_edges[i] = this->point(node_1) - this->point(node_0);
1966  }
1967 
1968  // Compute unscaled area (2D) or volume (3D) using the
1969  // cross product (2D) or scalar triple product (3D) of the
1970  // oriented edges. We take the absolute value so that we
1971  // don't have to worry about the sign of the area.
1972  Real node_area = (N == 2) ?
1973  cross_norm(oriented_edges[0], oriented_edges[1]) :
1974  std::abs(triple_product(oriented_edges[0], oriented_edges[1], oriented_edges[2]));
1975 
1976  // Divide by (non-zero) edge lengths if computing scaled Jacobian.
1977  // If any length is zero, then set node_area to zero. This means that
1978  // e.g. degenerate quadrilaterals will have a zero SCALED_JACOBIAN metric.
1979  if (q == SCALED_JACOBIAN)
1980  for (auto i : make_range(N))
1981  {
1982  Real len_i = oriented_edges[i].norm();
1983  node_area = (len_i == 0.) ? 0. : (node_area / len_i);
1984  }
1985 
1986  // Update minimum
1987  min_node_area = std::min(node_area, min_node_area);
1988  }
1989 
1990  return min_node_area;
1991  }
1992 
1993  // Return 1 if we made it here
1994  default:
1995  {
1996  libmesh_do_once( libmesh_here();
1997 
1998  libMesh::err << "ERROR: quality metric "
2000  << " not implemented on element type "
2001  << Utility::enum_to_string(this->type())
2002  << std::endl
2003  << "Returning 1."
2004  << std::endl; );
2005 
2006  return 1.;
2007  }
2008  }
2009 }
OStreamProxy err
virtual std::vector< unsigned int > sides_on_edge(const unsigned int) const =0
T cross_norm(const TypeVector< T > &b, const TypeVector< T > &c)
Calls cross_norm_sq() and takes the square root of the result.
Definition: type_vector.h:1096
IntRange< unsigned short > edge_index_range() const
Definition: elem.h:2661
T triple_product(const TypeVector< T > &a, const TypeVector< T > &b, const TypeVector< T > &c)
Definition: type_vector.h:1029
virtual std::vector< unsigned int > edges_adjacent_to_node(const unsigned int) const =0
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 ...
virtual unsigned int n_edges() const =0
auto norm(const T &a) -> decltype(std::abs(a))
Definition: tensor_tools.h:74
std::string enum_to_string(const T e)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned short dim() const =0
virtual Real quality(const ElemQuality q) const
Definition: elem.C:1777
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...
Definition: int_range.h:140
IntRange< unsigned short > node_index_range() const
Definition: elem.h:2652
virtual ElemType type() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:2422
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:117
virtual std::vector< unsigned int > nodes_on_side(const unsigned int) const =0
const Real pi
.
Definition: libmesh.h:299

◆ quasicircumcenter()

virtual Point libMesh::Elem::quasicircumcenter ( ) const
inlinevirtualinherited
Returns
The "circumcenter of mass" (area-weighted average of triangulation circumcenters) of the element.

Not implemented for infinite elements, not currently implemented for 3D elements, currently ignores curvature of element edges.

Reimplemented in libMesh::NodeElem, libMesh::Edge, and libMesh::Face.

Definition at line 1051 of file elem.h.

Referenced by libMesh::Poly2TriTriangulator::insert_refinement_points().

1052  { libmesh_not_implemented(); }

◆ raw_child_ptr()

const Elem * libMesh::Elem::raw_child_ptr ( unsigned int  i) const
inlineinherited
Returns
A constant pointer to the i^{th} child for this element. For internal use only - skips assertions about null pointers.

Definition at line 3151 of file elem.h.

References libMesh::Elem::_children.

Referenced by libMesh::CheckpointIO::read_remote_elem().

3152 {
3153  if (!_children)
3154  return nullptr;
3155 
3156  return _children[i];
3157 }
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2243

◆ reference_elem()

const Elem * libMesh::Elem::reference_elem ( ) const
inherited
Returns
A pointer to the "reference element" associated with this element. The reference element is the image of this element in reference parametric space. Importantly, it is not an actual element in the mesh, but rather a Singleton-type object, so for example all Quad4 elements share the same reference_elem().

If the element is of a type that can admit multiple topologies, such as a Polygon subtype, then there is no reference element; for such types this method should not be used.

Definition at line 573 of file elem.C.

References libMesh::ReferenceElem::get(), and libMesh::Elem::type().

Referenced by libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::QComposite< QSubCell >::init(), and libMesh::RBParametrizedFunction::preevaluate_parametrized_function_on_mesh().

574 {
575  return &(ReferenceElem::get(this->type()));
576 }
virtual ElemType type() const =0
const Elem & get(const ElemType type_in)

◆ refine()

void libMesh::Elem::refine ( MeshRefinement mesh_refinement)
virtualinherited

Refine the element.

Definition at line 87 of file elem_refinement.C.

References libMesh::Elem::_children, libMesh::Elem::active(), libMesh::MeshRefinement::add_elem(), libMesh::MeshRefinement::add_node(), libMesh::Elem::ancestor(), libMesh::Elem::build(), libMesh::Elem::child_ptr(), libMesh::Elem::INACTIVE, libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_systems(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::parent(), libMesh::Elem::REFINE, libMesh::Elem::refinement_flag(), libMesh::remote_elem, libMesh::DofObject::set_extra_integer(), libMesh::DofObject::set_n_systems(), libMesh::Elem::set_p_level(), libMesh::Elem::set_p_refinement_flag(), libMesh::Elem::set_refinement_flag(), libMesh::Elem::subactive(), and libMesh::Elem::type().

88 {
89  libmesh_assert_equal_to (this->refinement_flag(), Elem::REFINE);
90  libmesh_assert (this->active());
91 
92  const unsigned int nc = this->n_children();
93 
94  // Create my children if necessary
95  if (!_children)
96  {
97  _children = std::make_unique<Elem *[]>(nc);
98 
99  unsigned int parent_p_level = this->p_level();
100  const unsigned int nei = this->n_extra_integers();
101  for (unsigned int c = 0; c != nc; c++)
102  {
103  auto current_child = Elem::build(this->type(), this);
104  _children[c] = current_child.get();
105 
106  current_child->set_refinement_flag(Elem::JUST_REFINED);
107  current_child->set_p_level(parent_p_level);
108  current_child->set_p_refinement_flag(this->p_refinement_flag());
109 
110  for (auto cnode : current_child->node_index_range())
111  {
112  Node * node =
113  mesh_refinement.add_node(*this, c, cnode,
114  current_child->processor_id());
115  node->set_n_systems (this->n_systems());
116  current_child->set_node(cnode, node);
117  }
118 
119  Elem * added_child = mesh_refinement.add_elem (std::move(current_child));
120  added_child->set_n_systems(this->n_systems());
121  libmesh_assert_equal_to (added_child->n_extra_integers(),
122  this->n_extra_integers());
123  for (unsigned int i=0; i != nei; ++i)
124  added_child->set_extra_integer(i, this->get_extra_integer(i));
125  }
126  }
127  else
128  {
129  unsigned int parent_p_level = this->p_level();
130  for (unsigned int c = 0; c != nc; c++)
131  {
132  Elem * current_child = this->child_ptr(c);
133  if (current_child != remote_elem)
134  {
135  libmesh_assert(current_child->subactive());
136  current_child->set_refinement_flag(Elem::JUST_REFINED);
137  current_child->set_p_level(parent_p_level);
138  current_child->set_p_refinement_flag(this->p_refinement_flag());
139  }
140  }
141  }
142 
143  // Un-set my refinement flag now
145 
146  // Leave the p refinement flag set - we will need that later to get
147  // projection operations correct
148  // this->set_p_refinement_flag(Elem::INACTIVE);
149 
150 #ifndef NDEBUG
151  for (unsigned int c = 0; c != nc; c++)
152  if (this->child_ptr(c) != remote_elem)
153  {
154  libmesh_assert_equal_to (this->child_ptr(c)->parent(), this);
155  libmesh_assert(this->child_ptr(c)->active());
156  }
157 #endif
158  libmesh_assert (this->ancestor());
159 }
RefinementState refinement_flag() const
Definition: elem.h:3207
const Elem * parent() const
Definition: elem.h:3027
RefinementState p_refinement_flag() const
Definition: elem.h:3223
void set_refinement_flag(const RefinementState rflag)
Sets the value of the refinement flag for the element.
Definition: elem.h:3215
virtual unsigned int n_children() const =0
unsigned int p_level() const
Definition: elem.h:3105
bool ancestor() const
Definition: elem.C:2013
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition: elem.C:447
unsigned int n_systems() const
Definition: dof_object.h:937
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1170
bool active() const
Definition: elem.h:2938
virtual ElemType type() const =0
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2243
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:3160
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ refinement_flag()

Elem::RefinementState libMesh::Elem::refinement_flag ( ) const
inlineinherited
Returns
The value of the refinement flag for the element.

Definition at line 3207 of file elem.h.

References libMesh::Elem::_rflag.

Referenced by libMesh::Elem::active(), libMesh::OldSolutionBase< Output, point_output >::check_old_context(), libMesh::Elem::coarsen(), libMesh::Elem::contract(), libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::Elem::get_info(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshRefinement::make_flags_parallel_consistent(), libMesh::Elem::make_links_to_me_local(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectEdges::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectSides::operator()(), libMesh::Elem::refine(), EquationSystemsTest::testRefineThenReinitPreserveFlags(), libMesh::BoundaryInfo::transfer_boundary_ids_from_children(), and libMesh::MeshRefinement::uniformly_coarsen().

3208 {
3209  return static_cast<RefinementState>(_rflag);
3210 }
RefinementState
Enumeration of possible element refinement states.
Definition: elem.h:1433
unsigned char _rflag
h refinement flag.
Definition: elem.h:2256

◆ remove_links_to_me()

void libMesh::Elem::remove_links_to_me ( )
inherited

Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's appropriate pointers to point to null instead of to this.

To be used before an element is deleted from a mesh.

Definition at line 1642 of file elem.C.

References libMesh::Elem::has_children(), libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::neighbor_ptr_range(), libMesh::Elem::parent(), libMesh::remote_elem, and libMesh::Elem::subactive().

Referenced by MeshDeletionsTest::testDeleteElem().

1643 {
1644  libmesh_assert_not_equal_to (this, remote_elem);
1645 
1646  // We need to have handled any children first
1647 #ifdef LIBMESH_ENABLE_AMR
1648  libmesh_assert (!this->has_children());
1649 #endif
1650 
1651  // Nullify any neighbor links
1652  for (auto neigh : this->neighbor_ptr_range())
1653  {
1654  if (neigh && neigh != remote_elem)
1655  {
1656  // My neighbor should never be more refined than me; my real
1657  // neighbor would have been its parent in that case.
1658  libmesh_assert_greater_equal (this->level(), neigh->level());
1659 
1660  if (this->level() == neigh->level() &&
1661  neigh->has_neighbor(this))
1662  {
1663 #ifdef LIBMESH_ENABLE_AMR
1664  // My neighbor may have descendants which also consider me a
1665  // neighbor
1666  std::vector<Elem *> family;
1667  neigh->total_family_tree_by_neighbor (family, this);
1668 
1669  for (auto & n : family)
1670  {
1671  libmesh_assert (n);
1672  if (n->is_remote())
1673  continue;
1674  unsigned int my_s = n->which_neighbor_am_i(this);
1675  libmesh_assert_less (my_s, n->n_neighbors());
1676  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1677  n->set_neighbor(my_s, nullptr);
1678  }
1679 #else
1680  unsigned int my_s = neigh->which_neighbor_am_i(this);
1681  libmesh_assert_less (my_s, neigh->n_neighbors());
1682  libmesh_assert_equal_to (neigh->neighbor_ptr(my_s), this);
1683  neigh->set_neighbor(my_s, nullptr);
1684 #endif
1685  }
1686 #ifdef LIBMESH_ENABLE_AMR
1687  // Even if my neighbor doesn't link back to me, it might
1688  // have subactive descendants which do
1689  else if (neigh->has_children())
1690  {
1691  // If my neighbor at the same level doesn't have me as a
1692  // neighbor, I must be subactive
1693  libmesh_assert(this->level() > neigh->level() ||
1694  this->subactive());
1695 
1696  // My neighbor must have some ancestor of mine as a
1697  // neighbor
1698  Elem * my_ancestor = this->parent();
1699  libmesh_assert(my_ancestor);
1700  while (!neigh->has_neighbor(my_ancestor))
1701  {
1702  my_ancestor = my_ancestor->parent();
1703  libmesh_assert(my_ancestor);
1704  }
1705 
1706  // My neighbor may have descendants which consider me a
1707  // neighbor
1708  std::vector<Elem *> family;
1709  neigh->total_family_tree_by_subneighbor (family, my_ancestor, this);
1710 
1711  for (auto & n : family)
1712  {
1713  libmesh_assert (n);
1714  if (n->is_remote())
1715  continue;
1716  unsigned int my_s = n->which_neighbor_am_i(this);
1717  libmesh_assert_less (my_s, n->n_neighbors());
1718  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1719  n->set_neighbor(my_s, nullptr);
1720  }
1721  }
1722 #endif
1723  }
1724  }
1725 
1726 #ifdef LIBMESH_ENABLE_AMR
1727  // We can't currently delete a child with a parent!
1728  libmesh_assert (!this->parent());
1729 #endif
1730 }
const Elem * parent() const
Definition: elem.h:3027
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360
unsigned int level() const
Definition: elem.h:3071
bool subactive() const
Definition: elem.h:2956
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Returns a range with all neighbors of an element, usable in range-based for loops.
Definition: elem.h:3486
bool has_children() const
Definition: elem.h:2976
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ replace_child()

void libMesh::Elem::replace_child ( Elem elem,
unsigned int  c 
)
inherited

Replaces the child pointer at the specified index in the child array.

Definition at line 2093 of file elem.C.

References libMesh::Elem::child_ptr(), libMesh::Elem::has_children(), libMesh::libmesh_assert(), and libMesh::Elem::set_child().

Referenced by libMesh::UnstructuredMesh::all_first_order().

2094 {
2095  libmesh_assert(this->has_children());
2096 
2097  libmesh_assert(this->child_ptr(c));
2098 
2099  this->set_child(c, elem);
2100 }
libmesh_assert(ctx)
void set_child(unsigned int c, Elem *elem)
Sets the pointer to the child for this element.
Definition: elem.h:3179
bool has_children() const
Definition: elem.h:2976
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:3160

◆ runtime_topology()

virtual bool libMesh::Elem::runtime_topology ( ) const
inlinevirtualinherited
Returns
true iff this element type can vary in topology (e.g. have different numbers of sides and/or nodes) at runtime. For such general polygons or polyhedra, APIs which assume a fixed topology are not safe to use.

Reimplemented in libMesh::Polyhedron, and libMesh::Polygon.

Definition at line 259 of file elem.h.

Referenced by libMesh::FE< Dim, LAGRANGE_VEC >::edge_map(), libMesh::FE< Dim, LAGRANGE_VEC >::edge_reinit(), libMesh::QBase::init(), libMesh::FE< Dim, LAGRANGE_VEC >::reinit(), and libMesh::FE< Dim, LAGRANGE_VEC >::side_map().

259 { return false; }

◆ second_order_adjacent_vertex()

unsigned short int libMesh::Pyramid18::second_order_adjacent_vertex ( const unsigned int  n,
const unsigned int  v 
) const
overridevirtual
Returns
The element-local number of the v^{th} vertex that defines the n^{th} second-order node.

Reimplemented from libMesh::Elem.

Definition at line 384 of file cell_pyramid18.C.

References n_nodes(), and libMesh::Pyramid::n_vertices().

386 {
387  libmesh_assert_greater_equal (n, this->n_vertices());
388  libmesh_assert_less (n, this->n_nodes());
389 
390  switch (n)
391  {
392  case 5:
393  case 6:
394  case 7:
395  case 8:
396  case 9:
397  case 10:
398  case 11:
399  case 12:
400  {
401  libmesh_assert_less (v, 2);
402 
403  // This is the analog of the static, const arrays
404  // {Hex,Prism,Tet10}::_second_order_adjacent_vertices
405  // defined in the respective source files... possibly treat
406  // this similarly once the Pyramid13 has been added?
407  constexpr unsigned short node_list[8][2] =
408  {
409  {0,1},
410  {1,2},
411  {2,3},
412  {0,3},
413  {0,4},
414  {1,4},
415  {2,4},
416  {3,4}
417  };
418 
419  return node_list[n-5][v];
420  }
421 
422  // mid-face node on bottom
423  case 13:
424  {
425  libmesh_assert_less (v, 4);
426 
427  // The vertex nodes surrounding node 13 are 0, 1, 2, and 3.
428  // Thus, the v'th node is simply = v.
429  return cast_int<unsigned short>(v);
430  }
431 
432  // mid-face nodes on triangles
433  case 14:
434  case 15:
435  case 16:
436  case 17:
437  {
438  libmesh_assert_less (v, 3);
439 
440  constexpr unsigned short node_list[4][3] =
441  {
442  {0,1,4},
443  {1,2,4},
444  {2,3,4},
445  {0,3,4}
446  };
447 
448  return node_list[n-14][v];
449  }
450 
451  default:
452  libmesh_error_msg("Invalid n = " << n);
453 
454  }
455 }
virtual unsigned int n_nodes() const override
virtual unsigned int n_vertices() const override
Definition: cell_pyramid.h:95

◆ second_order_child_vertex()

std::pair< unsigned short int, unsigned short int > libMesh::Elem::second_order_child_vertex ( const unsigned int  n) const
virtualinherited
Returns
A pair (c,v), where c == child index, and v == element-local index of the \( n^{th} \) second-order node on the parent element. For linear elements, (0,0) is returned.
Note
The return values are always less than this->n_children() and this->child_ptr(c)->n_vertices().
n has to be greater than or equal to this->n_vertices().
On refined second-order elements, the return value will satisfy this->node_ptr(n) == this->child_ptr(c)->node_ptr(v).

Reimplemented in libMesh::Prism21, libMesh::Prism20, libMesh::Prism18, libMesh::Hex27, libMesh::Tet14, libMesh::Prism15, libMesh::InfHex18, libMesh::Tet10, libMesh::Hex20, libMesh::Tri7, libMesh::InfHex16, libMesh::Tri6, libMesh::Quad9, libMesh::InfPrism12, libMesh::Quad8, libMesh::C0Polygon, libMesh::InfQuad6, libMesh::Edge3, and libMesh::C0Polyhedron.

Definition at line 3061 of file elem.C.

3062 {
3063  // for linear elements, always return 0
3064  return std::pair<unsigned short int, unsigned short int>(0,0);
3065 }

◆ second_order_equivalent_type()

ElemType libMesh::Elem::second_order_equivalent_type ( const ElemType  et,
const bool  full_ordered = true 
)
staticinherited
Returns
The ElemType of the associated second-order element (which will be the same as the input if the input is already a second-order ElemType) or INVALID_ELEM for elements that cannot be converted into higher order equivalents.

For example, when this is a TET4, then TET10 is returned.

For some elements, there exist two second-order equivalents, e.g. for Quad4 there is Quad8 and Quad9. When the optional full_ordered is true, then QUAD9 is returned. When full_ordered is false, then QUAD8 is returned.

Definition at line 3138 of file elem.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::Utility::enum_to_string(), libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::INFEDGE2, libMesh::INFHEX16, libMesh::INFHEX18, libMesh::INFHEX8, libMesh::INFPRISM12, libMesh::INFPRISM6, libMesh::INFQUAD4, libMesh::INFQUAD6, libMesh::NODEELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM20, libMesh::PRISM21, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID18, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::QUADSHELL9, libMesh::TET10, libMesh::TET14, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, libMesh::TRI7, and libMesh::TRISHELL3.

Referenced by libMesh::UnstructuredMesh::all_second_order_range(), libMesh::Elem::bracketing_nodes(), and libMesh::Elem::parent_bracketing_nodes().

3140 {
3141  switch (et)
3142  {
3143  case NODEELEM:
3144  return NODEELEM;
3145  case EDGE2:
3146  case EDGE3:
3147  {
3148  // full_ordered not relevant
3149  return EDGE3;
3150  }
3151 
3152  case EDGE4:
3153  {
3154  // full_ordered not relevant
3155  return EDGE4;
3156  }
3157 
3158  case TRI3:
3159  case TRI6:
3160  {
3161  // full_ordered not relevant
3162  return TRI6;
3163  }
3164 
3165  case TRI7:
3166  return TRI7;
3167 
3168  // Currently there is no TRISHELL6, so similarly to other types
3169  // where this is the case, we just return the input.
3170  case TRISHELL3:
3171  return TRISHELL3;
3172 
3173  case QUAD4:
3174  case QUAD8:
3175  {
3176  if (full_ordered)
3177  return QUAD9;
3178  else
3179  return QUAD8;
3180  }
3181 
3182  case QUADSHELL4:
3183  case QUADSHELL8:
3184  {
3185  if (full_ordered)
3186  return QUADSHELL9;
3187  else
3188  return QUADSHELL8;
3189  }
3190 
3191  case QUAD9:
3192  {
3193  // full_ordered not relevant
3194  return QUAD9;
3195  }
3196 
3197  case QUADSHELL9:
3198  {
3199  // full_ordered not relevant
3200  return QUADSHELL9;
3201  }
3202 
3203  case TET4:
3204  case TET10:
3205  {
3206  // full_ordered not relevant
3207  return TET10;
3208  }
3209 
3210  case TET14:
3211  return TET14;
3212 
3213  case HEX8:
3214  case HEX20:
3215  {
3216  // see below how this correlates with INFHEX8
3217  if (full_ordered)
3218  return HEX27;
3219  else
3220  return HEX20;
3221  }
3222 
3223  case HEX27:
3224  {
3225  // full_ordered not relevant
3226  return HEX27;
3227  }
3228 
3229  case PRISM6:
3230  case PRISM15:
3231  {
3232  if (full_ordered)
3233  return PRISM18;
3234  else
3235  return PRISM15;
3236  }
3237 
3238  // full_ordered not relevant, already fully second order
3239  case PRISM18:
3240  return PRISM18;
3241  case PRISM20:
3242  return PRISM20;
3243  case PRISM21:
3244  return PRISM21;
3245  case PYRAMID18:
3246  return PYRAMID18;
3247 
3248  case PYRAMID5:
3249  case PYRAMID13:
3250  {
3251  if (full_ordered)
3252  return PYRAMID14;
3253  else
3254  return PYRAMID13;
3255  }
3256 
3257  case PYRAMID14:
3258  {
3259  // full_ordered not relevant
3260  return PYRAMID14;
3261  }
3262 
3263 
3264 
3265 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
3266 
3267  // infinite elements
3268  case INFEDGE2:
3269  {
3270  return INFEDGE2;
3271  }
3272 
3273  case INFQUAD4:
3274  case INFQUAD6:
3275  {
3276  // full_ordered not relevant
3277  return INFQUAD6;
3278  }
3279 
3280  case INFHEX8:
3281  case INFHEX16:
3282  {
3283  /*
3284  * Note that this matches with \p Hex8:
3285  * For full-ordered, \p InfHex18 and \p Hex27
3286  * belong together, and for not full-ordered,
3287  * \p InfHex16 and \p Hex20 belong together.
3288  */
3289  if (full_ordered)
3290  return INFHEX18;
3291  else
3292  return INFHEX16;
3293  }
3294 
3295  case INFHEX18:
3296  {
3297  // full_ordered not relevant
3298  return INFHEX18;
3299  }
3300 
3301  case INFPRISM6:
3302  case INFPRISM12:
3303  {
3304  // full_ordered not relevant
3305  return INFPRISM12;
3306  }
3307 
3308 #endif
3309 
3310 
3311  default:
3312  {
3313  // what did we miss?
3314  libmesh_error_msg("No second order equivalent element type for et = "
3315  << Utility::enum_to_string(et));
3316  }
3317  }
3318 }
std::string enum_to_string(const T e)

◆ set_buffer()

void libMesh::DofObject::set_buffer ( const std::vector< dof_id_type > &  buf)
inlineinherited

Definition at line 717 of file dof_object.h.

References libMesh::DofObject::_idx_buf.

Referenced by DofObjectTest< Node >::testJensEftangBug().

718  { _idx_buf = buf; }
index_buffer_t _idx_buf
Definition: dof_object.h:680

◆ set_dof_number()

void libMesh::DofObject::set_dof_number ( const unsigned int  s,
const unsigned int  var,
const unsigned int  comp,
const dof_id_type  dn 
)
inherited

Sets the global degree of freedom number for variable var, component comp for system s associated with this DofObject.

Definition at line 454 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::dof_number(), libMesh::DofObject::invalid_id, libMesh::libmesh_assert(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), libMesh::DofObject::start_idx(), libMesh::DofObject::system_var_to_vg_var(), and libMesh::DofObject::var_to_vg().

458 {
459  libmesh_assert_less (s, this->n_systems());
460  libmesh_assert_less (var, this->n_vars(s));
461  libmesh_assert_less (comp, this->n_comp(s,var));
462 
463  const unsigned int
464  vg = this->var_to_vg(s,var),
465 #ifndef NDEBUG
466  ncg = this->n_comp_group(s,vg),
467 #endif
468  vig = this->system_var_to_vg_var(s,vg,var),
469  start_idx_sys = this->start_idx(s);
470 
471  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
472 
473  dof_id_type & base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
474 
475  // We intend to change all dof numbers together or not at all
476  if (comp || vig)
477  libmesh_assert ((dn == invalid_id && base_idx == invalid_id) ||
478  (dn == base_idx + vig*ncg + comp));
479 
480  // only explicitly store the base index for vig==0, comp==0
481  else
482  base_idx = dn;
483 
484  libmesh_assert_equal_to (this->dof_number(s, var, comp), dn);
485 }
unsigned int system_var_to_vg_var(const unsigned int s, const unsigned int vg, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in...
Definition: dof_object.h:1359
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:1032
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:1002
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in...
Definition: dof_object.h:1341
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:967
unsigned int n_systems() const
Definition: dof_object.h:937
libmesh_assert(ctx)
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1249
index_buffer_t _idx_buf
Definition: dof_object.h:680
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1015
uint8_t dof_id_type
Definition: id_types.h:67

◆ set_extra_datum()

template<typename T >
void libMesh::DofObject::set_extra_datum ( const unsigned int  index,
const T  value 
)
inlineinherited

Sets the value on this object of the extra datum associated with index, which should have been obtained via a call to MeshBase::add_elem_datum or MeshBase::add_node_datum using the same type T.

Definition at line 1126 of file dof_object.h.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_pseudo_systems(), libMesh::DofObject::start_idx_ints(), and value.

Referenced by libMesh::ExodusII_IO::read(), libMesh::DynaIO::read_mesh(), and DofObjectTest< Node >::testAddExtraData().

1128 {
1129 #ifndef NDEBUG
1130  const unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
1131 #endif
1132  libmesh_assert_less(index+n_more_integers, this->n_extra_integers());
1133  libmesh_assert_less(this->n_pseudo_systems(), _idx_buf.size());
1134 
1135  const unsigned int start_idx_i = this->start_idx_ints();
1136 
1137  libmesh_assert_less(start_idx_i+index+n_more_integers, _idx_buf.size());
1138  std::memcpy(&_idx_buf[start_idx_i+index], &value, sizeof(T));
1139 }
unsigned int n_pseudo_systems() const
Definition: dof_object.h:947
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1273
static const bool value
Definition: xdr_io.C:54
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1170
index_buffer_t _idx_buf
Definition: dof_object.h:680
uint8_t dof_id_type
Definition: id_types.h:67

◆ set_extra_integer()

void libMesh::DofObject::set_extra_integer ( const unsigned int  index,
const dof_id_type  value 
)
inlineinherited

Sets the value on this object of the extra integer associated with index, which should have been obtained via a call to MeshBase::add_elem_integer or MeshBase::add_node_integer.

Definition at line 1086 of file dof_object.h.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_pseudo_systems(), libMesh::DofObject::start_idx_ints(), and value.

Referenced by libMesh::SyncElementIntegers::act_on_data(), libMesh::BoundaryInfo::add_elements(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::create_submesh(), libMesh::ExodusII_IO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::CheckpointIO::read_nodes(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::Elem::refine(), DofObjectTest< Node >::testAddExtraData(), DofObjectTest< Node >::testAddSystemExtraInts(), DofObjectTest< Node >::testSetNSystemsExtraInts(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

1088 {
1089  libmesh_assert_less(index, this->n_extra_integers());
1090  libmesh_assert_less(this->n_pseudo_systems(), _idx_buf.size());
1091 
1092  const unsigned int start_idx_i = this->start_idx_ints();
1093 
1094  libmesh_assert_less(start_idx_i+index, _idx_buf.size());
1095  _idx_buf[start_idx_i+index] = value;
1096 }
unsigned int n_pseudo_systems() const
Definition: dof_object.h:947
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1273
static const bool value
Definition: xdr_io.C:54
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1170
index_buffer_t _idx_buf
Definition: dof_object.h:680

◆ set_id() [1/2]

dof_id_type & libMesh::DofObject::set_id ( )
inlineinherited

◆ set_id() [2/2]

void libMesh::DofObject::set_id ( const dof_id_type  dofid)
inlineinherited

Sets the id for this DofObject.

Definition at line 201 of file dof_object.h.

References libMesh::DofObject::set_id().

202  { this->set_id() = dofid; }
dof_id_type & set_id()
Definition: dof_object.h:836

◆ set_interior_parent()

void libMesh::Elem::set_interior_parent ( Elem p)
inherited

Sets the pointer to the element's interior_parent.

Dangerous! Only use this if you know what you are doing!

Definition at line 1251 of file elem.C.

References libMesh::Elem::_elemlinks, libMesh::Elem::dim(), libMesh::libmesh_assert(), libMesh::Elem::n_sides(), and libMesh::remote_elem.

Referenced by libMesh::BoundaryInfo::add_elements(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::Edge::Edge(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Hex::Hex(), libMesh::InfHex::InfHex(), libMesh::InfQuad::InfQuad(), libMesh::NodeElem::NodeElem(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), libMesh::Prism::Prism(), libMesh::Pyramid::Pyramid(), libMesh::Quad::Quad(), libMesh::Tet::Tet(), libMesh::Tri::Tri(), and libMesh::MeshTetInterface::volume_to_surface_mesh().

1252 {
1253  // interior parents make no sense for full-dimensional elements.
1254  libmesh_assert (!p ||
1255  this->dim() < LIBMESH_DIM);
1256 
1257  // If we have an interior_parent, we USED TO assume it was a
1258  // one-higher-dimensional interior element, but we now allow e.g.
1259  // edge elements to have a 3D interior_parent with no
1260  // intermediate 2D element.
1261  // libmesh_assert (!p ||
1262  // p->dim() == (this->dim()+1));
1263  libmesh_assert (!p ||
1264  (p == remote_elem) ||
1265  (p->dim() > this->dim()));
1266 
1267  _elemlinks[1+this->n_sides()] = p;
1268 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2233
libmesh_assert(ctx)
virtual unsigned int n_sides() const =0
virtual unsigned short dim() const =0
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ set_mapping_data()

void libMesh::Elem::set_mapping_data ( const unsigned char  data)
inlineinherited

Sets the value of the mapping data for the element.

Definition at line 3141 of file elem.h.

References libMesh::Elem::_map_data.

Referenced by libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::UnstructuredMesh::all_first_order(), libMesh::ReplicatedMesh::insert_elem(), and libMesh::DistributedMesh::insert_elem().

3142 {
3143  _map_data = data;
3144 }
unsigned char _map_data
Mapping function data; currently used when needed to store the RATIONAL_BERNSTEIN nodal weight data i...
Definition: elem.h:2285

◆ set_mapping_type()

void libMesh::Elem::set_mapping_type ( const ElemMappingType  type)
inlineinherited

Sets the value of the mapping type for the element.

Definition at line 3125 of file elem.h.

References libMesh::Elem::_map_type, and libMesh::Elem::type().

Referenced by libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::UnstructuredMesh::all_first_order(), libMesh::ReplicatedMesh::insert_elem(), and libMesh::DistributedMesh::insert_elem().

3126 {
3127  _map_type = cast_int<unsigned char>(type);
3128 }
unsigned char _map_type
Mapping function type; currently either 0 (LAGRANGE) or 1 (RATIONAL_BERNSTEIN).
Definition: elem.h:2279
virtual ElemType type() const =0

◆ set_n_comp()

void libMesh::DofObject::set_n_comp ( const unsigned int  s,
const unsigned int  var,
const unsigned int  ncomp 
)
inherited

Sets the number of components for Variable var of system s associated with this DofObject.

Definition at line 385 of file dof_object.C.

References libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), libMesh::DofObject::set_n_comp_group(), and libMesh::DofObject::var_to_vg().

388 {
389  libmesh_assert_less (s, this->n_systems());
390  libmesh_assert_less (var, this->n_vars(s));
391 
392  this->set_n_comp_group(s, this->var_to_vg(s,var), ncomp);
393 }
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in...
Definition: dof_object.h:1341
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:967
unsigned int n_systems() const
Definition: dof_object.h:937
void set_n_comp_group(const unsigned int s, const unsigned int vg, const unsigned int ncomp)
Sets the number of components for VariableGroup vg of system s associated with this DofObject...
Definition: dof_object.C:397

◆ set_n_comp_group()

void libMesh::DofObject::set_n_comp_group ( const unsigned int  s,
const unsigned int  vg,
const unsigned int  ncomp 
)
inherited

Sets the number of components for VariableGroup vg of system s associated with this DofObject.

Definition at line 397 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::invalid_id, libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), libMesh::DofObject::ncv_magic, and libMesh::DofObject::start_idx().

Referenced by libMesh::DofMap::reinit(), libMesh::DofObject::set_n_comp(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), and DofObjectTest< Node >::testManualDofCalculation().

400 {
401  libmesh_assert_less (s, this->n_systems());
402  libmesh_assert_less (vg, this->n_var_groups(s));
403 
404  // Check for trivial return
405  if (ncomp == this->n_comp_group(s,vg)) return;
406 
407 #ifndef NDEBUG
408  if (ncomp >= ncv_magic)
409  {
410  const index_t ncvm = ncv_magic;
411  libmesh_error_msg("ERROR: ncomp must be less than DofObject::ncv_magic!\n" \
412  << "ncomp = " \
413  << ncomp \
414  << ", ncv_magic = " \
415  << ncvm \
416  << "\nrecompile and try again!");
417  }
418 #endif
419 
420  const unsigned int
421  start_idx_sys = this->start_idx(s),
422  n_vars_group = this->n_vars(s,vg),
423  base_offset = start_idx_sys + 2*vg;
424 
425  libmesh_assert_less ((base_offset + 1), _idx_buf.size());
426 
427  // if (ncomp)
428  // libMesh::out << "s,vg,ncomp="
429  // << s << ","
430  // << vg << ","
431  // << ncomp << '\n';
432 
433  // set the number of components, maintaining the number
434  // of variables in the group
435  _idx_buf[base_offset] = ncv_magic*n_vars_group + ncomp;
436 
437  // We use (invalid_id - 1) to signify no
438  // components for this object
439  _idx_buf[base_offset + 1] = (ncomp == 0) ? invalid_id - 1 : invalid_id;
440 
441  // this->debug_buffer();
442  // libMesh::out << "s,vg = " << s << "," << vg << '\n'
443  // << "base_offset=" << base_offset << '\n'
444  // << "this->n_comp(s,vg)=" << this->n_comp(s,vg) << '\n'
445  // << "this->n_comp_group(s,vg)=" << this->n_comp_group(s,vg) << '\n'
446  // << "this->n_vars(s,vg)=" << this->n_vars(s,vg) << '\n'
447  // << "this->n_var_groups(s)=" << this->n_var_groups(s) << '\n';
448 
449  libmesh_assert_equal_to (ncomp, this->n_comp_group(s,vg));
450 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:957
dof_id_type index_t
DoF index information.
Definition: dof_object.h:678
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:967
unsigned int n_systems() const
Definition: dof_object.h:937
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1249
index_buffer_t _idx_buf
Definition: dof_object.h:680
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1015
static const index_t ncv_magic
Above we introduced the chimera ncv, which is a hybrid of the form ncv = ncv_magic*nv + nc where nv a...
Definition: dof_object.h:691

◆ set_n_systems()

void libMesh::DofObject::set_n_systems ( const unsigned int  s)
inherited

Sets the number of systems for this DofObject.

If this number is a change, also clears all variable count and DoF indexing associated with this DofObject.

If any extra integers are associated with this DofObject, their count and values are unchanged.

Definition at line 150 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::make_range(), libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), and libMesh::DofObject::start_idx_ints().

Referenced by libMesh::DofObject::add_system(), libMesh::DofObject::clear_dofs(), libMesh::Elem::refine(), DofObjectTest< Node >::testManualDofCalculation(), DofObjectTest< Node >::testSetNSystems(), DofObjectTest< Node >::testSetNSystemsExtraInts(), DofObjectTest< Node >::testSetNVariableGroups(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

151 {
152  const unsigned int old_ns = this->n_systems();
153 
154  // Check for trivial return
155  if (ns == old_ns)
156  return;
157 
158  const unsigned int nei = this->n_extra_integers();
159  const dof_id_type header_size = ns + bool(nei);
160  const dof_id_type hdr = nei ?
161  static_cast<dof_id_type>(-static_cast<std::ptrdiff_t>(header_size))
162  : header_size;
163  index_buffer_t new_buf(header_size + nei, hdr);
164  if (nei)
165  {
166  const unsigned int start_idx_ints = old_ns ?
167  cast_int<unsigned int>(_idx_buf[old_ns]) :
168  1;
169  libmesh_assert_less(start_idx_ints, _idx_buf.size());
170  std::copy(_idx_buf.begin()+start_idx_ints,
171  _idx_buf.end(),
172  new_buf.begin()+header_size);
173  if (ns)
174  std::fill(new_buf.begin()+1, new_buf.begin()+ns+1, ns+1);
175  }
176 
177  // vector swap trick to force deallocation when shrinking
178  new_buf.swap(_idx_buf);
179 
180 #ifdef DEBUG
181  libmesh_assert_equal_to(nei, this->n_extra_integers());
182 
183  // check that all systems now exist and that they have 0 size
184  libmesh_assert_equal_to (ns, this->n_systems());
185  for (auto s : make_range(this->n_systems()))
186  {
187  libmesh_assert_equal_to (this->n_vars(s), 0);
188  libmesh_assert_equal_to (this->n_var_groups(s), 0);
189  }
190 #endif
191 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:957
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1273
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:967
unsigned int n_systems() const
Definition: dof_object.h:937
std::vector< index_t > index_buffer_t
Definition: dof_object.h:679
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...
Definition: int_range.h:140
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1170
index_buffer_t _idx_buf
Definition: dof_object.h:680
uint8_t dof_id_type
Definition: id_types.h:67

◆ set_n_vars_per_group()

void libMesh::DofObject::set_n_vars_per_group ( const unsigned int  s,
const std::vector< unsigned int > &  nvpg 
)
inherited

Sets number of variables in each group associated with system s for this DofObject.

Implicit in this is also setting the number of VariableGroup variable groups for the system. Has the effect of setting the number of components to 0 even when called even with (nvg == this->n_var_groups(s)).

Definition at line 247 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::end_idx(), libMesh::DofObject::get_extra_integer(), libMesh::DofObject::has_extra_integers(), libMesh::DofObject::invalid_id, libMesh::make_range(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), libMesh::DofObject::ncv_magic, libMesh::DofObject::set_n_comp_group(), and libMesh::DofObject::start_idx().

Referenced by DofObjectTest< Node >::testManualDofCalculation(), DofObjectTest< Node >::testSetNVariableGroups(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

249 {
250  const unsigned int n_sys = this->n_systems();
251 
252  libmesh_assert_less (s, n_sys);
253 
254  // number of variable groups for this system - inferred
255  const unsigned int nvg = cast_int<unsigned int>(nvpg.size());
256 
257  // BSK - note that for compatibility with the previous implementation
258  // calling this method when (nvars == this->n_vars()) requires that
259  // we invalidate the DOF indices and set the number of components to 0.
260  // Note this was a bit of a surprise to me - there was no quick return in
261  // the old method, which caused removal and readdition of the DOF indices
262  // even in the case of (nvars == this->n_vars()), resulting in n_comp(s,v)
263  // implicitly becoming 0 regardless of any previous value.
264  // quick return?
265  if (nvg == this->n_var_groups(s))
266  {
267  for (unsigned int vg=0; vg<nvg; vg++)
268  {
269  this->set_n_comp_group(s,vg,0);
270  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
271  }
272  return;
273  }
274 
275  const bool hei = this->has_extra_integers();
276 
277  // since there is ample opportunity to screw up other systems, let us
278  // cache their current sizes and later assert that they are unchanged.
279 #ifdef DEBUG
280  const unsigned int nei = this->n_extra_integers();
281 
282  DofObject::index_buffer_t old_system_sizes, old_extra_integers;
283  old_system_sizes.reserve(n_sys);
284  old_extra_integers.reserve(nei);
285 
286  for (unsigned int s_ctr=0; s_ctr<n_sys; s_ctr++)
287  old_system_sizes.push_back(this->n_var_groups(s_ctr));
288 
289  for (unsigned int ei=0; ei != nei; ++ei)
290  old_extra_integers.push_back(this->get_extra_integer(ei));
291 #endif
292 
293  // remove current indices if we have some
294  if (this->n_var_groups(s) != 0)
295  {
296  const unsigned int old_nvg_s = this->n_var_groups(s);
297 
298  DofObject::index_buffer_t::iterator
299  it = _idx_buf.begin(),
300  end = _idx_buf.begin();
301 
302  std::advance(it, this->start_idx(s));
303  std::advance(end, this->end_idx(s));
304  _idx_buf.erase(it,end);
305 
306  for (unsigned int ctr=(s+1); ctr<n_sys; ctr++)
307  _idx_buf[ctr] -= 2*old_nvg_s;
308 
309  if (hei)
310  _idx_buf[n_sys] -= 2*old_nvg_s;
311  }
312 
313  // better not have any now!
314  libmesh_assert_equal_to (this->n_var_groups(s), 0);
315 
316  // Make sure we didn't screw up any of our sizes!
317 #ifdef DEBUG
318  for (auto s_ctr : make_range(this->n_systems()))
319  if (s_ctr != s)
320  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
321 
322  libmesh_assert_equal_to (nei, this->n_extra_integers());
323 
324  for (unsigned int ei=0; ei != nei; ++ei)
325  libmesh_assert_equal_to(old_extra_integers[ei], this->get_extra_integer(ei));
326 #endif
327 
328  // OK, if the user requested 0 that is what we have
329  if (nvg == 0)
330  return;
331 
332  {
333  // array to hold new indices
334  DofObject::index_buffer_t var_idxs(2*nvg);
335  for (unsigned int vg=0; vg<nvg; vg++)
336  {
337  var_idxs[2*vg ] = ncv_magic*nvpg[vg] + 0;
338  var_idxs[2*vg + 1] = invalid_id - 1;
339  }
340 
341  DofObject::index_buffer_t::iterator it = _idx_buf.begin();
342  std::advance(it, this->end_idx(s));
343  _idx_buf.insert(it, var_idxs.begin(), var_idxs.end());
344 
345  for (unsigned int ctr=(s+1); ctr<n_sys; ctr++)
346  _idx_buf[ctr] += 2*nvg;
347 
348  if (hei)
349  _idx_buf[n_sys] += 2*nvg;
350 
351  // resize _idx_buf to fit so no memory is wasted.
353  }
354 
355  libmesh_assert_equal_to (nvg, this->n_var_groups(s));
356 
357 #ifdef DEBUG
358 
359  libmesh_assert_equal_to (this->n_var_groups(s), nvpg.size());
360 
361  for (auto vg : make_range(this->n_var_groups(s)))
362  {
363  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
364  libmesh_assert_equal_to (this->n_comp_group(s,vg), 0);
365  }
366 
367  for (auto v : make_range(this->n_vars(s)))
368  libmesh_assert_equal_to (this->n_comp(s,v), 0);
369 
370  // again, all other system sizes should be unchanged!
371  for (auto s_ctr : make_range(this->n_systems()))
372  if (s_ctr != s)
373  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
374 
375  // Extra integers count and values should also be unchanged!
376  libmesh_assert_equal_to (nei, this->n_extra_integers());
377 
378  for (unsigned int ei=0; ei != nei; ++ei)
379  libmesh_assert_equal_to(old_extra_integers[ei], this->get_extra_integer(ei));
380 #endif
381 }
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:1002
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:957
unsigned int end_idx(const unsigned int s) const
The ending index for system s.
Definition: dof_object.h:1260
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:967
unsigned int n_systems() const
Definition: dof_object.h:937
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482
bool has_extra_integers() const
Returns whether extra integers are associated to the DofObject.
Definition: dof_object.h:1188
std::vector< index_t > index_buffer_t
Definition: dof_object.h:679
void set_n_comp_group(const unsigned int s, const unsigned int vg, const unsigned int ncomp)
Sets the number of components for VariableGroup vg of system s associated with this DofObject...
Definition: dof_object.C:397
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1249
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...
Definition: int_range.h:140
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1170
index_buffer_t _idx_buf
Definition: dof_object.h:680
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1015
dof_id_type get_extra_integer(const unsigned int index) const
Gets the value on this object of the extra integer associated with index, which should have been obta...
Definition: dof_object.h:1102
static const index_t ncv_magic
Above we introduced the chimera ncv, which is a hybrid of the form ncv = ncv_magic*nv + nc where nv a...
Definition: dof_object.h:691

◆ set_neighbor()

void libMesh::Elem::set_neighbor ( const unsigned int  i,
Elem n 
)
inlineinherited

◆ set_node() [1/2]

Node *& libMesh::Elem::set_node ( const unsigned int  i)
inlinevirtualinherited
Returns
The pointer to the Node with local number i as a writable reference.

Reimplemented in libMesh::RemoteElem.

Definition at line 2527 of file elem.h.

References libMesh::Elem::_nodes, and libMesh::Elem::n_nodes().

Referenced by LinearElasticityWithContact::add_contact_edge_elements(), add_cube_convex_hull_to_mesh(), libMesh::UnstructuredMesh::all_first_order(), AllSecondOrderTest::allCompleteOrderMixed(), AllSecondOrderTest::allCompleteOrderRange(), AllSecondOrderTest::allSecondOrderMixed(), AllSecondOrderTest::allSecondOrderRange(), libMesh::TetGenMeshInterface::assign_nodes_to_elem(), libMesh::MeshTools::Generation::build_cube(), GetBoundaryPointsTest::build_mesh(), MixedDimensionMeshTest::build_mesh(), MeshfunctionDFEM::build_mesh(), SlitMeshTest::build_mesh(), MixedDimensionNonUniformRefinement::build_mesh(), MixedDimensionNonUniformRefinementTriangle::build_mesh(), MixedDimensionNonUniformRefinement3D::build_mesh(), OverlappingTestBase::build_quad_mesh(), libMesh::TriangleWrapper::copy_tri_to_mesh(), libMesh::UnstructuredMesh::create_submesh(), libMesh::C0Polygon::permute(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::AbaqusIO::read_elements(), libMesh::GmshIO::read_mesh(), libMesh::DynaIO::read_mesh(), libMesh::MatlabIO::read_stream(), libMesh::C0Polyhedron::retriangulate(), libMesh::RemoteElem::set_node(), PerElemTest< elem_type >::setUp(), libMesh::FE< Dim, LAGRANGE_VEC >::shape(), libMesh::Polyhedron::side_clones(), libMesh::UnstructuredMesh::stitching_helper(), libMesh::MeshTools::Generation::surface_octahedron(), libMesh::Elem::swap2nodes(), SystemsTest::testDofCouplingWithVarGroups(), MeshTriangulationTest::testEdgesMesh(), MeshTriangulationTest::testHalfDomain(), NodalNeighborsTest::testOrientation(), MeshTriangulationTest::testPoly2TriBad1DMultiBoundary(), MeshTriangulationTest::testPoly2TriBad2DMultiBoundary(), MeshTriangulationTest::testPoly2TriBadEdges(), EquationSystemsTest::testPostInitAddElem(), SystemsTest::testProjectMatrix3D(), InfFERadialTest::testRefinement(), EquationSystemsTest::testReinitWithNodeElem(), SystemsTest::testSetSystemParameterOverEquationSystem(), BoundaryInfoTest::testShellFaceConstraints(), InfFERadialTest::testSides(), MeshTetTest::testTetsToTets(), MeshSubdomainIDTest::testUnpartitioned(), and libMesh::Poly2TriTriangulator::triangulate_current_points().

2528 {
2529  libmesh_assert_less (i, this->n_nodes());
2530 
2531  libmesh_deprecated();
2532 
2533  return _nodes[i];
2534 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2227
virtual unsigned int n_nodes() const =0

◆ set_node() [2/2]

void libMesh::Elem::set_node ( const unsigned int  i,
Node node 
)
inlinevirtualinherited

Sets local Node i to refer to node.

Reimplemented in libMesh::RemoteElem.

Definition at line 2540 of file elem.h.

References libMesh::Elem::_nodes, and libMesh::Elem::n_nodes().

2542 {
2543  libmesh_assert_less (i, this->n_nodes());
2544 
2545  _nodes[i] = node;
2546 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2227
virtual unsigned int n_nodes() const =0

◆ set_old_dof_object()

void libMesh::DofObject::set_old_dof_object ( )
inherited

Sets the old_dof_object to a copy of this.

Definition at line 135 of file dof_object.C.

References libMesh::DofObject::clear_old_dof_object(), libMesh::DofObject::construct(), libMesh::libmesh_assert(), and libMesh::DofObject::old_dof_object.

136 {
137  this->clear_old_dof_object();
138 
140 
141  // Make a new DofObject, assign a copy of \p this.
142  // Make sure the copy ctor for DofObject works!!
143  this->old_dof_object = this->construct(this);
144 }
std::unique_ptr< DofObject > construct(const DofObject *other=nullptr)
Convenient factory function that calls either the (deep) copy constructor or the default constructor ...
Definition: dof_object.h:741
void clear_old_dof_object()
Sets the old_dof_object to nullptr.
Definition: dof_object.C:128
libmesh_assert(ctx)
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88

◆ set_p_level()

void libMesh::Elem::set_p_level ( const unsigned int  p)
inherited

Sets the value of the p-refinement level for the element.

The following functions only apply when AMR is enabled and thus are not present otherwise.

Note
The maximum p-refinement level is currently 255.

Definition at line 41 of file elem_refinement.C.

References libMesh::Elem::_p_level, libMesh::Elem::child_ref_range(), libMesh::Elem::hack_p_level(), libMesh::Elem::JUST_COARSENED, libMesh::Elem::JUST_REFINED, libMesh::Elem::p_level(), libMesh::Elem::parent(), libMesh::Elem::set_p_level(), and libMesh::Elem::set_p_refinement_flag().

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::Elem::coarsen(), libMesh::Elem::Elem(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), libMesh::Elem::refine(), libMesh::Elem::set_p_level(), and VolumeTest::testHex20PLevelTrueCentroid().

42 {
43  // Maintain the parent's p level as the minimum of it's children
44  if (this->parent() != nullptr)
45  {
46  unsigned int parent_p_level = this->parent()->p_level();
47 
48  // If our new p level is less than our parents, our parents drops
49  if (parent_p_level > p)
50  {
51  this->parent()->set_p_level(p);
52 
53  // And we should keep track of the drop, in case we need to
54  // do a projection later.
56  }
57  // If we are the lowest p level and it increases, so might
58  // our parent's, but we have to check every other child to see
59  else if (parent_p_level == _p_level && _p_level < p)
60  {
61  _p_level = cast_int<unsigned char>(p);
62  parent_p_level = cast_int<unsigned char>(p);
63  for (auto & c : this->parent()->child_ref_range())
64  parent_p_level = std::min(parent_p_level,
65  c.p_level());
66 
67  // When its children all have a higher p level, the parent's
68  // should rise
69  if (parent_p_level > this->parent()->p_level())
70  {
71  this->parent()->set_p_level(parent_p_level);
72 
73  // And we should keep track of the rise, in case we need to
74  // do a projection later.
76  }
77 
78  return;
79  }
80  }
81 
82  this->hack_p_level(p);
83 }
void set_p_level(const unsigned int p)
Sets the value of the p-refinement level for the element.
const Elem * parent() const
Definition: elem.h:3027
unsigned char _p_level
p refinement level - the difference between the polynomial degree on this element and the minimum pol...
Definition: elem.h:2272
unsigned int p_level() const
Definition: elem.h:3105
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:2328
void set_p_refinement_flag(const RefinementState pflag)
Sets the value of the p-refinement flag for the element.
Definition: elem.h:3231
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...
Definition: elem.h:3261

◆ set_p_refinement_flag()

void libMesh::Elem::set_p_refinement_flag ( const RefinementState  pflag)
inlineinherited

Sets the value of the p-refinement flag for the element.

Definition at line 3231 of file elem.h.

References libMesh::Elem::_pflag, libMesh::Elem::JUST_REFINED, and libMesh::Elem::p_level().

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshRefinement::make_flags_parallel_consistent(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::refine(), and libMesh::Elem::set_p_level().

3232 {
3233  if (this->p_level() == 0)
3234  libmesh_assert_not_equal_to
3235  (pflag, Elem::JUST_REFINED);
3236 
3237  _pflag = cast_int<unsigned char>(pflag);
3238 }
unsigned char _pflag
p refinement flag.
Definition: elem.h:2262
unsigned int p_level() const
Definition: elem.h:3105

◆ set_parent()

void libMesh::Elem::set_parent ( Elem p)
inlineinherited

Sets the pointer to the element's parent.

Dangerous! Only use this if you know what you are doing!

Definition at line 3043 of file elem.h.

References libMesh::Elem::_elemlinks, and libMesh::Elem::dim().

Referenced by libMesh::BoundaryInfo::add_elements(), and libMesh::UnstructuredMesh::all_first_order().

3044 {
3045  // We no longer support using parent() as interior_parent()
3046  libmesh_assert_equal_to(this->dim(), p ? p->dim() : this->dim());
3047  _elemlinks[0] = p;
3048 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2233
virtual unsigned short dim() const =0

◆ set_refinement_flag()

void libMesh::Elem::set_refinement_flag ( const RefinementState  rflag)
inlineinherited

◆ set_unique_id() [1/2]

unique_id_type & libMesh::DofObject::set_unique_id ( )
inlineinherited

◆ set_unique_id() [2/2]

void libMesh::DofObject::set_unique_id ( unique_id_type  new_id)
inlineinherited

Sets the unique_id for this DofObject.

Definition at line 872 of file dof_object.h.

References libMesh::DofObject::_unique_id, and libMesh::libmesh_ignore().

873 {
874 #ifdef LIBMESH_ENABLE_UNIQUE_ID
875  _unique_id = new_id;
876 #else
877  libmesh_ignore(new_id);
878  libmesh_not_implemented();
879 #endif
880 }
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:577
void libmesh_ignore(const Args &...)

◆ set_vg_dof_base()

void libMesh::DofObject::set_vg_dof_base ( const unsigned int  s,
const unsigned int  vg,
const dof_id_type  db 
)
inlineinherited

VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base.

Definition at line 1297 of file dof_object.h.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::start_idx(), and libMesh::DofObject::vg_dof_base().

Referenced by libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofObject::invalidate_dofs(), libMesh::DofMap::reinit(), libMesh::DofMap::set_nonlocal_dof_objects(), and DofObjectTest< Node >::testManualDofCalculation().

1300 {
1301  libmesh_assert_less (s, this->n_systems());
1302  libmesh_assert_less (vg, this->n_var_groups(s));
1303 
1304  const unsigned int
1305  start_idx_sys = this->start_idx(s);
1306 
1307  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1308 
1309  _idx_buf[start_idx_sys + 2*vg + 1] = db;
1310 
1311  libmesh_assert_equal_to (this->vg_dof_base(s,vg), db);
1312 }
dof_id_type vg_dof_base(const unsigned int s, const unsigned int vg) const
VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for di...
Definition: dof_object.h:1317
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:957
unsigned int n_systems() const
Definition: dof_object.h:937
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1249
index_buffer_t _idx_buf
Definition: dof_object.h:680

◆ side_children_matrix()

unsigned int libMesh::Pyramid::side_children_matrix ( const unsigned  int,
const unsigned  int 
) const
inlineprotectedinherited

Matrix that allows children to inherit boundary conditions.

Definition at line 221 of file cell_pyramid.h.

223  { libmesh_not_implemented(); return 0; }

◆ side_index_range()

IntRange< unsigned short > libMesh::Elem::side_index_range ( ) const
inlineinherited
Returns
An integer range from 0 up to (but not including) the number of sides this element has.

Definition at line 2670 of file elem.h.

References libMesh::Elem::n_sides().

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::BoundaryInfo::add_elements(), libMesh::MeshTools::Modification::all_tri(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), compute_enriched_soln(), libMesh::FEAbstract::compute_node_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::BoundaryInfo::copy_boundary_ids(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::MeshTools::Modification::flatten(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), libMesh::Elem::get_info(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::Elem::has_topological_neighbor(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_constraints(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_node_constraints(), libMesh::LaplaceMeshSmoother::init(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::Elem::nullify_neighbors(), libMesh::PostscriptIO::plot_quadratic_elem(), libMesh::MeshTools::Modification::smooth(), libMesh::UnstructuredMesh::stitching_helper(), MeshBaseTest::testMeshBaseVerifyIsPrepared(), and libMesh::MeshTetInterface::volume_to_surface_mesh().

2671 {
2672  return {0, cast_int<unsigned short>(this->n_sides())};
2673 }
virtual unsigned int n_sides() const =0

◆ side_ptr() [1/4]

std::unique_ptr< Elem > libMesh::Pyramid::side_ptr ( const unsigned int  i)
overridevirtualinherited
Returns
A primitive triangle or quad for face i.

Implements libMesh::Elem.

Definition at line 158 of file cell_pyramid.C.

References libMesh::Pyramid::n_sides(), and libMesh::Pyramid5::side_nodes_map.

Referenced by libMesh::Pyramid5::build_side_ptr(), and libMesh::Pyramid::side_ptr().

159 {
160  libmesh_assert_less (i, this->n_sides());
161 
162  // Return value
163  std::unique_ptr<Elem> face;
164 
165  // Set up the type of element
166  switch (i)
167  {
168  case 0: // triangular face 1
169  case 1: // triangular face 2
170  case 2: // triangular face 3
171  case 3: // triangular face 4
172  {
173  face = std::make_unique<Tri3>();
174  break;
175  }
176  case 4: // the quad face at z=0
177  {
178  face = std::make_unique<Quad4>();
179  break;
180  }
181  default:
182  libmesh_error_msg("Invalid side i = " << i);
183  }
184 
185  // Set the nodes
186  for (auto n : face->node_index_range())
187  face->set_node(n, this->node_ptr(Pyramid5::side_nodes_map[i][n]));
188 
189  return face;
190 }
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:90
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.

◆ side_ptr() [2/4]

void libMesh::Pyramid::side_ptr ( std::unique_ptr< Elem > &  side,
const unsigned int  i 
)
overridevirtualinherited

Rebuilds a primitive triangle or quad for face i.

Implements libMesh::Elem.

Definition at line 194 of file cell_pyramid.C.

References libMesh::Pyramid::n_sides(), libMesh::QUAD4, libMesh::Pyramid5::side_nodes_map, libMesh::Pyramid::side_ptr(), libMesh::Elem::subdomain_id(), and libMesh::TRI3.

196 {
197  libmesh_assert_less (i, this->n_sides());
198 
199  switch (i)
200  {
201  case 0: // triangular face 1
202  case 1: // triangular face 2
203  case 2: // triangular face 3
204  case 3: // triangular face 4
205  {
206  if (!side.get() || side->type() != TRI3)
207  {
208  side = this->side_ptr(i);
209  return;
210  }
211  break;
212  }
213 
214  case 4: // the quad face at z=0
215  {
216  if (!side.get() || side->type() != QUAD4)
217  {
218  side = this->side_ptr(i);
219  return;
220  }
221  break;
222  }
223 
224  default:
225  libmesh_error_msg("Invalid side i = " << i);
226  }
227 
228  side->subdomain_id() = this->subdomain_id();
229 
230  // Set the nodes
231  for (auto n : side->node_index_range())
232  side->set_node(n, this->node_ptr(Pyramid5::side_nodes_map[i][n]));
233 }
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:90
virtual std::unique_ptr< Elem > side_ptr(const unsigned int i) override
Definition: cell_pyramid.C:158
subdomain_id_type subdomain_id() const
Definition: elem.h:2551
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.

◆ side_ptr() [3/4]

std::unique_ptr< const Elem > libMesh::Elem::side_ptr ( unsigned int  i) const
inlineinherited

Definition at line 2679 of file elem.h.

References libMesh::Elem::side_ptr().

2680 {
2681  // Call the non-const version of this function, return the result as
2682  // a std::unique_ptr<const Elem>.
2683  Elem * me = const_cast<Elem *>(this);
2684  const Elem * s = const_cast<const Elem *>(me->side_ptr(i).release());
2685  return std::unique_ptr<const Elem>(s);
2686 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360

◆ side_ptr() [4/4]

void libMesh::Elem::side_ptr ( std::unique_ptr< const Elem > &  side,
const unsigned int  i 
) const
inlineinherited

Definition at line 2692 of file elem.h.

References libMesh::Elem::side_ptr().

2694 {
2695  // Hand off to the non-const version of this function
2696  Elem * me = const_cast<Elem *>(this);
2697  std::unique_ptr<Elem> e {const_cast<Elem *>(elem.release())};
2698  me->side_ptr(e, i);
2699  elem = std::move(e);
2700 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360

◆ side_type()

ElemType libMesh::Pyramid18::side_type ( const unsigned int  s) const
finaloverridevirtual
Returns
The type of element for side s.

Implements libMesh::Elem.

Definition at line 499 of file cell_pyramid18.C.

References libMesh::QUAD9, and libMesh::TRI7.

500 {
501  libmesh_assert_less (s, 5);
502  if (s < 4)
503  return TRI7;
504  return QUAD9;
505 }

◆ sides_on_edge()

std::vector< unsigned int > libMesh::Pyramid::sides_on_edge ( const unsigned int  int) const
finaloverridevirtualinherited
Returns
the (local) side numbers that touch the specified edge

Implements libMesh::Elem.

Definition at line 262 of file cell_pyramid.C.

References libMesh::Pyramid::edge_sides_map, and libMesh::Pyramid::n_edges().

263 {
264  libmesh_assert_less (e, this->n_edges());
265  return {edge_sides_map[e][0], edge_sides_map[e][1]};
266 }
virtual unsigned int n_edges() const override
Definition: cell_pyramid.h:100
static const unsigned int edge_sides_map[8][2]
This maps each edge to the sides that contain said edge.
Definition: cell_pyramid.h:199

◆ simple_build_edge_ptr() [1/2]

template<typename Edgeclass , typename Subclass >
std::unique_ptr< Elem > libMesh::Elem::simple_build_edge_ptr ( const unsigned int  i)
inlineprotectedinherited

An implementation for simple (all edges equal) elements.

Definition at line 2855 of file elem.h.

References libMesh::Elem::mapping_type(), libMesh::Elem::n_edges(), libMesh::Elem::p_level(), and libMesh::Elem::subdomain_id().

2856 {
2857  libmesh_assert_less (i, this->n_edges());
2858 
2859  std::unique_ptr<Elem> edge = std::make_unique<Edgeclass>(this);
2860 
2861  for (auto n : edge->node_index_range())
2862  edge->set_node(n, this->node_ptr(Subclass::edge_nodes_map[i][n]));
2863 
2864  edge->set_interior_parent(this);
2865  edge->set_mapping_type(this->mapping_type());
2866  edge->subdomain_id() = this->subdomain_id();
2867 #ifdef LIBMESH_ENABLE_AMR
2868  edge->set_p_level(this->p_level());
2869 #endif
2870 
2871  return edge;
2872 }
unsigned int p_level() const
Definition: elem.h:3105
ElemMappingType mapping_type() const
Definition: elem.h:3117
virtual unsigned int n_edges() const =0
subdomain_id_type subdomain_id() const
Definition: elem.h:2551

◆ simple_build_edge_ptr() [2/2]

template<typename Subclass >
void libMesh::Elem::simple_build_edge_ptr ( std::unique_ptr< Elem > &  edge,
const unsigned int  i,
ElemType  edgetype 
)
inlineprotectedinherited

An implementation for simple (all edges equal) elements.

Definition at line 2880 of file elem.h.

References libMesh::Elem::mapping_type(), libMesh::Elem::n_edges(), libMesh::Elem::p_level(), and libMesh::Elem::subdomain_id().

2883 {
2884  libmesh_assert_less (i, this->n_edges());
2885 
2886  if (!edge.get() || edge->type() != edgetype)
2887  {
2888  Subclass & real_me = cast_ref<Subclass&>(*this);
2889  edge = real_me.Subclass::build_edge_ptr(i);
2890  }
2891  else
2892  {
2893  edge->set_mapping_type(this->mapping_type());
2894  edge->subdomain_id() = this->subdomain_id();
2895 #ifdef LIBMESH_ENABLE_AMR
2896  edge->set_p_level(this->p_level());
2897 #endif
2898  for (auto n : edge->node_index_range())
2899  edge->set_node(n, this->node_ptr(Subclass::edge_nodes_map[i][n]));
2900  }
2901 }
unsigned int p_level() const
Definition: elem.h:3105
ElemMappingType mapping_type() const
Definition: elem.h:3117
virtual unsigned int n_edges() const =0
subdomain_id_type subdomain_id() const
Definition: elem.h:2551

◆ simple_build_side_ptr() [1/2]

template<typename Sideclass , typename Subclass >
std::unique_ptr< Elem > libMesh::Elem::simple_build_side_ptr ( const unsigned int  i,
bool  proxy 
)
inlineprotectedinherited

An implementation for simple (all sides equal) elements.

Definition at line 2734 of file elem.h.

References libMesh::Elem::mapping_type(), libMesh::Elem::n_sides(), libMesh::Elem::p_level(), and libMesh::Elem::subdomain_id().

2736 {
2737  libmesh_assert_less (i, this->n_sides());
2738 
2739  std::unique_ptr<Elem> face;
2740  if (proxy)
2741  {
2742 #ifdef LIBMESH_ENABLE_DEPRECATED
2743  face = std::make_unique<Side<Sideclass,Subclass>>(this,i);
2744  libmesh_deprecated();
2745 #else
2746  libmesh_error();
2747 #endif
2748  }
2749  else
2750  {
2751  face = std::make_unique<Sideclass>(this);
2752  for (auto n : face->node_index_range())
2753  face->set_node(n, this->node_ptr(Subclass::side_nodes_map[i][n]));
2754  }
2755 
2756 #ifdef LIBMESH_ENABLE_DEPRECATED
2757  if (!proxy) // proxy sides used to leave parent() set
2758 #endif
2759  face->set_parent(nullptr);
2760  face->set_interior_parent(this);
2761 
2762  face->set_mapping_type(this->mapping_type());
2763  face->subdomain_id() = this->subdomain_id();
2764 #ifdef LIBMESH_ENABLE_AMR
2765  face->set_p_level(this->p_level());
2766 #endif
2767 
2768  return face;
2769 }
unsigned int p_level() const
Definition: elem.h:3105
ElemMappingType mapping_type() const
Definition: elem.h:3117
virtual unsigned int n_sides() const =0
subdomain_id_type subdomain_id() const
Definition: elem.h:2551

◆ simple_build_side_ptr() [2/2]

template<typename Subclass >
void libMesh::Elem::simple_build_side_ptr ( std::unique_ptr< Elem > &  side,
const unsigned int  i,
ElemType  sidetype 
)
inlineprotectedinherited

An implementation for simple (all sides equal) elements.

Definition at line 2776 of file elem.h.

References libMesh::Elem::mapping_type(), libMesh::Elem::n_sides(), libMesh::Elem::p_level(), and libMesh::Elem::subdomain_id().

2779 {
2780  libmesh_assert_less (i, this->n_sides());
2781 
2782  if (!side.get() || side->type() != sidetype)
2783  {
2784  Subclass & real_me = cast_ref<Subclass&>(*this);
2785  side = real_me.Subclass::build_side_ptr(i, false);
2786  }
2787  else
2788  {
2789  side->subdomain_id() = this->subdomain_id();
2790  side->set_mapping_type(this->mapping_type());
2791 #ifdef LIBMESH_ENABLE_AMR
2792  side->set_p_level(this->p_level());
2793 #endif
2794  for (auto n : side->node_index_range())
2795  side->set_node(n, this->node_ptr(Subclass::side_nodes_map[i][n]));
2796  }
2797 }
unsigned int p_level() const
Definition: elem.h:3105
ElemMappingType mapping_type() const
Definition: elem.h:3117
virtual unsigned int n_sides() const =0
subdomain_id_type subdomain_id() const
Definition: elem.h:2551

◆ simple_side_ptr()

template<typename Subclass , typename Mapclass >
void libMesh::Elem::simple_side_ptr ( std::unique_ptr< Elem > &  side,
const unsigned int  i,
ElemType  sidetype 
)
inlineprotectedinherited

An implementation for simple (all sides equal) elements.

Definition at line 2804 of file elem.h.

References libMesh::Elem::n_sides(), and libMesh::Elem::subdomain_id().

2807 {
2808  libmesh_assert_less (i, this->n_sides());
2809 
2810  if (!side.get() || side->type() != sidetype)
2811  {
2812  Subclass & real_me = cast_ref<Subclass&>(*this);
2813  side = real_me.Subclass::side_ptr(i);
2814  }
2815  else
2816  {
2817  side->subdomain_id() = this->subdomain_id();
2818 
2819  for (auto n : side->node_index_range())
2820  side->set_node(n, this->node_ptr(Mapclass::side_nodes_map[i][n]));
2821  }
2822 }
virtual unsigned int n_sides() const =0
subdomain_id_type subdomain_id() const
Definition: elem.h:2551

◆ subactive()

bool libMesh::Elem::subactive ( ) const
inlineinherited
Returns
true if the element is subactive (i.e. has no active descendants), false otherwise or if AMR is disabled.

Definition at line 2956 of file elem.h.

References libMesh::Elem::active(), libMesh::Elem::has_children(), and libMesh::Elem::parent().

Referenced by libMesh::HPCoarsenTest::add_projection(), libMesh::Elem::ancestor(), libMesh::FEAbstract::compute_node_constraints(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_constraints(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_node_constraints(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::Elem::refine(), libMesh::Elem::remove_links_to_me(), and libMesh::UnstructuredMesh::stitching_helper().

2957 {
2958 #ifdef LIBMESH_ENABLE_AMR
2959  if (this->active())
2960  return false;
2961  if (!this->has_children())
2962  return true;
2963  for (const Elem * my_ancestor = this->parent();
2964  my_ancestor != nullptr;
2965  my_ancestor = my_ancestor->parent())
2966  if (my_ancestor->active())
2967  return true;
2968 #endif
2969 
2970  return false;
2971 }
const Elem * parent() const
Definition: elem.h:3027
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360
bool active() const
Definition: elem.h:2938
bool has_children() const
Definition: elem.h:2976

◆ subdomain_id() [1/2]

subdomain_id_type libMesh::Elem::subdomain_id ( ) const
inlineinherited
Returns
The subdomain that this element belongs to.

Definition at line 2551 of file elem.h.

References libMesh::Elem::_sbd_id.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::SyncSubdomainIds::act_on_data(), LinearElasticityWithContact::add_contact_edge_elements(), libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Modification::all_tri(), AllSecondOrderTest::allCompleteOrderRange(), AllSecondOrderTest::allSecondOrderRange(), libMesh::AbaqusIO::assign_subdomain_ids(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::InfHex8::build_edge_ptr(), libMesh::InfPrism6::build_edge_ptr(), libMesh::InfHex18::build_edge_ptr(), libMesh::InfPrism12::build_edge_ptr(), libMesh::InfHex16::build_edge_ptr(), MixedDimensionMeshTest::build_mesh(), MixedDimensionNonUniformRefinement::build_mesh(), MixedDimensionNonUniformRefinementTriangle::build_mesh(), MixedDimensionNonUniformRefinement3D::build_mesh(), OverlappingTestBase::build_quad_mesh(), libMesh::InfQuad4::build_side_ptr(), libMesh::InfHex8::build_side_ptr(), libMesh::InfPrism6::build_side_ptr(), libMesh::InfHex18::build_side_ptr(), libMesh::Pyramid5::build_side_ptr(), libMesh::InfQuad6::build_side_ptr(), libMesh::Prism6::build_side_ptr(), libMesh::InfPrism12::build_side_ptr(), libMesh::InfHex16::build_side_ptr(), libMesh::C0Polygon::build_side_ptr(), libMesh::Pyramid13::build_side_ptr(), libMesh::Prism15::build_side_ptr(), libMesh::Prism18::build_side_ptr(), libMesh::Pyramid14::build_side_ptr(), libMesh::Polyhedron::build_side_ptr(), libMesh::Prism20::build_side_ptr(), libMesh::Prism21::build_side_ptr(), build_side_ptr(), libMesh::MeshTools::Modification::change_subdomain_id(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::TriangleWrapper::copy_tri_to_mesh(), libMesh::C0Polyhedron::disconnected_clone(), libMesh::Elem::disconnected_clone(), libMesh::DofMap::dof_indices(), libMesh::Elem::Elem(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::MeshTools::Modification::flatten(), libMesh::SyncSubdomainIds::gather_data(), libMesh::Elem::get_info(), MeshExtruderTest::QueryElemSubdomainID::get_subdomain_for_layer(), libMesh::UNVIO::groups_in(), libMesh::DofMap::old_dof_indices(), libMesh::PointLocatorNanoflann::operator()(), libMesh::XdrIO::pack_element(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), libMesh::CheckpointIO::read_connectivity(), libMesh::GmshIO::read_mesh(), libMesh::DynaIO::read_mesh(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::Prism::side_ptr(), libMesh::Pyramid::side_ptr(), libMesh::Edge::side_ptr(), libMesh::Polygon::side_ptr(), libMesh::InfPrism::side_ptr(), libMesh::InfHex::side_ptr(), libMesh::InfQuad::side_ptr(), libMesh::Elem::simple_build_edge_ptr(), libMesh::Elem::simple_build_side_ptr(), libMesh::Elem::simple_side_ptr(), SystemsTest::testDofCouplingWithVarGroups(), MeshExtruderTest::testExtruder(), SystemsTest::testSetSystemParameterOverEquationSystem(), and SystemsTest::tripleValueTest().

2552 {
2553  return _sbd_id;
2554 }
subdomain_id_type _sbd_id
The subdomain to which this element belongs.
Definition: elem.h:2249

◆ subdomain_id() [2/2]

subdomain_id_type & libMesh::Elem::subdomain_id ( )
inlineinherited
Returns
The subdomain that this element belongs to as a writable reference.

Definition at line 2559 of file elem.h.

References libMesh::Elem::_sbd_id.

2560 {
2561  return _sbd_id;
2562 }
subdomain_id_type _sbd_id
The subdomain to which this element belongs.
Definition: elem.h:2249

◆ supported_nodal_order()

virtual Order libMesh::Elem::supported_nodal_order ( ) const
inlinevirtualinherited
Returns
The maximum supported approximation order for nodal (Lagrange or Rational Bezier-Bernstein) variables on this element type. This is usually the same as the default order.

Reimplemented in libMesh::NodeElem.

Definition at line 996 of file elem.h.

References libMesh::Elem::default_order().

Referenced by libMesh::MeshBase::copy_constraint_rows().

996 { return default_order(); }
virtual Order default_order() const =0

◆ swap2boundaryedges()

void libMesh::Elem::swap2boundaryedges ( unsigned short  e1,
unsigned short  e2,
BoundaryInfo boundary_info 
) const
protectedinherited

Swaps two edges in boundary_info, if it is non-null.

Definition at line 3553 of file elem.C.

References libMesh::BoundaryInfo::add_edge(), libMesh::BoundaryInfo::edge_boundary_ids(), and libMesh::BoundaryInfo::remove_edge().

Referenced by libMesh::InfQuad4::flip(), libMesh::InfPrism6::flip(), libMesh::InfHex8::flip(), libMesh::Quad4::flip(), libMesh::InfQuad6::flip(), libMesh::C0Polygon::flip(), libMesh::Pyramid5::flip(), libMesh::Tri3::flip(), libMesh::Prism6::flip(), libMesh::InfPrism12::flip(), libMesh::Quad8::flip(), libMesh::Hex8::flip(), libMesh::Quad9::flip(), libMesh::InfHex16::flip(), libMesh::Tri7::flip(), libMesh::Tri6::flip(), libMesh::Pyramid13::flip(), libMesh::InfHex18::flip(), libMesh::Hex20::flip(), libMesh::Tet14::flip(), libMesh::Tet10::flip(), libMesh::Prism15::flip(), libMesh::Tet4::flip(), libMesh::Pyramid14::flip(), flip(), libMesh::Hex27::flip(), libMesh::Prism18::flip(), libMesh::Prism20::flip(), and libMesh::Prism21::flip().

3556 {
3557  std::vector<boundary_id_type> ids1, ids2;
3558  boundary_info->edge_boundary_ids(this, e1, ids1);
3559  boundary_info->edge_boundary_ids(this, e2, ids2);
3560  boundary_info->remove_edge(this, e1);
3561  boundary_info->remove_edge(this, e2);
3562  if (!ids1.empty())
3563  boundary_info->add_edge(this, e2, ids1);
3564  if (!ids2.empty())
3565  boundary_info->add_edge(this, e1, ids2);
3566 }

◆ swap2boundarysides()

void libMesh::Elem::swap2boundarysides ( unsigned short  s1,
unsigned short  s2,
BoundaryInfo boundary_info 
) const
protectedinherited

Swaps two sides in boundary_info, if it is non-null.

Definition at line 3537 of file elem.C.

References libMesh::BoundaryInfo::add_side(), libMesh::BoundaryInfo::boundary_ids(), and libMesh::BoundaryInfo::remove_side().

Referenced by libMesh::InfQuad4::flip(), libMesh::InfPrism6::flip(), libMesh::InfHex8::flip(), libMesh::Edge2::flip(), libMesh::Quad4::flip(), libMesh::InfQuad6::flip(), libMesh::C0Polygon::flip(), libMesh::Pyramid5::flip(), libMesh::Edge4::flip(), libMesh::Tri3::flip(), libMesh::Prism6::flip(), libMesh::Edge3::flip(), libMesh::InfPrism12::flip(), libMesh::Quad8::flip(), libMesh::Hex8::flip(), libMesh::Quad9::flip(), libMesh::InfHex16::flip(), libMesh::Tri7::flip(), libMesh::Tri6::flip(), libMesh::Pyramid13::flip(), libMesh::InfHex18::flip(), libMesh::Hex20::flip(), libMesh::Tet10::flip(), libMesh::Tet14::flip(), libMesh::Prism15::flip(), libMesh::Tet4::flip(), libMesh::Pyramid14::flip(), flip(), libMesh::Hex27::flip(), libMesh::Prism20::flip(), libMesh::Prism18::flip(), and libMesh::Prism21::flip().

3540 {
3541  std::vector<boundary_id_type> ids1, ids2;
3542  boundary_info->boundary_ids(this, s1, ids1);
3543  boundary_info->boundary_ids(this, s2, ids2);
3544  boundary_info->remove_side(this, s1);
3545  boundary_info->remove_side(this, s2);
3546  if (!ids1.empty())
3547  boundary_info->add_side(this, s2, ids1);
3548  if (!ids2.empty())
3549  boundary_info->add_side(this, s1, ids2);
3550 }

◆ swap2neighbors()

void libMesh::Elem::swap2neighbors ( unsigned int  n1,
unsigned int  n2 
)
inlineprotectedinherited

Swaps two neighbor_ptrs.

Definition at line 2083 of file elem.h.

References libMesh::Elem::neighbor_ptr(), and libMesh::Elem::set_neighbor().

Referenced by libMesh::InfQuad4::flip(), libMesh::InfPrism6::flip(), libMesh::InfHex8::flip(), libMesh::Quad4::flip(), libMesh::Edge2::flip(), libMesh::InfQuad6::flip(), libMesh::C0Polygon::flip(), libMesh::Pyramid5::flip(), libMesh::Edge4::flip(), libMesh::Tri3::flip(), libMesh::Prism6::flip(), libMesh::Edge3::flip(), libMesh::InfPrism12::flip(), libMesh::Quad8::flip(), libMesh::Hex8::flip(), libMesh::Quad9::flip(), libMesh::Tri7::flip(), libMesh::InfHex16::flip(), libMesh::Tri6::flip(), libMesh::Pyramid13::flip(), libMesh::InfHex18::flip(), libMesh::Hex20::flip(), libMesh::Tet14::flip(), libMesh::Tet10::flip(), libMesh::Prism15::flip(), libMesh::Tet4::flip(), libMesh::Pyramid14::flip(), flip(), libMesh::Hex27::flip(), libMesh::Prism18::flip(), libMesh::Prism20::flip(), libMesh::Prism21::flip(), libMesh::Prism6::permute(), libMesh::Hex8::permute(), libMesh::Hex20::permute(), libMesh::Prism15::permute(), libMesh::Hex27::permute(), libMesh::Prism20::permute(), libMesh::Prism18::permute(), libMesh::Prism21::permute(), libMesh::Elem::swap3neighbors(), and libMesh::Elem::swap4neighbors().

2084  {
2085  Elem * temp = this->neighbor_ptr(n1);
2086  this->set_neighbor(n1, this->neighbor_ptr(n2));
2087  this->set_neighbor(n2, temp);
2088  }
void set_neighbor(const unsigned int i, Elem *n)
Assigns n as the neighbor.
Definition: elem.h:2587
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2567

◆ swap2nodes()

void libMesh::Elem::swap2nodes ( unsigned int  n1,
unsigned int  n2 
)
inlineprotectedinherited

Swaps two node_ptrs.

Definition at line 2073 of file elem.h.

References libMesh::Elem::node_ptr(), and libMesh::Elem::set_node().

Referenced by libMesh::InfQuad4::flip(), libMesh::InfPrism6::flip(), libMesh::InfHex8::flip(), libMesh::Quad4::flip(), libMesh::Edge2::flip(), libMesh::InfQuad6::flip(), libMesh::C0Polygon::flip(), libMesh::Pyramid5::flip(), libMesh::Edge4::flip(), libMesh::Tri3::flip(), libMesh::Prism6::flip(), libMesh::Edge3::flip(), libMesh::InfPrism12::flip(), libMesh::Quad8::flip(), libMesh::Hex8::flip(), libMesh::Quad9::flip(), libMesh::Tri7::flip(), libMesh::InfHex16::flip(), libMesh::Tri6::flip(), libMesh::Pyramid13::flip(), libMesh::InfHex18::flip(), libMesh::Hex20::flip(), libMesh::Tet14::flip(), libMesh::Tet10::flip(), libMesh::Prism15::flip(), libMesh::Tet4::flip(), libMesh::Pyramid14::flip(), flip(), libMesh::Hex27::flip(), libMesh::Prism18::flip(), libMesh::Prism20::flip(), libMesh::Prism21::flip(), libMesh::Prism6::permute(), libMesh::Hex8::permute(), libMesh::Hex20::permute(), libMesh::Prism15::permute(), libMesh::Hex27::permute(), libMesh::Prism20::permute(), libMesh::Prism18::permute(), libMesh::Prism21::permute(), libMesh::Elem::swap3nodes(), and libMesh::Elem::swap4nodes().

2074  {
2075  Node * temp = this->node_ptr(n1);
2076  this->set_node(n1, this->node_ptr(n2));
2077  this->set_node(n2, temp);
2078  }
virtual Node *& set_node(const unsigned int i)
Definition: elem.h:2527
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2476

◆ swap3neighbors()

void libMesh::Elem::swap3neighbors ( unsigned int  n1,
unsigned int  n2,
unsigned int  n3 
)
inlineprotectedinherited

◆ swap3nodes()

void libMesh::Elem::swap3nodes ( unsigned int  n1,
unsigned int  n2,
unsigned int  n3 
)
inlineprotectedinherited

◆ swap4neighbors()

void libMesh::Elem::swap4neighbors ( unsigned int  n1,
unsigned int  n2,
unsigned int  n3,
unsigned int  n4 
)
inlineprotectedinherited

Swaps four neighbor_ptrs, "rotating" them.

Definition at line 2134 of file elem.h.

References libMesh::Elem::swap2neighbors(), and libMesh::Elem::swap3neighbors().

Referenced by libMesh::InfHex8::permute(), libMesh::Quad4::permute(), libMesh::Pyramid5::permute(), libMesh::Hex8::permute(), libMesh::Quad8::permute(), libMesh::Quad9::permute(), libMesh::InfHex16::permute(), libMesh::Pyramid13::permute(), libMesh::InfHex18::permute(), libMesh::Hex20::permute(), libMesh::Pyramid14::permute(), permute(), and libMesh::Hex27::permute().

2136  {
2137  swap3neighbors(n1, n2, n3);
2138  swap2neighbors(n3, n4);
2139  }
void swap3neighbors(unsigned int n1, unsigned int n2, unsigned int n3)
Swaps three neighbor_ptrs, "rotating" them.
Definition: elem.h:2114
void swap2neighbors(unsigned int n1, unsigned int n2)
Swaps two neighbor_ptrs.
Definition: elem.h:2083

◆ swap4nodes()

void libMesh::Elem::swap4nodes ( unsigned int  n1,
unsigned int  n2,
unsigned int  n3,
unsigned int  n4 
)
inlineprotectedinherited

Swaps four node_ptrs, "rotating" them.

Definition at line 2124 of file elem.h.

References libMesh::Elem::swap2nodes(), and libMesh::Elem::swap3nodes().

Referenced by libMesh::InfHex8::permute(), libMesh::Quad4::permute(), libMesh::Pyramid5::permute(), libMesh::Hex8::permute(), libMesh::Quad8::permute(), libMesh::Quad9::permute(), libMesh::InfHex16::permute(), libMesh::Pyramid13::permute(), libMesh::InfHex18::permute(), libMesh::Hex20::permute(), libMesh::Pyramid14::permute(), permute(), and libMesh::Hex27::permute().

2126  {
2127  swap3nodes(n1, n2, n3);
2128  swap2nodes(n3, n4);
2129  }
void swap3nodes(unsigned int n1, unsigned int n2, unsigned int n3)
Swaps three node_ptrs, "rotating" them.
Definition: elem.h:2105
void swap2nodes(unsigned int n1, unsigned int n2)
Swaps two node_ptrs.
Definition: elem.h:2073

◆ top_parent()

const Elem * libMesh::Elem::top_parent ( ) const
inlineinherited
Returns
A pointer to the element's top-most (i.e. level-0) parent.

That is, this if this is a level-0 element, this element's parent if this is a level-1 element, this element's grandparent if this is a level-2 element, etc...

Definition at line 3053 of file elem.h.

References libMesh::Elem::level(), libMesh::libmesh_assert(), and libMesh::Elem::parent().

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::BoundaryInfo::add_elements(), libMesh::BoundaryInfo::boundary_ids(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::ExodusII_IO::read_elemental_variable(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::BoundaryInfo::sides_with_boundary_id(), and ExtraIntegersTest::test_final_integers().

3054 {
3055  const Elem * tp = this;
3056 
3057  // Keep getting the element's parent
3058  // until that parent is at level-0
3059  while (tp->parent() != nullptr)
3060  tp = tp->parent();
3061 
3062  libmesh_assert(tp);
3063  libmesh_assert_equal_to (tp->level(), 0);
3064 
3065  return tp;
3066 }
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360

◆ topological_neighbor() [1/2]

const Elem * libMesh::Elem::topological_neighbor ( const unsigned int  i,
const MeshBase mesh,
const PointLocatorBase point_locator,
const PeriodicBoundaries pb 
) const
inherited
Returns
A pointer to the i^{th} neighbor of this element for interior elements. If an element is on a periodic boundary, it will return a corresponding element on the opposite side.

Definition at line 1316 of file elem.C.

References libMesh::PeriodicBoundaries::boundary(), libMesh::Elem::level(), mesh, libMesh::Elem::n_neighbors(), libMesh::PeriodicBoundaries::neighbor(), libMesh::Elem::neighbor_ptr(), and libMesh::Elem::parent().

Referenced by libMesh::Elem::has_topological_neighbor(), libMesh::GhostPointNeighbors::operator()(), libMesh::DefaultCoupling::operator()(), and libMesh::MeshRefinement::topological_neighbor().

1320 {
1321  libmesh_assert_less (i, this->n_neighbors());
1322 
1323  const Elem * neighbor_i = this->neighbor_ptr(i);
1324  if (neighbor_i != nullptr)
1325  return neighbor_i;
1326 
1327  if (pb)
1328  {
1329  // Since the neighbor is nullptr it must be on a boundary. We need
1330  // see if this is a periodic boundary in which case it will have a
1331  // topological neighbor
1332  std::vector<boundary_id_type> bc_ids;
1333  mesh.get_boundary_info().boundary_ids(this, cast_int<unsigned short>(i), bc_ids);
1334  for (const auto & id : bc_ids)
1335  if (pb->boundary(id))
1336  {
1337  neighbor_i = pb->neighbor(id, point_locator, this, i);
1338 
1339  // Since coarse elements do not have more refined
1340  // neighbors we need to make sure that we don't return one
1341  // of these types of neighbors.
1342  if (neighbor_i)
1343  while (level() < neighbor_i->level())
1344  neighbor_i = neighbor_i->parent();
1345  return neighbor_i;
1346  }
1347  }
1348 
1349  return nullptr;
1350 }
MeshBase & mesh
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2567
unsigned int level() const
Definition: elem.h:3071
unsigned int n_neighbors() const
Definition: elem.h:714

◆ topological_neighbor() [2/2]

Elem * libMesh::Elem::topological_neighbor ( const unsigned int  i,
MeshBase mesh,
const PointLocatorBase point_locator,
const PeriodicBoundaries pb 
)
inherited
Returns
A writable pointer to the i^{th} neighbor of this element for interior elements. If an element is on a periodic boundary, it will return a corresponding element on the opposite side.

Definition at line 1274 of file elem.C.

References libMesh::PeriodicBoundaries::boundary(), libMesh::Elem::level(), mesh, libMesh::Elem::n_neighbors(), libMesh::PeriodicBoundaries::neighbor(), libMesh::Elem::neighbor_ptr(), and libMesh::Elem::parent().

1278 {
1279  libmesh_assert_less (i, this->n_neighbors());
1280 
1281  Elem * neighbor_i = this->neighbor_ptr(i);
1282  if (neighbor_i != nullptr)
1283  return neighbor_i;
1284 
1285  if (pb)
1286  {
1287  // Since the neighbor is nullptr it must be on a boundary. We need
1288  // see if this is a periodic boundary in which case it will have a
1289  // topological neighbor
1290  std::vector<boundary_id_type> bc_ids;
1291  mesh.get_boundary_info().boundary_ids(this, cast_int<unsigned short>(i), bc_ids);
1292  for (const auto & id : bc_ids)
1293  if (pb->boundary(id))
1294  {
1295  // Since the point locator inside of periodic boundaries
1296  // returns a const pointer we will retrieve the proper
1297  // pointer directly from the mesh object.
1298  const Elem * const cn = pb->neighbor(id, point_locator, this, i);
1299  neighbor_i = const_cast<Elem *>(cn);
1300 
1301  // Since coarse elements do not have more refined
1302  // neighbors we need to make sure that we don't return one
1303  // of these types of neighbors.
1304  if (neighbor_i)
1305  while (level() < neighbor_i->level())
1306  neighbor_i = neighbor_i->parent();
1307  return neighbor_i;
1308  }
1309  }
1310 
1311  return nullptr;
1312 }
MeshBase & mesh
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2567
unsigned int level() const
Definition: elem.h:3071
unsigned int n_neighbors() const
Definition: elem.h:714

◆ topologically_equal()

bool libMesh::Elem::topologically_equal ( const Elem rhs) const
inherited
Returns
true if two elements have equal topologies, false otherwise. This is true if the elements connect to nodes of the same id in the same order, and neighbors of the same id on each side, the same id on any parent and/or interior_parent link, etc.

Definition at line 806 of file elem.C.

References libMesh::DofObject::id(), libMesh::Elem::interior_parent(), libMesh::make_range(), libMesh::Elem::n_neighbors(), libMesh::Elem::n_nodes(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_id(), libMesh::Elem::parent(), and libMesh::Elem::type().

807 {
808  // If the elements aren't the same type, they aren't equal
809  if (this->type() != rhs.type())
810  return false;
811 
812  libmesh_assert_equal_to(this->n_nodes(), rhs.n_nodes());
813 
814  for (auto n : make_range(this->n_nodes()))
815  if (this->node_id(n) != rhs.node_id(n))
816  return false;
817 
818  for (auto neigh : make_range(this->n_neighbors()))
819  {
820  if (!this->neighbor_ptr(neigh))
821  {
822  if (rhs.neighbor_ptr(neigh))
823  return false;
824  continue;
825  }
826  if (!rhs.neighbor_ptr(neigh) ||
827  this->neighbor_ptr(neigh)->id() !=
828  rhs.neighbor_ptr(neigh)->id())
829  return false;
830  }
831 
832  if (this->parent())
833  {
834  if (!rhs.parent())
835  return false;
836  if (this->parent()->id() != rhs.parent()->id())
837  return false;
838  }
839  else if (rhs.parent())
840  return false;
841 
842  if (this->interior_parent())
843  {
844  if (!rhs.interior_parent())
845  return false;
846  if (this->interior_parent()->id() !=
847  rhs.interior_parent()->id())
848  return false;
849  }
850  else if (rhs.interior_parent())
851  return false;
852 
853  return true;
854 }
const Elem * parent() const
Definition: elem.h:3027
const Elem * interior_parent() const
Definition: elem.C:1189
dof_id_type id() const
Definition: dof_object.h:828
virtual unsigned int n_nodes() const =0
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2567
unsigned int n_neighbors() const
Definition: elem.h:714
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...
Definition: int_range.h:140
virtual ElemType type() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2444

◆ total_family_tree() [1/2]

void libMesh::Elem::total_family_tree ( std::vector< const Elem *> &  family,
bool  reset = true 
) const
inherited

Same as the family_tree() member, but also adds any subactive descendants.

Definition at line 2120 of file elem.C.

References libMesh::ElemInternal::total_family_tree().

Referenced by libMesh::Partitioner::set_parent_processor_ids().

2122 {
2123  ElemInternal::total_family_tree(this, family, reset);
2124 }
void total_family_tree(T elem, std::vector< T > &family, bool reset)
Definition: elem_internal.h:67

◆ total_family_tree() [2/2]

void libMesh::Elem::total_family_tree ( std::vector< Elem *> &  family,
bool  reset = true 
)
inherited

Non-const version of function above; fills a vector of non-const pointers.

Definition at line 2128 of file elem.C.

References libMesh::ElemInternal::total_family_tree().

2130 {
2131  ElemInternal::total_family_tree(this, family, reset);
2132 }
void total_family_tree(T elem, std::vector< T > &family, bool reset)
Definition: elem_internal.h:67

◆ total_family_tree_by_neighbor() [1/2]

void libMesh::Elem::total_family_tree_by_neighbor ( std::vector< const Elem *> &  family,
const Elem neighbor,
bool  reset = true 
) const
inherited

Same as the family_tree_by_neighbor() member, but also adds any subactive descendants.

Definition at line 2206 of file elem.C.

References libMesh::ElemInternal::total_family_tree_by_neighbor().

2209 {
2210  ElemInternal::total_family_tree_by_neighbor(this, family, neighbor, reset);
2211 }
void total_family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)

◆ total_family_tree_by_neighbor() [2/2]

void libMesh::Elem::total_family_tree_by_neighbor ( std::vector< Elem *> &  family,
Elem neighbor,
bool  reset = true 
)
inherited

Non-const version of function above; fills a vector of non-const pointers.

Definition at line 2215 of file elem.C.

References libMesh::ElemInternal::total_family_tree_by_neighbor().

2218 {
2219  ElemInternal::total_family_tree_by_neighbor(this, family, neighbor, reset);
2220 }
void total_family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)

◆ total_family_tree_by_subneighbor() [1/2]

void libMesh::Elem::total_family_tree_by_subneighbor ( std::vector< const Elem *> &  family,
const Elem neighbor,
const Elem subneighbor,
bool  reset = true 
) const
inherited

Same as the family_tree_by_subneighbor() member, but also adds any subactive descendants.

Definition at line 2244 of file elem.C.

References libMesh::ElemInternal::total_family_tree_by_subneighbor().

2248 {
2249  ElemInternal::total_family_tree_by_subneighbor(this, family, neighbor, subneighbor, reset);
2250 }
void total_family_tree_by_subneighbor(T elem, std::vector< T > &family, T neighbor_in, T subneighbor, bool reset=true)

◆ total_family_tree_by_subneighbor() [2/2]

void libMesh::Elem::total_family_tree_by_subneighbor ( std::vector< Elem *> &  family,
Elem neighbor,
Elem subneighbor,
bool  reset = true 
)
inherited

Non-const version of function above; fills a vector of non-const pointers.

Definition at line 2254 of file elem.C.

References libMesh::ElemInternal::total_family_tree_by_subneighbor().

2258 {
2259  ElemInternal::total_family_tree_by_subneighbor(this, family, neighbor, subneighbor, reset);
2260 }
void total_family_tree_by_subneighbor(T elem, std::vector< T > &family, T neighbor_in, T subneighbor, bool reset=true)

◆ true_centroid()

Point libMesh::Elem::true_centroid ( ) const
virtualinherited
Returns
The "true" geometric centroid of the element, c=(cx, cy, cz), where:

[cx] [ x dV] [cy] := (1/V) * [ y dV] [cz] [ z dV]

This method is virtual since some derived elements might want to use shortcuts to compute their centroid. For most element types, this method is more expensive than calling vertex_average(), so if you only need a point which is located "somewhere" in the interior of the element, consider calling vertex_average() instead.

Reimplemented in libMesh::Tet4, libMesh::Hex8, libMesh::Prism6, libMesh::C0Polygon, libMesh::Pyramid5, libMesh::Tri3, libMesh::C0Polyhedron, libMesh::Quad4, and libMesh::Edge2.

Definition at line 597 of file elem.C.

References libMesh::Elem::_nodes, libMesh::FEGenericBase< OutputType >::build(), libMesh::Elem::default_order(), libMesh::FEType::default_quadrature_order(), libMesh::Elem::dim(), libMesh::Elem::disconnected_clone(), libMesh::index_range(), libMesh::make_range(), libMesh::FEMap::map_fe_type(), libMesh::Elem::n_nodes(), libMesh::Elem::node_index_range(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::Real, and libMesh::QBase::size().

Referenced by VolumeTest::testHex20PLevelTrueCentroid(), VolumeTest::testPyramid5TrueCentroid(), VolumeTest::testQuad4TrueCentroid(), VolumeTest::testTri3TrueCentroid(), libMesh::C0Polyhedron::true_centroid(), and libMesh::C0Polygon::true_centroid().

598 {
599  // The base class implementation builds a finite element of the correct
600  // order and computes the centroid, c=(cx, cy, cz), where:
601  //
602  // [cx] [\int x dV]
603  // [cy] := (1/V) * [\int y dV]
604  // [cz] [\int z dV]
605  //
606  // using quadrature. Note that we can expand "x" in the FE space as:
607  //
608  // x = \sum_i x_i \phi_i
609  //
610  // where x_i are the nodal positions of the element and \phi_i are the
611  // associated Lagrange shape functions. This allows us to write the
612  // integrals above as e.g.:
613  //
614  // \int x dV = \sum_i x_i \int \phi_i dV
615  //
616  // Defining:
617  //
618  // V_i := \int \phi_i dV
619  //
620  // we then have:
621  //
622  // [cx] [\sum_i x_i V_i]
623  // [cy] = (1/V) * [\sum_i y_i V_i]
624  // [cz] [\sum_i z_i V_i]
625  //
626  // where:
627  // V = \sum_i V_i
628  //
629  // Derived element types can overload this method to compute
630  // the centroid more efficiently when possible.
631 
632  // If this Elem has an elevated p_level, then we need to generate a
633  // barebones copy of it with zero p_level and call true_centroid()
634  // on that instead. This workaround allows us to avoid issues with
635  // calling FE::reinit() with a default_order() FEType, and then
636  // having that order incorrectly boosted by p_level.
637  if (this->p_level())
638  {
639  auto elem_copy = this->disconnected_clone();
640 #ifdef LIBMESH_ENABLE_AMR
641  elem_copy->set_p_level(0);
642 #endif
643 
644  // Set node pointers
645  for (auto n : this->node_index_range())
646  elem_copy->set_node(n, _nodes[n]);
647 
648  return elem_copy->true_centroid();
649  }
650 
651  const FEFamily mapping_family = FEMap::map_fe_type(*this);
652  const FEType fe_type(this->default_order(), mapping_family);
653 
654  // Build FE and attach quadrature rule. The default quadrature rule
655  // integrates the mass matrix exactly, thus it is overkill to
656  // integrate the basis functions, but this is convenient.
657  std::unique_ptr<FEBase> fe = FEBase::build(this->dim(), fe_type);
658  QGauss qrule (this->dim(), fe_type.default_quadrature_order());
659  fe->attach_quadrature_rule(&qrule);
660 
661  // Pre-request required data
662  const auto & JxW = fe->get_JxW();
663  const auto & phi = fe->get_phi();
664 
665  // Re-compute element-specific values
666  fe->reinit(this);
667 
668  // Number of basis functions
669  auto N = phi.size();
670  libmesh_assert_equal_to(N, this->n_nodes());
671 
672  // Compute V_i
673  std::vector<Real> V(N);
674  for (auto qp : index_range(JxW))
675  for (auto i : make_range(N))
676  V[i] += JxW[qp] * phi[i][qp];
677 
678  // Compute centroid
679  Point cp;
680  Real vol = 0.;
681 
682  for (auto i : make_range(N))
683  {
684  cp += this->point(i) * V[i];
685  vol += V[i];
686  }
687 
688  return cp / vol;
689 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2227
unsigned int p_level() const
Definition: elem.h:3105
virtual unsigned int n_nodes() const =0
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
virtual std::unique_ptr< Elem > disconnected_clone() const
Definition: elem.C:412
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned short dim() const =0
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...
Definition: int_range.h:140
IntRange< unsigned short > node_index_range() const
Definition: elem.h:2652
FEFamily
defines an enum for finite element families.
virtual Order default_order() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:2422
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:117
static FEFamily map_fe_type(const Elem &elem)
Definition: fe_map.C:46

◆ type()

virtual ElemType libMesh::Pyramid18::type ( ) const
inlineoverridevirtual
Returns
PYRAMID18.

Implements libMesh::Elem.

Definition at line 108 of file cell_pyramid18.h.

References libMesh::PYRAMID18.

108 { return PYRAMID18; }

◆ unique_id()

unique_id_type libMesh::DofObject::unique_id ( ) const
inlineinherited
Returns
The globally unique_id for this DofObject

Definition at line 844 of file dof_object.h.

References libMesh::DofObject::_unique_id, libMesh::DofObject::invalid_unique_id, libMesh::libmesh_assert(), and libMesh::DofObject::valid_unique_id().

Referenced by libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::MeshTools::Modification::all_tri(), libMesh::C0Polyhedron::disconnected_clone(), libMesh::Elem::disconnected_clone(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::get_info(), libMesh::ReplicatedMesh::insert_elem(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_node(), libMesh::XdrIO::pack_element(), libMesh::ExodusII_IO::read_elemental_variable(), SlitMeshRefinedSystemTest::testRestart(), and libMesh::XdrIO::write_serialized_nodes().

845 {
846 #ifdef LIBMESH_ENABLE_UNIQUE_ID
848  return _unique_id;
849 #else
850  return invalid_unique_id;
851 #endif
852 }
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:577
static const unique_id_type invalid_unique_id
An invalid unique_id to distinguish an uninitialized DofObject.
Definition: dof_object.h:487
libmesh_assert(ctx)
bool valid_unique_id() const
Definition: dof_object.h:893

◆ unpack_indexing()

void libMesh::DofObject::unpack_indexing ( std::vector< largest_id_type >::const_iterator  begin)
inherited

A method for creating our index buffer from packed data - basically with our current implementation we investigate the size term and then copy.

Definition at line 595 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::clear_old_dof_object(), libMesh::DofObject::construct(), libMesh::libmesh_assert(), and libMesh::DofObject::old_dof_object.

596 {
597  _idx_buf.clear();
598 
599 #ifdef LIBMESH_ENABLE_AMR
600  this->clear_old_dof_object();
601  const bool has_old_dof_object = cast_int<bool>(*begin++);
602 #endif
603 
604  const largest_id_type size = *begin++;
605  _idx_buf.reserve(size);
606  std::copy(begin, begin+size, back_inserter(_idx_buf));
607 
608  // Check as best we can for internal consistency now
609  libmesh_assert(_idx_buf.empty() ||
610  (std::abs(dof_id_signed_type(_idx_buf[0])) <=
611  cast_int<dof_id_signed_type>(_idx_buf.size())));
612 #ifdef DEBUG
613  if (!_idx_buf.empty())
614  {
615  const int hdr = cast_int<int>(dof_id_signed_type(_idx_buf[0]));
616  const unsigned int ns = hdr >= 0 ? hdr : (-hdr-1);
617  for (unsigned int i=1; i < ns; ++i)
618  {
619  if (hdr > 0 || i > 1)
620  libmesh_assert_greater_equal (_idx_buf[i], _idx_buf[i-1]);
621  else
622  libmesh_assert_greater_equal (_idx_buf[i], ns);
623  libmesh_assert_equal_to ((_idx_buf[i] - _idx_buf[i-1])%2, 0);
624  libmesh_assert_less_equal (_idx_buf[i], _idx_buf.size());
625  }
626  if (hdr < 0 && ns > 0)
627  libmesh_assert_less_equal(_idx_buf[ns], _idx_buf.size());
628  }
629 #endif
630 
631 #ifdef LIBMESH_ENABLE_AMR
632  if (has_old_dof_object)
633  {
634  this->old_dof_object = this->construct();
635  this->old_dof_object->unpack_indexing(begin+size);
636  }
637 #endif
638 }
std::unique_ptr< DofObject > construct(const DofObject *other=nullptr)
Convenient factory function that calls either the (deep) copy constructor or the default constructor ...
Definition: dof_object.h:741
uint64_t largest_id_type
Definition: id_types.h:148
void clear_old_dof_object()
Sets the old_dof_object to nullptr.
Definition: dof_object.C:128
libmesh_assert(ctx)
int8_t dof_id_signed_type
Definition: id_types.h:68
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88
index_buffer_t _idx_buf
Definition: dof_object.h:680

◆ unpackable_indexing_size()

unsigned int libMesh::DofObject::unpackable_indexing_size ( std::vector< largest_id_type >::const_iterator  begin)
staticinherited

If we have indices packed into an buffer for communications, how much of that buffer applies to this dof object?

Definition at line 575 of file dof_object.C.

576 {
577 #ifdef LIBMESH_ENABLE_AMR
578  const bool has_old_dof_object = cast_int<bool>(*begin++);
579 
580  static const int dof_header_size = 2;
581 #else
582  static const bool has_old_dof_object = false;
583  static const int dof_header_size = 1;
584 #endif
585 
586  const largest_id_type this_indexing_size = *begin++;
587 
588  return cast_int<unsigned int>
589  (dof_header_size + this_indexing_size +
590  (has_old_dof_object ?
591  unpackable_indexing_size(begin+this_indexing_size) : 0));
592 }
static unsigned int unpackable_indexing_size(std::vector< largest_id_type >::const_iterator begin)
If we have indices packed into an buffer for communications, how much of that buffer applies to this ...
Definition: dof_object.C:575
uint64_t largest_id_type
Definition: id_types.h:148

◆ valid_id()

bool libMesh::DofObject::valid_id ( ) const
inlineinherited

◆ valid_processor_id()

bool libMesh::DofObject::valid_processor_id ( ) const
inlineinherited
Returns
true if this DofObject has a valid id set, false otherwise.

Definition at line 929 of file dof_object.h.

References libMesh::DofObject::_processor_id, and libMesh::DofObject::invalid_processor_id.

Referenced by DofObjectTest< Node >::testInvalidateProcId(), and DofObjectTest< Node >::testValidProcId().

930 {
932 }
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
Definition: dof_object.h:493
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:594

◆ valid_unique_id()

bool libMesh::DofObject::valid_unique_id ( ) const
inlineinherited
Returns
true if this DofObject has a valid unique_id set, false otherwise.

Definition at line 893 of file dof_object.h.

References libMesh::DofObject::_unique_id, and libMesh::DofObject::invalid_unique_id.

Referenced by libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::C0Polyhedron::disconnected_clone(), libMesh::Elem::disconnected_clone(), libMesh::Elem::get_info(), libMesh::ReplicatedMesh::insert_elem(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_node(), and libMesh::DofObject::unique_id().

894 {
895 #ifdef LIBMESH_ENABLE_UNIQUE_ID
897 #else
898  return false;
899 #endif
900 }
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:577
static const unique_id_type invalid_unique_id
An invalid unique_id to distinguish an uninitialized DofObject.
Definition: dof_object.h:487

◆ var_to_vg_and_offset()

std::pair< unsigned int, unsigned int > libMesh::DofObject::var_to_vg_and_offset ( const unsigned int  s,
const unsigned int  var 
) const
inlineinherited
Returns
A pair consisting of the variable group number and the offset index from the start of that group for variable var on system s associated with this DofObject

Definition at line 1200 of file dof_object.h.

References libMesh::DofObject::n_var_groups(), and libMesh::DofObject::n_vars().

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::DofObject::dof_number(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), and libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs().

1202 {
1203  std::pair<unsigned int, unsigned int> returnval(0,0);
1204 
1205  unsigned int & vg = returnval.first;
1206  unsigned int & offset = returnval.second;
1207 
1208  unsigned int vg_start = 0;
1209  for (; ; vg++)
1210  {
1211  libmesh_assert_less(vg, this->n_var_groups(s));
1212 
1213  const unsigned int vg_end = vg_start + this->n_vars(s,vg);
1214  if (var < vg_end)
1215  {
1216  offset = var - vg_start;
1217  return returnval;
1218  }
1219  vg_start = vg_end;
1220  }
1221 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:957
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:967

◆ vertex_average()

Point libMesh::Elem::vertex_average ( ) const
inherited
Returns
A Point at the average of the elment's vertices.
Note
This used to be the base class centroid() implementation, but the centroid is only equal to the vertex average in some special cases. The centroid() implementation now returns the "true" centroid of the element (up to quadrature error).

Definition at line 691 of file elem.C.

References libMesh::TypeVector< T >::add(), and libMesh::Elem::n_vertices().

Referenced by libMesh::Elem::centroid(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::Poly2TriTriangulator::insert_refinement_points(), A0::interior_assembly(), A1::interior_assembly(), OutputAssembly::interior_assembly(), SlitFunc::operator()(), libMesh::LocationMap< T >::point_of(), libMesh::RBParametrizedFunction::preevaluate_parametrized_function_on_mesh(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::C0Polygon::retriangulate(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_second_deriv(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), libMesh::Tri3::true_centroid(), and libMesh::Tet4::true_centroid().

692 {
693  Point cp;
694 
695  const auto n_vertices = this->n_vertices();
696 
697  for (unsigned int n=0; n<n_vertices; n++)
698  cp.add (this->point(n));
699 
700  return (cp /= static_cast<Real>(n_vertices));
701 }
virtual unsigned int n_vertices() const =0

◆ vg_dof_base()

dof_id_type libMesh::DofObject::vg_dof_base ( const unsigned int  s,
const unsigned int  vg 
) const
inlineinherited

VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base.

Definition at line 1317 of file dof_object.h.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), and libMesh::DofObject::start_idx().

Referenced by libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::reinit(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::DofObject::set_vg_dof_base(), and DofObjectTest< Node >::testManualDofCalculation().

1319 {
1320  libmesh_assert_less (s, this->n_systems());
1321  libmesh_assert_less (vg, this->n_var_groups(s));
1322 
1323  const unsigned int
1324  start_idx_sys = this->start_idx(s);
1325 
1326  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1327 
1328  // #ifdef DEBUG
1329  // std::cout << " [ ";
1330  // for (auto i : _idx_buf)
1331  // std::cout << i << " ";
1332  // std::cout << "]\n";
1333  // #endif
1334 
1335  return _idx_buf[start_idx_sys + 2*vg + 1];
1336 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:957
unsigned int n_systems() const
Definition: dof_object.h:937
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1249
index_buffer_t _idx_buf
Definition: dof_object.h:680

◆ volume()

Real libMesh::Elem::volume ( ) const
virtualinherited
Returns
The (length/area/volume) of the geometric element.

If the element is twisted or inverted such that the mapping Jacobian is singular at any point, implementations of this method may return a "net" volume or may simply return NaN.

Reimplemented in libMesh::Prism18, libMesh::Hex27, libMesh::Pyramid14, libMesh::Prism15, libMesh::Tet10, libMesh::Hex20, libMesh::Pyramid13, libMesh::Tet4, libMesh::Tri6, libMesh::Quad9, libMesh::Hex8, libMesh::Quad8, libMesh::Prism6, libMesh::Edge4, libMesh::Pyramid5, libMesh::Tri3, libMesh::C0Polygon, libMesh::Edge3, libMesh::Quad4, libMesh::C0Polyhedron, and libMesh::Edge2.

Definition at line 3432 of file elem.C.

References libMesh::FEGenericBase< OutputType >::build(), libMesh::Elem::default_order(), libMesh::FEType::default_quadrature_order(), libMesh::Elem::dim(), libMesh::FEMap::map_fe_type(), and libMesh::Real.

Referenced by assemble_ellipticdg(), libMesh::Elem::get_info(), libMesh::MeshBase::get_info(), libMesh::QNodal::init_3D(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::SimplexRefiner::should_refine_elem(), libMesh::Poly2TriTriangulator::should_refine_elem(), VolumeTest::testC0Polygon(), VolumeTest::testC0Polyhedron(), MeshInputTest::testTetgenIO(), VolumeTest::testTwistedVolume(), libMesh::C0Polyhedron::volume(), libMesh::C0Polygon::volume(), libMesh::Quad8::volume(), libMesh::Quad9::volume(), libMesh::Tri6::volume(), libMesh::Pyramid13::volume(), libMesh::Hex20::volume(), libMesh::Tet10::volume(), libMesh::Prism15::volume(), libMesh::Pyramid14::volume(), libMesh::Hex27::volume(), and libMesh::Prism18::volume().

3433 {
3434  // The default implementation builds a finite element of the correct
3435  // order and sums up the JxW contributions. This can be expensive,
3436  // so the various element types can overload this method and compute
3437  // the volume more efficiently.
3438  const FEFamily mapping_family = FEMap::map_fe_type(*this);
3439  const FEType fe_type(this->default_order(), mapping_family);
3440 
3441  std::unique_ptr<FEBase> fe (FEBase::build(this->dim(),
3442  fe_type));
3443 
3444  // Use a map with a negative Jacobian tolerance, in case we're asked
3445  // for the net volume of a tangled element
3446  fe->get_fe_map().set_jacobian_tolerance(std::numeric_limits<Real>::lowest());
3447 
3448  const std::vector<Real> & JxW = fe->get_JxW();
3449 
3450  // The default quadrature rule should integrate the mass matrix,
3451  // thus it should be plenty to compute the area
3452  QGauss qrule (this->dim(), fe_type.default_quadrature_order());
3453 
3454  fe->attach_quadrature_rule(&qrule);
3455 
3456  fe->reinit(this);
3457 
3458  Real vol=0.;
3459  for (auto jxw : JxW)
3460  vol += jxw;
3461 
3462  return vol;
3463 
3464 }
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned short dim() const =0
FEFamily
defines an enum for finite element families.
virtual Order default_order() const =0
static FEFamily map_fe_type(const Elem &elem)
Definition: fe_map.C:46

◆ which_child_am_i()

unsigned int libMesh::Elem::which_child_am_i ( const Elem e) const
inlineinherited
Returns
The child index which e corresponds to.

I.e. if c = a->which_child_am_i(e); then a->child_ptr(c) will be e.

Definition at line 3189 of file elem.h.

References libMesh::Elem::child_ptr(), libMesh::Elem::has_children(), libMesh::invalid_uint, libMesh::libmesh_assert(), and libMesh::Elem::n_children().

Referenced by libMesh::BoundaryInfo::boundary_ids(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::make_links_to_me_remote(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::BoundaryInfo::sides_with_boundary_id(), libMesh::MeshTools::Modification::smooth(), and libMesh::Parallel::sync_element_data_by_parent_id().

3190 {
3191  libmesh_assert(e);
3192  libmesh_assert (this->has_children());
3193 
3194  unsigned int nc = this->n_children();
3195  for (unsigned int c=0; c != nc; c++)
3196  if (this->child_ptr(c) == e)
3197  return c;
3198 
3199  libmesh_error_msg("ERROR: which_child_am_i() was called with a non-child!");
3200 
3201  return libMesh::invalid_uint;
3202 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:310
virtual unsigned int n_children() const =0
libmesh_assert(ctx)
bool has_children() const
Definition: elem.h:2976
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:3160

◆ which_neighbor_am_i()

unsigned int libMesh::Elem::which_neighbor_am_i ( const Elem e) const
inlineinherited

This function tells you which neighbor e is.

I.e. if s = a->which_neighbor_am_i(e); then a->neighbor(s) will be an ancestor of e.

Definition at line 2916 of file elem.h.

References libMesh::invalid_uint, libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::make_range(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor_ptr(), and libMesh::Elem::parent().

Referenced by assemble_ellipticdg(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::BoundaryInfo::clear_stitched_boundary_side_ids(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::Poly2TriTriangulator::insert_refinement_points(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::Elem::nullify_neighbors(), libMesh::C0Polyhedron::retriangulate(), and MeshBaseTest::testMeshBaseVerifyIsPrepared().

2917 {
2918  libmesh_assert(e);
2919 
2920  const Elem * eparent = e;
2921 
2922  while (eparent->level() > this->level())
2923  {
2924  eparent = eparent->parent();
2925  libmesh_assert(eparent);
2926  }
2927 
2928  for (auto s : make_range(this->n_sides()))
2929  if (this->neighbor_ptr(s) == eparent)
2930  return s;
2931 
2932  return libMesh::invalid_uint;
2933 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:310
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2360
virtual unsigned int n_sides() const =0
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2567
unsigned int level() const
Definition: elem.h:3071
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...
Definition: int_range.h:140

◆ which_node_am_i()

unsigned int libMesh::Elem::which_node_am_i ( unsigned int  side,
unsigned int  side_node 
) const
inherited

This function is deprecated, call local_side_node(side, side_node) instead.

Definition at line 927 of file elem.C.

References libMesh::Elem::local_side_node().

929 {
930  libmesh_deprecated();
931  return local_side_node(side, side_node);
932 }
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const =0

◆ which_side_am_i()

unsigned int libMesh::Elem::which_side_am_i ( const Elem e) const
inherited

This function tells you which side the boundary element e is.

I.e. if e = a->build_side_ptr(s) or e = a->side_ptr(s); then a->which_side_am_i(e) will be s.

Note
An exact floating point comparison of the nodal positions of e is made with the nodal positions of this in order to perform this test. The idea is that the test will return a valid side id if e either directly shares Node pointers with this, or was created by exactly copying some of the nodes of this (e.g. through BoundaryMesh::sync()). In these circumstances, non-fuzzy floating point equality is expected.
Returns
The side of this the element which e is, otherwise invalid_uint.

Definition at line 873 of file elem.C.

References libMesh::invalid_uint, libMesh::Elem::is_node_on_side(), libMesh::libmesh_assert(), libMesh::Elem::n_nodes(), libMesh::Elem::n_sides(), and libMesh::Elem::point().

874 {
875  libmesh_assert(e);
876 
877  const unsigned int ns = this->n_sides();
878  const unsigned int nn = this->n_nodes();
879 
880  const unsigned int en = e->n_nodes();
881 
882  // e might be on any side until proven otherwise
883  std::vector<bool> might_be_side(ns, true);
884 
885  for (unsigned int i=0; i != en; ++i)
886  {
887  Point side_point = e->point(i);
888  unsigned int local_node_id = libMesh::invalid_uint;
889 
890  // Look for a node of this that's contiguous with node i of
891  // e. Note that the exact floating point comparison of Point
892  // positions is intentional, see the class documentation for
893  // this function.
894  for (unsigned int j=0; j != nn; ++j)
895  if (this->point(j) == side_point)
896  local_node_id = j;
897 
898  // If a node of e isn't contiguous with some node of this, then
899  // e isn't a side of this.
900  if (local_node_id == libMesh::invalid_uint)
901  return libMesh::invalid_uint;
902 
903  // If a node of e isn't contiguous with some node on side s of
904  // this, then e isn't on side s.
905  for (unsigned int s=0; s != ns; ++s)
906  if (!this->is_node_on_side(local_node_id, s))
907  might_be_side[s] = false;
908  }
909 
910  for (unsigned int s=0; s != ns; ++s)
911  if (might_be_side[s])
912  {
913 #ifdef DEBUG
914  for (unsigned int s2=s+1; s2 < ns; ++s2)
915  libmesh_assert (!might_be_side[s2]);
916 #endif
917  return s;
918  }
919 
920  // Didn't find any matching side
921  return libMesh::invalid_uint;
922 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:310
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
virtual unsigned int n_nodes() const =0
libmesh_assert(ctx)
virtual unsigned int n_sides() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:2422

◆ write_connectivity()

void libMesh::Elem::write_connectivity ( std::ostream &  out,
const IOPackage  iop 
) const
inherited

Writes the element connectivity for various IO packages to the passed ostream "out".

Not virtual, since it is implemented in the base class.

Definition at line 1734 of file elem.C.

References libMesh::Elem::_nodes, libMesh::Elem::connectivity(), libMesh::INVALID_IO_PACKAGE, libMesh::libmesh_assert(), libMesh::make_range(), libMesh::Elem::n_sub_elem(), libMesh::Elem::node_id(), libMesh::Elem::node_index_range(), libMesh::TECPLOT, and libMesh::UCD.

1736 {
1737  libmesh_assert (out_stream.good());
1739  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
1740 
1741  switch (iop)
1742  {
1743  case TECPLOT:
1744  {
1745  // This connectivity vector will be used repeatedly instead
1746  // of being reconstructed inside the loop.
1747  std::vector<dof_id_type> conn;
1748  for (auto sc : make_range(this->n_sub_elem()))
1749  {
1750  this->connectivity(sc, TECPLOT, conn);
1751 
1752  std::copy(conn.begin(),
1753  conn.end(),
1754  std::ostream_iterator<dof_id_type>(out_stream, " "));
1755 
1756  out_stream << '\n';
1757  }
1758  return;
1759  }
1760 
1761  case UCD:
1762  {
1763  for (auto i : this->node_index_range())
1764  out_stream << this->node_id(i)+1 << "\t";
1765 
1766  out_stream << '\n';
1767  return;
1768  }
1769 
1770  default:
1771  libmesh_error_msg("Unsupported IO package " << iop);
1772  }
1773 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2227
libmesh_assert(ctx)
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...
Definition: int_range.h:140
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const =0
IntRange< unsigned short > node_index_range() const
Definition: elem.h:2652
virtual unsigned int n_sub_elem() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2444

Member Data Documentation

◆ _children

std::unique_ptr<Elem *[]> libMesh::Elem::_children
protectedinherited

unique_ptr to array of this element's children.

A Mesh ultimately owns the child Elems so we are not responsible for deleting them, but we are responsible for cleaning up the array allocated to hold those Elems, hence the unique_ptr.

Definition at line 2243 of file elem.h.

Referenced by libMesh::Elem::add_child(), libMesh::Elem::child_ptr(), libMesh::Elem::child_ref_range(), libMesh::Elem::contract(), libMesh::Elem::has_ancestor_children(), libMesh::Elem::has_children(), libMesh::Elem::raw_child_ptr(), libMesh::Elem::refine(), and libMesh::Elem::set_child().

◆ _counts [1/2]

ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited

Actually holds the data.

Definition at line 124 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::get_info().

◆ _counts [2/2]

ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited

Actually holds the data.

Definition at line 124 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::get_info().

◆ _elemlinks

Elem** libMesh::Elem::_elemlinks
protectedinherited

◆ _elemlinks_data

Elem* libMesh::Pyramid::_elemlinks_data[6+(LIBMESH_DIM >3)]
protectedinherited

Data for links to parent/neighbor/interior_parent elements.

Definition at line 209 of file cell_pyramid.h.

◆ _enable_print_counter [1/2]

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 143 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info(), and libMesh::ReferenceCounter::print_info().

◆ _enable_print_counter [2/2]

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 143 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info(), and libMesh::ReferenceCounter::print_info().

◆ _map_data

unsigned char libMesh::Elem::_map_data
protectedinherited

Mapping function data; currently used when needed to store the RATIONAL_BERNSTEIN nodal weight data index.

Definition at line 2285 of file elem.h.

Referenced by libMesh::Elem::Elem(), libMesh::Elem::mapping_data(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), and libMesh::Elem::set_mapping_data().

◆ _map_type

unsigned char libMesh::Elem::_map_type
protectedinherited

Mapping function type; currently either 0 (LAGRANGE) or 1 (RATIONAL_BERNSTEIN).

Definition at line 2279 of file elem.h.

Referenced by libMesh::Elem::Elem(), libMesh::Elem::mapping_type(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), and libMesh::Elem::set_mapping_type().

◆ _master_points

const Real libMesh::Pyramid::_master_points
staticprotectedinherited
Initial value:
=
{
{-1, -1, 0},
{1, -1, 0},
{1, 1, 0},
{-1, 1, 0},
{0, 0, 1},
{0, -1, 0},
{1, 0, 0},
{0, 1, 0},
{-1, 0, 0},
{0, -0.5, 0.5},
{0.5, 0, 0.5},
{0, 0.5, 0.5},
{-0.5, 0, 0.5},
{0, 0, 0}
}

Master element node locations.

Definition at line 214 of file cell_pyramid.h.

Referenced by libMesh::Pyramid::master_point().

◆ _mutex [1/2]

Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 137 of file reference_counter.h.

◆ _mutex [2/2]

Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 137 of file reference_counter.h.

◆ _n_objects [1/2]

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects.

Print the reference count information when the number returns to 0.

Definition at line 132 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().

◆ _n_objects [2/2]

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects.

Print the reference count information when the number returns to 0.

Definition at line 132 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().

◆ _nodelinks_data

Node* libMesh::Pyramid18::_nodelinks_data[num_nodes]
protected

Data for links to nodes.

Definition at line 260 of file cell_pyramid18.h.

◆ _nodes

Node** libMesh::Elem::_nodes
protectedinherited

◆ _p_level

unsigned char libMesh::Elem::_p_level
protectedinherited

p refinement level - the difference between the polynomial degree on this element and the minimum polynomial degree on the mesh.

This is stored as an unsigned char to save space. In theory, these last four bytes might have been padding anyway.

Definition at line 2272 of file elem.h.

Referenced by libMesh::Elem::hack_p_level(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::p_level(), and libMesh::Elem::set_p_level().

◆ _pflag

unsigned char libMesh::Elem::_pflag
protectedinherited

p refinement flag.

This is stored as an unsigned char to save space.

Definition at line 2262 of file elem.h.

Referenced by libMesh::Elem::hack_p_level_and_refinement_flag(), libMesh::Elem::p_refinement_flag(), and libMesh::Elem::set_p_refinement_flag().

◆ _rflag

unsigned char libMesh::Elem::_rflag
protectedinherited

h refinement flag.

This is stored as an unsigned char to save space.

Definition at line 2256 of file elem.h.

Referenced by libMesh::Elem::refinement_flag(), and libMesh::Elem::set_refinement_flag().

◆ _sbd_id

subdomain_id_type libMesh::Elem::_sbd_id
protectedinherited

The subdomain to which this element belongs.

Definition at line 2249 of file elem.h.

Referenced by libMesh::Elem::subdomain_id().

◆ adjacent_edges_map

const unsigned int libMesh::Pyramid::adjacent_edges_map
staticprotectedinherited
Initial value:
=
{
{0, 3, 4, 99},
{0, 1, 5, 99},
{1, 2, 6, 99},
{2, 3, 7, 99},
{4, 5, 6, 7}
}

This maps the j^{th} node to the 3 or 4 edge ids adjacent to the node.

The edge numbering matches the ones used in the derived classes' edge_nodes_map. An edge index of 99 is used to indicate that there is no adjacent edge. This data structure is used in the Pyramid::edges_adjacent_to_node() override and is shared by all the derived Hex types.

Definition at line 235 of file cell_pyramid.h.

Referenced by libMesh::Pyramid::edges_adjacent_to_node().

◆ affine_tol

constexpr Real libMesh::Elem::affine_tol = TOLERANCE*TOLERANCE
staticprotectedinherited

◆ edge_nodes_map

const unsigned int libMesh::Pyramid18::edge_nodes_map
static
Initial value:
=
{
{0, 1, 5},
{1, 2, 6},
{2, 3, 7},
{0, 3, 8},
{0, 4, 9},
{1, 4, 10},
{2, 4, 11},
{3, 4, 12}
}

This maps the j^{th} node of the i^{th} edge to element node numbers.

Definition at line 245 of file cell_pyramid18.h.

Referenced by is_node_on_edge(), local_edge_node(), and nodes_on_edge().

◆ edge_sides_map

const unsigned int libMesh::Pyramid::edge_sides_map
staticinherited
Initial value:
=
{
{0, 4},
{1, 4},
{2, 4},
{3, 4},
{0, 3},
{0, 1},
{1, 2},
{2, 3}
}

This maps each edge to the sides that contain said edge.

Definition at line 199 of file cell_pyramid.h.

Referenced by libMesh::Pyramid::is_edge_on_side(), and libMesh::Pyramid::sides_on_edge().

◆ invalid_id

const dof_id_type libMesh::DofObject::invalid_id = static_cast<dof_id_type>(-1)
staticinherited

An invalid id to distinguish an uninitialized DofObject.

Definition at line 482 of file dof_object.h.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::Node::active(), libMesh::MeshBase::add_elem_datum(), libMesh::MeshBase::add_elem_integers(), libMesh::DofObject::add_extra_integers(), libMesh::StaticCondensation::add_matrix(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::TopologyMap::add_node(), libMesh::MeshRefinement::add_node(), libMesh::MeshBase::add_node_datum(), libMesh::MeshBase::add_node_integers(), libMesh::ReplicatedMesh::add_point(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::DofMap::assert_no_nodes_missed(), libMesh::Elem::bracketing_nodes(), ExtraIntegersTest::checkpoint_helper(), libMesh::StaticCondensation::clear(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_nodes(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_sides(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::TopologyMap::find(), libMesh::DofMap::gather_constraints(), libMesh::MeshBase::get_elemset_code(), libMesh::StaticCondensation::init(), libMesh::ReplicatedMesh::insert_node(), libMesh::Poly2TriTriangulator::insert_refinement_points(), libMesh::Elem::interior_parent(), libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::invalidate_id(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::Node::Node(), libMesh::Elem::node_id(), libMesh::DofMap::old_dof_indices(), libMesh::DistributedMesh::own_node(), libMesh::XdrIO::pack_element(), libMesh::SFCPartitioner::partition_range(), libMesh::Elem::point(), libMesh::ExodusII_IO::read(), libMesh::System::read_legacy_data(), libMesh::DynaIO::read_mesh(), libMesh::System::read_parallel_data(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::DofMap::SCALAR_dof_indices(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Parallel::sync_node_data_by_element_id_once(), ExtraIntegersTest::test_and_set_initial_data(), DofObjectTest< Node >::testAddExtraData(), DofObjectTest< Node >::testAddSystemExtraInts(), NodalNeighborsTest::testEdge2(), NodalNeighborsTest::testEdge3(), NodalNeighborsTest::testEdge4(), ExtraIntegersTest::testExtraIntegersExodusReading(), InfFERadialTest::testRefinement(), DofObjectTest< Node >::testSetNSystemsExtraInts(), DofObjectTest< Node >::testSetNVariableGroupsExtraInts(), MeshTetTest::testTetInterfaceBase(), DofObjectTest< Node >::testValidId(), WriteElemsetData::testWriteImpl(), libMesh::Poly2TriTriangulator::triangulate_current_points(), libMesh::DofObject::valid_id(), libMesh::System::write_parallel_data(), and libMesh::XdrIO::write_serialized_connectivity().

◆ invalid_processor_id

const processor_id_type libMesh::DofObject::invalid_processor_id = static_cast<processor_id_type>(-1)
staticinherited

An invalid processor_id to distinguish DoFs that have not been assigned to a processor.

Definition at line 493 of file dof_object.h.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::DistributedMesh::add_node(), libMesh::MeshRefinement::add_node(), libMesh::MeshCommunication::allgather(), libMesh::Node::choose_processor_id(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubProjector::construct_projection(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshTools::create_bounding_box(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::Elem::Elem(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::MeshCommunication::find_global_indices(), libMesh::MeshBase::get_info(), libMesh::DistributedMesh::insert_elem(), libMesh::DofObject::invalidate_processor_id(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshBase::n_constraint_rows(), libMesh::MeshBase::n_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), libMesh::MeshBase::n_unpartitioned_elem(), libMesh::MeshBase::n_unpartitioned_nodes(), libMesh::SparsityPattern::Build::operator()(), libMesh::Partitioner::processor_pairs_to_interface_nodes(), libMesh::Nemesis_IO_Helper::read_var_names_impl(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DistributedMesh::renumber_nodes_and_elements(), OverlappingFunctorTest::run_coupling_functor_test(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::send_and_insert_dof_values(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_dofobject_data_by_xyz(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id_once(), DofObjectTest< Node >::testValidProcId(), libMesh::MeshTools::total_weight(), libMesh::DofObject::valid_processor_id(), and libMesh::CheckpointIO::write().

◆ invalid_subdomain_id

const subdomain_id_type libMesh::Elem::invalid_subdomain_id = std::numeric_limits<subdomain_id_type>::max()
staticinherited

A static integral constant representing an invalid subdomain id.

See also DofObject::{invalid_id, invalid_unique_id, invalid_processor_id}.

Note
We don't use the static_cast(-1) trick here since subdomain_id_type is sometimes a signed integer for compatibility reasons (see libmesh/id_types.h).
Normally you can declare static const integral types directly in the header file (C++ standard, 9.4.2/4) but std::numeric_limits<T>::max() is not considered a "constant expression". This one is therefore defined in elem.C. http://stackoverflow.com/questions/2738435/using-numeric-limitsmax-in-constant-expressions

Definition at line 251 of file elem.h.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::BoundaryInfo::add_elements(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), libMesh::MeshBase::get_id_by_name(), libMesh::BoundaryInfo::sync(), and MeshSubdomainIDTest::testMultiple().

◆ invalid_unique_id

const unique_id_type libMesh::DofObject::invalid_unique_id = static_cast<unique_id_type>(-1)
staticinherited

An invalid unique_id to distinguish an uninitialized DofObject.

Definition at line 487 of file dof_object.h.

Referenced by libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DofObject::unique_id(), and libMesh::DofObject::valid_unique_id().

◆ LIBMESH_ENABLE_TOPOLOGY_CACHES

libMesh::Pyramid18::LIBMESH_ENABLE_TOPOLOGY_CACHES
protected

Definition at line 274 of file cell_pyramid18.h.

◆ max_n_nodes

const unsigned int libMesh::Elem::max_n_nodes = 27
staticinherited

The maximum number of nodes any element can contain.

This is useful for replacing heap vectors with stack arrays.

Definition at line 661 of file elem.h.

Referenced by libMesh::Elem::Elem(), and ElemTest< elem_type >::test_static_data().

◆ nodes_per_edge

const int libMesh::Pyramid18::nodes_per_edge = 3
static

Definition at line 233 of file cell_pyramid18.h.

Referenced by local_edge_node().

◆ nodes_per_side

const int libMesh::Pyramid18::nodes_per_side = 9
static

Definition at line 232 of file cell_pyramid18.h.

Referenced by local_side_node().

◆ num_children

const int libMesh::Pyramid::num_children = 0
staticinherited

Definition at line 79 of file cell_pyramid.h.

◆ num_edges

const int libMesh::Pyramid::num_edges = 8
staticinherited

Definition at line 78 of file cell_pyramid.h.

◆ num_nodes

const int libMesh::Pyramid18::num_nodes = 18
static

Geometric constants for Pyramid18.

Definition at line 231 of file cell_pyramid18.h.

Referenced by n_nodes().

◆ num_sides

const int libMesh::Pyramid::num_sides = 5
staticinherited

Geometric constants for all Pyramids.

Definition at line 77 of file cell_pyramid.h.

Referenced by libMesh::Pyramid14::center_node_on_side(), and center_node_on_side().

◆ old_dof_object

std::unique_ptr<DofObject> libMesh::DofObject::old_dof_object
protectedinherited

This object on the last mesh.

Useful for projecting solutions from one mesh to another.

Public access to old_dof_object is now officially deprecated and will be removed in future libMesh versions. Use the get_old_dof_object() accessor instead.

Definition at line 88 of file dof_object.h.

Referenced by libMesh::DofObject::clear_old_dof_object(), libMesh::DofObject::get_old_dof_object(), libMesh::DofObject::get_old_dof_object_ref(), libMesh::DofObject::operator=(), libMesh::DofObject::pack_indexing(), libMesh::DofObject::packed_indexing_size(), libMesh::DofObject::set_old_dof_object(), and libMesh::DofObject::unpack_indexing().

◆ side_nodes_map

const unsigned int libMesh::Pyramid18::side_nodes_map
static
Initial value:
=
{
{0, 1, 4, 5, 10, 9, 14, 99, 99},
{1, 2, 4, 6, 11, 10, 15, 99, 99},
{2, 3, 4, 7, 12, 11, 16, 99, 99},
{3, 0, 4, 8, 9, 12, 17, 99, 99},
{0, 3, 2, 1, 8, 7, 6, 5, 13}
}

This maps the j^{th} node of the i^{th} side to element node numbers.

Definition at line 239 of file cell_pyramid18.h.

Referenced by build_side_ptr(), is_node_on_side(), local_side_node(), and nodes_on_side().

◆ type_to_default_order_map

const Order libMesh::Elem::type_to_default_order_map
staticinherited

This array maps the integer representation of the ElemType enum to the default approximation order of elements of that type.

This is currently usable even for complicated subclasses with runtime-varying topology.

Definition at line 982 of file elem.h.

Referenced by SystemsTest::test2DProjectVectorFE(), SystemsTest::test3DProjectVectorFE(), and ElemTest< elem_type >::test_static_data().

◆ type_to_dim_map

const unsigned int libMesh::Elem::type_to_dim_map
staticinherited

This array maps the integer representation of the ElemType enum to the geometric dimension of the element.

This is currently usable even for complicated subclasses with runtime-varying topology.

Definition at line 635 of file elem.h.

Referenced by FETestBase< order, family, elem_type, 1 >::setUp(), SystemsTest::test2DProjectVectorFE(), SystemsTest::test3DProjectVectorFE(), ElemTest< elem_type >::test_static_data(), and PointLocatorTest::testLocator().

◆ type_to_n_edges_map

const unsigned int libMesh::Elem::type_to_n_edges_map
staticinherited

This array maps the integer representation of the ElemType enum to the number of edges on the element.

This is only usable for simple types for which the node number is fixed; for more general types like Polygon subclasses an actual instantiated Elem must be queried.

Definition at line 743 of file elem.h.

Referenced by ElemTest< elem_type >::test_static_data().

◆ type_to_n_nodes_map

const unsigned int libMesh::Elem::type_to_n_nodes_map
staticinherited

This array maps the integer representation of the ElemType enum to the number of nodes in the element.

This is only usable for simple types for which the node number is fixed; for more general types like Polygon subclasses an actual instantiated Elem must be queried.

Definition at line 650 of file elem.h.

Referenced by libMesh::DynaIO::ElementDefinition::ElementDefinition(), libMesh::FEAbstract::get_refspace_nodes(), libMesh::XdrIO::pack_element(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_serialized_connectivity(), ElemTest< elem_type >::test_static_data(), MeshGenerationTest::testBuildCube(), MeshGenerationTest::testBuildLine(), and libMesh::ExodusII_IO_Helper::write_elements().

◆ type_to_n_sides_map

const unsigned int libMesh::Elem::type_to_n_sides_map
staticinherited

This array maps the integer representation of the ElemType enum to the number of sides on the element.

This is only usable for simple types for which the node number is fixed; for more general types like Polygon subclasses an actual instantiated Elem must be queried.

Definition at line 685 of file elem.h.

Referenced by ElemTest< elem_type >::test_static_data(), MeshGenerationTest::testBuildCube(), and MeshGenerationTest::testBuildSquare().


The documentation for this class was generated from the following files: