libMesh
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
libMesh::Edge Class Referenceabstract

The Edge is an element in 1D. More...

#include <edge.h>

Inheritance diagram for libMesh::Edge:
[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.
 
typedef const Elem *const * ConstNeighborPtrIter
 
typedef Predicates::multi_predicate Predicate
 Useful iterator typedefs.
 

Public Member Functions

 Edge (const unsigned int nn, Elem *p, Node **nodelinkdata)
 Default line element, takes number of nodes and parent.
 
 Edge (Edge &&)=delete
 
 Edge (const Edge &)=delete
 
Edge & operator= (const Edge &)=delete
 
Edge & operator= (Edge &&)=delete
 
virtual ~Edge ()=default
 
virtual unsigned short dim () const override final
 
virtual unsigned int n_nodes () const override
 
virtual unsigned int n_sides () const override final
 
virtual unsigned int n_vertices () const override final
 
virtual unsigned int n_edges () const override final
 
virtual unsigned int n_faces () const override final
 
virtual unsigned int n_children () const override final
 
virtual bool is_child_on_side (const unsigned int c, const unsigned int s) const override final
 
virtual bool is_edge_on_side (const unsigned int, const unsigned int) const override final
 
virtual unsigned int opposite_side (const unsigned int s) const override final
 
virtual unsigned int opposite_node (const unsigned int n, const unsigned int s) const override final
 
virtual dof_id_type key (const unsigned int s) const override final
 
virtual dof_id_type low_order_key (const unsigned int s) const override final
 
virtual unsigned int local_side_node (unsigned int side, unsigned int) const override final
 
virtual unsigned int local_edge_node (unsigned int edge, unsigned int edge_node) const override final
 Throws an error.
 
virtual std::unique_ptr< Elem > side_ptr (const unsigned int i) override final
 
virtual void side_ptr (std::unique_ptr< Elem > &side, const unsigned int i) override final
 Rebuilds a pointer to a NodeElem for the specified node.
 
virtual std::unique_ptr< Elem > build_side_ptr (const unsigned int i) override final
 
virtual void build_side_ptr (std::unique_ptr< Elem > &elem, const unsigned int i) override final
 Rebuilds a NODEELEM for the specified node.
 
virtual std::unique_ptr< Elem > build_edge_ptr (const unsigned int) override final
 The Elem::build_edge_ptr() member makes no sense for edges.
 
virtual void build_edge_ptr (std::unique_ptr< Elem > &, const unsigned int) override final
 The Elem::build_edge_ptr() member makes no sense for edges.
 
virtual std::vector< unsigned int > nodes_on_side (const unsigned int s) const override
 
virtual std::vector< unsigned int > nodes_on_edge (const unsigned int e) const override
 
virtual std::vector< unsigned int > sides_on_edge (const unsigned int) const override final
 
virtual std::vector< unsigned int > edges_adjacent_to_node (const unsigned int) const override final
 1D elements don't have any edges, but they are themselves edges, so I guess an argument could be made for returning "this" somehow.
 
virtual Point quasicircumcenter () const override
 
virtual unsigned int n_permutations () const override final
 Returns the number of independent permutations of element nodes - e.g.
 
virtual void permute (unsigned int) override final
 Permutes the element (by swapping node and neighbor pointers) according to the specified index.
 
virtual bool is_flipped () const override final
 
unsigned int center_node_on_side (const unsigned short side) const override final
 
ElemType side_type (const unsigned int s) const override final
 
virtual bool on_reference_element (const Point &p, const Real eps=TOLERANCE) const override final
 
virtual dof_id_type key (const unsigned int s) const=0
 Don't hide Elem::key() defined in the base class.
 
virtual dof_id_type key () const
 Don't hide Elem::key() defined in the base class.
 
virtual std::unique_ptr< Elem > build_side_ptr (const unsigned int i)=0
 
std::unique_ptr< const Elem > build_side_ptr (const unsigned int i) const
 
virtual std::unique_ptr< Elem > build_side_ptr (const unsigned int i, bool proxy)
 
std::unique_ptr< const Elem > build_side_ptr (const unsigned int i, bool proxy) const
 
virtual void build_side_ptr (std::unique_ptr< Elem > &side, const unsigned int i)=0
 Resets the loose element side, which may currently point to a different side than i or even a different element than this, to point to side i on this.
 
void build_side_ptr (std::unique_ptr< const Elem > &side, const unsigned int i) const
 
const Point & point (const unsigned int i) const
 
Point & point (const unsigned int i)
 
virtual Point master_point (const unsigned int i) const =0
 
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 Node * node_ptr (const unsigned int i) const
 
Node * node_ptr (const unsigned int i)
 
const Node & node_ref (const unsigned int i) const
 
Node & node_ref (const unsigned int i)
 
virtual Node *& set_node (const unsigned int i)
 
virtual void set_node (const unsigned int i, Node *node)
 Sets local Node i to refer to node.
 
SimpleRange< NodeRefIter > node_ref_range ()
 Returns a range with all nodes of an element, usable in range-based for loops.
 
SimpleRange< ConstNodeRefIter > node_ref_range () const
 
subdomain_id_type subdomain_id () const
 
subdomain_id_type & subdomain_id ()
 
virtual bool runtime_topology () const
 
const Elem * reference_elem () const
 
bool operator== (const Elem &rhs) const
 
bool operator!= (const Elem &rhs) const
 
bool topologically_equal (const Elem &rhs) const
 
const Elem * neighbor_ptr (unsigned int i) const
 
Elem * neighbor_ptr (unsigned int i)
 
SimpleRange< NeighborPtrIter > neighbor_ptr_range ()
 Returns a range with all neighbors of an element, usable in range-based for loops.
 
SimpleRange< ConstNeighborPtrIter > neighbor_ptr_range () const
 
const Elem * topological_neighbor (const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
 
Elem * topological_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.
 
bool has_neighbor (const Elem *elem) const
 
Elem * child_neighbor (Elem *elem)
 
const Elem * child_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.
 
unsigned int which_side_am_i (const Elem *e) const
 This function tells you which side the boundary element e is.
 
bool contains_vertex_of (const Elem *e, bool mesh_connection=false) const
 
bool contains_edge_of (const Elem *e) const
 
void find_point_neighbors (const Point &p, std::set< const Elem * > &neighbor_set) const
 This function finds all active elements (including this one) which are in the same manifold as this element and which touch the current active element at the specified point, which should be a point in the current element.
 
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.
 
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.
 
void find_point_neighbors (std::set< Elem * > &neighbor_set, Elem *start_elem)
 Non-const version of function above.
 
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.
 
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).
 
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.
 
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.
 
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.
 
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.
 
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.
 
virtual bool is_remote () const
 
virtual void connectivity (const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const =0
 
void write_connectivity (std::ostream &out, const IOPackage iop) const
 Writes the element connectivity for various IO packages to the passed ostream "out".
 
virtual ElemType type () const =0
 
IntRange< unsigned short > node_index_range () const
 
virtual unsigned int n_nodes_in_child (unsigned int) const
 
virtual Point side_vertex_average_normal (const unsigned int s) const
 
IntRange< unsigned short > side_index_range () const
 
unsigned int n_neighbors () const
 
IntRange< unsigned short > edge_index_range () const
 
IntRange< unsigned short > face_index_range () const
 
virtual bool is_vertex (const unsigned int i) const =0
 
virtual bool is_vertex_on_child (unsigned int, unsigned int n) const
 
virtual bool is_vertex_on_parent (unsigned int c, unsigned int n) const
 
virtual bool is_edge (const unsigned int i) const =0
 
virtual bool is_face (const unsigned int i) const =0
 
bool is_internal (const unsigned int i) const
 
virtual bool is_node_on_side (const unsigned int n, const unsigned int s) const =0
 
virtual bool is_node_on_edge (const unsigned int n, const unsigned int e) const =0
 
virtual unsigned int n_sub_elem () const =0
 
std::unique_ptr< const Elem > side_ptr (unsigned int i) const
 
void side_ptr (std::unique_ptr< const Elem > &side, const unsigned int i) const
 
std::unique_ptr< const Elem > build_edge_ptr (const unsigned int i) const
 
void build_edge_ptr (std::unique_ptr< const Elem > &edge, const unsigned int i) const
 
virtual Order default_order () const =0
 
virtual Order supported_nodal_order () const
 
virtual Order default_side_order () const
 
virtual Point true_centroid () const
 
Point vertex_average () 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, Real > qual_bounds (const ElemQuality) const
 
virtual bool contains_point (const Point &p, Real tol=TOLERANCE) const
 
virtual bool close_to_point (const Point &p, Real tol) const
 
bool positive_edge_orientation (const unsigned int i) const
 
bool positive_face_orientation (const unsigned int i) const
 
unsigned int face_orientation (const unsigned int i) const
 
std::vector< unsigned int > oriented_face_vertices (const unsigned int i) const
 
bool relative_edge_face_order (const unsigned int e, const unsigned int s) const
 
void inherit_data_from (const Elem &src)
 A helper function for copying generic element data (mapping, subdomain, processor) from an element to a derived (child, side, edge) element.
 
virtual bool has_affine_map () const
 
virtual bool has_invertible_map (Real tol=TOLERANCE *TOLERANCE) const
 
virtual bool is_linear () const
 
void print_info (std::ostream &os=libMesh::out) const
 Prints relevant information about the element.
 
std::string get_info () const
 Prints relevant information about the element to a string.
 
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 Elem * parent () const
 
Elem * parent ()
 
void set_parent (Elem *p)
 Sets the pointer to the element's parent.
 
const Elem * top_parent () const
 
const Elem * interior_parent () const
 
Elem * interior_parent ()
 
void set_interior_parent (Elem *p)
 Sets the pointer to the element's interior_parent.
 
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 int > second_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.
 
unsigned char mapping_data () const
 
void set_mapping_data (const unsigned char data)
 Sets the value of the mapping data for the element.
 
const Elem * raw_child_ptr (unsigned int i) const
 
const Elem * child_ptr (unsigned int i) const
 
Elem * child_ptr (unsigned int i)
 
SimpleRange< ChildRefIter > child_ref_range ()
 Returns a range with all children of a parent element, usable in range-based for loops.
 
SimpleRange< ConstChildRefIter > child_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.
 
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.
 
void replace_child (Elem *elem, unsigned int c)
 Replaces the child pointer at the specified index in the child array.
 
void family_tree (std::vector< const Elem * > &family, bool reset=true) const
 Fills the vector family with the children of this element, recursively.
 
void family_tree (std::vector< Elem * > &family, bool reset=true)
 Non-const version of function above; fills a vector of non-const pointers.
 
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.
 
void total_family_tree (std::vector< Elem * > &family, bool reset=true)
 Non-const version of function above; fills a vector of non-const pointers.
 
void active_family_tree (std::vector< const Elem * > &active_family, bool reset=true) const
 Same as the family_tree() member, but only adds the active children.
 
void active_family_tree (std::vector< Elem * > &active_family, bool reset=true)
 Non-const version of function above; fills a vector of non-const pointers.
 
void family_tree_by_side (std::vector< const Elem * > &family, unsigned int side, bool reset=true) const
 Same as the family_tree() member, but only adds elements which are next to side.
 
void 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.
 
void total_family_tree_by_side (std::vector< const Elem * > &family, unsigned int side, bool reset=true) const
 Same as the total_family_tree() member, but only adds elements which are next to side.
 
void total_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.
 
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.
 
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.
 
void family_tree_by_neighbor (std::vector< const Elem * > &family, const Elem *neighbor, bool reset=true) const
 Same as the family_tree() member, but only adds elements which are next to neighbor.
 
void 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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
RefinementState refinement_flag () const
 
void set_refinement_flag (const RefinementState rflag)
 Sets the value of the refinement flag for the element.
 
RefinementState p_refinement_flag () const
 
void set_p_refinement_flag (const RefinementState pflag)
 Sets the value of the p-refinement flag for the element.
 
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.
 
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.
 
void hack_p_level_and_refinement_flag (const unsigned int p, RefinementState pflag)
 Sets the value of the p-refinement level for the element without altering the p-level of its ancestors; also sets the p_refinement_flag, simultaneously so that they can be safely checked for mutual consistency.
 
virtual void refine (MeshRefinement &mesh_refinement)
 Refine the element.
 
void coarsen ()
 Coarsen the element.
 
void contract ()
 Contract an active element, i.e.
 
void libmesh_assert_valid_neighbors () const
 Checks for consistent neighbor links on this element.
 
void libmesh_assert_valid_node_pointers () const
 Checks for a valid id and pointers to nodes with valid ids on this element.
 
virtual unsigned int local_singular_node (const Point &, const Real=TOLERANCE *TOLERANCE) const
 
virtual bool is_singular_node (unsigned int) const
 
side_iterator boundary_sides_begin ()
 Iterator accessor functions.
 
side_iterator boundary_sides_end ()
 
virtual bool infinite () const =0
 
virtual bool is_mid_infinite_edge_node (const unsigned int) const
 
virtual Point origin () const
 
virtual std::unique_ptr< Elem > disconnected_clone () const
 
virtual void flip (BoundaryInfo *boundary_info)=0
 Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sign.
 
void orient (BoundaryInfo *boundary_info)
 Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sign, iff we find a negative orientation.
 
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 Real embedding_matrix (const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
 
virtual unsigned int embedding_matrix_version () const
 
void nullify_neighbors ()
 Replaces this element with nullptr for all of its neighbors.
 
DofObject * get_old_dof_object ()
 Pointer accessor for previously public old_dof_object.
 
const DofObject * get_old_dof_object () const
 
DofObject & get_old_dof_object_ref ()
 As above, but do not use in situations where the old_dof_object may be nullptr, since this function asserts that the old_dof_object is valid before returning a reference to it.
 
const DofObject & get_old_dof_object_ref () const
 
void clear_old_dof_object ()
 Sets the old_dof_object to nullptr.
 
void set_old_dof_object ()
 Sets the old_dof_object to a copy of this.
 
void clear_dofs ()
 Clear the DofMap data structures holding degree of freedom data.
 
void invalidate_dofs (const unsigned int sys_num=libMesh::invalid_uint)
 Sets all degree of freedom numbers to invalid_id.
 
void invalidate_id ()
 Sets the id to invalid_id.
 
void invalidate_processor_id ()
 Sets the processor id to invalid_processor_id.
 
void invalidate ()
 Invalidates all the indices for this DofObject.
 
unsigned int n_dofs (const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
 
dof_id_type id () const
 
dof_id_type & set_id ()
 
void set_id (const dof_id_type dofid)
 Sets the id for this DofObject.
 
unique_id_type unique_id () const
 
void set_unique_id (unique_id_type new_id)
 Sets the unique_id for this DofObject.
 
bool valid_id () const
 
bool valid_unique_id () const
 
processor_id_type processor_id () const
 
processor_id_type & processor_id ()
 
void processor_id (const processor_id_type pid)
 Sets the processor_id for this DofObject.
 
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.
 
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.
 
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.
 
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.
 
template<typename T >
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.
 
void add_system ()
 Adds an additional system to the DofObject.
 
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.
 
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.
 
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.
 
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 int > var_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.
 
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.
 
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.
 
void add_extra_integers (const unsigned int n_integers)
 Assigns a set of extra integers to this DofObject.
 
void add_extra_integers (const unsigned int n_integers, const std::vector< dof_id_type > &default_values)
 Assigns a set of extra integers to this DofObject.
 
unsigned int n_extra_integers () const
 Returns how many extra integers are associated to the DofObject.
 
bool has_extra_integers () const
 Returns whether extra integers are associated to the DofObject.
 
unsigned int packed_indexing_size () const
 If we pack our indices into an buffer for communications, how many ints do we need?
 
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.
 
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.
 
void debug_buffer () const
 Print our buffer for debugging.
 
void print_dof_info () const
 Print out info for debugging.
 
void set_buffer (const std::vector< dof_id_type > &buf)
 

Static Public Member Functions

static unsigned int local_side_node (ElemType t, unsigned int side, unsigned int side_node)
 
static unsigned int local_edge_node (ElemType t, unsigned int edge, unsigned int edge_node)
 
static ElemType side_type (const ElemType t, const unsigned int s)
 
static ElemType edge_type (const ElemType t)
 
static void print_info (std::ostream &out_stream=libMesh::out)
 Prints the reference information, by default to libMesh::out.
 
static void print_info (std::ostream &out_stream=libMesh::out)
 Prints the reference information, by default to libMesh::out.
 
static std::string get_info ()
 Gets a string containing the reference information.
 
static std::string get_info ()
 Gets a string containing the reference information.
 
static ElemType second_order_equivalent_type (const ElemType et, const bool full_ordered=true)
 
static ElemType first_order_equivalent_type (const ElemType et)
 
static ElemType complete_order_equivalent_type (const ElemType et)
 
static constexpr bool infinite ()
 
static std::unique_ptr< Elem > build (const ElemType type, Elem *p=nullptr)
 
static std::unique_ptr< Elem > build_with_id (const ElemType type, dof_id_type id)
 Calls the build() method above with a nullptr parent, and additionally sets the newly-created Elem's id.
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects.
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects.
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info().
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info().
 
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?
 

Static Public Attributes

static const int num_sides = 2
 Geometric constants for all Edges.
 
static const int num_edges = 0
 
static const int num_children = 2
 
static const int nodes_per_side = 1
 
static const int nodes_per_edge = invalid_int
 
static constexpr subdomain_id_type invalid_subdomain_id = std::numeric_limits<subdomain_id_type>::max()
 A static integral constant representing an invalid subdomain id.
 
static const unsigned int type_to_dim_map [INVALID_ELEM]
 This array maps the integer representation of the ElemType enum to the geometric dimension of the element.
 
static constexpr unsigned int type_to_n_nodes_map [INVALID_ELEM]
 This array maps the integer representation of the ElemType enum to the number of nodes in the element.
 
static const unsigned int max_n_nodes = 27
 The maximum number of nodes any element can contain.
 
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.
 
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.
 
static const Order type_to_default_order_map [INVALID_ELEM]
 This array maps the integer representation of the ElemType enum to the default approximation order of elements of that type.
 
static constexpr dof_id_type invalid_id = static_cast<dof_id_type>(-1)
 An invalid id to distinguish an uninitialized DofObject.
 
static constexpr unique_id_type invalid_unique_id = static_cast<unique_id_type>(-1)
 An invalid unique_id to distinguish an uninitialized DofObject.
 
static constexpr 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.
 

Protected Types

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

Protected Member Functions

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

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

Static Protected Attributes

static constexpr Real affine_tol = TOLERANCE*TOLERANCE
 Default tolerance to use in has_affine_map().
 
static Counts _counts
 Actually holds the data.
 
static Counts _counts
 Actually holds the data.
 
static Threads::atomic< unsigned int > _n_objects
 The number of objects.
 
static Threads::atomic< unsigned int > _n_objects
 The number of objects.
 
static Threads::spin_mutex _mutex
 Mutual exclusion object to enable thread-safe reference counting.
 
static Threads::spin_mutex _mutex
 Mutual exclusion object to enable thread-safe reference counting.
 
static bool _enable_print_counter = true
 Flag to control whether reference count information is printed when print_info is called.
 
static bool _enable_print_counter = true
 Flag to control whether reference count information is printed when print_info is called.
 

Private Types

typedef dof_id_type index_t
 DoF index information.
 
typedef std::vector< index_t > index_buffer_t
 

Private Member Functions

bool point_test (const Point &p, Real box_tol, Real map_tol) const
 Shared private implementation used by the contains_point() and close_to_point() routines.
 
void set_child (unsigned int c, Elem *elem)
 Sets the pointer to the \( i^{th} \) child for this element.
 
SideIter _first_side ()
 Side iterator helper functions.
 
SideIter _last_side ()
 
std::unique_ptr< DofObject > construct (const DofObject *other=nullptr)
 Convenient factory function that calls either the (deep) copy constructor or the default constructor depending on the input arg.
 
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.
 
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.
 
unsigned int start_idx (const unsigned int s) const
 The starting index for system s.
 
unsigned int end_idx (const unsigned int s) const
 The ending index for system s.
 
unsigned int start_idx_ints () const
 The starting index for an extra_integers pseudosystem.
 
unsigned int end_idx_ints () const
 The ending index for an extra_integers pseudosystem.
 

Private Attributes

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

Static Private Attributes

static constexpr index_t ncv_magic_exp = sizeof(index_t)*3
 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.
 
static constexpr index_t ncv_magic = index_t(1) << ncv_magic_exp
 

Detailed Description

The Edge is an element in 1D.

It can be thought of as a line segment.

Author
Benjamin S. Kirk
Date
2002

The base class for all 1D geometric element types.

Definition at line 37 of file edge.h.

Member Typedef Documentation

◆ ConstNeighborPtrIter

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

Definition at line 335 of file elem.h.

◆ Counts [1/2]

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

Data structure to log the information.

The log is identified by the class name.

Definition at line 119 of file reference_counter.h.

◆ Counts [2/2]

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

Data structure to log the information.

The log is identified by the class name.

Definition at line 119 of file reference_counter.h.

◆ index_buffer_t

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

Definition at line 670 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 669 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 334 of file elem.h.

◆ Predicate

Useful iterator typedefs.

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

1567 { COARSEN = 0,
1568 DO_NOTHING,
1569 REFINE,
1572 INACTIVE,
@ COARSEN_INACTIVE
Definition elem.h:1573
@ INVALID_REFINEMENTSTATE
Definition elem.h:1574
@ JUST_COARSENED
Definition elem.h:1571

Constructor & Destructor Documentation

◆ Edge() [1/3]

libMesh::Edge::Edge ( const unsigned int  nn,
Elem *  p,
Node **  nodelinkdata 
)
inline

Default line element, takes number of nodes and parent.

Derived classes implement 'true' elements.

Definition at line 45 of file edge.h.

47 :
48 Elem(nn, num_sides, p, _elemlinks_data, nodelinkdata)
49 {
50 // Make sure the interior parent isn't undefined
51 if (LIBMESH_DIM > 1)
52 this->set_interior_parent(nullptr);
53 }
static const int num_sides
Geometric constants for all Edges.
Definition edge.h:64
Elem * _elemlinks_data[3+(LIBMESH_DIM >1)]
Data for links to parent/neighbor/interior_parent elements.
Definition edge.h:247
void set_interior_parent(Elem *p)
Sets the pointer to the element's interior_parent.
Definition elem.C:1162
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition elem.h:2508

References libMesh::Elem::set_interior_parent().

◆ Edge() [2/3]

libMesh::Edge::Edge ( Edge &&  )
delete

◆ Edge() [3/3]

libMesh::Edge::Edge ( const Edge &  )
delete

◆ ~Edge()

virtual libMesh::Edge::~Edge ( )
virtualdefault

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

3609{
3610 return SideIter(0, this);
3611}

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

2340 {
2341 static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> c;
2342 libmesh_error();
2343 return c;
2344 }

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

2354 {
2355 static std::vector<std::vector<std::vector<signed char>>> c;
2356 libmesh_error();
2357 return c;
2358 }

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

◆ _last_side()

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

Definition at line 3616 of file elem.h.

3617{
3618 return SideIter(this->n_neighbors(), this);
3619}
unsigned int n_neighbors() const
Definition elem.h:812

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

3080{
3081#ifdef LIBMESH_ENABLE_AMR
3082 if ((this->refinement_flag() == INACTIVE) ||
3083 (this->refinement_flag() == COARSEN_INACTIVE))
3084 return false;
3085 else
3086 return true;
3087#else
3088 return true;
3089#endif
3090}
RefinementState refinement_flag() const
Definition elem.h:3348

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< OutputType >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), compute_residual(), libMesh::Elem::contract(), libMesh::DofMap::dof_indices(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), libMesh::Elem::get_info(), libMesh::ErrorVector::is_active_elem(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_local(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::max_descendant_p_level(), libMesh::DofMap::merge_ghost_functor_outputs(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::DofMap::old_dof_indices(), libMesh::PointLocatorTree::operator()(), libMesh::EquationSystems::redundant_added_side(), libMesh::Elem::refine(), libMesh::Elem::subactive(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::MeshRefinement::test_level_one(), ElemTest< elem_type >::test_n_refinements(), EquationSystemsTest::testRefineThenReinitPreserveFlags(), libMesh::BoundaryInfo::transfer_boundary_ids_from_children(), 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 2244 of file elem.C.

2246{
2247 ElemInternal::active_family_tree(this, active_family, reset);
2248}
void active_family_tree(T elem, std::vector< T > &active_family, bool reset=true)

References libMesh::ElemInternal::active_family_tree().

Referenced by libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::merge_ghost_functor_outputs(), 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 2252 of file elem.C.

2254{
2255 ElemInternal::active_family_tree(this, active_family, reset);
2256}

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

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

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

2402{
2403 ElemInternal::active_family_tree_by_neighbor(this, family, neighbor, reset);
2404}

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

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

References libMesh::ElemInternal::active_family_tree_by_side().

Referenced by libMesh::BoundaryInfo::build_node_list_from_side_list(), and 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 2305 of file elem.C.

2308{
2309 ElemInternal::active_family_tree_by_side(this, family, side, reset);
2310}

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

2414{
2416 mesh, point_locator, pb,
2417 reset);
2418}
MeshBase & mesh
void active_family_tree_by_topological_neighbor(T elem, std::vector< T > &family, T neighbor_in, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb, bool reset=true)

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

Referenced by libMesh::DefaultCoupling::operator()(), and libMesh::GhostPointNeighbors::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 2422 of file elem.C.

2428{
2430 mesh, point_locator, pb,
2431 reset);
2432}

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

2156{
2157 const unsigned int nc = this->n_children();
2158
2159 if (!_children)
2160 {
2161 _children = std::make_unique<Elem *[]>(nc);
2162
2163 for (unsigned int c = 0; c != nc; c++)
2164 this->set_child(c, nullptr);
2165 }
2166
2167 for (unsigned int c = 0; c != nc; c++)
2168 {
2169 if (this->_children[c] == nullptr || this->_children[c] == remote_elem)
2170 {
2171 libmesh_assert_equal_to (this, elem->parent());
2172 this->set_child(c, elem);
2173 return;
2174 }
2175 }
2176
2177 libmesh_error_msg("Error: Tried to add a child to an element with full children array");
2178}
void set_child(unsigned int c, Elem *elem)
Sets the pointer to the child for this element.
Definition elem.h:3320
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element's children.
Definition elem.h:2391
virtual unsigned int n_children() const =0
const RemoteElem * remote_elem
Definition remote_elem.C:57

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

Referenced by libMesh::BoundaryInfo::add_elements(), 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 2182 of file elem.C.

2183{
2184 if (!this->has_children())
2185 {
2186 const unsigned int nc = this->n_children();
2187 _children = std::make_unique<Elem *[]>(nc);
2188
2189 for (unsigned int i = 0; i != nc; i++)
2190 this->set_child(i, nullptr);
2191 }
2192
2193 libmesh_assert (this->_children[c] == nullptr || this->child_ptr(c) == remote_elem);
2194 libmesh_assert (elem == remote_elem || this == elem->parent());
2195
2196 this->set_child(c, elem);
2197}
bool has_children() const
Definition elem.h:3117
const Elem * parent() const
Definition elem.h:3168
const Elem * child_ptr(unsigned int i) const
Definition elem.h:3301
libmesh_assert(ctx)

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() [1/2]

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

Assigns a set of extra integers to this DofObject.

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

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

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

Definition at line 482 of file dof_object.C.

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

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

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

◆ add_extra_integers() [2/2]

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

Assigns a set of extra integers to this DofObject.

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

Any newly-added values will be copied from default_values.

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

Definition at line 534 of file dof_object.C.

536{
537 libmesh_assert_equal_to(n_integers, default_values.size());
538
539 const unsigned int n_old_integers = this->n_extra_integers();
540 this->add_extra_integers(n_integers);
541 if (n_integers > n_old_integers)
542 {
543 const unsigned int n_more_integers = n_integers - n_old_integers;
544 std::copy(default_values.begin()+n_old_integers,
545 default_values.end(),
546 _idx_buf.end()-n_more_integers);
547 }
548}
void add_extra_integers(const unsigned int n_integers)
Assigns a set of extra integers to this DofObject.
Definition dof_object.C:482

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

◆ add_system()

void libMesh::DofObject::add_system ( )
inherited

Adds an additional system to the DofObject.

Definition at line 187 of file dof_object.C.

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

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

Referenced by DofObjectTest< DerivedClass >::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 2121 of file elem.C.

2122{
2123#ifdef LIBMESH_ENABLE_AMR
2124
2125 // Use a fast, DistributedMesh-safe definition
2126 const bool is_ancestor =
2127 !this->active() && !this->subactive();
2128
2129 // But check for inconsistencies if we have time
2130#ifdef DEBUG
2131 if (!is_ancestor && this->has_children())
2132 {
2133 for (auto & c : this->child_ref_range())
2134 {
2135 if (&c != remote_elem)
2136 {
2137 libmesh_assert(!c.active());
2138 libmesh_assert(!c.ancestor());
2139 }
2140 }
2141 }
2142#endif // DEBUG
2143
2144 return is_ancestor;
2145
2146#else
2147 return false;
2148#endif
2149}
bool active() const
Definition elem.h:3079
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition elem.h:2476
bool subactive() const
Definition elem.h:3097

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

Referenced by libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::refine(), and ElemTest< elem_type >::test_n_refinements().

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

2517{
2518 const unsigned int nc = this->n_children();
2519 libmesh_assert_less(child, nc);
2520
2521 // Cached return values, indexed first by embedding_matrix version,
2522 // then by child number, then by child node number.
2523 std::vector<std::vector<std::vector<signed char>>> &
2524 cached_parent_indices = this->_get_parent_indices_cache();
2525
2526 unsigned int em_vers = this->embedding_matrix_version();
2527
2528 // We may be updating the cache on one thread, and while that
2529 // happens we can't safely access the cache from other threads.
2530 Threads::spin_mutex::scoped_lock lock(parent_indices_mutex);
2531
2532 if (em_vers >= cached_parent_indices.size())
2533 cached_parent_indices.resize(em_vers+1);
2534
2535 if (child >= cached_parent_indices[em_vers].size())
2536 {
2537 const signed char nn = cast_int<signed char>(this->n_nodes());
2538
2539 cached_parent_indices[em_vers].resize(nc);
2540
2541 for (unsigned int c = 0; c != nc; ++c)
2542 {
2543 const unsigned int ncn = this->n_nodes_in_child(c);
2544 cached_parent_indices[em_vers][c].resize(ncn);
2545 for (unsigned int cn = 0; cn != ncn; ++cn)
2546 {
2547 for (signed char n = 0; n != nn; ++n)
2548 {
2549 const Real em_val = this->embedding_matrix
2550 (c, cn, n);
2551 if (em_val == 1)
2552 {
2553 cached_parent_indices[em_vers][c][cn] = n;
2554 break;
2555 }
2556
2557 if (em_val != 0)
2558 {
2559 cached_parent_indices[em_vers][c][cn] =
2560 -1;
2561 break;
2562 }
2563
2564 // We should never see an all-zero embedding matrix
2565 // row
2566 libmesh_assert_not_equal_to (n+1, nn);
2567 }
2568 }
2569 }
2570 }
2571
2572 const signed char cache_val =
2573 cached_parent_indices[em_vers][child][child_node];
2574 if (cache_val == -1)
2575 return libMesh::invalid_uint;
2576
2577 return cached_parent_indices[em_vers][child][child_node];
2578}
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition elem.h:748
virtual unsigned int n_nodes() const =0
virtual Real embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
virtual std::vector< std::vector< std::vector< signed char > > > & _get_parent_indices_cache() const
Elem subclasses which don't do their own child-to-parent node calculations will need to supply a stat...
Definition elem.h:2353
virtual unsigned int embedding_matrix_version() const
Definition elem.h:2181
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition libmesh.h:303
Threads::spin_mutex parent_indices_mutex
Definition elem.C:98
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

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

Referenced by libMesh::MeshRefinement::add_node(), libMesh::Elem::parent_bracketing_nodes(), and ElemTest< elem_type >::test_n_refinements().

◆ boundary_sides_begin()

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

Iterator accessor functions.

Definition at line 3847 of file elem.C.

3848{
3849 Predicates::BoundarySide<SideIter> bsp;
3850 return side_iterator(this->_first_side(), this->_last_side(), bsp);
3851}
SideIter _last_side()
Definition elem.h:3616
SideIter _first_side()
Side iterator helper functions.
Definition elem.h:3608

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

3857{
3858 Predicates::BoundarySide<SideIter> bsp;
3859 return side_iterator(this->_last_side(), this->_last_side(), bsp);
3860}

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

2788{
2789 std::vector<std::pair<dof_id_type, dof_id_type>> returnval;
2790
2791 const std::vector<std::pair<unsigned char, unsigned char>> & pbc =
2792 this->parent_bracketing_nodes(child,child_node);
2793
2794 for (const auto & pb : pbc)
2795 {
2796 const unsigned short n_n = this->n_nodes();
2797 if (pb.first < n_n && pb.second < n_n)
2798 returnval.emplace_back(this->node_id(pb.first), this->node_id(pb.second));
2799 else
2800 {
2801 // We must be on a non-full-order higher order element...
2802 libmesh_assert_not_equal_to(this->default_order(), FIRST);
2803 libmesh_assert_not_equal_to
2804 (second_order_equivalent_type (this->type(), true),
2805 this->type());
2806 libmesh_assert_equal_to
2807 (second_order_equivalent_type (this->type(), false),
2808 this->type());
2809
2810 // And that's a shame, because this is a nasty search:
2811
2812 // Build the full-order type
2813 ElemType full_type =
2814 second_order_equivalent_type(this->type(), /*full_ordered=*/ true);
2815 std::unique_ptr<Elem> full_elem = Elem::build(full_type);
2816
2819
2820 // Find the bracketing nodes by figuring out what
2821 // already-created children will have them.
2822
2823 // This only doesn't break horribly because we add children
2824 // and nodes in straightforward + hierarchical orders...
2825 for (unsigned int c=0; c <= child; ++c)
2826 {
2827 libmesh_assert(this->child_ptr(c));
2828 if (this->child_ptr(c) == remote_elem)
2829 continue;
2830
2831 for (auto n : make_range(this->n_nodes_in_child(c)))
2832 {
2833 if (c == child && n == child_node)
2834 break;
2835
2836 if (pb.first == full_elem->as_parent_node(c,n))
2837 {
2838 // We should be consistent
2839 if (pt1 != DofObject::invalid_id)
2840 libmesh_assert_equal_to(pt1, this->child_ptr(c)->node_id(n));
2841
2842 pt1 = this->child_ptr(c)->node_id(n);
2843 }
2844
2845 if (pb.second == full_elem->as_parent_node(c,n))
2846 {
2847 // We should be consistent
2848 if (pt2 != DofObject::invalid_id)
2849 libmesh_assert_equal_to(pt2, this->child_ptr(c)->node_id(n));
2850
2851 pt2 = this->child_ptr(c)->node_id(n);
2852 }
2853 }
2854 }
2855
2856 // We should *usually* find all bracketing nodes by the time
2857 // we query them (again, because of the child & node add
2858 // order)
2859 //
2860 // The exception is if we're a HEX20, in which case we will
2861 // find pairs of vertex nodes and edge nodes bracketing the
2862 // new central node but we *won't* find the pairs of face
2863 // nodes which we would have had on a HEX27. In that case
2864 // we'll still have enough bracketing nodes for a
2865 // topological lookup, but we won't be able to make the
2866 // following assertions.
2867 if (this->type() != HEX20)
2868 {
2869 libmesh_assert_not_equal_to (pt1, DofObject::invalid_id);
2870 libmesh_assert_not_equal_to (pt2, DofObject::invalid_id);
2871 }
2872
2873 if (pt1 != DofObject::invalid_id &&
2874 pt2 != DofObject::invalid_id)
2875 returnval.emplace_back(pt1, pt2);
2876 }
2877 }
2878
2879 return returnval;
2880}
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes(unsigned int c, unsigned int n) const
Definition elem.C:2583
virtual Order default_order() const =0
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition elem.C:382
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
Definition elem.C:3571
virtual ElemType type() const =0
dof_id_type node_id(const unsigned int i) const
Definition elem.h:2605
ElemType
Defines an enum for geometric element types.
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition int_range.h:176

References libMesh::Elem::build(), libMesh::Elem::child_ptr(), libMesh::Elem::default_order(), libMesh::FIRST, libMesh::HEX20, libMesh::DofObject::invalid_id, libMesh::libmesh_assert(), libMesh::make_range(), libMesh::Elem::n_nodes(), libMesh::Elem::n_nodes_in_child(), libMesh::Elem::node_id(), libMesh::Elem::parent_bracketing_nodes(), libMesh::remote_elem, 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 382 of file elem.C.

384{
385 switch (type)
386 {
387 // 0D elements
388 case NODEELEM:
389 return std::make_unique<NodeElem>(p);
390
391 // 1D elements
392 case EDGE2:
393 return std::make_unique<Edge2>(p);
394 case EDGE3:
395 return std::make_unique<Edge3>(p);
396 case EDGE4:
397 return std::make_unique<Edge4>(p);
398
399 // 2D elements
400 case TRI3:
401 return std::make_unique<Tri3>(p);
402 case TRISHELL3:
403 return std::make_unique<TriShell3>(p);
404 case TRI3SUBDIVISION:
405 return std::make_unique<Tri3Subdivision>(p);
406 case TRI6:
407 return std::make_unique<Tri6>(p);
408 case TRI7:
409 return std::make_unique<Tri7>(p);
410 case QUAD4:
411 return std::make_unique<Quad4>(p);
412 case QUADSHELL4:
413 return std::make_unique<QuadShell4>(p);
414 case QUAD8:
415 return std::make_unique<Quad8>(p);
416 case QUADSHELL8:
417 return std::make_unique<QuadShell8>(p);
418 case QUAD9:
419 return std::make_unique<Quad9>(p);
420 case QUADSHELL9:
421 return std::make_unique<QuadShell9>(p);
422
423 // Well, a hexagon is *a* polygon...
424 case C0POLYGON:
425 return std::make_unique<C0Polygon>(6, p);
426
427 // Building a polyhedron can't currently be done without creating
428 // its nodes first
429 case C0POLYHEDRON:
430 libmesh_not_implemented_msg
431 ("Polyhedra cannot be built via Elem::build()");
432
433 // 3D elements
434 case TET4:
435 return std::make_unique<Tet4>(p);
436 case TET10:
437 return std::make_unique<Tet10>(p);
438 case TET14:
439 return std::make_unique<Tet14>(p);
440 case HEX8:
441 return std::make_unique<Hex8>(p);
442 case HEX20:
443 return std::make_unique<Hex20>(p);
444 case HEX27:
445 return std::make_unique<Hex27>(p);
446 case PRISM6:
447 return std::make_unique<Prism6>(p);
448 case PRISM15:
449 return std::make_unique<Prism15>(p);
450 case PRISM18:
451 return std::make_unique<Prism18>(p);
452 case PRISM20:
453 return std::make_unique<Prism20>(p);
454 case PRISM21:
455 return std::make_unique<Prism21>(p);
456 case PYRAMID5:
457 return std::make_unique<Pyramid5>(p);
458 case PYRAMID13:
459 return std::make_unique<Pyramid13>(p);
460 case PYRAMID14:
461 return std::make_unique<Pyramid14>(p);
462 case PYRAMID18:
463 return std::make_unique<Pyramid18>(p);
464
465#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
466 // 1D infinite elements
467 case INFEDGE2:
468 return std::make_unique<InfEdge2>(p);
469
470 // 2D infinite elements
471 case INFQUAD4:
472 return std::make_unique<InfQuad4>(p);
473 case INFQUAD6:
474 return std::make_unique<InfQuad6>(p);
475
476 // 3D infinite elements
477 case INFHEX8:
478 return std::make_unique<InfHex8>(p);
479 case INFHEX16:
480 return std::make_unique<InfHex16>(p);
481 case INFHEX18:
482 return std::make_unique<InfHex18>(p);
483 case INFPRISM6:
484 return std::make_unique<InfPrism6>(p);
485 case INFPRISM12:
486 return std::make_unique<InfPrism12>(p);
487#endif
488
489 default:
490 libmesh_error_msg("ERROR: Undefined element type == " << Utility::enum_to_string(type));
491 }
492}
std::string enum_to_string(const T e)

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

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

◆ build_edge_ptr() [1/4]

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

Definition at line 2978 of file elem.h.

2979{
2980 // Call the non-const version of this function, return the result as
2981 // a std::unique_ptr<const Elem>.
2982 Elem * me = const_cast<Elem *>(this);
2983 return me->build_edge_ptr(i);
2984}

References libMesh::Elem::build_edge_ptr().

◆ build_edge_ptr() [2/4]

virtual std::unique_ptr< Elem > libMesh::Edge::build_edge_ptr ( const unsigned int  )
inlinefinaloverridevirtual

The Elem::build_edge_ptr() member makes no sense for edges.

Implements libMesh::Elem.

Definition at line 193 of file edge.h.

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

◆ build_edge_ptr() [3/4]

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

Definition at line 2990 of file elem.h.

2992{
2993 // Hand off to the non-const version of this function
2994 Elem * me = const_cast<Elem *>(this);
2995 std::unique_ptr<Elem> e {const_cast<Elem *>(elem.release())};
2996 me->build_edge_ptr(e, i);
2997 elem = std::move(e);
2998}

References libMesh::Elem::build_edge_ptr().

◆ build_edge_ptr() [4/4]

virtual void libMesh::Edge::build_edge_ptr ( std::unique_ptr< Elem > &  ,
const unsigned int   
)
inlinefinaloverridevirtual

The Elem::build_edge_ptr() member makes no sense for edges.

Implements libMesh::Elem.

Definition at line 199 of file edge.h.

200 { libmesh_not_implemented(); }

◆ build_side_ptr() [1/8]

std::unique_ptr< const Elem > libMesh::Elem::build_side_ptr ( const unsigned int  i) const
inline

Definition at line 1019 of file elem.h.

2884{
2885 // Call the non-const version of this function, return the result as
2886 // a std::unique_ptr<const Elem>.
2887 Elem * me = const_cast<Elem *>(this);
2888 return me->build_side_ptr(i);
2889}

◆ build_side_ptr() [2/8]

std::unique_ptr< Elem > libMesh::Edge::build_side_ptr ( const unsigned int  i)
finaloverridevirtual
Returns
A pointer to a NodeElem for the specified node.

Implements libMesh::Elem.

Definition at line 86 of file edge.C.

87{
88 libmesh_assert_less (i, 2);
89 std::unique_ptr<Elem> nodeelem = std::make_unique<NodeElem>();
90 nodeelem->set_node(0, this->node_ptr(i));
91
92 nodeelem->set_interior_parent(this);
93 nodeelem->inherit_data_from(*this);
94
95 return nodeelem;
96}
const Node * node_ptr(const unsigned int i) const
Definition elem.h:2637

References libMesh::Elem::node_ptr().

Referenced by build_side_ptr(), and side_ptr().

◆ build_side_ptr() [3/8]

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

The element returned is full-ordered and full-featured, in contrast to the side method. For example, calling build_side_ptr(0) on a 20-noded hex in subdomain 5 will build a 8-noded quadrilateral coincident with face 0, assign it subdomain id 5, and pass back the pointer.

The side element's id() is undefined; it is a temporary element not added to any mesh.

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.

◆ build_side_ptr() [4/8]

virtual std::unique_ptr< Elem > libMesh::Elem::build_side_ptr ( const unsigned int  i,
bool  proxy 
)
inlinevirtual

Reimplemented from libMesh::Elem.

Definition at line 1025 of file elem.h.

1026 { if (proxy) libmesh_error(); libmesh_deprecated(); return this->build_side_ptr(i); }
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i) override final
Definition edge.C:86

◆ build_side_ptr() [5/8]

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

Definition at line 1028 of file elem.h.

1029 { if (proxy) libmesh_error(); libmesh_deprecated(); return this->build_side_ptr(i); }

◆ build_side_ptr() [6/8]

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

Definition at line 1047 of file elem.h.

2897{
2898 // Hand off to the non-const version of this function
2899 Elem * me = const_cast<Elem *>(this);
2900 std::unique_ptr<Elem> e {const_cast<Elem *>(elem.release())};
2901 me->build_side_ptr(e, i);
2902 elem = std::move(e);
2903}

◆ build_side_ptr() [7/8]

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

Rebuilds a NODEELEM for the specified node.

Implements libMesh::Elem.

Definition at line 99 of file edge.C.

101{
102 libmesh_assert_less (i, this->n_sides());
103
104 if (!side.get() || side->type() != NODEELEM)
105 side = this->build_side_ptr(i);
106 else
107 {
108 side->set_interior_parent(this);
109 side->inherit_data_from(*this);
110 side->set_node(0, this->node_ptr(i));
111 }
112}
virtual unsigned int n_sides() const override final
Definition edge.h:83

References build_side_ptr(), n_sides(), libMesh::Elem::node_ptr(), and libMesh::NODEELEM.

◆ build_side_ptr() [8/8]

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

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

◆ build_with_id()

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

◆ center_node_on_side()

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

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

Reimplemented from libMesh::Elem.

Definition at line 159 of file edge.C.

160{
161 libmesh_assert_less (side, this->n_sides());
162 return side;
163}

References n_sides().

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

2791{
2792 for (auto n : elem->neighbor_ptr_range())
2793 if (n && n->parent() == this)
2794 return n;
2795
2796 return nullptr;
2797}
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Returns a range with all neighbors of an element, usable in range-based for loops.
Definition elem.h:3641

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

2779{
2780 for (auto n : elem->neighbor_ptr_range())
2781 if (n && n->parent() == this)
2782 return n;
2783
2784 return nullptr;
2785}

References libMesh::Elem::neighbor_ptr_range().

Referenced by ElemTest< elem_type >::test_n_refinements().

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

3311{
3314
3315 return _children[i];
3316}

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

2485{
2487 return {_children.get(), _children.get() + this->n_children()};
2488}

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

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

804{
805 this->set_n_systems(0);
806}

References libMesh::DofObject::set_n_systems().

◆ clear_old_dof_object()

void libMesh::DofObject::clear_old_dof_object ( )
inherited

Sets the old_dof_object to nullptr.

Definition at line 120 of file dof_object.C.

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

References libMesh::DofObject::old_dof_object.

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

◆ close_to_point()

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

Reimplemented in libMesh::NodeElem.

Definition at line 2911 of file elem.C.

2912{
2913 // This test uses the user's passed-in tolerance for the
2914 // bounding box test as well, thereby allowing the routine to
2915 // find points which are not only "in" the element, but also
2916 // "nearby" to within some tolerance.
2917 return this->point_test(p, tol, tol);
2918}
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:2923

References libMesh::Elem::point_test().

Referenced by assemble_SchroedingerEquation(), libMesh::TreeNode< N >::find_element(), libMesh::PointLocatorNanoflann::operator()(), libMesh::PointLocatorTree::operator()(), and libMesh::PointLocatorNanoflann::operator()().

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

181{
182 libmesh_assert_equal_to (this->refinement_flag(), Elem::COARSEN_INACTIVE);
183 libmesh_assert (!this->active());
184
185 // We no longer delete children until MeshRefinement::contract()
186
187 unsigned int parent_p_level = 0;
188
189 const unsigned int n_n = this->n_nodes();
190
191 // re-compute hanging node nodal locations
192 for (unsigned int c = 0, nc = this->n_children(); c != nc; ++c)
193 {
194 Elem * mychild = this->child_ptr(c);
195 if (mychild == remote_elem)
196 continue;
197 for (auto cnode : mychild->node_index_range())
198 {
199 Point new_pos;
200 bool calculated_new_pos = false;
201
202 for (unsigned int n=0; n<n_n; n++)
203 {
204 // The value from the embedding matrix
205 const Real em_val = this->embedding_matrix(c,cnode,n);
206
207 // The node location is somewhere between existing vertices
208 if ((em_val != 0.) && (em_val != 1.))
209 {
210 new_pos.add_scaled (this->point(n), em_val);
211 calculated_new_pos = true;
212 }
213 }
214
215 if (calculated_new_pos)
216 {
217 //Move the existing node back into it's original location
218 for (unsigned int i=0; i<LIBMESH_DIM; i++)
219 {
220 Point & child_node = mychild->point(cnode);
221 child_node(i)=new_pos(i);
222 }
223 }
224 }
225 }
226
227 for (auto & mychild : this->child_ref_range())
228 {
229 if (&mychild == remote_elem)
230 continue;
231 libmesh_assert_equal_to (mychild.refinement_flag(), Elem::COARSEN);
232 mychild.set_refinement_flag(Elem::INACTIVE);
233 if (mychild.p_level() > parent_p_level)
234 parent_p_level = mychild.p_level();
235 }
236
238 this->set_p_level(parent_p_level);
239
240 libmesh_assert (this->active());
241}
const Point & point(const unsigned int i) const
Definition elem.h:2583
IntRange< unsigned short > node_index_range() const
Definition elem.h:2821
void set_refinement_flag(const RefinementState rflag)
Sets the value of the refinement flag for the element.
Definition elem.h:3356
void set_p_level(const unsigned int p)
Sets the value of the p-refinement level for the element.

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

◆ complete_order_equivalent_type()

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

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

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

Definition at line 3755 of file elem.C.

3756{
3757 switch (et)
3758 {
3759 case NODEELEM:
3760 return NODEELEM;
3761 case EDGE2:
3762 case EDGE3:
3763 return EDGE3;
3764
3765 case EDGE4:
3766 return EDGE4;
3767
3768 case TRI3:
3769 case TRI6:
3770 case TRI7:
3771 return TRI7;
3772
3773 // Currently there is no TRISHELL6, so similarly to other types
3774 // where this is the case, we just return the input.
3775 case TRISHELL3:
3776 return TRISHELL3;
3777
3778 case QUAD4:
3779 case QUAD8:
3780 case QUAD9:
3781 return QUAD9;
3782
3783 case QUADSHELL4:
3784 case QUADSHELL8:
3785 case QUADSHELL9:
3786 return QUADSHELL9;
3787
3788 case TET4:
3789 case TET10:
3790 case TET14:
3791 return TET14;
3792
3793 case HEX8:
3794 case HEX20:
3795 case HEX27:
3796 return HEX27;
3797
3798 // We don't strictly need the 21st node for DoFs, but some code
3799 // depends on it for e.g. refinement patterns
3800 case PRISM6:
3801 case PRISM15:
3802 case PRISM18:
3803 case PRISM20:
3804 case PRISM21:
3805 return PRISM21;
3806
3807 case PYRAMID5:
3808 case PYRAMID13:
3809 case PYRAMID14:
3810 case PYRAMID18:
3811 return PYRAMID18;
3812
3813
3814
3815#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
3816 case INFEDGE2:
3817 return INFEDGE2;
3818
3819 case INFQUAD4:
3820 case INFQUAD6:
3821 return INFQUAD6;
3822
3823 case INFHEX8:
3824 case INFHEX16:
3825 case INFHEX18:
3826 return INFHEX18;
3827
3828 // Probably ought to implement INFPRISM13 and/or 14; until then
3829 // we'll just return the not-complete-order ElemType, in
3830 // accordance which what seems like bad precedent...
3831 case INFPRISM6:
3832 case INFPRISM12:
3833 return INFPRISM12;
3834#endif // LIBMESH_ENABLE_INFINITE_ELEMENTS
3835
3836 default:
3837 {
3838 // what did we miss?
3839 libmesh_error_msg("No complete order equivalent element type for et = "
3841 }
3842 }
3843}

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

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

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

3442{
3443 // Order the two so that n0 < n1
3444 if (n0 > n1) std::swap (n0, n1);
3445
3446 return Utility::hashword2(n0, n1);
3447}
uint32_t hashword2(const uint32_t &first, const uint32_t &second, uint32_t initval=0)
This is a hard-coded version of hashword for hashing exactly 2 numbers.
Definition hashword.h:215

References libMesh::Utility::hashword2().

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

3455{
3456 std::array<dof_id_type, 3> array = {{n0, n1, n2}};
3457 std::sort(array.begin(), array.end());
3458 return Utility::hashword(array);
3459}
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:158

References libMesh::Utility::hashword().

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

3468{
3469 std::array<dof_id_type, 4> array = {{n0, n1, n2, n3}};
3470 std::sort(array.begin(), array.end());
3471 return Utility::hashword(array);
3472}

References libMesh::Utility::hashword().

◆ connectivity()

virtual void libMesh::Elem::connectivity ( const unsigned int  sc,
const IOPackage  iop,
std::vector< dof_id_type > &  conn 
) const
pure virtualinherited

◆ construct()

std::unique_ptr< DofObject > libMesh::DofObject::construct ( const DofObject *  other = nullptr)
inlineprivateinherited

Convenient factory function that calls either the (deep) copy constructor or the default constructor depending on the input arg.

Like the copy constructor, this function is also private. We can't use std::make_unique to construct a DofObject since the copy constructor is private, but we can at least encapsulate the code which calls "new" directly.

Definition at line 746 of file dof_object.h.

747{
748 return other
749 ? std::unique_ptr<DofObject>(new DofObject(*other))
750 : std::unique_ptr<DofObject>(new DofObject());
751}
DofObject()
Constructor.
Definition dof_object.h:732

References libMesh::DofObject::DofObject().

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

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

887{
888 unsigned int num_contained_edges = 0;
889
890 // Our vertices are the first numbered nodes
891 for (auto n : make_range(e->n_vertices()))
892 {
893 if (this->contains_point(e->point(n)))
894 {
895 num_contained_edges++;
896 if (num_contained_edges>=2)
897 {
898 return true;
899 }
900 }
901 }
902 return false;
903}
virtual unsigned int n_vertices() const =0
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition elem.C:2886

References libMesh::Elem::contains_point(), libMesh::make_range(), 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 physical point p is contained in this element, false otherwise.

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

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

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

Definition at line 2886 of file elem.C.

2887{
2888 // We currently allow the user to enlarge the bounding box by
2889 // providing a tol > TOLERANCE (so this routine is identical to
2890 // Elem::close_to_point()), but print a warning so that the
2891 // user can eventually switch his code over to calling close_to_point()
2892 // instead, which is intended to be used for this purpose.
2893 if (tol > TOLERANCE)
2894 {
2895 libmesh_do_once(libMesh::err
2896 << "WARNING: Resizing bounding box to match user-specified tolerance!\n"
2897 << "In the future, calls to Elem::contains_point() with tol > TOLERANCE\n"
2898 << "will be more optimized, but should not be used\n"
2899 << "to search for points 'close to' elements!\n"
2900 << "Instead, use Elem::close_to_point() for this purpose.\n"
2901 << std::endl;);
2902 return this->point_test(p, tol, tol);
2903 }
2904 else
2905 return this->point_test(p, TOLERANCE, tol);
2906}
OStreamProxy err
static constexpr Real TOLERANCE

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

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

◆ contains_vertex_of()

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

Definition at line 848 of file elem.C.

849{
850 // Our vertices are the first numbered nodes
851 const unsigned int nv = e->n_vertices();
852 const unsigned int my_nv = this->n_vertices();
853
854 // Check for vertex-to-vertex containment first; contains_point() is
855 // expensive
856 for (auto n : make_range(nv))
857 {
858 const Node * vertex = e->node_ptr(n);
859 for (auto my_n : make_range(my_nv))
860 if (&this->node_ref(my_n) == vertex)
861 return true;
862 }
863
864 // If e is in our mesh, then we might be done testing
865 if (mesh_connection)
866 {
867 const unsigned int l = this->level();
868 const unsigned int el = e->level();
869
870 if (l >= el)
871 return false;
872
873 // We could also return false for l==el-1 iff we knew we had no
874 // triangular faces, but we don't have an API to check that.
875 }
876
877 // Our vertices are the first numbered nodes
878 for (auto n : make_range(nv))
879 if (this->contains_point(e->point(n)))
880 return true;
881 return false;
882}
const Node & node_ref(const unsigned int i) const
Definition elem.h:2659
unsigned int level() const
Definition elem.h:3212

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

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

246{
247 // Subactive elements get deleted entirely, not contracted
248 libmesh_assert (this->active());
249
250 // Active contracted elements no longer can have children
251 _children.reset(nullptr);
252
255}

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

◆ debug_buffer()

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

Print our buffer for debugging.

Definition at line 652 of file dof_object.C.

653{
654 libMesh::out << " [ ";
655 for (const auto & idx : _idx_buf)
656 libMesh::out << idx << " ";
657 libMesh::out << "]\n";
658}
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.
The libMesh namespace provides an interface to certain functionality in the library.
OStreamProxy out

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

◆ default_order()

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

Implemented in libMesh::C0Polyhedron, libMesh::Hex20, libMesh::Hex27, libMesh::Hex8, libMesh::InfHex16, libMesh::InfHex18, libMesh::InfHex8, libMesh::InfPrism12, libMesh::InfPrism6, libMesh::Prism15, libMesh::Prism18, libMesh::Prism20, libMesh::Prism21, libMesh::Prism6, libMesh::Pyramid13, libMesh::Pyramid14, libMesh::Pyramid18, libMesh::Pyramid5, libMesh::Tet10, libMesh::Tet14, libMesh::Tet4, libMesh::Edge2, libMesh::Edge3, libMesh::Edge4, libMesh::InfEdge2, libMesh::C0Polygon, libMesh::InfQuad4, libMesh::InfQuad6, libMesh::Quad4, libMesh::Quad8, libMesh::Quad9, libMesh::Tri3, libMesh::Tri3Subdivision, libMesh::Tri6, libMesh::Tri7, libMesh::NodeElem, and libMesh::RemoteElem.

Referenced by libMesh::MeshTools::Modification::all_rbb(), libMesh::Elem::bracketing_nodes(), libMesh::FEMap::compute_face_map(), libMesh::FEAbstract::compute_node_constraints(), libMesh::InfHex::contains_point(), libMesh::InfPrism::contains_point(), libMesh::MeshBase::copy_constraint_rows(), libMesh::Elem::default_side_order(), libMesh::FEMap::init_face_shape_functions(), libMesh::FEMap::init_reference_to_physical_map(), libMesh::FEMap::map(), libMesh::FEMap::map_deriv(), libMesh::Elem::parent_bracketing_nodes(), libMesh::Elem::point_test(), libMesh::ExodusII_IO::read(), libMesh::Elem::side_vertex_average_normal(), libMesh::Elem::supported_nodal_order(), libMesh::Elem::true_centroid(), and libMesh::Elem::volume().

◆ default_side_order()

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

Reimplemented in libMesh::Tri7.

Definition at line 1110 of file elem.h.

1110{ return default_order(); }

References libMesh::Elem::default_order().

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

◆ dim()

virtual unsigned short libMesh::Edge::dim ( ) const
inlinefinaloverridevirtual
Returns
1, the dimensionality of the object.

Implements libMesh::Elem.

Definition at line 73 of file edge.h.

73{ return 1; }

◆ disable_print_counter_info() [1/2]

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 100 of file reference_counter.C.

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

References libMesh::ReferenceCounter::_enable_print_counter.

◆ disable_print_counter_info() [2/2]

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 100 of file reference_counter.C.

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

References libMesh::ReferenceCounter::_enable_print_counter.

◆ disconnected_clone()

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

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

Reimplemented in libMesh::C0Polyhedron.

Definition at line 350 of file elem.C.

351{
352 std::unique_ptr<Elem> returnval;
353
354 switch (this->type())
355 {
356 case C0POLYGON:
357 returnval = std::make_unique<C0Polygon>(this->n_sides());
358 break;
359
360 default:
361 returnval = Elem::build(this->type());
362 }
363
364 returnval->set_id() = this->id();
365#ifdef LIBMESH_ENABLE_UNIQUE_ID
366 if (this->valid_unique_id())
367 returnval->set_unique_id(this->unique_id());
368#endif
369
370 const auto n_elem_ints = this->n_extra_integers();
371 returnval->add_extra_integers(n_elem_ints);
372 for (unsigned int i = 0; i != n_elem_ints; ++i)
373 returnval->set_extra_integer(i, this->get_extra_integer(i));
374
375 returnval->inherit_data_from(*this);
376
377 return returnval;
378}
unique_id_type unique_id() const
Definition dof_object.h:849
bool valid_unique_id() const
Definition dof_object.h:883
dof_id_type id() const
Definition dof_object.h:833
virtual unsigned int n_sides() const =0

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

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

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

1025{
1026 libmesh_assert_less (s, this->n_systems());
1027 libmesh_assert_less (var, this->n_vars(s));
1028 libmesh_assert_less (comp, this->n_comp(s,var));
1029
1030 const std::pair<unsigned int, unsigned int>
1031 vg_vig = this->var_to_vg_and_offset(s,var);
1032
1033 const unsigned int
1034 n_comp = this->n_comp_group(s,vg_vig.first);
1035
1036 return this->dof_number(s, vg_vig.first, vg_vig.second,
1037 comp, n_comp);
1038}
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition dof_object.h:992
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
std::pair< unsigned int, unsigned int > var_to_vg_and_offset(const unsigned int s, const unsigned int var) const

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

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::DofMap::allgather_recursive_constraints(), assemble_advection_diffusion(), assemble_matrix_and_rhs(), assemble_shell(), centroid_l2_error(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), GhostDofConstraint::constrain(), libMesh::VariationalSmootherConstraint::constrain_node_to_line(), libMesh::VariationalSmootherConstraint::constrain_node_to_plane(), libMesh::DofMap::constrain_p_dofs(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::Nemesis_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::Nemesis_IO::copy_nodal_solution(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::dof_indices(), libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_mixed_derivatives(), libMesh::OldSolutionValue< Output, point_output >::eval_mixed_derivatives(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), fill_dirichlet_bc(), libMesh::VariationalSmootherConstraint::fix_node(), libMesh::Elem::get_info(), libMesh::Node::get_info(), AssemblyPointLoadX::get_nodal_rhs_values(), AssemblyPointLoadY::get_nodal_rhs_values(), AssemblyPointLoadZ::get_nodal_rhs_values(), libMesh::DofMap::local_variable_indices(), main(), libMesh::DofMap::old_dof_indices(), libMesh::BuildProjectionList::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectInteriors::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::DofObject::operator=(), libMesh::DofObject::print_dof_info(), libMesh::DofMap::process_mesh_constraint_rows(), LinearElasticityWithContact::residual_and_jacobian(), libMesh::HPCoarsenTest::select_refinement(), libMesh::DofObject::set_dof_number(), libMesh::PetscPreconditioner< T >::set_hypre_ads_data(), libMesh::PetscPreconditioner< T >::set_hypre_ams_data(), libMesh::DofMap::set_nonlocal_dof_objects(), ParsedFEMFunctionTest::setUp(), DofMapTest::testGhostConstraintSendList(), DofObjectTest< DerivedClass >::testJensEftangBug(), DofObjectTest< DerivedClass >::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 1043 of file dof_object.h.

1048{
1049 libmesh_assert_less (s, this->n_systems());
1050 libmesh_assert_less (vg, this->n_var_groups(s));
1051 libmesh_assert_less (vig, this->n_vars(s,vg));
1052
1053 const unsigned int
1054 start_idx_sys = this->start_idx(s);
1055
1056 libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1057
1058 const dof_id_type
1059 base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
1060
1061 // if the first component is invalid, they
1062 // are all invalid
1063 if (base_idx == invalid_id)
1064 return invalid_id;
1065
1066 // otherwise the index is the first component
1067 // index augmented by the component number
1068 else
1069 return cast_int<dof_id_type>(base_idx + vig*n_comp + comp);
1070}
unsigned int start_idx(const unsigned int s) const
The starting index for system s.

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

◆ edge_index_range()

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

◆ edge_type()

ElemType libMesh::Elem::edge_type ( const ElemType  t)
staticinherited
Returns
The type of every edge of an element of type t, or INVALID_ELEM for the 1D types, which have no edges. Unlike its sides, a finite element's edges all have the same type, so no edge index is needed; the infinite elements, whose finite and infinite edges differ, are not answered here.

Definition at line 3380 of file elem.C.

3381{
3382 switch (t)
3383 {
3384 // 1D elements have no edges
3385 case EDGE2:
3386 case EDGE3:
3387 case EDGE4:
3388 return INVALID_ELEM;
3389 // A 2D element's edges are its sides
3390 case TRI3:
3391 case TRISHELL3:
3392 case TRI6:
3393 case TRI7:
3394 case QUAD4:
3395 case QUADSHELL4:
3396 case QUAD8:
3397 case QUADSHELL8:
3398 case QUAD9:
3399 case QUADSHELL9:
3400 case C0POLYGON:
3401 return side_type(t, 0);
3402 // A first-order 3D element's edges hold their two vertices
3403 case TET4:
3404 case HEX8:
3405 case PRISM6:
3406 case PYRAMID5:
3407 case C0POLYHEDRON:
3408 return EDGE2;
3409 // and a second-order element's add the midpoint
3410 case TET10:
3411 case TET14:
3412 case HEX20:
3413 case HEX27:
3414 case PRISM15:
3415 case PRISM18:
3416 case PRISM20:
3417 case PRISM21:
3418 case PYRAMID13:
3419 case PYRAMID14:
3420 case PYRAMID18:
3421 return EDGE3;
3422 default:
3423 libmesh_error_msg("No edge type for element type " << Utility::enum_to_string(t));
3424 }
3425
3426 return INVALID_ELEM;
3427}
virtual ElemType side_type(const unsigned int s) const =0

References libMesh::C0POLYGON, libMesh::C0POLYHEDRON, libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::Utility::enum_to_string(), libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::INVALID_ELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM20, libMesh::PRISM21, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID18, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::QUADSHELL9, libMesh::Elem::side_type(), libMesh::TET10, libMesh::TET14, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, libMesh::TRI7, and libMesh::TRISHELL3.

Referenced by libMesh::Elem::local_edge_node(), and ElemTest< elem_type >::test_static_topology().

◆ edges_adjacent_to_node()

virtual std::vector< unsigned int > libMesh::Edge::edges_adjacent_to_node ( const unsigned int  ) const
inlinefinaloverridevirtual

1D elements don't have any edges, but they are themselves edges, so I guess an argument could be made for returning "this" somehow.

Since I don't know exactly how that should be done, return an empty vector for now.

Implements libMesh::Elem.

Definition at line 215 of file edge.h.

216 { return {}; }

◆ embedding_matrix()

virtual Real libMesh::Elem::embedding_matrix ( const unsigned int  child_num,
const unsigned int  child_node_num,
const unsigned int  parent_node_num 
) const
pure virtualinherited

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

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

Enabled by default.

Definition at line 94 of file reference_counter.C.

95{
97 return;
98}

References libMesh::ReferenceCounter::_enable_print_counter.

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

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

Enabled by default.

Definition at line 94 of file reference_counter.C.

95{
97 return;
98}

References libMesh::ReferenceCounter::_enable_print_counter.

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

◆ end_idx()

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

The ending index for system s.

Definition at line 1250 of file dof_object.h.

1251{
1252 libmesh_assert_less (s, this->n_systems());
1253 libmesh_assert_less (s, _idx_buf.size());
1254
1255 return ((s+1) == this->n_pseudo_systems()) ?
1256 cast_int<unsigned int>(_idx_buf.size()) :
1257 cast_int<unsigned int>(_idx_buf[s+1]);
1258}
void ErrorVector unsigned int
unsigned int n_pseudo_systems() const
Definition dof_object.h:937
Tnew cast_int(Told oldvar)

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

1278{
1280
1281 return cast_int<unsigned int>(_idx_buf.size());
1282}

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

◆ face_index_range()

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

Definition at line 2839 of file elem.h.

2840{
2841 return {0, cast_int<unsigned short>(this->n_faces())};
2842}
virtual unsigned int n_faces() const =0

References libMesh::Elem::n_faces().

Referenced by libMesh::FE< Dim, T >::cache().

◆ face_orientation()

unsigned int libMesh::Elem::face_orientation ( const unsigned int  i) const
inherited
Returns
An index over the symmetries of face i (six for a triangle, eight for a quadrilateral): twice the position of the lexicographically least vertex in the face's node map, plus 1 if the face is positively oriented.

Unlike positive_face_orientation(), this fixes the full ordering of the face's vertices, which a basis with face degrees of freedom (e.g. HIERARCHIC of order three or above) needs in order to be conforming across the face.

Definition at line 4053 of file elem.C.

4054{
4055 libmesh_assert_less (i, this->n_faces());
4056
4057 // Get the number of vertices N of face i. Note that for 3d elements, i.e.
4058 // elements for which this->n_faces() > 0, the number of vertices on any of
4059 // its sides (or faces) is just the number of that face's sides (or edges).
4060 const unsigned int N = Elem::type_to_n_sides_map[this->side_type(i)];
4061
4062 const std::vector<unsigned int> nodes = this->nodes_on_side(i);
4063
4064 auto cmp = [&](const unsigned int & m, const unsigned int & n) -> bool
4065 { return this->point(m) < this->point(n); };
4066
4067 const unsigned int v = std::distance(nodes.begin(),
4068 std::min_element(nodes.begin(), nodes.begin() + N, cmp));
4069
4070 // v is the position of the least vertex. Compare its neighbors just
4071 // before and after it, cyclically: the face is positively oriented iff
4072 // the lesser neighbor precedes v, i.e. the vertices run backward from
4073 // the least vertex through the face's node map.
4074 return 2 * v + cmp(nodes[(v - 1 + N) % N], nodes[(v + 1) % N]);
4075}
virtual std::vector< unsigned int > nodes_on_side(const unsigned int) const =0
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...
Definition elem.h:759

References libMesh::Elem::n_faces(), libMesh::Elem::nodes_on_side(), libMesh::Elem::point(), libMesh::Elem::side_type(), and libMesh::Elem::type_to_n_sides_map.

Referenced by FEOrientationTestBase< order, family >::entity_orientation(), libMesh::Elem::oriented_face_vertices(), and libMesh::Elem::positive_face_orientation().

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

2214{
2215 ElemInternal::family_tree(this, family, reset);
2216}
void family_tree(T elem, std::vector< T > &family, bool reset=true)

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

2222{
2223 ElemInternal::family_tree(this, family, reset);
2224}

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

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

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

2326{
2327 ElemInternal::family_tree_by_neighbor(this, family, neighbor, reset);
2328}

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

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

References libMesh::ElemInternal::family_tree_by_side().

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

2272{
2273 ElemInternal::family_tree_by_side(this, family, side, reset);
2274}

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

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

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

2364{
2365 ElemInternal::family_tree_by_subneighbor(this, family, neighbor, subneighbor, reset);
2366}

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

1000{
1001 // Simple but perhaps suboptimal code: find elements containing the
1002 // first point, then winnow this set down by removing elements which
1003 // don't also contain the second point
1004
1005 libmesh_assert(this->contains_point(p2));
1006 this->find_point_neighbors(p1, neighbor_set);
1007
1008 std::set<const Elem *>::iterator it = neighbor_set.begin();
1009 const std::set<const Elem *>::iterator end = neighbor_set.end();
1010
1011 while (it != end)
1012 {
1013 // As of C++11, set::erase returns an iterator to the element
1014 // following the erased element, or end.
1015 if (!(*it)->contains_point(p2))
1016 it = neighbor_set.erase(it);
1017 else
1018 ++it;
1019 }
1020}
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:907

References libMesh::Elem::contains_point(), 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 1024 of file elem.C.

1025{
1026 neighbor_set.clear();
1027 neighbor_set.insert(this);
1028
1029 std::set<const Elem *> untested_set, next_untested_set;
1030 untested_set.insert(this);
1031
1032 while (!untested_set.empty())
1033 {
1034 // Loop over all the elements in the patch that haven't already
1035 // been tested
1036 for (const auto & elem : untested_set)
1037 {
1038 for (auto current_neighbor : elem->neighbor_ptr_range())
1039 {
1040 if (current_neighbor &&
1041 current_neighbor != remote_elem) // we have a real neighbor on this side
1042 {
1043 if (current_neighbor->active()) // ... if it is active
1044 {
1045 if (this->contains_edge_of(current_neighbor) // ... and touches us
1046 || current_neighbor->contains_edge_of(this))
1047 {
1048 // Make sure we'll test it
1049 if (!neighbor_set.count(current_neighbor))
1050 next_untested_set.insert (current_neighbor);
1051
1052 // And add it
1053 neighbor_set.insert (current_neighbor);
1054 }
1055 }
1056#ifdef LIBMESH_ENABLE_AMR
1057 else // ... the neighbor is *not* active,
1058 { // ... so add *all* neighboring
1059 // active children
1060 std::vector<const Elem *> active_neighbor_children;
1061
1062 current_neighbor->active_family_tree_by_neighbor
1063 (active_neighbor_children, elem);
1064
1065 for (const auto & current_child : active_neighbor_children)
1066 if (this->contains_edge_of(current_child) || current_child->contains_edge_of(this))
1067 {
1068 // Make sure we'll test it
1069 if (!neighbor_set.count(current_child))
1070 next_untested_set.insert (current_child);
1071
1072 neighbor_set.insert (current_child);
1073 }
1074 }
1075#endif // #ifdef LIBMESH_ENABLE_AMR
1076 }
1077 }
1078 }
1079 untested_set.swap(next_untested_set);
1080 next_untested_set.clear();
1081 }
1082}
bool contains_edge_of(const Elem *e) const
Definition elem.C:886

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

1087{
1088 ElemInternal::find_interior_neighbors(this, neighbor_set);
1089}
void find_interior_neighbors(T this_elem, std::set< T > &neighbor_set)

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

1094{
1095 ElemInternal::find_interior_neighbors(this, neighbor_set);
1096}

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

909{
911 libmesh_assert(this->active());
912
913 neighbor_set.clear();
914 neighbor_set.insert(this);
915
916 std::set<const Elem *> untested_set, next_untested_set;
917 untested_set.insert(this);
918
919#ifdef LIBMESH_ENABLE_AMR
920 std::vector<const Elem *> active_neighbor_children;
921#endif // #ifdef LIBMESH_ENABLE_AMR
922
923 while (!untested_set.empty())
924 {
925 // Loop over all the elements in the patch that haven't already
926 // been tested
927 for (const auto & elem : untested_set)
928 for (auto current_neighbor : elem->neighbor_ptr_range())
929 {
930 if (current_neighbor &&
931 current_neighbor != remote_elem) // we have a real neighbor on this side
932 {
933 if (current_neighbor->active()) // ... if it is active
934 {
935 auto it = neighbor_set.lower_bound(current_neighbor);
936 if ((it == neighbor_set.end() || *it != current_neighbor) &&
937 current_neighbor->contains_point(p)) // ... don't have and touches p
938 {
939 // Add it and test it
940 next_untested_set.insert(current_neighbor);
941 neighbor_set.emplace_hint(it, current_neighbor);
942 }
943 }
944#ifdef LIBMESH_ENABLE_AMR
945 else // ... the neighbor is *not* active,
946 { // ... so add *all* neighboring
947 // active children that touch p
948 active_neighbor_children.clear();
949 current_neighbor->active_family_tree_by_neighbor
950 (active_neighbor_children, elem);
951
952 for (const auto & current_child : active_neighbor_children)
953 {
954 auto it = neighbor_set.lower_bound(current_child);
955 if ((it == neighbor_set.end() || *it != current_child) &&
956 current_child->contains_point(p))
957 {
958 // Add it and test it
959 next_untested_set.insert(current_child);
960 neighbor_set.emplace_hint(it, current_child);
961 }
962 }
963 }
964#endif // #ifdef LIBMESH_ENABLE_AMR
965 }
966 }
967 untested_set.swap(next_untested_set);
968 next_untested_set.clear();
969 }
970}

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

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

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

975{
976 this->find_point_neighbors(neighbor_set, this);
977}

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

983{
984 ElemInternal::find_point_neighbors(this, neighbor_set, start_elem);
985}
void find_point_neighbors(T this_elem, std::set< T > &neighbor_set, T start_elem)

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

991{
992 ElemInternal::find_point_neighbors(this, neighbor_set, start_elem);
993}

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

3202{
3203 switch (et)
3204 {
3205 case NODEELEM:
3206 return NODEELEM;
3207 case EDGE2:
3208 case EDGE3:
3209 case EDGE4:
3210 return EDGE2;
3211 case TRI3:
3212 case TRI6:
3213 case TRI7:
3214 return TRI3;
3215 case TRISHELL3:
3216 return TRISHELL3;
3217 case QUAD4:
3218 case QUAD8:
3219 case QUAD9:
3220 return QUAD4;
3221 case QUADSHELL4:
3222 case QUADSHELL8:
3223 case QUADSHELL9:
3224 return QUADSHELL4;
3225 case TET4:
3226 case TET10:
3227 case TET14:
3228 return TET4;
3229 case HEX8:
3230 case HEX27:
3231 case HEX20:
3232 return HEX8;
3233 case PRISM6:
3234 case PRISM15:
3235 case PRISM18:
3236 case PRISM20:
3237 case PRISM21:
3238 return PRISM6;
3239 case PYRAMID5:
3240 case PYRAMID13:
3241 case PYRAMID14:
3242 case PYRAMID18:
3243 return PYRAMID5;
3244
3245#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
3246
3247 case INFEDGE2:
3248 return INFEDGE2;
3249 case INFQUAD4:
3250 case INFQUAD6:
3251 return INFQUAD4;
3252 case INFHEX8:
3253 case INFHEX16:
3254 case INFHEX18:
3255 return INFHEX8;
3256 case INFPRISM6:
3257 case INFPRISM12:
3258 return INFPRISM6;
3259
3260#endif
3261
3262 default:
3263 // unknown element
3264 return INVALID_ELEM;
3265 }
3266}

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

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

◆ flip()

virtual void libMesh::Elem::flip ( BoundaryInfo *  boundary_info)
pure virtualinherited

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

1137{
1138#ifndef NDEBUG
1139 const unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
1140#endif
1141 libmesh_assert_less(index+n_more_integers, this->n_extra_integers());
1142 libmesh_assert_less(this->n_systems(), _idx_buf.size());
1143
1144 const unsigned int start_idx_i = this->start_idx_ints();
1145
1146 libmesh_assert_less(start_idx_i+index+n_more_integers, _idx_buf.size());
1147 T returnval;
1148 std::memcpy(&returnval, &_idx_buf[start_idx_i+index], sizeof(T));
1149 return returnval;
1150}
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.

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

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

◆ get_extra_integer()

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

◆ 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 & [name, cd] : _counts)
59 oss << "| " << name << " reference count information:\n"
60 << "| Creations: " << cd.first << '\n'
61 << "| Destructions: " << cd.second << '\n';
62
63 oss << " ---------------------------------------------------------------------------- \n";
64
65 return oss.str();
66
67#else
68
69 return "";
70
71#endif
72}
static Counts _counts
Actually holds the data.
std::string name(const ElemQuality q)
This function returns a string containing some name for q.

References libMesh::ReferenceCounter::_counts.

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 & [name, cd] : _counts)
59 oss << "| " << name << " reference count information:\n"
60 << "| Creations: " << cd.first << '\n'
61 << "| Destructions: " << cd.second << '\n';
62
63 oss << " ---------------------------------------------------------------------------- \n";
64
65 return oss.str();
66
67#else
68
69 return "";
70
71#endif
72}

References libMesh::ReferenceCounter::_counts.

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

3059{
3060 std::ostringstream oss;
3061
3062 oss << " Elem Information" << '\n'
3063 << " id()=";
3064
3065 if (this->valid_id())
3066 oss << this->id();
3067 else
3068 oss << "invalid";
3069
3070#ifdef LIBMESH_ENABLE_UNIQUE_ID
3071 oss << ", unique_id()=";
3072 if (this->valid_unique_id())
3073 oss << this->unique_id();
3074 else
3075 oss << "invalid";
3076#endif
3077
3078 oss << ", subdomain_id()=" << this->subdomain_id();
3079 oss << ", processor_id()=" << this->processor_id() << '\n';
3080
3081 oss << " type()=" << Utility::enum_to_string(this->type()) << '\n'
3082 << " dim()=" << this->dim() << '\n'
3083 << " n_nodes()=" << this->n_nodes() << '\n';
3084
3085 oss << " mapping=" << Utility::enum_to_string(this->mapping_type()) << '\n';
3086
3087 for (auto n : this->node_index_range())
3088 {
3089 oss << " " << n << this->node_ref(n);
3090 if (this->mapping_type() == RATIONAL_BERNSTEIN_MAP)
3091 {
3092 const unsigned char datum_index = this->mapping_data();
3093 oss << " weight=" <<
3094 this->node_ref(n).get_extra_datum<Real>(datum_index) << '\n';
3095 }
3096 }
3097
3098 oss << " n_sides()=" << this->n_sides() << '\n';
3099
3100 for (auto s : this->side_index_range())
3101 {
3102 oss << " neighbor(" << s << ")=";
3103 if (this->neighbor_ptr(s))
3104 oss << this->neighbor_ptr(s)->id() << '\n';
3105 else
3106 oss << "nullptr\n";
3107 }
3108
3109 if (!this->infinite())
3110 {
3111 oss << " hmin()=" << this->hmin()
3112 << ", hmax()=" << this->hmax() << '\n'
3113 << " volume()=" << this->volume() << '\n';
3114 }
3115 oss << " active()=" << this->active()
3116 << ", ancestor()=" << this->ancestor()
3117 << ", subactive()=" << this->subactive()
3118 << ", has_children()=" << this->has_children() << '\n'
3119 << " parent()=";
3120 if (this->parent())
3121 oss << this->parent()->id() << '\n';
3122 else
3123 oss << "nullptr\n";
3124 oss << " level()=" << this->level()
3125 << ", p_level()=" << this->p_level() << '\n'
3126#ifdef LIBMESH_ENABLE_AMR
3127 << " refinement_flag()=" << Utility::enum_to_string(this->refinement_flag()) << '\n'
3128 << " p_refinement_flag()=" << Utility::enum_to_string(this->p_refinement_flag()) << '\n'
3129#endif
3130#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
3131 << " infinite()=" << this->infinite() << '\n';
3132 if (this->infinite())
3133 oss << " origin()=" << this->origin() << '\n'
3134#endif
3135 ;
3136
3137 oss << " DoFs=";
3138 for (auto s : make_range(this->n_systems()))
3139 for (auto v : make_range(this->n_vars(s)))
3140 for (auto c : make_range(this->n_comp(s,v)))
3141 oss << '(' << s << '/' << v << '/' << this->dof_number(s,v,c) << ") ";
3142
3143
3144 return oss.str();
3145}
bool valid_id() const
Definition dof_object.h:875
processor_id_type processor_id() const
Definition dof_object.h:895
T get_extra_datum(const unsigned int index) const
Gets the value on this object of the extra datum associated with index, which should have been obtain...
unsigned char mapping_data() const
Definition elem.h:3274
virtual Point origin() const
Definition elem.h:2044
bool ancestor() const
Definition elem.C:2121
virtual Real hmin() const
Definition elem.C:623
virtual unsigned short dim() const =0
subdomain_id_type subdomain_id() const
Definition elem.h:2712
virtual Real hmax() const
Definition elem.C:647
ElemMappingType mapping_type() const
Definition elem.h:3258
virtual Real volume() const
Definition elem.C:3865
unsigned int p_level() const
Definition elem.h:3246
RefinementState p_refinement_flag() const
Definition elem.h:3364
const Elem * neighbor_ptr(unsigned int i) const
Definition elem.h:2736
virtual bool infinite() const =0
IntRange< unsigned short > side_index_range() const
Definition elem.h:2848
@ RATIONAL_BERNSTEIN_MAP

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

Referenced by libMesh::MeshTetInterface::check_hull_integrity(), libMesh::FEMap::compute_single_point_map(), libMesh::FEMap::inverse_map(), and libMesh::Elem::print_info().

◆ get_node_index()

unsigned int libMesh::Elem::get_node_index ( const Node *  node_ptr) const
inlineinherited

◆ get_nodes()

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

Definition at line 2629 of file elem.h.

2630{
2631 return _nodes;
2632}

References libMesh::Elem::_nodes.

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

◆ get_old_dof_object() [1/2]

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

◆ get_old_dof_object() [2/2]

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

Definition at line 97 of file dof_object.h.

97{ return old_dof_object.get(); }

References libMesh::DofObject::old_dof_object.

◆ get_old_dof_object_ref() [1/2]

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

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

Definition at line 104 of file dof_object.h.

105 {
107 return *old_dof_object;
108 }

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

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

◆ get_old_dof_object_ref() [2/2]

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

Definition at line 110 of file dof_object.h.

111 {
113 return *old_dof_object;
114 }

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

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

3403{
3404 if (p == 0)
3405 libmesh_assert_not_equal_to
3407
3408 _p_level = cast_int<unsigned char>(p);
3409}
unsigned char _p_level
p refinement level - the difference between the polynomial degree on this element and the minimum pol...
Definition elem.h:2420

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

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

◆ hack_p_level_and_refinement_flag()

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

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

Definition at line 3413 of file elem.h.

3415{
3416 _pflag = cast_int<unsigned char>(pflag);
3417 this->hack_p_level(p);
3418}
void hack_p_level(const unsigned int p)
Sets the value of the p-refinement level for the element without altering the p-level of its ancestor...
Definition elem.h:3402
unsigned char _pflag
p refinement flag.
Definition elem.h:2410

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

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

◆ has_affine_map()

virtual bool libMesh::Elem::has_affine_map ( ) const
inlinevirtualinherited

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

3132{
3133#ifdef LIBMESH_ENABLE_AMR
3134 if (!_children)
3135 return false;
3136 else
3137 for (auto & c : child_ref_range())
3138 if (c.has_children())
3139 return true;
3140#endif
3141 return false;
3142}

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

Referenced by ElemTest< elem_type >::test_n_refinements().

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

1217{
1218 if (sys == libMesh::invalid_uint)
1219 {
1220 for (auto s : make_range(this->n_systems()))
1221 if (this->n_vars(s))
1222 return true;
1223 }
1224
1225 else
1226 {
1227 libmesh_assert_less (sys, this->n_systems());
1228
1229 if (this->n_vars(sys))
1230 return true;
1231 }
1232
1233 return false;
1234}

References libMesh::invalid_uint, libMesh::make_range(), libMesh::DofObject::n_systems(), and 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_invertible_map()

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

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

Definition at line 3016 of file elem.C.

3017{
3018 QNodal qnodal {this->dim()};
3019 FEMap fe_map;
3020 auto & jac = fe_map.get_jacobian();
3021
3022 // We have a separate check for is_singular_node() below, so in this
3023 // case its "OK" to do nodal quadrature on pyramids.
3024 qnodal.allow_nodal_pyramid_quadrature = true;
3025 qnodal.init(*this);
3026 auto & qp = qnodal.get_points();
3027 libmesh_assert_equal_to(qp.size(), this->n_nodes());
3028
3029 std::vector<Point> one_point(1);
3030 std::vector<Real> one_weight(1,1);
3031 for (auto i : index_range(qp))
3032 {
3033 if (this->is_singular_node(i))
3034 continue;
3035
3036 one_point[0] = qp[i];
3037
3038 fe_map.init_reference_to_physical_map(this->dim(), one_point, this);
3039 fe_map.compute_map(this->dim(), one_weight, this, false);
3040
3041 if (jac[0] <= 0)
3042 return false;
3043 }
3044
3045 return true;
3046}
virtual bool is_singular_node(unsigned int) const
Definition elem.h:1968
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition int_range.h:153

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

Referenced by VolumeTest::testEdge4Invertible().

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

2767{
2768 for (auto n : this->neighbor_ptr_range())
2769 if (n == elem)
2770 return true;
2771
2772 return false;
2773}

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

1268{
1269 // First see if this is a normal "interior" neighbor
1270 if (has_neighbor(elem))
1271 return true;
1272
1273 for (auto n : this->side_index_range())
1274 if (this->topological_neighbor(n, mesh, point_locator, pb))
1275 return true;
1276
1277 return false;
1278}
bool has_neighbor(const Elem *elem) const
Definition elem.h:2766
const Elem * topological_neighbor(const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
Definition elem.C:1227

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

648{
649 Real h_max=0;
650
651 // Avoid calling a virtual a lot of times
652 const auto n_vertices = this->n_vertices();
653
654 for (unsigned int n_outer=0; n_outer<n_vertices; n_outer++)
655 for (unsigned int n_inner=n_outer+1; n_inner<n_vertices; n_inner++)
656 {
657 const auto diff = (this->point(n_outer) - this->point(n_inner));
658
659 h_max = std::max(h_max, diff.norm_sq());
660 }
661
662 return std::sqrt(h_max);
663}

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

Referenced by libMesh::DiscontinuityMeasure::boundary_side_integration(), libMesh::KellyErrorEstimator::boundary_side_integration(), libMesh::OldSolutionBase< Output, point_output >::check_old_context(), libMesh::Elem::get_info(), libMesh::DiscontinuityMeasure::internal_side_integration(), libMesh::LaplacianErrorEstimator::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 623 of file elem.C.

624{
625 // Avoid calling a virtual a lot of times
626 const auto n_vertices = this->n_vertices();
627
628 // Special case for NodeElem
629 if (!n_vertices)
630 return 0;
631
632 Real h_min=std::numeric_limits<Real>::max();
633
634 for (unsigned int n_outer=0; n_outer<n_vertices; n_outer++)
635 for (unsigned int n_inner=n_outer+1; n_inner<n_vertices; n_inner++)
636 {
637 const auto diff = (this->point(n_outer) - this->point(n_inner));
638
639 h_min = std::min(h_min, diff.norm_sq());
640 }
641
642 return std::sqrt(h_min);
643}

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

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

◆ id()

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

Definition at line 833 of file dof_object.h.

834{
835 return _id;
836}
dof_id_type _id
The id of the DofObject.
Definition dof_object.h:574

References libMesh::DofObject::_id.

Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), add_cube_convex_hull_to_mesh(), libMesh::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::TopologyMap::add_node(), libMesh::DistributedMesh::add_node(), libMesh::ReplicatedMesh::add_node(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::ClawSystem::assemble_avg_coupling_matrices(), assemble_ellipticdg(), libMesh::ClawSystem::assemble_jump_coupling_matrix(), assemble_shell(), libMesh::MeshTools::Generation::build_cube(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::BoundaryInfo::build_side_list_from_node_list(), libMesh::MeshTetInterface::check_hull_integrity(), compute_jacobian(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), compute_residual(), libMesh::InfFE< Dim, T_radial, T_map >::compute_shape_functions(), libMesh::MeshBase::copy_constraint_rows(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::DistributedMesh::delete_elem(), libMesh::ReplicatedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::ReplicatedMesh::delete_node(), libMesh::Elem::disconnected_clone(), libMesh::C0Polyhedron::disconnected_clone(), libMesh::StaticCondensationDofMap::dof_indices(), libMesh::DTKAdapter::DTKAdapter(), libMesh::UNVIO::elements_out(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::MeshTools::find_nodal_or_face_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::Elem::get_info(), libMesh::Node::get_info(), libMesh::MeshBase::get_info(), libMesh::VariationalSmootherConstraint::get_neighbors_for_boundary_constraint(), libMesh::VariationalSmootherConstraint::get_neighbors_for_subdomain_constraint(), libMesh::MeshTetInterface::improve_hull_integrity(), libMesh::ParmetisPartitioner::initialize(), libMesh::TreeNode< N >::insert(), libMesh::TriangulatorInterface::insert_any_extra_boundary_points(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_elem(), libMesh::Poly2TriTriangulator::insert_refinement_points(), EIM_F::interior_assembly(), AssemblyEIM::interior_assembly(), libMesh::MeshTools::Modification::interpolate_surface(), libMesh::FEMap::inverse_map(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_constraint_rows(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::Tri3Subdivision::local_node_number(), main(), MeshPerElemTest< elem_type >::meshes_equal_enough(), LinearElasticityWithContact::move_mesh(), libMesh::MeshTools::n_connected_components(), libMesh::FE< Dim, T >::nodal_soln(), libMesh::Elem::node_id(), libMesh::TriangulatorInterface::nodes_to_segments(), libMesh::VTKIO::nodes_to_vtk(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::CompareDofObjectsByID::operator()(), libMesh::CompareDofObjectsByPIDAndThenID::operator()(), libMesh::CompareElemIdsByLevel::operator()(), libMesh::GhostPointNeighbors::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::BoundaryInfo::operator==(), libMesh::DistributedMesh::own_node(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::MetisPartitioner::partition_range(), libMesh::DofObject::print_dof_info(), libMesh::DofMap::process_mesh_constraint_rows(), libMesh::DistributedMesh::query_elem_ptr(), libMesh::DistributedMesh::query_elem_ptr(), libMesh::query_ghosting_functors(), libMesh::DistributedMesh::query_node_ptr(), libMesh::DistributedMesh::query_node_ptr(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::ExodusII_IO_Helper::read_edge_blocks(), libMesh::EquationSystems::redundant_added_side(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::DistributedMesh::renumber_elem(), libMesh::DistributedMesh::renumber_node(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::C0Polyhedron::retriangulate(), libMesh::DofMap::scatter_constraints(), libMesh::StaticCondensation::set_current_elem(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), FETestBase< order, family, elem_type, build_nx, CaseName >::setUp(), libMesh::MeshTools::Modification::smooth(), libMesh::BoundaryInfo::sync(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id_once(), ElemTest< elem_type >::test_n_refinements(), ElemTest< elem_type >::test_orient_elements(), DefaultCouplingTest::testCoupling(), MixedDimensionMeshTest::testPointLocatorTree(), InfFERadialTest::testRefinement(), DofObjectTest< DerivedClass >::testSetId(), DisjointNeighborTest::testTempJump(), libMesh::Elem::topologically_equal(), libMesh::NetGenMeshInterface::triangulate(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), libMesh::Poly2TriTriangulator::triangulate_current_points(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::MeshTetInterface::volume_to_surface_mesh(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO_Helper::write_elemsets(), 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)
inlineprotectednoexceptinherited

Increments the construction counter.

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

Definition at line 183 of file reference_counter.h.

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

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

Referenced by libMesh::ReferenceCountedObject< T >::ReferenceCountedObject(), libMesh::ReferenceCountedObject< T >::ReferenceCountedObject(), and libMesh::ReferenceCountedObject< T >::ReferenceCountedObject().

◆ increment_constructor_count() [2/2]

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

Increments the construction counter.

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

Definition at line 183 of file reference_counter.h.

184{
185 libmesh_try
186 {
187 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188 std::pair<unsigned int, unsigned int> & p = _counts[name];
189 p.first++;
190 }
191 libmesh_catch (...)
192 {
193 auto stream = libMesh::err.get();
194 stream->exceptions(stream->goodbit); // stream must not throw
195 libMesh::err << "Encountered unrecoverable error while calling "
196 << "ReferenceCounter::increment_constructor_count() "
197 << "for a(n) " << name << " object." << std::endl;
198 std::terminate();
199 }
200}

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

Referenced by libMesh::ReferenceCountedObject< T >::ReferenceCountedObject(), libMesh::ReferenceCountedObject< T >::ReferenceCountedObject(), and libMesh::ReferenceCountedObject< T >::ReferenceCountedObject().

◆ increment_destructor_count() [1/2]

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

Increments the destruction counter.

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

Definition at line 207 of file reference_counter.h.

208{
209 libmesh_try
210 {
211 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
212 std::pair<unsigned int, unsigned int> & p = _counts[name];
213 p.second++;
214 }
215 libmesh_catch (...)
216 {
217 auto stream = libMesh::err.get();
218 stream->exceptions(stream->goodbit); // stream must not throw
219 libMesh::err << "Encountered unrecoverable error while calling "
220 << "ReferenceCounter::increment_destructor_count() "
221 << "for a(n) " << name << " object." << std::endl;
222 std::terminate();
223 }
224}

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

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

◆ increment_destructor_count() [2/2]

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

Increments the destruction counter.

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

Definition at line 207 of file reference_counter.h.

208{
209 libmesh_try
210 {
211 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
212 std::pair<unsigned int, unsigned int> & p = _counts[name];
213 p.second++;
214 }
215 libmesh_catch (...)
216 {
217 auto stream = libMesh::err.get();
218 stream->exceptions(stream->goodbit); // stream must not throw
219 libMesh::err << "Encountered unrecoverable error while calling "
220 << "ReferenceCounter::increment_destructor_count() "
221 << "for a(n) " << name << " object." << std::endl;
222 std::terminate();
223 }
224}

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

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

◆ infinite() [1/2]

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

Definition at line 2048 of file elem.h.

2048{ return false; }

◆ infinite() [2/2]

virtual bool libMesh::Elem::infinite ( ) const
pure virtualinherited
Returns
true if the element is an infinite element, false otherwise.

Implemented in libMesh::Cell, libMesh::InfCell, libMesh::Edge2, libMesh::Edge3, libMesh::Edge4, libMesh::InfEdge2, libMesh::NodeElem, libMesh::RemoteElem, libMesh::Face, and libMesh::InfQuad.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::MeshFunction::_gradient_on_elem(), libMesh::MeshTools::Modification::all_rbb(), libMesh::FEInterface::all_shapes(), libMesh::FEMContext::cached_fe(), libMesh::FEAbstract::compute_node_constraints(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), libMesh::Elem::get_info(), libMesh::MeshFunction::hessian(), libMesh::InfFE< Dim, T_radial, T_map >::init_face_shape_functions(), libMesh::TreeNode< N >::insert(), libMesh::FEMap::inverse_map(), libMesh::FEMap::inverse_map(), libMesh::Elem::is_mid_infinite_edge_node(), libMesh::FEMap::map(), libMesh::FEMap::map_deriv(), libMesh::DofMap::old_dof_indices(), libMesh::System::point_hessian(), libMesh::FEInterface::shape(), libMesh::FEInterface::shape_deriv(), libMesh::FEInterface::shape_deriv(), libMesh::FEInterface::shape_second_deriv(), libMesh::FEInterface::shape_second_deriv(), libMesh::FEInterface::shapes(), ElemTest< elem_type >::test_orientation_conformity(), InfFERadialTest::testInfQuants(), InfFERadialTest::testInfQuants_numericDeriv(), FETest< order, family, elem_type, CaseName >::testPastVerticesLoop(), InfFERadialTest::testRefinement(), FETest< order, family, elem_type, CaseName >::testRefspaceNodes(), InfFERadialTest::testSides(), and InfFERadialTest::testSingleOrder().

◆ inherit_data_from()

void libMesh::Elem::inherit_data_from ( const Elem &  src)
inlineinherited

A helper function for copying generic element data (mapping, subdomain, processor) from an element to a derived (child, side, edge) element.

Useful for forwards compatibility when new data is added.

Definition at line 3477 of file elem.h.

3478{
3479 this->set_mapping_type(src.mapping_type());
3480 this->set_mapping_data(src.mapping_data());
3481 this->subdomain_id() = src.subdomain_id();
3482 this->processor_id(src.processor_id());
3483#ifdef LIBMESH_ENABLE_AMR
3484 this->set_p_level(src.p_level());
3485#endif
3486}
void set_mapping_type(const ElemMappingType type)
Sets the value of the mapping type for the element.
Definition elem.h:3266
void set_mapping_data(const unsigned char data)
Sets the value of the mapping data for the element.
Definition elem.h:3282

References libMesh::Elem::mapping_data(), libMesh::Elem::mapping_type(), libMesh::Elem::p_level(), libMesh::DofObject::processor_id(), libMesh::Elem::set_mapping_data(), libMesh::Elem::set_mapping_type(), libMesh::Elem::set_p_level(), and libMesh::Elem::subdomain_id().

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

◆ interior_parent() [1/2]

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

Definition at line 1145 of file elem.C.

1146{
1147 // See the const version for comments
1148 if (this->dim() >= LIBMESH_DIM)
1149 return nullptr;
1150
1151 Elem * interior_p = _elemlinks[1+this->n_sides()];
1152
1153 libmesh_assert (!interior_p ||
1154 (interior_p == remote_elem) ||
1155 (interior_p->dim() > this->dim()));
1156
1157 return interior_p;
1158}
Elem ** _elemlinks
Pointers to this element's parent and neighbors, and for lower-dimensional elements' interior_parent.
Definition elem.h:2381

References libMesh::Elem::_elemlinks, libMesh::Elem::dim(), 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 returns nullptr if this->dim() == LIBMESH_DIM; in such cases no data storage for an interior parent pointer has been allocated.

Definition at line 1100 of file elem.C.

1101{
1102 // interior parents make no sense for full-dimensional elements.
1103 if (this->dim() >= LIBMESH_DIM)
1104 return nullptr;
1105
1106 // they USED TO BE only good for level-0 elements, but we now
1107 // support keeping interior_parent() valid on refined boundary
1108 // elements.
1109 // if (this->level() != 0)
1110 // return this->parent()->interior_parent();
1111
1112 // We store the interior_parent pointer after both the parent
1113 // neighbor and neighbor pointers
1114 Elem * interior_p = _elemlinks[1+this->n_sides()];
1115
1116 // If we have an interior_parent, we USED TO assume it was a
1117 // one-higher-dimensional interior element, but we now allow e.g.
1118 // edge elements to have a 3D interior_parent with no
1119 // intermediate 2D element.
1120 // libmesh_assert (!interior_p ||
1121 // interior_p->dim() == (this->dim()+1));
1122 libmesh_assert (!interior_p ||
1123 (interior_p == remote_elem) ||
1124 (interior_p->dim() > this->dim()));
1125
1126 // If an element in a multi-dimensional mesh has an interior_parent
1127 // link, it should be at our level or coarser, just like a neighbor
1128 // link. Our collect_families() code relies on this, but it might
1129 // be tempting for users to manually assign something that breaks
1130 // it.
1131 //
1132 // However, we *also* create temporary side elements, and we don't
1133 // bother with creating ancestors for those, so they can be at level
1134 // 0 even when they're sides of non-level-0 elements.
1135 libmesh_assert (!interior_p ||
1136 (interior_p->level() <= this->level()) ||
1137 (this->level() == 0 &&
1138 this->id() == DofObject::invalid_id));
1139
1140 return interior_p;
1141}

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

Referenced by libMesh::FEMap::compute_face_map(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::InfFE< Dim, T_radial, T_map >::init_face_shape_functions(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::GhostPointNeighbors::operator()(), ElemTest< elem_type >::test_n_refinements(), libMesh::Elem::topologically_equal(), 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 793 of file dof_object.h.

794{
795 this->invalidate_dofs ();
796 this->invalidate_id ();
798}
void invalidate_processor_id()
Sets the processor id to invalid_processor_id.
Definition dof_object.h:785
void invalidate_id()
Sets the id to invalid_id.
Definition dof_object.h:777
void invalidate_dofs(const unsigned int sys_num=libMesh::invalid_uint)
Sets all degree of freedom numbers to invalid_id.
Definition dof_object.h:756

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

757{
758 const unsigned int n_sys = this->n_systems();
759 // If the user does not specify the system number...
760 if (sys_num >= n_sys)
761 {
762 for (auto s : make_range(n_sys))
763 for (auto vg : make_range(this->n_var_groups(s)))
764 if (this->n_comp_group(s,vg))
765 this->set_vg_dof_base(s,vg,invalid_id);
766 }
767 // ...otherwise invalidate the dofs for all systems
768 else
769 for (auto vg : make_range(this->n_var_groups(sys_num)))
770 if (this->n_comp_group(sys_num,vg))
771 this->set_vg_dof_base(sys_num,vg,invalid_id);
772}
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...

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

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

◆ invalidate_id()

void libMesh::DofObject::invalidate_id ( )
inlineinherited

Sets the id to invalid_id.

Definition at line 777 of file dof_object.h.

778{
779 this->set_id (invalid_id);
780}
dof_id_type & set_id()
Definition dof_object.h:841

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

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

◆ invalidate_processor_id()

void libMesh::DofObject::invalidate_processor_id ( )
inlineinherited

Sets the processor id to invalid_processor_id.

Definition at line 785 of file dof_object.h.

786{
788}
static constexpr 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:484

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

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

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

3152{
3153#ifdef LIBMESH_ENABLE_AMR
3154 const Elem * e = descendant;
3155 while (e)
3156 {
3157 if (this == e)
3158 return true;
3159 e = e->parent();
3160 }
3161#endif
3162 return false;
3163}

References libMesh::Elem::parent().

Referenced by libMesh::UnstructuredMesh::find_neighbors(), and ElemTest< elem_type >::test_n_refinements().

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

2437{
2438 libmesh_assert_less (c, this->n_children());
2439 libmesh_assert_less (e, this->n_edges());
2440
2441 std::unique_ptr<const Elem> my_edge = this->build_edge_ptr(e);
2442 std::unique_ptr<const Elem> child_edge = this->child_ptr(c)->build_edge_ptr(e);
2443
2444 // We're assuming that an overlapping child edge has the same
2445 // number and orientation as its parent
2446 return (child_edge->node_id(0) == my_edge->node_id(0) ||
2447 child_edge->node_id(1) == my_edge->node_id(1));
2448}
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i)=0

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

Referenced by libMesh::FEGenericBase< OutputType >::coarsened_dof_values(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectEdges::operator()(), and ElemTest< elem_type >::test_n_refinements().

◆ is_child_on_side()

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

Implements libMesh::Elem.

Definition at line 117 of file edge.C.

119{
120 libmesh_assert_less (c, this->n_children());
121 libmesh_assert_less (s, this->n_sides());
122
123 return (c == s);
124}
virtual unsigned int n_children() const override final
Definition edge.h:103

References n_children(), and n_sides().

◆ is_edge()

virtual bool libMesh::Elem::is_edge ( const unsigned int  i) const
pure virtualinherited

◆ is_edge_on_side()

virtual bool libMesh::Edge::is_edge_on_side ( const unsigned int  ,
const unsigned int   
) const
inlinefinaloverridevirtual
Returns
true if the specified edge is on the specified side.

Implements libMesh::Elem.

Definition at line 114 of file edge.h.

116 { return false; }

◆ is_face()

virtual bool libMesh::Elem::is_face ( const unsigned int  i) const
pure virtualinherited

◆ is_flipped()

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

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

Implements libMesh::Elem.

Definition at line 173 of file edge.C.

174{
175 // Don't trigger on 1D elements embedded in 2D/3D
176 return (
177#if LIBMESH_DIM > 2
178 !this->point(0)(2) && !this->point(1)(2) &&
179#endif
180#if LIBMESH_DIM > 1
181 !this->point(0)(1) && !this->point(1)(1) &&
182#endif
183 this->point(0)(0) > this->point(1)(0));
184}

References libMesh::Elem::point().

◆ is_internal()

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

Definition at line 4014 of file elem.C.

4015{
4016 switch (this->dim())
4017 {
4018 case 0:
4019 return false;
4020
4021 case 1:
4022 return !this->is_vertex(i);
4023
4024 case 2:
4025 return !this->is_vertex(i) && !this->is_edge(i);
4026
4027 case 3:
4028 return !this->is_vertex(i) && !this->is_edge(i) && !this->is_face(i);
4029
4030 default:
4031 libmesh_error_msg("impossible element dimension " << std::to_string(this->dim()));
4032 return 0;
4033 }
4034}
virtual bool is_face(const unsigned int i) const =0
virtual bool is_edge(const unsigned int i) const =0
virtual bool is_vertex(const unsigned int i) const =0

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

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

◆ 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::Tet4, libMesh::Edge2, libMesh::Tri3, libMesh::Tri3Subdivision, and libMesh::NodeElem.

Definition at line 1328 of file elem.h.

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

Definition at line 2035 of file elem.h.

2036 { 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::Elem::is_node_on_edge ( const unsigned int  n,
const unsigned int  e 
) const
pure virtualinherited

◆ is_node_on_side()

virtual bool libMesh::Elem::is_node_on_side ( const unsigned int  n,
const unsigned int  s 
) const
pure virtualinherited

◆ is_remote()

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

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

Reimplemented in libMesh::RemoteElem.

Definition at line 617 of file elem.h.

618 { return false; }

Referenced by libMesh::Elem::make_links_to_me_local(), MeshGenerationTest::polyhedronTetNeighbor(), and MeshGenerationTest::testBuildCube().

◆ is_semilocal()

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

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

Definition at line 780 of file elem.C.

781{
782 std::set<const Elem *> point_neighbors;
783
784 this->find_point_neighbors(point_neighbors);
785
786 for (const auto & elem : point_neighbors)
787 if (elem->processor_id() == my_pid)
788 return true;
789
790 return false;
791}

References libMesh::Elem::find_point_neighbors().

◆ is_singular_node()

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

Reimplemented in libMesh::Pyramid.

Definition at line 1968 of file elem.h.

1968{ return false; }

Referenced by libMesh::Elem::has_invertible_map(), and FETest< order, family, elem_type, CaseName >::testPastVerticesLoop().

◆ is_vertex()

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

Implemented in libMesh::C0Polyhedron, libMesh::Hex20, libMesh::Hex27, libMesh::Hex8, libMesh::Prism15, libMesh::Prism18, libMesh::Prism20, libMesh::Prism21, libMesh::Prism6, libMesh::Pyramid13, libMesh::Pyramid14, libMesh::Pyramid18, libMesh::Pyramid5, libMesh::Tet10, libMesh::Tet14, libMesh::Tet4, libMesh::Edge2, libMesh::Edge3, libMesh::Edge4, libMesh::InfEdge2, libMesh::C0Polygon, libMesh::Quad4, libMesh::Quad8, libMesh::Quad9, libMesh::Tri3, libMesh::Tri6, libMesh::Tri7, libMesh::InfHex, libMesh::InfPrism, libMesh::InfQuad, and libMesh::RemoteElem.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::FEGenericBase< OutputType >::coarsened_dof_values(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::Hex::edges_adjacent_to_node(), libMesh::Prism::edges_adjacent_to_node(), libMesh::Pyramid::edges_adjacent_to_node(), libMesh::Tet::edges_adjacent_to_node(), libMesh::Polygon::edges_adjacent_to_node(), libMesh::Quad::edges_adjacent_to_node(), libMesh::Tri::edges_adjacent_to_node(), libMesh::ElemCutter::find_intersection_points(), libMesh::MeshTools::SidesToElemMap::get_sorted_vertex_ids(), libMesh::Elem::is_internal(), libMesh::Elem::is_vertex_on_child(), FEOrientationTestBase< order, family >::node_entity(), libMesh::DofMap::old_dof_indices(), ElemTest< elem_type >::test_n_refinements(), VolumeTest::testC0PolygonMethods(), and VolumeTest::testC0PolyhedronMethods().

◆ is_vertex_on_child()

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

Definition at line 872 of file elem.h.

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

References libMesh::Elem::is_vertex().

Referenced by libMesh::Elem::parent_bracketing_nodes(), and ElemTest< elem_type >::test_n_refinements().

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

3937{
3938#ifdef LIBMESH_ENABLE_AMR
3939
3940 unsigned int my_n_vertices = this->n_vertices();
3941 for (unsigned int n_parent = 0; n_parent != my_n_vertices;
3942 ++n_parent)
3943 if (this->node_ptr(n_parent) == this->child_ptr(c)->node_ptr(n))
3944 return true;
3945 return false;
3946
3947#else
3948
3949 // No AMR?
3950 libmesh_ignore(c,n);
3951 libmesh_error_msg("ERROR: AMR disabled, how did we get here?");
3952 return true;
3953
3954#endif
3955}
void libmesh_ignore(const Args &...)

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()(), and ElemTest< elem_type >::test_n_refinements().

◆ key() [1/3]

dof_id_type libMesh::Elem::key ( ) const
virtual

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

Reimplemented from libMesh::Elem.

Reimplemented in libMesh::Edge2, libMesh::Edge3, libMesh::Edge4, libMesh::Edge2, libMesh::Edge3, and libMesh::Edge4.

Definition at line 290 of file elem.C.

679{
680 const unsigned short n_n = this->n_nodes();
681
682 std::array<dof_id_type, Elem::max_n_nodes> node_ids;
683
684 for (unsigned short n=0; n != n_n; ++n)
685 node_ids[n] = this->node_id(n);
686
687 // Always sort, so that different local node numberings hash to the
688 // same value.
689 std::sort (node_ids.begin(), node_ids.begin()+n_n);
690
691 return Utility::hashword(node_ids.data(), n_n);
692}
virtual unsigned int n_nodes() const override
Definition edge.h:78

◆ key() [2/3]

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

Implements libMesh::Elem.

Reimplemented in libMesh::Edge2, libMesh::Edge3, libMesh::Edge4, libMesh::Edge2, libMesh::Edge3, and libMesh::Edge4.

Definition at line 141 of file edge.h.

142 { return this->compute_key(this->node_id(s)); }
static dof_id_type compute_key(dof_id_type n0)
Definition elem.h:3432

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

◆ key() [3/3]

virtual dof_id_type libMesh::Elem::key ( const unsigned int  s) const
virtual

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

Implements libMesh::Elem.

Reimplemented in libMesh::Edge2, libMesh::Edge3, libMesh::Edge4, libMesh::Edge2, libMesh::Edge3, and libMesh::Edge4.

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

669{
670 libmesh_assert_less ( n1, this->n_vertices() );
671 libmesh_assert_less ( n2, this->n_vertices() );
672
673 return (this->point(n1) - this->point(n2)).norm();
674}

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

3213{
3214#ifdef LIBMESH_ENABLE_AMR
3215
3216 // if I don't have a parent I was
3217 // created directly from file
3218 // or by the user, so I am a
3219 // level-0 element
3220 if (this->parent() == nullptr)
3221 return 0;
3222
3223 // if the parent and this element are of different
3224 // dimensionality we are at the same level as
3225 // the parent (e.g. we are the 2D side of a
3226 // 3D element)
3227 if (this->dim() != this->parent()->dim())
3228 return this->parent()->level();
3229
3230 // otherwise we are at a level one
3231 // higher than our parent
3232 return (this->parent()->level() + 1);
3233
3234#else
3235
3236 // Without AMR all elements are
3237 // at level 0.
3238 return 0;
3239
3240#endif
3241}

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

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::BoundaryInfo::add_edge(), libMesh::BoundaryInfo::add_edge(), libMesh::BoundaryInfo::add_shellface(), libMesh::BoundaryInfo::add_shellface(), libMesh::BoundaryInfo::add_side(), libMesh::BoundaryInfo::add_side(), libMesh::MeshTools::Modification::all_rbb(), assemble_ellipticdg(), libMesh::BoundaryInfo::boundary_ids(), libMesh::EquationSystems::build_discontinuous_solution_vector(), compute_jacobian(), libMesh::FEAbstract::compute_node_constraints(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), compute_residual(), libMesh::Elem::contains_vertex_of(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::Elem::get_info(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_constraints(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_node_constraints(), libMesh::Poly2TriTriangulator::insert_refinement_points(), libMesh::Elem::interior_parent(), libMesh::Elem::level(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::nullify_neighbors(), libMesh::CompareElemIdsByLevel::operator()(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::BoundaryInfo::remove_edge(), libMesh::BoundaryInfo::remove_edge(), libMesh::Elem::remove_links_to_me(), libMesh::BoundaryInfo::remove_shellface(), libMesh::BoundaryInfo::remove_shellface(), libMesh::BoundaryInfo::remove_side(), libMesh::BoundaryInfo::shellface_boundary_ids(), libMesh::BoundaryInfo::side_boundary_ids(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::BoundaryInfo::sides_with_boundary_id(), libMesh::UnstructuredMesh::stitching_helper(), libMesh::MeshRefinement::test_level_one(), libMesh::Elem::top_parent(), libMesh::Elem::topological_neighbor(), libMesh::Elem::topological_neighbor(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::MeshTetInterface::volume_to_surface_mesh(), 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 1297 of file elem.C.

1298{
1299 for (auto n : this->side_index_range())
1300 {
1301 const Elem * neigh = this->neighbor_ptr(n);
1302
1303 // Any element might have a remote neighbor; checking
1304 // to make sure that's not inaccurate is tough.
1305 if (neigh == remote_elem)
1306 continue;
1307
1308 if (neigh)
1309 {
1310 // Only subactive elements have subactive neighbors
1311 libmesh_assert (this->subactive() || !neigh->subactive());
1312
1313 const Elem * elem = this;
1314
1315 // If we're subactive but our neighbor isn't, its
1316 // return neighbor link will be to our first active
1317 // ancestor OR to our inactive ancestor of the same
1318 // level as neigh,
1319 if (this->subactive() && !neigh->subactive())
1320 {
1321 for (elem = this; !elem->active();
1322 elem = elem->parent())
1323 libmesh_assert(elem);
1324 }
1325 else
1326 {
1327 unsigned int rev = neigh->which_neighbor_am_i(elem);
1328 libmesh_assert_less (rev, neigh->n_neighbors());
1329
1330 if (this->subactive() && !neigh->subactive())
1331 {
1332 while (neigh->neighbor_ptr(rev) != elem)
1333 {
1334 libmesh_assert(elem->parent());
1335 elem = elem->parent();
1336 }
1337 }
1338 else
1339 {
1340 const Elem * nn = neigh->neighbor_ptr(rev);
1341 libmesh_assert(nn);
1342
1343 for (; elem != nn; elem = elem->parent())
1344 libmesh_assert(elem);
1345 }
1346 }
1347 }
1348 // If we don't have a neighbor and we're not subactive, our
1349 // ancestors shouldn't have any neighbors in this same
1350 // direction.
1351 else if (!this->subactive())
1352 {
1353 const Elem * my_parent = this->parent();
1354 if (my_parent &&
1355 // A parent with a different dimension isn't really one of
1356 // our ancestors, it means we're on a boundary mesh and this
1357 // is an interior mesh element for which we're on a side.
1358 // Nothing to test for in that case.
1359 (my_parent->dim() == this->dim()))
1360 libmesh_assert (!my_parent->neighbor_ptr(n));
1361 }
1362 }
1363}

References libMesh::Elem::active(), 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 1285 of file elem.C.

1286{
1287 libmesh_assert(this->valid_id());
1288 for (auto n : this->node_index_range())
1289 {
1290 libmesh_assert(this->node_ptr(n));
1291 libmesh_assert(this->node_ptr(n)->valid_id());
1292 }
1293}

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

◆ local_edge_node() [1/2]

unsigned int libMesh::Elem::local_edge_node ( ElemType  t,
unsigned int  edge,
unsigned int  edge_node 
)
staticinherited
Returns
The local node id for node edge_node on edge edge of an element of type t, without needing an instantiated Elem. For 2D types this is local_side_node(); 1D types have no edges. The same types are unsupported here as in local_side_node().

Definition at line 3512 of file elem.C.

3515{
3516 libmesh_assert_less (edge, type_to_n_edges_map[t]);
3517 libmesh_assert_less (edge_node, type_to_n_nodes_map[edge_type(t)]);
3518
3519 switch (t)
3520 {
3521 case TRI3:
3522 case TRISHELL3:
3523 case TRI6:
3524 case TRI7:
3525 case QUAD4:
3526 case QUADSHELL4:
3527 case QUAD8:
3528 case QUADSHELL8:
3529 case QUAD9:
3530 case QUADSHELL9:
3531 return local_side_node(t, edge, edge_node);
3532 case TET4:
3533 return Tet4::edge_nodes_map[edge][edge_node];
3534 case TET10:
3535 return Tet10::edge_nodes_map[edge][edge_node];
3536 case TET14:
3537 return Tet14::edge_nodes_map[edge][edge_node];
3538 case HEX8:
3539 return Hex8::edge_nodes_map[edge][edge_node];
3540 case HEX20:
3541 return Hex20::edge_nodes_map[edge][edge_node];
3542 case HEX27:
3543 return Hex27::edge_nodes_map[edge][edge_node];
3544 case PRISM6:
3545 return Prism6::edge_nodes_map[edge][edge_node];
3546 case PRISM15:
3547 return Prism15::edge_nodes_map[edge][edge_node];
3548 case PRISM18:
3549 return Prism18::edge_nodes_map[edge][edge_node];
3550 case PRISM20:
3551 return Prism20::edge_nodes_map[edge][edge_node];
3552 case PRISM21:
3553 return Prism21::edge_nodes_map[edge][edge_node];
3554 case PYRAMID5:
3555 return Pyramid5::edge_nodes_map[edge][edge_node];
3556 case PYRAMID13:
3557 return Pyramid13::edge_nodes_map[edge][edge_node];
3558 case PYRAMID14:
3559 return Pyramid14::edge_nodes_map[edge][edge_node];
3560 case PYRAMID18:
3561 return Pyramid18::edge_nodes_map[edge][edge_node];
3562 default:
3563 libmesh_error_msg("No static edge node map for element type " << Utility::enum_to_string(t));
3564 }
3565
3566 return invalid_uint;
3567}
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const =0
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...
Definition elem.h:841
static ElemType edge_type(const ElemType t)
Definition elem.C:3380
static constexpr unsigned int type_to_n_nodes_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the number of nodes in the element...
Definition elem.h:664
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
Definition cell_hex20.h:228
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
Definition cell_hex27.h:243
static constexpr unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
Definition cell_hex8.h:187
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
Definition cell_tet10.h:229
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
Definition cell_tet14.h:234
static constexpr unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
Definition cell_tet4.h:207

References libMesh::Hex20::edge_nodes_map, libMesh::Hex27::edge_nodes_map, libMesh::Prism15::edge_nodes_map, libMesh::Prism18::edge_nodes_map, libMesh::Prism20::edge_nodes_map, libMesh::Prism21::edge_nodes_map, libMesh::Pyramid13::edge_nodes_map, libMesh::Pyramid14::edge_nodes_map, libMesh::Pyramid18::edge_nodes_map, libMesh::Tet10::edge_nodes_map, libMesh::Tet14::edge_nodes_map, libMesh::Hex8::edge_nodes_map, libMesh::Prism6::edge_nodes_map, libMesh::Pyramid5::edge_nodes_map, libMesh::Tet4::edge_nodes_map, libMesh::Elem::edge_type(), libMesh::Utility::enum_to_string(), libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::invalid_uint, libMesh::Elem::local_side_node(), libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM20, libMesh::PRISM21, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID18, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::QUADSHELL9, libMesh::TET10, libMesh::TET14, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, libMesh::TRI7, libMesh::TRISHELL3, libMesh::Elem::type_to_n_edges_map, and libMesh::Elem::type_to_n_nodes_map.

◆ local_edge_node() [2/2]

unsigned int libMesh::Edge::local_edge_node ( unsigned int  edge,
unsigned int  edge_node 
) const
finaloverridevirtual

Throws an error.

Edge elems have n_edges() == 0, so it does not make sense to call local_edge_node().

Implements libMesh::Elem.

Definition at line 47 of file edge.C.

49{
50 libmesh_error_msg("Calling Edge::local_edge_node() does not make sense.");
51 return 0;
52}

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

2618{
2619 for (auto n : make_range(this->n_nodes()))
2620 if (this->node_id(n) == i)
2621 return n;
2622
2623 return libMesh::invalid_uint;
2624}

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

Referenced by libMesh::MeshTetInterface::check_hull_integrity(), NodalNeighborsTest::do_test(), libMesh::MeshTetInterface::improve_hull_integrity(), libMesh::UnstructuredMesh::stitching_helper(), and ElemTest< elem_type >::test_n_refinements().

◆ local_side_node() [1/2]

unsigned int libMesh::Elem::local_side_node ( ElemType  t,
unsigned int  side,
unsigned int  side_node 
)
staticinherited
Returns
The local node id for node side_node on side side of an element of type t, without needing an instantiated Elem. The Polygon and Polyhedron subclasses have no such map, and the infinite elements' maps are not read here, so those must be queried through an actual Elem.

Definition at line 3431 of file elem.C.

3434{
3435 // The nodes on a side are the nodes of the side's own element type, so
3436 // we compose the two lookups here rather than tabulating side node
3437 // counts a second time. That also keeps us inside the meaningful part
3438 // of a row: the prisms' and pyramids' triangular sides carry fewer
3439 // nodes than their quadrilateral ones, and their rows are padded out
3440 // to the longer length
3441 libmesh_assert_less (side, type_to_n_sides_map[t]);
3442 libmesh_assert_less (side_node, type_to_n_nodes_map[side_type(t, side)]);
3443
3444 switch (t)
3445 {
3446 // A 1D element's sides are its end nodes
3447 case EDGE2:
3448 case EDGE3:
3449 case EDGE4:
3450 return side;
3451 // The shell elements are numbered like the elements they shadow
3452 case TRI3:
3453 case TRISHELL3:
3454 return Tri3::side_nodes_map[side][side_node];
3455 case TRI6:
3456 return Tri6::side_nodes_map[side][side_node];
3457 case TRI7:
3458 return Tri7::side_nodes_map[side][side_node];
3459 case QUAD4:
3460 case QUADSHELL4:
3461 return Quad4::side_nodes_map[side][side_node];
3462 case QUAD8:
3463 case QUADSHELL8:
3464 return Quad8::side_nodes_map[side][side_node];
3465 case QUAD9:
3466 case QUADSHELL9:
3467 return Quad9::side_nodes_map[side][side_node];
3468 case TET4:
3469 return Tet4::side_nodes_map[side][side_node];
3470 case TET10:
3471 return Tet10::side_nodes_map[side][side_node];
3472 case TET14:
3473 return Tet14::side_nodes_map[side][side_node];
3474 case HEX8:
3475 return Hex8::side_nodes_map[side][side_node];
3476 case HEX20:
3477 return Hex20::side_nodes_map[side][side_node];
3478 case HEX27:
3479 return Hex27::side_nodes_map[side][side_node];
3480 case PRISM6:
3481 return Prism6::side_nodes_map[side][side_node];
3482 case PRISM15:
3483 return Prism15::side_nodes_map[side][side_node];
3484 case PRISM18:
3485 return Prism18::side_nodes_map[side][side_node];
3486 case PRISM20:
3487 return Prism20::side_nodes_map[side][side_node];
3488 case PRISM21:
3489 return Prism21::side_nodes_map[side][side_node];
3490 case PYRAMID5:
3491 return Pyramid5::side_nodes_map[side][side_node];
3492 case PYRAMID13:
3493 return Pyramid13::side_nodes_map[side][side_node];
3494 case PYRAMID14:
3495 return Pyramid14::side_nodes_map[side][side_node];
3496 case PYRAMID18:
3497 return Pyramid18::side_nodes_map[side][side_node];
3498 default:
3499 libmesh_error_msg("No static side node map for element type " << Utility::enum_to_string(t));
3500 }
3501
3502 return invalid_uint;
3503}
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
Definition cell_hex20.h:233
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
Definition cell_hex27.h:248
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
Definition cell_hex8.h:173
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
Definition face_quad4.h:155
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
Definition face_quad8.h:202
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
Definition face_quad9.h:209
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
Definition cell_tet10.h:234
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
Definition cell_tet14.h:239
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
Definition cell_tet4.h:195
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
Definition face_tri3.h:169
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
Definition face_tri6.h:212
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
Definition face_tri7.h:216

References libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::Utility::enum_to_string(), libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::invalid_uint, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM20, libMesh::PRISM21, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID18, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::QUADSHELL9, libMesh::Hex20::side_nodes_map, libMesh::Hex27::side_nodes_map, libMesh::Prism15::side_nodes_map, libMesh::Prism18::side_nodes_map, libMesh::Prism20::side_nodes_map, libMesh::Prism21::side_nodes_map, libMesh::Pyramid13::side_nodes_map, libMesh::Pyramid14::side_nodes_map, libMesh::Pyramid18::side_nodes_map, libMesh::Tet10::side_nodes_map, libMesh::Tet14::side_nodes_map, libMesh::Quad8::side_nodes_map, libMesh::Quad9::side_nodes_map, libMesh::Tri6::side_nodes_map, libMesh::Tri7::side_nodes_map, libMesh::Hex8::side_nodes_map, libMesh::Prism6::side_nodes_map, libMesh::Pyramid5::side_nodes_map, libMesh::Tet4::side_nodes_map, libMesh::Quad4::side_nodes_map, libMesh::Tri3::side_nodes_map, libMesh::Elem::side_type(), libMesh::TET10, libMesh::TET14, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, libMesh::TRI7, libMesh::TRISHELL3, libMesh::Elem::type_to_n_nodes_map, and libMesh::Elem::type_to_n_sides_map.

◆ local_side_node() [2/2]

unsigned int libMesh::Edge::local_side_node ( unsigned int  side,
unsigned int   
) const
finaloverridevirtual
Returns
side after doing some range checking. side_node is ignored.

Implements libMesh::Elem.

Definition at line 38 of file edge.C.

40{
41 libmesh_assert_less (side, this->n_sides());
42 return side;
43}

References n_sides().

◆ local_singular_node()

virtual unsigned int libMesh::Elem::local_singular_node ( const Point &  ,
const Real  = TOLERANCE*TOLERANCE 
) const
inlinevirtualinherited
Returns
The local node index of the given point IF said node has a singular Jacobian for this element. If the given point is not a node or is a node and does not have a singular Jacobian, this will return invalid_uint.

The intention is for this to be overridden in derived element classes that do have nodes that have singular Jacobians. When mapping failures are caught, we can check this to see if the failed physical point is actually a singular point and return the correct master point.

Reimplemented in libMesh::Pyramid.

Definition at line 1961 of file elem.h.

1962 { return invalid_uint; }

References libMesh::invalid_uint.

Referenced by libMesh::FEMap::inverse_map(), and FETest< order, family, elem_type, CaseName >::testLoop().

◆ 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::Cell, libMesh::Hex8, libMesh::Prism6, libMesh::Pyramid5, libMesh::Edge3, libMesh::Edge4, libMesh::Quad4, libMesh::Quad8, libMesh::Quad9, libMesh::Tri3, libMesh::Tri6, and libMesh::Tri7.

Definition at line 3901 of file elem.C.

3902{
3903 Point pmin = this->point(0);
3904 Point pmax = pmin;
3905
3906 unsigned int n_points = this->n_nodes();
3907 for (unsigned int p=0; p != n_points; ++p)
3908 for (unsigned d=0; d<LIBMESH_DIM; ++d)
3909 {
3910 const Point & pt = this->point(p);
3911 if (pmin(d) > pt(d))
3912 pmin(d) = pt(d);
3913
3914 if (pmax(d) < pt(d))
3915 pmax(d) = pt(d);
3916 }
3917
3918 return BoundingBox(pmin, pmax);
3919}

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

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

◆ low_order_key()

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

Implements libMesh::Elem.

Definition at line 150 of file edge.h.

151 { return this->compute_key(this->node_id(s)); }

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

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

1370{
1371 Elem * neigh = this->neighbor_ptr(n);
1372
1373 // Don't bother calling this function unless it's necessary
1374 libmesh_assert(neigh);
1375 libmesh_assert(!neigh->is_remote());
1376
1377 const unsigned int this_level = this->level();
1378 const unsigned int neigh_level = neigh->level();
1379
1380 // We never have neighbors more refined than us
1381 libmesh_assert_less_equal (neigh_level, this_level);
1382
1383 // We never have subactive neighbors of non subactive elements
1384 libmesh_assert(!neigh->subactive() || this->subactive());
1385
1386 // If we have a neighbor less refined than us then it must not
1387 // have any more refined descendants we could have pointed to
1388 // instead.
1389 libmesh_assert((neigh_level == this_level) ||
1390 (neigh->active() && !this->subactive()) ||
1391 (!neigh->has_children() && this->subactive()));
1392
1393 // What side of neigh are we on? nn.
1394 //
1395 // We can't use the usual Elem method because we're in the middle of
1396 // restoring topology. We can't compare side_ptr nodes because
1397 // users want to abuse neighbor_ptr to point to
1398 // not-technically-neighbors across mesh slits. We can't compare
1399 // node locations because users want to move those
1400 // not-technically-neighbors until they're
1401 // not-even-geometrically-neighbors.
1402
1403 // Find any elements that might need to point to elem
1404 std::vector<Elem *> neigh_family;
1405#ifdef LIBMESH_ENABLE_AMR
1406 neigh->total_family_tree_by_side(neigh_family, nn);
1407#else
1408 neigh_family.push_back(neigh);
1409#endif
1410
1411 // Pull objects out of the loop to reduce heap operations
1412 std::unique_ptr<Elem> my_side, neigh_side;
1413
1414 // And point them to elem
1415 for (auto & neigh_family_member : neigh_family)
1416 {
1417 // Only subactive elements point to other subactive elements
1418 const bool member_subactive = neigh_family_member->subactive();
1419 if (this->subactive() && !member_subactive)
1420 continue;
1421
1422 // neigh (and possibly some of its family) might be at a lower
1423 // level than us, with a neighbor at that lower level. We
1424 // would exit early if neigh was at a lower level, except we do
1425 // want to handle neighbor links from subactive descendents.
1426 const unsigned int member_level = neigh_family_member->level();
1427 if (member_level < this_level)
1428 continue;
1429
1430 // Ideally, the neighbor link ought to either be correct
1431 // already or ought to be to remote_elem.
1432 //
1433 // However, if we're redistributing a newly created elem,
1434 // after an AMR step but before find_neighbors has fixed up
1435 // neighbor links, we might have an out of date neighbor
1436 // link to elem's parent instead.
1437#ifdef LIBMESH_ENABLE_AMR
1438 libmesh_assert((neigh_family_member->neighbor_ptr(nn) &&
1439 (neigh_family_member->neighbor_ptr(nn)->active() ||
1440 this->is_ancestor_of(neigh_family_member->neighbor_ptr(nn)) ||
1441 neigh_family_member->neighbor_ptr(nn)->is_ancestor_of(this))) ||
1442 (neigh_family_member->neighbor_ptr(nn) == remote_elem) ||
1443 ((this->refinement_flag() == JUST_REFINED) &&
1444 (this->parent() != nullptr) &&
1445 (neigh_family_member->neighbor_ptr(nn) == this->parent())));
1446#else
1447 libmesh_assert((neigh_family_member->neighbor_ptr(nn) == this) ||
1448 (neigh_family_member->neighbor_ptr(nn) == remote_elem));
1449#endif
1450
1451 // Some of neigh's family might be at a higher (finer) level
1452 // than us, and might need to point back to one of our children
1453 // rather than to us.
1454 if (member_level > this_level)
1455 {
1456 if (this->ancestor())
1457 continue;
1458
1459 if (member_subactive && this->has_children())
1460 continue;
1461 }
1462
1463 // If neigh is at a coarser level than us, some of neigh's
1464 // subactive family just won't line up with us!
1465 if (neigh_level < this_level &&
1466 member_level > neigh_level)
1467 {
1468 libmesh_assert(member_subactive);
1469
1470 this->side_ptr(my_side, n);
1471 neigh_family_member->side_ptr(neigh_side, nn);
1472
1473 if (*my_side != *neigh_side)
1474 continue;
1475 }
1476
1477 neigh_family_member->set_neighbor(nn, this);
1478 }
1479}
virtual std::unique_ptr< Elem > side_ptr(unsigned int i)=0

References libMesh::Elem::active(), libMesh::Elem::ancestor(), libMesh::Elem::has_children(), libMesh::Elem::is_remote(), libMesh::Elem::JUST_REFINED, libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::neighbor_ptr(), libMesh::remote_elem, libMesh::Elem::side_ptr(), libMesh::Elem::subactive(), and libMesh::Elem::total_family_tree_by_side().

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

1483{
1484 libmesh_assert_not_equal_to (this, remote_elem);
1485
1486 // We need to have handled any children first
1487#if defined(LIBMESH_ENABLE_AMR) && defined(DEBUG)
1488 if (this->has_children())
1489 for (auto & child : this->child_ref_range())
1490 libmesh_assert_equal_to (&child, remote_elem);
1491#endif
1492
1493 // Remotify any neighbor links
1494 for (auto neigh : this->neighbor_ptr_range())
1495 {
1496 if (neigh && neigh != remote_elem)
1497 {
1498 // My neighbor should never be more refined than me; my real
1499 // neighbor would have been its parent in that case.
1500 libmesh_assert_greater_equal (this->level(), neigh->level());
1501
1502 if (this->level() == neigh->level() &&
1503 neigh->has_neighbor(this))
1504 {
1505#ifdef LIBMESH_ENABLE_AMR
1506 // My neighbor may have descendants which also consider me a
1507 // neighbor
1508 std::vector<Elem *> family;
1509 neigh->total_family_tree_by_neighbor (family, this);
1510
1511 // FIXME - There's a lot of ugly const_casts here; we
1512 // may want to make remote_elem non-const
1513 for (auto & n : family)
1514 {
1515 libmesh_assert (n);
1516 if (n == remote_elem)
1517 continue;
1518 unsigned int my_s = n->which_neighbor_am_i(this);
1519 libmesh_assert_less (my_s, n->n_neighbors());
1520 libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1521 n->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1522 }
1523#else
1524 unsigned int my_s = neigh->which_neighbor_am_i(this);
1525 libmesh_assert_less (my_s, neigh->n_neighbors());
1526 libmesh_assert_equal_to (neigh->neighbor_ptr(my_s), this);
1527 neigh->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1528#endif
1529 }
1530#ifdef LIBMESH_ENABLE_AMR
1531 // Even if my neighbor doesn't link back to me, it might
1532 // have subactive descendants which do
1533 else if (neigh->has_children())
1534 {
1535 // If my neighbor at the same level doesn't have me as a
1536 // neighbor, I must be subactive
1537 libmesh_assert(this->level() > neigh->level() ||
1538 this->subactive());
1539
1540 // My neighbor must have some ancestor of mine as a
1541 // neighbor
1542 Elem * my_ancestor = this->parent();
1543 libmesh_assert(my_ancestor);
1544 while (!neigh->has_neighbor(my_ancestor))
1545 {
1546 my_ancestor = my_ancestor->parent();
1547 libmesh_assert(my_ancestor);
1548 }
1549
1550 // My neighbor may have descendants which consider me a
1551 // neighbor
1552 std::vector<Elem *> family;
1553 neigh->total_family_tree_by_subneighbor (family, my_ancestor, this);
1554
1555 for (auto & n : family)
1556 {
1557 libmesh_assert (n);
1558 if (n->is_remote())
1559 continue;
1560 unsigned int my_s = n->which_neighbor_am_i(this);
1561 libmesh_assert_less (my_s, n->n_neighbors());
1562 libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1563 // TODO: we may want to make remote_elem non-const.
1564 n->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1565 }
1566 }
1567#endif
1568 }
1569 }
1570
1571#ifdef LIBMESH_ENABLE_AMR
1572 // Remotify parent's child link
1573 Elem * my_parent = this->parent();
1574 if (my_parent &&
1575 // As long as it's not already remote
1576 my_parent != remote_elem &&
1577 // And it's a real parent, not an interior parent
1578 this->dim() == my_parent->dim())
1579 {
1580 unsigned int me = my_parent->which_child_am_i(this);
1581 libmesh_assert_equal_to (my_parent->child_ptr(me), this);
1582 my_parent->set_child(me, const_cast<RemoteElem *>(remote_elem));
1583 }
1584#endif
1585}
virtual unsigned short dim() const override

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

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

◆ mapping_data()

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

◆ mapping_type()

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

Definition at line 3258 of file elem.h.

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

References libMesh::Elem::_map_type.

Referenced by libMesh::MeshTools::Modification::all_tri(), libMesh::InfQuad6::build_side_ptr(), libMesh::MeshTools::clear_spline_nodes(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::get_info(), libMesh::Edge3::has_invertible_map(), libMesh::Edge4::has_invertible_map(), libMesh::Quad4::has_invertible_map(), libMesh::Elem::inherit_data_from(), libMesh::QComposite< QSubCell >::init(), libMesh::MeshTools::Modification::interpolate_surface(), libMesh::FEMap::map_fe_type(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), libMesh::FE< Dim, T >::reinit(), libMesh::C0Polyhedron::side_vertex_average_normal(), libMesh::Hex8::side_vertex_average_normal(), libMesh::Prism6::side_vertex_average_normal(), libMesh::Pyramid5::side_vertex_average_normal(), libMesh::Quad4::side_vertex_average_normal(), libMesh::C0Polyhedron::true_centroid(), libMesh::C0Polyhedron::volume(), libMesh::Hex20::volume(), libMesh::Hex27::volume(), libMesh::Hex8::volume(), libMesh::Prism15::volume(), libMesh::Prism18::volume(), libMesh::Prism6::volume(), libMesh::Pyramid13::volume(), libMesh::Pyramid14::volume(), libMesh::Pyramid5::volume(), libMesh::Tet10::volume(), libMesh::Edge3::volume(), libMesh::Edge4::volume(), libMesh::Quad4::volume(), libMesh::Quad8::volume(), libMesh::Quad9::volume(), and libMesh::Tri6::volume().

◆ master_point()

virtual Point libMesh::Elem::master_point ( const unsigned int  i) const
pure virtualinherited

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

3385{
3386 // This is undefined for subactive elements,
3387 // which have no active descendants
3388 libmesh_assert (!this->subactive());
3389 if (this->active())
3390 return this->p_level();
3391
3392 unsigned int max_p_level = _p_level;
3393 for (auto & c : child_ref_range())
3394 max_p_level = std::max(max_p_level,
3396 return max_p_level;
3397}
unsigned int max_descendant_p_level() const
Definition elem.h:3384

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< OutputType >::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 2481 of file elem.C.

2483{
2484 libmesh_assert(!this->subactive());
2485 libmesh_assert(neighbor_in->active());
2486
2487 // If we're an active element this is simple
2488 if (this->active())
2489 {
2490 unsigned int new_p_level = this->p_level();
2491 if (this->p_refinement_flag() == Elem::REFINE)
2492 new_p_level += 1;
2493 if (this->p_refinement_flag() == Elem::COARSEN)
2494 {
2495 libmesh_assert_greater (new_p_level, 0);
2496 new_p_level -= 1;
2497 }
2498 return std::min(current_min, new_p_level);
2499 }
2500
2501 libmesh_assert(has_neighbor(neighbor_in));
2502
2503 unsigned int min_p_level = current_min;
2504
2505 for (auto & c : this->child_ref_range())
2506 if (&c != remote_elem && c.has_neighbor(neighbor_in))
2507 min_p_level =
2508 c.min_new_p_level_by_neighbor(neighbor_in, min_p_level);
2509
2510 return min_p_level;
2511}
unsigned int min_new_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
Definition elem.C:2481

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

2454{
2455 libmesh_assert(!this->subactive());
2456 libmesh_assert(neighbor_in->active());
2457
2458 // If we're an active element this is simple
2459 if (this->active())
2460 return std::min(current_min, this->p_level());
2461
2462 libmesh_assert(has_neighbor(neighbor_in));
2463
2464 // The p_level() of an ancestor element is already the minimum
2465 // p_level() of its children - so if that's high enough, we don't
2466 // need to examine any children.
2467 if (current_min <= this->p_level())
2468 return current_min;
2469
2470 unsigned int min_p_level = current_min;
2471
2472 for (auto & c : this->child_ref_range())
2473 if (&c != remote_elem && c.has_neighbor(neighbor_in))
2474 min_p_level =
2475 c.min_p_level_by_neighbor(neighbor_in, min_p_level);
2476
2477 return min_p_level;
2478}
unsigned int min_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
Definition elem.C:2452

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< OutputType >::compute_periodic_constraints(), and libMesh::FEGenericBase< OutputType >::compute_proj_constraints().

◆ n_children()

virtual unsigned int libMesh::Edge::n_children ( ) const
inlinefinaloverridevirtual
Returns
2.

Implements libMesh::Elem.

Definition at line 103 of file edge.h.

103{ return 2; }

Referenced by is_child_on_side().

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

994{
995 libmesh_assert_less (s, this->n_systems());
996 libmesh_assert_less (var, this->n_vars(s));
997
998 return this->n_comp_group(s,this->var_to_vg(s,var));
999}
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.

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

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

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

1007{
1008 libmesh_assert_less (s, this->n_systems());
1009 libmesh_assert_less (vg, this->n_var_groups(s));
1010
1011 const unsigned int
1012 start_idx_sys = this->start_idx(s);
1013
1014 libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
1015
1016 return (_idx_buf[start_idx_sys + 2*vg] % ncv_magic);
1017}
static constexpr index_t ncv_magic
Definition dof_object.h:697

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::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::n_comp(), libMesh::DofMap::old_dof_indices(), libMesh::BuildProjectionList::operator()(), 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 directly stored on this object. Optionally only degrees of freedom for variable number var are counted. Does not count degrees of freedom only indirectly associated with this object, such as those stored on an element's nodes when n_dofs() is called on the element itself.

Definition at line 811 of file dof_object.h.

813{
814 libmesh_assert_less (s, this->n_systems());
815
816 unsigned int num = 0;
817
818 // Count all variables
819 if (var == libMesh::invalid_uint)
820 for (auto v : make_range(this->n_vars(s)))
821 num += this->n_comp(s,v);
822
823 // Only count specified variable
824 else
825 num = this->n_comp(s,var);
826
827 return num;
828}

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

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

◆ n_edges()

virtual unsigned int libMesh::Edge::n_edges ( ) const
inlinefinaloverridevirtual
Returns
0. All 1D elements have no edges.

Implements libMesh::Elem.

Definition at line 93 of file edge.h.

93{ 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 1160 of file dof_object.h.

1161{
1162 if (_idx_buf.empty())
1163 return 0;
1164
1165 const int hdr = dof_id_signed_type(_idx_buf[0]);
1166 if (hdr >= 0)
1167 return 0;
1168
1169 const unsigned int start_idx_i = this->start_idx_ints();
1170
1171 return _idx_buf.size() - start_idx_i;
1172}

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

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

◆ n_faces()

virtual unsigned int libMesh::Edge::n_faces ( ) const
inlinefinaloverridevirtual
Returns
0. All 1D elements have no faces.

Implements libMesh::Elem.

Definition at line 98 of file edge.h.

98{ return 0; }

◆ n_neighbors()

unsigned int libMesh::Elem::n_neighbors ( ) const
inlineinherited

◆ n_nodes()

virtual unsigned int libMesh::Edge::n_nodes ( ) const
inlineoverridevirtual
Returns
2. Every edge is guaranteed to have at least 2 nodes.

Implements libMesh::Elem.

Reimplemented in libMesh::Edge3, and libMesh::Edge4.

Definition at line 78 of file edge.h.

78{ return 2; }

Referenced by libMesh::Edge2::master_point(), and libMesh::InfEdge2::master_point().

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

749 { return this->n_nodes(); }

References libMesh::Elem::n_nodes().

Referenced by libMesh::Elem::as_parent_node(), libMesh::Elem::bracketing_nodes(), libMesh::Elem::parent_bracketing_nodes(), and ElemTest< elem_type >::test_n_refinements().

◆ n_objects() [1/2]

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

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

Definition at line 85 of file reference_counter.h.

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

References libMesh::ReferenceCounter::_n_objects.

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

◆ n_objects() [2/2]

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

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

Definition at line 85 of file reference_counter.h.

86 { return _n_objects; }

References libMesh::ReferenceCounter::_n_objects.

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

◆ n_permutations()

virtual unsigned int libMesh::Edge::n_permutations ( ) const
inlinefinaloverridevirtual

Returns the number of independent permutations of element nodes - e.g.

a cube can be reoriented to put side 0 where side N is (for 0 <= N < 6) and then rotated in one of four ways, giving 24 possible permutations.

Permutations which change the mapping Jacobian of an element (i.e. flipping the element) are not allowed in this definition.

Implements libMesh::Elem.

Definition at line 229 of file edge.h.

229{ return 0; }

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

938{
939 const int hdr = _idx_buf.empty() ?
940 0 : cast_int<int>(dof_id_signed_type(_idx_buf[0]));
941 return std::abs(hdr);
942}

References libMesh::DofObject::_idx_buf.

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::Pyramid13, libMesh::Pyramid14, libMesh::Pyramid18, libMesh::Quad9, libMesh::Hex20, libMesh::Hex27, libMesh::InfHex16, libMesh::InfHex18, libMesh::InfPrism12, libMesh::Prism15, libMesh::Prism18, libMesh::Prism20, libMesh::Prism21, libMesh::Tet10, libMesh::Tet14, libMesh::Edge3, libMesh::Edge4, libMesh::C0Polygon, libMesh::InfQuad6, libMesh::Quad8, libMesh::Tri6, and libMesh::Tri7.

Definition at line 3175 of file elem.C.

3176{
3177 // for linear elements, always return 0
3178 return 0;
3179}

Referenced by libMesh::MeshTools::Modification::smooth(), and DualShapeTest::testTransformedDual().

◆ n_sides()

virtual unsigned int libMesh::Edge::n_sides ( ) const
inlinefinaloverridevirtual
Returns
2.

Implements libMesh::Elem.

Definition at line 83 of file edge.h.

83{ return 2; }

Referenced by build_side_ptr(), center_node_on_side(), is_child_on_side(), local_side_node(), opposite_node(), and side_ptr().

◆ n_sub_elem()

virtual unsigned int libMesh::Elem::n_sub_elem ( ) const
pure virtualinherited

◆ n_systems()

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

Definition at line 927 of file dof_object.h.

928{
929 const int hdr = _idx_buf.empty() ?
930 0 : cast_int<int>(dof_id_signed_type(_idx_buf[0]));
931 return hdr >= 0 ? hdr : (-hdr-1);
932}

References libMesh::DofObject::_idx_buf.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofObject::add_system(), libMesh::DofObject::dof_number(), libMesh::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::DofObject::end_idx(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), libMesh::DofObject::get_extra_datum(), libMesh::DofObject::get_extra_integer(), libMesh::Elem::get_info(), libMesh::Node::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::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< DerivedClass >::testAddSystemExtraInts(), DofObjectTest< DerivedClass >::testSetNSystems(), DofObjectTest< DerivedClass >::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 974 of file dof_object.h.

975{
976 libmesh_assert_less (s, this->n_systems());
977
978 const unsigned int nvg = this->n_var_groups(s);
979
980 unsigned int val=0;
981
982 for (unsigned int vg=0; vg<nvg; vg++)
983 val += this->n_vars(s,vg);
984
985 return val;
986}

References libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), and 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 957 of file dof_object.h.

959{
960 libmesh_assert_less (s, this->n_systems());
961 libmesh_assert_less (vg, this->n_var_groups(s));
962
963 const unsigned int start_idx_sys = this->start_idx(s);
964
965 libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
966
967 return (cast_int<unsigned int>
968 (_idx_buf[start_idx_sys + 2*vg] >> ncv_magic_exp));
969}
static constexpr index_t ncv_magic_exp
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:696

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::DofMap::allgather_recursive_constraints(), libMesh::DofMap::distribute_dofs(), libMesh::DofObject::DofObject(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_mixed_derivatives(), libMesh::OldSolutionValue< Output, point_output >::eval_mixed_derivatives(), libMesh::BuildProjectionList::operator()(), libMesh::DofObject::operator=(), libMesh::DofMap::set_nonlocal_dof_objects(), DofObjectTest< DerivedClass >::testAddSystemExtraInts(), DofObjectTest< DerivedClass >::testSetNVariableGroups(), and DofObjectTest< DerivedClass >::testSetNVariableGroupsExtraInts().

◆ n_vertices()

virtual unsigned int libMesh::Edge::n_vertices ( ) const
inlinefinaloverridevirtual
Returns
2. Every edge has exactly two vertices.

Implements libMesh::Elem.

Definition at line 88 of file edge.h.

88{ return 2; }

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

2747{
2748 libmesh_assert_less (i, this->n_neighbors());
2749
2750 return _elemlinks[i+1];
2751}

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

2737{
2738 libmesh_assert_less (i, this->n_neighbors());
2739
2740 return _elemlinks[i+1];
2741}

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

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::BoundaryInfo::add_elements(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::MeshTools::Modification::all_tri(), assemble_advection_diffusion(), libMesh::ClawSystem::assemble_avg_coupling_matrices(), assemble_ellipticdg(), libMesh::ClawSystem::assemble_jump_coupling_matrix(), assemble_SchroedingerEquation(), assemble_temperature_jump(), assembly_with_dg_fem_context(), libMesh::BoundaryInfo::boundary_ids(), MeshBaseTest::BrokenNeighborMesh(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_side_list_from_node_list(), libMesh::MeshTetInterface::check_hull_integrity(), libMesh::BoundaryInfo::clear_stitched_boundary_side_ids(), compute_enriched_soln(), compute_jacobian(), libMesh::FEAbstract::compute_node_constraints(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), compute_residual(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::Subdivision::find_one_ring(), libMesh::MeshTools::Modification::flatten(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), libMesh::Elem::get_info(), libMesh::VariationalSmootherConstraint::get_neighbors_for_boundary_constraint(), libMesh::VariationalSmootherConstraint::get_neighbors_for_subdomain_constraint(), libMesh::MeshTetInterface::improve_hull_integrity(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_constraints(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_node_constraints(), libMesh::RBEIMConstruction::initialize_qp_data(), libMesh::Poly2TriTriangulator::insert_refinement_points(), libMesh::MeshTools::Modification::interpolate_surface(), libMesh::Poly2TriTriangulator::is_refine_boundary_allowed(), libMesh::HDGProblem::jacobian(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::nullify_neighbors(), libMesh::DefaultCoupling::operator()(), MeshGenerationTest::polyhedronTetNeighbor(), libMesh::CheckpointIO::read_remote_elem(), libMesh::EquationSystems::redundant_added_side(), libMesh::Elem::refine(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::FE< Dim, T >::reinit(), libMesh::FEXYZ< Dim >::reinit(), libMesh::InfFE< Dim, T_radial, T_map >::reinit(), libMesh::HDGProblem::residual(), libMesh::C0Polyhedron::retriangulate(), libMesh::BoundaryInfo::side_boundary_ids(), libMesh::FE< Dim, T >::side_map(), libMesh::Elem::SideIter::side_on_boundary(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::BoundaryInfo::sides_with_boundary_id(), libMesh::MeshTools::Modification::smooth(), libMesh::UnstructuredMesh::stitching_helper(), libMesh::Elem::swap2neighbors(), FEOrientationTestBase< order, family >::test_conformity_across_sides(), ElemTest< elem_type >::test_orient_elements(), ElemTest< elem_type >::test_orientation_conformity(), MeshGenerationTest::testBuildCube(), BoundaryInfoTest::testBuildSideListFromNodeListThinMesh(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), InfFERadialTest::testSides(), DisjointNeighborTest::testTempJump(), libMesh::Elem::topological_neighbor(), libMesh::Elem::topological_neighbor(), libMesh::MeshRefinement::topological_neighbor(), libMesh::Elem::topologically_equal(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::MeshTetInterface::volume_to_surface_mesh(), 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 3641 of file elem.h.

3642{
3643 return {_elemlinks+1, _elemlinks + 1 + this->n_neighbors()};
3644}

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

Referenced by libMesh::Elem::child_neighbor(), libMesh::Elem::child_neighbor(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::has_neighbor(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_constraints(), libMesh::Elem::make_links_to_me_remote(), 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 3648 of file elem.h.

3649{
3650 return {_elemlinks+1, _elemlinks + 1 + this->n_neighbors()};
3651}

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

2606{
2607 libmesh_assert_less (i, this->n_nodes());
2609 libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);
2610
2611 return _nodes[i]->id();
2612}

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

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), assemble_stokes(), libMesh::Elem::bracketing_nodes(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::BoundaryInfo::build_node_list_from_side_list(), MeshInputTest::checkHexPrismPolyhedron(), libMesh::FEMap::compute_face_map(), libMesh::Hex20::connectivity(), libMesh::Hex27::connectivity(), libMesh::Hex8::connectivity(), libMesh::InfHex16::connectivity(), libMesh::InfHex18::connectivity(), libMesh::InfHex8::connectivity(), libMesh::InfPrism12::connectivity(), libMesh::InfPrism6::connectivity(), libMesh::Prism15::connectivity(), libMesh::Prism18::connectivity(), libMesh::Prism6::connectivity(), libMesh::Pyramid5::connectivity(), libMesh::Tet10::connectivity(), libMesh::Tet14::connectivity(), libMesh::Tet4::connectivity(), libMesh::Edge2::connectivity(), libMesh::Edge3::connectivity(), libMesh::Edge4::connectivity(), libMesh::InfEdge2::connectivity(), libMesh::C0Polyhedron::connectivity(), libMesh::InfQuad4::connectivity(), libMesh::InfQuad6::connectivity(), libMesh::Quad4::connectivity(), libMesh::Quad8::connectivity(), libMesh::Quad9::connectivity(), libMesh::Tri3::connectivity(), libMesh::Tri6::connectivity(), libMesh::Tri7::connectivity(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::VariationalSmootherConstraint::get_neighbors_for_boundary_constraint(), libMesh::VariationalSmootherConstraint::get_neighbors_for_subdomain_constraint(), libMesh::Tri3Subdivision::get_ordered_node(), libMesh::Tri3Subdivision::get_ordered_valence(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::MeshTools::SidesToElemMap::get_sorted_vertex_ids(), libMesh::LaplaceMeshSmoother::init(), libMesh::Elem::key(), libMesh::Tet4::key(), libMesh::Edge2::key(), libMesh::Edge3::key(), libMesh::Edge4::key(), libMesh::Quad::key(), libMesh::Quad9::key(), libMesh::Tri::key(), libMesh::Hex::key(), libMesh::Hex27::key(), libMesh::InfHex::key(), libMesh::InfHex18::key(), libMesh::InfPrism::key(), libMesh::Prism::key(), libMesh::Prism18::key(), libMesh::Prism20::key(), libMesh::Prism21::key(), libMesh::Pyramid::key(), libMesh::Pyramid14::key(), libMesh::Pyramid18::key(), libMesh::Tet::key(), libMesh::InfQuad::key(), libMesh::InfQuad6::key(), libMesh::Polygon::key(), libMesh::Quad::key(), libMesh::Quad8::key(), libMesh::Quad9::key(), libMesh::Tri::key(), libMesh::Tri6::key(), libMesh::Tri7::key(), key(), libMesh::MeshTools::libmesh_assert_equal_connectivity(), libMesh::Elem::local_node(), libMesh::Tri3Subdivision::local_node_number(), libMesh::Hex::low_order_key(), libMesh::InfHex::low_order_key(), libMesh::InfPrism::low_order_key(), libMesh::Polyhedron::low_order_key(), libMesh::Prism::low_order_key(), libMesh::Pyramid::low_order_key(), libMesh::Tet::low_order_key(), libMesh::InfQuad::low_order_key(), libMesh::Polygon::low_order_key(), libMesh::Quad::low_order_key(), libMesh::Tri::low_order_key(), low_order_key(), libMesh::Elem::operator==(), libMesh::XdrIO::pack_element(), libMesh::CheckpointIO::read_connectivity(), libMesh::C0Polyhedron::retriangulate(), ExodusC0PolyhedronTest::test_write_and_read_hexagonal_prism(), ExodusC0PolygonTest::test_write_and_read_pentagon(), CheckpointIOTest::testC0PolygonCheckpoint(), CheckpointIOTest::testC0PolyhedronCheckpoint(), HDivGradTest::testGradByFiniteDifference(), libMesh::Elem::topologically_equal(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::FroIO::write(), 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 2648 of file elem.h.

2649{
2650 libmesh_assert_less (i, this->n_nodes());
2652
2653 return _nodes[i];
2654}

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

2638{
2639 libmesh_assert_less (i, this->n_nodes());
2641
2642 return _nodes[i];
2643}

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

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

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

2668{
2669 return *this->node_ptr(i);
2670}

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

2813{
2814 return {_nodes, _nodes+this->n_nodes()};
2815}

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

◆ nodes_on_edge()

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

Implements libMesh::Elem.

Definition at line 154 of file edge.C.

155{
156 return nodes_on_side(e);
157}
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
Definition edge.C:147

References nodes_on_side().

◆ nodes_on_side()

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

Implements libMesh::Elem.

Reimplemented in libMesh::InfEdge2.

Definition at line 147 of file edge.C.

148{
149 libmesh_assert_less(s, 2);
150 return {s};
151}

Referenced by nodes_on_edge().

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

3150{
3151 // Tell any of my neighbors about my death...
3152 // Looks strange, huh?
3153 for (auto n : this->side_index_range())
3154 {
3155 Elem * current_neighbor = this->neighbor_ptr(n);
3156 if (current_neighbor && current_neighbor != remote_elem)
3157 {
3158 // Note: it is possible that I see the neighbor
3159 // (which is coarser than me)
3160 // but they don't see me, so avoid that case.
3161 if (current_neighbor->level() == this->level())
3162 {
3163 const unsigned int w_n_a_i = current_neighbor->which_neighbor_am_i(this);
3164 libmesh_assert_less (w_n_a_i, current_neighbor->n_neighbors());
3165 current_neighbor->set_neighbor(w_n_a_i, nullptr);
3166 this->set_neighbor(n, nullptr);
3167 }
3168 }
3169 }
3170}
void set_neighbor(const unsigned int i, Elem *n)
Assigns n as the neighbor.
Definition elem.h:2756

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

3048{
3049 // By convention, the element is on the boundary
3050 // if it has a nullptr neighbor.
3051 return this->has_neighbor(nullptr);
3052}

References libMesh::Elem::has_neighbor().

◆ on_reference_element()

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

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

Implements libMesh::Elem.

Definition at line 188 of file edge.C.

190{
191 return ((p(0) >= -1-eps) && (p(0) <= 1+eps));
192}

◆ operator!=()

bool libMesh::Elem::operator!= ( const Elem &  rhs) const
inlineinherited
Returns
false if two elements are equivalent, true otherwise.

Definition at line 2728 of file elem.h.

2729{
2730 return !(*this == rhs);
2731}

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ operator==()

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

Definition at line 696 of file elem.C.

697{
698 // If the elements aren't the same type, they aren't equal
699 if (this->type() != rhs.type())
700 return false;
701
702 const unsigned short n_n = this->n_nodes();
703 libmesh_assert_equal_to(n_n, rhs.n_nodes());
704
705 // Make two sorted arrays of global node ids and compare them for
706 // equality.
707 std::array<dof_id_type, Elem::max_n_nodes> this_ids, rhs_ids;
708
709 for (unsigned short n = 0; n != n_n; n++)
710 {
711 this_ids[n] = this->node_id(n);
712 rhs_ids[n] = rhs.node_id(n);
713 }
714
715 // Sort the vectors to rule out different local node numberings.
716 std::sort(this_ids.begin(), this_ids.begin()+n_n);
717 std::sort(rhs_ids.begin(), rhs_ids.begin()+n_n);
718
719 // If the node ids match, the elements are equal!
720 for (unsigned short n = 0; n != n_n; ++n)
721 if (this_ids[n] != rhs_ids[n])
722 return false;
723 return true;
724}

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

◆ opposite_node()

unsigned int libMesh::Edge::opposite_node ( const unsigned int  n,
const unsigned int  s 
) const
finaloverridevirtual
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 from libMesh::Elem.

Definition at line 136 of file edge.C.

138{
139 libmesh_assert_less (node_in, 2);
140 libmesh_assert_less (side_in, this->n_sides());
141 libmesh_assert(this->is_node_on_side(node_in, side_in));
142
143 return 1 - node_in;
144}
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0

References libMesh::Elem::is_node_on_side(), libMesh::libmesh_assert(), and n_sides().

◆ opposite_side()

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

Reimplemented from libMesh::Elem.

Definition at line 128 of file edge.C.

129{
130 libmesh_assert_less (side_in, 2);
131 return 1 - side_in;
132}

◆ orient()

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

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

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

Definition at line 3424 of file elem.h.

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

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

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

◆ oriented_face_vertices()

std::vector< unsigned int > libMesh::Elem::oriented_face_vertices ( const unsigned int  i) const
inherited
Returns
The local indices of the vertices of face i, starting at its lexicographically least vertex and continuing toward the lesser of that vertex's two neighbors on the face, as encoded by face_orientation(). Every element sharing the face returns the same vertices in the same order.

Definition at line 4078 of file elem.C.

4079{
4080 const unsigned int N = Elem::type_to_n_sides_map[this->side_type(i)];
4081 const unsigned int orientation = this->face_orientation(i);
4082 const unsigned int least = orientation / 2;
4083
4084 // A positively oriented face has the lesser neighbor before the least
4085 // vertex in its side node map
4086 const bool backward = orientation % 2;
4087
4088 std::vector<unsigned int> vertices(N);
4089 for (const auto k : make_range(N))
4090 vertices[k] = this->local_side_node(i, (least + (backward ? N - k : k)) % N);
4091
4092 return vertices;
4093}
unsigned int face_orientation(const unsigned int i) const
Definition elem.C:4053

References libMesh::Elem::face_orientation(), libMesh::Elem::local_side_node(), libMesh::make_range(), libMesh::Elem::side_type(), and libMesh::Elem::type_to_n_sides_map.

Referenced by ElemTest< elem_type >::oriented_face_nodes(), and libMesh::FE< Dim, T >::shape().

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

Definition at line 2044 of file elem.h.

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

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

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

3247{
3248#ifdef LIBMESH_ENABLE_AMR
3249 return _p_level;
3250#else
3251 return 0;
3252#endif
3253}

References libMesh::Elem::_p_level.

Referenced by libMesh::InfQuad6::build_side_ptr(), libMesh::FEGenericBase< OutputType >::coarsened_dof_values(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::DofMap::dof_indices(), libMesh::DofMap::dof_indices(), libMesh::FE< Dim, T >::dofs_on_side(), libMesh::FE< Dim, T >::edge_map(), libMesh::FE< Dim, T >::edge_reinit(), libMesh::Elem::Elem(), libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::FE< Dim, CLOUGH >::FE(), libMesh::Elem::get_info(), libMesh::Elem::inherit_data_from(), libMesh::QBase::init(), libMesh::InfFE< Dim, T_radial, T_map >::init_face_shape_functions(), libMesh::lagrange_nodal_soln(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::LIBMESH_DEFAULT_VECTORIZED_FE(), libMesh::LIBMESH_DEFAULT_VECTORIZED_FE(), libMesh::LIBMESH_DEFAULT_VECTORIZED_FE(), libMesh::LIBMESH_DEFAULT_VECTORIZED_FE(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::FEInterface::n_dofs(), libMesh::FEInterface::n_dofs(), libMesh::FEInterface::n_dofs_at_node(), libMesh::FEInterface::n_dofs_per_elem(), libMesh::FEInterface::n_shape_functions(), libMesh::DofMap::old_dof_indices(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectEdges::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectSides::operator()(), libMesh::XdrIO::pack_element(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), libMesh::rational_fe_shape(), libMesh::rational_fe_shape_deriv(), libMesh::rational_fe_shape_second_deriv(), libMesh::rational_fe_weighted_shapes(), libMesh::rational_fe_weighted_shapes_derivs(), libMesh::Elem::refine(), libMesh::FE< Dim, T >::reinit(), libMesh::FE< Dim, T >::reinit(), libMesh::FEXYZ< Dim >::reinit(), libMesh::InfFE< Dim, T_radial, T_map >::reinit(), libMesh::FE< Dim, T >::reinit_dual_shape_coeffs(), libMesh::HPCoarsenTest::select_refinement(), libMesh::Elem::set_p_level(), libMesh::Elem::set_p_refinement_flag(), libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape(), libMesh::InfFE< Dim, T_radial, T_map >::shape(), libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::InfFE< Dim, T_radial, T_map >::shape_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::FEInterface::shapes(), libMesh::FE< Dim, T >::side_map(), libMesh::SparsityPattern::Build::sorted_connected_dofs(), libMesh::MeshRefinement::test_level_one(), libMesh::Elem::true_centroid(), 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 634 of file dof_object.C.

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

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

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

553{
554 return
555 cast_int<unsigned int> (
556#ifdef LIBMESH_ENABLE_AMR
557 ((old_dof_object == nullptr) ? 0 : old_dof_object->packed_indexing_size()) + 2 +
558#else
559 1 +
560#endif
561 _idx_buf.size());
562}
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:552

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

Referenced by libMesh::Node::packed_size(), libMesh::Parallel::Packing< Elem * >::unpack(), and libMesh::Parallel::Packing< Node * >::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 3176 of file elem.h.

3177{
3178 return _elemlinks[0];
3179}

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

3169{
3170 return _elemlinks[0];
3171}

References libMesh::Elem::_elemlinks.

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

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

Definition at line 2583 of file elem.C.

2585{
2586 // Indexed first by embedding matrix type, then by child id, then by
2587 // child node, then by bracketing pair
2588 std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> &
2589 cached_bracketing_nodes = this->_get_bracketing_node_cache();
2590
2591 const unsigned int em_vers = this->embedding_matrix_version();
2592
2593 // We may be updating the cache on one thread, and while that
2594 // happens we can't safely access the cache from other threads.
2595 Threads::spin_mutex::scoped_lock lock(parent_bracketing_nodes_mutex);
2596
2597 if (cached_bracketing_nodes.size() <= em_vers)
2598 cached_bracketing_nodes.resize(em_vers+1);
2599
2600 const unsigned int nc = this->n_children();
2601
2602 // If we haven't cached the bracketing nodes corresponding to this
2603 // embedding matrix yet, let's do so now.
2604 if (cached_bracketing_nodes[em_vers].size() < nc)
2605 {
2606 // If we're a second-order element but we're not a full-order
2607 // element, then some of our bracketing nodes may not exist
2608 // except on the equivalent full-order element. Let's build an
2609 // equivalent full-order element and make a copy of its cache to
2610 // use.
2611 if (this->default_order() != FIRST &&
2612 second_order_equivalent_type(this->type(), /*full_ordered=*/ true) != this->type())
2613 {
2614 // Check that we really are the non-full-order type
2615 libmesh_assert_equal_to
2616 (second_order_equivalent_type (this->type(), false),
2617 this->type());
2618
2619 // Build the full-order type
2620 ElemType full_type =
2621 second_order_equivalent_type(this->type(), /*full_ordered=*/ true);
2622 std::unique_ptr<Elem> full_elem = Elem::build(full_type);
2623
2624 // This won't work for elements with multiple
2625 // embedding_matrix versions, but every such element is full
2626 // order anyways.
2627 libmesh_assert_equal_to(em_vers, 0);
2628
2629 // Make sure its cache has been built. We temporarily
2630 // release our mutex lock so that the inner call can
2631 // re-acquire it.
2632 lock.release();
2633 full_elem->parent_bracketing_nodes(0,0);
2634
2635 // And then we need to lock again, so that if someone *else*
2636 // grabbed our lock before we did we don't risk accessing
2637 // cached_bracketing_nodes while they're working on it.
2638 // Threading is hard.
2639 lock.acquire(parent_bracketing_nodes_mutex);
2640
2641 // Copy its cache
2642 cached_bracketing_nodes =
2643 full_elem->_get_bracketing_node_cache();
2644
2645 // Now we don't need to build the cache ourselves.
2646 return cached_bracketing_nodes[em_vers][child][child_node];
2647 }
2648
2649 cached_bracketing_nodes[em_vers].resize(nc);
2650
2651 const unsigned int nn = this->n_nodes();
2652
2653 // We have to examine each child
2654 for (unsigned int c = 0; c != nc; ++c)
2655 {
2656 const unsigned int ncn = this->n_nodes_in_child(c);
2657
2658 cached_bracketing_nodes[em_vers][c].resize(ncn);
2659
2660 // We have to examine each node in that child
2661 for (unsigned int n = 0; n != ncn; ++n)
2662 {
2663 // If this child node isn't a vertex or an infinite
2664 // child element's mid-infinite-edge node, then we need
2665 // to find bracketing nodes on the child.
2666 if (!this->is_vertex_on_child(c, n)
2667#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2668 && !this->is_mid_infinite_edge_node(n)
2669#endif
2670 )
2671 {
2672 // Use the embedding matrix to find the child node
2673 // location in parent master element space
2674 Point bracketed_pt;
2675
2676 for (unsigned int pn = 0; pn != nn; ++pn)
2677 {
2678 const Real em_val =
2679 this->embedding_matrix(c,n,pn);
2680
2681 libmesh_assert_not_equal_to (em_val, 1);
2682 if (em_val != 0.)
2683 bracketed_pt.add_scaled(this->master_point(pn), em_val);
2684 }
2685
2686 // Check each pair of nodes on the child which are
2687 // also both parent nodes
2688 for (unsigned int n1 = 0; n1 != ncn; ++n1)
2689 {
2690 if (n1 == n)
2691 continue;
2692
2693 unsigned int parent_n1 =
2694 this->as_parent_node(c,n1);
2695
2696 if (parent_n1 == libMesh::invalid_uint)
2697 continue;
2698
2699 Point p1 = this->master_point(parent_n1);
2700
2701 for (unsigned int n2 = n1+1; n2 < nn; ++n2)
2702 {
2703 if (n2 == n)
2704 continue;
2705
2706 unsigned int parent_n2 =
2707 this->as_parent_node(c,n2);
2708
2709 if (parent_n2 == libMesh::invalid_uint)
2710 continue;
2711
2712 Point p2 = this->master_point(parent_n2);
2713
2714 Point pmid = (p1 + p2)/2;
2715
2716 if (pmid == bracketed_pt)
2717 {
2718 cached_bracketing_nodes[em_vers][c][n].emplace_back(parent_n1, parent_n2);
2719 break;
2720 }
2721 else
2722 libmesh_assert(!pmid.absolute_fuzzy_equals(bracketed_pt));
2723 }
2724 }
2725 }
2726 // If this child node is a parent node, we need to
2727 // find bracketing nodes on the parent.
2728 else
2729 {
2730 unsigned int parent_node = this->as_parent_node(c,n);
2731
2732 Point bracketed_pt;
2733
2734 // If we're not a parent node, use the embedding
2735 // matrix to find the child node location in parent
2736 // master element space
2737 if (parent_node == libMesh::invalid_uint)
2738 {
2739 for (unsigned int pn = 0; pn != nn; ++pn)
2740 {
2741 const Real em_val =
2742 this->embedding_matrix(c,n,pn);
2743
2744 libmesh_assert_not_equal_to (em_val, 1);
2745 if (em_val != 0.)
2746 bracketed_pt.add_scaled(this->master_point(pn), em_val);
2747 }
2748 }
2749 // If we're a parent node then we need no arithmetic
2750 else
2751 bracketed_pt = this->master_point(parent_node);
2752
2753 for (unsigned int n1 = 0; n1 != nn; ++n1)
2754 {
2755 if (n1 == parent_node)
2756 continue;
2757
2758 Point p1 = this->master_point(n1);
2759
2760 for (unsigned int n2 = n1+1; n2 < nn; ++n2)
2761 {
2762 if (n2 == parent_node)
2763 continue;
2764
2765 Point pmid = (p1 + this->master_point(n2))/2;
2766
2767 if (pmid == bracketed_pt)
2768 {
2769 cached_bracketing_nodes[em_vers][c][n].emplace_back(n1, n2);
2770 break;
2771 }
2772 else
2773 libmesh_assert(!pmid.absolute_fuzzy_equals(bracketed_pt));
2774 }
2775 }
2776 }
2777 }
2778 }
2779 }
2780
2781 return cached_bracketing_nodes[em_vers][child][child_node];
2782}
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:2339
virtual bool is_mid_infinite_edge_node(const unsigned int) const
Definition elem.h:2035
virtual bool is_vertex_on_child(unsigned int, unsigned int n) const
Definition elem.h:872
virtual unsigned int as_parent_node(unsigned int c, unsigned int n) const
Definition elem.C:2515
virtual Point master_point(const unsigned int i) const =0
Threads::spin_mutex parent_bracketing_nodes_mutex
Definition elem.C:99

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

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

◆ permute()

virtual void libMesh::Edge::permute ( unsigned int  perm_num)
inlinefinaloverridevirtual

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

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

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

Implements libMesh::Elem.

Definition at line 231 of file edge.h.

231{ libmesh_error(); }

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

2596{
2597 libmesh_assert_less (i, this->n_nodes());
2598
2599 return *_nodes[i];
2600}

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

2584{
2585 libmesh_assert_less (i, this->n_nodes());
2587 libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);
2588
2589 return *_nodes[i];
2590}

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::FEMContext::_do_elem_position_set(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::BoundaryInfo::add_elements(), libMesh::MeshRefinement::add_node(), libMesh::C0Polyhedron::add_tet(), libMesh::MeshTools::Modification::all_rbb(), libMesh::MeshTools::Modification::all_tri(), assemble_stokes(), libMesh::FE< Dim, T >::cache(), libMesh::Tet::choose_diagonal(), libMesh::Elem::coarsen(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), libMesh::FEMap::compute_edge_map(), libMesh::FEMap::compute_face_map(), libMesh::Elem::contains_edge_of(), libMesh::Tet4::contains_point(), libMesh::Tri3::contains_point(), libMesh::NodeElem::contains_point(), libMesh::InfHex::contains_point(), libMesh::InfPrism::contains_point(), libMesh::InfQuad4::contains_point(), libMesh::Elem::contains_vertex_of(), libMesh::Polyhedron::convex(), libMesh::ElemCutter::cut_2D(), libMesh::ElemCutter::cut_3D(), libMesh::FEMContext::elem_position_get(), libMesh::Elem::face_orientation(), libMesh::Hex20::has_affine_map(), libMesh::Hex27::has_affine_map(), libMesh::Hex8::has_affine_map(), libMesh::Prism15::has_affine_map(), libMesh::Prism18::has_affine_map(), libMesh::Prism20::has_affine_map(), libMesh::Prism21::has_affine_map(), libMesh::Prism6::has_affine_map(), libMesh::Tet10::has_affine_map(), libMesh::Tet14::has_affine_map(), libMesh::Edge3::has_affine_map(), libMesh::Edge4::has_affine_map(), libMesh::Quad4::has_affine_map(), libMesh::Quad8::has_affine_map(), libMesh::Quad9::has_affine_map(), libMesh::Tri6::has_affine_map(), libMesh::Tri7::has_affine_map(), libMesh::Edge3::has_invertible_map(), libMesh::Edge4::has_invertible_map(), libMesh::Quad4::has_invertible_map(), libMesh::Elem::hmax(), libMesh::Elem::hmin(), libMesh::MeshTetInterface::improve_hull_integrity(), libMesh::Poly2TriTriangulator::insert_refinement_points(), libMesh::Hex::is_flipped(), libMesh::InfHex::is_flipped(), libMesh::InfPrism::is_flipped(), libMesh::Polyhedron::is_flipped(), libMesh::Prism::is_flipped(), libMesh::Pyramid::is_flipped(), libMesh::Tet::is_flipped(), is_flipped(), libMesh::InfQuad::is_flipped(), libMesh::Polygon::is_flipped(), libMesh::Quad::is_flipped(), libMesh::Tri::is_flipped(), libMesh::Elem::length(), libMesh::Elem::loose_bounding_box(), libMesh::Edge3::loose_bounding_box(), libMesh::Edge4::loose_bounding_box(), libMesh::Quad8::loose_bounding_box(), libMesh::Quad9::loose_bounding_box(), libMesh::Tri6::loose_bounding_box(), libMesh::Tri7::loose_bounding_box(), main(), libMesh::FEMap::map(), libMesh::InfFEMap::map(), libMesh::FEMap::map_deriv(), libMesh::Polyhedron::master_point(), libMesh::FE< Dim, T >::matches_cache(), libMesh::Tet4::min_and_max_angle(), libMesh::Tri3::min_and_max_angle(), libMesh::FEMSystem::numerical_jacobian(), libMesh::Polyhedron::on_reference_element(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::InfCell::origin(), libMesh::InfEdge2::origin(), libMesh::InfQuad::origin(), libMesh::PostscriptIO::plot_linear_elem(), libMesh::Polyhedron::Polyhedron(), libMesh::Elem::positive_edge_orientation(), libMesh::Elem::quality(), libMesh::Hex::quality(), libMesh::Quad::quality(), libMesh::Tri::quality(), quasicircumcenter(), libMesh::Face::quasicircumcenter(), libMesh::NodeElem::quasicircumcenter(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::Poly2TriTriangulator::should_refine_elem(), libMesh::SimplexRefiner::should_refine_elem(), libMesh::Hex8::side_vertex_average_normal(), libMesh::Prism6::side_vertex_average_normal(), libMesh::Pyramid5::side_vertex_average_normal(), libMesh::Tet4::side_vertex_average_normal(), libMesh::Edge2::side_vertex_average_normal(), libMesh::Quad4::side_vertex_average_normal(), libMesh::Tri3::side_vertex_average_normal(), libMesh::MeshTools::Modification::smooth(), ExtraIntegersTest::test_final_integers(), ElemTest< elem_type >::test_ref_elem(), CheckpointIOTest::testC0PolygonCheckpoint(), BoundaryInfoTest::testShellFaceConstraints(), VolumeTest::testTwistedVolume(), libMesh::Elem::true_centroid(), libMesh::C0Polyhedron::true_centroid(), libMesh::Hex8::true_centroid(), libMesh::Prism6::true_centroid(), libMesh::Pyramid5::true_centroid(), libMesh::Edge2::true_centroid(), libMesh::Quad4::true_centroid(), libMesh::C0Polyhedron::volume(), libMesh::Hex20::volume(), libMesh::Hex27::volume(), libMesh::Hex8::volume(), libMesh::Prism15::volume(), libMesh::Prism18::volume(), libMesh::Pyramid13::volume(), libMesh::Pyramid14::volume(), libMesh::Pyramid5::volume(), libMesh::Tet10::volume(), libMesh::Tet4::volume(), libMesh::Edge2::volume(), libMesh::Edge3::volume(), libMesh::Edge4::volume(), libMesh::Quad4::volume(), libMesh::Quad8::volume(), libMesh::Quad9::volume(), libMesh::Tri3::volume(), libMesh::Tri6::volume(), libMesh::Elem::which_side_am_i(), and libMesh::ExodusII_IO_Helper::write_nodal_coordinates().

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

2924{
2925 libmesh_assert_greater (box_tol, 0.);
2926 libmesh_assert_greater (map_tol, 0.);
2927
2928 // This is a great optimization on first order elements, but it
2929 // could return false negatives on higher orders
2930 if (this->default_order() == FIRST)
2931 {
2932 // Check to make sure the element *could* contain this point, so we
2933 // can avoid an expensive inverse_map call if it doesn't.
2934 bool
2935#if LIBMESH_DIM > 2
2936 point_above_min_z = false,
2937 point_below_max_z = false,
2938#endif
2939#if LIBMESH_DIM > 1
2940 point_above_min_y = false,
2941 point_below_max_y = false,
2942#endif
2943 point_above_min_x = false,
2944 point_below_max_x = false;
2945
2946 // For relative bounding box checks in physical space
2947 const Real my_hmax = this->hmax();
2948
2949 for (auto & n : this->node_ref_range())
2950 {
2951 point_above_min_x = point_above_min_x || (n(0) - my_hmax*box_tol <= p(0));
2952 point_below_max_x = point_below_max_x || (n(0) + my_hmax*box_tol >= p(0));
2953#if LIBMESH_DIM > 1
2954 point_above_min_y = point_above_min_y || (n(1) - my_hmax*box_tol <= p(1));
2955 point_below_max_y = point_below_max_y || (n(1) + my_hmax*box_tol >= p(1));
2956#endif
2957#if LIBMESH_DIM > 2
2958 point_above_min_z = point_above_min_z || (n(2) - my_hmax*box_tol <= p(2));
2959 point_below_max_z = point_below_max_z || (n(2) + my_hmax*box_tol >= p(2));
2960#endif
2961 }
2962
2963 if (
2964#if LIBMESH_DIM > 2
2965 !point_above_min_z ||
2966 !point_below_max_z ||
2967#endif
2968#if LIBMESH_DIM > 1
2969 !point_above_min_y ||
2970 !point_below_max_y ||
2971#endif
2972 !point_above_min_x ||
2973 !point_below_max_x)
2974 return false;
2975 }
2976
2977 // To be on the safe side, we converge the inverse_map() iteration
2978 // to a slightly tighter tolerance than that requested by the
2979 // user...
2980 const Point mapped_point = FEMap::inverse_map(this->dim(),
2981 this,
2982 p,
2983 0.1*map_tol, // <- this is |dx| tolerance, the Newton residual should be ~ |dx|^2
2984 /*secure=*/ false,
2985 /*extra_checks=*/ false);
2986
2987 // Check that the refspace point maps back to p! This is only necessary
2988 // for 1D and 2D elements, 3D elements always live in 3D.
2989 //
2990 // TODO: The contains_point() function could most likely be implemented
2991 // more efficiently in the element sub-classes themselves, at least for
2992 // the linear element types.
2993 if (this->dim() < 3)
2994 {
2995 Point xyz = FEMap::map(this->dim(), this, mapped_point);
2996
2997 // Compute the distance between the original point and the re-mapped point.
2998 // They should be in the same place.
2999 Real dist = (xyz - p).norm();
3000
3001
3002 // If dist is larger than some fraction of the tolerance, then return false.
3003 // This can happen when e.g. a 2D element is living in 3D, and
3004 // FEMap::inverse_map() maps p onto the projection of the element,
3005 // effectively "tricking" on_reference_element().
3006 if (dist > this->hmax() * map_tol)
3007 return false;
3008 }
3009
3010 return this->on_reference_element(mapped_point, map_tol);
3011}
virtual bool on_reference_element(const Point &p, const Real eps=TOLERANCE) const =0
SimpleRange< NodeRefIter > node_ref_range()
Returns a range with all nodes of an element, usable in range-based for loops.
Definition elem.h:2803
static Point map(const unsigned int dim, const Elem *elem, const Point &reference_point)
Definition fe_map.C:1954
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true, const bool extra_checks=true)
Definition fe_map.C:1512
LIBMESH_DEVICE_INLINE auto norm(const T &a)

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

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

◆ positive_edge_orientation()

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

Definition at line 4037 of file elem.C.

4038{
4039 libmesh_assert_less (i, this->n_edges());
4040
4041 return this->point(this->local_edge_node(i, 0)) >
4042 this->point(this->local_edge_node(i, 1));
4043}
virtual unsigned int local_edge_node(unsigned int edge, unsigned int edge_node) const =0
Similar to Elem::local_side_node(), but instead of a side id, takes an edge id and a node id on that ...

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

Referenced by libMesh::FE< Dim, T >::cache(), FEOrientationTestBase< order, family >::entity_orientation(), libMesh::FE< Dim, T >::matches_cache(), libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::FE< Dim, T >::shape_second_deriv().

◆ positive_face_orientation()

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

Definition at line 4046 of file elem.C.

4047{
4048 return this->face_orientation(i) % 2;
4049}

References libMesh::Elem::face_orientation().

Referenced by libMesh::FE< Dim, T >::cache(), libMesh::FE< Dim, T >::matches_cache(), libMesh::FE< Dim, T >::shape(), and libMesh::FE< Dim, T >::shape_deriv().

◆ print_dof_info()

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

Print out info for debugging.

Definition at line 662 of file dof_object.C.

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

References libMesh::DofObject::dof_number(), libMesh::DofObject::id(), libMesh::make_range(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_systems(), 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 3050 of file elem.C.

3051{
3052 os << this->get_info()
3053 << std::endl;
3054}
std::string get_info() const
Prints relevant information about the element to a string.
Definition elem.C:3058

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_stream = libMesh::out)
staticinherited

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

Definition at line 81 of file reference_counter.C.

82{
84 out_stream << ReferenceCounter::get_info();
85}
static std::string get_info()
Gets a string containing the reference information.

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

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

◆ print_info() [3/3]

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

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

Definition at line 81 of file reference_counter.C.

82{
84 out_stream << ReferenceCounter::get_info();
85}

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

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

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

904{
905 return _processor_id;
906}
processor_id_type _processor_id
The processor_id of the DofObject.
Definition dof_object.h:585

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

896{
897 return _processor_id;
898}

References libMesh::DofObject::_processor_id.

Referenced by GhostDofConstraintPartitioner::_do_partition(), NonManifoldTestPartitioner::_do_partition(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::MeshRefinement::add_node(), libMesh::DistributedMesh::add_node(), libMesh::DistributedMesh::add_point(), libMesh::ReplicatedMesh::add_point(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Patch::build_around_element(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::BoundaryInfo::build_side_list_from_node_list(), libMesh::MeshFunction::check_found_elem(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubProjector::construct_projection(), libMesh::MeshBase::copy_constraint_rows(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::DistributedMesh::delete_elem(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::Elem::Elem(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::get_info(), libMesh::Node::get_info(), libMesh::Elem::inherit_data_from(), libMesh::RBEIMConstruction::initialize_qp_data(), libMesh::DistributedMesh::insert_elem(), libMesh::MeshTools::Modification::interpolate_surface(), libMesh::DofObject::invalidate_processor_id(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), AugmentSparsityOnInterface::mesh_reinit(), MeshPerElemTest< elem_type >::meshes_equal_enough(), libMesh::PeriodicBoundaries::neighbor(), libMesh::RBEIMEvaluation::node_distribute_bfs(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SortAndCopy::operator()(), libMesh::CompareDofObjectsByPIDAndThenID::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectInteriors::operator()(), AugmentSparsityOnInterface::operator()(), libMesh::GhostPointNeighbors::operator()(), OverlappingCouplingFunctor::operator()(), AugmentSparsityOnNodes::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::DistributedMesh::own_node(), libMesh::XdrIO::pack_element(), libMesh::CentroidPartitioner::partition_range(), libMesh::LinearPartitioner::partition_range(), libMesh::SFCPartitioner::partition_range(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), libMesh::DofMap::process_mesh_constraint_rows(), libMesh::DofObject::processor_id(), libMesh::CheckpointIO::read_connectivity(), libMesh::CheckpointIO::read_nodes(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::DofMap::scatter_constraints(), libMesh::PetscPreconditioner< T >::set_hypre_ads_data(), libMesh::PetscPreconditioner< T >::set_hypre_ams_data(), libMesh::Partitioner::set_interface_node_processor_ids_BFS(), libMesh::Partitioner::set_interface_node_processor_ids_linear(), libMesh::Partitioner::set_interface_node_processor_ids_petscpartitioner(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), ParsedFEMFunctionTest::setUp(), libMesh::Partitioner::single_partition_range(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id_once(), MeshFunctionTest::test_bad_gradient_var_with_out_of_mesh_value(), MeshFunctionTest::test_bad_hessian_var_with_out_of_mesh_value(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), DofMapTest::testGhostConstraintSendList(), DofObjectTest< DerivedClass >::testInvalidateProcId(), EquationSystemsTest::testPostInitAddElem(), DofObjectTest< DerivedClass >::testSetProcId(), BoundaryInfoTest::testShellFaceConstraints(), DofObjectTest< DerivedClass >::testValidProcId(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::DTKAdapter::update_variable_values(), NonManifoldGhostingFunctorTest::verify_send_list_entries_helper(), libMesh::GmshIO::write_mesh(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), 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 911 of file dof_object.h.

912{
913 this->processor_id() = pid;
914}

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::Hex, libMesh::InfHex, libMesh::Polyhedron, libMesh::Prism, libMesh::Pyramid, libMesh::Tet, libMesh::InfQuad, libMesh::Polygon, libMesh::Quad, and libMesh::Tri.

Definition at line 1208 of file elem.h.

1209 { 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. Not all ElemQuality metrics are supported for all Elem types; consult the Elem::quality() overrides for specific Elem types to determine which quality metrics are supported. The ElemQuality metrics with generic support for all Elems with dimension > 1 are: .) EDGE_LENGTH_RATIO - ratio of maximum to minimum edge (in 2D, side) length, where the min/max is taken over all Elem edges. .) MIN,MAX_ANGLE - The minimum (respectively maximum) angle between all pairs of adjacent Elem edges, in degrees. In 3D, these are not the dihedral angles between adjacent planar faces of the element. In 2D, we compute the angle between adjacent sides for this metric. .) MIN,MAX_DIHEDRAL_ANGLE - In 3D, the minimum (respectively maximum) unoriented angle between adjacent side planes, folded into the range [0, 90] degrees. In 2D, these are equivalent to MIN,MAX_ANGLE.

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

Definition at line 1723 of file elem.C.

1724{
1725 switch (q)
1726 {
1727 // Return the maximum ratio of edge lengths, or zero if that
1728 // maximum would otherwise be infinity.
1729 case EDGE_LENGTH_RATIO:
1730 {
1731 if (this->dim() < 2)
1732 return 1;
1733
1734 std::vector<Real> edge_lengths(this->n_edges());
1735 for (auto e : index_range(edge_lengths))
1736 edge_lengths[e] = (this->point(this->local_edge_node(e,1)) -
1737 this->point(this->local_edge_node(e,0))).norm();
1738
1739 auto [min, max] =
1740 std::minmax_element(edge_lengths.begin(), edge_lengths.end());
1741
1742 if (*min == 0.)
1743 return 0.;
1744 else
1745 return *max / *min;
1746 }
1747
1748 case MIN_ANGLE:
1749 case MAX_ANGLE:
1750 {
1751 // 1D elements don't have interior angles, so just return some
1752 // dummy value in that case.
1753 if (this->dim() < 2)
1754 return 0.;
1755
1756 // Initialize return values
1757 Real min_angle = std::numeric_limits<Real>::max();
1758 Real max_angle = -std::numeric_limits<Real>::max();
1759
1760 for (auto n : this->node_index_range())
1761 {
1762 // Get list of edge ids adjacent to this node.
1763 const auto adjacent_edge_ids = this->edges_adjacent_to_node(n);
1764
1765 // Skip any nodes with fewer than 2 adjacent edges. You
1766 // need at least two adjacent edges to form an interior
1767 // element angle.
1768 auto N = adjacent_edge_ids.size();
1769 if (N < 2)
1770 continue;
1771
1772 // Consider all possible pairs of edges adjacent to node n
1773 for (unsigned int first = 0; first < N-1; ++first)
1774 for (unsigned int second = first+1; second < N; ++second)
1775 {
1776 // Get ids of first and second edges
1777 auto first_edge = adjacent_edge_ids[first];
1778 auto second_edge = adjacent_edge_ids[second];
1779
1780 // Get node ids of first and second edge
1781 auto first_edge_node_0 = this->local_edge_node(first_edge, 0);
1782 auto first_edge_node_1 = this->local_edge_node(first_edge, 1);
1783 auto second_edge_node_0 = this->local_edge_node(second_edge, 0);
1784 auto second_edge_node_1 = this->local_edge_node(second_edge, 1);
1785
1786 // Orient both edges so that edge node 0 == n
1787 if (first_edge_node_0 != n)
1788 std::swap(first_edge_node_0, first_edge_node_1);
1789 if (second_edge_node_0 != n)
1790 std::swap(second_edge_node_0, second_edge_node_1);
1791
1792 libmesh_assert_equal_to(first_edge_node_0, n);
1793 libmesh_assert_equal_to(second_edge_node_0, n);
1794
1795 // Locally oriented edge vectors
1796 Point
1797 first_ev = this->point(first_edge_node_1) - this->point(first_edge_node_0),
1798 second_ev = this->point(second_edge_node_1) - this->point(second_edge_node_0);
1799
1800 // Angle between them in the range [0, pi]
1801 Real theta = std::acos(first_ev.unit() * second_ev.unit());
1802
1803 // Track min and max angles seen
1804 min_angle = std::min(theta, min_angle);
1805 max_angle = std::max(theta, max_angle);
1806 }
1807 }
1808
1809 // Return requested extreme value (in degrees)
1810 return Real(180)/libMesh::pi * ((q == MIN_ANGLE) ? min_angle : max_angle);
1811 }
1812
1813 case MIN_DIHEDRAL_ANGLE:
1814 case MAX_DIHEDRAL_ANGLE:
1815 {
1816 // For 1D and 2D elements, just call this function with MIN,MAX_ANGLE instead.
1817 if (this->dim() < 3)
1818 return this->quality((q == MIN_DIHEDRAL_ANGLE) ? MIN_ANGLE : MAX_ANGLE);
1819
1820 // Initialize return values
1821 Real min_angle = std::numeric_limits<Real>::max();
1822 Real max_angle = -std::numeric_limits<Real>::max();
1823
1824 // Algorithm for computing dihedral angles:
1825 // .) Loop over the edges, use the edge_sides_map to get the
1826 // two sides adjacent to the edge.
1827 // .) For each adjacent side, use the side_nodes_map to get the
1828 // list of three (or more) node ids on that side.
1829 // .) Use the node ids to compute the (approximate) inward
1830 // normal for the side. Note: this is approximate since 3D
1831 // elements with four-sided faces and quadratic tetrahedra
1832 // do not necessarily have planar faces.
1833 // .) Compute the dihedral angle for the current edge, compare
1834 // it to the current min and max dihedral angles.
1835 for (auto e : this->edge_index_range())
1836 {
1837 // Get list of edge ids adjacent to this node.
1838 const auto adjacent_side_ids = this->sides_on_edge(e);
1839
1840 // All 3D elements should have exactly two sides adjacent to each edge.
1841 libmesh_assert_equal_to(adjacent_side_ids.size(), 2);
1842
1843 // Get lists of node ids on each side
1844 const auto side_0_node_ids = this->nodes_on_side(adjacent_side_ids[0]);
1845 const auto side_1_node_ids = this->nodes_on_side(adjacent_side_ids[1]);
1846
1847 // All 3D elements have at least three nodes on each side
1848 libmesh_assert_greater_equal(side_0_node_ids.size(), 3);
1849 libmesh_assert_greater_equal(side_1_node_ids.size(), 3);
1850
1851 // Construct (approximate) inward normal on each adjacent side
1852 const auto side_0_normal =
1853 (this->point(side_0_node_ids[2]) - this->point(side_0_node_ids[0])).cross
1854 (this->point(side_0_node_ids[1]) - this->point(side_0_node_ids[0])).unit();
1855 const auto side_1_normal =
1856 (this->point(side_1_node_ids[2]) - this->point(side_1_node_ids[0])).cross
1857 (this->point(side_1_node_ids[1]) - this->point(side_1_node_ids[0])).unit();
1858
1859 // Compute dihedral angle between the planes.
1860 // Using the absolute value ensures that we get the same result
1861 // even if the orientation of one of the planes is flipped, i.e.
1862 // it always gives us a value in the range [0, pi/2].
1863 // https://en.wikipedia.org/wiki/Dihedral_angle
1864 Real theta = std::acos(std::abs(side_0_normal * side_1_normal));
1865
1866 // Track min and max angles seen
1867 min_angle = std::min(theta, min_angle);
1868 max_angle = std::max(theta, max_angle);
1869 }
1870
1871 // Return requested extreme value (in degrees)
1872 return Real(180)/libMesh::pi * ((q == MIN_DIHEDRAL_ANGLE) ? min_angle : max_angle);
1873 }
1874
1875 case JACOBIAN:
1876 case SCALED_JACOBIAN:
1877 {
1878 // 1D elements don't have interior corners, so this metric
1879 // does not really apply to them.
1880 const auto N = this->dim();
1881 if (N < 2)
1882 return 1.;
1883
1884 // Initialize return value
1885 Real min_node_area = std::numeric_limits<Real>::max();
1886
1887 for (auto n : this->node_index_range())
1888 {
1889 // Get list of edge ids adjacent to this node.
1890 auto adjacent_edge_ids = this->edges_adjacent_to_node(n);
1891
1892 // Skip any nodes that don't have dim() adjacent edges. In 2D,
1893 // you need at least two adjacent edges to compute the cross
1894 // product, and in 3D, you need at least three adjacent edges
1895 // to compute the scalar triple product. The only element
1896 // type which has an unusual topology in this regard is the
1897 // Pyramid element in 3D, where 4 edges meet at the apex node.
1898 // For now, we just skip this node when computing the JACOBIAN
1899 // metric for Pyramids.
1900 if (adjacent_edge_ids.size() != N)
1901 continue;
1902
1903 // Construct oriented edges
1904 std::vector<Point> oriented_edges(N);
1905 for (auto i : make_range(N))
1906 {
1907 auto node_0 = this->local_edge_node(adjacent_edge_ids[i], 0);
1908 auto node_1 = this->local_edge_node(adjacent_edge_ids[i], 1);
1909 if (node_0 != n)
1910 std::swap(node_0, node_1);
1911 oriented_edges[i] = this->point(node_1) - this->point(node_0);
1912 }
1913
1914 // Compute unscaled area (2D) or volume (3D) using the
1915 // cross product (2D) or scalar triple product (3D) of the
1916 // oriented edges. We take the absolute value so that we
1917 // don't have to worry about the sign of the area.
1918 Real node_area = (N == 2) ?
1919 cross_norm(oriented_edges[0], oriented_edges[1]) :
1920 std::abs(triple_product(oriented_edges[0], oriented_edges[1], oriented_edges[2]));
1921
1922 // Divide by (non-zero) edge lengths if computing scaled Jacobian.
1923 // If any length is zero, then set node_area to zero. This means that
1924 // e.g. degenerate quadrilaterals will have a zero SCALED_JACOBIAN metric.
1925 if (q == SCALED_JACOBIAN)
1926 for (auto i : make_range(N))
1927 {
1928 Real len_i = oriented_edges[i].norm();
1929 node_area = (len_i == 0.) ? 0. : (node_area / len_i);
1930 }
1931
1932 // Update minimum
1933 min_node_area = std::min(node_area, min_node_area);
1934 }
1935
1936 return min_node_area;
1937 }
1938
1939 // Relative size metric: min over the corner nodes of min(tau,
1940 // 1/tau), where tau is the ratio of the corner's nodal Jacobian
1941 // determinant to that of the ideal (regular) element of the same
1942 // volume -- ReferenceElem::ideal_target(), rescaled to this
1943 // element's volume via the volume ratio. tau = 1 at every corner
1944 // of an element whose Jacobian is uniform (any affine element:
1945 // parallelogram, box, or regular simplex, at any scale), so the
1946 // metric is 1; non-uniform (tapered/sheared) elements score below
1947 // 1, and a degenerate corner drives it to 0.
1948 case SIZE:
1949 {
1950 // 1D elements don't have interior corners, so this metric does
1951 // not really apply to them.
1952 const auto N = this->dim();
1953 if (N < 2)
1954 return 1.;
1955
1956 const Real vol = this->volume();
1957 if (vol == 0.)
1958 return 0.;
1959
1960 // Ideal (regular) element of the same type; its Jacobian is
1961 // uniform. We compare nodal determinants after rescaling it to
1962 // this element's volume, i.e. multiply by ideal_vol / this_vol.
1963 const auto ideal_pair = ReferenceElem::ideal_target(this->type());
1964 const Elem & ideal = *ideal_pair.first;
1965 const Real vol_ratio = ideal.volume() / vol;
1966
1967 // Nodal Jacobian determinant at node n of element el (the same
1968 // construction as the JACOBIAN metric above).
1969 auto nodal_det = [](const Elem & el, const unsigned int n,
1970 const std::vector<unsigned int> & edge_ids,
1971 const unsigned int dim)
1972 {
1973 std::vector<Point> e(dim);
1974 for (unsigned int i = 0; i != dim; ++i)
1975 {
1976 auto n0 = el.local_edge_node(edge_ids[i], 0);
1977 auto n1 = el.local_edge_node(edge_ids[i], 1);
1978 if (n0 != n)
1979 std::swap(n0, n1);
1980 e[i] = el.point(n1) - el.point(n0);
1981 }
1982 return (dim == 2) ? cross_norm(e[0], e[1])
1983 : std::abs(triple_product(e[0], e[1], e[2]));
1984 };
1985
1986 Real size = 1.;
1987 bool have_corner = false;
1988 for (auto n : this->node_index_range())
1989 {
1990 // Skip any nodes that don't have dim() adjacent edges (see
1991 // the JACOBIAN metric above for the Pyramid apex caveat).
1992 const auto adjacent_edge_ids = this->edges_adjacent_to_node(n);
1993 if (adjacent_edge_ids.size() != N)
1994 continue;
1995 have_corner = true;
1996
1997 const Real a = nodal_det(*this, n, adjacent_edge_ids, N);
1998 const Real aw = nodal_det(ideal, n, adjacent_edge_ids, N);
1999
2000 // Degenerate corner: worst quality.
2001 if (a == 0. || aw == 0.)
2002 return 0.;
2003
2004 const Real tau = (a / aw) * vol_ratio;
2005 size = std::min(size, std::min(tau, Real(1) / tau));
2006 }
2007
2008 return have_corner ? size : 0.;
2009 }
2010
2011 // Maximum condition number of the nodal Jacobian over the corner
2012 // nodes, measured against the ideal (regular) element rather than
2013 // the reference element. At each corner the physical nodal
2014 // Jacobian A and the ideal nodal Jacobian W (taken from the same
2015 // corner of ReferenceElem::ideal_target) give the weighted
2016 // Jacobian A W^{-1}, whose Frobenius condition number, via the
2017 // corner metric tensors T_A = A^T A and T_W = W^T W (which also
2018 // handles a lower-dimensional element embedded in 3D), is
2019 // kappa = sqrt(tr(T_A T_W^{-1}) * tr(T_W T_A^{-1})) / N.
2020 // This is 1 for a corner similar to the ideal one -- so an
2021 // equilateral triangle or regular tetrahedron scores 1, not just
2022 // a right-angled corner -- and grows with distortion. A
2023 // degenerate corner has an infinite condition number, reported as
2024 // 0 (0 stands in for infinity, cf. EDGE_LENGTH_RATIO).
2025 case CONDITION:
2026 {
2027 // 1D elements don't have interior corners, so this metric does
2028 // not really apply to them.
2029 const auto N = this->dim();
2030 if (N < 2)
2031 return 1.;
2032
2033 // Ideal (regular) element of the same type; W is its nodal
2034 // Jacobian. Its scale is irrelevant here (the condition number
2035 // is scale invariant), so the reference-volume sizing is fine.
2036 const auto ideal_pair = ReferenceElem::ideal_target(this->type());
2037 const Elem & ideal = *ideal_pair.first;
2038
2039 // Corner metric tensor T = A^T A at node n of element el, padded
2040 // with the identity in unused dimensions so that RealTensor's
2041 // 3x3 inverse yields the correct NxN inverse.
2042 auto metric_tensor = [](const Elem & el, const unsigned int n,
2043 const std::vector<unsigned int> & edge_ids,
2044 const unsigned int dim)
2045 {
2046 std::vector<Point> e(dim);
2047 for (unsigned int i = 0; i != dim; ++i)
2048 {
2049 auto n0 = el.local_edge_node(edge_ids[i], 0);
2050 auto n1 = el.local_edge_node(edge_ids[i], 1);
2051 if (n0 != n)
2052 std::swap(n0, n1);
2053 e[i] = el.point(n1) - el.point(n0);
2054 }
2055 RealTensor T(1, 0, 0, 0, 1, 0, 0, 0, 1);
2056 for (unsigned int i = 0; i != dim; ++i)
2057 for (unsigned int j = 0; j != dim; ++j)
2058 T(i, j) = e[i] * e[j];
2059 return T;
2060 };
2061
2062 // kappa >= 1 for every matrix, so 1 is both the ideal value and
2063 // a safe floor for the running maximum.
2064 Real max_cond = 1.;
2065
2066 for (auto n : this->node_index_range())
2067 {
2068 // Skip any nodes that don't have dim() adjacent edges (see
2069 // the JACOBIAN metric above for the Pyramid apex caveat).
2070 const auto adjacent_edge_ids = this->edges_adjacent_to_node(n);
2071 if (adjacent_edge_ids.size() != N)
2072 continue;
2073
2074 const RealTensor Ta = metric_tensor(*this, n, adjacent_edge_ids, N);
2075
2076 // Degenerate corner: infinite condition number.
2077 if (Ta.det() == 0.)
2078 return 0.;
2079
2080 const RealTensor Tw = metric_tensor(ideal, n, adjacent_edge_ids, N);
2081 const RealTensor Ta_inv = Ta.inverse();
2082 const RealTensor Tw_inv = Tw.inverse();
2083
2084 // num1 = tr(T_A T_W^{-1}), num2 = tr(T_W T_A^{-1}) over the
2085 // NxN blocks (both symmetric, so summed as elementwise dot
2086 // products).
2087 Real num1 = 0., num2 = 0.;
2088 for (auto i : make_range(N))
2089 for (auto j : make_range(N))
2090 {
2091 num1 += Ta(i, j) * Tw_inv(i, j);
2092 num2 += Tw(i, j) * Ta_inv(i, j);
2093 }
2094
2095 max_cond = std::max(max_cond, std::sqrt(num1 * num2) / N);
2096 }
2097
2098 return max_cond;
2099 }
2100
2101 // Return 1 if we made it here
2102 default:
2103 {
2104 libmesh_do_once( libmesh_here();
2105
2106 libMesh::err << "ERROR: quality metric "
2108 << " not implemented on element type "
2109 << Utility::enum_to_string(this->type())
2110 << std::endl
2111 << "Returning 1."
2112 << std::endl; );
2113
2114 return 1.;
2115 }
2116 }
2117}
virtual Real quality(const ElemQuality q) const
Definition elem.C:1723
virtual std::vector< unsigned int > sides_on_edge(const unsigned int) const =0
IntRange< unsigned short > edge_index_range() const
Definition elem.h:2830
virtual std::vector< unsigned int > edges_adjacent_to_node(const unsigned int) const =0
TypeTensor< T > inverse() const
std::pair< std::unique_ptr< Elem >, std::vector< std::unique_ptr< Node > > > ideal_target(const ElemType type)
LIBMESH_DEVICE_INLINE T cross_norm(const TypeVector< T > &b, const TypeVector< T > &c)
Calls cross_norm_sq() and takes the square root of the result.
LIBMESH_DEVICE_INLINE T triple_product(const TypeVector< T > &a, const TypeVector< T > &b, const TypeVector< T > &c)
const Real pi
.
Definition libmesh.h:292
RealTensorValue RealTensor

References libMesh::CONDITION, libMesh::cross_norm(), libMesh::TypeTensor< T >::det(), libMesh::Elem::dim(), libMesh::Elem::edge_index_range(), libMesh::EDGE_LENGTH_RATIO, libMesh::Elem::edges_adjacent_to_node(), libMesh::Utility::enum_to_string(), libMesh::err, libMesh::ReferenceElem::ideal_target(), libMesh::index_range(), libMesh::TypeTensor< T >::inverse(), libMesh::JACOBIAN, libMesh::Elem::local_edge_node(), libMesh::make_range(), libMesh::MAX_ANGLE, libMesh::MAX_DIHEDRAL_ANGLE, libMesh::MIN_ANGLE, libMesh::MIN_DIHEDRAL_ANGLE, libMesh::Elem::n_edges(), libMesh::Elem::node_index_range(), libMesh::Elem::nodes_on_side(), libMesh::pi, libMesh::Elem::point(), libMesh::Elem::quality(), libMesh::Real, libMesh::SCALED_JACOBIAN, libMesh::Elem::sides_on_edge(), libMesh::SIZE, libMesh::triple_product(), libMesh::Elem::type(), libMesh::TypeVector< T >::unit(), and libMesh::Elem::volume().

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

◆ quasicircumcenter()

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

Currently ignores curvature of element edges, which makes this trivial in 1D.

Reimplemented from libMesh::Elem.

Definition at line 225 of file edge.h.

226 { return (this->point(0) + this->point(1)) / 2; }

References libMesh::Elem::point().

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

3293{
3294 if (!_children)
3295 return nullptr;
3296
3297 return _children[i];
3298}

References libMesh::Elem::_children.

Referenced by libMesh::BoundaryInfo::add_elements(), and 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().

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

Definition at line 508 of file elem.C.

509{
510 return &(ReferenceElem::get(this->type()));
511}
const Elem & get(const ElemType type_in)

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

Referenced by libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::VariationalSmootherSystem::get_target_to_reference_jacobian(), libMesh::QComposite< QSubCell >::init(), libMesh::RBParametrizedFunction::preevaluate_parametrized_function_on_mesh(), and ElemTest< elem_type >::test_ref_elem().

◆ 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 = std::make_unique<Elem *[]>(nc);
98
99 unsigned int parent_p_level = this->p_level();
100 const unsigned int nei = this->n_extra_integers();
101 for (unsigned int c = 0; c != nc; c++)
102 {
103 auto current_child = Elem::build(this->type(), this);
104 _children[c] = current_child.get();
105
106 current_child->set_refinement_flag(Elem::JUST_REFINED);
107 current_child->set_p_level(parent_p_level);
108 current_child->set_p_refinement_flag(this->p_refinement_flag());
109
110 for (auto cnode : current_child->node_index_range())
111 {
112 Node * node =
113 mesh_refinement.add_node(*this, c, cnode,
114 current_child->processor_id());
115 node->set_n_systems (this->n_systems());
116 current_child->set_node(cnode, node);
117 }
118
119 Elem * added_child = mesh_refinement.add_elem (std::move(current_child));
120 added_child->set_n_systems(this->n_systems());
121 libmesh_assert_equal_to (added_child->n_extra_integers(),
122 this->n_extra_integers());
123 for (unsigned int i=0; i != nei; ++i)
124 added_child->set_extra_integer(i, this->get_extra_integer(i));
125 }
126 }
127 else
128 {
129 unsigned int parent_p_level = this->p_level();
130 for (unsigned int c = 0; c != nc; c++)
131 {
132 Elem * current_child = this->child_ptr(c);
133 if (current_child != remote_elem)
134 {
135 libmesh_assert(current_child->subactive());
136 current_child->set_refinement_flag(Elem::JUST_REFINED);
137 current_child->set_p_level(parent_p_level);
138 current_child->set_p_refinement_flag(this->p_refinement_flag());
139 }
140 }
141 }
142
143 // Get any new remote neighbor links right; even find_neighbors
144 // relies on those
145 for (unsigned int s : this->side_index_range())
146 {
147 if (this->neighbor_ptr(s) != remote_elem)
148 continue;
149
150 for (unsigned int c = 0; c != nc; c++)
151 {
152 Elem * current_child = this->child_ptr(c);
153 if (current_child != remote_elem &&
154 this->is_child_on_side(c, s))
155 current_child->set_neighbor
156 (s, const_cast<RemoteElem *>(remote_elem));
157 }
158 }
159
160 // Un-set my refinement flag now
162
163 // Leave the p refinement flag set - we will need that later to get
164 // projection operations correct
165 // this->set_p_refinement_flag(Elem::INACTIVE);
166
167#ifndef NDEBUG
168 for (unsigned int c = 0; c != nc; c++)
169 if (this->child_ptr(c) != remote_elem)
170 {
171 libmesh_assert_equal_to (this->child_ptr(c)->parent(), this);
172 libmesh_assert(this->child_ptr(c)->active());
173 }
174#endif
175 libmesh_assert (this->ancestor());
176}
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const =0

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::is_child_on_side(), libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_systems(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::parent(), libMesh::Elem::REFINE, libMesh::Elem::refinement_flag(), libMesh::remote_elem, libMesh::DofObject::set_extra_integer(), libMesh::DofObject::set_n_systems(), libMesh::Elem::set_neighbor(), libMesh::Elem::set_p_level(), libMesh::Elem::set_p_refinement_flag(), libMesh::Elem::set_refinement_flag(), libMesh::Elem::side_index_range(), libMesh::Elem::subactive(), and libMesh::Elem::type().

◆ refinement_flag()

Elem::RefinementState libMesh::Elem::refinement_flag ( ) const
inlineinherited
Returns
The value of the refinement flag for the element.

Definition at line 3348 of file elem.h.

3349{
3350 return static_cast<RefinementState>(_rflag);
3351}
unsigned char _rflag
h refinement flag.
Definition elem.h:2404

References libMesh::Elem::_rflag.

Referenced by libMesh::Elem::active(), libMesh::BoundaryInfo::add_elements(), libMesh::OldSolutionBase< Output, point_output >::check_old_context(), libMesh::OldSolutionBase< Output, point_output >::check_old_context(), libMesh::Elem::coarsen(), libMesh::Elem::contract(), libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), libMesh::Elem::get_info(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::DofMap::old_dof_indices(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectEdges::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectSides::operator()(), libMesh::Elem::refine(), EquationSystemsTest::testRefineThenReinitPreserveFlags(), libMesh::BoundaryInfo::transfer_boundary_ids_from_children(), libMesh::MeshRefinement::uniformly_coarsen(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ relative_edge_face_order()

bool libMesh::Elem::relative_edge_face_order ( const unsigned int  e,
const unsigned int  s 
) const
inherited
Returns
true iff, for an edge e on side s, the node map for side s is such that the first vertex (i.e. zeroth node) of e is lower positioned than the second vertex (i.e. first node) of e.

Definition at line 4096 of file elem.C.

4097{
4098 libmesh_assert_less (e, this->n_edges());
4099 libmesh_assert_less (s, this->n_faces());
4101
4102 const unsigned int N = Elem::type_to_n_sides_map[this->side_type(s)];
4103
4104 unsigned int v;
4105 for (v = 0; v < N; v++)
4106 if (this->local_side_node(s, v) == this->local_edge_node(e, 0))
4107 break;
4108
4109 libmesh_assert (this->local_side_node(s, (v + 1) % N) ==
4110 this->local_edge_node(e, 1) ||
4111 this->local_side_node(s, (v - 1 + N) % N) ==
4112 this->local_edge_node(e, 1));
4113
4114 return this->local_side_node(s, (v + 1) % N) ==
4115 this->local_edge_node(e, 1);
4116}
virtual bool is_edge_on_side(const unsigned int e, const unsigned int s) const =0

References libMesh::Elem::is_edge_on_side(), libMesh::libmesh_assert(), libMesh::Elem::local_edge_node(), libMesh::Elem::local_side_node(), libMesh::Elem::n_edges(), libMesh::Elem::n_faces(), libMesh::Elem::side_type(), and libMesh::Elem::type_to_n_sides_map.

◆ remove_links_to_me()

void libMesh::Elem::remove_links_to_me ( )
inherited

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

To be used before an element is deleted from a mesh.

Definition at line 1588 of file elem.C.

1589{
1590 libmesh_assert_not_equal_to (this, remote_elem);
1591
1592 // We need to have handled any children first
1593#ifdef LIBMESH_ENABLE_AMR
1594 libmesh_assert (!this->has_children());
1595#endif
1596
1597 // Nullify any neighbor links
1598 for (auto neigh : this->neighbor_ptr_range())
1599 {
1600 if (neigh && neigh != remote_elem)
1601 {
1602 // My neighbor should never be more refined than me; my real
1603 // neighbor would have been its parent in that case.
1604 libmesh_assert_greater_equal (this->level(), neigh->level());
1605
1606 if (this->level() == neigh->level() &&
1607 neigh->has_neighbor(this))
1608 {
1609#ifdef LIBMESH_ENABLE_AMR
1610 // My neighbor may have descendants which also consider me a
1611 // neighbor
1612 std::vector<Elem *> family;
1613 neigh->total_family_tree_by_neighbor (family, this);
1614
1615 for (auto & n : family)
1616 {
1617 libmesh_assert (n);
1618 if (n->is_remote())
1619 continue;
1620 unsigned int my_s = n->which_neighbor_am_i(this);
1621 libmesh_assert_less (my_s, n->n_neighbors());
1622 libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1623 n->set_neighbor(my_s, nullptr);
1624 }
1625#else
1626 unsigned int my_s = neigh->which_neighbor_am_i(this);
1627 libmesh_assert_less (my_s, neigh->n_neighbors());
1628 libmesh_assert_equal_to (neigh->neighbor_ptr(my_s), this);
1629 neigh->set_neighbor(my_s, nullptr);
1630#endif
1631 }
1632#ifdef LIBMESH_ENABLE_AMR
1633 // Even if my neighbor doesn't link back to me, it might
1634 // have subactive descendants which do
1635 else if (neigh->has_children())
1636 {
1637 // If my neighbor at the same level doesn't have me as a
1638 // neighbor, I must be subactive
1639 libmesh_assert(this->level() > neigh->level() ||
1640 this->subactive());
1641
1642 // My neighbor must have some ancestor of mine as a
1643 // neighbor
1644 Elem * my_ancestor = this->parent();
1645 libmesh_assert(my_ancestor);
1646 while (!neigh->has_neighbor(my_ancestor))
1647 {
1648 my_ancestor = my_ancestor->parent();
1649 libmesh_assert(my_ancestor);
1650 }
1651
1652 // My neighbor may have descendants which consider me a
1653 // neighbor
1654 std::vector<Elem *> family;
1655 neigh->total_family_tree_by_subneighbor (family, my_ancestor, this);
1656
1657 for (auto & n : family)
1658 {
1659 libmesh_assert (n);
1660 if (n->is_remote())
1661 continue;
1662 unsigned int my_s = n->which_neighbor_am_i(this);
1663 libmesh_assert_less (my_s, n->n_neighbors());
1664 libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1665 n->set_neighbor(my_s, nullptr);
1666 }
1667 }
1668#endif
1669 }
1670 }
1671
1672#ifdef LIBMESH_ENABLE_AMR
1673 // We can't currently delete a child with a parent!
1674 libmesh_assert (!this->parent());
1675#endif
1676}

References libMesh::Elem::has_children(), libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::neighbor_ptr_range(), libMesh::Elem::parent(), and libMesh::remote_elem.

Referenced by MeshDeletionsTest::testDeleteElem().

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

2202{
2204
2205 libmesh_assert(this->child_ptr(c));
2206
2207 this->set_child(c, elem);
2208}

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

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

◆ runtime_topology()

virtual bool libMesh::Elem::runtime_topology ( ) const
inlinevirtualinherited
Returns
true iff this element type can vary in topology (e.g. have different numbers of sides and/or nodes) at runtime. For such general polygons or polyhedra, APIs which assume a fixed topology are not safe to use.

Reimplemented in libMesh::Polyhedron, and libMesh::Polygon.

Definition at line 254 of file elem.h.

254{ return false; }

Referenced by libMesh::FE< Dim, T >::edge_map(), libMesh::FE< Dim, T >::edge_reinit(), libMesh::Elem::Elem(), libMesh::QBase::init(), libMesh::FE< Dim, T >::reinit(), libMesh::FE< Dim, T >::reinit(), libMesh::FE< Dim, T >::side_map(), FETest< order, family, elem_type, CaseName >::testNodalSoln(), FETest< order, family, elem_type, CaseName >::testRefspaceNodes(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ 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::Hex20, libMesh::Hex27, libMesh::InfHex16, libMesh::InfHex18, libMesh::InfPrism12, libMesh::Prism15, libMesh::Prism18, libMesh::Prism20, libMesh::Prism21, libMesh::Pyramid13, libMesh::Pyramid14, libMesh::Pyramid18, libMesh::Tet10, libMesh::Tet14, libMesh::InfQuad6, libMesh::Quad8, libMesh::Quad9, libMesh::Tri6, libMesh::Tri7, libMesh::Edge3, and libMesh::Edge4.

Definition at line 3183 of file elem.C.

3185{
3186 // for linear elements, always return 0
3187 return 0;
3188}

Referenced by libMesh::MeshTools::Modification::smooth(), and DualShapeTest::testTransformedDual().

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

Definition at line 3193 of file elem.C.

3194{
3195 // for linear elements, always return 0
3196 return std::pair<unsigned short int, unsigned short int>(0,0);
3197}

◆ second_order_equivalent_type()

ElemType libMesh::Elem::second_order_equivalent_type ( const ElemType  et,
const bool  full_ordered = true 
)
staticinherited
Returns
The ElemType of the associated second-order element (which will be the same as the input if the input is already a second-order ElemType) or INVALID_ELEM for elements that cannot be converted into higher order equivalents.

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

For some elements, there exist two second-order equivalents, e.g. for Quad4 there is Quad8 and Quad9. When the optional full_ordered is true, then QUAD9 is returned. When full_ordered is false, then QUAD8 is returned.

Definition at line 3571 of file elem.C.

3573{
3574 switch (et)
3575 {
3576 case NODEELEM:
3577 return NODEELEM;
3578 case EDGE2:
3579 case EDGE3:
3580 {
3581 // full_ordered not relevant
3582 return EDGE3;
3583 }
3584
3585 case EDGE4:
3586 {
3587 // full_ordered not relevant
3588 return EDGE4;
3589 }
3590
3591 case TRI3:
3592 case TRI6:
3593 {
3594 // full_ordered not relevant
3595 return TRI6;
3596 }
3597
3598 case TRI7:
3599 return TRI7;
3600
3601 // Currently there is no TRISHELL6, so similarly to other types
3602 // where this is the case, we just return the input.
3603 case TRISHELL3:
3604 return TRISHELL3;
3605
3606 case QUAD4:
3607 case QUAD8:
3608 {
3609 if (full_ordered)
3610 return QUAD9;
3611 else
3612 return QUAD8;
3613 }
3614
3615 case QUADSHELL4:
3616 case QUADSHELL8:
3617 {
3618 if (full_ordered)
3619 return QUADSHELL9;
3620 else
3621 return QUADSHELL8;
3622 }
3623
3624 case QUAD9:
3625 {
3626 // full_ordered not relevant
3627 return QUAD9;
3628 }
3629
3630 case QUADSHELL9:
3631 {
3632 // full_ordered not relevant
3633 return QUADSHELL9;
3634 }
3635
3636 case TET4:
3637 case TET10:
3638 {
3639 // full_ordered not relevant
3640 return TET10;
3641 }
3642
3643 case TET14:
3644 return TET14;
3645
3646 case HEX8:
3647 case HEX20:
3648 {
3649 // see below how this correlates with INFHEX8
3650 if (full_ordered)
3651 return HEX27;
3652 else
3653 return HEX20;
3654 }
3655
3656 case HEX27:
3657 {
3658 // full_ordered not relevant
3659 return HEX27;
3660 }
3661
3662 case PRISM6:
3663 case PRISM15:
3664 {
3665 if (full_ordered)
3666 return PRISM18;
3667 else
3668 return PRISM15;
3669 }
3670
3671 // full_ordered not relevant, already fully second order
3672 case PRISM18:
3673 return PRISM18;
3674 case PRISM20:
3675 return PRISM20;
3676 case PRISM21:
3677 return PRISM21;
3678 case PYRAMID18:
3679 return PYRAMID18;
3680
3681 case PYRAMID5:
3682 case PYRAMID13:
3683 {
3684 if (full_ordered)
3685 return PYRAMID14;
3686 else
3687 return PYRAMID13;
3688 }
3689
3690 case PYRAMID14:
3691 {
3692 // full_ordered not relevant
3693 return PYRAMID14;
3694 }
3695
3696
3697
3698#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
3699
3700 // infinite elements
3701 case INFEDGE2:
3702 {
3703 return INFEDGE2;
3704 }
3705
3706 case INFQUAD4:
3707 case INFQUAD6:
3708 {
3709 // full_ordered not relevant
3710 return INFQUAD6;
3711 }
3712
3713 case INFHEX8:
3714 case INFHEX16:
3715 {
3716 /*
3717 * Note that this matches with \p Hex8:
3718 * For full-ordered, \p InfHex18 and \p Hex27
3719 * belong together, and for not full-ordered,
3720 * \p InfHex16 and \p Hex20 belong together.
3721 */
3722 if (full_ordered)
3723 return INFHEX18;
3724 else
3725 return INFHEX16;
3726 }
3727
3728 case INFHEX18:
3729 {
3730 // full_ordered not relevant
3731 return INFHEX18;
3732 }
3733
3734 case INFPRISM6:
3735 case INFPRISM12:
3736 {
3737 // full_ordered not relevant
3738 return INFPRISM12;
3739 }
3740
3741#endif
3742
3743
3744 default:
3745 {
3746 // what did we miss?
3747 libmesh_error_msg("No second order equivalent element type for et = "
3749 }
3750 }
3751}

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

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

◆ set_buffer()

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

Definition at line 722 of file dof_object.h.

723 { _idx_buf = buf; }

References libMesh::DofObject::_idx_buf.

Referenced by DofObjectTest< DerivedClass >::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 3320 of file elem.h.

3321{
3322 libmesh_assert (this->has_children());
3323
3324 _children[c] = elem;
3325}

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

Referenced by libMesh::Elem::add_child(), 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 446 of file dof_object.C.

450{
451 libmesh_assert_less (s, this->n_systems());
452 libmesh_assert_less (var, this->n_vars(s));
453 libmesh_assert_less (comp, this->n_comp(s,var));
454
455 const unsigned int
456 vg = this->var_to_vg(s,var),
457#ifndef NDEBUG
458 ncg = this->n_comp_group(s,vg),
459#endif
460 vig = this->system_var_to_vg_var(s,vg,var),
461 start_idx_sys = this->start_idx(s);
462
463 libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
464
465 dof_id_type & base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
466
467 // We intend to change all dof numbers together or not at all
468 if (comp || vig)
469 libmesh_assert ((dn == invalid_id && base_idx == invalid_id) ||
470 (dn == base_idx + vig*ncg + comp));
471
472 // only explicitly store the base index for vig==0, comp==0
473 else
474 base_idx = dn;
475
476 libmesh_assert_equal_to (this->dof_number(s, var, comp), dn);
477}
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.

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(), 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 1116 of file dof_object.h.

1118{
1119#ifndef NDEBUG
1120 const unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
1121#endif
1122 libmesh_assert_less(index+n_more_integers, this->n_extra_integers());
1123 libmesh_assert_less(this->n_pseudo_systems(), _idx_buf.size());
1124
1125 const unsigned int start_idx_i = this->start_idx_ints();
1126
1127 libmesh_assert_less(start_idx_i+index+n_more_integers, _idx_buf.size());
1128 std::memcpy(&_idx_buf[start_idx_i+index], &value, sizeof(T));
1129}
static const bool value
Definition xdr_io.C:55

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::MeshTools::Modification::all_rbb(), libMesh::ExodusII_IO::read(), libMesh::DynaIO::read_mesh(), RationalMapTest< elem_type >::setUp(), FETestBase< order, family, elem_type, build_nx, CaseName >::setUp(), and DofObjectTest< DerivedClass >::testAddExtraData().

◆ set_extra_integer()

void libMesh::DofObject::set_extra_integer ( const unsigned int  index,
const dof_id_type  value 
)
inlineinherited

◆ set_id() [1/2]

dof_id_type & libMesh::DofObject::set_id ( )
inlineinherited

◆ set_id() [2/2]

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

Sets the id for this DofObject.

Definition at line 192 of file dof_object.h.

193 { 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 1162 of file elem.C.

1163{
1164 // interior parents make no sense for full-dimensional elements.
1165 libmesh_assert (!p ||
1166 this->dim() < LIBMESH_DIM);
1167
1168 // If we have an interior_parent, we USED TO assume it was a
1169 // one-higher-dimensional interior element, but we now allow e.g.
1170 // edge elements to have a 3D interior_parent with no
1171 // intermediate 2D element.
1172 // libmesh_assert (!p ||
1173 // p->dim() == (this->dim()+1));
1174 libmesh_assert (!p ||
1175 (p == remote_elem) ||
1176 (p->dim() > this->dim()));
1177
1178 _elemlinks[1+this->n_sides()] = p;
1179}

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

Referenced by libMesh::BoundaryInfo::add_elements(), Edge(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Hex::Hex(), libMesh::InfHex::InfHex(), libMesh::InfQuad::InfQuad(), libMesh::NodeElem::NodeElem(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), libMesh::Prism::Prism(), libMesh::Pyramid::Pyramid(), libMesh::Quad::Quad(), libMesh::Tet::Tet(), libMesh::Tri::Tri(), libMesh::Parallel::Packing< Elem * >::unpack(), and libMesh::MeshTetInterface::volume_to_surface_mesh().

◆ set_mapping_data()

void libMesh::Elem::set_mapping_data ( const unsigned char  data)
inlineinherited

◆ set_mapping_type()

void libMesh::Elem::set_mapping_type ( const ElemMappingType  type)
inlineinherited

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

380{
381 libmesh_assert_less (s, this->n_systems());
382 libmesh_assert_less (var, this->n_vars(s));
383
384 this->set_n_comp_group(s, this->var_to_vg(s,var), ncomp);
385}
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:389

References libMesh::DofObject::n_systems(), 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 389 of file dof_object.C.

392{
393 libmesh_assert_less (s, this->n_systems());
394 libmesh_assert_less (vg, this->n_var_groups(s));
395
396 // Check for trivial return
397 if (ncomp == this->n_comp_group(s,vg)) return;
398
399#ifndef NDEBUG
400 if (index_t(ncomp) >= ncv_magic)
401 {
402 const index_t ncvm = ncv_magic;
403 libmesh_error_msg("ERROR: ncomp must be less than DofObject::ncv_magic!\n" \
404 << "ncomp = " \
405 << ncomp \
406 << ", ncv_magic = " \
407 << ncvm \
408 << "\nrecompile and try again!");
409 }
410#endif
411
412 const unsigned int
413 start_idx_sys = this->start_idx(s),
414 n_vars_group = this->n_vars(s,vg),
415 base_offset = start_idx_sys + 2*vg;
416
417 libmesh_assert_less ((base_offset + 1), _idx_buf.size());
418
419 // if (ncomp)
420 // libMesh::out << "s,vg,ncomp="
421 // << s << ","
422 // << vg << ","
423 // << ncomp << '\n';
424
425 // set the number of components, maintaining the number
426 // of variables in the group
427 _idx_buf[base_offset] = ncv_magic*n_vars_group + ncomp;
428
429 // We use (invalid_id - 1) to signify no
430 // components for this object
431 _idx_buf[base_offset + 1] = (ncomp == 0) ? invalid_id - 1 : invalid_id;
432
433 // this->debug_buffer();
434 // libMesh::out << "s,vg = " << s << "," << vg << '\n'
435 // << "base_offset=" << base_offset << '\n'
436 // << "this->n_comp(s,vg)=" << this->n_comp(s,vg) << '\n'
437 // << "this->n_comp_group(s,vg)=" << this->n_comp_group(s,vg) << '\n'
438 // << "this->n_vars(s,vg)=" << this->n_vars(s,vg) << '\n'
439 // << "this->n_var_groups(s)=" << this->n_var_groups(s) << '\n';
440
441 libmesh_assert_equal_to (ncomp, this->n_comp_group(s,vg));
442}
dof_id_type index_t
DoF index information.
Definition dof_object.h:669

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

Referenced by libMesh::DofObject::set_n_comp(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), and DofObjectTest< DerivedClass >::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 142 of file dof_object.C.

143{
144 const unsigned int old_ns = this->n_systems();
145
146 // Check for trivial return
147 if (ns == old_ns)
148 return;
149
150 const unsigned int nei = this->n_extra_integers();
151 const dof_id_type header_size = ns + bool(nei);
152 const dof_id_type hdr = nei ?
153 static_cast<dof_id_type>(-static_cast<std::ptrdiff_t>(header_size))
154 : header_size;
155 index_buffer_t new_buf(header_size + nei, hdr);
156 if (nei)
157 {
158 const unsigned int start_idx_ints = old_ns ?
159 cast_int<unsigned int>(_idx_buf[old_ns]) :
160 1;
161 libmesh_assert_less(start_idx_ints, _idx_buf.size());
162 std::copy(_idx_buf.begin()+start_idx_ints,
163 _idx_buf.end(),
164 new_buf.begin()+header_size);
165 if (ns)
166 std::fill(new_buf.begin()+1, new_buf.begin()+ns+1, ns+1);
167 }
168
169 // vector swap trick to force deallocation when shrinking
170 new_buf.swap(_idx_buf);
171
172#ifdef DEBUG
173 libmesh_assert_equal_to(nei, this->n_extra_integers());
174
175 // check that all systems now exist and that they have 0 size
176 libmesh_assert_equal_to (ns, this->n_systems());
177 for (auto s : make_range(this->n_systems()))
178 {
179 libmesh_assert_equal_to (this->n_vars(s), 0);
180 libmesh_assert_equal_to (this->n_var_groups(s), 0);
181 }
182#endif
183}
std::vector< index_t > index_buffer_t
Definition dof_object.h:670

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

Referenced by libMesh::DofObject::add_system(), libMesh::DofObject::clear_dofs(), libMesh::Elem::refine(), DofObjectTest< DerivedClass >::testManualDofCalculation(), DofObjectTest< DerivedClass >::testSetNSystems(), DofObjectTest< DerivedClass >::testSetNSystemsExtraInts(), DofObjectTest< DerivedClass >::testSetNVariableGroups(), and DofObjectTest< DerivedClass >::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 239 of file dof_object.C.

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

References libMesh::DofObject::_idx_buf, libMesh::DofObject::end_idx(), libMesh::DofObject::get_extra_integer(), libMesh::DofObject::has_extra_integers(), libMesh::DofObject::invalid_id, libMesh::make_range(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), n_vars, libMesh::DofObject::ncv_magic, libMesh::DofObject::set_n_comp_group(), and libMesh::DofObject::start_idx().

Referenced by DofObjectTest< DerivedClass >::testManualDofCalculation(), DofObjectTest< DerivedClass >::testSetNVariableGroups(), and DofObjectTest< DerivedClass >::testSetNVariableGroupsExtraInts().

◆ set_neighbor()

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

◆ set_node() [1/2]

Node *& libMesh::Elem::set_node ( const unsigned int  i)
inlinevirtualinherited
Returns
The pointer to the Node with local number i as a writable reference.
Deprecated:
This setter cannot update the multiple node pointers used in a general polyhedron; use the set_node overload that takes an argument.

Reimplemented in libMesh::RemoteElem.

Definition at line 2688 of file elem.h.

2689{
2690 libmesh_assert_less (i, this->n_nodes());
2691
2692 libmesh_deprecated();
2693
2694 return _nodes[i];
2695}

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

Referenced by LinearElasticityWithContact::add_contact_edge_elements(), add_cube_convex_hull_to_mesh(), libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Modification::all_tri(), AllSecondOrderTest::allCompleteOrderMixed(), AllSecondOrderTest::allCompleteOrderRange(), AllSecondOrderTest::allSecondOrderMixed(), AllSecondOrderTest::allSecondOrderRange(), libMesh::TetGenMeshInterface::assign_nodes_to_elem(), libMesh::MeshTools::Generation::build_cube(), DisjointNeighborTest::build_four_disjoint_elems(), GetBoundaryPointsTest::build_mesh(), MeshfunctionDFEM::build_mesh(), MixedDimensionMeshTest::build_mesh(), MixedDimensionNonUniformRefinement::build_mesh(), MixedDimensionNonUniformRefinementTriangle::build_mesh(), MixedDimensionNonUniformRefinement3D::build_mesh(), SlitMeshTest::build_mesh(), FEHybridOrientationTest< order, family >::build_mesh(), OverlappingTestBase::build_quad_mesh(), DisjointNeighborTest::build_split_mesh_with_interface(), DisjointNeighborTest::build_two_disjoint_elems(), libMesh::TriangleWrapper::copy_tri_to_mesh(), libMesh::UnstructuredMesh::create_submesh(), libMesh::TetGenIO::element_in(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::AbaqusIO::read_elements(), libMesh::DynaIO::read_mesh(), libMesh::GmshIO::read_mesh(), libMesh::MatlabIO::read_stream(), libMesh::C0Polyhedron::retriangulate(), libMesh::RemoteElem::set_node(), PerElemTest< elem_type >::setUp(), libMesh::FE< Dim, T >::shape(), libMesh::Polyhedron::side_clones(), libMesh::UnstructuredMesh::stitching_helper(), libMesh::MeshTools::Generation::surface_octahedron(), libMesh::Elem::swap2nodes(), DisjointNeighborTest::testDisjointNeighborConflictError(), CheckpointIOTest::testDisjointNeighborPairsCheckpoint(), SystemsTest::testDofCouplingWithVarGroups(), MeshTriangulationTest::testEdge3Mesh(), MeshTriangulationTest::testEdgesMesh(), MeshTriangulationTest::testHalfDomain(), NodalNeighborsTest::testOrientation(), MeshTriangulationTest::testPoly2TriBad1DMultiBoundary(), MeshTriangulationTest::testPoly2TriBad2DMultiBoundary(), MeshTriangulationTest::testPoly2TriBadEdges(), MeshTriangulationTest::testPoly2TriEdge3ToTri6FlipThrows(), EquationSystemsTest::testPostInitAddElem(), SystemsTest::testProjectMatrix3D(), InfFERadialTest::testRefinement(), EquationSystemsTest::testReinitWithNodeElem(), SystemsTest::testSetSystemParameterOverEquationSystem(), BoundaryInfoTest::testShellFaceConstraints(), InfFERadialTest::testSides(), DisjointNeighborTest::testStitchCrossMesh(), MeshTetTest::testTetsToTets(), MeshSubdomainIDTest::testUnpartitioned(), libMesh::Poly2TriTriangulator::triangulate_current_points(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ set_node() [2/2]

void libMesh::Elem::set_node ( const unsigned int  i,
Node *  node 
)
inlinevirtualinherited

Sets local Node i to refer to node.

Reimplemented in libMesh::RemoteElem.

Definition at line 2701 of file elem.h.

2703{
2704 libmesh_assert_less (i, this->n_nodes());
2705
2706 _nodes[i] = node;
2707}

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

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

128{
129 this->clear_old_dof_object();
130
132
133 // Make a new DofObject, assign a copy of \p this.
134 // Make sure the copy ctor for DofObject works!!
135 this->old_dof_object = this->construct(this);
136}
std::unique_ptr< DofObject > construct(const DofObject *other=nullptr)
Convenient factory function that calls either the (deep) copy constructor or the default constructor ...
Definition dof_object.h:746
void clear_old_dof_object()
Sets the old_dof_object to nullptr.
Definition dof_object.C:120

References libMesh::DofObject::clear_old_dof_object(), libMesh::DofObject::construct(), 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 this->hack_p_level(p);
83}
void set_p_refinement_flag(const RefinementState pflag)
Sets the value of the p-refinement flag for the element.
Definition elem.h:3372

References libMesh::Elem::_p_level, libMesh::Elem::child_ref_range(), libMesh::Elem::hack_p_level(), libMesh::Elem::JUST_COARSENED, libMesh::Elem::JUST_REFINED, libMesh::Elem::p_level(), libMesh::Elem::parent(), libMesh::Elem::set_p_level(), and libMesh::Elem::set_p_refinement_flag().

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::Elem::coarsen(), libMesh::Elem::Elem(), libMesh::Elem::inherit_data_from(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), libMesh::Elem::refine(), libMesh::Elem::set_p_level(), VolumeTest::testHex20PLevelTrueCentroid(), 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 3184 of file elem.h.

3185{
3186 // We no longer support using parent() as interior_parent()
3187 libmesh_assert_equal_to(this->dim(), p ? p->dim() : this->dim());
3188 _elemlinks[0] = p;
3189}

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

void libMesh::DofObject::set_unique_id ( unique_id_type  new_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 1287 of file dof_object.h.

1290{
1291 libmesh_assert_less (s, this->n_systems());
1292 libmesh_assert_less (vg, this->n_var_groups(s));
1293
1294 const unsigned int
1295 start_idx_sys = this->start_idx(s);
1296
1297 libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1298
1299 _idx_buf[start_idx_sys + 2*vg + 1] = db;
1300
1301 libmesh_assert_equal_to (this->vg_dof_base(s,vg), db);
1302}
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...

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::set_nonlocal_dof_objects(), and DofObjectTest< DerivedClass >::testManualDofCalculation().

◆ side_children_matrix()

unsigned int libMesh::Edge::side_children_matrix ( const unsigned int  ,
const unsigned int   
) const
inlineprotected

Matrix that allows children to inherit boundary conditions.

Definition at line 254 of file edge.h.

256 { libmesh_not_implemented(); return 0; }

◆ side_index_range()

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

Definition at line 2848 of file elem.h.

2849{
2850 return {0, cast_int<unsigned short>(this->n_sides())};
2851}

References libMesh::Elem::n_sides().

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::BoundaryInfo::add_elements(), libMesh::MeshTools::Modification::all_rbb(), libMesh::MeshTools::Modification::all_tri(), assemble_advection_diffusion(), MeshBaseTest::BrokenNeighborMesh(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_side_list_from_node_list(), libMesh::MeshTetInterface::check_hull_integrity(), MeshInputTest::checkHexPrismPolyhedron(), libMesh::FEGenericBase< OutputType >::coarsened_dof_values(), compute_enriched_soln(), libMesh::FEAbstract::compute_node_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), libMesh::BoundaryInfo::copy_boundary_ids(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::MeshTools::Modification::flatten(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), libMesh::Elem::get_info(), libMesh::VariationalSmootherConstraint::get_neighbors_for_boundary_constraint(), libMesh::VariationalSmootherConstraint::get_neighbors_for_subdomain_constraint(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::Elem::has_topological_neighbor(), libMesh::MeshTetInterface::improve_hull_integrity(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_constraints(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_node_constraints(), libMesh::LaplaceMeshSmoother::init(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::MeshTools::Modification::interpolate_surface(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::VariationalSmootherConstraint::nodes_share_boundary_id(), libMesh::Elem::nullify_neighbors(), libMesh::PostscriptIO::plot_quadratic_elem(), libMesh::Elem::refine(), libMesh::MeshTools::Modification::smooth(), libMesh::UnstructuredMesh::stitching_helper(), ExodusC0PolyhedronTest::test_write_and_read_hexagonal_prism(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::MeshTetInterface::volume_to_surface_mesh(), libMesh::ExodusII_IO_Helper::write_elements(), and libMesh::ExodusII_IO_Helper::write_nodal_coordinates().

◆ side_ptr() [1/4]

std::unique_ptr< Elem > libMesh::Edge::side_ptr ( const unsigned int  i)
finaloverridevirtual
Returns
A pointer to a NodeElem for the specified node.

Implements libMesh::Elem.

Definition at line 56 of file edge.C.

57{
58 libmesh_assert_less (i, 2);
59 std::unique_ptr<Elem> nodeelem = std::make_unique<NodeElem>();
60 nodeelem->set_node(0, this->node_ptr(i));
61
62 nodeelem->set_interior_parent(this);
63 nodeelem->inherit_data_from(*this);
64
65 return nodeelem;
66}

References libMesh::Elem::node_ptr().

◆ side_ptr() [2/4]

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

Definition at line 2869 of file elem.h.

2871{
2872 // Hand off to the non-const version of this function
2873 Elem * me = const_cast<Elem *>(this);
2874 std::unique_ptr<Elem> e {const_cast<Elem *>(elem.release())};
2875 me->side_ptr(e, i);
2876 elem = std::move(e);
2877}

References libMesh::Elem::side_ptr().

◆ side_ptr() [3/4]

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

Rebuilds a pointer to a NodeElem for the specified node.

Implements libMesh::Elem.

Definition at line 69 of file edge.C.

71{
72 libmesh_assert_less (i, this->n_sides());
73
74 if (!side.get() || side->type() != NODEELEM)
75 side = this->build_side_ptr(i);
76 else
77 {
78 side->inherit_data_from(*this);
79 side->set_node(0, this->node_ptr(i));
80 }
81}

References build_side_ptr(), n_sides(), libMesh::Elem::node_ptr(), and libMesh::NODEELEM.

◆ side_ptr() [4/4]

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

Definition at line 2857 of file elem.h.

2858{
2859 // Call the non-const version of this function, return the result as
2860 // a std::unique_ptr<const Elem>.
2861 Elem * me = const_cast<Elem *>(this);
2862 return me->side_ptr(i);
2863}

References libMesh::Elem::side_ptr().

◆ side_type() [1/2]

ElemType libMesh::Elem::side_type ( const ElemType  t,
const unsigned int  s 
)
staticinherited
Returns
The type of side s of an element of type t, without needing an instantiated Elem. The Polygon and Polyhedron subclasses have one side type but no fixed number of sides, so s goes unchecked for them; query an actual Elem when you have one.

Definition at line 3275 of file elem.C.

3277{
3278 libmesh_assert_less (s, type_to_n_sides_map[t]);
3279
3280 switch (t)
3281 {
3282 case EDGE2:
3283 case EDGE3:
3284 case EDGE4:
3285 return NODEELEM;
3286 case TRI3:
3287 case TRISHELL3:
3288 case QUAD4:
3289 case QUADSHELL4:
3290 // A polygon's sides are all edges and a polyhedron's are all
3291 // polygons, however many a given element turns out to have
3292 case C0POLYGON:
3293 return EDGE2;
3294 case TRI6:
3295 case TRI7:
3296 case QUAD8:
3297 case QUADSHELL8:
3298 case QUAD9:
3299 case QUADSHELL9:
3300 return EDGE3;
3301 case TET4:
3302 return TRI3;
3303 case TET10:
3304 return TRI6;
3305 case TET14:
3306 return TRI7;
3307 case HEX8:
3308 return QUAD4;
3309 case HEX20:
3310 return QUAD8;
3311 case HEX27:
3312 return QUAD9;
3313 // Sides 0 and 4 of a prism are its triangles
3314 case PRISM6:
3315 return (s == 0 || s == 4) ? TRI3 : QUAD4;
3316 case PRISM15:
3317 return (s == 0 || s == 4) ? TRI6 : QUAD8;
3318 case PRISM18:
3319 return (s == 0 || s == 4) ? TRI6 : QUAD9;
3320 case PRISM20:
3321 case PRISM21:
3322 return (s == 0 || s == 4) ? TRI7 : QUAD9;
3323 // Side 4 of a pyramid is its quadrilateral base
3324 case PYRAMID5:
3325 return (s < 4) ? TRI3 : QUAD4;
3326 case PYRAMID13:
3327 return (s < 4) ? TRI6 : QUAD8;
3328 case PYRAMID14:
3329 return (s < 4) ? TRI6 : QUAD9;
3330 case PYRAMID18:
3331 return (s < 4) ? TRI7 : QUAD9;
3332 case C0POLYHEDRON:
3333 return C0POLYGON;
3334#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
3335 // An InfEdge2's sides are its end nodes, like any other 1D element's
3336 case INFEDGE2:
3337 return NODEELEM;
3338 // A 2D or 3D infinite element's side 0 is the finite base it was
3339 // built from; its remaining sides run out to infinity with it
3340 case INFQUAD4:
3341 return (s == 0) ? EDGE2 : INFEDGE2;
3342 case INFQUAD6:
3343 return (s == 0) ? EDGE3 : INFEDGE2;
3344 case INFHEX8:
3345 return (s == 0) ? QUAD4 : INFQUAD4;
3346 case INFHEX16:
3347 return (s == 0) ? QUAD8 : INFQUAD6;
3348 case INFHEX18:
3349 return (s == 0) ? QUAD9 : INFQUAD6;
3350 case INFPRISM6:
3351 return (s == 0) ? TRI3 : INFQUAD4;
3352 case INFPRISM12:
3353 return (s == 0) ? TRI6 : INFQUAD6;
3354#endif
3355 default:
3356 libmesh_error_msg("No side type for element type " << Utility::enum_to_string(t));
3357 }
3358
3359 return INVALID_ELEM;
3360}

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

◆ side_type() [2/2]

ElemType libMesh::Edge::side_type ( const unsigned int  s) const
finaloverridevirtual
Returns
The type of element for side s.

Implements libMesh::Elem.

Definition at line 165 of file edge.C.

166{
167 libmesh_assert_less (s, 2);
168 return NODEELEM;
169}

References libMesh::NODEELEM.

◆ side_vertex_average_normal()

Point libMesh::Elem::side_vertex_average_normal ( const unsigned int  s) const
virtualinherited
Returns
the normal (outwards-facing) of the side of the element at the vertex-average of the side
Parameters
sthe side of interest

Reimplemented in libMesh::C0Polyhedron, libMesh::Hex8, libMesh::Prism6, libMesh::Pyramid5, libMesh::Tet4, libMesh::Edge2, libMesh::C0Polygon, libMesh::Quad4, and libMesh::Tri3.

Definition at line 3922 of file elem.C.

3923{
3924 unsigned int dim = this->dim();
3925 const std::unique_ptr<const Elem> face = this->build_side_ptr(s);
3926 std::unique_ptr<libMesh::FEBase> fe(
3928 fe->add_p_level_in_reinit(false); // Yes, really use the default order
3929 const std::vector<Point> & normals = fe->get_normals();
3930 std::vector<Point> ref_side_vertex_average_v = {face->reference_elem()->vertex_average()};
3931 fe->reinit(this, s, TOLERANCE, &ref_side_vertex_average_v);
3932 return normals[0];
3933}
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i)=0
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
Definition fe_type.h:197

References libMesh::FEGenericBase< OutputType >::build(), libMesh::Elem::build_side_ptr(), libMesh::Elem::default_order(), libMesh::Elem::dim(), and libMesh::TOLERANCE.

Referenced by SideVertexAverageNormalTest::testEdge2(), and SideVertexAverageNormalTest::testEdge3().

◆ sides_on_edge()

virtual std::vector< unsigned int > libMesh::Edge::sides_on_edge ( const unsigned int  ) const
inlinefinaloverridevirtual
Returns
the (local) side numbers that touch the specified edge

Implements libMesh::Elem.

Definition at line 206 of file edge.h.

207 { return {}; }

◆ simple_build_edge_ptr() [1/2]

template<typename Edgeclass , typename Subclass >
std::unique_ptr< Elem > libMesh::Elem::simple_build_edge_ptr ( const unsigned int  i)
inlineprotectedinherited

An implementation for simple (all edges equal) elements.

Definition at line 3004 of file elem.h.

3005{
3006 libmesh_assert_less (i, this->n_edges());
3007
3008 std::unique_ptr<Elem> edge = std::make_unique<Edgeclass>();
3009
3010 for (auto n : edge->node_index_range())
3011 edge->set_node(n, this->node_ptr(Subclass::edge_nodes_map[i][n]));
3012
3013 edge->set_interior_parent(this);
3014 edge->inherit_data_from(*this);
3015
3016 return edge;
3017}
virtual Node *& set_node(const unsigned int i)
Definition elem.h:2688

References libMesh::Elem::n_edges().

◆ simple_build_edge_ptr() [2/2]

template<typename Subclass >
void libMesh::Elem::simple_build_edge_ptr ( std::unique_ptr< Elem > &  edge,
const unsigned int  i,
ElemType  edgetype 
)
inlineprotectedinherited

An implementation for simple (all edges equal) elements.

Definition at line 3025 of file elem.h.

3028{
3029 libmesh_assert_less (i, this->n_edges());
3030
3031 if (!edge.get() || edge->type() != edgetype)
3032 {
3033 Subclass & real_me = cast_ref<Subclass&>(*this);
3034 edge = real_me.Subclass::build_edge_ptr(i);
3035 }
3036 else
3037 {
3038 edge->inherit_data_from(*this);
3039 for (auto n : edge->node_index_range())
3040 edge->set_node(n, this->node_ptr(Subclass::edge_nodes_map[i][n]));
3041 }
3042}

References libMesh::Elem::n_edges().

◆ simple_build_side_ptr() [1/2]

template<typename Sideclass , typename Subclass >
std::unique_ptr< Elem > libMesh::Elem::simple_build_side_ptr ( const unsigned int  i)
inlineprotectedinherited

An implementation for simple (all sides equal) elements.

Definition at line 2910 of file elem.h.

2911{
2912 libmesh_assert_less (i, this->n_sides());
2913
2914 std::unique_ptr<Elem> face = std::make_unique<Sideclass>();
2915 for (auto n : face->node_index_range())
2916 face->set_node(n, this->node_ptr(Subclass::side_nodes_map[i][n]));
2917
2918 face->set_interior_parent(this);
2919 face->inherit_data_from(*this);
2920
2921 return face;
2922}

References libMesh::Elem::n_sides().

◆ simple_build_side_ptr() [2/2]

template<typename Subclass >
void libMesh::Elem::simple_build_side_ptr ( std::unique_ptr< Elem > &  side,
const unsigned int  i,
ElemType  sidetype 
)
inlineprotectedinherited

An implementation for simple (all sides equal) elements.

Definition at line 2929 of file elem.h.

2932{
2933 libmesh_assert_less (i, this->n_sides());
2934
2935 if (!side.get() || side->type() != sidetype)
2936 {
2937 Subclass & real_me = cast_ref<Subclass&>(*this);
2938 side = real_me.Subclass::build_side_ptr(i);
2939 }
2940 else
2941 {
2942 side->set_interior_parent(this);
2943 side->inherit_data_from(*this);
2944 for (auto n : side->node_index_range())
2945 side->set_node(n, this->node_ptr(Subclass::side_nodes_map[i][n]));
2946 }
2947}

References libMesh::Elem::n_sides().

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

2957{
2958 libmesh_assert_less (i, this->n_sides());
2959
2960 if (!side.get() || side->type() != sidetype)
2961 {
2962 Subclass & real_me = cast_ref<Subclass&>(*this);
2963 side = real_me.Subclass::side_ptr(i);
2964 }
2965 else
2966 {
2967 side->subdomain_id() = this->subdomain_id();
2968
2969 for (auto n : side->node_index_range())
2970 side->set_node(n, this->node_ptr(Mapclass::side_nodes_map[i][n]));
2971 }
2972}

References libMesh::Elem::n_sides(), 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 1263 of file dof_object.h.

1264{
1266
1267 unsigned int n_sys = this->n_systems();
1268
1269 libmesh_assert_less(this->n_systems(), _idx_buf.size());
1270 return n_sys ? cast_int<unsigned int>(_idx_buf[this->n_systems()]) :
1271 (n_sys+1);
1272}

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

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

2721{
2722 return _sbd_id;
2723}
subdomain_id_type _sbd_id
The subdomain to which this element belongs.
Definition elem.h:2397

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

2713{
2714 return _sbd_id;
2715}

References libMesh::Elem::_sbd_id.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::SyncSubdomainIds::act_on_data(), LinearElasticityWithContact::add_contact_edge_elements(), libMesh::BoundaryInfo::add_elements(), libMesh::MeshTools::Modification::all_tri(), AllSecondOrderTest::allCompleteOrderRange(), AllSecondOrderTest::allSecondOrderRange(), libMesh::AbaqusIO::assign_subdomain_ids(), ExodusC0PolyhedronTest::build_c0polyhedron(), libMesh::EquationSystems::build_discontinuous_solution_vector(), MixedDimensionMeshTest::build_mesh(), MixedDimensionNonUniformRefinement::build_mesh(), MixedDimensionNonUniformRefinementTriangle::build_mesh(), MixedDimensionNonUniformRefinement3D::build_mesh(), ExodusC0PolygonTest::build_pentagon(), OverlappingTestBase::build_quad_mesh(), libMesh::BoundaryInfo::build_side_list_from_node_list(), libMesh::InfQuad6::build_side_ptr(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), libMesh::TriangleWrapper::copy_tri_to_mesh(), libMesh::DofMap::dof_indices(), libMesh::DofMap::dof_indices(), libMesh::Elem::Elem(), libMesh::TetGenIO::element_in(), HilbertSystem::element_time_derivative(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::MeshTools::Modification::flatten(), libMesh::SyncSubdomainIds::gather_data(), libMesh::Elem::get_info(), libMesh::VariationalSmootherConstraint::get_neighbors_for_subdomain_constraint(), MeshExtruderTest::QueryElemSubdomainID::get_subdomain_for_layer(), libMesh::UNVIO::groups_in(), libMesh::Elem::inherit_data_from(), libMesh::MeshTools::Modification::interpolate_surface(), libMesh::DofMap::old_dof_indices(), libMesh::PointLocatorNanoflann::operator()(), libMesh::PointLocatorNanoflann::operator()(), libMesh::XdrIO::pack_element(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), libMesh::CheckpointIO::read_connectivity(), libMesh::DynaIO::read_mesh(), libMesh::GmshIO::read_mesh(), libMesh::Polygon::side_ptr(), libMesh::Pyramid::side_ptr(), libMesh::InfHex::side_ptr(), libMesh::InfPrism::side_ptr(), libMesh::Prism::side_ptr(), libMesh::InfQuad::side_ptr(), libMesh::Elem::simple_side_ptr(), BoundaryInfoTest::testBuildSideListFromNodeListThinMesh(), SystemsTest::testDofCouplingWithVarGroups(), MeshExtruderTest::testExtruder(), MeshBaseTest::testMeshBaseVerifyHasCachedElemData(), SystemsTest::testSetSystemParameterOverEquationSystem(), SystemsTest::tripleValueTest(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_element_values_element_major(), and libMesh::ExodusII_IO_Helper::write_elements().

◆ supported_nodal_order()

virtual Order libMesh::Elem::supported_nodal_order ( ) const
inlinevirtualinherited
Returns
The maximum supported approximation order for nodal (Lagrange or Rational Bezier-Bernstein) variables on this element type. This is usually the same as the default order.

Reimplemented in libMesh::NodeElem.

Definition at line 1103 of file elem.h.

1103{ return default_order(); }

References libMesh::Elem::default_order().

Referenced by libMesh::MeshBase::copy_constraint_rows().

◆ swap2boundaryedges()

void libMesh::Elem::swap2boundaryedges ( unsigned short  e1,
unsigned short  e2,
BoundaryInfo *  boundary_info 
) const
protectedinherited

Swaps two edges in boundary_info, if it is non-null.

Definition at line 3998 of file elem.C.

4001{
4002 std::vector<boundary_id_type> ids1, ids2;
4003 boundary_info->edge_boundary_ids(this, e1, ids1);
4004 boundary_info->edge_boundary_ids(this, e2, ids2);
4005 boundary_info->remove_edge(this, e1);
4006 boundary_info->remove_edge(this, e2);
4007 if (!ids1.empty())
4008 boundary_info->add_edge(this, e2, ids1);
4009 if (!ids2.empty())
4010 boundary_info->add_edge(this, e1, ids2);
4011}

References libMesh::BoundaryInfo::add_edge(), libMesh::BoundaryInfo::edge_boundary_ids(), and libMesh::BoundaryInfo::remove_edge().

Referenced by libMesh::Hex20::flip(), libMesh::Hex27::flip(), libMesh::Hex8::flip(), libMesh::InfHex16::flip(), libMesh::InfHex18::flip(), libMesh::InfHex8::flip(), libMesh::InfPrism12::flip(), libMesh::InfPrism6::flip(), libMesh::Prism15::flip(), libMesh::Prism18::flip(), libMesh::Prism20::flip(), libMesh::Prism21::flip(), libMesh::Prism6::flip(), libMesh::Pyramid13::flip(), libMesh::Pyramid14::flip(), libMesh::Pyramid18::flip(), libMesh::Pyramid5::flip(), libMesh::Tet10::flip(), libMesh::Tet14::flip(), libMesh::Tet4::flip(), libMesh::InfQuad4::flip(), libMesh::InfQuad6::flip(), libMesh::Quad4::flip(), libMesh::Quad8::flip(), libMesh::Quad9::flip(), libMesh::Tri3::flip(), libMesh::Tri6::flip(), and libMesh::Tri7::flip().

◆ swap2boundarysides()

void libMesh::Elem::swap2boundarysides ( unsigned short  s1,
unsigned short  s2,
BoundaryInfo *  boundary_info 
) const
protectedinherited

Swaps two sides in boundary_info, if it is non-null.

Definition at line 3982 of file elem.C.

3985{
3986 std::vector<boundary_id_type> ids1, ids2;
3987 boundary_info->boundary_ids(this, s1, ids1);
3988 boundary_info->boundary_ids(this, s2, ids2);
3989 boundary_info->remove_side(this, s1);
3990 boundary_info->remove_side(this, s2);
3991 if (!ids1.empty())
3992 boundary_info->add_side(this, s2, ids1);
3993 if (!ids2.empty())
3994 boundary_info->add_side(this, s1, ids2);
3995}

References libMesh::BoundaryInfo::add_side(), libMesh::BoundaryInfo::boundary_ids(), and libMesh::BoundaryInfo::remove_side().

Referenced by libMesh::Hex20::flip(), libMesh::Hex27::flip(), libMesh::Hex8::flip(), libMesh::InfHex16::flip(), libMesh::InfHex18::flip(), libMesh::InfHex8::flip(), libMesh::InfPrism12::flip(), libMesh::InfPrism6::flip(), libMesh::Prism15::flip(), libMesh::Prism18::flip(), libMesh::Prism20::flip(), libMesh::Prism21::flip(), libMesh::Prism6::flip(), libMesh::Pyramid13::flip(), libMesh::Pyramid14::flip(), libMesh::Pyramid18::flip(), libMesh::Pyramid5::flip(), libMesh::Tet10::flip(), libMesh::Tet14::flip(), libMesh::Tet4::flip(), libMesh::Edge2::flip(), libMesh::Edge3::flip(), libMesh::Edge4::flip(), libMesh::InfQuad4::flip(), libMesh::InfQuad6::flip(), libMesh::Quad4::flip(), libMesh::Quad8::flip(), libMesh::Quad9::flip(), libMesh::Tri3::flip(), libMesh::Tri6::flip(), and libMesh::Tri7::flip().

◆ swap2neighbors()

void libMesh::Elem::swap2neighbors ( unsigned int  n1,
unsigned int  n2 
)
inlineprotectedinherited

◆ swap2nodes()

void libMesh::Elem::swap2nodes ( unsigned int  n1,
unsigned int  n2 
)
inlineprotectedinherited

◆ swap3neighbors()

void libMesh::Elem::swap3neighbors ( unsigned int  n1,
unsigned int  n2,
unsigned int  n3 
)
inlineprotectedinherited

◆ swap3nodes()

void libMesh::Elem::swap3nodes ( unsigned int  n1,
unsigned int  n2,
unsigned int  n3 
)
inlineprotectedinherited

◆ swap4neighbors()

void libMesh::Elem::swap4neighbors ( unsigned int  n1,
unsigned int  n2,
unsigned int  n3,
unsigned int  n4 
)
inlineprotectedinherited

◆ swap4nodes()

void libMesh::Elem::swap4nodes ( unsigned int  n1,
unsigned int  n2,
unsigned int  n3,
unsigned int  n4 
)
inlineprotectedinherited

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

1352{
1353 unsigned int accumulated_sum=0;
1354
1355 for (unsigned int vgc=0; vgc<vg; vgc++)
1356 accumulated_sum += this->n_vars(s,vgc);
1357
1358 libmesh_assert_less_equal (accumulated_sum, var);
1359
1360 return (var - accumulated_sum);
1361}

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

3195{
3196 const Elem * tp = this;
3197
3198 // Keep getting the element's parent
3199 // until that parent is at level-0
3200 while (tp->parent() != nullptr)
3201 tp = tp->parent();
3202
3203 libmesh_assert(tp);
3204 libmesh_assert_equal_to (tp->level(), 0);
3205
3206 return tp;
3207}

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

Referenced by 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_boundary_ids(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::BoundaryInfo::sides_with_boundary_id(), ExtraIntegersTest::test_final_integers(), and ElemTest< elem_type >::test_n_refinements().

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

1231{
1232 libmesh_assert_less (i, this->n_neighbors());
1233
1234 const Elem * neighbor_i = this->neighbor_ptr(i);
1235 if (neighbor_i != nullptr)
1236 return neighbor_i;
1237
1238 if (pb)
1239 {
1240 // Since the neighbor is nullptr it must be on a boundary. We need
1241 // see if this is a periodic boundary in which case it will have a
1242 // topological neighbor
1243 std::vector<boundary_id_type> bc_ids;
1244 mesh.get_boundary_info().boundary_ids(this, cast_int<unsigned short>(i), bc_ids);
1245 for (const auto & id : bc_ids)
1246 if (pb->boundary(id))
1247 {
1248 neighbor_i = pb->neighbor(id, point_locator, this, i);
1249
1250 // Since coarse elements do not have more refined
1251 // neighbors we need to make sure that we don't return one
1252 // of these types of neighbors.
1253 if (neighbor_i)
1254 while (level() < neighbor_i->level())
1255 neighbor_i = neighbor_i->parent();
1256 return neighbor_i;
1257 }
1258 }
1259
1260 return nullptr;
1261}

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()(), libMesh::GhostPointNeighbors::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 1185 of file elem.C.

1189{
1190 libmesh_assert_less (i, this->n_neighbors());
1191
1192 Elem * neighbor_i = this->neighbor_ptr(i);
1193 if (neighbor_i != nullptr)
1194 return neighbor_i;
1195
1196 if (pb)
1197 {
1198 // Since the neighbor is nullptr it must be on a boundary. We need
1199 // see if this is a periodic boundary in which case it will have a
1200 // topological neighbor
1201 std::vector<boundary_id_type> bc_ids;
1202 mesh.get_boundary_info().boundary_ids(this, cast_int<unsigned short>(i), bc_ids);
1203 for (const auto & id : bc_ids)
1204 if (pb->boundary(id))
1205 {
1206 // Since the point locator inside of periodic boundaries
1207 // returns a const pointer we will retrieve the proper
1208 // pointer directly from the mesh object.
1209 const Elem * const cn = pb->neighbor(id, point_locator, this, i);
1210 neighbor_i = const_cast<Elem *>(cn);
1211
1212 // Since coarse elements do not have more refined
1213 // neighbors we need to make sure that we don't return one
1214 // of these types of neighbors.
1215 if (neighbor_i)
1216 while (level() < neighbor_i->level())
1217 neighbor_i = neighbor_i->parent();
1218 return neighbor_i;
1219 }
1220 }
1221
1222 return nullptr;
1223}

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

◆ topologically_equal()

bool libMesh::Elem::topologically_equal ( const Elem &  rhs) const
inherited
Returns
true if two elements have equal topologies, false otherwise. This is true if the elements connect to nodes of the same id in the same order, and neighbors of the same id on each side, the same id on any parent and/or interior_parent link, etc.

Definition at line 728 of file elem.C.

729{
730 // If the elements aren't the same type, they aren't equal
731 if (this->type() != rhs.type())
732 return false;
733
734 libmesh_assert_equal_to(this->n_nodes(), rhs.n_nodes());
735
736 for (auto n : make_range(this->n_nodes()))
737 if (this->node_id(n) != rhs.node_id(n))
738 return false;
739
740 for (auto neigh : make_range(this->n_neighbors()))
741 {
742 if (!this->neighbor_ptr(neigh))
743 {
744 if (rhs.neighbor_ptr(neigh))
745 return false;
746 continue;
747 }
748 if (!rhs.neighbor_ptr(neigh) ||
749 this->neighbor_ptr(neigh)->id() !=
750 rhs.neighbor_ptr(neigh)->id())
751 return false;
752 }
753
754 if (this->parent())
755 {
756 if (!rhs.parent())
757 return false;
758 if (this->parent()->id() != rhs.parent()->id())
759 return false;
760 }
761 else if (rhs.parent())
762 return false;
763
764 if (this->interior_parent())
765 {
766 if (!rhs.interior_parent())
767 return false;
768 if (this->interior_parent()->id() !=
769 rhs.interior_parent()->id())
770 return false;
771 }
772 else if (rhs.interior_parent())
773 return false;
774
775 return true;
776}
const Elem * interior_parent() const
Definition elem.C:1100

References libMesh::DofObject::id(), libMesh::Elem::interior_parent(), libMesh::make_range(), libMesh::Elem::n_neighbors(), libMesh::Elem::n_nodes(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_id(), libMesh::Elem::parent(), and libMesh::Elem::type().

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

2230{
2231 ElemInternal::total_family_tree(this, family, reset);
2232}
void total_family_tree(T elem, std::vector< T > &family, bool reset)

References libMesh::ElemInternal::total_family_tree().

Referenced by 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 2236 of file elem.C.

2238{
2239 ElemInternal::total_family_tree(this, family, reset);
2240}

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

2335{
2336 ElemInternal::total_family_tree_by_neighbor(this, family, neighbor, reset);
2337}
void total_family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)

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

2344{
2345 ElemInternal::total_family_tree_by_neighbor(this, family, neighbor, reset);
2346}

References libMesh::ElemInternal::total_family_tree_by_neighbor().

◆ total_family_tree_by_side() [1/2]

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

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

Definition at line 2278 of file elem.C.

2281{
2282 ElemInternal::total_family_tree_by_side(this, family, side, reset);
2283}
void total_family_tree_by_side(T elem, std::vector< T > &family, unsigned int s, bool reset)

References libMesh::ElemInternal::total_family_tree_by_side().

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

◆ total_family_tree_by_side() [2/2]

void libMesh::Elem::total_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 2287 of file elem.C.

2290{
2291 ElemInternal::total_family_tree_by_side(this, family, side, reset);
2292}

References libMesh::ElemInternal::total_family_tree_by_side().

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

2374{
2375 ElemInternal::total_family_tree_by_subneighbor(this, family, neighbor, subneighbor, reset);
2376}
void total_family_tree_by_subneighbor(T elem, std::vector< T > &family, T neighbor_in, T subneighbor, bool reset=true)

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

2384{
2385 ElemInternal::total_family_tree_by_subneighbor(this, family, neighbor, subneighbor, reset);
2386}

References libMesh::ElemInternal::total_family_tree_by_subneighbor().

◆ true_centroid()

Point libMesh::Elem::true_centroid ( ) const
virtualinherited
Returns
The "true" geometric centroid of the element, c=(cx, cy, cz), where:

[cx] [\int x dV] [cy] := (1/V) * [\int y dV] [cz] [\int z dV]

This method is virtual since some derived elements might want to use shortcuts to compute their centroid. For most element types, this method is more expensive than calling vertex_average(), so if you only need a point which is located "somewhere" in the interior of the element, consider calling vertex_average() instead.

Reimplemented in libMesh::C0Polyhedron, libMesh::Hex8, libMesh::Prism6, libMesh::Pyramid5, libMesh::Tet4, libMesh::Edge2, libMesh::C0Polygon, libMesh::Quad4, and libMesh::Tri3.

Definition at line 515 of file elem.C.

516{
517 // The base class implementation builds a finite element of the correct
518 // order and computes the centroid, c=(cx, cy, cz), where:
519 //
520 // [cx] [\int x dV]
521 // [cy] := (1/V) * [\int y dV]
522 // [cz] [\int z dV]
523 //
524 // using quadrature. Note that we can expand "x" in the FE space as:
525 //
526 // x = \sum_i x_i \phi_i
527 //
528 // where x_i are the nodal positions of the element and \phi_i are the
529 // associated Lagrange shape functions. This allows us to write the
530 // integrals above as e.g.:
531 //
532 // \int x dV = \sum_i x_i \int \phi_i dV
533 //
534 // Defining:
535 //
536 // V_i := \int \phi_i dV
537 //
538 // we then have:
539 //
540 // [cx] [\sum_i x_i V_i]
541 // [cy] = (1/V) * [\sum_i y_i V_i]
542 // [cz] [\sum_i z_i V_i]
543 //
544 // where:
545 // V = \sum_i V_i
546 //
547 // Derived element types can overload this method to compute
548 // the centroid more efficiently when possible.
549
550 // If this Elem has an elevated p_level, then we need to generate a
551 // barebones copy of it with zero p_level and call true_centroid()
552 // on that instead. This workaround allows us to avoid issues with
553 // calling FE::reinit() with a default_order() FEType, and then
554 // having that order incorrectly boosted by p_level.
555 if (this->p_level())
556 {
557 auto elem_copy = this->disconnected_clone();
558#ifdef LIBMESH_ENABLE_AMR
559 elem_copy->set_p_level(0);
560#endif
561
562 // Set node pointers
563 for (auto n : this->node_index_range())
564 elem_copy->set_node(n, _nodes[n]);
565
566 return elem_copy->true_centroid();
567 }
568
569 const FEFamily mapping_family = FEMap::map_fe_type(*this);
570 const FEType fe_type(this->default_order(), mapping_family);
571
572 // Build FE and attach quadrature rule. The default quadrature rule
573 // integrates the mass matrix exactly, thus it is overkill to
574 // integrate the basis functions, but this is convenient.
575 std::unique_ptr<FEBase> fe = FEBase::build(this->dim(), fe_type);
576 QGauss qrule (this->dim(), fe_type.default_quadrature_order());
577 fe->attach_quadrature_rule(&qrule);
578
579 // Pre-request required data
580 const auto & JxW = fe->get_JxW();
581 const auto & phi = fe->get_phi();
582
583 // Re-compute element-specific values
584 fe->reinit(this);
585
586 // Number of basis functions
587 auto N = phi.size();
588 libmesh_assert_equal_to(N, this->n_nodes());
589
590 // Compute V_i
591 std::vector<Real> V(N);
592 for (auto qp : index_range(JxW))
593 for (auto i : make_range(N))
594 V[i] += JxW[qp] * phi[i][qp];
595
596 // Compute centroid
597 Point cp;
598 Real vol = 0.;
599
600 for (auto i : make_range(N))
601 {
602 cp += this->point(i) * V[i];
603 vol += V[i];
604 }
605
606 return cp / vol;
607}
virtual std::unique_ptr< Elem > disconnected_clone() const
Definition elem.C:350
static FEFamily map_fe_type(const Elem &elem)
Definition fe_map.C:46

References libMesh::Elem::_nodes, libMesh::FEGenericBase< OutputType >::build(), libMesh::Elem::default_order(), libMesh::FEType::default_quadrature_order(), libMesh::Elem::dim(), libMesh::Elem::disconnected_clone(), libMesh::index_range(), libMesh::make_range(), libMesh::FEMap::map_fe_type(), libMesh::Elem::n_nodes(), libMesh::Elem::node_index_range(), libMesh::Elem::p_level(), libMesh::Elem::point(), and libMesh::Real.

Referenced by assemble_advection_diffusion(), centroid_l2_error(), VolumeTest::testHex20PLevelTrueCentroid(), VolumeTest::testPyramid5TrueCentroid(), VolumeTest::testQuad4TrueCentroid(), VolumeTest::testTri3TrueCentroid(), and libMesh::C0Polyhedron::true_centroid().

◆ type()

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

Implemented in libMesh::Hex20, libMesh::Hex27, libMesh::Hex8, libMesh::InfHex16, libMesh::InfHex18, libMesh::InfHex8, libMesh::InfPrism12, libMesh::InfPrism6, libMesh::Prism15, libMesh::Prism18, libMesh::Prism20, libMesh::Prism21, libMesh::Prism6, libMesh::Pyramid13, libMesh::Pyramid14, libMesh::Pyramid18, libMesh::Pyramid5, libMesh::Tet10, libMesh::Tet14, libMesh::Tet4, libMesh::Edge2, libMesh::Edge3, libMesh::Edge4, libMesh::InfEdge2, libMesh::InfQuad4, libMesh::InfQuad6, libMesh::Quad4, libMesh::QuadShell4, libMesh::Quad8, libMesh::QuadShell8, libMesh::Quad9, libMesh::QuadShell9, libMesh::Tri3, libMesh::TriShell3, libMesh::Tri3Subdivision, libMesh::Tri6, libMesh::Tri7, libMesh::NodeElem, libMesh::RemoteElem, libMesh::C0Polyhedron, and libMesh::C0Polygon.

Referenced by libMesh::PostscriptIO::_compute_edge_bezier_coeffs(), libMesh::DofMap::_dof_indices(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::MeshTools::Modification::all_rbb(), libMesh::FE< Dim, T >::all_shape_derivs(), libMesh::FEInterface::all_shape_derivs(), libMesh::FEInterface::all_shapes(), libMesh::MeshTools::Modification::all_tri(), AllSecondOrderTest::allCompleteOrderMixed(), AllSecondOrderTest::allCompleteOrderRange(), AllSecondOrderTest::allSecondOrderMixed(), AllSecondOrderTest::allSecondOrderRange(), assemble_matrix_and_rhs(), libMesh::AbaqusIO::assign_sideset_ids(), libMesh::AbaqusIO::assign_subdomain_ids(), libMesh::Elem::bracketing_nodes(), libMesh::Elem::build(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::Elem::build_with_id(), libMesh::MeshTetInterface::check_hull_integrity(), MeshInputTest::checkHexPrismPolyhedron(), libMesh::MeshTools::clear_spline_nodes(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), libMesh::FEInterface::compute_data(), libMesh::FEMap::compute_map(), libMesh::InfFE< Dim, T_radial, T_map >::compute_shape_functions(), libMesh::InfFE< Dim, T_radial, T_map >::compute_shape_indices(), libMesh::MeshTetInterface::delete_2D_hull_elements(), libMesh::Elem::disconnected_clone(), libMesh::DofMap::dof_indices(), libMesh::DofMap::dof_indices(), libMesh::FE< Dim, T >::edge_map(), libMesh::FE< Dim, T >::edge_reinit(), libMesh::VariationalSmootherSystem::element_time_derivative(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::MeshTools::Modification::flatten(), libMesh::DTKAdapter::get_element_topology(), libMesh::Elem::get_info(), libMesh::MeshBase::get_info(), libMesh::ExodusII_IO_Helper::get_sideset_data_indices(), libMesh::QBase::init(), libMesh::QBase::init(), libMesh::QGauss::init_2D(), libMesh::QNodal::init_2D(), libMesh::QGauss::init_3D(), libMesh::QNodal::init_3D(), libMesh::FE< Dim, T >::init_base_shape_functions(), libMesh::FESubdivision::init_shape_functions(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::Poly2TriTriangulator::insert_refinement_points(), libMesh::FEInterface::inverse_map(), libMesh::FEInterface::inverse_map(), libMesh::l2_lagrange_gll_n_dofs(), libMesh::l2_lagrange_gll_nodal_soln(), libMesh::lagrange_nodal_soln(), libMesh::LIBMESH_DEFAULT_VECTORIZED_FE(), libMesh::LIBMESH_DEFAULT_VECTORIZED_FE(), libMesh::LIBMESH_DEFAULT_VECTORIZED_FE(), libMesh::LIBMESH_DEFAULT_VECTORIZED_FE(), libMesh::LIBMESH_DEFAULT_VECTORIZED_FE(), libMesh::LIBMESH_DEFAULT_VECTORIZED_FE(), libMesh::FEInterface::map(), libMesh::monomial_n_dofs(), libMesh::InfFEBase::n_base_mapping_sf(), libMesh::FE< Dim, T >::n_dofs(), libMesh::FEInterface::n_dofs(), libMesh::FEInterface::n_dofs(), libMesh::FEInterface::n_dofs_at_node(), libMesh::FEInterface::n_dofs_at_node(), libMesh::InfFE< Dim, T_radial, T_map >::n_dofs_at_node(), libMesh::FEInterface::n_dofs_per_elem(), libMesh::FEInterface::n_dofs_per_elem(), libMesh::FEInterface::n_shape_functions(), libMesh::FEInterface::n_shape_functions(), libMesh::FE< Dim, T >::nodal_soln(), libMesh::FEInterface::nodal_soln(), libMesh::DofMap::old_dof_indices(), libMesh::Elem::operator==(), libMesh::XdrIO::pack_element(), libMesh::Elem::parent_bracketing_nodes(), MeshGenerationTest::polyhedronTetNeighbor(), libMesh::RBParametrizedFunction::preevaluate_parametrized_function_on_mesh(), libMesh::Elem::quality(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::ExodusII_IO_Helper::read_sideset_data(), libMesh::Elem::reference_elem(), libMesh::Elem::refine(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::FE< Dim, T >::reinit(), libMesh::InfFE< Dim, T_radial, T_map >::reinit(), libMesh::FE< Dim, T >::reinit(), libMesh::FEXYZ< Dim >::reinit(), libMesh::InfFE< Dim, T_radial, T_map >::reinit(), libMesh::FE< Dim, T >::reinit_dual_shape_coeffs(), libMesh::Elem::set_mapping_type(), libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape(), libMesh::FEInterface::shape(), libMesh::FEInterface::shape(), libMesh::FEInterface::shape(), libMesh::FEInterface::shape(), libMesh::FEInterface::shape(), libMesh::FEInterface::shape(), libMesh::FE< Dim, T >::shape(), libMesh::FEInterface::shape(), libMesh::FEInterface::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FEInterface::shape_deriv(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FEInterface::shape_deriv_function(), libMesh::FEInterface::shape_function(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::FEInterface::shape_second_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::FEInterface::shape_second_deriv_function(), libMesh::FEInterface::shapes(), libMesh::FE< Dim, T >::side_map(), libMesh::FEInterface::side_nodal_soln(), ExodusC0PolyhedronTest::test_write_and_read_hexagonal_prism(), ExodusC0PolygonTest::test_write_and_read_pentagon(), CheckpointIOTest::testC0PolygonCheckpoint(), VolumeTest::testC0PolygonMethods(), CheckpointIOTest::testC0PolyhedronCheckpoint(), VolumeTest::testC0PolyhedronMethods(), FETest< order, family, elem_type, CaseName >::testRefspaceNodes(), libMesh::Elem::topologically_equal(), libMesh::Tri3Subdivision::Tri3Subdivision(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO_Helper::write_sideset_data(), libMesh::ExodusII_IO_Helper::write_sidesets(), and libMesh::Nemesis_IO_Helper::write_sidesets().

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

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

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

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

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

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

References libMesh::DofObject::unpackable_indexing_size().

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

◆ valid_id()

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

◆ valid_processor_id()

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

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

1333{
1334 const unsigned int
1335 nvg = this->n_var_groups(s);
1336
1337 for (unsigned int vg=0, vg_end=0; vg<nvg; vg++)
1338 {
1339 vg_end += this->n_vars(s,vg);
1340 if (var < vg_end) return vg;
1341 }
1342
1343 libmesh_error_msg("Error: could not map variable " << var << " to variable group.");
1344}

References libMesh::DofObject::n_var_groups(), and 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 1190 of file dof_object.h.

1192{
1193 std::pair<unsigned int, unsigned int> returnval(0,0);
1194
1195 unsigned int & vg = returnval.first;
1196 unsigned int & offset = returnval.second;
1197
1198 unsigned int vg_start = 0;
1199 for (; ; vg++)
1200 {
1201 libmesh_assert_less(vg, this->n_var_groups(s));
1202
1203 const unsigned int vg_end = vg_start + this->n_vars(s,vg);
1204 if (var < vg_end)
1205 {
1206 offset = var - vg_start;
1207 return returnval;
1208 }
1209 vg_start = vg_end;
1210 }
1211}

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

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::DofObject::dof_number(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), and libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs().

◆ vertex_average()

Point libMesh::Elem::vertex_average ( ) const
inherited
Returns
A Point at the average of the elment's vertices.
Note
This used to be the base class centroid() implementation, but the centroid is only equal to the vertex average in some special cases. The centroid() implementation now returns the "true" centroid of the element (up to quadrature error).

Definition at line 609 of file elem.C.

610{
611 Point cp;
612
613 const auto n_vertices = this->n_vertices();
614
615 for (unsigned int n=0; n<n_vertices; n++)
616 cp.add (this->point(n));
617
618 return (cp /= static_cast<Real>(n_vertices));
619}

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

Referenced by libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::Poly2TriTriangulator::insert_refinement_points(), OutputAssembly::interior_assembly(), A0::interior_assembly(), A1::interior_assembly(), SlitFunc::operator()(), libMesh::LocationMap< T >::point_of(), libMesh::RBParametrizedFunction::preevaluate_parametrized_function_on_mesh(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::C0Polyhedron::retriangulate(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), HDivGradTest::testGradByFiniteDifference(), libMesh::Tet4::true_centroid(), and libMesh::Tri3::true_centroid().

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

1309{
1310 libmesh_assert_less (s, this->n_systems());
1311 libmesh_assert_less (vg, this->n_var_groups(s));
1312
1313 const unsigned int
1314 start_idx_sys = this->start_idx(s);
1315
1316 libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1317
1318 // #ifdef DEBUG
1319 // std::cout << " [ ";
1320 // for (auto i : _idx_buf)
1321 // std::cout << i << " ";
1322 // std::cout << "]\n";
1323 // #endif
1324
1325 return _idx_buf[start_idx_sys + 2*vg + 1];
1326}

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::set_nonlocal_dof_objects(), libMesh::DofObject::set_vg_dof_base(), and DofObjectTest< DerivedClass >::testManualDofCalculation().

◆ volume()

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

If the element is twisted or inverted such that the mapping Jacobian is singular at any point, implementations of this method may return a "net" volume or may simply return NaN.

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

Definition at line 3865 of file elem.C.

3866{
3867 // The default implementation builds a finite element of the correct
3868 // order and sums up the JxW contributions. This can be expensive,
3869 // so the various element types can overload this method and compute
3870 // the volume more efficiently.
3871 const FEFamily mapping_family = FEMap::map_fe_type(*this);
3872 const FEType fe_type(this->default_order(), mapping_family);
3873
3874 std::unique_ptr<FEBase> fe (FEBase::build(this->dim(),
3875 fe_type));
3876
3877 // Use a map with a negative Jacobian tolerance, in case we're asked
3878 // for the net volume of a tangled element
3879 fe->get_fe_map().set_jacobian_tolerance(std::numeric_limits<Real>::lowest());
3880
3881 const std::vector<Real> & JxW = fe->get_JxW();
3882
3883 // The default quadrature rule should integrate the mass matrix,
3884 // thus it should be plenty to compute the area
3885 QGauss qrule (this->dim(), fe_type.default_quadrature_order());
3886
3887 fe->attach_quadrature_rule(&qrule);
3888
3889 fe->reinit(this);
3890
3891 Real vol=0.;
3892 for (auto jxw : JxW)
3893 vol += jxw;
3894
3895 return vol;
3896
3897}

References libMesh::FEGenericBase< OutputType >::build(), libMesh::Elem::default_order(), libMesh::FEType::default_quadrature_order(), libMesh::Elem::dim(), libMesh::FEMap::map_fe_type(), and libMesh::Real.

Referenced by assemble_advection_diffusion(), assemble_ellipticdg(), centroid_l2_error(), libMesh::MeshTetInterface::check_hull_integrity(), MeshInputTest::checkHexPrismPolyhedron(), libMesh::Elem::get_info(), libMesh::MeshBase::get_info(), libMesh::QNodal::init_3D(), libMesh::Elem::quality(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::Poly2TriTriangulator::should_refine_elem(), libMesh::SimplexRefiner::should_refine_elem(), VolumeTest::testC0Polygon(), VolumeTest::testElemVolume(), MeshInputTest::testTetgenIO(), VolumeTest::testTwistedVolume(), libMesh::C0Polyhedron::volume(), libMesh::Hex20::volume(), libMesh::Hex27::volume(), libMesh::Hex8::volume(), libMesh::Prism15::volume(), libMesh::Prism18::volume(), libMesh::Prism6::volume(), libMesh::Pyramid13::volume(), libMesh::Pyramid14::volume(), libMesh::Pyramid5::volume(), libMesh::Tet10::volume(), libMesh::Edge3::volume(), libMesh::Edge4::volume(), libMesh::Quad4::volume(), libMesh::Quad8::volume(), libMesh::Quad9::volume(), and libMesh::Tri6::volume().

◆ which_child_am_i()

unsigned int libMesh::Elem::which_child_am_i ( const Elem *  e) const
inlineinherited

◆ which_neighbor_am_i()

unsigned int libMesh::Elem::which_neighbor_am_i ( const Elem *  e) const
inlineinherited

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

796{
798
799 const unsigned int ns = this->n_sides();
800 const unsigned int nn = this->n_nodes();
801
802 const unsigned int en = e->n_nodes();
803
804 // e might be on any side until proven otherwise
805 std::vector<bool> might_be_side(ns, true);
806
807 for (unsigned int i=0; i != en; ++i)
808 {
809 Point side_point = e->point(i);
810 unsigned int local_node_id = libMesh::invalid_uint;
811
812 // Look for a node of this that's contiguous with node i of
813 // e. Note that the exact floating point comparison of Point
814 // positions is intentional, see the class documentation for
815 // this function.
816 for (unsigned int j=0; j != nn; ++j)
817 if (this->point(j) == side_point)
818 local_node_id = j;
819
820 // If a node of e isn't contiguous with some node of this, then
821 // e isn't a side of this.
822 if (local_node_id == libMesh::invalid_uint)
824
825 // If a node of e isn't contiguous with some node on side s of
826 // this, then e isn't on side s.
827 for (unsigned int s=0; s != ns; ++s)
828 if (!this->is_node_on_side(local_node_id, s))
829 might_be_side[s] = false;
830 }
831
832 for (unsigned int s=0; s != ns; ++s)
833 if (might_be_side[s])
834 {
835#ifdef DEBUG
836 for (unsigned int s2=s+1; s2 < ns; ++s2)
837 libmesh_assert (!might_be_side[s2]);
838#endif
839 return s;
840 }
841
842 // Didn't find any matching side
844}

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

1682{
1683 libmesh_assert (out_stream.good());
1685 libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
1686
1687 switch (iop)
1688 {
1689 case TECPLOT:
1690 {
1691 // This connectivity vector will be used repeatedly instead
1692 // of being reconstructed inside the loop.
1693 std::vector<dof_id_type> conn;
1694 for (auto sc : make_range(this->n_sub_elem()))
1695 {
1696 this->connectivity(sc, TECPLOT, conn);
1697
1698 std::copy(conn.begin(),
1699 conn.end(),
1700 std::ostream_iterator<dof_id_type>(out_stream, " "));
1701
1702 out_stream << '\n';
1703 }
1704 return;
1705 }
1706
1707 case UCD:
1708 {
1709 for (auto i : this->node_index_range())
1710 out_stream << this->node_id(i)+1 << "\t";
1711
1712 out_stream << '\n';
1713 return;
1714 }
1715
1716 default:
1717 libmesh_error_msg("Unsupported IO package " << iop);
1718 }
1719}
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const =0
virtual unsigned int n_sub_elem() const =0

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

Member Data Documentation

◆ _children

std::unique_ptr<Elem *[]> libMesh::Elem::_children
protectedinherited

unique_ptr to array of this element's children.

A Mesh ultimately owns the child Elems so we are not responsible for deleting them, but we are responsible for cleaning up the array allocated to hold those Elems, hence the unique_ptr.

Definition at line 2391 of file elem.h.

Referenced by libMesh::Elem::add_child(), libMesh::Elem::add_child(), libMesh::Elem::child_ptr(), libMesh::Elem::child_ptr(), libMesh::Elem::child_ref_range(), libMesh::Elem::child_ref_range(), libMesh::Elem::contract(), libMesh::Elem::has_ancestor_children(), libMesh::Elem::has_children(), libMesh::Elem::raw_child_ptr(), libMesh::Elem::refine(), and libMesh::Elem::set_child().

◆ _counts [1/2]

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

Actually holds the data.

Definition at line 124 of file reference_counter.h.

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

◆ _counts [2/2]

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

Actually holds the data.

Definition at line 124 of file reference_counter.h.

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

◆ _elemlinks

Elem** libMesh::Elem::_elemlinks
protectedinherited

◆ _elemlinks_data

Elem* libMesh::Edge::_elemlinks_data[3+(LIBMESH_DIM >1)]
protected

Data for links to parent/neighbor/interior_parent elements.

Definition at line 247 of file edge.h.

◆ _enable_print_counter [1/2]

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 143 of file reference_counter.h.

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

◆ _enable_print_counter [2/2]

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 143 of file reference_counter.h.

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

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

Referenced by libMesh::Elem::Elem(), libMesh::Elem::mapping_data(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), and libMesh::Elem::set_mapping_data().

◆ _map_type

unsigned char libMesh::Elem::_map_type
protectedinherited

Mapping function type; currently either 0 (LAGRANGE) or 1 (RATIONAL_BERNSTEIN).

Definition at line 2427 of file elem.h.

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

◆ _mutex [1/2]

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

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 137 of file reference_counter.h.

◆ _mutex [2/2]

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

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 137 of file reference_counter.h.

◆ _n_objects [1/2]

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

◆ _n_objects [2/2]

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

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

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

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

Referenced by libMesh::DofObject::operator=(), libMesh::DofObject::processor_id(), 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 2404 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 2397 of file elem.h.

Referenced by libMesh::Elem::subdomain_id(), and 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 568 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().

◆ affine_tol

constexpr Real libMesh::Elem::affine_tol = TOLERANCE*TOLERANCE
staticconstexprprotectedinherited

◆ invalid_id

constexpr dof_id_type libMesh::DofObject::invalid_id = static_cast<dof_id_type>(-1)
staticconstexprinherited

An invalid id to distinguish an uninitialized DofObject.

Definition at line 473 of file dof_object.h.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::Node::active(), libMesh::MeshBase::add_elem_datum(), libMesh::MeshBase::add_elem_integers(), libMesh::DofObject::add_extra_integers(), libMesh::StaticCondensation::add_matrix(), libMesh::TopologyMap::add_node(), libMesh::MeshRefinement::add_node(), libMesh::MeshBase::add_node_datum(), libMesh::MeshBase::add_node_integers(), libMesh::ReplicatedMesh::add_point(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Elem::bracketing_nodes(), ExtraIntegersTest::checkpoint_helper(), libMesh::StaticCondensation::clear(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), libMesh::DofObject::dof_number(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_nodes(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_sides(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::TopologyMap::find(), libMesh::TopologyMap::find(), libMesh::DofMap::gather_constraints(), libMesh::MeshBase::get_elemset_code(), libMesh::Poly2TriTriangulator::insert_refinement_points(), libMesh::Elem::interior_parent(), libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::invalidate_id(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::Node::Node(), libMesh::Elem::node_id(), libMesh::DistributedMesh::own_node(), libMesh::XdrIO::pack_element(), libMesh::SFCPartitioner::partition_range(), libMesh::Elem::point(), libMesh::ExodusII_IO::read(), libMesh::DynaIO::read_mesh(), libMesh::System::read_parallel_data(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::StaticCondensationDofMap::reinit(), 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< DerivedClass >::testAddExtraData(), DofObjectTest< DerivedClass >::testAddSystemExtraInts(), ExtraIntegersTest::testExtraIntegersExodusReading(), InfFERadialTest::testRefinement(), DofObjectTest< DerivedClass >::testSetNSystemsExtraInts(), DofObjectTest< DerivedClass >::testSetNVariableGroupsExtraInts(), MeshTetTest::testTetInterfaceBase(), DofObjectTest< DerivedClass >::testValidId(), MeshSmootherTest::testVariationalSmoother(), WriteElemsetData::testWriteImpl(), libMesh::NetGenMeshInterface::triangulate(), libMesh::Poly2TriTriangulator::triangulate_current_points(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DofObject::valid_id(), libMesh::System::write_parallel_data(), and libMesh::XdrIO::write_serialized_connectivity().

◆ invalid_processor_id

constexpr processor_id_type libMesh::DofObject::invalid_processor_id = static_cast<processor_id_type>(-1)
staticconstexprinherited

An invalid processor_id to distinguish DoFs that have not been assigned to a processor.

Definition at line 484 of file dof_object.h.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::MeshRefinement::add_node(), libMesh::DistributedMesh::add_node(), libMesh::MeshCommunication::allgather(), libMesh::Node::choose_processor_id(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubProjector::construct_projection(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshBase::count_constraint_rows(), libMesh::MeshTools::create_bounding_box(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::Elem::Elem(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::MeshCommunication::find_global_indices(), libMesh::MeshBase::get_info(), libMesh::DistributedMesh::insert_elem(), libMesh::DofObject::invalidate_processor_id(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshBase::n_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), libMesh::MeshBase::n_unpartitioned_elem(), libMesh::MeshBase::n_unpartitioned_nodes(), libMesh::SparsityPattern::Build::operator()(), libMesh::Partitioner::processor_pairs_to_interface_nodes(), libMesh::Nemesis_IO_Helper::read_var_names_impl(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DistributedMesh::renumber_nodes_and_elements(), OverlappingFunctorTest::run_coupling_functor_test(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::send_and_insert_dof_values(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_dofobject_data_by_xyz(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id_once(), DofObjectTest< DerivedClass >::testValidProcId(), libMesh::MeshTools::total_weight(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::DofObject::valid_processor_id(), and libMesh::CheckpointIO::write().

◆ invalid_subdomain_id

constexpr subdomain_id_type libMesh::Elem::invalid_subdomain_id = std::numeric_limits<subdomain_id_type>::max()
staticconstexprinherited

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

Definition at line 245 of file elem.h.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::BoundaryInfo::add_elements(), libMesh::BoundaryInfo::add_elements(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), libMesh::MeshBase::get_id_by_name(), libMesh::BoundaryInfo::sync(), and MeshSubdomainIDTest::testMultiple().

◆ invalid_unique_id

constexpr unique_id_type libMesh::DofObject::invalid_unique_id = static_cast<unique_id_type>(-1)
staticconstexprinherited

An invalid unique_id to distinguish an uninitialized DofObject.

Definition at line 478 of file dof_object.h.

Referenced by libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DofObject::unique_id(), and libMesh::DofObject::valid_unique_id().

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

Referenced by libMesh::Elem::Elem(), and ElemTest< elem_type >::test_static_data().

◆ ncv_magic

constexpr index_t libMesh::DofObject::ncv_magic = index_t(1) << ncv_magic_exp
staticconstexprprivateinherited

◆ ncv_magic_exp

constexpr index_t libMesh::DofObject::ncv_magic_exp = sizeof(index_t)*3
staticconstexprprivateinherited

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

I want ncv_magic to be low enough so we can still do some testing with multiphysics and 16-bit DoF indices occasionally, but high enough that we don't fail with only a few hundred components (e.g. a p=6 L2_HIERARCIC Hex has 7^3 and already exceeds 2^8).

Let's make it what our indices can store to the 3/8 power. That leaves 5/8 for n_vars. On a 32-bit build this lets us have n_vars up to 2^20 (good for 1M variables, passing our 100K unit test) and n_comp up to 2^12 (good for 16^3 components, so we can go up to p=15 even on an L2_HIERARCHIC hex).

For a 64-bit build we instead get 2^40 and 2^24, 1T vars and p=30, which should be enough for anybody.

Definition at line 696 of file dof_object.h.

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

◆ nodes_per_edge

const int libMesh::Edge::nodes_per_edge = invalid_int
static

Definition at line 68 of file edge.h.

◆ nodes_per_side

const int libMesh::Edge::nodes_per_side = 1
static

Definition at line 67 of file edge.h.

◆ num_children

const int libMesh::Edge::num_children = 2
static

Definition at line 66 of file edge.h.

◆ num_edges

const int libMesh::Edge::num_edges = 0
static

Definition at line 65 of file edge.h.

◆ num_sides

const int libMesh::Edge::num_sides = 2
static

Geometric constants for all Edges.

Definition at line 64 of file edge.h.

◆ old_dof_object

std::unique_ptr<DofObject> libMesh::DofObject::old_dof_object
protectedinherited

◆ type_to_default_order_map

const Order libMesh::Elem::type_to_default_order_map
staticinherited

This array maps the integer representation of the ElemType enum to the default approximation order of elements of that type.

This is currently usable even for complicated subclasses with runtime-varying topology.

Definition at line 1089 of file elem.h.

Referenced by NodalNeighborsTest::do_test(), SystemsTest::test2DProjectVectorFE(), SystemsTest::test3DProjectVectorFE(), ElemTest< elem_type >::test_static_data(), and MeshSmootherTest::testVariationalSmoother().

◆ type_to_dim_map

const unsigned int libMesh::Elem::type_to_dim_map
staticinherited

◆ type_to_n_edges_map

const unsigned int libMesh::Elem::type_to_n_edges_map
staticinherited

This array maps the integer representation of the ElemType enum to the number of edges on the element.

This is only usable for simple types for which the node number is fixed; for more general types like Polygon subclasses an actual instantiated Elem must be queried.

Definition at line 841 of file elem.h.

Referenced by libMesh::Elem::local_edge_node(), ElemTest< elem_type >::test_static_data(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ type_to_n_nodes_map

constexpr unsigned int libMesh::Elem::type_to_n_nodes_map[INVALID_ELEM]
staticconstexprinherited

This array maps the integer representation of the ElemType enum to the number of nodes in the element.

This is only usable for simple types for which the node number is fixed; for more general types like Polygon subclasses an actual instantiated Elem must be queried.

Definition at line 664 of file elem.h.

665 {
666 2, // EDGE2
667 3, // EDGE3
668 4, // EDGE4
669
670 3, // TRI3
671 6, // TRI6
672
673 4, // QUAD4
674 8, // QUAD8
675 9, // QUAD9
676
677 4, // TET4
678 10, // TET10
679
680 8, // HEX8
681 20, // HEX20
682 27, // HEX27
683
684 6, // PRISM6
685 15, // PRISM15
686 18, // PRISM18
687
688 5, // PYRAMID5
689 13, // PYRAMID13
690 14, // PYRAMID14
691
692 2, // INFEDGE2
693
694 4, // INFQUAD4
695 6, // INFQUAD6
696
697 8, // INFHEX8
698 16, // INFHEX16
699 18, // INFHEX18
700
701 6, // INFPRISM6
702 12, // INFPRISM12
703
704 1, // NODEELEM
705
706 0, // REMOTEELEM
707
708 3, // TRI3SUBDIVISION
709 3, // TRISHELL3
710 4, // QUADSHELL4
711 8, // QUADSHELL8
712
713 7, // TRI7
714 14, // TET14
715 20, // PRISM20
716 21, // PRISM21
717 18, // PYRAMID18
718
719 9, // QUADSHELL9
720
721 invalid_uint, // C0POLYGON
722 invalid_uint, // C0POLYHEDRON
723
724 };

Referenced by libMesh::DynaIO::ElementDefinition::ElementDefinition(), libMesh::FEAbstract::get_refspace_nodes(), libMesh::Elem::local_edge_node(), libMesh::Elem::local_side_node(), libMesh::XdrIO::pack_element(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_serialized_connectivity(), ElemTest< elem_type >::test_static_data(), ElemTest< elem_type >::test_static_topology(), MeshGenerationTest::testBuildCube(), MeshGenerationTest::testBuildLine(), libMesh::Parallel::Packing< Elem * >::unpack(), and libMesh::ExodusII_IO_Helper::write_elements().

◆ type_to_n_sides_map

const unsigned int libMesh::Elem::type_to_n_sides_map
staticinherited

This array maps the integer representation of the ElemType enum to the number of sides on the element.

This is only usable for simple types for which the node number is fixed; for more general types like Polygon subclasses an actual instantiated Elem must be queried.

Definition at line 759 of file elem.h.

Referenced by libMesh::Elem::face_orientation(), libMesh::Elem::local_side_node(), libMesh::Elem::oriented_face_vertices(), libMesh::Elem::relative_edge_face_order(), libMesh::PetscPreconditioner< T >::set_hypre_ads_data(), libMesh::Elem::side_type(), ElemTest< elem_type >::test_orientation(), ElemTest< elem_type >::test_static_data(), MeshGenerationTest::testBuildCube(), MeshGenerationTest::testBuildSquare(), and libMesh::Parallel::Packing< Elem * >::unpack().


The documentation for this class was generated from the following files: