libMesh
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
libMesh::RemoteElem Class Reference

In parallel meshes where a ghost element has neighbors which do not exist on the local processor, the ghost element's neighbors are set to point to the singleton RemoteElement instead. More...

#include <remote_elem.h>

Inheritance diagram for libMesh::RemoteElem:
[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 Predicates::multi_predicate Predicate
 Useful iterator typedefs. More...
 

Public Member Functions

 RemoteElem (RemoteElem &&)=delete
 
 RemoteElem (const RemoteElem &)=delete
 
RemoteElemoperator= (const RemoteElem &)=delete
 
RemoteElemoperator= (RemoteElem &&)=delete
 
virtual ~RemoteElem ()
 Sets remote_elem to nullptr. More...
 
virtual Point master_point (const unsigned int) const override
 
virtual Node *& set_node (const unsigned int i) override
 
virtual dof_id_type key (const unsigned int) const override
 
virtual unsigned int which_node_am_i (unsigned int, unsigned int) const override
 
virtual bool is_remote () const override
 
virtual void connectivity (const unsigned int, const IOPackage, std::vector< dof_id_type > &) const override
 
virtual ElemType type () const override
 
virtual unsigned short dim () const override
 
virtual unsigned int n_nodes () 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_vertex (const unsigned int) const override
 
virtual bool is_edge (const unsigned int) const override
 
virtual bool is_face (const unsigned int) const override
 
virtual bool is_node_on_side (const unsigned int, const unsigned int) const override
 
virtual std::vector< unsigned intnodes_on_side (const unsigned int) const override
 
virtual bool is_child_on_side (const unsigned int, const unsigned int) const override
 
virtual bool is_edge_on_side (const unsigned int, const unsigned int) const override
 
virtual bool is_node_on_edge (const unsigned int, const unsigned int) const override
 
virtual unsigned int n_sub_elem () const override
 
virtual std::unique_ptr< Elemside_ptr (const unsigned int) override
 
virtual void side_ptr (std::unique_ptr< Elem > &, const unsigned int) override
 Resets the loose element side, which may currently point to a different side than i or even a different element than this, to point to side i on this. More...
 
virtual std::unique_ptr< Elembuild_side_ptr (const unsigned int, bool) override
 
virtual void build_side_ptr (std::unique_ptr< Elem > &, const unsigned int) override
 Resets the loose element side, which may currently point to a different side than i or even a different element than this, to point to side i on this. More...
 
virtual std::unique_ptr< Elembuild_edge_ptr (const unsigned int) override
 
virtual Order default_order () const override
 
virtual bool infinite () const override
 
virtual float embedding_matrix (const unsigned int, const unsigned int, const unsigned int) const override
 Matrix that transforms the parents nodes into the children's nodes. More...
 
virtual dof_id_type key (const unsigned int s) const=0
 Don't hide Elem::key() defined in the base class. More...
 
virtual dof_id_type key () const
 Don't hide Elem::key() defined in the base class. More...
 
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)
 
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 ()
 
const Elemreference_elem () const
 
virtual dof_id_type key () const
 
bool operator== (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...
 
bool contains_vertex_of (const Elem *e) 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...
 
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 unsigned int is_vertex_on_child (unsigned int, unsigned int n) const
 
virtual bool is_vertex_on_parent (unsigned int c, unsigned int n) 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 Elemside_ptr (unsigned int i) const
 
void side_ptr (std::unique_ptr< const Elem > &side, const unsigned int i) const
 
std::unique_ptr< const Elembuild_side_ptr (const unsigned int i, bool proxy=true) 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
 
virtual Point centroid () const
 
virtual Real hmin () const
 
virtual Real hmax () const
 
virtual Real volume () const
 
virtual BoundingBox loose_bounding_box () 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
 
virtual bool has_affine_map () 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 unsigned int n_second_order_adjacent_vertices (const unsigned int n) const
 
virtual unsigned short int second_order_adjacent_vertex (const unsigned int n, const unsigned int v) 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...
 
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 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...
 
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 ()
 
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...
 
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 const Elemcreate ()
 Return a reference to the global RemoteElem singleton object. More...
 
static void print_info (std::ostream &out=libMesh::out)
 Prints the reference information, by default to libMesh::out. More...
 
static void print_info (std::ostream &out=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 std::unique_ptr< Elembuild (const ElemType type, Elem *p=nullptr)
 
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 void setup ()
 Setup function. More...
 
static void cleanup ()
 Cleanup function. More...
 

Public Attributes

 LIBMESH_ENABLE_TOPOLOGY_CACHES
 
const typedef Elem *const * ConstNeighborPtrIter
 
DofObjectold_dof_object
 This object on the last mesh. More...
 

Static Public Attributes

static const dof_id_type remote_elem_id = static_cast<dof_id_type>(-2)
 A unique id to distinguish remote element links. 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_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 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

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...
 
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)
 Increments the construction counter. More...
 
void increment_constructor_count (const std::string &name)
 Increments the construction counter. More...
 
void increment_destructor_count (const std::string &name)
 Increments the destruction counter. More...
 
void increment_destructor_count (const std::string &name)
 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

Elem_elemlinks_data [1]
 Data for link to (nullptr!) parent. 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...
 
Elem ** _children
 Pointers to 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...
 

Static Protected Attributes

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...
 

Private Types

typedef dof_id_type index_t
 DoF index information. More...
 
typedef std::vector< index_tindex_buffer_t
 

Private Member Functions

 RemoteElem ()
 Constructor. More...
 
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. More...
 
void set_child (unsigned int c, Elem *elem)
 Sets the pointer to the \( i^{th} \) child for this element. More...
 
SideIter _first_side ()
 Side iterator helper functions. More...
 
SideIter _last_side ()
 
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. More...
 
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. More...
 
unsigned int start_idx (const unsigned int s) const
 The starting index for system s. More...
 
unsigned int end_idx (const unsigned int s) const
 The ending index for system s. More...
 
unsigned int start_idx_ints () const
 The starting index for an extra_integers pseudosystem. More...
 
unsigned int end_idx_ints () const
 The ending index for an extra_integers pseudosystem. More...
 

Private Attributes

unique_id_type _unique_id
 A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted. More...
 
dof_id_type _id
 The id of the DofObject. More...
 
processor_id_type _processor_id
 The processor_id of the DofObject. More...
 
index_buffer_t _idx_buf
 

Static Private Attributes

static const index_t ncv_magic = 256
 Above we introduced the chimera ncv, which is a hybrid of the form ncv = ncv_magic*nv + nc where nv are the number of identical variables of a given type, and nc is the number of components for this set of variables. More...
 
static const index_t ncv_magic_exp = 8
 

Detailed Description

In parallel meshes where a ghost element has neighbors which do not exist on the local processor, the ghost element's neighbors are set to point to the singleton RemoteElement instead.

Library code can then distinguish between such elements and boundary elements (with nullptr neighbors).

Author
Roy H. Stogner
Date
2007

Used by ParallelMesh to represent an Elem owned by another processor.

Definition at line 44 of file remote_elem.h.

Member Typedef Documentation

◆ 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 117 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 117 of file reference_counter.h.

◆ index_buffer_t

typedef std::vector<index_t> libMesh::DofObject::index_buffer_t
privateinherited

Definition at line 612 of file dof_object.h.

◆ index_t

typedef dof_id_type libMesh::DofObject::index_t
privateinherited

DoF index information.

This is packed into a contiguous buffer of the following format:

* [hdr end_0 end_1 ... end_{nps-2} (ncv_0 idx_0 ncv_1 idx_1 ... ncv_nv idx_nv)_0
*                                  (ncv_0 idx_0 ncv_1 idx_1 ... ncv_nv idx_nv)_1
*                                   ...
*                                  (ncv_0 idx_0 ncv_1 idx_1 ... ncv_nv idx_nv)_{nps-2} ]
* 

'hdr' determines whether this DofObject has_extra_integers() associated with it; iff so then it is negative.

The total number of "pseudo systems" is nps := abs(hdr).

The total number of true systems is

* ns = hdr,            hdr >= 0
*    = abs(hdr) - 1,   otherwise.
* 

'end_s' is the index past the end of the variable group (or integer) storage for (pseudo) system s.

Note
We specifically do not store the end for the last (pseudo) system - this always _idx_buf.size().

As a first example, consider the case of 4 systems, with 3, 0, 1, 2 variable groups, respectively. The _idx_buf then looks like:

* [4 10 10 12 () (ncv_0 idx_0 ncv_1 idx_1 ncv_2 idx_2) () (ncv_0 idx_0) (ncv_0 idx_0 ncv_1 idx_1)]
* [0  1  2  3         4     5     6     7     8     9         10    11      12    13    14    15]
* 

The ending index for each (pseudo) system is then given by:

* end_s = _idx_buf.size(),                        s == (nps-1),
*       = _idx_buf[s+1] + has_extra_integers(),   otherwise.
* 

The starting indices are not specifically stored, but rather inferred as follows:

start_s = abs(_idx_buf[s])

Now, the defining characteristic of the VariableGroup is that it supports an arbitrary number of variables of the same type. At the DofObject level, what that means is that each Variable in the VariableGroup will have the same number of nonzero components, and they can all be indexed from the same base number. We use this information in the ncv_# and idx_# entries as follows:

ncv_# = n_vars*ncv_magic + n_comp for variable group # idx_# = base_offset for variable group #

the DoF index for a particular component c of variable v within that group is then given by

idx_var = idx_# + n_comp*v + c

Note
There is a subtlety here - "variable v within that group" usually means nothing to the user. This class is either indexed with variable group numbers, or variable numbers counted within the system. So for a system with 2 variable groups, 4 and 8 variables each, the 5th variable in the system is the 1st variable in 2nd variable group. (Now of course 0-base everything... but you get the idea.)

When hdr is negative when cast to a signed type, then we interpret that to mean there exists one pseudo-system following the true systems, one for which the _idx_buf data stores the values associated with add_extra_integer entries, not ncv and idx data associated with system variables. We still return only the number of true systems for n_systems(), but we report has_extra_integers() as true iff hdr is negative, and abs(hdr) will reflect the total number of pseudo-systems, n_systems()+1.

E.g. if we had added two extra integers to the example case above, the _idx_buf then looks like:

* [-5 11 11 13 17 () (ncv_0 idx_0 ncv_1 idx_1 ncv_2 idx_2) () (ncv_0 idx_0) (ncv_0 idx_0 ncv_1 idx_1) (xtra1 xtra2)]
* [0   1  2  3  4         5     6     7     8     9    10         11    12      13    14    15    16      17    18]
* 

Definition at line 611 of file dof_object.h.

◆ NeighborPtrIter

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

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

Definition at line 298 of file elem.h.

◆ Predicate

Useful iterator typedefs.

Definition at line 1539 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 1169 of file elem.h.

1169  { COARSEN = 0,
1170  DO_NOTHING,
1171  REFINE,
1172  JUST_REFINED,
1174  INACTIVE,

Constructor & Destructor Documentation

◆ RemoteElem() [1/3]

libMesh::RemoteElem::RemoteElem ( )
inlineprivate

Constructor.

Private to force use of the create() member.

Definition at line 58 of file remote_elem.h.

58  : Elem(0,
59  0,
60  nullptr,
62  nullptr)
63  { this->set_id(remote_elem_id); }

References libMesh::DofObject::set_id().

Referenced by create().

◆ RemoteElem() [2/3]

libMesh::RemoteElem::RemoteElem ( RemoteElem &&  )
delete

◆ RemoteElem() [3/3]

libMesh::RemoteElem::RemoteElem ( const RemoteElem )
delete

◆ ~RemoteElem()

libMesh::RemoteElem::~RemoteElem ( )
virtual

Sets remote_elem to nullptr.

Definition at line 60 of file remote_elem.C.

61 {
62  RemoteElemMutex::scoped_lock lock(remote_elem_mtx);
63 
64  remote_elem = nullptr;
65 }

References libMesh::remote_elem.

Member Function Documentation

◆ _first_side()

Elem::SideIter libMesh::Elem::_first_side ( )
inlineprivateinherited

Side iterator helper functions.

Used to replace the begin() and end() functions of the STL containers.

Definition at line 2884 of file elem.h.

2885 {
2886  return SideIter(0, this);
2887 }

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

◆ _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 1707 of file elem.h.

1708  {
1709  static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> c;
1710  libmesh_error();
1711  return c;
1712  }

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

◆ _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 1721 of file elem.h.

1722  {
1723  static std::vector<std::vector<std::vector<signed char>>> c;
1724  libmesh_error();
1725  return c;
1726  }

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

◆ _last_side()

Elem::SideIter libMesh::Elem::_last_side ( )
inlineprivateinherited

Definition at line 2892 of file elem.h.

2893 {
2894  return SideIter(this->n_neighbors(), this);
2895 }

References libMesh::Elem::n_neighbors().

Referenced by libMesh::Elem::boundary_sides_begin(), and libMesh::Elem::boundary_sides_end().

◆ 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 2345 of file elem.h.

2346 {
2347 #ifdef LIBMESH_ENABLE_AMR
2348  if ((this->refinement_flag() == INACTIVE) ||
2349  (this->refinement_flag() == COARSEN_INACTIVE))
2350  return false;
2351  else
2352  return true;
2353 #else
2354  return true;
2355 #endif
2356 }

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::connect_families(), libMesh::UnstructuredMesh::contract(), 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::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::DofMap::old_dof_indices(), libMesh::PointLocatorTree::operator()(), libMesh::Elem::refine(), libMesh::Elem::subactive(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::MeshRefinement::test_level_one(), EquationSystemsTest::testRefineThenReinitPreserveFlags(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ 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 1473 of file elem.C.

1475 {
1476  ElemInternal::active_family_tree(this, active_family, reset);
1477 }

References libMesh::ElemInternal::active_family_tree().

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

◆ 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 1481 of file elem.C.

1483 {
1484  ElemInternal::active_family_tree(this, active_family, reset);
1485 }

References libMesh::ElemInternal::active_family_tree().

◆ 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 1601 of file elem.C.

1604 {
1605  ElemInternal::active_family_tree_by_neighbor(this, family, neighbor, reset);
1606 }

References libMesh::ElemInternal::active_family_tree_by_neighbor().

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

◆ 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 1610 of file elem.C.

1613 {
1614  ElemInternal::active_family_tree_by_neighbor(this, family, neighbor, reset);
1615 }

References libMesh::ElemInternal::active_family_tree_by_neighbor().

◆ 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 1507 of file elem.C.

1510 {
1511  ElemInternal::active_family_tree_by_side(this, family, side, reset);
1512 }

References libMesh::ElemInternal::active_family_tree_by_side().

Referenced by libMesh::Nemesis_IO_Helper::write_sidesets().

◆ 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 1516 of file elem.C.

1519 {
1520  ElemInternal::active_family_tree_by_side(this, family, side, reset);
1521 }

References libMesh::ElemInternal::active_family_tree_by_side().

◆ 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 1619 of file elem.C.

1625 {
1627  mesh, point_locator, pb,
1628  reset);
1629 }

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

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

◆ 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 1633 of file elem.C.

1639 {
1641  mesh, point_locator, pb,
1642  reset);
1643 }

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

◆ 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 1384 of file elem.C.

1385 {
1386  const unsigned int nc = this->n_children();
1387 
1388  if (_children == nullptr)
1389  {
1390  _children = new Elem *[nc];
1391 
1392  for (unsigned int c = 0; c != nc; c++)
1393  this->set_child(c, nullptr);
1394  }
1395 
1396  for (unsigned int c = 0; c != nc; c++)
1397  {
1398  if (this->_children[c] == nullptr || this->_children[c] == remote_elem)
1399  {
1400  libmesh_assert_equal_to (this, elem->parent());
1401  this->set_child(c, elem);
1402  return;
1403  }
1404  }
1405 
1406  libmesh_error_msg("Error: Tried to add a child to an element with full children array");
1407 }

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(), libMesh::CheckpointIO::read_remote_elem(), libMesh::XdrIO::read_serialized_connectivity(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ 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 1411 of file elem.C.

1412 {
1413  if (!this->has_children())
1414  {
1415  const unsigned int nc = this->n_children();
1416  _children = new Elem *[nc];
1417 
1418  for (unsigned int i = 0; i != nc; i++)
1419  this->set_child(i, nullptr);
1420  }
1421 
1422  libmesh_assert (this->_children[c] == nullptr || this->child_ptr(c) == remote_elem);
1423  libmesh_assert (elem == remote_elem || this == elem->parent());
1424 
1425  this->set_child(c, elem);
1426 }

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().

◆ add_extra_integers()

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.

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 503 of file dof_object.C.

504 {
505  if (_idx_buf.empty())
506  {
507  if (n_integers)
508  {
509  _idx_buf.resize(n_integers+1, DofObject::invalid_id);
510  _idx_buf[0] = dof_id_type(-1);
511  }
512  return;
513  }
514  else
515  {
516  const int hdr = dof_id_signed_type(_idx_buf[0]);
517 
518  // We already have some extra integers, but may need more or
519  // less now.
520  if (hdr < 0)
521  {
522  const unsigned int old_n_integers = this->n_extra_integers();
523  if (n_integers != old_n_integers)
524  {
525  // Make or remove space as needed by count change
526  _idx_buf.resize(_idx_buf.size()+n_integers-old_n_integers, DofObject::invalid_id);
527 
528  // The start index for the extra integers is unchanged.
529  }
530  }
531  else if (n_integers)
532  // We had no extra integers, but need to add some
533  {
534  // Mark the DofObject as holding extra integers
535  _idx_buf[0] = dof_id_type(-hdr-1);
536 
537  // Insert the integer start position
538  DofObject::index_buffer_t::iterator it = _idx_buf.begin() + hdr;
539  _idx_buf.insert(it, _idx_buf.size()+1);
540 
541  // Increment the previous system start positions to account
542  // for the new header entry creating an offset
543  for (int i=1; i<hdr; i++)
544  _idx_buf[i]++;
545 
546  // Append space for extra integers
547  _idx_buf.resize(_idx_buf.size()+n_integers, DofObject::invalid_id);
548  }
549  }
550 }

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::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::ReplicatedMesh::add_point(), 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().

◆ add_system()

void libMesh::DofObject::add_system ( )
inherited

Adds an additional system to the DofObject.

Definition at line 208 of file dof_object.C.

209 {
210  // quick return?
211  if (this->n_systems() == 0)
212  {
213  this->set_n_systems(1);
214  return;
215  }
216 
217  // cache this value before we screw it up!
218  const unsigned int ns_orig = this->n_systems();
219 
220  DofObject::index_buffer_t::iterator it = _idx_buf.begin() + ns_orig;
221 
222  // Create the entry for the new system indicating 0 variables.
223  //
224  // increment the number of systems and the offsets for each of
225  // the systems including the new one we just added.
226  if (this->has_extra_integers())
227  {
228  // this inserts the extra_integers' start position as the start
229  // position for the new system. We'll increment all those
230  // counts in one sweep next, to account for header expansion.
231  _idx_buf.insert(it, *it);
232 
233  _idx_buf[0]--;
234  for (unsigned int i=1; i<ns_orig+2; i++)
235  {
236  libmesh_assert_less(i, _idx_buf.size());
237  _idx_buf[i]++;
238  }
239  }
240  else
241  {
242  // this inserts the current vector size at the position for the
243  // new system
244  _idx_buf.insert(it, cast_int<dof_id_type>(_idx_buf.size()));
245 
246  for (unsigned int i=0; i<ns_orig+1; i++)
247  {
248  libmesh_assert_less(i, _idx_buf.size());
249  _idx_buf[i]++;
250  }
251  }
252 
253  libmesh_assert_equal_to (this->n_systems(), (ns_orig+1));
254  libmesh_assert_equal_to (this->n_vars(ns_orig), 0);
255  libmesh_assert_equal_to (this->n_var_groups(ns_orig), 0);
256 }

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().

◆ 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 1350 of file elem.C.

1351 {
1352 #ifdef LIBMESH_ENABLE_AMR
1353 
1354  // Use a fast, DistributedMesh-safe definition
1355  const bool is_ancestor =
1356  !this->active() && !this->subactive();
1357 
1358  // But check for inconsistencies if we have time
1359 #ifdef DEBUG
1360  if (!is_ancestor && this->has_children())
1361  {
1362  for (auto & c : this->child_ref_range())
1363  {
1364  if (&c != remote_elem)
1365  {
1366  libmesh_assert(!c.active());
1367  libmesh_assert(!c.ancestor());
1368  }
1369  }
1370  }
1371 #endif // DEBUG
1372 
1373  return is_ancestor;
1374 
1375 #else
1376  return false;
1377 #endif
1378 }

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::contract(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), and libMesh::Elem::refine().

◆ 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 1726 of file elem.C.

1728 {
1729  const unsigned int nc = this->n_children();
1730  libmesh_assert_less(child, nc);
1731 
1732  // Cached return values, indexed first by embedding_matrix version,
1733  // then by child number, then by child node number.
1734  std::vector<std::vector<std::vector<signed char>>> &
1735  cached_parent_indices = this->_get_parent_indices_cache();
1736 
1737  unsigned int em_vers = this->embedding_matrix_version();
1738 
1739  // We may be updating the cache on one thread, and while that
1740  // happens we can't safely access the cache from other threads.
1741  Threads::spin_mutex::scoped_lock lock(parent_indices_mutex);
1742 
1743  if (em_vers >= cached_parent_indices.size())
1744  cached_parent_indices.resize(em_vers+1);
1745 
1746  if (child >= cached_parent_indices[em_vers].size())
1747  {
1748  const signed char nn = cast_int<signed char>(this->n_nodes());
1749 
1750  cached_parent_indices[em_vers].resize(nc);
1751 
1752  for (unsigned int c = 0; c != nc; ++c)
1753  {
1754  const unsigned int ncn = this->n_nodes_in_child(c);
1755  cached_parent_indices[em_vers][c].resize(ncn);
1756  for (unsigned int cn = 0; cn != ncn; ++cn)
1757  {
1758  for (signed char n = 0; n != nn; ++n)
1759  {
1760  const float em_val = this->embedding_matrix
1761  (c, cn, n);
1762  if (em_val == 1)
1763  {
1764  cached_parent_indices[em_vers][c][cn] = n;
1765  break;
1766  }
1767 
1768  if (em_val != 0)
1769  {
1770  cached_parent_indices[em_vers][c][cn] =
1771  -1;
1772  break;
1773  }
1774 
1775  // We should never see an all-zero embedding matrix
1776  // row
1777  libmesh_assert_not_equal_to (n+1, nn);
1778  }
1779  }
1780  }
1781  }
1782 
1783  const signed char cache_val =
1784  cached_parent_indices[em_vers][child][child_node];
1785  if (cache_val == -1)
1786  return libMesh::invalid_uint;
1787 
1788  return cached_parent_indices[em_vers][child][child_node];
1789 }

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(), and libMesh::parent_indices_mutex.

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

◆ boundary_sides_begin()

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

Iterator accessor functions.

Definition at line 2599 of file elem.C.

2600 {
2601  Predicates::BoundarySide<SideIter> bsp;
2602  return side_iterator(this->_first_side(), this->_last_side(), bsp);
2603 }

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

◆ boundary_sides_end()

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

Definition at line 2608 of file elem.C.

2609 {
2610  Predicates::BoundarySide<SideIter> bsp;
2611  return side_iterator(this->_last_side(), this->_last_side(), bsp);
2612 }

References libMesh::Elem::_last_side().

◆ 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 1999 of file elem.C.

2001 {
2002  std::vector<std::pair<dof_id_type, dof_id_type>> returnval;
2003 
2004  const std::vector<std::pair<unsigned char, unsigned char>> & pbc =
2005  this->parent_bracketing_nodes(child,child_node);
2006 
2007  for (const auto & pb : pbc)
2008  {
2009  const unsigned short n_n = this->n_nodes();
2010  if (pb.first < n_n && pb.second < n_n)
2011  returnval.push_back(std::make_pair(this->node_id(pb.first),
2012  this->node_id(pb.second)));
2013  else
2014  {
2015  // We must be on a non-full-order higher order element...
2016  libmesh_assert_not_equal_to(this->default_order(), FIRST);
2017  libmesh_assert_not_equal_to
2018  (second_order_equivalent_type (this->type(), true),
2019  this->type());
2020  libmesh_assert_equal_to
2021  (second_order_equivalent_type (this->type(), false),
2022  this->type());
2023 
2024  // And that's a shame, because this is a nasty search:
2025 
2026  // Build the full-order type
2027  ElemType full_type =
2028  second_order_equivalent_type(this->type(), /*full_ordered=*/ true);
2029  std::unique_ptr<Elem> full_elem = Elem::build(full_type);
2030 
2033 
2034  // Find the bracketing nodes by figuring out what
2035  // already-created children will have them.
2036 
2037  // This only doesn't break horribly because we add children
2038  // and nodes in straightforward + hierarchical orders...
2039  for (unsigned int c=0; c <= child; ++c)
2040  for (auto n : IntRange<unsigned int>(0, this->n_nodes_in_child(c)))
2041  {
2042  if (c == child && n == child_node)
2043  break;
2044 
2045  if (pb.first == full_elem->as_parent_node(c,n))
2046  {
2047  // We should be consistent
2048  if (pt1 != DofObject::invalid_id)
2049  libmesh_assert_equal_to(pt1, this->child_ptr(c)->node_id(n));
2050 
2051  pt1 = this->child_ptr(c)->node_id(n);
2052  }
2053 
2054  if (pb.second == full_elem->as_parent_node(c,n))
2055  {
2056  // We should be consistent
2057  if (pt2 != DofObject::invalid_id)
2058  libmesh_assert_equal_to(pt2, this->child_ptr(c)->node_id(n));
2059 
2060  pt2 = this->child_ptr(c)->node_id(n);
2061  }
2062  }
2063 
2064  // We should *usually* find all bracketing nodes by the time
2065  // we query them (again, because of the child & node add
2066  // order)
2067  //
2068  // The exception is if we're a HEX20, in which case we will
2069  // find pairs of vertex nodes and edge nodes bracketing the
2070  // new central node but we *won't* find the pairs of face
2071  // nodes which we would have had on a HEX27. In that case
2072  // we'll still have enough bracketing nodes for a
2073  // topological lookup, but we won't be able to make the
2074  // following assertions.
2075  if (this->type() != HEX20)
2076  {
2077  libmesh_assert_not_equal_to (pt1, DofObject::invalid_id);
2078  libmesh_assert_not_equal_to (pt2, DofObject::invalid_id);
2079  }
2080 
2081  if (pt1 != DofObject::invalid_id &&
2082  pt2 != DofObject::invalid_id)
2083  returnval.push_back(std::make_pair(pt1, pt2));
2084  }
2085  }
2086 
2087  return returnval;
2088 }

References libMesh::Elem::build(), libMesh::Elem::child_ptr(), libMesh::Elem::default_order(), libMesh::FIRST, libMesh::HEX20, libMesh::DofObject::invalid_id, 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().

◆ 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 246 of file elem.C.

248 {
249  switch (type)
250  {
251  // 0D elements
252  case NODEELEM:
253  return libmesh_make_unique<NodeElem>(p);
254 
255  // 1D elements
256  case EDGE2:
257  return libmesh_make_unique<Edge2>(p);
258  case EDGE3:
259  return libmesh_make_unique<Edge3>(p);
260  case EDGE4:
261  return libmesh_make_unique<Edge4>(p);
262 
263  // 2D elements
264  case TRI3:
265  return libmesh_make_unique<Tri3>(p);
266  case TRISHELL3:
267  return libmesh_make_unique<TriShell3>(p);
268  case TRI3SUBDIVISION:
269  return libmesh_make_unique<Tri3Subdivision>(p);
270  case TRI6:
271  return libmesh_make_unique<Tri6>(p);
272  case QUAD4:
273  return libmesh_make_unique<Quad4>(p);
274  case QUADSHELL4:
275  return libmesh_make_unique<QuadShell4>(p);
276  case QUAD8:
277  return libmesh_make_unique<Quad8>(p);
278  case QUADSHELL8:
279  return libmesh_make_unique<QuadShell8>(p);
280  case QUAD9:
281  return libmesh_make_unique<Quad9>(p);
282 
283  // 3D elements
284  case TET4:
285  return libmesh_make_unique<Tet4>(p);
286  case TET10:
287  return libmesh_make_unique<Tet10>(p);
288  case HEX8:
289  return libmesh_make_unique<Hex8>(p);
290  case HEX20:
291  return libmesh_make_unique<Hex20>(p);
292  case HEX27:
293  return libmesh_make_unique<Hex27>(p);
294  case PRISM6:
295  return libmesh_make_unique<Prism6>(p);
296  case PRISM15:
297  return libmesh_make_unique<Prism15>(p);
298  case PRISM18:
299  return libmesh_make_unique<Prism18>(p);
300  case PYRAMID5:
301  return libmesh_make_unique<Pyramid5>(p);
302  case PYRAMID13:
303  return libmesh_make_unique<Pyramid13>(p);
304  case PYRAMID14:
305  return libmesh_make_unique<Pyramid14>(p);
306 
307 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
308  // 1D infinite elements
309  case INFEDGE2:
310  return libmesh_make_unique<InfEdge2>(p);
311 
312  // 2D infinite elements
313  case INFQUAD4:
314  return libmesh_make_unique<InfQuad4>(p);
315  case INFQUAD6:
316  return libmesh_make_unique<InfQuad6>(p);
317 
318  // 3D infinite elements
319  case INFHEX8:
320  return libmesh_make_unique<InfHex8>(p);
321  case INFHEX16:
322  return libmesh_make_unique<InfHex16>(p);
323  case INFHEX18:
324  return libmesh_make_unique<InfHex18>(p);
325  case INFPRISM6:
326  return libmesh_make_unique<InfPrism6>(p);
327  case INFPRISM12:
328  return libmesh_make_unique<InfPrism12>(p);
329 #endif
330 
331  default:
332  libmesh_error_msg("ERROR: Undefined element type!");
333  }
334 }

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::NODEELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI3SUBDIVISION, libMesh::TRI6, libMesh::TRISHELL3, and libMesh::Elem::type().

Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::Elem::bracketing_nodes(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), ExtraIntegersTest::build_mesh(), ContainsPointTest::containsPointTri3Helper(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::UnstructuredMesh::create_submesh(), libMesh::MeshTools::Modification::flatten(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::RBDataDeserialization::load_rb_eim_evaluation_data(), libMesh::Elem::parent_bracketing_nodes(), 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::GmshIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::Elem::refine(), ElemTest< elem_type >::setUp(), RationalMapTest< elem_type >::setUp(), FETest< order, family, elem_type >::setUp(), ContainsPointTest::testContainsPointTet4(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), DofMapTest::testDofOwner(), PointLocatorTest::testLocator(), EquationSystemsTest::testPostInitAddElem(), libMesh::Parallel::Packing< Elem * >::unpack(), and libMesh::GMVIO::write_ascii_old_impl().

◆ build_edge_ptr() [1/2]

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

Definition at line 2301 of file elem.h.

2302 {
2303  // Call the non-const version of this function, return the result as
2304  // a std::unique_ptr<const Elem>.
2305  Elem * me = const_cast<Elem *>(this);
2306  const Elem * e = const_cast<const Elem *>(me->build_edge_ptr(i).release());
2307  return std::unique_ptr<const Elem>(e);
2308 }

References libMesh::Elem::build_edge_ptr().

◆ build_edge_ptr() [2/2]

virtual std::unique_ptr<Elem> libMesh::RemoteElem::build_edge_ptr ( const unsigned int  i)
inlineoverridevirtual
Returns
An element coincident with edge i wrapped in a smart pointer.

The element returned is full-ordered. For example, calling build_edge_ptr(0) on a 20-noded hex will build a 3-noded edge coincident with edge 0 and pass back the pointer. A std::unique_ptr<Elem> is returned to prevent a memory leak. This way the user need not remember to delete the object.

The const version of this function is non-virtual; it simply calls the virtual non-const version and const_casts the return type.

Implements libMesh::Elem.

Definition at line 182 of file remote_elem.h.

183  { libmesh_not_implemented(); return std::unique_ptr<Elem>(); }

◆ build_side_ptr() [1/4]

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

Definition at line 2224 of file elem.h.

2225 {
2226  // Call the non-const version of this function, return the result as
2227  // a std::unique_ptr<const Elem>.
2228  Elem * me = const_cast<Elem *>(this);
2229  const Elem * s = const_cast<const Elem *>(me->build_side_ptr(i, proxy).release());
2230  return std::unique_ptr<const Elem>(s);
2231 }

References libMesh::Elem::build_side_ptr().

◆ build_side_ptr() [2/4]

virtual std::unique_ptr<Elem> libMesh::RemoteElem::build_side_ptr ( const unsigned int  i,
bool  proxy 
)
inlineoverridevirtual
Returns
An element coincident with side i wrapped in a smart pointer.

The element returned is full-ordered, in contrast to the side method. For example, calling build_side_ptr(0) on a 20-noded hex will build a 8-noded quadrilateral coincident with face 0 and pass back the pointer. A std::unique_ptr<Elem> is returned to prevent a memory leak. This way the user need not remember to delete the object.

The second argument, which is true by default, specifies that a "proxy" element (of type Side) will be returned. This type of value is useful because it does not allocate additional memory, and is usually sufficient for FE calculation purposes. If you really need a full-ordered, non-proxy side object, call this function with proxy=false.

The const version of this function is non-virtual; it simply calls the virtual non-const version and const_casts the return type.

Implements libMesh::Elem.

Definition at line 174 of file remote_elem.h.

176  { libmesh_not_implemented(); return std::unique_ptr<Elem>(); }

◆ build_side_ptr() [3/4]

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

Definition at line 2237 of file elem.h.

2239 {
2240  // Hand off to the non-const version of this function
2241  Elem * me = const_cast<Elem *>(this);
2242  std::unique_ptr<Elem> e {const_cast<Elem *>(elem.release())};
2243  me->build_side_ptr(e, i);
2244  elem.reset(e.release());
2245 }

References libMesh::Elem::build_side_ptr().

◆ build_side_ptr() [4/4]

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

Resets the loose element side, which may currently point to a different side than i or even a different element than this, to point to side i on this.

If side is currently an element of the wrong type, it will be freed and a new element allocated; otherwise no memory allocation will occur.

This should not be called with proxy Side elements. This will cause side to be a full-ordered element, even if it is handed a lower-ordered element that must be replaced.

The const version of this function is non-virtual; it simply calls the virtual non-const version and const_casts the return type.

Implements libMesh::Elem.

Definition at line 178 of file remote_elem.h.

180  { libmesh_not_implemented(); }

◆ centroid()

Point libMesh::Elem::centroid ( ) const
virtualinherited
Returns
The centroid of the element. The centroid is computed as the average of all the element vertices.

This method is virtual since some derived elements might want to use shortcuts to compute their centroid.

Definition at line 345 of file elem.C.

346 {
347  Point cp;
348 
349  const auto n_vertices = this->n_vertices();
350 
351  for (unsigned int n=0; n<n_vertices; n++)
352  cp.add (this->point(n));
353 
354  return (cp /= static_cast<Real>(n_vertices));
355 }

References libMesh::TypeVector< T >::add(), and libMesh::Elem::n_vertices().

Referenced by libMesh::UnstructuredMesh::find_neighbors(), A0::interior_assembly(), A1::interior_assembly(), OutputAssembly::interior_assembly(), SlitFunc::operator()(), libMesh::LocationMap< T >::point_of(), libMesh::FE< Dim, LAGRANGE_VEC >::shape(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_second_deriv(), DefaultCouplingTest::testCoupling(), and PointNeighborCouplingTest::testCoupling().

◆ child_neighbor() [1/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 2139 of file elem.h.

2140 {
2141  for (auto n : elem->neighbor_ptr_range())
2142  if (n && n->parent() == this)
2143  return n;
2144 
2145  return nullptr;
2146 }

References libMesh::Elem::neighbor_ptr_range().

◆ child_neighbor() [2/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 2127 of file elem.h.

2128 {
2129  for (auto n : elem->neighbor_ptr_range())
2130  if (n && n->parent() == this)
2131  return n;
2132 
2133  return nullptr;
2134 }

References libMesh::Elem::neighbor_ptr_range().

◆ child_ptr() [1/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 2576 of file elem.h.

2577 {
2580 
2581  return _children[i];
2582 }

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

◆ child_ptr() [2/2]

const Elem * libMesh::Elem::child_ptr ( unsigned int  i) const
inlineinherited

◆ child_ref_range() [1/2]

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

◆ child_ref_range() [2/2]

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

Definition at line 1847 of file elem.h.

1848 {
1850  return {_children, _children + this->n_children()};
1851 }

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

◆ cleanup()

void libMesh::Singleton::cleanup ( )
staticinherited

Cleanup function.

Removes all dynamically created Singleton objects.

Definition at line 96 of file libmesh_singleton.C.

97 {
98  SingletonMutex::scoped_lock lock(singleton_mtx);
99 
100  SingletonList & singleton_cache = get_singleton_cache();
101 
102  for (auto & item : as_range(singleton_cache.rbegin(),
103  singleton_cache.rend()))
104  {
105  libmesh_assert (item);
106  delete item;
107  item = nullptr;
108  }
109 
110  singleton_cache.clear();
111 }

References libMesh::as_range(), and libMesh::libmesh_assert().

◆ 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 737 of file dof_object.h.

738 {
739  this->set_n_systems(0);
740 }

References libMesh::DofObject::set_n_systems().

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

◆ clear_old_dof_object()

void libMesh::DofObject::clear_old_dof_object ( )
inherited

Sets the old_dof_object to nullptr.

Definition at line 142 of file dof_object.C.

143 {
144  delete this->old_dof_object;
145  this->old_dof_object = nullptr;
146 }

References libMesh::DofObject::old_dof_object.

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

◆ 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.

Definition at line 2119 of file elem.C.

2120 {
2121  // This test uses the user's passed-in tolerance for the
2122  // bounding box test as well, thereby allowing the routine to
2123  // find points which are not only "in" the element, but also
2124  // "nearby" to within some tolerance.
2125  return this->point_test(p, tol, tol);
2126 }

References libMesh::Elem::point_test().

Referenced by assemble_SchroedingerEquation().

◆ 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.

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  // delete [] _children;
170  // _children = nullptr;
171 
172  unsigned int parent_p_level = 0;
173 
174  const unsigned int n_n = this->n_nodes();
175 
176  // re-compute hanging node nodal locations
177  for (unsigned int c = 0, nc = this->n_children(); c != nc; ++c)
178  {
179  Elem * mychild = this->child_ptr(c);
180  if (mychild == remote_elem)
181  continue;
182  for (auto cnode : mychild->node_index_range())
183  {
184  Point new_pos;
185  bool calculated_new_pos = false;
186 
187  for (unsigned int n=0; n<n_n; n++)
188  {
189  // The value from the embedding matrix
190  const float em_val = this->embedding_matrix(c,cnode,n);
191 
192  // The node location is somewhere between existing vertices
193  if ((em_val != 0.) && (em_val != 1.))
194  {
195  new_pos.add_scaled (this->point(n), em_val);
196  calculated_new_pos = true;
197  }
198  }
199 
200  if (calculated_new_pos)
201  {
202  //Move the existing node back into it's original location
203  for (unsigned int i=0; i<LIBMESH_DIM; i++)
204  {
205  Point & child_node = mychild->point(cnode);
206  child_node(i)=new_pos(i);
207  }
208  }
209  }
210  }
211 
212  for (auto & mychild : this->child_ref_range())
213  {
214  if (&mychild == remote_elem)
215  continue;
216  libmesh_assert_equal_to (mychild.refinement_flag(), Elem::COARSEN);
217  mychild.set_refinement_flag(Elem::INACTIVE);
218  if (mychild.p_level() > parent_p_level)
219  parent_p_level = mychild.p_level();
220  }
221 
223  this->set_p_level(parent_p_level);
224 
225  libmesh_assert (this->active());
226 }

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::Elem::refinement_flag(), libMesh::remote_elem, libMesh::Elem::set_p_level(), and libMesh::Elem::set_refinement_flag().

◆ 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 2691 of file elem.h.

2693 {
2694  // Order the two so that n0 < n1
2695  if (n0 > n1) std::swap (n0, n1);
2696 
2697  return Utility::hashword2(n0, n1);
2698 }

References libMesh::Utility::hashword2(), and swap().

◆ 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 2703 of file elem.h.

2706 {
2707  // Order the numbers such that n0 < n1 < n2.
2708  // We'll do it in 3 steps like this:
2709  //
2710  // n0 n1 n2
2711  // min(n0,n1) max(n0,n1) n2
2712  // min(n0,n1) min(n2,max(n0,n1) max(n2,max(n0,n1)
2713  // |\ /| |
2714  // | \ / | |
2715  // | / | |
2716  // | / \| |
2717  // gb min= min max gb max
2718 
2719  // Step 1
2720  if (n0 > n1) std::swap (n0, n1);
2721 
2722  // Step 2
2723  if (n1 > n2) std::swap (n1, n2);
2724 
2725  // Step 3
2726  if (n0 > n1) std::swap (n0, n1);
2727 
2728  libmesh_assert ((n0 < n1) && (n1 < n2));
2729 
2730  dof_id_type array[3] = {n0, n1, n2};
2731  return Utility::hashword(array, 3);
2732 }

References libMesh::Utility::hashword(), libMesh::libmesh_assert(), and swap().

◆ 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 2737 of file elem.h.

2741 {
2742  // Sort first
2743  // Step 1
2744  if (n0 > n1) std::swap (n0, n1);
2745 
2746  // Step 2
2747  if (n2 > n3) std::swap (n2, n3);
2748 
2749  // Step 3
2750  if (n0 > n2) std::swap (n0, n2);
2751 
2752  // Step 4
2753  if (n1 > n3) std::swap (n1, n3);
2754 
2755  // Finally sort step 5
2756  if (n1 > n2) std::swap (n1, n2);
2757 
2758  libmesh_assert ((n0 < n1) && (n1 < n2) && (n2 < n3));
2759 
2760  dof_id_type array[4] = {n0, n1, n2, n3};
2761  return Utility::hashword(array, 4);
2762 }

References libMesh::Utility::hashword(), libMesh::libmesh_assert(), and swap().

◆ connectivity()

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

Implements libMesh::Elem.

Definition at line 104 of file remote_elem.h.

107  { libmesh_not_implemented(); }

◆ 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 539 of file elem.C.

540 {
541  unsigned int num_contained_edges = 0;
542 
543  // Our vertices are the first numbered nodes
544  for (auto n : IntRange<unsigned int>(0, e->n_vertices()))
545  {
546  if (this->contains_point(e->point(n)))
547  {
548  num_contained_edges++;
549  if (num_contained_edges>=2)
550  {
551  return true;
552  }
553  }
554  }
555  return false;
556 }

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

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

◆ contains_point()

bool libMesh::Elem::contains_point ( const Point p,
Real  tol = TOLERANCE 
) const
virtualinherited
Returns
true if the 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::InfHex, libMesh::InfPrism, libMesh::InfQuad4, libMesh::Tet4, and libMesh::Tri3.

Definition at line 2094 of file elem.C.

2095 {
2096  // We currently allow the user to enlarge the bounding box by
2097  // providing a tol > TOLERANCE (so this routine is identical to
2098  // Elem::close_to_point()), but print a warning so that the
2099  // user can eventually switch his code over to calling close_to_point()
2100  // instead, which is intended to be used for this purpose.
2101  if (tol > TOLERANCE)
2102  {
2103  libmesh_do_once(libMesh::err
2104  << "WARNING: Resizing bounding box to match user-specified tolerance!\n"
2105  << "In the future, calls to Elem::contains_point() with tol > TOLERANCE\n"
2106  << "will be more optimized, but should not be used\n"
2107  << "to search for points 'close to' elements!\n"
2108  << "Instead, use Elem::close_to_point() for this purpose.\n"
2109  << std::endl;);
2110  return this->point_test(p, tol, tol);
2111  }
2112  else
2113  return this->point_test(p, TOLERANCE, tol);
2114 }

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::PointLocatorTree::operator()(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), NavierSystem::side_constraint(), RationalMapTest< elem_type >::testContainsPoint(), FETest< order, family, elem_type >::testGradU(), FETest< order, family, elem_type >::testGradUComp(), PointLocatorTest::testLocator(), and FETest< order, family, elem_type >::testU().

◆ contains_vertex_of()

bool libMesh::Elem::contains_vertex_of ( const Elem e) const
inherited
Returns
true if a vertex of e is contained in this element.

Definition at line 528 of file elem.C.

529 {
530  // Our vertices are the first numbered nodes
531  for (auto n : IntRange<unsigned int>(0, e->n_vertices()))
532  if (this->contains_point(e->point(n)))
533  return true;
534  return false;
535 }

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

◆ 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 230 of file elem_refinement.C.

231 {
232  // Subactive elements get deleted entirely, not contracted
233  libmesh_assert (this->active());
234 
235  // Active contracted elements no longer can have children
236  delete [] _children;
237  _children = nullptr;
238 
239  if (this->refinement_flag() == Elem::JUST_COARSENED)
241 }

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().

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

◆ create()

const Elem & libMesh::RemoteElem::create ( )
static

Return a reference to the global RemoteElem singleton object.

Definition at line 69 of file remote_elem.C.

70 {
71  if (remote_elem != nullptr)
72  return *remote_elem;
73 
74  RemoteElemMutex::scoped_lock lock(remote_elem_mtx);
75 
76  // check again - object could have been created while waiting
77  // for the lock to acquire!
78  if (remote_elem == nullptr)
79  remote_elem = new RemoteElem;
80 
81  return *remote_elem;
82 }

References libMesh::remote_elem, and RemoteElem().

◆ debug_buffer()

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

Print our buffer for debugging.

Definition at line 654 of file dof_object.C.

655 {
656  libMesh::out << " [ ";
657  for (const auto & idx : _idx_buf)
658  libMesh::out << idx << " ";
659  libMesh::out << "]\n";
660 }

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

◆ default_order()

virtual Order libMesh::RemoteElem::default_order ( ) const
inlineoverridevirtual
Returns
The default approximation order for this element type. This is the order that will be used to compute the map to the reference element.

Implements libMesh::Elem.

Definition at line 185 of file remote_elem.h.

186  { libmesh_not_implemented(); return static_cast<Order>(1); }

◆ dim()

virtual unsigned short libMesh::RemoteElem::dim ( ) const
inlineoverridevirtual
Returns
The dimensionality of the object.

Implements libMesh::Elem.

Definition at line 112 of file remote_elem.h.

113  { libmesh_not_implemented(); return 0; }

◆ disable_print_counter_info() [1/2]

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 106 of file reference_counter.C.

107 {
108  _enable_print_counter = false;
109  return;
110 }

References libMesh::ReferenceCounter::_enable_print_counter.

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

◆ disable_print_counter_info() [2/2]

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 106 of file reference_counter.C.

107 {
108  _enable_print_counter = false;
109  return;
110 }

References libMesh::ReferenceCounter::_enable_print_counter.

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

◆ 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 956 of file dof_object.h.

959 {
960  libmesh_assert_less (s, this->n_systems());
961  libmesh_assert_less (var, this->n_vars(s));
962  libmesh_assert_less (comp, this->n_comp(s,var));
963 
964  const std::pair<unsigned int, unsigned int>
965  vg_vig = this->var_to_vg_and_offset(s,var);
966 
967  const unsigned int
968  n_comp = this->n_comp_group(s,vg_vig.first);
969 
970  return this->dof_number(s, vg_vig.first, vg_vig.second,
971  comp, n_comp);
972 }

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::DynaIO::add_spline_constraints(), 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::ExodusII_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_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(), 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().

◆ 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 977 of file dof_object.h.

982 {
983  libmesh_assert_less (s, this->n_systems());
984  libmesh_assert_less (vg, this->n_var_groups(s));
985  libmesh_assert_less (vig, this->n_vars(s,vg));
986 
987  const unsigned int
988  start_idx_sys = this->start_idx(s);
989 
990  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
991 
992  const dof_id_type
993  base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
994 
995  // if the first component is invalid, they
996  // are all invalid
997  if (base_idx == invalid_id)
998  return invalid_id;
999 
1000  // otherwise the index is the first component
1001  // index augmented by the component number
1002  else
1003  return cast_int<dof_id_type>(base_idx + vig*n_comp + comp);
1004 }

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().

◆ 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 2179 of file elem.h.

2180 {
2181  return {0, cast_int<unsigned short>(this->n_edges())};
2182 }

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(), libMesh::Parallel::Packing< const Elem * >::pack(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ embedding_matrix()

virtual float libMesh::RemoteElem::embedding_matrix ( const unsigned int  ,
const unsigned int  ,
const unsigned int   
) const
inlineoverridevirtual

Matrix that transforms the parents nodes into the children's nodes.

Implements libMesh::Elem.

Definition at line 201 of file remote_elem.h.

204  { 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 1649 of file elem.h.

1649 { return 0; }

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

◆ 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 100 of file reference_counter.C.

101 {
102  _enable_print_counter = true;
103  return;
104 }

References libMesh::ReferenceCounter::_enable_print_counter.

◆ 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 100 of file reference_counter.C.

101 {
102  _enable_print_counter = true;
103  return;
104 }

References libMesh::ReferenceCounter::_enable_print_counter.

◆ end_idx()

unsigned int libMesh::DofObject::end_idx ( const unsigned int  s) const
inlineprivateinherited

The ending index for system s.

Definition at line 1172 of file dof_object.h.

1173 {
1174  libmesh_assert_less (s, this->n_systems());
1175  libmesh_assert_less (s, _idx_buf.size());
1176 
1177  return ((s+1) == this->n_pseudo_systems()) ?
1178  cast_int<unsigned int>(_idx_buf.size()) :
1179  cast_int<unsigned int>(_idx_buf[s+1]);
1180 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_pseudo_systems(), and libMesh::DofObject::n_systems().

Referenced by libMesh::DofObject::n_var_groups(), and libMesh::DofObject::set_n_vars_per_group().

◆ end_idx_ints()

unsigned int libMesh::DofObject::end_idx_ints ( ) const
inlineprivateinherited

The ending index for an extra_integers pseudosystem.

Definition at line 1199 of file dof_object.h.

1200 {
1202 
1203  return cast_int<unsigned int>(_idx_buf.size());
1204 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::has_extra_integers(), and libMesh::libmesh_assert().

◆ 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 1441 of file elem.C.

1443 {
1444  ElemInternal::family_tree(this, family, reset);
1445 }

References libMesh::ElemInternal::family_tree().

◆ 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 1449 of file elem.C.

1451 {
1452  ElemInternal::family_tree(this, family, reset);
1453 }

References libMesh::ElemInternal::family_tree().

◆ 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 1525 of file elem.C.

1528 {
1529  ElemInternal::family_tree_by_neighbor(this, family, neighbor, reset);
1530 }

References libMesh::ElemInternal::family_tree_by_neighbor().

◆ 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 1534 of file elem.C.

1537 {
1538  ElemInternal::family_tree_by_neighbor(this, family, neighbor, reset);
1539 }

References libMesh::ElemInternal::family_tree_by_neighbor().

◆ 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 1489 of file elem.C.

1492 {
1493  ElemInternal::family_tree_by_side(this, family, side, reset);
1494 }

References libMesh::ElemInternal::family_tree_by_side().

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

◆ 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 1498 of file elem.C.

1501 {
1502  ElemInternal::family_tree_by_side(this, family, side, reset);
1503 }

References libMesh::ElemInternal::family_tree_by_side().

◆ 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 1561 of file elem.C.

1565 {
1566  ElemInternal::family_tree_by_subneighbor(this, family, neighbor, subneighbor, reset);
1567 }

References libMesh::ElemInternal::family_tree_by_subneighbor().

◆ 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 1571 of file elem.C.

1575 {
1576  ElemInternal::family_tree_by_subneighbor(this, family, neighbor, subneighbor, reset);
1577 }

References libMesh::ElemInternal::family_tree_by_subneighbor().

◆ 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 646 of file elem.C.

649 {
650  // Simple but perhaps suboptimal code: find elements containing the
651  // first point, then winnow this set down by removing elements which
652  // don't also contain the second point
653 
654  libmesh_assert(this->contains_point(p2));
655  this->find_point_neighbors(p1, neighbor_set);
656 
657  std::set<const Elem *>::iterator it = neighbor_set.begin();
658  const std::set<const Elem *>::iterator end = neighbor_set.end();
659 
660  while (it != end)
661  {
662  // As of C++11, set::erase returns an iterator to the element
663  // following the erased element, or end.
664  if (!(*it)->contains_point(p2))
665  it = neighbor_set.erase(it);
666  else
667  ++it;
668  }
669 }

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

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

◆ 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 673 of file elem.C.

674 {
675  neighbor_set.clear();
676  neighbor_set.insert(this);
677 
678  std::set<const Elem *> untested_set, next_untested_set;
679  untested_set.insert(this);
680 
681  while (!untested_set.empty())
682  {
683  // Loop over all the elements in the patch that haven't already
684  // been tested
685  for (const auto & elem : untested_set)
686  {
687  for (auto current_neighbor : elem->neighbor_ptr_range())
688  {
689  if (current_neighbor &&
690  current_neighbor != remote_elem) // we have a real neighbor on this side
691  {
692  if (current_neighbor->active()) // ... if it is active
693  {
694  if (this->contains_edge_of(current_neighbor) // ... and touches us
695  || current_neighbor->contains_edge_of(this))
696  {
697  // Make sure we'll test it
698  if (!neighbor_set.count(current_neighbor))
699  next_untested_set.insert (current_neighbor);
700 
701  // And add it
702  neighbor_set.insert (current_neighbor);
703  }
704  }
705 #ifdef LIBMESH_ENABLE_AMR
706  else // ... the neighbor is *not* active,
707  { // ... so add *all* neighboring
708  // active children
709  std::vector<const Elem *> active_neighbor_children;
710 
711  current_neighbor->active_family_tree_by_neighbor
712  (active_neighbor_children, elem);
713 
714  for (const auto & current_child : active_neighbor_children)
715  if (this->contains_edge_of(current_child) || current_child->contains_edge_of(this))
716  {
717  // Make sure we'll test it
718  if (!neighbor_set.count(current_child))
719  next_untested_set.insert (current_child);
720 
721  neighbor_set.insert (current_child);
722  }
723  }
724 #endif // #ifdef LIBMESH_ENABLE_AMR
725  }
726  }
727  }
728  untested_set.swap(next_untested_set);
729  next_untested_set.clear();
730  }
731 }

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

◆ 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 735 of file elem.C.

736 {
737  ElemInternal::find_interior_neighbors(this, neighbor_set);
738 }

References libMesh::ElemInternal::find_interior_neighbors().

◆ 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 742 of file elem.C.

743 {
744  ElemInternal::find_interior_neighbors(this, neighbor_set);
745 }

References libMesh::ElemInternal::find_interior_neighbors().

◆ 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 560 of file elem.C.

562 {
563  libmesh_assert(this->contains_point(p));
564  libmesh_assert(this->active());
565 
566  neighbor_set.clear();
567  neighbor_set.insert(this);
568 
569  std::set<const Elem *> untested_set, next_untested_set;
570  untested_set.insert(this);
571 
572  while (!untested_set.empty())
573  {
574  // Loop over all the elements in the patch that haven't already
575  // been tested
576  for (const auto & elem : untested_set)
577  for (auto current_neighbor : elem->neighbor_ptr_range())
578  {
579  if (current_neighbor &&
580  current_neighbor != remote_elem) // we have a real neighbor on this side
581  {
582  if (current_neighbor->active()) // ... if it is active
583  {
584  if (current_neighbor->contains_point(p)) // ... and touches p
585  {
586  // Make sure we'll test it
587  if (!neighbor_set.count(current_neighbor))
588  next_untested_set.insert (current_neighbor);
589 
590  // And add it
591  neighbor_set.insert (current_neighbor);
592  }
593  }
594 #ifdef LIBMESH_ENABLE_AMR
595  else // ... the neighbor is *not* active,
596  { // ... so add *all* neighboring
597  // active children that touch p
598  std::vector<const Elem *> active_neighbor_children;
599 
600  current_neighbor->active_family_tree_by_neighbor
601  (active_neighbor_children, elem);
602 
603  for (const auto & current_child : active_neighbor_children)
604  if (current_child->contains_point(p))
605  {
606  // Make sure we'll test it
607  if (!neighbor_set.count(current_child))
608  next_untested_set.insert (current_child);
609 
610  neighbor_set.insert (current_child);
611  }
612  }
613 #endif // #ifdef LIBMESH_ENABLE_AMR
614  }
615  }
616  untested_set.swap(next_untested_set);
617  next_untested_set.clear();
618  }
619 }

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

Referenced by libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::Elem::find_edge_neighbors(), libMesh::MeshFunction::find_element(), libMesh::Elem::find_point_neighbors(), libMesh::ReplicatedMesh::get_boundary_points(), and libMesh::Elem::is_semilocal().

◆ 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 623 of file elem.C.

624 {
625  this->find_point_neighbors(neighbor_set, this);
626 }

References libMesh::Elem::find_point_neighbors().

◆ 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 630 of file elem.C.

632 {
633  ElemInternal::find_point_neighbors(this, neighbor_set, start_elem);
634 }

References libMesh::ElemInternal::find_point_neighbors().

◆ 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 638 of file elem.C.

640 {
641  ElemInternal::find_point_neighbors(this, neighbor_set, start_elem);
642 }

References libMesh::ElemInternal::find_point_neighbors().

◆ 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 2369 of file elem.C.

2370 {
2371  switch (et)
2372  {
2373  case NODEELEM:
2374  return NODEELEM;
2375  case EDGE2:
2376  case EDGE3:
2377  case EDGE4:
2378  return EDGE2;
2379  case TRI3:
2380  case TRI6:
2381  return TRI3;
2382  case TRISHELL3:
2383  return TRISHELL3;
2384  case QUAD4:
2385  case QUAD8:
2386  case QUAD9:
2387  return QUAD4;
2388  case QUADSHELL4:
2389  case QUADSHELL8:
2390  return QUADSHELL4;
2391  case TET4:
2392  case TET10:
2393  return TET4;
2394  case HEX8:
2395  case HEX27:
2396  case HEX20:
2397  return HEX8;
2398  case PRISM6:
2399  case PRISM15:
2400  case PRISM18:
2401  return PRISM6;
2402  case PYRAMID5:
2403  case PYRAMID13:
2404  case PYRAMID14:
2405  return PYRAMID5;
2406 
2407 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2408 
2409  case INFEDGE2:
2410  return INFEDGE2;
2411  case INFQUAD4:
2412  case INFQUAD6:
2413  return INFQUAD4;
2414  case INFHEX8:
2415  case INFHEX16:
2416  case INFHEX18:
2417  return INFHEX8;
2418  case INFPRISM6:
2419  case INFPRISM12:
2420  return INFPRISM6;
2421 
2422 #endif
2423 
2424  default:
2425  // unknown element
2426  return INVALID_ELEM;
2427  }
2428 }

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::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, and libMesh::TRISHELL3.

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

◆ 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 1062 of file dof_object.h.

1063 {
1064 #ifndef NDEBUG
1065  const unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
1066 #endif
1067  libmesh_assert_less(index+n_more_integers, this->n_extra_integers());
1068  libmesh_assert_less(this->n_systems(), _idx_buf.size());
1069 
1070  const unsigned int start_idx_i = this->start_idx_ints();
1071 
1072  libmesh_assert_less(start_idx_i+index+n_more_integers, _idx_buf.size());
1073  T returnval;
1074  std::memcpy(&returnval, &_idx_buf[start_idx_i+index], sizeof(T));
1075  return returnval;
1076 }

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

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

◆ 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 1026 of file dof_object.h.

1027 {
1028  libmesh_assert_less(index, this->n_extra_integers());
1029  libmesh_assert_less(this->n_systems(), _idx_buf.size());
1030 
1031  const unsigned int start_idx_i = this->start_idx_ints();
1032 
1033  libmesh_assert_less(start_idx_i+index, _idx_buf.size());
1034  return _idx_buf[start_idx_i+index];
1035 }

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

Referenced by libMesh::CheckpointIO::read_connectivity(), libMesh::DofObject::set_n_vars_per_group(), DofObjectTest< Node >::testAddExtraData(), DofObjectTest< Node >::testAddSystemExtraInts(), DofObjectTest< Node >::testSetNSystemsExtraInts(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

◆ 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.

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 & pr : _counts)
59  {
60  const std::string name(pr.first);
61  const unsigned int creations = pr.second.first;
62  const unsigned int destructions = pr.second.second;
63 
64  oss << "| " << name << " reference count information:\n"
65  << "| Creations: " << creations << '\n'
66  << "| Destructions: " << destructions << '\n';
67  }
68 
69  oss << " ---------------------------------------------------------------------------- \n";
70 
71  return oss.str();
72 
73 #else
74 
75  return "";
76 
77 #endif
78 }

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

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

◆ 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.

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 & pr : _counts)
59  {
60  const std::string name(pr.first);
61  const unsigned int creations = pr.second.first;
62  const unsigned int destructions = pr.second.second;
63 
64  oss << "| " << name << " reference count information:\n"
65  << "| Creations: " << creations << '\n'
66  << "| Destructions: " << destructions << '\n';
67  }
68 
69  oss << " ---------------------------------------------------------------------------- \n";
70 
71  return oss.str();
72 
73 #else
74 
75  return "";
76 
77 #endif
78 }

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

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

◆ get_info() [3/3]

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

Prints relevant information about the element to a string.

Definition at line 2233 of file elem.C.

2234 {
2235  std::ostringstream oss;
2236 
2237  oss << " Elem Information" << '\n'
2238  << " id()=";
2239 
2240  if (this->valid_id())
2241  oss << this->id();
2242  else
2243  oss << "invalid";
2244 
2245 #ifdef LIBMESH_ENABLE_UNIQUE_ID
2246  oss << ", unique_id()=";
2247  if (this->valid_unique_id())
2248  oss << this->unique_id();
2249  else
2250  oss << "invalid";
2251 #endif
2252 
2253  oss << ", processor_id()=" << this->processor_id() << '\n';
2254 
2255  oss << " type()=" << Utility::enum_to_string(this->type()) << '\n'
2256  << " dim()=" << this->dim() << '\n'
2257  << " n_nodes()=" << this->n_nodes() << '\n';
2258 
2259  for (auto n : this->node_index_range())
2260  oss << " " << n << this->node_ref(n);
2261 
2262  oss << " n_sides()=" << this->n_sides() << '\n';
2263 
2264  for (auto s : this->side_index_range())
2265  {
2266  oss << " neighbor(" << s << ")=";
2267  if (this->neighbor_ptr(s))
2268  oss << this->neighbor_ptr(s)->id() << '\n';
2269  else
2270  oss << "nullptr\n";
2271  }
2272 
2273 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2274  if (!this->infinite())
2275  {
2276 #endif
2277  oss << " hmin()=" << this->hmin()
2278  << ", hmax()=" << this->hmax() << '\n'
2279  << " volume()=" << this->volume() << '\n';
2280 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2281  }
2282 #endif
2283  oss << " active()=" << this->active()
2284  << ", ancestor()=" << this->ancestor()
2285  << ", subactive()=" << this->subactive()
2286  << ", has_children()=" << this->has_children() << '\n'
2287  << " parent()=";
2288  if (this->parent())
2289  oss << this->parent()->id() << '\n';
2290  else
2291  oss << "nullptr\n";
2292  oss << " level()=" << this->level()
2293  << ", p_level()=" << this->p_level() << '\n'
2294 #ifdef LIBMESH_ENABLE_AMR
2295  << " refinement_flag()=" << Utility::enum_to_string(this->refinement_flag()) << '\n'
2296  << " p_refinement_flag()=" << Utility::enum_to_string(this->p_refinement_flag()) << '\n'
2297 #endif
2298 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2299  << " infinite()=" << this->infinite() << '\n';
2300  if (this->infinite())
2301  oss << " origin()=" << this->origin() << '\n'
2302 #endif
2303  ;
2304 
2305  oss << " DoFs=";
2306  for (auto s : IntRange<unsigned int>(0, this->n_systems()))
2307  for (auto v : IntRange<unsigned int>(0, this->n_vars(s)))
2308  for (auto c : IntRange<unsigned int>(0, this->n_comp(s,v)))
2309  oss << '(' << s << '/' << v << '/' << this->dof_number(s,v,c) << ") ";
2310 
2311 
2312  return oss.str();
2313 }

References libMesh::Elem::active(), libMesh::Elem::ancestor(), libMesh::Elem::dim(), libMesh::DofObject::dof_number(), libMesh::Utility::enum_to_string(), libMesh::Elem::has_children(), libMesh::Elem::hmax(), libMesh::Elem::hmin(), libMesh::DofObject::id(), libMesh::Elem::infinite(), libMesh::Elem::level(), 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::Elem::refinement_flag(), libMesh::Elem::side_index_range(), libMesh::Elem::subactive(), 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().

◆ 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_id if node_ptr is not a local node.

Definition at line 2047 of file elem.h.

2048 {
2049  for (auto n : IntRange<unsigned int>(0, this->n_nodes()))
2050  if (this->_nodes[n] == node_ptr)
2051  return n;
2052 
2053  return libMesh::invalid_uint;
2054 }

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

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

◆ get_nodes()

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

Definition at line 2001 of file elem.h.

2002 {
2003  return _nodes;
2004 }

References libMesh::Elem::_nodes.

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

◆ 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 2668 of file elem.h.

2669 {
2670  if (p == 0)
2671  libmesh_assert_not_equal_to
2673 
2674  _p_level = cast_int<unsigned char>(p);
2675 }

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

Referenced by libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::HPCoarsenTest::select_refinement(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ has_affine_map()

virtual bool libMesh::Elem::has_affine_map ( ) const
inlinevirtualinherited
Returns
true if the element map is definitely affine (i.e. the same at every quadrature point) within numerical tolerances.

Reimplemented in libMesh::NodeElem, libMesh::Pyramid14, libMesh::Prism15, libMesh::Prism18, libMesh::Pyramid13, libMesh::Hex20, libMesh::Hex27, libMesh::Tet10, libMesh::Tet4, libMesh::Tri6, libMesh::Hex8, libMesh::Quad8, libMesh::Quad9, libMesh::Tri3, libMesh::Edge4, libMesh::Prism6, libMesh::Pyramid5, libMesh::Edge3, libMesh::Quad4, libMesh::Edge2, and libMesh::Tri3Subdivision.

Definition at line 938 of file elem.h.

938 { return false; }

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

◆ 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 2397 of file elem.h.

2398 {
2399 #ifdef LIBMESH_ENABLE_AMR
2400  if (_children == nullptr)
2401  return false;
2402  else
2403  for (auto & c : child_ref_range())
2404  if (c.has_children())
2405  return true;
2406 #endif
2407  return false;
2408 }

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

◆ 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 1138 of file dof_object.h.

1139 {
1140  if (sys == libMesh::invalid_uint)
1141  {
1142  for (auto s : IntRange<unsigned int>(0, this->n_systems()))
1143  if (this->n_vars(s))
1144  return true;
1145  }
1146 
1147  else
1148  {
1149  libmesh_assert_less (sys, this->n_systems());
1150 
1151  if (this->n_vars(sys))
1152  return true;
1153  }
1154 
1155  return false;
1156 }

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

Referenced by libMesh::DofMap::old_dof_indices(), and libMesh::Parallel::Packing< Node * >::unpack().

◆ has_extra_integers()

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

◆ 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 2115 of file elem.h.

2116 {
2117  for (auto n : this->neighbor_ptr_range())
2118  if (n == elem)
2119  return true;
2120 
2121  return false;
2122 }

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().

◆ 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 902 of file elem.C.

906 {
907  // First see if this is a normal "interior" neighbor
908  if (has_neighbor(elem))
909  return true;
910 
911  for (auto n : this->side_index_range())
912  if (this->topological_neighbor(n, mesh, point_locator, pb))
913  return true;
914 
915  return false;
916 }

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

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

◆ hmax()

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

Definition at line 379 of file elem.C.

380 {
381  Real h_max=0;
382 
383  // Avoid calling a virtual a lot of times
384  const auto n_vertices = this->n_vertices();
385 
386  for (unsigned int n_outer=0; n_outer<n_vertices; n_outer++)
387  for (unsigned int n_inner=n_outer+1; n_inner<n_vertices; n_inner++)
388  {
389  const auto diff = (this->point(n_outer) - this->point(n_inner));
390 
391  h_max = std::max(h_max, diff.norm_sq());
392  }
393 
394  return std::sqrt(h_max);
395 }

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

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().

◆ hmin()

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

Definition at line 359 of file elem.C.

360 {
361  Real h_min=std::numeric_limits<Real>::max();
362 
363  // Avoid calling a virtual a lot of times
364  const auto n_vertices = this->n_vertices();
365 
366  for (unsigned int n_outer=0; n_outer<n_vertices; n_outer++)
367  for (unsigned int n_inner=n_outer+1; n_inner<n_vertices; n_inner++)
368  {
369  const auto diff = (this->point(n_outer) - this->point(n_inner));
370 
371  h_min = std::min(h_min, diff.norm_sq());
372  }
373 
374  return std::sqrt(h_min);
375 }

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

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

◆ id()

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

Definition at line 767 of file dof_object.h.

768 {
769  libmesh_assert (this->valid_id());
770  return _id;
771 }

References libMesh::DofObject::_id, libMesh::libmesh_assert(), and libMesh::DofObject::valid_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::DistributedMesh::add_point(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), assemble_ellipticdg(), assemble_SchroedingerEquation(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), compute_jacobian(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), compute_residual(), libMesh::FEMap::compute_single_point_map(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::ReplicatedMesh::delete_elem(), libMesh::DistributedMesh::delete_elem(), libMesh::ReplicatedMesh::delete_node(), libMesh::DistributedMesh::delete_node(), libMesh::DistributedMesh::DistributedMesh(), 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::DofMap::get_local_constraints(), libMesh::ParmetisPartitioner::initialize(), libMesh::TreeNode< N >::insert(), libMesh::ReplicatedMesh::insert_elem(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_node(), libMesh::FEMap::inverse_map(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::Tri3Subdivision::local_node_number(), main(), LinearElasticityWithContact::move_mesh(), libMesh::Elem::node_id(), libMesh::VTKIO::nodes_to_vtk(), libMesh::CompareElemIdsByLevel::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::DistributedMesh::own_node(), libMesh::Parallel::Packing< const Node * >::pack(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::MetisPartitioner::partition_range(), libMesh::DofObject::print_dof_info(), libMesh::DistributedMesh::query_elem_ptr(), libMesh::DistributedMesh::query_node_ptr(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::AbaqusIO::read_elements(), libMesh::DynaIO::read_mesh(), libMesh::DistributedMesh::renumber_elem(), libMesh::DistributedMesh::renumber_node(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::DofMap::scatter_constraints(), libMesh::DofMap::set_nonlocal_dof_objects(), 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(), DefaultCouplingTest::testCoupling(), MixedDimensionMeshTest::testPointLocatorTree(), DofObjectTest< Node >::testSetId(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::GmshIO::write_mesh(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), and libMesh::XdrIO::write_serialized_nodes().

◆ increment_constructor_count() [1/2]

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

Increments the construction counter.

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

Definition at line 181 of file reference_counter.h.

182 {
183  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
184  std::pair<unsigned int, unsigned int> & p = _counts[name];
185 
186  p.first++;
187 }

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

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

◆ increment_constructor_count() [2/2]

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

Increments the construction counter.

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

Definition at line 181 of file reference_counter.h.

182 {
183  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
184  std::pair<unsigned int, unsigned int> & p = _counts[name];
185 
186  p.first++;
187 }

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

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

◆ increment_destructor_count() [1/2]

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

Increments the destruction counter.

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

Definition at line 194 of file reference_counter.h.

195 {
196  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
197  std::pair<unsigned int, unsigned int> & p = _counts[name];
198 
199  p.second++;
200 }

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

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

◆ increment_destructor_count() [2/2]

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

Increments the destruction counter.

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

Definition at line 194 of file reference_counter.h.

195 {
196  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
197  std::pair<unsigned int, unsigned int> & p = _counts[name];
198 
199  p.second++;
200 }

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

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

◆ infinite()

virtual bool libMesh::RemoteElem::infinite ( ) const
inlineoverridevirtual
Returns
true if the element is an infinite element, false otherwise.

Implements libMesh::Elem.

Definition at line 190 of file remote_elem.h.

191  { libmesh_not_implemented(); return false; }

◆ interior_parent() [1/2]

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

Definition at line 784 of file elem.C.

785 {
786  // See the const version for comments
787  libmesh_assert_less (this->dim(), LIBMESH_DIM);
788  Elem * interior_p = _elemlinks[1+this->n_sides()];
789 
790  libmesh_assert (!interior_p ||
791  (interior_p == remote_elem) ||
792  (interior_p->dim() > this->dim()));
793  if (interior_p && (interior_p != remote_elem))
794  libmesh_assert_less_equal (interior_p->level(), this->level());
795 
796  return interior_p;
797 }

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

◆ interior_parent() [2/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 is not safe to call if this->dim() == LIBMESH_DIM; in such cases no data storage for an interior parent pointer has been allocated.

Definition at line 749 of file elem.C.

750 {
751  // interior parents make no sense for full-dimensional elements.
752  libmesh_assert_less (this->dim(), LIBMESH_DIM);
753 
754  // they USED TO BE only good for level-0 elements, but we now
755  // support keeping interior_parent() valid on refined boundary
756  // elements.
757  // if (this->level() != 0)
758  // return this->parent()->interior_parent();
759 
760  // We store the interior_parent pointer after both the parent
761  // neighbor and neighbor pointers
762  Elem * interior_p = _elemlinks[1+this->n_sides()];
763 
764  // If we have an interior_parent, we USED TO assume it was a
765  // one-higher-dimensional interior element, but we now allow e.g.
766  // edge elements to have a 3D interior_parent with no
767  // intermediate 2D element.
768  // libmesh_assert (!interior_p ||
769  // interior_p->dim() == (this->dim()+1));
770  libmesh_assert (!interior_p ||
771  (interior_p == remote_elem) ||
772  (interior_p->dim() > this->dim()));
773 
774  // We require consistency between AMR of interior and of boundary
775  // elements
776  if (interior_p && (interior_p != remote_elem))
777  libmesh_assert_less_equal (interior_p->level(), this->level());
778 
779  return interior_p;
780 }

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

Referenced by libMesh::UnstructuredMesh::find_neighbors(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::Parallel::Packing< const Elem * >::pack(), BoundaryMeshTest::sanityCheck(), MixedDimensionMeshTest::testMesh(), MixedDimensionNonUniformRefinement::testMesh(), MixedDimensionNonUniformRefinementTriangle::testMesh(), MixedDimensionNonUniformRefinement3D::testMesh(), libMesh::BoundaryVolumeSolutionTransfer::transfer_boundary_volume(), libMesh::BoundaryVolumeSolutionTransfer::transfer_volume_boundary(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ invalidate()

void libMesh::DofObject::invalidate ( )
inlineinherited

Invalidates all the indices for this DofObject.

Definition at line 727 of file dof_object.h.

728 {
729  this->invalidate_dofs ();
730  this->invalidate_id ();
731  this->invalidate_processor_id ();
732 }

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

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

◆ 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 690 of file dof_object.h.

691 {
692  const unsigned int n_sys = this->n_systems();
693  // If the user does not specify the system number...
694  if (sys_num >= n_sys)
695  {
696  for (auto s : IntRange<unsigned int>(0, n_sys))
697  for (auto vg : IntRange<unsigned int>(0, this->n_var_groups(s)))
698  if (this->n_comp_group(s,vg))
699  this->set_vg_dof_base(s,vg,invalid_id);
700  }
701  // ...otherwise invalidate the dofs for all systems
702  else
703  for (auto vg : IntRange<unsigned int>(0, this->n_var_groups(sys_num)))
704  if (this->n_comp_group(sys_num,vg))
705  this->set_vg_dof_base(sys_num,vg,invalid_id);
706 }

References libMesh::DofObject::invalid_id, 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().

◆ invalidate_id()

void libMesh::DofObject::invalidate_id ( )
inlineinherited

Sets the id to invalid_id.

Definition at line 711 of file dof_object.h.

712 {
713  this->set_id (invalid_id);
714 }

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

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

◆ invalidate_processor_id()

void libMesh::DofObject::invalidate_processor_id ( )
inlineinherited

◆ 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 2413 of file elem.h.

2418 {
2419 #ifdef LIBMESH_ENABLE_AMR
2420  const Elem * e = descendant;
2421  while (e)
2422  {
2423  if (this == e)
2424  return true;
2425  e = e->parent();
2426  }
2427 #endif
2428  return false;
2429 }

References libMesh::Elem::parent().

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

◆ 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 1646 of file elem.C.

1648 {
1649  libmesh_assert_less (c, this->n_children());
1650  libmesh_assert_less (e, this->n_edges());
1651 
1652  std::unique_ptr<const Elem> my_edge = this->build_edge_ptr(e);
1653  std::unique_ptr<const Elem> child_edge = this->build_edge_ptr(e);
1654 
1655  // We're assuming that an overlapping child edge has the same
1656  // number and orientation as its parent
1657  return (child_edge->node_id(0) == my_edge->node_id(0) ||
1658  child_edge->node_id(1) == my_edge->node_id(1));
1659 }

References libMesh::Elem::build_edge_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()().

◆ is_child_on_side()

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

Implements libMesh::Elem.

Definition at line 152 of file remote_elem.h.

154  { libmesh_not_implemented(); return false; }

◆ is_edge()

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

Implements libMesh::Elem.

Definition at line 136 of file remote_elem.h.

137  { libmesh_not_implemented(); return false; }

◆ is_edge_on_side()

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

Implements libMesh::Elem.

Definition at line 156 of file remote_elem.h.

158  { libmesh_not_implemented(); return false; }

◆ is_face()

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

Implements libMesh::Elem.

Definition at line 139 of file remote_elem.h.

140  { libmesh_not_implemented(); return false; }

◆ 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 944 of file elem.h.

944 { return false; }

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

◆ 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::InfQuad, libMesh::InfPrism, libMesh::InfHex, and libMesh::InfEdge2.

Definition at line 1584 of file elem.h.

1585  { libmesh_assert (!this->infinite()); return false; }

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

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

◆ is_node_on_edge()

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

Implements libMesh::Elem.

Definition at line 160 of file remote_elem.h.

162  { libmesh_not_implemented(); return false; }

◆ is_node_on_side()

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

Implements libMesh::Elem.

Definition at line 142 of file remote_elem.h.

144  { libmesh_not_implemented(); return false; }

◆ is_remote()

virtual bool libMesh::RemoteElem::is_remote ( ) const
inlineoverridevirtual
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 from libMesh::Elem.

Definition at line 101 of file remote_elem.h.

102  { return true; }

◆ 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.

Definition at line 460 of file elem.C.

461 {
462  std::set<const Elem *> point_neighbors;
463 
464  this->find_point_neighbors(point_neighbors);
465 
466  for (const auto & elem : point_neighbors)
467  if (elem->processor_id() == my_pid)
468  return true;
469 
470  return false;
471 }

References libMesh::Elem::find_point_neighbors().

◆ is_vertex()

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

Implements libMesh::Elem.

Definition at line 133 of file remote_elem.h.

134  { libmesh_not_implemented(); return false; }

◆ is_vertex_on_child()

virtual unsigned int 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 681 of file elem.h.

683  { return this->is_vertex(n); }

References libMesh::Elem::is_vertex().

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

◆ 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 2671 of file elem.C.

2673 {
2674 #ifdef LIBMESH_ENABLE_AMR
2675 
2676  unsigned int my_n_vertices = this->n_vertices();
2677  for (unsigned int n_parent = 0; n_parent != my_n_vertices;
2678  ++n_parent)
2679  if (this->node_ptr(n_parent) == this->child_ptr(c)->node_ptr(n))
2680  return true;
2681  return false;
2682 
2683 #else
2684 
2685  // No AMR?
2686  libmesh_ignore(c,n);
2687  libmesh_error_msg("ERROR: AMR disabled, how did we get here?");
2688  return true;
2689 
2690 #endif
2691 }

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()().

◆ key() [1/4]

dof_id_type libMesh::Elem::key

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

Definition at line 410 of file elem.C.

411 {
412  const unsigned short n_n = this->n_nodes();
413 
414  std::array<dof_id_type, Elem::max_n_nodes> node_ids;
415 
416  for (unsigned short n=0; n != n_n; ++n)
417  node_ids[n] = this->node_id(n);
418 
419  // Always sort, so that different local node numberings hash to the
420  // same value.
421  std::sort (node_ids.begin(), node_ids.begin()+n_n);
422 
423  return Utility::hashword(node_ids.data(), n_n);
424 }

◆ key() [2/4]

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::Tri, libMesh::Tet4, libMesh::Edge3, libMesh::Edge4, libMesh::Edge2, libMesh::Quad9, and libMesh::Quad.

Definition at line 410 of file elem.C.

411 {
412  const unsigned short n_n = this->n_nodes();
413 
414  std::array<dof_id_type, Elem::max_n_nodes> node_ids;
415 
416  for (unsigned short n=0; n != n_n; ++n)
417  node_ids[n] = this->node_id(n);
418 
419  // Always sort, so that different local node numberings hash to the
420  // same value.
421  std::sort (node_ids.begin(), node_ids.begin()+n_n);
422 
423  return Utility::hashword(node_ids.data(), n_n);
424 }

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().

◆ key() [3/4]

virtual dof_id_type libMesh::Elem::key

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

◆ key() [4/4]

virtual dof_id_type libMesh::RemoteElem::key ( const unsigned int  s) const
inlineoverridevirtual
Returns
An id associated with the s side of this element. 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 94 of file remote_elem.h.

95  { libmesh_not_implemented(); return 0; }

◆ 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 399 of file elem.C.

401 {
402  libmesh_assert_less ( n1, this->n_vertices() );
403  libmesh_assert_less ( n2, this->n_vertices() );
404 
405  return (this->point(n1) - this->point(n2)).norm();
406 }

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

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

◆ 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 2478 of file elem.h.

2479 {
2480 #ifdef LIBMESH_ENABLE_AMR
2481 
2482  // if I don't have a parent I was
2483  // created directly from file
2484  // or by the user, so I am a
2485  // level-0 element
2486  if (this->parent() == nullptr)
2487  return 0;
2488 
2489  // if the parent and this element are of different
2490  // dimensionality we are at the same level as
2491  // the parent (e.g. we are the 2D side of a
2492  // 3D element)
2493  if (this->dim() != this->parent()->dim())
2494  return this->parent()->level();
2495 
2496  // otherwise we are at a level one
2497  // higher than our parent
2498  return (this->parent()->level() + 1);
2499 
2500 #else
2501 
2502  // Without AMR all elements are
2503  // at level 0.
2504  return 0;
2505 
2506 #endif
2507 }

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(), libMesh::UnstructuredMesh::all_second_order(), assemble_ellipticdg(), libMesh::BoundaryInfo::boundary_ids(), 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::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::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::Parallel::Packing< const Elem * >::pack(), libMesh::Parallel::Packing< const Elem * >::packable_size(), 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::ReplicatedMesh::stitching_helper(), libMesh::MeshRefinement::test_level_one(), libMesh::Elem::top_parent(), libMesh::Elem::topological_neighbor(), libMesh::Parallel::Packing< Elem * >::unpack(), and libMesh::Elem::which_neighbor_am_i().

◆ libmesh_assert_valid_neighbors()

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

Checks for consistent neighbor links on this element.

Definition at line 935 of file elem.C.

936 {
937  for (auto n : this->side_index_range())
938  {
939  const Elem * neigh = this->neighbor_ptr(n);
940 
941  // Any element might have a remote neighbor; checking
942  // to make sure that's not inaccurate is tough.
943  if (neigh == remote_elem)
944  continue;
945 
946  if (neigh)
947  {
948  // Only subactive elements have subactive neighbors
949  libmesh_assert (this->subactive() || !neigh->subactive());
950 
951  const Elem * elem = this;
952 
953  // If we're subactive but our neighbor isn't, its
954  // return neighbor link will be to our first active
955  // ancestor OR to our inactive ancestor of the same
956  // level as neigh,
957  if (this->subactive() && !neigh->subactive())
958  {
959  for (elem = this; !elem->active();
960  elem = elem->parent())
961  libmesh_assert(elem);
962  }
963  else
964  {
965  unsigned int rev = neigh->which_neighbor_am_i(elem);
966  libmesh_assert_less (rev, neigh->n_neighbors());
967 
968  if (this->subactive() && !neigh->subactive())
969  {
970  while (neigh->neighbor_ptr(rev) != elem)
971  {
972  libmesh_assert(elem->parent());
973  elem = elem->parent();
974  }
975  }
976  else
977  {
978  const Elem * nn = neigh->neighbor_ptr(rev);
979  libmesh_assert(nn);
980 
981  for (; elem != nn; elem = elem->parent())
982  libmesh_assert(elem);
983  }
984  }
985  }
986  // If we don't have a neighbor and we're not subactive, our
987  // ancestors shouldn't have any neighbors in this same
988  // direction.
989  else if (!this->subactive())
990  {
991  const Elem * my_parent = this->parent();
992  if (my_parent &&
993  // A parent with a different dimension isn't really one of
994  // our ancestors, it means we're on a boundary mesh and this
995  // is an interior mesh element for which we're on a side.
996  // Nothing to test for in that case.
997  (my_parent->dim() == this->dim()))
998  libmesh_assert (!my_parent->neighbor_ptr(n));
999  }
1000  }
1001 }

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().

◆ 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 923 of file elem.C.

924 {
925  libmesh_assert(this->valid_id());
926  for (auto n : this->node_index_range())
927  {
928  libmesh_assert(this->node_ptr(n));
929  libmesh_assert(this->node_ptr(n)->valid_id());
930  }
931 }

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

◆ 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 1989 of file elem.h.

1990 {
1991  for (auto n : IntRange<unsigned int>(0, this->n_nodes()))
1992  if (this->node_id(n) == i)
1993  return n;
1994 
1995  return libMesh::invalid_uint;
1996 }

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

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

◆ loose_bounding_box()

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

The base class implementation determines a bounding box for the element nodes, which should be sufficient for first order finite elements. Higher order geometric elements will need to override with an implementation which takes curved elements into account.

Reimplemented in libMesh::Quad9, libMesh::Tri6, libMesh::Quad8, libMesh::Hex8, libMesh::Prism6, libMesh::Tri3, libMesh::Pyramid5, libMesh::Edge3, libMesh::Quad4, libMesh::Edge4, and libMesh::Cell.

Definition at line 2649 of file elem.C.

2650 {
2651  Point pmin = this->point(0);
2652  Point pmax = pmin;
2653 
2654  unsigned int n_points = this->n_nodes();
2655  for (unsigned int p=0; p != n_points; ++p)
2656  for (unsigned d=0; d<LIBMESH_DIM; ++d)
2657  {
2658  const Point & pt = this->point(p);
2659  if (pmin(d) > pt(d))
2660  pmin(d) = pt(d);
2661 
2662  if (pmax(d) < pt(d))
2663  pmax(d) = pt(d);
2664  }
2665 
2666  return BoundingBox(pmin, pmax);
2667 }

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

Referenced by libMesh::TreeNode< N >::insert(), libMesh::Quad4::loose_bounding_box(), libMesh::Pyramid5::loose_bounding_box(), libMesh::Tri3::loose_bounding_box(), libMesh::Prism6::loose_bounding_box(), and libMesh::Hex8::loose_bounding_box().

◆ 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 1007 of file elem.C.

1008 {
1009  Elem * neigh = this->neighbor_ptr(n);
1010 
1011  // Don't bother calling this function unless it's necessary
1012  libmesh_assert(neigh);
1013  libmesh_assert(!neigh->is_remote());
1014 
1015  // We never have neighbors more refined than us
1016  libmesh_assert_less_equal (neigh->level(), this->level());
1017 
1018  // We never have subactive neighbors of non subactive elements
1019  libmesh_assert(!neigh->subactive() || this->subactive());
1020 
1021  // If we have a neighbor less refined than us then it must not
1022  // have any more refined descendants we could have pointed to
1023  // instead.
1024  libmesh_assert((neigh->level() == this->level()) ||
1025  (neigh->active() && !this->subactive()) ||
1026  (!neigh->has_children() && this->subactive()));
1027 
1028  // If neigh is at our level, then its family might have
1029  // remote_elem neighbor links which need to point to us
1030  // instead, but if not, then we're done.
1031  if (neigh->level() != this->level())
1032  return;
1033 
1034  // What side of neigh are we on? nn.
1035  //
1036  // We can't use the usual Elem method because we're in the middle of
1037  // restoring topology. We can't compare side_ptr nodes because
1038  // users want to abuse neighbor_ptr to point to
1039  // not-technically-neighbors across mesh slits. We can't compare
1040  // node locations because users want to move those
1041  // not-technically-neighbors until they're
1042  // not-even-geometrically-neighbors.
1043 
1044  // Find any elements that ought to point to elem
1045  std::vector<Elem *> neigh_family;
1046 #ifdef LIBMESH_ENABLE_AMR
1047  if (this->active())
1048  neigh->family_tree_by_side(neigh_family, nn);
1049  else
1050 #endif
1051  neigh_family.push_back(neigh);
1052 
1053  // And point them to elem
1054  for (auto & neigh_family_member : neigh_family)
1055  {
1056  // Only subactive elements point to other subactive elements
1057  if (this->subactive() && !neigh_family_member->subactive())
1058  continue;
1059 
1060  // Ideally, the neighbor link ought to either be correct
1061  // already or ought to be to remote_elem.
1062  //
1063  // However, if we're redistributing a newly created elem,
1064  // after an AMR step but before find_neighbors has fixed up
1065  // neighbor links, we might have an out of date neighbor
1066  // link to elem's parent instead.
1067 #ifdef LIBMESH_ENABLE_AMR
1068  libmesh_assert((neigh_family_member->neighbor_ptr(nn) &&
1069  (neigh_family_member->neighbor_ptr(nn)->active() ||
1070  neigh_family_member->neighbor_ptr(nn)->is_ancestor_of(this))) ||
1071  (neigh_family_member->neighbor_ptr(nn) == remote_elem) ||
1072  ((this->refinement_flag() == JUST_REFINED) &&
1073  (this->parent() != nullptr) &&
1074  (neigh_family_member->neighbor_ptr(nn) == this->parent())));
1075 #else
1076  libmesh_assert((neigh_family_member->neighbor_ptr(nn) == this) ||
1077  (neigh_family_member->neighbor_ptr(nn) == remote_elem));
1078 #endif
1079 
1080  neigh_family_member->set_neighbor(nn, this);
1081  }
1082 }

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().

Referenced by libMesh::Parallel::Packing< Elem * >::unpack().

◆ 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 1085 of file elem.C.

1086 {
1087  libmesh_assert_not_equal_to (this, remote_elem);
1088 
1089  // We need to have handled any children first
1090 #if defined(LIBMESH_ENABLE_AMR) && defined(DEBUG)
1091  if (this->has_children())
1092  for (auto & child : this->child_ref_range())
1093  libmesh_assert_equal_to (&child, remote_elem);
1094 #endif
1095 
1096  // Remotify any neighbor links
1097  for (auto neigh : this->neighbor_ptr_range())
1098  {
1099  if (neigh && neigh != remote_elem)
1100  {
1101  // My neighbor should never be more refined than me; my real
1102  // neighbor would have been its parent in that case.
1103  libmesh_assert_greater_equal (this->level(), neigh->level());
1104 
1105  if (this->level() == neigh->level() &&
1106  neigh->has_neighbor(this))
1107  {
1108 #ifdef LIBMESH_ENABLE_AMR
1109  // My neighbor may have descendants which also consider me a
1110  // neighbor
1111  std::vector<Elem *> family;
1112  neigh->total_family_tree_by_neighbor (family, this);
1113 
1114  // FIXME - There's a lot of ugly const_casts here; we
1115  // may want to make remote_elem non-const
1116  for (auto & n : family)
1117  {
1118  libmesh_assert (n);
1119  if (n == remote_elem)
1120  continue;
1121  unsigned int my_s = n->which_neighbor_am_i(this);
1122  libmesh_assert_less (my_s, n->n_neighbors());
1123  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1124  n->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1125  }
1126 #else
1127  unsigned int my_s = neigh->which_neighbor_am_i(this);
1128  libmesh_assert_less (my_s, neigh->n_neighbors());
1129  libmesh_assert_equal_to (neigh->neighbor_ptr(my_s), this);
1130  neigh->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1131 #endif
1132  }
1133 #ifdef LIBMESH_ENABLE_AMR
1134  // Even if my neighbor doesn't link back to me, it might
1135  // have subactive descendants which do
1136  else if (neigh->has_children())
1137  {
1138  // If my neighbor at the same level doesn't have me as a
1139  // neighbor, I must be subactive
1140  libmesh_assert(this->level() > neigh->level() ||
1141  this->subactive());
1142 
1143  // My neighbor must have some ancestor of mine as a
1144  // neighbor
1145  Elem * my_ancestor = this->parent();
1146  libmesh_assert(my_ancestor);
1147  while (!neigh->has_neighbor(my_ancestor))
1148  {
1149  my_ancestor = my_ancestor->parent();
1150  libmesh_assert(my_ancestor);
1151  }
1152 
1153  // My neighbor may have descendants which consider me a
1154  // neighbor
1155  std::vector<Elem *> family;
1156  neigh->total_family_tree_by_subneighbor (family, my_ancestor, this);
1157 
1158  for (auto & n : family)
1159  {
1160  libmesh_assert (n);
1161  if (n->is_remote())
1162  continue;
1163  unsigned int my_s = n->which_neighbor_am_i(this);
1164  libmesh_assert_less (my_s, n->n_neighbors());
1165  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1166  // TODO: we may want to make remote_elem non-const.
1167  n->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1168  }
1169  }
1170 #endif
1171  }
1172  }
1173 
1174 #ifdef LIBMESH_ENABLE_AMR
1175  // Remotify parent's child link
1176  Elem * my_parent = this->parent();
1177  if (my_parent &&
1178  // As long as it's not already remote
1179  my_parent != remote_elem &&
1180  // And it's a real parent, not an interior parent
1181  this->dim() == my_parent->dim())
1182  {
1183  unsigned int me = my_parent->which_child_am_i(this);
1184  libmesh_assert_equal_to (my_parent->child_ptr(me), this);
1185  my_parent->set_child(me, const_cast<RemoteElem *>(remote_elem));
1186  }
1187 #endif
1188 }

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().

◆ mapping_data()

unsigned char libMesh::Elem::mapping_data ( ) const
inlineinherited
Returns
The value of the mapping data for the element.

Definition at line 2540 of file elem.h.

2541 {
2542  return _map_data;
2543 }

References libMesh::Elem::_map_data.

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

◆ mapping_type()

ElemMappingType libMesh::Elem::mapping_type ( ) const
inlineinherited

◆ master_point()

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

Implements libMesh::Elem.

Definition at line 83 of file remote_elem.h.

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

◆ 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 2650 of file elem.h.

2651 {
2652  // This is undefined for subactive elements,
2653  // which have no active descendants
2654  libmesh_assert (!this->subactive());
2655  if (this->active())
2656  return this->p_level();
2657 
2658  unsigned int max_p_level = _p_level;
2659  for (auto & c : child_ref_range())
2660  max_p_level = std::max(max_p_level,
2661  c.max_descendant_p_level());
2662  return max_p_level;
2663 }

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().

◆ 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 1692 of file elem.C.

1694 {
1695  libmesh_assert(!this->subactive());
1696  libmesh_assert(neighbor_in->active());
1697 
1698  // If we're an active element this is simple
1699  if (this->active())
1700  {
1701  unsigned int new_p_level = this->p_level();
1702  if (this->p_refinement_flag() == Elem::REFINE)
1703  new_p_level += 1;
1704  if (this->p_refinement_flag() == Elem::COARSEN)
1705  {
1706  libmesh_assert_greater (new_p_level, 0);
1707  new_p_level -= 1;
1708  }
1709  return std::min(current_min, new_p_level);
1710  }
1711 
1712  libmesh_assert(has_neighbor(neighbor_in));
1713 
1714  unsigned int min_p_level = current_min;
1715 
1716  for (auto & c : this->child_ref_range())
1717  if (&c != remote_elem && c.has_neighbor(neighbor_in))
1718  min_p_level =
1719  c.min_new_p_level_by_neighbor(neighbor_in, min_p_level);
1720 
1721  return min_p_level;
1722 }

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().

◆ 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 1663 of file elem.C.

1665 {
1666  libmesh_assert(!this->subactive());
1667  libmesh_assert(neighbor_in->active());
1668 
1669  // If we're an active element this is simple
1670  if (this->active())
1671  return std::min(current_min, this->p_level());
1672 
1673  libmesh_assert(has_neighbor(neighbor_in));
1674 
1675  // The p_level() of an ancestor element is already the minimum
1676  // p_level() of its children - so if that's high enough, we don't
1677  // need to examine any children.
1678  if (current_min <= this->p_level())
1679  return current_min;
1680 
1681  unsigned int min_p_level = current_min;
1682 
1683  for (auto & c : this->child_ref_range())
1684  if (&c != remote_elem && c.has_neighbor(neighbor_in))
1685  min_p_level =
1686  c.min_p_level_by_neighbor(neighbor_in, min_p_level);
1687 
1688  return min_p_level;
1689 }

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().

◆ n_children()

virtual unsigned int libMesh::RemoteElem::n_children ( ) const
inlineoverridevirtual
Returns
The number of children the element that has been derived from this class may have.

Implements libMesh::Elem.

Definition at line 130 of file remote_elem.h.

131  { libmesh_not_implemented(); return 0; }

◆ 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 926 of file dof_object.h.

928 {
929  libmesh_assert_less (s, this->n_systems());
930  libmesh_assert_less (var, this->n_vars(s));
931 
932  return this->n_comp_group(s,this->var_to_vg(s,var));
933 }

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::ExodusII_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::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::DofObject::operator=(), libMesh::DofObject::print_dof_info(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_vars_per_group(), and libMesh::DofMap::set_nonlocal_dof_objects().

◆ 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 939 of file dof_object.h.

941 {
942  libmesh_assert_less (s, this->n_systems());
943  libmesh_assert_less (vg, this->n_var_groups(s));
944 
945  const unsigned int
946  start_idx_sys = this->start_idx(s);
947 
948  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
949 
950  return (_idx_buf[start_idx_sys + 2*vg] % ncv_magic);
951 }

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().

◆ 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 for this object. Optionally only counts degrees of freedom for variable number var

Definition at line 745 of file dof_object.h.

747 {
748  libmesh_assert_less (s, this->n_systems());
749 
750  unsigned int num = 0;
751 
752  // Count all variables
753  if (var == libMesh::invalid_uint)
754  for (auto v : IntRange<unsigned int>(0, this->n_vars(s)))
755  num += this->n_comp(s,v);
756 
757  // Only count specified variable
758  else
759  num = this->n_comp(s,var);
760 
761  return num;
762 }

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

Referenced by libMesh::PetscDMWrapper::add_dofs_helper().

◆ n_edges()

virtual unsigned int libMesh::RemoteElem::n_edges ( ) const
inlineoverridevirtual
Returns
The number of edges the element that has been derived from this class has.

Implements libMesh::Elem.

Definition at line 124 of file remote_elem.h.

125  { libmesh_not_implemented(); return 0; }

◆ 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 1082 of file dof_object.h.

1083 {
1084  if (_idx_buf.empty())
1085  return 0;
1086 
1087  const int hdr = dof_id_signed_type(_idx_buf[0]);
1088  if (hdr >= 0)
1089  return 0;
1090 
1091  const unsigned int start_idx_i = this->start_idx_ints();
1092 
1093  return _idx_buf.size() - start_idx_i;
1094 }

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

Referenced by libMesh::DofObject::add_extra_integers(), libMesh::DofObject::get_extra_datum(), libMesh::DofObject::get_extra_integer(), libMesh::CheckpointIO::read_connectivity(), libMesh::CheckpointIO::read_nodes(), libMesh::Elem::refine(), 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().

◆ n_faces()

virtual unsigned int libMesh::RemoteElem::n_faces ( ) const
inlineoverridevirtual
Returns
The number of faces the element that has been derived from this class has.

Implements libMesh::Elem.

Definition at line 127 of file remote_elem.h.

128  { libmesh_not_implemented(); return 0; }

◆ 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 631 of file elem.h.

632  { return this->n_sides(); }

References libMesh::Elem::n_sides().

Referenced by libMesh::Elem::_last_side(), assemble_SchroedingerEquation(), 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(), and libMesh::Elem::topological_neighbor().

◆ n_nodes()

virtual unsigned int libMesh::RemoteElem::n_nodes ( ) const
inlineoverridevirtual
Returns
The number of nodes this element contains.

Implements libMesh::Elem.

Definition at line 115 of file remote_elem.h.

116  { libmesh_not_implemented(); return 0; }

◆ 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 600 of file elem.h.

601  { return this->n_nodes(); }

References libMesh::Elem::n_nodes().

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

◆ 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 83 of file reference_counter.h.

84  { return _n_objects; }

References libMesh::ReferenceCounter::_n_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 83 of file reference_counter.h.

84  { return _n_objects; }

References libMesh::ReferenceCounter::_n_objects.

◆ 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 871 of file dof_object.h.

872 {
873  const int hdr = _idx_buf.empty() ?
874  0 : cast_int<int>(dof_id_signed_type(_idx_buf[0]));
875  return std::abs(hdr);
876 }

References libMesh::DofObject::_idx_buf, and std::abs().

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

◆ n_second_order_adjacent_vertices()

unsigned int libMesh::Elem::n_second_order_adjacent_vertices ( const unsigned int  n) const
virtualinherited
Returns
The number of adjacent vertices that uniquely define the location of the \( n^{th} \) second-order node, or 0 for linear elements.

This method is useful when converting linear elements to quadratic elements.

Note
n has to be greater than or equal to this->n_vertices().

Reimplemented in libMesh::InfHex18, libMesh::Hex27, libMesh::Prism18, libMesh::InfHex16, libMesh::Hex20, libMesh::Prism15, libMesh::Tet10, libMesh::Tri6, libMesh::InfPrism12, libMesh::Quad8, libMesh::InfQuad6, libMesh::Edge4, libMesh::Edge3, libMesh::Pyramid14, libMesh::Pyramid13, and libMesh::Quad9.

Definition at line 2343 of file elem.C.

2344 {
2345  // for linear elements, always return 0
2346  return 0;
2347 }

Referenced by libMesh::UnstructuredMesh::all_second_order(), and libMesh::MeshTools::Modification::smooth().

◆ n_sides()

virtual unsigned int libMesh::RemoteElem::n_sides ( ) const
inlineoverridevirtual
Returns
The number of sides the element that has been derived from this class has. In 2D the number of sides is the number of edges, in 3D the number of sides is the number of faces.

Implements libMesh::Elem.

Definition at line 118 of file remote_elem.h.

119  { libmesh_not_implemented(); return 0; }

◆ n_sub_elem()

virtual unsigned int libMesh::RemoteElem::n_sub_elem ( ) const
inlineoverridevirtual
Returns
The number of sub-elements this element may be broken down into for visualization purposes. For example, 1 for a linear triangle, 4 for a quadratic (6-noded) triangle, etc...

Implements libMesh::Elem.

Definition at line 164 of file remote_elem.h.

165  { libmesh_not_implemented(); return 0; }

◆ n_systems()

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

Definition at line 861 of file dof_object.h.

862 {
863  const int hdr = _idx_buf.empty() ?
864  0 : cast_int<int>(dof_id_signed_type(_idx_buf[0]));
865  return hdr >= 0 ? hdr : (-hdr-1);
866 }

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().

◆ 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
inlineinherited
Returns
The number of Variable variables associated with system s for this DofObject

Definition at line 908 of file dof_object.h.

909 {
910  libmesh_assert_less (s, this->n_systems());
911 
912  const unsigned int nvg = this->n_var_groups(s);
913 
914  unsigned int val=0;
915 
916  for (unsigned int vg=0; vg<nvg; vg++)
917  val += this->n_vars(s,vg);
918 
919  return val;
920 }

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

◆ n_vars() [2/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 891 of file dof_object.h.

893 {
894  libmesh_assert_less (s, this->n_systems());
895  libmesh_assert_less (vg, this->n_var_groups(s));
896 
897  const unsigned int start_idx_sys = this->start_idx(s);
898 
899  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
900 
901  return (cast_int<unsigned int>
902  (_idx_buf[start_idx_sys + 2*vg]) >> ncv_magic_exp);
903 }

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::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().

◆ n_vertices()

virtual unsigned int libMesh::RemoteElem::n_vertices ( ) const
inlineoverridevirtual
Returns
The number of vertices the element that has been derived from this class has.

Implements libMesh::Elem.

Definition at line 121 of file remote_elem.h.

122  { libmesh_not_implemented(); return 0; }

◆ neighbor_ptr() [1/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 2095 of file elem.h.

2096 {
2097  libmesh_assert_less (i, this->n_neighbors());
2098 
2099  return _elemlinks[i+1];
2100 }

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

◆ neighbor_ptr() [2/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 2085 of file elem.h.

2086 {
2087  libmesh_assert_less (i, this->n_neighbors());
2088 
2089  return _elemlinks[i+1];
2090 }

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::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), assemble_ellipticdg(), assemble_SchroedingerEquation(), assembly_with_dg_fem_context(), libMesh::BoundaryInfo::boundary_ids(), libMesh::InfElemBuilder::build_inf_elem(), 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_boundary_points(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), libMesh::Elem::get_info(), 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::CheckpointIO::read_remote_elem(), libMesh::FE< Dim, LAGRANGE_VEC >::reinit(), libMesh::FE< Dim, LAGRANGE_VEC >::side_map(), libMesh::Elem::SideIter::side_on_boundary(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::MeshTools::Modification::smooth(), libMesh::ReplicatedMesh::stitching_helper(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), libMesh::Elem::topological_neighbor(), libMesh::MeshRefinement::topological_neighbor(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::Elem::which_neighbor_am_i(), and libMesh::CheckpointIO::write_remote_elem().

◆ 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 2917 of file elem.h.

2918 {
2919  return {_elemlinks+1, _elemlinks + 1 + this->n_neighbors()};
2920 }

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

Referenced by libMesh::Elem::child_neighbor(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::has_neighbor(), libMesh::Elem::make_links_to_me_remote(), libMesh::Parallel::Packing< const Elem * >::pack(), and libMesh::Elem::remove_links_to_me().

◆ neighbor_ptr_range() [2/2]

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

Definition at line 2924 of file elem.h.

2925 {
2926  return {_elemlinks+1, _elemlinks + 1 + this->n_neighbors()};
2927 }

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

◆ 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 1977 of file elem.h.

1978 {
1979  libmesh_assert_less (i, this->n_nodes());
1980  libmesh_assert(_nodes[i]);
1981  libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);
1982 
1983  return _nodes[i]->id();
1984 }

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::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::Elem::bracketing_nodes(), libMesh::FEMap::compute_face_map(), libMesh::InfEdge2::connectivity(), libMesh::Edge2::connectivity(), libMesh::Edge3::connectivity(), libMesh::Edge4::connectivity(), libMesh::Quad4::connectivity(), libMesh::InfQuad4::connectivity(), libMesh::Prism6::connectivity(), libMesh::Tri3::connectivity(), libMesh::Pyramid5::connectivity(), libMesh::Hex8::connectivity(), libMesh::InfHex8::connectivity(), libMesh::InfPrism6::connectivity(), libMesh::InfQuad6::connectivity(), libMesh::Quad8::connectivity(), libMesh::InfPrism12::connectivity(), libMesh::Tet4::connectivity(), libMesh::Tri6::connectivity(), libMesh::Quad9::connectivity(), libMesh::Tet10::connectivity(), libMesh::Hex20::connectivity(), libMesh::Prism15::connectivity(), libMesh::InfHex16::connectivity(), libMesh::Hex27::connectivity(), libMesh::Prism18::connectivity(), libMesh::InfHex18::connectivity(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::Tri3Subdivision::get_ordered_node(), libMesh::Tri3Subdivision::get_ordered_valence(), libMesh::Tet::key(), libMesh::Prism::key(), libMesh::Tri::key(), libMesh::Pyramid::key(), libMesh::Hex::key(), libMesh::Edge::key(), libMesh::InfPrism::key(), libMesh::InfQuad6::key(), libMesh::InfHex::key(), libMesh::Quad::key(), libMesh::Quad8::key(), libMesh::Quad9::key(), libMesh::Tri6::key(), libMesh::InfQuad::key(), libMesh::Edge2::key(), libMesh::Hex27::key(), libMesh::Prism18::key(), libMesh::Pyramid14::key(), libMesh::Edge4::key(), libMesh::InfHex18::key(), libMesh::Edge3::key(), libMesh::Tet4::key(), libMesh::Elem::key(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::Elem::local_node(), libMesh::Tri3Subdivision::local_node_number(), libMesh::Elem::operator==(), libMesh::XdrIO::pack_element(), libMesh::CheckpointIO::read_connectivity(), libMesh::FE< Dim, LAGRANGE_VEC >::side_map(), MixedDimensionMeshTest::testMesh(), SlitMeshTest::testMesh(), MixedDimensionNonUniformRefinement::testMesh(), MixedDimensionNonUniformRefinementTriangle::testMesh(), MixedDimensionNonUniformRefinement3D::testMesh(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::Elem::write_connectivity(), and libMesh::ExodusII_IO_Helper::write_elements().

◆ node_index_range()

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

◆ node_ptr() [1/2]

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

Definition at line 2020 of file elem.h.

2021 {
2022  libmesh_assert_less (i, this->n_nodes());
2023  libmesh_assert(_nodes[i]);
2024 
2025  return _nodes[i];
2026 }

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

◆ node_ptr() [2/2]

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

Definition at line 2009 of file elem.h.

2010 {
2011  libmesh_assert_less (i, this->n_nodes());
2012  libmesh_assert(_nodes[i]);
2013 
2014  return _nodes[i];
2015 }

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::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), assemble_shell(), libMesh::Quad4::build_side_ptr(), libMesh::InfQuad4::build_side_ptr(), libMesh::Prism6::build_side_ptr(), libMesh::Pyramid5::build_side_ptr(), libMesh::InfHex8::build_side_ptr(), libMesh::InfPrism6::build_side_ptr(), libMesh::Tri3::build_side_ptr(), libMesh::Hex8::build_side_ptr(), libMesh::InfPrism12::build_side_ptr(), libMesh::InfHex18::build_side_ptr(), libMesh::Tet4::build_side_ptr(), libMesh::InfQuad6::build_side_ptr(), libMesh::Quad8::build_side_ptr(), libMesh::InfHex16::build_side_ptr(), libMesh::Tet10::build_side_ptr(), libMesh::Hex20::build_side_ptr(), libMesh::Tri6::build_side_ptr(), libMesh::Prism15::build_side_ptr(), libMesh::Pyramid13::build_side_ptr(), libMesh::Edge::build_side_ptr(), libMesh::Quad9::build_side_ptr(), libMesh::Hex27::build_side_ptr(), libMesh::Prism18::build_side_ptr(), libMesh::Pyramid14::build_side_ptr(), libMesh::FEMap::compute_affine_map(), libMesh::FEMap::compute_map(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), 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::Elem::node_ref(), libMesh::Tri3Subdivision::prepare_subdivision_properties(), libMesh::Tet::side_ptr(), libMesh::Prism::side_ptr(), libMesh::Pyramid::side_ptr(), libMesh::Hex::side_ptr(), libMesh::Tri::side_ptr(), libMesh::Edge::side_ptr(), libMesh::InfPrism::side_ptr(), libMesh::InfHex::side_ptr(), libMesh::Quad::side_ptr(), libMesh::InfQuad::side_ptr(), libMesh::Elem::simple_build_side_ptr(), libMesh::Elem::simple_side_ptr(), libMesh::MeshTools::Modification::smooth(), libMesh::ReplicatedMesh::stitching_helper(), SystemsTest::testDofCouplingWithVarGroups(), and libMesh::ExodusII_IO_Helper::write_elements().

◆ node_ref() [1/2]

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

Definition at line 2039 of file elem.h.

2040 {
2041  return *this->node_ptr(i);
2042 }

References libMesh::Elem::node_ptr().

◆ node_ref() [2/2]

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

◆ 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 2161 of file elem.h.

2162 {
2163  return {_nodes, _nodes+this->n_nodes()};
2164 }

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

◆ nodes_on_side()

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

Implements libMesh::Elem.

Definition at line 146 of file remote_elem.h.

147  {
148  libmesh_not_implemented();
149  return {0};
150  }

◆ 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 2317 of file elem.C.

2318 {
2319  // Tell any of my neighbors about my death...
2320  // Looks strange, huh?
2321  for (auto n : this->side_index_range())
2322  {
2323  Elem * current_neighbor = this->neighbor_ptr(n);
2324  if (current_neighbor && current_neighbor != remote_elem)
2325  {
2326  // Note: it is possible that I see the neighbor
2327  // (which is coarser than me)
2328  // but they don't see me, so avoid that case.
2329  if (current_neighbor->level() == this->level())
2330  {
2331  const unsigned int w_n_a_i = current_neighbor->which_neighbor_am_i(this);
2332  libmesh_assert_less (w_n_a_i, current_neighbor->n_neighbors());
2333  current_neighbor->set_neighbor(w_n_a_i, nullptr);
2334  this->set_neighbor(n, nullptr);
2335  }
2336  }
2337  }
2338 }

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().

◆ 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 2313 of file elem.h.

2314 {
2315  // By convention, the element is on the boundary
2316  // if it has a nullptr neighbor.
2317  return this->has_neighbor(nullptr);
2318 }

References libMesh::Elem::has_neighbor().

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ operator==()

bool libMesh::Elem::operator== ( const Elem rhs) const
inherited
Returns
true if two elements are identical, 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 428 of file elem.C.

429 {
430  // If the elements aren't the same type, they aren't equal
431  if (this->type() != rhs.type())
432  return false;
433 
434  const unsigned short n_n = this->n_nodes();
435  libmesh_assert_equal_to(n_n, rhs.n_nodes());
436 
437  // Make two sorted arrays of global node ids and compare them for
438  // equality.
439  std::array<dof_id_type, Elem::max_n_nodes> this_ids, rhs_ids;
440 
441  for (unsigned short n = 0; n != n_n; n++)
442  {
443  this_ids[n] = this->node_id(n);
444  rhs_ids[n] = rhs.node_id(n);
445  }
446 
447  // Sort the vectors to rule out different local node numberings.
448  std::sort(this_ids.begin(), this_ids.begin()+n_n);
449  std::sort(rhs_ids.begin(), rhs_ids.begin()+n_n);
450 
451  // If the node ids match, the elements are equal!
452  for (unsigned short n = 0; n != n_n; ++n)
453  if (this_ids[n] != rhs_ids[n])
454  return false;
455  return true;
456 }

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

◆ 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, and libMesh::Hex.

Definition at line 2703 of file elem.C.

2705 {
2706  // If the subclass didn't rederive this, using it is an error
2707  libmesh_not_implemented();
2708 }

◆ 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::Edge, and libMesh::Hex.

Definition at line 2695 of file elem.C.

2696 {
2697  // If the subclass didn't rederive this, using it is an error
2698  libmesh_not_implemented();
2699 }

◆ 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 1593 of file elem.h.

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

Referenced by libMesh::InfFE< Dim, T_radial, T_map >::combine_base_radial(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), libMesh::Elem::get_info(), libMesh::InfFEMap::inverse_map(), and libMesh::InfFEMap::map().

◆ 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 2512 of file elem.h.

2513 {
2514 #ifdef LIBMESH_ENABLE_AMR
2515  return _p_level;
2516 #else
2517  return 0;
2518 #endif
2519 }

References libMesh::Elem::_p_level.

Referenced by libMesh::DofMap::_node_dof_indices(), 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_reinit(), libMesh::Elem::Elem(), libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::Elem::get_info(), libMesh::InfFE< Dim, T_radial, T_map >::init_face_shape_functions(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), 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::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::Parallel::Packing< const Elem * >::pack(), libMesh::XdrIO::pack_element(), libMesh::Elem::refine(), libMesh::FE< Dim, LAGRANGE_VEC >::reinit(), libMesh::InfFE< Dim, T_radial, T_map >::reinit(), libMesh::FEXYZ< Dim >::reinit(), libMesh::HPCoarsenTest::select_refinement(), libMesh::Elem::set_p_level(), libMesh::Elem::set_p_refinement_flag(), libMesh::FE< Dim, LAGRANGE_VEC >::shape(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_second_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::side_map(), libMesh::MeshRefinement::test_level_one(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ 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 636 of file dof_object.C.

637 {
638 #ifdef LIBMESH_ENABLE_AMR
639  // We might need to pack old_dof_object too
640  *target++ = (old_dof_object == nullptr) ? 0 : 1;
641 #endif
642 
643  *target++ = _idx_buf.size();
644  std::copy(_idx_buf.begin(), _idx_buf.end(), target);
645 
646 #ifdef LIBMESH_ENABLE_AMR
647  if (old_dof_object)
648  old_dof_object->pack_indexing(target);
649 #endif
650 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::old_dof_object, and libMesh::DofObject::pack_indexing().

Referenced by libMesh::Parallel::Packing< const Node * >::pack(), libMesh::Parallel::Packing< const Elem * >::pack(), and libMesh::DofObject::pack_indexing().

◆ 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 554 of file dof_object.C.

555 {
556  return
557  cast_int<unsigned int> (
558 #ifdef LIBMESH_ENABLE_AMR
559  ((old_dof_object == nullptr) ? 0 : old_dof_object->packed_indexing_size()) + 2 +
560 #else
561  1 +
562 #endif
563  _idx_buf.size());
564 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::old_dof_object, and libMesh::DofObject::packed_indexing_size().

Referenced by libMesh::Parallel::Packing< const Node * >::packable_size(), libMesh::Parallel::Packing< const Elem * >::packable_size(), libMesh::DofObject::packed_indexing_size(), libMesh::Node::packed_size(), libMesh::Parallel::Packing< Node * >::unpack(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ parent() [1/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 2442 of file elem.h.

2443 {
2444  return _elemlinks[0];
2445 }

References libMesh::Elem::_elemlinks.

◆ parent() [2/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 2434 of file elem.h.

2435 {
2436  return _elemlinks[0];
2437 }

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::FEMap::compute_face_map(), libMesh::FEAbstract::compute_node_constraints(), libMesh::connect_families(), libMesh::UnstructuredMesh::contract(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshRefinement::create_parent_error_vector(), 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 >::init_face_shape_functions(), 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::Parallel::Packing< const Elem * >::pack(), 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::MeshTools::Modification::smooth(), libMesh::Elem::subactive(), libMesh::Parallel::sync_element_data_by_parent_id(), MixedDimensionNonUniformRefinement::testMesh(), MixedDimensionNonUniformRefinementTriangle::testMesh(), MixedDimensionNonUniformRefinement3D::testMesh(), libMesh::Elem::top_parent(), libMesh::Elem::topological_neighbor(), libMesh::Parallel::Packing< Elem * >::unpack(), and libMesh::Elem::which_neighbor_am_i().

◆ 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.

Definition at line 1794 of file elem.C.

1796 {
1797  // Indexed first by embedding matrix type, then by child id, then by
1798  // child node, then by bracketing pair
1799  std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> &
1800  cached_bracketing_nodes = this->_get_bracketing_node_cache();
1801 
1802  const unsigned int em_vers = this->embedding_matrix_version();
1803 
1804  // We may be updating the cache on one thread, and while that
1805  // happens we can't safely access the cache from other threads.
1806  Threads::spin_mutex::scoped_lock lock(parent_bracketing_nodes_mutex);
1807 
1808  if (cached_bracketing_nodes.size() <= em_vers)
1809  cached_bracketing_nodes.resize(em_vers+1);
1810 
1811  const unsigned int nc = this->n_children();
1812 
1813  // If we haven't cached the bracketing nodes corresponding to this
1814  // embedding matrix yet, let's do so now.
1815  if (cached_bracketing_nodes[em_vers].size() < nc)
1816  {
1817  // If we're a second-order element but we're not a full-order
1818  // element, then some of our bracketing nodes may not exist
1819  // except on the equivalent full-order element. Let's build an
1820  // equivalent full-order element and make a copy of its cache to
1821  // use.
1822  if (this->default_order() != FIRST &&
1823  second_order_equivalent_type(this->type(), /*full_ordered=*/ true) != this->type())
1824  {
1825  // Check that we really are the non-full-order type
1826  libmesh_assert_equal_to
1827  (second_order_equivalent_type (this->type(), false),
1828  this->type());
1829 
1830  // Build the full-order type
1831  ElemType full_type =
1832  second_order_equivalent_type(this->type(), /*full_ordered=*/ true);
1833  std::unique_ptr<Elem> full_elem = Elem::build(full_type);
1834 
1835  // This won't work for elements with multiple
1836  // embedding_matrix versions, but every such element is full
1837  // order anyways.
1838  libmesh_assert_equal_to(em_vers, 0);
1839 
1840  // Make sure its cache has been built. We temporarily
1841  // release our mutex lock so that the inner call can
1842  // re-acquire it.
1843  lock.release();
1844  full_elem->parent_bracketing_nodes(0,0);
1845 
1846  // And then we need to lock again, so that if someone *else*
1847  // grabbed our lock before we did we don't risk accessing
1848  // cached_bracketing_nodes while they're working on it.
1849  // Threading is hard.
1850  lock.acquire(parent_bracketing_nodes_mutex);
1851 
1852  // Copy its cache
1853  cached_bracketing_nodes =
1854  full_elem->_get_bracketing_node_cache();
1855 
1856  // Now we don't need to build the cache ourselves.
1857  return cached_bracketing_nodes[em_vers][child][child_node];
1858  }
1859 
1860  cached_bracketing_nodes[em_vers].resize(nc);
1861 
1862  const unsigned int nn = this->n_nodes();
1863 
1864  // We have to examine each child
1865  for (unsigned int c = 0; c != nc; ++c)
1866  {
1867  const unsigned int ncn = this->n_nodes_in_child(c);
1868 
1869  cached_bracketing_nodes[em_vers][c].resize(ncn);
1870 
1871  // We have to examine each node in that child
1872  for (unsigned int n = 0; n != ncn; ++n)
1873  {
1874  // If this child node isn't a vertex or an infinite
1875  // child element's mid-infinite-edge node, then we need
1876  // to find bracketing nodes on the child.
1877  if (!this->is_vertex_on_child(c, n)
1878 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1879  && !this->is_mid_infinite_edge_node(n)
1880 #endif
1881  )
1882  {
1883  // Use the embedding matrix to find the child node
1884  // location in parent master element space
1885  Point bracketed_pt;
1886 
1887  for (unsigned int pn = 0; pn != nn; ++pn)
1888  {
1889  const float em_val =
1890  this->embedding_matrix(c,n,pn);
1891 
1892  libmesh_assert_not_equal_to (em_val, 1);
1893  if (em_val != 0.)
1894  bracketed_pt.add_scaled(this->master_point(pn), em_val);
1895  }
1896 
1897  // Check each pair of nodes on the child which are
1898  // also both parent nodes
1899  for (unsigned int n1 = 0; n1 != ncn; ++n1)
1900  {
1901  if (n1 == n)
1902  continue;
1903 
1904  unsigned int parent_n1 =
1905  this->as_parent_node(c,n1);
1906 
1907  if (parent_n1 == libMesh::invalid_uint)
1908  continue;
1909 
1910  Point p1 = this->master_point(parent_n1);
1911 
1912  for (unsigned int n2 = n1+1; n2 < nn; ++n2)
1913  {
1914  if (n2 == n)
1915  continue;
1916 
1917  unsigned int parent_n2 =
1918  this->as_parent_node(c,n2);
1919 
1920  if (parent_n2 == libMesh::invalid_uint)
1921  continue;
1922 
1923  Point p2 = this->master_point(parent_n2);
1924 
1925  Point pmid = (p1 + p2)/2;
1926 
1927  if (pmid == bracketed_pt)
1928  {
1929  cached_bracketing_nodes[em_vers][c][n].push_back
1930  (std::make_pair(parent_n1,parent_n2));
1931  break;
1932  }
1933  else
1934  libmesh_assert(!pmid.absolute_fuzzy_equals(bracketed_pt));
1935  }
1936  }
1937  }
1938  // If this child node is a parent node, we need to
1939  // find bracketing nodes on the parent.
1940  else
1941  {
1942  unsigned int parent_node = this->as_parent_node(c,n);
1943 
1944  Point bracketed_pt;
1945 
1946  // If we're not a parent node, use the embedding
1947  // matrix to find the child node location in parent
1948  // master element space
1949  if (parent_node == libMesh::invalid_uint)
1950  {
1951  for (unsigned int pn = 0; pn != nn; ++pn)
1952  {
1953  const float em_val =
1954  this->embedding_matrix(c,n,pn);
1955 
1956  libmesh_assert_not_equal_to (em_val, 1);
1957  if (em_val != 0.)
1958  bracketed_pt.add_scaled(this->master_point(pn), em_val);
1959  }
1960  }
1961  // If we're a parent node then we need no arithmetic
1962  else
1963  bracketed_pt = this->master_point(parent_node);
1964 
1965  for (unsigned int n1 = 0; n1 != nn; ++n1)
1966  {
1967  if (n1 == parent_node)
1968  continue;
1969 
1970  Point p1 = this->master_point(n1);
1971 
1972  for (unsigned int n2 = n1+1; n2 < nn; ++n2)
1973  {
1974  if (n2 == parent_node)
1975  continue;
1976 
1977  Point pmid = (p1 + this->master_point(n2))/2;
1978 
1979  if (pmid == bracketed_pt)
1980  {
1981  cached_bracketing_nodes[em_vers][c][n].push_back
1982  (std::make_pair(n1,n2));
1983  break;
1984  }
1985  else
1986  libmesh_assert(!pmid.absolute_fuzzy_equals(bracketed_pt));
1987  }
1988  }
1989  }
1990  }
1991  }
1992  }
1993 
1994  return cached_bracketing_nodes[em_vers][child][child_node];
1995 }

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::Elem::second_order_equivalent_type(), and libMesh::Elem::type().

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

◆ point() [1/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 1967 of file elem.h.

1968 {
1969  libmesh_assert_less (i, this->n_nodes());
1970 
1971  return *_nodes[i];
1972 }

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

◆ point() [2/2]

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

Definition at line 1955 of file elem.h.

1956 {
1957  libmesh_assert_less (i, this->n_nodes());
1958  libmesh_assert(_nodes[i]);
1959  libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);
1960 
1961  return *_nodes[i];
1962 }

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::MeshTools::Modification::all_tri(), libMesh::Tet::choose_diagonal(), libMesh::Elem::coarsen(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), libMesh::FEMap::compute_edge_map(), libMesh::FEXYZMap::compute_face_map(), libMesh::FEMap::compute_face_map(), libMesh::Elem::contains_edge_of(), libMesh::InfQuad4::contains_point(), libMesh::InfPrism::contains_point(), libMesh::Tri3::contains_point(), libMesh::InfHex::contains_point(), libMesh::Tet4::contains_point(), libMesh::Elem::contains_vertex_of(), libMesh::ElemCutter::cut_2D(), libMesh::ElemCutter::cut_3D(), libMesh::FEMContext::elem_position_get(), libMesh::Quad4::has_affine_map(), libMesh::Edge3::has_affine_map(), libMesh::Prism6::has_affine_map(), libMesh::Edge4::has_affine_map(), libMesh::Quad9::has_affine_map(), libMesh::Quad8::has_affine_map(), libMesh::Hex8::has_affine_map(), libMesh::Tri6::has_affine_map(), libMesh::Tet10::has_affine_map(), libMesh::Hex20::has_affine_map(), libMesh::Hex27::has_affine_map(), libMesh::Prism15::has_affine_map(), libMesh::Prism18::has_affine_map(), libMesh::Elem::hmax(), libMesh::Elem::hmin(), libMesh::Elem::length(), libMesh::Edge4::loose_bounding_box(), libMesh::Edge3::loose_bounding_box(), libMesh::Quad8::loose_bounding_box(), libMesh::Tri6::loose_bounding_box(), libMesh::Quad9::loose_bounding_box(), libMesh::Elem::loose_bounding_box(), libMesh::InfFEMap::map(), libMesh::FEMap::map(), libMesh::FEMap::map_deriv(), libMesh::Tri3::min_and_max_angle(), libMesh::Tet4::min_and_max_angle(), libMesh::FEMSystem::numerical_jacobian(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::InfCell::origin(), libMesh::InfEdge2::origin(), libMesh::InfQuad::origin(), libMesh::PostscriptIO::plot_linear_elem(), libMesh::Hex::quality(), libMesh::Tri::quality(), libMesh::Quad::quality(), libMesh::FE< Dim, LAGRANGE_VEC >::reinit(), libMesh::FE< Dim, LAGRANGE_VEC >::shape(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_second_deriv(), libMesh::MeshTools::Modification::smooth(), ExtraIntegersTest::test_final_integers(), BoundaryInfoTest::testShellFaceConstraints(), libMesh::Edge2::volume(), libMesh::Quad4::volume(), libMesh::Edge3::volume(), libMesh::Tri3::volume(), libMesh::Pyramid5::volume(), libMesh::Prism6::volume(), libMesh::Edge4::volume(), libMesh::Hex8::volume(), libMesh::Tet4::volume(), libMesh::Quad8::volume(), libMesh::Tri6::volume(), libMesh::Quad9::volume(), libMesh::Pyramid13::volume(), libMesh::Tet10::volume(), libMesh::Hex20::volume(), libMesh::Prism15::volume(), libMesh::Pyramid14::volume(), libMesh::Hex27::volume(), libMesh::Prism18::volume(), and libMesh::Elem::which_side_am_i().

◆ point_test()

bool libMesh::Elem::point_test ( const Point p,
Real  box_tol,
Real  map_tol 
) const
privateinherited

Shared private implementation used by the contains_point() and close_to_point() routines.

The box_tol tolerance is used in the bounding box optimization, the map_tol tolerance is used in the calls to inverse_map() and on_reference_element().

Definition at line 2131 of file elem.C.

2132 {
2133  libmesh_assert_greater (box_tol, 0.);
2134  libmesh_assert_greater (map_tol, 0.);
2135 
2136  // This is a great optimization on first order elements, but it
2137  // could return false negatives on higher orders
2138  if (this->default_order() == FIRST)
2139  {
2140  // Check to make sure the element *could* contain this point, so we
2141  // can avoid an expensive inverse_map call if it doesn't.
2142  bool
2143 #if LIBMESH_DIM > 2
2144  point_above_min_z = false,
2145  point_below_max_z = false,
2146 #endif
2147 #if LIBMESH_DIM > 1
2148  point_above_min_y = false,
2149  point_below_max_y = false,
2150 #endif
2151  point_above_min_x = false,
2152  point_below_max_x = false;
2153 
2154  // For relative bounding box checks in physical space
2155  const Real my_hmax = this->hmax();
2156 
2157  for (auto & n : this->node_ref_range())
2158  {
2159  point_above_min_x = point_above_min_x || (n(0) - my_hmax*box_tol <= p(0));
2160  point_below_max_x = point_below_max_x || (n(0) + my_hmax*box_tol >= p(0));
2161 #if LIBMESH_DIM > 1
2162  point_above_min_y = point_above_min_y || (n(1) - my_hmax*box_tol <= p(1));
2163  point_below_max_y = point_below_max_y || (n(1) + my_hmax*box_tol >= p(1));
2164 #endif
2165 #if LIBMESH_DIM > 2
2166  point_above_min_z = point_above_min_z || (n(2) - my_hmax*box_tol <= p(2));
2167  point_below_max_z = point_below_max_z || (n(2) + my_hmax*box_tol >= p(2));
2168 #endif
2169  }
2170 
2171  if (
2172 #if LIBMESH_DIM > 2
2173  !point_above_min_z ||
2174  !point_below_max_z ||
2175 #endif
2176 #if LIBMESH_DIM > 1
2177  !point_above_min_y ||
2178  !point_below_max_y ||
2179 #endif
2180  !point_above_min_x ||
2181  !point_below_max_x)
2182  return false;
2183  }
2184 
2185  // To be on the safe side, we converge the inverse_map() iteration
2186  // to a slightly tighter tolerance than that requested by the
2187  // user...
2188  const Point mapped_point = FEMap::inverse_map(this->dim(),
2189  this,
2190  p,
2191  0.1*map_tol, // <- this is |dx| tolerance, the Newton residual should be ~ |dx|^2
2192  /*secure=*/ false);
2193 
2194  // Check that the refspace point maps back to p! This is only necessary
2195  // for 1D and 2D elements, 3D elements always live in 3D.
2196  //
2197  // TODO: The contains_point() function could most likely be implemented
2198  // more efficiently in the element sub-classes themselves, at least for
2199  // the linear element types.
2200  if (this->dim() < 3)
2201  {
2202  Point xyz = FEMap::map(this->dim(), this, mapped_point);
2203 
2204  // Compute the distance between the original point and the re-mapped point.
2205  // They should be in the same place.
2206  Real dist = (xyz - p).norm();
2207 
2208 
2209  // If dist is larger than some fraction of the tolerance, then return false.
2210  // This can happen when e.g. a 2D element is living in 3D, and
2211  // FEMap::inverse_map() maps p onto the projection of the element,
2212  // effectively "tricking" FEInterface::on_reference_element().
2213  if (dist > this->hmax() * map_tol)
2214  return false;
2215  }
2216 
2217 
2218 
2219  return FEInterface::on_reference_element(mapped_point, this->type(), map_tol);
2220 }

References libMesh::Elem::default_order(), libMesh::Elem::dim(), libMesh::FIRST, libMesh::Elem::hmax(), libMesh::FEMap::inverse_map(), libMesh::FEMap::map(), libMesh::Elem::node_ref_range(), std::norm(), libMesh::FEInterface::on_reference_element(), libMesh::Real, and libMesh::Elem::type().

Referenced by libMesh::Elem::close_to_point(), and libMesh::Elem::contains_point().

◆ print_dof_info()

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

Print out info for debugging.

Definition at line 664 of file dof_object.C.

665 {
666  libMesh::out << this->id() << " [ ";
667 
668  for (auto s : IntRange<unsigned int>(0, this->n_systems()))
669  {
670  libMesh::out << "s:" << s << " ";
671  for (auto var : IntRange<unsigned int>(0, this->n_vars(s)))
672  {
673  libMesh::out << "v:" << var << " ";
674  for (auto comp : IntRange<unsigned int>(0, this->n_comp(s,var)))
675  {
676  libMesh::out << "c:" << comp << " dof:" << this->dof_number(s,var,comp) << " ";
677  }
678  }
679  }
680 
681  libMesh::out << "]\n";
682 }

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

◆ print_info() [1/3]

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

Prints relevant information about the element.

Definition at line 2225 of file elem.C.

2226 {
2227  os << this->get_info()
2228  << std::endl;
2229 }

References libMesh::Elem::get_info().

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

◆ print_info() [2/3]

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

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

Definition at line 87 of file reference_counter.C.

88 {
90  out_stream << ReferenceCounter::get_info();
91 }

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

◆ print_info() [3/3]

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

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

Definition at line 87 of file reference_counter.C.

88 {
90  out_stream << ReferenceCounter::get_info();
91 }

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

◆ processor_id() [1/3]

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

Definition at line 837 of file dof_object.h.

838 {
839  return _processor_id;
840 }

References libMesh::DofObject::_processor_id.

◆ processor_id() [2/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 829 of file dof_object.h.

830 {
831  return _processor_id;
832 }

References libMesh::DofObject::_processor_id.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::DofMap::add_neighbors_to_send_list(), 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::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Patch::build_around_element(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::InfElemBuilder::build_inf_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::UnstructuredMesh::copy_nodes_and_elements(), libMesh::UnstructuredMesh::create_submesh(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), 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::MeshFunction::find_element(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::Modification::flatten(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::get_info(), libMesh::DofMap::get_local_constraints(), libMesh::DistributedMesh::insert_elem(), libMesh::DofObject::invalidate_processor_id(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), 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(), AugmentSparsityOnNodes::operator()(), OverlappingCouplingFunctor::operator()(), AugmentSparsityOnInterface::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::DistributedMesh::own_node(), libMesh::Parallel::Packing< const Node * >::pack(), libMesh::Parallel::Packing< const Elem * >::pack(), 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::DofObject::processor_id(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::Elem::refine(), libMesh::DofMap::scatter_constraints(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), ParsedFEMFunctionTest::setUp(), 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::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DTKAdapter::update_variable_values(), libMesh::GmshIO::write_mesh(), and libMesh::Nemesis_IO_Helper::write_sidesets().

◆ 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 845 of file dof_object.h.

846 {
847  this->processor_id() = pid;
848 }

References libMesh::DofObject::processor_id().

◆ 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::Quad, libMesh::InfHex, libMesh::Tri, libMesh::Hex, and libMesh::Tet.

Definition at line 898 of file elem.h.

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

Referenced by main().

◆ 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.

I don't know what to do for this metric.

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

Definition at line 1326 of file elem.C.

1327 {
1328  switch (q)
1329  {
1333  default:
1334  {
1335  libmesh_do_once( libmesh_here();
1336 
1337  libMesh::err << "ERROR: unknown quality metric: "
1339  << std::endl
1340  << "Cowardly returning 1."
1341  << std::endl; );
1342 
1343  return 1.;
1344  }
1345  }
1346 }

References libMesh::Utility::enum_to_string(), and libMesh::err.

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

◆ 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 2558 of file elem.h.

2559 {
2560  if (!_children)
2561  return nullptr;
2562 
2563  return _children[i];
2564 }

References libMesh::Elem::_children.

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

◆ 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().

Definition at line 338 of file elem.C.

339 {
340  return &(ReferenceElem::get(this->type()));
341 }

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

Referenced by libMesh::QComposite< QSubCell >::init().

◆ refine()

void libMesh::Elem::refine ( MeshRefinement mesh_refinement)
virtualinherited

Refine the element.

Definition at line 87 of file elem_refinement.C.

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 = new 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  _children[c] = Elem::build(this->type(), this).release();
104  Elem * current_child = this->child_ptr(c);
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  mesh_refinement.add_elem (current_child);
120  current_child->set_n_systems(this->n_systems());
121  libmesh_assert_equal_to (current_child->n_extra_integers(),
122  this->n_extra_integers());
123  for (unsigned int i=0; i != nei; ++i)
124  current_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 }

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::node_index_range(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::parent(), libMesh::DofObject::processor_id(), libMesh::Elem::REFINE, libMesh::Elem::refinement_flag(), libMesh::remote_elem, libMesh::DofObject::set_extra_integer(), libMesh::DofObject::set_n_systems(), libMesh::Elem::set_node(), libMesh::Elem::set_p_level(), libMesh::Elem::set_p_refinement_flag(), libMesh::Elem::set_refinement_flag(), libMesh::Elem::subactive(), and libMesh::Elem::type().

◆ refinement_flag()

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

◆ 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.

Used by the library before an element is deleted from a mesh.

Definition at line 1191 of file elem.C.

1192 {
1193  libmesh_assert_not_equal_to (this, remote_elem);
1194 
1195  // We need to have handled any children first
1196 #ifdef LIBMESH_ENABLE_AMR
1197  libmesh_assert (!this->has_children());
1198 #endif
1199 
1200  // Nullify any neighbor links
1201  for (auto neigh : this->neighbor_ptr_range())
1202  {
1203  if (neigh && neigh != remote_elem)
1204  {
1205  // My neighbor should never be more refined than me; my real
1206  // neighbor would have been its parent in that case.
1207  libmesh_assert_greater_equal (this->level(), neigh->level());
1208 
1209  if (this->level() == neigh->level() &&
1210  neigh->has_neighbor(this))
1211  {
1212 #ifdef LIBMESH_ENABLE_AMR
1213  // My neighbor may have descendants which also consider me a
1214  // neighbor
1215  std::vector<Elem *> family;
1216  neigh->total_family_tree_by_neighbor (family, this);
1217 
1218  for (auto & n : family)
1219  {
1220  libmesh_assert (n);
1221  if (n->is_remote())
1222  continue;
1223  unsigned int my_s = n->which_neighbor_am_i(this);
1224  libmesh_assert_less (my_s, n->n_neighbors());
1225  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1226  n->set_neighbor(my_s, nullptr);
1227  }
1228 #else
1229  unsigned int my_s = neigh->which_neighbor_am_i(this);
1230  libmesh_assert_less (my_s, neigh->n_neighbors());
1231  libmesh_assert_equal_to (neigh->neighbor_ptr(my_s), this);
1232  neigh->set_neighbor(my_s, nullptr);
1233 #endif
1234  }
1235 #ifdef LIBMESH_ENABLE_AMR
1236  // Even if my neighbor doesn't link back to me, it might
1237  // have subactive descendants which do
1238  else if (neigh->has_children())
1239  {
1240  // If my neighbor at the same level doesn't have me as a
1241  // neighbor, I must be subactive
1242  libmesh_assert(this->level() > neigh->level() ||
1243  this->subactive());
1244 
1245  // My neighbor must have some ancestor of mine as a
1246  // neighbor
1247  Elem * my_ancestor = this->parent();
1248  libmesh_assert(my_ancestor);
1249  while (!neigh->has_neighbor(my_ancestor))
1250  {
1251  my_ancestor = my_ancestor->parent();
1252  libmesh_assert(my_ancestor);
1253  }
1254 
1255  // My neighbor may have descendants which consider me a
1256  // neighbor
1257  std::vector<Elem *> family;
1258  neigh->total_family_tree_by_subneighbor (family, my_ancestor, this);
1259 
1260  for (auto & n : family)
1261  {
1262  libmesh_assert (n);
1263  if (n->is_remote())
1264  continue;
1265  unsigned int my_s = n->which_neighbor_am_i(this);
1266  libmesh_assert_less (my_s, n->n_neighbors());
1267  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1268  n->set_neighbor(my_s, nullptr);
1269  }
1270  }
1271 #endif
1272  }
1273  }
1274 
1275 #ifdef LIBMESH_ENABLE_AMR
1276  // We can't currently delete a child with a parent!
1277  libmesh_assert (!this->parent());
1278 #endif
1279 }

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().

◆ 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 1430 of file elem.C.

1431 {
1432  libmesh_assert(this->has_children());
1433 
1434  libmesh_assert(this->child_ptr(c));
1435 
1436  this->set_child(c, elem);
1437 }

References libMesh::Elem::child_ptr(), libMesh::Elem::has_children(), libMesh::libmesh_assert(), and libMesh::Elem::set_child().

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

◆ second_order_adjacent_vertex()

unsigned short int libMesh::Elem::second_order_adjacent_vertex ( const unsigned int  n,
const unsigned int  v 
) const
virtualinherited
Returns
The element-local number of the \( v^{th} \) vertex that defines the \( n^{th} \) second-order node, or 0 for linear elements.
Note
The value is always less than this->n_vertices(), while n has to be greater than or equal to this->n_vertices().

Reimplemented in libMesh::Edge4, libMesh::Edge3, libMesh::InfHex18, libMesh::Pyramid14, libMesh::Hex27, libMesh::Prism18, libMesh::InfHex16, libMesh::Hex20, libMesh::Prism15, libMesh::Tet10, libMesh::Pyramid13, libMesh::Quad9, libMesh::Tri6, libMesh::InfPrism12, libMesh::Quad8, and libMesh::InfQuad6.

Definition at line 2351 of file elem.C.

2353 {
2354  // for linear elements, always return 0
2355  return 0;
2356 }

Referenced by libMesh::UnstructuredMesh::all_second_order(), and libMesh::MeshTools::Modification::smooth().

◆ 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::InfHex18, libMesh::Hex27, libMesh::Prism18, libMesh::InfHex16, libMesh::Hex20, libMesh::Prism15, libMesh::Tet10, libMesh::Quad9, libMesh::Tri6, libMesh::InfPrism12, libMesh::Quad8, libMesh::InfQuad6, and libMesh::Edge3.

Definition at line 2361 of file elem.C.

2362 {
2363  // for linear elements, always return 0
2364  return std::pair<unsigned short int, unsigned short int>(0,0);
2365 }

◆ second_order_equivalent_type()

ElemType libMesh::Elem::second_order_equivalent_type ( const ElemType  et,
const bool  full_ordered = true 
)
staticinherited
Returns
The element type of the associated second-order element, or INVALID_ELEM for second-order or other 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 2432 of file elem.C.

2434 {
2435  switch (et)
2436  {
2437  case NODEELEM:
2438  return NODEELEM;
2439  case EDGE2:
2440  case EDGE3:
2441  {
2442  // full_ordered not relevant
2443  return EDGE3;
2444  }
2445 
2446  case EDGE4:
2447  {
2448  // full_ordered not relevant
2449  return EDGE4;
2450  }
2451 
2452  case TRI3:
2453  case TRI6:
2454  {
2455  // full_ordered not relevant
2456  return TRI6;
2457  }
2458 
2459  // Currently there is no TRISHELL6, so similarly to other types
2460  // where this is the case, we just return the input.
2461  case TRISHELL3:
2462  return TRISHELL3;
2463 
2464  case QUAD4:
2465  case QUAD8:
2466  {
2467  if (full_ordered)
2468  return QUAD9;
2469  else
2470  return QUAD8;
2471  }
2472 
2473  case QUADSHELL4:
2474  case QUADSHELL8:
2475  {
2476  // There is no QUADSHELL9, so in that sense QUADSHELL8 is the
2477  // "full ordered" element.
2478  return QUADSHELL8;
2479  }
2480 
2481  case QUAD9:
2482  {
2483  // full_ordered not relevant
2484  return QUAD9;
2485  }
2486 
2487  case TET4:
2488  case TET10:
2489  {
2490  // full_ordered not relevant
2491  return TET10;
2492  }
2493 
2494  case HEX8:
2495  case HEX20:
2496  {
2497  // see below how this correlates with INFHEX8
2498  if (full_ordered)
2499  return HEX27;
2500  else
2501  return HEX20;
2502  }
2503 
2504  case HEX27:
2505  {
2506  // full_ordered not relevant
2507  return HEX27;
2508  }
2509 
2510  case PRISM6:
2511  case PRISM15:
2512  {
2513  if (full_ordered)
2514  return PRISM18;
2515  else
2516  return PRISM15;
2517  }
2518 
2519  case PRISM18:
2520  {
2521  // full_ordered not relevant
2522  return PRISM18;
2523  }
2524 
2525  case PYRAMID5:
2526  case PYRAMID13:
2527  {
2528  if (full_ordered)
2529  return PYRAMID14;
2530  else
2531  return PYRAMID13;
2532  }
2533 
2534  case PYRAMID14:
2535  {
2536  // full_ordered not relevant
2537  return PYRAMID14;
2538  }
2539 
2540 
2541 
2542 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2543 
2544  // infinite elements
2545  case INFEDGE2:
2546  {
2547  return INFEDGE2;
2548  }
2549 
2550  case INFQUAD4:
2551  case INFQUAD6:
2552  {
2553  // full_ordered not relevant
2554  return INFQUAD6;
2555  }
2556 
2557  case INFHEX8:
2558  case INFHEX16:
2559  {
2560  /*
2561  * Note that this matches with \p Hex8:
2562  * For full-ordered, \p InfHex18 and \p Hex27
2563  * belong together, and for not full-ordered,
2564  * \p InfHex16 and \p Hex20 belong together.
2565  */
2566  if (full_ordered)
2567  return INFHEX18;
2568  else
2569  return INFHEX16;
2570  }
2571 
2572  case INFHEX18:
2573  {
2574  // full_ordered not relevant
2575  return INFHEX18;
2576  }
2577 
2578  case INFPRISM6:
2579  case INFPRISM12:
2580  {
2581  // full_ordered not relevant
2582  return INFPRISM12;
2583  }
2584 
2585 #endif
2586 
2587 
2588  default:
2589  {
2590  // what did we miss?
2591  libmesh_error_msg("No second order equivalent element type for et = "
2592  << Utility::enum_to_string(et));
2593  }
2594  }
2595 }

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::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, and libMesh::TRISHELL3.

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

◆ set_buffer()

void libMesh::DofObject::set_buffer ( const std::vector< dof_id_type > &  buf)
inlineinherited

Definition at line 650 of file dof_object.h.

651  { _idx_buf = buf; }

References libMesh::DofObject::_idx_buf.

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

◆ set_child()

void libMesh::Elem::set_child ( unsigned int  c,
Elem elem 
)
inlineprivateinherited

Sets the 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 2586 of file elem.h.

2587 {
2588  libmesh_assert (this->has_children());
2589 
2590  _children[c] = elem;
2591 }

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

Referenced by libMesh::Elem::add_child(), libMesh::Elem::make_links_to_me_remote(), and libMesh::Elem::replace_child().

◆ 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 467 of file dof_object.C.

471 {
472  libmesh_assert_less (s, this->n_systems());
473  libmesh_assert_less (var, this->n_vars(s));
474  libmesh_assert_less (comp, this->n_comp(s,var));
475 
476  const unsigned int
477  vg = this->var_to_vg(s,var),
478 #ifndef NDEBUG
479  ncg = this->n_comp_group(s,vg),
480 #endif
481  vig = this->system_var_to_vg_var(s,vg,var),
482  start_idx_sys = this->start_idx(s);
483 
484  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
485 
486  dof_id_type & base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
487 
488  // We intend to change all dof numbers together or not at all
489  if (comp || vig)
490  libmesh_assert ((dn == invalid_id && base_idx == invalid_id) ||
491  (dn == base_idx + vig*ncg + comp));
492 
493  // only explicitly store the base index for vig==0, comp==0
494  else
495  base_idx = dn;
496 
497  libmesh_assert_equal_to (this->dof_number(s, var, comp), dn);
498 }

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().

◆ 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 1042 of file dof_object.h.

1044 {
1045 #ifndef NDEBUG
1046  const unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
1047 #endif
1048  libmesh_assert_less(index+n_more_integers, this->n_extra_integers());
1049  libmesh_assert_less(this->n_pseudo_systems(), _idx_buf.size());
1050 
1051  const unsigned int start_idx_i = this->start_idx_ints();
1052 
1053  libmesh_assert_less(start_idx_i+index+n_more_integers, _idx_buf.size());
1054  std::memcpy(&_idx_buf[start_idx_i+index], &value, sizeof(T));
1055 }

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::DynaIO::read_mesh(), and DofObjectTest< Node >::testAddExtraData().

◆ 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 1010 of file dof_object.h.

1012 {
1013  libmesh_assert_less(index, this->n_extra_integers());
1014  libmesh_assert_less(this->n_pseudo_systems(), _idx_buf.size());
1015 
1016  const unsigned int start_idx_i = this->start_idx_ints();
1017 
1018  libmesh_assert_less(start_idx_i+index, _idx_buf.size());
1019  _idx_buf[start_idx_i+index] = value;
1020 }

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::UnstructuredMesh::create_submesh(), libMesh::CheckpointIO::read_connectivity(), libMesh::CheckpointIO::read_nodes(), libMesh::Elem::refine(), DofObjectTest< Node >::testAddExtraData(), DofObjectTest< Node >::testAddSystemExtraInts(), DofObjectTest< Node >::testSetNSystemsExtraInts(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

◆ set_id() [1/2]

dof_id_type & libMesh::DofObject::set_id ( )
inlineinherited
Returns
The id for this DofObject as a writable reference.

Definition at line 776 of file dof_object.h.

777 {
778  return _id;
779 }

References libMesh::DofObject::_id.

Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Subdivision::all_subdivision(), libMesh::MeshTools::Generation::build_cube(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::InfElemBuilder::build_inf_elem(), GetBoundaryPointsTest::build_mesh(), SlitMeshTest::build_mesh(), OverlappingTestBase::build_quad_mesh(), libMesh::UnstructuredMesh::create_submesh(), libMesh::UNVIO::elements_in(), libMesh::MeshTools::Modification::flatten(), libMesh::DofObject::invalidate_id(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::RBDataDeserialization::load_rb_eim_evaluation_data(), libMesh::Node::Node(), libMesh::DistributedMesh::own_node(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::VTKIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::UCDIO::read_implementation(), libMesh::GmshIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::OFFIO::read_stream(), libMesh::MatlabIO::read_stream(), RemoteElem(), libMesh::ReplicatedMesh::renumber_elem(), libMesh::DistributedMesh::renumber_elem(), libMesh::ReplicatedMesh::renumber_node(), libMesh::DistributedMesh::renumber_node(), libMesh::ReplicatedMesh::renumber_nodes_and_elements(), libMesh::DofObject::set_id(), DofObjectTest< Node >::testInvalidateId(), EquationSystemsTest::testPostInitAddElem(), SystemsTest::testProjectMatrix3D(), DofObjectTest< Node >::testSetId(), DofObjectTest< Node >::testValidId(), libMesh::Parallel::Packing< Node * >::unpack(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ set_id() [2/2]

void libMesh::DofObject::set_id ( const dof_id_type  dofid)
inlineinherited

Sets the id for this DofObject.

Definition at line 156 of file dof_object.h.

157  { this->set_id() = dofid; }

References libMesh::DofObject::set_id().

◆ 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 801 of file elem.C.

802 {
803  // interior parents make no sense for full-dimensional elements.
804  libmesh_assert_less (this->dim(), LIBMESH_DIM);
805 
806  // If we have an interior_parent, we USED TO assume it was a
807  // one-higher-dimensional interior element, but we now allow e.g.
808  // edge elements to have a 3D interior_parent with no
809  // intermediate 2D element.
810  // libmesh_assert (!p ||
811  // p->dim() == (this->dim()+1));
812  libmesh_assert (!p ||
813  (p == remote_elem) ||
814  (p->dim() > this->dim()));
815 
816  _elemlinks[1+this->n_sides()] = p;
817 }

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::Edge::Edge(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Hex::Hex(), libMesh::InfHex::InfHex(), libMesh::InfQuad::InfQuad(), libMesh::NodeElem::NodeElem(), libMesh::Prism::Prism(), libMesh::Pyramid::Pyramid(), libMesh::Quad::Quad(), libMesh::Tet::Tet(), libMesh::Tri::Tri(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ 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 2548 of file elem.h.

2549 {
2550  _map_data = data;
2551 }

References libMesh::Elem::_map_data, and data.

Referenced by libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::insert_elem(), and libMesh::DistributedMesh::insert_elem().

◆ 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 2532 of file elem.h.

2533 {
2534  _map_type = cast_int<unsigned char>(type);
2535 }

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

Referenced by libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::insert_elem(), and libMesh::DistributedMesh::insert_elem().

◆ 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 398 of file dof_object.C.

401 {
402  libmesh_assert_less (s, this->n_systems());
403  libmesh_assert_less (var, this->n_vars(s));
404 
405  this->set_n_comp_group(s, this->var_to_vg(s,var), ncomp);
406 }

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

◆ 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 410 of file dof_object.C.

413 {
414  libmesh_assert_less (s, this->n_systems());
415  libmesh_assert_less (vg, this->n_var_groups(s));
416 
417  // Check for trivial return
418  if (ncomp == this->n_comp_group(s,vg)) return;
419 
420 #ifndef NDEBUG
421  if (ncomp >= ncv_magic)
422  {
423  const index_t ncvm = ncv_magic;
424  libmesh_error_msg("ERROR: ncomp must be less than DofObject::ncv_magic!\n" \
425  << "ncomp = " \
426  << ncomp \
427  << ", ncv_magic = " \
428  << ncvm \
429  << "\nrecompile and try again!");
430  }
431 #endif
432 
433  const unsigned int
434  start_idx_sys = this->start_idx(s),
435  n_vars_group = this->n_vars(s,vg),
436  base_offset = start_idx_sys + 2*vg;
437 
438  libmesh_assert_less ((base_offset + 1), _idx_buf.size());
439 
440  // if (ncomp)
441  // libMesh::out << "s,vg,ncomp="
442  // << s << ","
443  // << vg << ","
444  // << ncomp << '\n';
445 
446  // set the number of components, maintaining the number
447  // of variables in the group
448  _idx_buf[base_offset] = ncv_magic*n_vars_group + ncomp;
449 
450  // We use (invalid_id - 1) to signify no
451  // components for this object
452  _idx_buf[base_offset + 1] = (ncomp == 0) ? invalid_id - 1 : invalid_id;
453 
454  // this->debug_buffer();
455  // libMesh::out << "s,vg = " << s << "," << vg << '\n'
456  // << "base_offset=" << base_offset << '\n'
457  // << "this->n_comp(s,vg)=" << this->n_comp(s,vg) << '\n'
458  // << "this->n_comp_group(s,vg)=" << this->n_comp_group(s,vg) << '\n'
459  // << "this->n_vars(s,vg)=" << this->n_vars(s,vg) << '\n'
460  // << "this->n_var_groups(s)=" << this->n_var_groups(s) << '\n';
461 
462  libmesh_assert_equal_to (ncomp, this->n_comp_group(s,vg));
463 }

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().

◆ 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 165 of file dof_object.C.

166 {
167  const unsigned int old_ns = this->n_systems();
168 
169  // Check for trivial return
170  if (ns == old_ns)
171  return;
172 
173  const unsigned int nei = this->n_extra_integers();
174  const dof_id_type header_size = ns + bool(nei);
175  const dof_id_type hdr = nei ? -header_size : header_size;
176  index_buffer_t new_buf(header_size + nei, hdr);
177  if (nei)
178  {
179  const unsigned int start_idx_ints = old_ns ?
180  cast_int<unsigned int>(_idx_buf[old_ns]) :
181  1;
182  libmesh_assert_less(start_idx_ints, _idx_buf.size());
183  std::copy(_idx_buf.begin()+start_idx_ints,
184  _idx_buf.end(),
185  new_buf.begin()+header_size);
186  if (ns)
187  std::fill(new_buf.begin()+1, new_buf.begin()+ns+1, ns+1);
188  }
189 
190  // vector swap trick to force deallocation when shrinking
191  new_buf.swap(_idx_buf);
192 
193 #ifdef DEBUG
194  libmesh_assert_equal_to(nei, this->n_extra_integers());
195 
196  // check that all systems now exist and that they have 0 size
197  libmesh_assert_equal_to (ns, this->n_systems());
198  for (auto s : IntRange<unsigned int>(0, this->n_systems()))
199  {
200  libmesh_assert_equal_to (this->n_vars(s), 0);
201  libmesh_assert_equal_to (this->n_var_groups(s), 0);
202  }
203 #endif
204 }

References libMesh::DofObject::_idx_buf, 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().

◆ 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 260 of file dof_object.C.

262 {
263  const unsigned int n_sys = this->n_systems();
264 
265  libmesh_assert_less (s, n_sys);
266 
267  // number of variable groups for this system - inferred
268  const unsigned int nvg = cast_int<unsigned int>(nvpg.size());
269 
270  // BSK - note that for compatibility with the previous implementation
271  // calling this method when (nvars == this->n_vars()) requires that
272  // we invalidate the DOF indices and set the number of components to 0.
273  // Note this was a bit of a surprise to me - there was no quick return in
274  // the old method, which caused removal and readdition of the DOF indices
275  // even in the case of (nvars == this->n_vars()), resulting in n_comp(s,v)
276  // implicitly becoming 0 regardless of any previous value.
277  // quick return?
278  if (nvg == this->n_var_groups(s))
279  {
280  for (unsigned int vg=0; vg<nvg; vg++)
281  {
282  this->set_n_comp_group(s,vg,0);
283  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
284  }
285  return;
286  }
287 
288  const bool hei = this->has_extra_integers();
289 
290  // since there is ample opportunity to screw up other systems, let us
291  // cache their current sizes and later assert that they are unchanged.
292 #ifdef DEBUG
293  const unsigned int nei = this->n_extra_integers();
294 
295  DofObject::index_buffer_t old_system_sizes, old_extra_integers;
296  old_system_sizes.reserve(n_sys);
297  old_extra_integers.reserve(nei);
298 
299  for (unsigned int s_ctr=0; s_ctr<n_sys; s_ctr++)
300  old_system_sizes.push_back(this->n_var_groups(s_ctr));
301 
302  for (unsigned int ei=0; ei != nei; ++ei)
303  old_extra_integers.push_back(this->get_extra_integer(ei));
304 #endif
305 
306  // remove current indices if we have some
307  if (this->n_var_groups(s) != 0)
308  {
309  const unsigned int old_nvg_s = this->n_var_groups(s);
310 
311  DofObject::index_buffer_t::iterator
312  it = _idx_buf.begin(),
313  end = _idx_buf.begin();
314 
315  std::advance(it, this->start_idx(s));
316  std::advance(end, this->end_idx(s));
317  _idx_buf.erase(it,end);
318 
319  for (unsigned int ctr=(s+1); ctr<n_sys; ctr++)
320  _idx_buf[ctr] -= 2*old_nvg_s;
321 
322  if (hei)
323  _idx_buf[n_sys] -= 2*old_nvg_s;
324  }
325 
326  // better not have any now!
327  libmesh_assert_equal_to (this->n_var_groups(s), 0);
328 
329  // Make sure we didn't screw up any of our sizes!
330 #ifdef DEBUG
331  for (auto s_ctr : IntRange<unsigned int>(0, this->n_systems()))
332  if (s_ctr != s)
333  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
334 
335  libmesh_assert_equal_to (nei, this->n_extra_integers());
336 
337  for (unsigned int ei=0; ei != nei; ++ei)
338  libmesh_assert_equal_to(old_extra_integers[ei], this->get_extra_integer(ei));
339 #endif
340 
341  // OK, if the user requested 0 that is what we have
342  if (nvg == 0)
343  return;
344 
345  {
346  // array to hold new indices
347  DofObject::index_buffer_t var_idxs(2*nvg);
348  for (unsigned int vg=0; vg<nvg; vg++)
349  {
350  var_idxs[2*vg ] = ncv_magic*nvpg[vg] + 0;
351  var_idxs[2*vg + 1] = invalid_id - 1;
352  }
353 
354  DofObject::index_buffer_t::iterator it = _idx_buf.begin();
355  std::advance(it, this->end_idx(s));
356  _idx_buf.insert(it, var_idxs.begin(), var_idxs.end());
357 
358  for (unsigned int ctr=(s+1); ctr<n_sys; ctr++)
359  _idx_buf[ctr] += 2*nvg;
360 
361  if (hei)
362  _idx_buf[n_sys] += 2*nvg;
363 
364  // resize _idx_buf to fit so no memory is wasted.
366  }
367 
368  libmesh_assert_equal_to (nvg, this->n_var_groups(s));
369 
370 #ifdef DEBUG
371 
372  libmesh_assert_equal_to (this->n_var_groups(s), nvpg.size());
373 
374  for (auto vg : IntRange<unsigned int>(0, this->n_var_groups(s)))
375  {
376  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
377  libmesh_assert_equal_to (this->n_comp_group(s,vg), 0);
378  }
379 
380  for (auto v : IntRange<unsigned int>(0, this->n_vars(s)))
381  libmesh_assert_equal_to (this->n_comp(s,v), 0);
382 
383  // again, all other system sizes should be unchanged!
384  for (auto s_ctr : IntRange<unsigned int>(0, this->n_systems()))
385  if (s_ctr != s)
386  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
387 
388  // Extra integers count and values should also be unchanged!
389  libmesh_assert_equal_to (nei, this->n_extra_integers());
390 
391  for (unsigned int ei=0; ei != nei; ++ei)
392  libmesh_assert_equal_to(old_extra_integers[ei], this->get_extra_integer(ei));
393 #endif
394 }

References libMesh::DofObject::_idx_buf, end, libMesh::DofObject::end_idx(), libMesh::DofObject::get_extra_integer(), libMesh::DofObject::has_extra_integers(), libMesh::DofObject::invalid_id, 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().

◆ set_neighbor()

void libMesh::Elem::set_neighbor ( const unsigned int  i,
Elem n 
)
inlineinherited

◆ set_node()

virtual Node* & libMesh::RemoteElem::set_node ( const unsigned int  i)
inlineoverridevirtual
Returns
The pointer to local Node i as a writable reference.

Reimplemented from libMesh::Elem.

Definition at line 86 of file remote_elem.h.

87  { libmesh_not_implemented(); return Elem::set_node(i); }

References libMesh::Elem::set_node().

◆ 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 150 of file dof_object.C.

151 {
152  this->clear_old_dof_object();
153 
155 
156  // Make a new DofObject, assign a copy of \p this.
157  // Make sure the copy ctor for DofObject works!!
158  this->old_dof_object = new DofObject(*this);
159 }

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

◆ 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.

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  _p_level = cast_int<unsigned char>(p);
83 }

References libMesh::Elem::_p_level, libMesh::Elem::child_ref_range(), 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::Elem::refine(), libMesh::Elem::set_p_level(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ set_p_refinement_flag()

void libMesh::Elem::set_p_refinement_flag ( const RefinementState  pflag)
inlineinherited

◆ 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 2450 of file elem.h.

2451 {
2452  // We no longer support using parent() as interior_parent()
2453  libmesh_assert_equal_to(this->dim(), p ? p->dim() : this->dim());
2454  _elemlinks[0] = p;
2455 }

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

Referenced by libMesh::BoundaryInfo::add_elements(), and libMesh::UnstructuredMesh::all_first_order().

◆ set_refinement_flag()

void libMesh::Elem::set_refinement_flag ( const RefinementState  rflag)
inlineinherited

◆ set_unique_id()

unique_id_type & libMesh::DofObject::set_unique_id ( )
inlineinherited

◆ 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 1209 of file dof_object.h.

1212 {
1213  libmesh_assert_less (s, this->n_systems());
1214  libmesh_assert_less (vg, this->n_var_groups(s));
1215 
1216  const unsigned int
1217  start_idx_sys = this->start_idx(s);
1218 
1219  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1220 
1221  _idx_buf[start_idx_sys + 2*vg + 1] = db;
1222 
1223  libmesh_assert_equal_to (this->vg_dof_base(s,vg), db);
1224 }

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().

◆ setup()

void libMesh::Singleton::setup ( )
staticinherited

Setup function.

Initializes any derived Singleton::Setup objects. objects.

Definition at line 81 of file libmesh_singleton.C.

82 {
83  SingletonMutex::scoped_lock lock(setup_mtx);
84 
85  SetupList & setup_cache = get_setup_cache();
86 
87  for (auto & item : setup_cache)
88  {
89  libmesh_assert (item);
90  item->setup();
91  }
92 }

References libMesh::libmesh_assert().

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

◆ 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 2188 of file elem.h.

2189 {
2190  return {0, cast_int<unsigned short>(this->n_sides())};
2191 }

References libMesh::Elem::n_sides().

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::BoundaryInfo::add_elements(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), 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_boundary_points(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), libMesh::Elem::get_info(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::Elem::has_topological_neighbor(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::Elem::nullify_neighbors(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::PostscriptIO::plot_quadratic_elem(), libMesh::MeshTools::Modification::smooth(), libMesh::ReplicatedMesh::stitching_helper(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ side_ptr() [1/4]

virtual std::unique_ptr<Elem> libMesh::RemoteElem::side_ptr ( const unsigned int  i)
inlineoverridevirtual
Returns
A proxy element coincident with side i.
Note
This method returns the minimum element necessary to uniquely identify the side. For example, the side of a hexahedron is always returned as a 4-noded quadrilateral, regardless of what type of hex you are dealing with. If you want the full-ordered face (i.e. a 9-noded quad face for a 27-noded hexahedron) use the build_side method.
The const version of this function is non-virtual; it simply calls the virtual non-const version and const_casts the return type.

Implements libMesh::Elem.

Definition at line 167 of file remote_elem.h.

168  { libmesh_not_implemented(); return std::unique_ptr<Elem>(); }

◆ side_ptr() [2/4]

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

Definition at line 2210 of file elem.h.

2212 {
2213  // Hand off to the non-const version of this function
2214  Elem * me = const_cast<Elem *>(this);
2215  std::unique_ptr<Elem> e {const_cast<Elem *>(elem.release())};
2216  me->side_ptr(e, i);
2217  elem.reset(e.release());
2218 }

References libMesh::Elem::side_ptr().

◆ side_ptr() [3/4]

virtual void libMesh::RemoteElem::side_ptr ( std::unique_ptr< Elem > &  side,
const unsigned int  i 
)
inlineoverridevirtual

Resets the loose element side, which may currently point to a different side than i or even a different element than this, to point to side i on this.

If side is currently an element of the wrong type, it will be freed and a new element allocated; otherwise no memory allocation will occur.

This should not be called with proxy Side elements. This will cause side to be a minimum-ordered element, even if it is handed a higher-ordered element that must be replaced.

The const version of this function is non-virtual; it simply calls the virtual non-const version and const_casts the return type.

Implements libMesh::Elem.

Definition at line 170 of file remote_elem.h.

172  { libmesh_not_implemented(); }

◆ side_ptr() [4/4]

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

Definition at line 2197 of file elem.h.

2198 {
2199  // Call the non-const version of this function, return the result as
2200  // a std::unique_ptr<const Elem>.
2201  Elem * me = const_cast<Elem *>(this);
2202  const Elem * s = const_cast<const Elem *>(me->side_ptr(i).release());
2203  return std::unique_ptr<const Elem>(s);
2204 }

References libMesh::Elem::side_ptr().

◆ simple_build_side_ptr()

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 2252 of file elem.h.

2255 {
2256  libmesh_assert_less (i, this->n_sides());
2257 
2258  if (!side.get() || side->type() != sidetype)
2259  {
2260  Subclass & real_me = cast_ref<Subclass&>(*this);
2261  side = real_me.Subclass::build_side_ptr(i, false);
2262  }
2263  else
2264  {
2265  side->subdomain_id() = this->subdomain_id();
2266 
2267  for (auto n : side->node_index_range())
2268  side->set_node(n) = this->node_ptr(Subclass::side_nodes_map[i][n]);
2269  }
2270 }

References libMesh::Elem::n_sides(), libMesh::Elem::node_ptr(), and libMesh::Elem::subdomain_id().

◆ 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 2277 of file elem.h.

2280 {
2281  libmesh_assert_less (i, this->n_sides());
2282 
2283  if (!side.get() || side->type() != sidetype)
2284  {
2285  Subclass & real_me = cast_ref<Subclass&>(*this);
2286  side = real_me.Subclass::side_ptr(i);
2287  }
2288  else
2289  {
2290  side->subdomain_id() = this->subdomain_id();
2291 
2292  for (auto n : side->node_index_range())
2293  side->set_node(n) = this->node_ptr(Mapclass::side_nodes_map[i][n]);
2294  }
2295 }

References libMesh::Elem::n_sides(), libMesh::Elem::node_ptr(), and libMesh::Elem::subdomain_id().

◆ start_idx()

unsigned int libMesh::DofObject::start_idx ( const unsigned int  s) const
inlineprivateinherited

◆ start_idx_ints()

unsigned int libMesh::DofObject::start_idx_ints ( ) const
inlineprivateinherited

The starting index for an extra_integers pseudosystem.

Definition at line 1185 of file dof_object.h.

1186 {
1188 
1189  unsigned int n_sys = this->n_systems();
1190 
1191  libmesh_assert_less(this->n_systems(), _idx_buf.size());
1192  return n_sys ? cast_int<unsigned int>(_idx_buf[this->n_systems()]) :
1193  (n_sys+1);
1194 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::has_extra_integers(), libMesh::libmesh_assert(), and libMesh::DofObject::n_systems().

Referenced by libMesh::DofObject::get_extra_datum(), libMesh::DofObject::get_extra_integer(), libMesh::DofObject::n_extra_integers(), libMesh::DofObject::set_extra_datum(), libMesh::DofObject::set_extra_integer(), and libMesh::DofObject::set_n_systems().

◆ 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 2363 of file elem.h.

2364 {
2365 #ifdef LIBMESH_ENABLE_AMR
2366  if (this->active())
2367  return false;
2368  if (!this->has_children())
2369  return true;
2370  for (const Elem * my_ancestor = this->parent();
2371  my_ancestor != nullptr;
2372  my_ancestor = my_ancestor->parent())
2373  if (my_ancestor->active())
2374  return true;
2375 #endif
2376 
2377  return false;
2378 }

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::UnstructuredMesh::contract(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), 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(), libMesh::ReplicatedMesh::stitching_helper(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ subdomain_id() [1/2]

subdomain_id_type & libMesh::Elem::subdomain_id ( )
inlineinherited
Returns
The subdomain that this element belongs to as a writable reference.

Definition at line 2077 of file elem.h.

2078 {
2079  return _sbd_id;
2080 }

References libMesh::Elem::_sbd_id.

◆ subdomain_id() [2/2]

subdomain_id_type libMesh::Elem::subdomain_id ( ) const
inlineinherited
Returns
The subdomain that this element belongs to.

Definition at line 2069 of file elem.h.

2070 {
2071  return _sbd_id;
2072 }

References libMesh::Elem::_sbd_id.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::BoundaryInfo::_find_id_maps(), LinearElasticityWithContact::add_contact_edge_elements(), libMesh::RBDataSerialization::add_elem_to_builder(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::AbaqusIO::assign_subdomain_ids(), libMesh::MeshTools::Generation::build_extrusion(), MixedDimensionMeshTest::build_mesh(), MixedDimensionNonUniformRefinement::build_mesh(), MixedDimensionNonUniformRefinementTriangle::build_mesh(), MixedDimensionNonUniformRefinement3D::build_mesh(), OverlappingTestBase::build_quad_mesh(), libMesh::Quad4::build_side_ptr(), libMesh::InfQuad4::build_side_ptr(), libMesh::Prism6::build_side_ptr(), libMesh::Pyramid5::build_side_ptr(), libMesh::InfHex8::build_side_ptr(), libMesh::Tri3::build_side_ptr(), libMesh::Hex8::build_side_ptr(), libMesh::InfPrism6::build_side_ptr(), libMesh::InfPrism12::build_side_ptr(), libMesh::Tet4::build_side_ptr(), libMesh::InfHex18::build_side_ptr(), libMesh::InfQuad6::build_side_ptr(), libMesh::Quad8::build_side_ptr(), libMesh::InfHex16::build_side_ptr(), libMesh::Tet10::build_side_ptr(), libMesh::Tri6::build_side_ptr(), libMesh::Hex20::build_side_ptr(), libMesh::Prism15::build_side_ptr(), libMesh::Pyramid13::build_side_ptr(), libMesh::Quad9::build_side_ptr(), libMesh::Hex27::build_side_ptr(), libMesh::Prism18::build_side_ptr(), libMesh::Pyramid14::build_side_ptr(), libMesh::MeshTools::Modification::change_subdomain_id(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::TriangleWrapper::copy_tri_to_mesh(), libMesh::UnstructuredMesh::create_submesh(), libMesh::DofMap::dof_indices(), libMesh::Elem::Elem(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::MeshTools::Modification::flatten(), MeshExtruderTest::QueryElemSubdomainID::get_subdomain_for_layer(), libMesh::UNVIO::groups_in(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::RBDataDeserialization::load_elem_into_mesh(), libMesh::DofMap::old_dof_indices(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::XdrIO::pack_element(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::UCDIO::read_implementation(), libMesh::GmshIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::Prism::side_ptr(), libMesh::Pyramid::side_ptr(), libMesh::Edge::side_ptr(), libMesh::InfPrism::side_ptr(), libMesh::InfHex::side_ptr(), libMesh::InfQuad::side_ptr(), libMesh::Elem::simple_build_side_ptr(), libMesh::Elem::simple_side_ptr(), SystemsTest::testDofCouplingWithVarGroups(), MeshExtruderTest::testExtruder(), SystemsTest::tripleValueTest(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ system_var_to_vg_var()

unsigned int libMesh::DofObject::system_var_to_vg_var ( const unsigned int  s,
const unsigned int  vg,
const unsigned int  var 
) const
inlineprivateinherited

Utility function - for variable var in system s, figure out what variable group it lives in.

Definition at line 1271 of file dof_object.h.

1274 {
1275  unsigned int accumulated_sum=0;
1276 
1277  for (unsigned int vgc=0; vgc<vg; vgc++)
1278  accumulated_sum += this->n_vars(s,vgc);
1279 
1280  libmesh_assert_less_equal (accumulated_sum, var);
1281 
1282  return (var - accumulated_sum);
1283 }

References libMesh::DofObject::n_vars().

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

◆ 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 2460 of file elem.h.

2461 {
2462  const Elem * tp = this;
2463 
2464  // Keep getting the element's parent
2465  // until that parent is at level-0
2466  while (tp->parent() != nullptr)
2467  tp = tp->parent();
2468 
2469  libmesh_assert(tp);
2470  libmesh_assert_equal_to (tp->level(), 0);
2471 
2472  return tp;
2473 }

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(), and ExtraIntegersTest::test_final_integers().

◆ 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 865 of file elem.C.

869 {
870  libmesh_assert_less (i, this->n_neighbors());
871 
872  const Elem * neighbor_i = this->neighbor_ptr(i);
873  if (neighbor_i != nullptr)
874  return neighbor_i;
875 
876  if (pb)
877  {
878  // Since the neighbor is nullptr it must be on a boundary. We need
879  // see if this is a periodic boundary in which case it will have a
880  // topological neighbor
881  std::vector<boundary_id_type> bc_ids;
882  mesh.get_boundary_info().boundary_ids(this, cast_int<unsigned short>(i), bc_ids);
883  for (const auto & id : bc_ids)
884  if (pb->boundary(id))
885  {
886  neighbor_i = pb->neighbor(id, point_locator, this, i);
887 
888  // Since coarse elements do not have more refined
889  // neighbors we need to make sure that we don't return one
890  // of these types of neighbors.
891  if (neighbor_i)
892  while (level() < neighbor_i->level())
893  neighbor_i = neighbor_i->parent();
894  return neighbor_i;
895  }
896  }
897 
898  return nullptr;
899 }

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::DefaultCoupling::operator()(), and libMesh::MeshRefinement::topological_neighbor().

◆ 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 823 of file elem.C.

827 {
828  libmesh_assert_less (i, this->n_neighbors());
829 
830  Elem * neighbor_i = this->neighbor_ptr(i);
831  if (neighbor_i != nullptr)
832  return neighbor_i;
833 
834  if (pb)
835  {
836  // Since the neighbor is nullptr it must be on a boundary. We need
837  // see if this is a periodic boundary in which case it will have a
838  // topological neighbor
839  std::vector<boundary_id_type> bc_ids;
840  mesh.get_boundary_info().boundary_ids(this, cast_int<unsigned short>(i), bc_ids);
841  for (const auto & id : bc_ids)
842  if (pb->boundary(id))
843  {
844  // Since the point locator inside of periodic boundaries
845  // returns a const pointer we will retrieve the proper
846  // pointer directly from the mesh object.
847  const Elem * const cn = pb->neighbor(id, point_locator, this, i);
848  neighbor_i = const_cast<Elem *>(cn);
849 
850  // Since coarse elements do not have more refined
851  // neighbors we need to make sure that we don't return one
852  // of these types of neighbors.
853  if (neighbor_i)
854  while (level() < neighbor_i->level())
855  neighbor_i = neighbor_i->parent();
856  return neighbor_i;
857  }
858  }
859 
860  return nullptr;
861 }

References libMesh::PeriodicBoundaries::boundary(), libMesh::Elem::level(), mesh, libMesh::Elem::n_neighbors(), libMesh::PeriodicBoundaries::neighbor(), libMesh::Elem::neighbor_ptr(), and libMesh::Elem::parent().

◆ 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 1457 of file elem.C.

1459 {
1460  ElemInternal::total_family_tree(this, family, reset);
1461 }

References libMesh::ElemInternal::total_family_tree().

Referenced by libMesh::connect_families(), and libMesh::Partitioner::set_parent_processor_ids().

◆ 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 1465 of file elem.C.

1467 {
1468  ElemInternal::total_family_tree(this, family, reset);
1469 }

References libMesh::ElemInternal::total_family_tree().

◆ 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 1543 of file elem.C.

1546 {
1547  ElemInternal::total_family_tree_by_neighbor(this, family, neighbor, reset);
1548 }

References libMesh::ElemInternal::total_family_tree_by_neighbor().

◆ 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 1552 of file elem.C.

1555 {
1556  ElemInternal::total_family_tree_by_neighbor(this, family, neighbor, reset);
1557 }

References libMesh::ElemInternal::total_family_tree_by_neighbor().

◆ 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 1581 of file elem.C.

1585 {
1586  ElemInternal::total_family_tree_by_subneighbor(this, family, neighbor, subneighbor, reset);
1587 }

References libMesh::ElemInternal::total_family_tree_by_subneighbor().

◆ 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 1591 of file elem.C.

1595 {
1596  ElemInternal::total_family_tree_by_subneighbor(this, family, neighbor, subneighbor, reset);
1597 }

References libMesh::ElemInternal::total_family_tree_by_subneighbor().

◆ type()

virtual ElemType libMesh::RemoteElem::type ( ) const
inlineoverridevirtual
Returns
The type of element that has been derived from this base class.

Implements libMesh::Elem.

Definition at line 109 of file remote_elem.h.

110  { return REMOTEELEM; }

References libMesh::REMOTEELEM.

◆ unique_id()

unique_id_type libMesh::DofObject::unique_id ( ) const
inlineinherited

◆ 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 589 of file dof_object.C.

590 {
591  _idx_buf.clear();
592 
593 #ifdef LIBMESH_ENABLE_AMR
594  this->clear_old_dof_object();
595  const bool has_old_dof_object = cast_int<bool>(*begin++);
596 #endif
597 
598  const largest_id_type size = *begin++;
599  _idx_buf.reserve(size);
600  std::copy(begin, begin+size, back_inserter(_idx_buf));
601 
602  // Check as best we can for internal consistency now
603  libmesh_assert(_idx_buf.empty() ||
605  cast_int<dof_id_signed_type>(_idx_buf.size())));
606 #ifdef DEBUG
607  if (!_idx_buf.empty())
608  {
609  const int hdr = cast_int<int>(dof_id_signed_type(_idx_buf[0]));
610  const unsigned int ns = hdr >= 0 ? hdr : (-hdr-1);
611  for (unsigned int i=1; i < ns; ++i)
612  {
613  libmesh_assert_greater_equal (_idx_buf[i], _idx_buf[i-1]);
614  libmesh_assert_equal_to ((_idx_buf[i] - _idx_buf[i-1])%2, 0);
615  libmesh_assert_less_equal (_idx_buf[i], _idx_buf.size());
616  }
617  if (hdr < 0 && ns > 0)
618  {
619  libmesh_assert_greater_equal(_idx_buf[ns], _idx_buf[ns-1]);
620  libmesh_assert_less_equal(_idx_buf[ns], _idx_buf.size());
621  }
622  }
623 #endif
624 
625 #ifdef LIBMESH_ENABLE_AMR
626  if (has_old_dof_object)
627  {
628  this->old_dof_object = new DofObject();
629  this->old_dof_object->unpack_indexing(begin+size);
630  }
631 #endif
632 }

References libMesh::DofObject::_idx_buf, std::abs(), libMesh::DofObject::clear_old_dof_object(), libMesh::DofObject::DofObject(), libMesh::libmesh_assert(), libMesh::DofObject::old_dof_object, and libMesh::DofObject::unpack_indexing().

Referenced by libMesh::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), and libMesh::DofObject::unpack_indexing().

◆ 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 569 of file dof_object.C.

570 {
571 #ifdef LIBMESH_ENABLE_AMR
572  const bool has_old_dof_object = cast_int<bool>(*begin++);
573 
574  static const int dof_header_size = 2;
575 #else
576  static const bool has_old_dof_object = false;
577  static const int dof_header_size = 1;
578 #endif
579 
580  const largest_id_type this_indexing_size = *begin++;
581 
582  return cast_int<unsigned int>
583  (dof_header_size + this_indexing_size +
584  (has_old_dof_object ?
585  unpackable_indexing_size(begin+this_indexing_size) : 0));
586 }

Referenced by libMesh::Parallel::Packing< const Elem * >::packed_size(), libMesh::Parallel::Packing< const Node * >::packed_size(), and libMesh::Parallel::Packing< Node * >::unpack().

◆ 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 853 of file dof_object.h.

854 {
856 }

References libMesh::DofObject::_processor_id, and libMesh::DofObject::invalid_processor_id.

Referenced by DofObjectTest< Node >::testInvalidateProcId(), and DofObjectTest< Node >::testValidProcId().

◆ valid_unique_id()

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

◆ var_to_vg()

unsigned int libMesh::DofObject::var_to_vg ( const unsigned int  s,
const unsigned int  var 
) const
inlineprivateinherited

Utility function - for variable var in system s, figure out what variable group it lives in.

Definition at line 1253 of file dof_object.h.

1255 {
1256  const unsigned int
1257  nvg = this->n_var_groups(s);
1258 
1259  for (unsigned int vg=0, vg_end=0; vg<nvg; vg++)
1260  {
1261  vg_end += this->n_vars(s,vg);
1262  if (var < vg_end) return vg;
1263  }
1264 
1265  libmesh_error_msg("Error: could not map variable " << var << " to variable group.");
1266 }

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

Referenced by libMesh::DofObject::n_comp(), libMesh::DofObject::set_dof_number(), and libMesh::DofObject::set_n_comp().

◆ 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 1112 of file dof_object.h.

1114 {
1115  std::pair<unsigned int, unsigned int> returnval(0,0);
1116 
1117  unsigned int & vg = returnval.first;
1118  unsigned int & offset = returnval.second;
1119 
1120  unsigned int vg_start = 0;
1121  for (; ; vg++)
1122  {
1123  libmesh_assert_less(vg, this->n_var_groups(s));
1124 
1125  const unsigned int vg_end = vg_start + this->n_vars(s,vg);
1126  if (var < vg_end)
1127  {
1128  offset = var - vg_start;
1129  return returnval;
1130  }
1131  vg_start = vg_end;
1132  }
1133 }

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().

◆ 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 1229 of file dof_object.h.

1231 {
1232  libmesh_assert_less (s, this->n_systems());
1233  libmesh_assert_less (vg, this->n_var_groups(s));
1234 
1235  const unsigned int
1236  start_idx_sys = this->start_idx(s);
1237 
1238  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1239 
1240  // #ifdef DEBUG
1241  // std::cout << " [ ";
1242  // for (auto i : _idx_buf)
1243  // std::cout << i << " ";
1244  // std::cout << "]\n";
1245  // #endif
1246 
1247  return _idx_buf[start_idx_sys + 2*vg + 1];
1248 }

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().

◆ volume()

Real libMesh::Elem::volume ( ) const
virtualinherited
Returns
The (length/area/volume) of the geometric element.

Reimplemented in libMesh::Hex27, libMesh::Prism18, libMesh::Pyramid14, libMesh::Hex20, libMesh::Prism15, libMesh::Tet10, libMesh::Pyramid13, libMesh::Quad9, libMesh::Tri6, libMesh::Quad8, libMesh::Tet4, libMesh::Hex8, libMesh::Edge4, libMesh::Prism6, libMesh::Pyramid5, libMesh::Tri3, libMesh::Edge3, libMesh::Quad4, and libMesh::Edge2.

Definition at line 2617 of file elem.C.

2618 {
2619  // The default implementation builds a finite element of the correct
2620  // order and sums up the JxW contributions. This can be expensive,
2621  // so the various element types can overload this method and compute
2622  // the volume more efficiently.
2623  const FEFamily mapping_family = FEMap::map_fe_type(*this);
2624  const FEType fe_type(this->default_order(), mapping_family);
2625 
2626  std::unique_ptr<FEBase> fe (FEBase::build(this->dim(),
2627  fe_type));
2628 
2629  const std::vector<Real> & JxW = fe->get_JxW();
2630 
2631  // The default quadrature rule should integrate the mass matrix,
2632  // thus it should be plenty to compute the area
2633  QGauss qrule (this->dim(), fe_type.default_quadrature_order());
2634 
2635  fe->attach_quadrature_rule(&qrule);
2636 
2637  fe->reinit(this);
2638 
2639  Real vol=0.;
2640  for (auto jxw : JxW)
2641  vol += jxw;
2642 
2643  return vol;
2644 
2645 }

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 libMesh::Elem::get_info(), libMesh::Quad8::volume(), libMesh::Tri6::volume(), libMesh::Quad9::volume(), libMesh::Pyramid13::volume(), libMesh::Tet10::volume(), libMesh::Prism15::volume(), libMesh::Hex20::volume(), libMesh::Pyramid14::volume(), libMesh::Hex27::volume(), and libMesh::Prism18::volume().

◆ 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 2596 of file elem.h.

2597 {
2598  libmesh_assert(e);
2599  libmesh_assert (this->has_children());
2600 
2601  unsigned int nc = this->n_children();
2602  for (unsigned int c=0; c != nc; c++)
2603  if (this->child_ptr(c) == e)
2604  return c;
2605 
2606  libmesh_error_msg("ERROR: which_child_am_i() was called with a non-child!");
2607 
2608  return libMesh::invalid_uint;
2609 }

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::Parallel::Packing< const Elem * >::pack(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::MeshTools::Modification::smooth(), and libMesh::Parallel::sync_element_data_by_parent_id().

◆ 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 2323 of file elem.h.

2324 {
2325  libmesh_assert(e);
2326 
2327  const Elem * eparent = e;
2328 
2329  while (eparent->level() > this->level())
2330  {
2331  eparent = eparent->parent();
2332  libmesh_assert(eparent);
2333  }
2334 
2335  for (auto s : IntRange<unsigned int>(0, this->n_sides()))
2336  if (this->neighbor_ptr(s) == eparent)
2337  return s;
2338 
2339  return libMesh::invalid_uint;
2340 }

References libMesh::invalid_uint, libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor_ptr(), and libMesh::Elem::parent().

Referenced by assemble_ellipticdg(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::Elem::libmesh_assert_valid_neighbors(), and libMesh::Elem::nullify_neighbors().

◆ which_node_am_i()

virtual unsigned int libMesh::RemoteElem::which_node_am_i ( unsigned int  side,
unsigned int  side_node 
) const
inlineoverridevirtual
Returns
The local node id for node side_node on side side of this Elem. Simply relies on the side_nodes_map for each of the derived types. For example, Tri3::which_node_am_i(0, 0) -> 0 Tri3::which_node_am_i(0, 1) -> 1 Tri3::which_node_am_i(1, 0) -> 1 Tri3::which_node_am_i(1, 1) -> 2 etc...

Implements libMesh::Elem.

Definition at line 97 of file remote_elem.h.

99  { libmesh_not_implemented(); return 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 475 of file elem.C.

476 {
477  libmesh_assert(e);
478 
479  const unsigned int ns = this->n_sides();
480  const unsigned int nn = this->n_nodes();
481 
482  const unsigned int en = e->n_nodes();
483 
484  // e might be on any side until proven otherwise
485  std::vector<bool> might_be_side(ns, true);
486 
487  for (unsigned int i=0; i != en; ++i)
488  {
489  Point side_point = e->point(i);
490  unsigned int local_node_id = libMesh::invalid_uint;
491 
492  // Look for a node of this that's contiguous with node i of
493  // e. Note that the exact floating point comparison of Point
494  // positions is intentional, see the class documentation for
495  // this function.
496  for (unsigned int j=0; j != nn; ++j)
497  if (this->point(j) == side_point)
498  local_node_id = j;
499 
500  // If a node of e isn't contiguous with some node of this, then
501  // e isn't a side of this.
502  if (local_node_id == libMesh::invalid_uint)
503  return libMesh::invalid_uint;
504 
505  // If a node of e isn't contiguous with some node on side s of
506  // this, then e isn't on side s.
507  for (unsigned int s=0; s != ns; ++s)
508  if (!this->is_node_on_side(local_node_id, s))
509  might_be_side[s] = false;
510  }
511 
512  for (unsigned int s=0; s != ns; ++s)
513  if (might_be_side[s])
514  {
515 #ifdef DEBUG
516  for (unsigned int s2=s+1; s2 < ns; ++s2)
517  libmesh_assert (!might_be_side[s2]);
518 #endif
519  return s;
520  }
521 
522  // Didn't find any matching side
523  return libMesh::invalid_uint;
524 }

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().

◆ 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 1283 of file elem.C.

1285 {
1286  libmesh_assert (out_stream.good());
1288  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
1289 
1290  switch (iop)
1291  {
1292  case TECPLOT:
1293  {
1294  // This connectivity vector will be used repeatedly instead
1295  // of being reconstructed inside the loop.
1296  std::vector<dof_id_type> conn;
1297  for (auto sc : IntRange<unsigned int>(0, this->n_sub_elem()))
1298  {
1299  this->connectivity(sc, TECPLOT, conn);
1300 
1301  std::copy(conn.begin(),
1302  conn.end(),
1303  std::ostream_iterator<dof_id_type>(out_stream, " "));
1304 
1305  out_stream << '\n';
1306  }
1307  return;
1308  }
1309 
1310  case UCD:
1311  {
1312  for (auto i : this->node_index_range())
1313  out_stream << this->node_id(i)+1 << "\t";
1314 
1315  out_stream << '\n';
1316  return;
1317  }
1318 
1319  default:
1320  libmesh_error_msg("Unsupported IO package " << iop);
1321  }
1322 }

References libMesh::Elem::_nodes, libMesh::Elem::connectivity(), libMesh::INVALID_IO_PACKAGE, libMesh::libmesh_assert(), libMesh::Elem::n_sub_elem(), libMesh::Elem::node_id(), libMesh::Elem::node_index_range(), libMesh::TECPLOT, and libMesh::UCD.

Member Data Documentation

◆ _children

Elem** libMesh::Elem::_children
protectedinherited

◆ _counts [1/2]

ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited

◆ _counts [2/2]

ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited

◆ _elemlinks

Elem** libMesh::Elem::_elemlinks
protectedinherited

Pointers to this element's parent and neighbors, and for lower-dimensional elements' interior_parent.

Definition at line 1749 of file elem.h.

Referenced by libMesh::Elem::Elem(), libMesh::Elem::interior_parent(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::neighbor_ptr_range(), libMesh::Elem::parent(), libMesh::Elem::set_interior_parent(), libMesh::Elem::set_neighbor(), and libMesh::Elem::set_parent().

◆ _elemlinks_data

Elem* libMesh::RemoteElem::_elemlinks_data[1]
protected

Data for link to (nullptr!) parent.

Definition at line 216 of file remote_elem.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 141 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 141 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info(), and libMesh::ReferenceCounter::print_info().

◆ _id

dof_id_type libMesh::DofObject::_id
privateinherited

◆ _idx_buf

index_buffer_t libMesh::DofObject::_idx_buf
privateinherited

◆ _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 1797 of file elem.h.

Referenced by libMesh::Elem::Elem(), libMesh::Elem::mapping_data(), 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 1791 of file elem.h.

Referenced by libMesh::Elem::Elem(), libMesh::Elem::mapping_type(), and libMesh::Elem::set_mapping_type().

◆ _mutex [1/2]

Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 135 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 135 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 130 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 130 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().

◆ _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 1784 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 1774 of file elem.h.

Referenced by libMesh::Elem::p_refinement_flag(), and libMesh::Elem::set_p_refinement_flag().

◆ _processor_id

processor_id_type libMesh::DofObject::_processor_id
privateinherited

The processor_id of the DofObject.

Degrees of freedom are wholly owned by processors, however they may be duplicated on other processors.

This is stored as an unsigned short int since we cannot expect to be solving on 65000+ processors any time soon, can we??

Definition at line 527 of file dof_object.h.

Referenced by libMesh::DofObject::operator=(), libMesh::DofObject::processor_id(), and libMesh::DofObject::valid_processor_id().

◆ _rflag

unsigned char libMesh::Elem::_rflag
protectedinherited

h refinement flag.

This is stored as an unsigned char to save space.

Definition at line 1768 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 1761 of file elem.h.

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

◆ _unique_id

unique_id_type libMesh::DofObject::_unique_id
privateinherited

A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.

Definition at line 510 of file dof_object.h.

Referenced by libMesh::DofObject::operator=(), libMesh::DofObject::set_unique_id(), libMesh::DofObject::unique_id(), and libMesh::DofObject::valid_unique_id().

◆ ConstNeighborPtrIter

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

Definition at line 299 of file elem.h.

◆ 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 421 of file dof_object.h.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::Node::active(), libMesh::DofObject::add_extra_integers(), libMesh::TopologyMap::add_node(), libMesh::MeshRefinement::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Elem::bracketing_nodes(), 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_RB_space(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::TopologyMap::find(), libMesh::DofMap::gather_constraints(), libMesh::ReplicatedMesh::insert_node(), 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::Parallel::Packing< const Elem * >::pack(), libMesh::XdrIO::pack_element(), libMesh::SFCPartitioner::partition_range(), libMesh::Elem::point(), libMesh::System::read_legacy_data(), libMesh::DynaIO::read_mesh(), libMesh::System::read_parallel_data(), libMesh::XdrIO::read_serialized_connectivity(), 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(), DofObjectTest< Node >::testSetNSystemsExtraInts(), DofObjectTest< Node >::testSetNVariableGroupsExtraInts(), DofObjectTest< Node >::testValidId(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DofObject::valid_id(), and libMesh::System::write_parallel_data().

◆ 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 432 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::UnstructuredMesh::all_second_order(), libMesh::MeshCommunication::allgather(), libMesh::Node::choose_processor_id(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubProjector::construct_projection(), libMesh::MeshTools::create_bounding_box(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), 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::DistributedMesh::insert_elem(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::insert_id(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::insert_ids(), 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_unpartitioned_elem(), libMesh::MeshBase::n_unpartitioned_nodes(), libMesh::SparsityPattern::Build::operator()(), libMesh::Partitioner::processor_pairs_to_interface_nodes(), libMesh::DistributedMesh::renumber_dof_objects(), 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::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::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), 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 244 of file elem.h.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::BoundaryInfo::add_elements(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), and libMesh::BoundaryInfo::sync().

◆ invalid_unique_id

const unique_id_type libMesh::DofObject::invalid_unique_id = static_cast<unique_id_type>(-1)
staticinherited

◆ LIBMESH_ENABLE_TOPOLOGY_CACHES

libMesh::RemoteElem::LIBMESH_ENABLE_TOPOLOGY_CACHES

Definition at line 206 of file remote_elem.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 587 of file elem.h.

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

◆ ncv_magic

const index_t libMesh::DofObject::ncv_magic = 256
staticprivateinherited

Above we introduced the chimera ncv, which is a hybrid of the form ncv = ncv_magic*nv + nc where nv are the number of identical variables of a given type, and nc is the number of components for this set of variables.

It is hoped that by setting this to a power of two, an optimizing compiler will recognize later that #/ncv_magic is simply a bitshift

Definition at line 624 of file dof_object.h.

Referenced by libMesh::DofObject::n_comp_group(), libMesh::DofObject::set_n_comp_group(), and libMesh::DofObject::set_n_vars_per_group().

◆ ncv_magic_exp

const index_t libMesh::DofObject::ncv_magic_exp = 8
staticprivateinherited

Definition at line 625 of file dof_object.h.

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

◆ old_dof_object

DofObject* libMesh::DofObject::old_dof_object
inherited

◆ remote_elem_id

const dof_id_type libMesh::RemoteElem::remote_elem_id = static_cast<dof_id_type>(-2)
static

A unique id to distinguish remote element links.

Definition at line 52 of file remote_elem.h.

◆ 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.

Definition at line 656 of file elem.h.

Referenced by libMesh::Parallel::Packing< const Elem * >::packed_size().

◆ type_to_n_nodes_map

const unsigned int libMesh::Elem::type_to_n_nodes_map
staticinherited

◆ 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.

Definition at line 607 of file elem.h.

Referenced by libMesh::Parallel::Packing< const Elem * >::packed_size().


The documentation for this class was generated from the following files:
libMesh::ElemInternal::find_interior_neighbors
void find_interior_neighbors(T this_elem, std::set< T > &neighbor_set)
Definition: elem_internal.h:472
libMesh::HEX20
Definition: enum_elem_type.h:48
libMesh::DofObject::valid_id
bool valid_id() const
Definition: dof_object.h:809
libMesh::Elem::find_point_neighbors
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:560
libMesh::dof_id_type
uint8_t dof_id_type
Definition: id_types.h:67
libMesh::ElemInternal::family_tree
void family_tree(T elem, std::vector< T > &family, bool reset=true)
Definition: elem_internal.h:41
libMesh::PRISM6
Definition: enum_elem_type.h:50
libMesh::Elem::child_ptr
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2567
libMesh::Elem::is_node_on_side
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
libMesh::Elem::is_vertex_on_child
virtual unsigned int is_vertex_on_child(unsigned int, unsigned int n) const
Definition: elem.h:681
libMesh::Elem::_last_side
SideIter _last_side()
Definition: elem.h:2892
libMesh::Elem::n_edges
virtual unsigned int n_edges() const =0
libMesh::DofObject::end_idx
unsigned int end_idx(const unsigned int s) const
The ending index for system s.
Definition: dof_object.h:1172
libMesh::invalid_uint
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
Definition: libmesh.h:249
libMesh::FEInterface::on_reference_element
static bool on_reference_element(const Point &p, const ElemType t, const Real eps=TOLERANCE)
Definition: fe_interface.C:677
libMesh::Elem::set_p_refinement_flag
void set_p_refinement_flag(const RefinementState pflag)
Sets the value of the p-refinement flag for the element.
Definition: elem.h:2638
libMesh::DofObject::_processor_id
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:527
libMesh::DofObject::n_systems
unsigned int n_systems() const
Definition: dof_object.h:861
libMesh::Elem::JUST_REFINED
Definition: elem.h:1172
libMesh::RemoteElem::n_nodes
virtual unsigned int n_nodes() const override
Definition: remote_elem.h:115
libMesh::RemoteElem::remote_elem_id
static const dof_id_type remote_elem_id
A unique id to distinguish remote element links.
Definition: remote_elem.h:52
libMesh::Elem::contains_edge_of
bool contains_edge_of(const Elem *e) const
Definition: elem.C:539
libMesh::DofObject::old_dof_object
DofObject * old_dof_object
This object on the last mesh.
Definition: dof_object.h:81
libMesh::DofObject::unpack_indexing
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 w...
Definition: dof_object.C:589
libMesh::DofObject::unpackable_indexing_size
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:569
libMesh::ElemInternal::family_tree_by_neighbor
void family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)
Definition: elem_internal.h:182
libMesh::Elem::level
unsigned int level() const
Definition: elem.h:2478
libMesh::DofObject::ncv_magic
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:624
libMesh::Elem::child_ref_range
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:1839
libMesh::DofObject::start_idx
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1161
libMesh::Elem::_first_side
SideIter _first_side()
Side iterator helper functions.
Definition: elem.h:2884
libMesh::Elem::n_nodes
virtual unsigned int n_nodes() const =0
libMesh::HEX8
Definition: enum_elem_type.h:47
libMesh::Elem::embedding_matrix
virtual float embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
libMesh::Elem::contains_point
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2094
libMesh::EDGE4
Definition: enum_elem_type.h:37
libMesh::INFHEX8
Definition: enum_elem_type.h:60
libMesh::INFQUAD4
Definition: enum_elem_type.h:58
libMesh::Elem::parent_bracketing_nodes
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes(unsigned int c, unsigned int n) const
Definition: elem.C:1794
libMesh::Elem::COARSEN
Definition: elem.h:1169
libMesh::Elem::n_neighbors
unsigned int n_neighbors() const
Definition: elem.h:631
libMesh::Elem::ancestor
bool ancestor() const
Definition: elem.C:1350
libMesh::Elem::_children
Elem ** _children
Pointers to this element's children.
Definition: elem.h:1755
libMesh::DofObject::set_id
dof_id_type & set_id()
Definition: dof_object.h:776
libMesh::DofObject::var_to_vg
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:1253
libMesh::Elem::set_p_level
void set_p_level(const unsigned int p)
Sets the value of the p-refinement level for the element.
Definition: elem_refinement.C:41
libMesh::Elem::dim
virtual unsigned short dim() const =0
libMesh::Elem::COARSEN_INACTIVE
Definition: elem.h:1175
libMesh::DofObject::start_idx_ints
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1185
libMesh::TET10
Definition: enum_elem_type.h:46
libMesh::DofObject::_idx_buf
index_buffer_t _idx_buf
Definition: dof_object.h:613
libMesh::INVALID_IO_PACKAGE
Definition: enum_io_package.h:48
libMesh::ElemInternal::active_family_tree_by_side
void active_family_tree_by_side(T elem, std::vector< T > &family, unsigned int side, bool reset=true)
Definition: elem_internal.h:149
libMesh::Elem::infinite
virtual bool infinite() const =0
end
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end.
Definition: variant_filter_iterator.h:343
libMesh::ReferenceCounter::_counts
static Counts _counts
Actually holds the data.
Definition: reference_counter.h:122
std::sqrt
MetaPhysicL::DualNumber< T, D > sqrt(const MetaPhysicL::DualNumber< T, D > &in)
libMesh::TOLERANCE
static const Real TOLERANCE
Definition: libmesh_common.h:128
libMesh::Elem::set_neighbor
void set_neighbor(const unsigned int i, Elem *n)
Assigns n as the neighbor.
Definition: elem.h:2105
libMesh::DofObject::set_n_comp_group
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:410
libMesh::DofObject::n_var_groups
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:881
libMesh::Elem::p_level
unsigned int p_level() const
Definition: elem.h:2512
libMesh::Elem::neighbor_ptr_range
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Returns a range with all neighbors of an element, usable in range-based for loops.
Definition: elem.h:2917
libMesh::ReferenceCounter::_n_objects
static Threads::atomic< unsigned int > _n_objects
The number of objects.
Definition: reference_counter.h:130
libMesh::Elem::node_index_range
IntRange< unsigned short > node_index_range() const
Definition: elem.h:2170
libMesh::Elem::_sbd_id
subdomain_id_type _sbd_id
The subdomain to which this element belongs.
Definition: elem.h:1761
libMesh::FEMap::map
static Point map(const unsigned int dim, const Elem *elem, const Point &reference_point)
Definition: fe_map.C:2043
libMesh::DofObject::set_vg_dof_base
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:1209
mesh
MeshBase & mesh
Definition: mesh_communication.C:1257
libMesh::DofObject::valid_unique_id
bool valid_unique_id() const
Definition: dof_object.h:817
libMesh::DofObject::ncv_magic_exp
static const index_t ncv_magic_exp
Definition: dof_object.h:625
libMesh::largest_id_type
uint64_t largest_id_type
Definition: id_types.h:148
libMesh::Elem::_map_data
unsigned char _map_data
Mapping function data; currently used when needed to store the RATIONAL_BERNSTEIN nodal weight data i...
Definition: elem.h:1797
libMesh::Elem::_pflag
unsigned char _pflag
p refinement flag.
Definition: elem.h:1774
libMesh::Elem::_p_level
unsigned char _p_level
p refinement level - the difference between the polynomial degree on this element and the minimum pol...
Definition: elem.h:1784
libMesh::ReferenceCounter::get_info
static std::string get_info()
Gets a string containing the reference information.
Definition: reference_counter.C:47
libMesh::DofObject::processor_id
processor_id_type processor_id() const
Definition: dof_object.h:829
libMesh::INFEDGE2
Definition: enum_elem_type.h:57
libMesh::Elem::active
bool active() const
Definition: elem.h:2345
libMesh::Elem::_nodes
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:1743
libMesh::ElemInternal::total_family_tree_by_neighbor
void total_family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)
Definition: elem_internal.h:211
libMesh::Elem::_rflag
unsigned char _rflag
h refinement flag.
Definition: elem.h:1768
libMesh::Elem::point
const Point & point(const unsigned int i) const
Definition: elem.h:1955
libMesh::DofObject::system_var_to_vg_var
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:1271
libMesh::DofObject::packed_indexing_size
unsigned int packed_indexing_size() const
If we pack our indices into an buffer for communications, how many ints do we need?
Definition: dof_object.C:554
libMesh::RemoteElem::RemoteElem
RemoteElem()
Constructor.
Definition: remote_elem.h:58
libMesh::TET4
Definition: enum_elem_type.h:45
libMesh::parent_indices_mutex
Threads::spin_mutex parent_indices_mutex
Definition: elem.C:86
libMesh::PRISM15
Definition: enum_elem_type.h:51
libMesh::Elem::has_neighbor
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2115
libMesh::ElemInternal::find_point_neighbors
void find_point_neighbors(T this_elem, std::set< T > &neighbor_set, T start_elem)
Definition: elem_internal.h:400
libMesh::DofObject::dof_number
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:956
libMesh::INFPRISM6
Definition: enum_elem_type.h:63
libMesh::libmesh_assert
libmesh_assert(ctx)
libMesh::Elem::connectivity
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const =0
libMesh::Elem::is_mid_infinite_edge_node
virtual bool is_mid_infinite_edge_node(const unsigned int) const
Definition: elem.h:1584
libMesh::DofObject::invalid_unique_id
static const unique_id_type invalid_unique_id
An invalid unique_id to distinguish an uninitialized DofObject.
Definition: dof_object.h:426
libMesh::DofObject::n_extra_integers
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1082
libMesh::Elem::subactive
bool subactive() const
Definition: elem.h:2363
std::abs
MetaPhysicL::DualNumber< T, D > abs(const MetaPhysicL::DualNumber< T, D > &in)
libMesh::HEX27
Definition: enum_elem_type.h:49
libMesh::Elem::node_ref_range
SimpleRange< NodeRefIter > node_ref_range()
Returns a range with all nodes of an element, usable in range-based for loops.
Definition: elem.h:2152
libMesh::FEMap::inverse_map
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_map.C:1622
libMesh::DofObject::clear_old_dof_object
void clear_old_dof_object()
Sets the old_dof_object to nullptr.
Definition: dof_object.C:142
libMesh::Elem::p_refinement_flag
RefinementState p_refinement_flag() const
Definition: elem.h:2630
libMesh::Elem::volume
virtual Real volume() const
Definition: elem.C:2617
libMesh::DofObject::n_comp
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:926
libMesh::REMOTEELEM
Definition: enum_elem_type.h:68
libMesh::Threads::spin_mtx
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
libMesh::libmesh_ignore
void libmesh_ignore(const Args &...)
Definition: libmesh_common.h:526
libMesh::FEGenericBase::build
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
libMesh::DofObject::invalid_id
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:421
libMesh::INFHEX18
Definition: enum_elem_type.h:62
libMesh::dof_id_signed_type
int8_t dof_id_signed_type
Definition: id_types.h:68
libMesh::QUAD4
Definition: enum_elem_type.h:41
libMesh::DofObject::var_to_vg_and_offset
std::pair< unsigned int, unsigned int > var_to_vg_and_offset(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:1112
libMesh::TRI3
Definition: enum_elem_type.h:39
libMesh::Elem::n_vertices
virtual unsigned int n_vertices() const =0
libMesh::Utility::hashword2
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:210
libMesh::Elem::default_order
virtual Order default_order() const =0
libMesh::MeshTools::Generation::Private::idx
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.
Definition: mesh_generation.C:72
libMesh::Elem::DO_NOTHING
Definition: elem.h:1170
libMesh::DofObject::set_n_systems
void set_n_systems(const unsigned int s)
Sets the number of systems for this DofObject.
Definition: dof_object.C:165
libMesh::DofObject::has_extra_integers
bool has_extra_integers() const
Returns whether extra integers are associated to the DofObject.
Definition: dof_object.h:1100
libMesh::FEMap::map_fe_type
static FEFamily map_fe_type(const Elem &elem)
Definition: fe_map.C:47
libMesh::as_range
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libMesh::Elem::JUST_COARSENED
Definition: elem.h:1173
libMesh::Elem::REFINE
Definition: elem.h:1171
libMesh::INFHEX16
Definition: enum_elem_type.h:61
libMesh::Elem::n_nodes_in_child
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:600
libMesh::DofObject::unique_id
unique_id_type unique_id() const
Definition: dof_object.h:784
libMesh::DofObject::pack_indexing
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 o...
Definition: dof_object.C:636
libMesh::ElemInternal::total_family_tree_by_subneighbor
void total_family_tree_by_subneighbor(T elem, std::vector< T > &family, T neighbor_in, T subneighbor, bool reset=true)
Definition: elem_internal.h:280
libMesh::Utility::enum_to_string
std::string enum_to_string(const T e)
libMesh::ElemInternal::active_family_tree_by_neighbor
void active_family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)
Definition: elem_internal.h:320
libMesh::ElemInternal::active_family_tree
void active_family_tree(T elem, std::vector< T > &active_family, bool reset=true)
Definition: elem_internal.h:90
libMesh::DofObject::n_vars
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:891
libMesh::Elem::Elem
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1871
libMesh::ElemInternal::total_family_tree
void total_family_tree(T elem, std::vector< T > &family, bool reset)
Definition: elem_internal.h:67
libMesh::Elem::set_child
void set_child(unsigned int c, Elem *elem)
Sets the pointer to the child for this element.
Definition: elem.h:2586
libMesh::Elem::as_parent_node
virtual unsigned int as_parent_node(unsigned int c, unsigned int n) const
Definition: elem.C:1726
libMesh::Elem::set_node
virtual Node *& set_node(const unsigned int i)
Definition: elem.h:2059
libMesh::INFPRISM12
Definition: enum_elem_type.h:64
libMesh::Elem::parent
const Elem * parent() const
Definition: elem.h:2434
libMesh::TRI6
Definition: enum_elem_type.h:40
libMesh::Elem::refinement_flag
RefinementState refinement_flag() const
Definition: elem.h:2614
libMesh::INVALID_ELEM
Definition: enum_elem_type.h:75
libMesh::Utility::hashword
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval=0)
The hashword function takes an array of uint32_t's of length 'length' and computes a single key from ...
Definition: hashword.h:153
swap
void swap(Iterator &lhs, Iterator &rhs)
swap, used to implement op=
Definition: variant_filter_iterator.h:478
libMesh::ReferenceElem::get
const Elem & get(const ElemType type_in)
Definition: reference_elem.C:237
libMesh::RemoteElem::_elemlinks_data
Elem * _elemlinks_data[1]
Data for link to (nullptr!) parent.
Definition: remote_elem.h:216
libMesh::parent_bracketing_nodes_mutex
Threads::spin_mutex parent_bracketing_nodes_mutex
Definition: elem.C:87
libMesh::Elem::hmax
virtual Real hmax() const
Definition: elem.C:379
libMesh::Elem::n_children
virtual unsigned int n_children() const =0
libMesh::Elem::topological_neighbor
const Elem * topological_neighbor(const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
Definition: elem.C:865
libMesh::FEFamily
FEFamily
Definition: enum_fe_family.h:34
libMesh::INFQUAD6
Definition: enum_elem_type.h:59
libMesh::DofObject::get_extra_integer
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:1026
value
static const bool value
Definition: xdr_io.C:56
libMesh::QUADSHELL8
Definition: enum_elem_type.h:73
libMesh::PYRAMID5
Definition: enum_elem_type.h:53
libMesh::Elem::hmin
virtual Real hmin() const
Definition: elem.C:359
libMesh::Elem::subdomain_id
subdomain_id_type subdomain_id() const
Definition: elem.h:2069
libMesh::DofObject::id
dof_id_type id() const
Definition: dof_object.h:767
libMesh::EDGE3
Definition: enum_elem_type.h:36
libMesh::Elem::has_children
bool has_children() const
Definition: elem.h:2383
libMesh::QUADSHELL4
Definition: enum_elem_type.h:72
libMesh::DofObject::_id
dof_id_type _id
The id of the DofObject.
Definition: dof_object.h:516
libMesh::Elem::side_index_range
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2188
libMesh::Elem::embedding_matrix_version
virtual unsigned int embedding_matrix_version() const
Definition: elem.h:1649
libMesh::Elem::is_vertex
virtual bool is_vertex(const unsigned int i) const =0
libMesh::Elem::master_point
virtual Point master_point(const unsigned int i) const =0
libMesh::DofObject::invalid_processor_id
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:432
libMesh::Elem::get_info
std::string get_info() const
Prints relevant information about the element to a string.
Definition: elem.C:2233
libMesh::Elem::second_order_equivalent_type
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
Definition: elem.C:2432
std::norm
MetaPhysicL::DualNumber< T, D > norm(const MetaPhysicL::DualNumber< T, D > &in)
libMesh::NODEELEM
Definition: enum_elem_type.h:66
data
IterBase * data
Ideally this private member data should have protected access.
Definition: variant_filter_iterator.h:337
libMesh::DofObject::index_t
dof_id_type index_t
DoF index information.
Definition: dof_object.h:611
libMesh::DofObject::invalidate_processor_id
void invalidate_processor_id()
Sets the processor id to invalid_processor_id.
Definition: dof_object.h:719
libMesh::DofObject::n_comp_group
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:939
libMesh::QUAD9
Definition: enum_elem_type.h:43
libMesh::Elem::set_refinement_flag
void set_refinement_flag(const RefinementState rflag)
Sets the value of the refinement flag for the element.
Definition: elem.h:2622
libMesh::DofObject::_unique_id
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:510
libMesh::Elem::origin
virtual Point origin() const
Definition: elem.h:1593
libMesh::err
OStreamProxy err
libMesh::DofObject::invalidate_dofs
void invalidate_dofs(const unsigned int sys_num=libMesh::invalid_uint)
Sets all degree of freedom numbers to invalid_id.
Definition: dof_object.h:690
libMesh::Elem::neighbor_ptr
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2085
libMesh::Elem::node_id
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1977
libMesh::Elem::node_ref
const Node & node_ref(const unsigned int i) const
Definition: elem.h:2031
libMesh::TRI3SUBDIVISION
Definition: enum_elem_type.h:69
libMesh::Elem::_map_type
unsigned char _map_type
Mapping function type; currently either 0 (LAGRANGE) or 1 (RATIONAL_BERNSTEIN).
Definition: elem.h:1791
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::Elem::_elemlinks
Elem ** _elemlinks
Pointers to this element's parent and neighbors, and for lower-dimensional elements' interior_parent.
Definition: elem.h:1749
libMesh::Elem::INACTIVE
Definition: elem.h:1174
libMesh::ReferenceCounter::_enable_print_counter
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called.
Definition: reference_counter.h:141
libMesh::ElemInternal::family_tree_by_subneighbor
void family_tree_by_subneighbor(T elem, std::vector< T > &family, T neighbor_in, T subneighbor, bool reset=true)
Definition: elem_internal.h:237
libMesh::Elem::n_sides
virtual unsigned int n_sides() const =0
libMesh::PRISM18
Definition: enum_elem_type.h:52
libMesh::Elem::_get_parent_indices_cache
virtual std::vector< std::vector< std::vector< signed char > > > & _get_parent_indices_cache() const
Elem subclasses which don't do their own child-to-parent node calculations will need to supply a stat...
Definition: elem.h:1721
libMesh::TRISHELL3
Definition: enum_elem_type.h:71
libMesh::Elem::n_sub_elem
virtual unsigned int n_sub_elem() const =0
libMesh::DofObject::index_buffer_t
std::vector< index_t > index_buffer_t
Definition: dof_object.h:612
libMesh::Elem::build
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition: elem.C:246
libMesh::Elem::build_edge_ptr
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i)=0
libMesh::out
OStreamProxy out
libMesh::Elem::node_ptr
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2009
libMesh::DofObject::vg_dof_base
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:1229
libMesh::UCD
Definition: enum_io_package.h:45
libMesh::Elem::type
virtual ElemType type() const =0
libMesh::FIRST
Definition: enum_order.h:42
libMesh::remote_elem
const RemoteElem * remote_elem
Definition: remote_elem.C:57
libMesh::ElemInternal::family_tree_by_side
void family_tree_by_side(T elem, std::vector< T > &family, unsigned int s, bool reset)
Definition: elem_internal.h:117
libMesh::Elem::INVALID_REFINEMENTSTATE
Definition: elem.h:1176
libMesh::TECPLOT
Definition: enum_io_package.h:39
libMesh::DofObject::DofObject
DofObject()
Constructor.
Definition: dof_object.h:660
libMesh::PYRAMID13
Definition: enum_elem_type.h:54
libMesh::DofObject::invalidate_id
void invalidate_id()
Sets the id to invalid_id.
Definition: dof_object.h:711
libMesh::Quality::name
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
libMesh::Elem::_get_bracketing_node_cache
virtual std::vector< std::vector< std::vector< std::vector< std::pair< unsigned char, unsigned char > > > > > & _get_bracketing_node_cache() const
Elem subclasses which don't do their own bracketing node calculations will need to supply a static ca...
Definition: elem.h:1707
libMesh::PYRAMID14
Definition: enum_elem_type.h:55
libMesh::EDGE2
Definition: enum_elem_type.h:35
libMesh::ElemInternal::active_family_tree_by_topological_neighbor
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)
Definition: elem_internal.h:356
libMesh::QUAD8
Definition: enum_elem_type.h:42
libMesh::ElemType
ElemType
Defines an enum for geometric element types.
Definition: enum_elem_type.h:33
libMesh::Elem::point_test
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:2131
libMesh::DofObject::n_pseudo_systems
unsigned int n_pseudo_systems() const
Definition: dof_object.h:871