libMesh
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
libMesh::Tet4 Class Referencefinal


The Tet4 is an element in 3D composed of 4 nodes. More...

#include <cell_tet4.h>

Inheritance diagram for libMesh::Tet4:
[legend]

Public Types

enum  Diagonal { DIAG_02_13 =0, DIAG_03_12 =1, DIAG_01_23 =2, INVALID_DIAG =99 }
 This enumeration keeps track of which diagonal is selected during refinement. More...
 
enum  RefinementState {
  COARSEN = 0, DO_NOTHING, REFINE, JUST_REFINED,
  JUST_COARSENED, INACTIVE, COARSEN_INACTIVE, INVALID_REFINEMENTSTATE
}
 Enumeration of possible element refinement states. More...
 
typedef Elem *const * NeighborPtrIter
 Nested "classes" for use iterating over all neighbors of an element. More...
 
typedef const Elem *const * ConstNeighborPtrIter
 
typedef Predicates::multi_predicate Predicate
 Useful iterator typedefs. More...
 

Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

static const int num_nodes = 4
 Geometric constants for Tet4. More...
 
static const int num_sides = 4
 
static const int num_edges = 6
 
static const int num_children = 8
 
static const int nodes_per_side = 3
 
static const int nodes_per_edge = 2
 
static const unsigned int side_nodes_map [num_sides][nodes_per_side]
 This maps the \( j^{th} \) node of the \( i^{th} \) side to element node numbers. More...
 
static const unsigned int edge_nodes_map [num_edges][nodes_per_edge]
 This maps the \( j^{th} \) node of the \( i^{th} \) edge to element node numbers. More...
 
static const unsigned int edge_sides_map [6][2]
 This maps each edge to the sides that contain said edge. More...
 
static const subdomain_id_type invalid_subdomain_id = std::numeric_limits<subdomain_id_type>::max()
 A static integral constant representing an invalid subdomain id. More...
 
static const unsigned int type_to_n_nodes_map [INVALID_ELEM]
 This array maps the integer representation of the ElemType enum to the number of nodes in the element. More...
 
static const unsigned int max_n_nodes = 27
 The maximum number of nodes any element can contain. More...
 
static const unsigned int type_to_n_sides_map [INVALID_ELEM]
 This array maps the integer representation of the ElemType enum to the number of sides on the element. More...
 
static const unsigned int type_to_n_edges_map [INVALID_ELEM]
 This array maps the integer representation of the ElemType enum to the number of edges on the element. More...
 
static const dof_id_type invalid_id = static_cast<dof_id_type>(-1)
 An invalid id to distinguish an uninitialized DofObject. More...
 
static const unique_id_type invalid_unique_id = static_cast<unique_id_type>(-1)
 An invalid unique_id to distinguish an uninitialized DofObject. More...
 
static const processor_id_type invalid_processor_id = static_cast<processor_id_type>(-1)
 An invalid processor_id to distinguish DoFs that have not been assigned to a processor. More...
 

Protected Types

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

Protected Member Functions

virtual Real embedding_matrix (const unsigned int i, const unsigned int j, const unsigned int k) const override
 Matrix used to create the elements children. More...
 
bool is_child_on_side_helper (const unsigned int c, const unsigned int s, const unsigned int checked_nodes[][3]) const
 Called by descendant classes with appropriate data to determine if child c is on side s. More...
 
void choose_diagonal () const
 Derived classes use this function to select an initial diagonal during refinement. More...
 
void swap2nodes (unsigned int n1, unsigned int n2)
 Swaps two node_ptrs. More...
 
void swap2neighbors (unsigned int n1, unsigned int n2)
 Swaps two neighbor_ptrs. More...
 
void swap2boundarysides (unsigned short s1, unsigned short s2, BoundaryInfo *boundary_info) const
 Swaps two sides in boundary_info, if it is non-null. More...
 
void swap2boundaryedges (unsigned short e1, unsigned short e2, BoundaryInfo *boundary_info) const
 Swaps two edges in boundary_info, if it is non-null. More...
 
void swap3nodes (unsigned int n1, unsigned int n2, unsigned int n3)
 Swaps three node_ptrs, "rotating" them. More...
 
void swap3neighbors (unsigned int n1, unsigned int n2, unsigned int n3)
 Swaps three neighbor_ptrs, "rotating" them. More...
 
void swap4nodes (unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
 Swaps four node_ptrs, "rotating" them. More...
 
void swap4neighbors (unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
 Swaps four neighbor_ptrs, "rotating" them. More...
 
template<typename Sideclass , typename Subclass >
std::unique_ptr< Elemsimple_build_side_ptr (const unsigned int i, bool proxy)
 An implementation for simple (all sides equal) elements. More...
 
template<typename Subclass >
void simple_build_side_ptr (std::unique_ptr< Elem > &side, const unsigned int i, ElemType sidetype)
 An implementation for simple (all sides equal) elements. More...
 
template<typename Subclass , typename Mapclass >
void simple_side_ptr (std::unique_ptr< Elem > &side, const unsigned int i, ElemType sidetype)
 An implementation for simple (all sides equal) elements. More...
 
template<typename Edgeclass , typename Subclass >
std::unique_ptr< Elemsimple_build_edge_ptr (const unsigned int i)
 An implementation for simple (all edges equal) elements. More...
 
template<typename Subclass >
void simple_build_edge_ptr (std::unique_ptr< Elem > &edge, const unsigned int i, ElemType edgetype)
 An implementation for simple (all edges equal) elements. More...
 
virtual std::vector< std::vector< std::vector< std::vector< std::pair< unsigned char, unsigned char > > > > > & _get_bracketing_node_cache () const
 Elem subclasses which don't do their own bracketing node calculations will need to supply a static cache, since the default calculation is slow. More...
 
virtual std::vector< std::vector< std::vector< signed char > > > & _get_parent_indices_cache () const
 Elem subclasses which don't do their own child-to-parent node calculations will need to supply a static cache, since the default calculation is slow. More...
 
void increment_constructor_count (const std::string &name) noexcept
 Increments the construction counter. More...
 
void increment_constructor_count (const std::string &name) noexcept
 Increments the construction counter. More...
 
void increment_destructor_count (const std::string &name) noexcept
 Increments the destruction counter. More...
 
void increment_destructor_count (const std::string &name) noexcept
 Increments the destruction counter. More...
 

Static Protected Member Functions

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

Protected Attributes

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

Static Protected Attributes

static const Real _embedding_matrix [num_children][num_nodes][num_nodes]
 Matrix that computes new nodal locations/solution values from current nodes/solution. More...
 
static const Real _master_points [14][3]
 Master element node locations. More...
 
static constexpr Real affine_tol = TOLERANCE*TOLERANCE
 Default tolerance to use in has_affine_map(). More...
 
static Counts _counts
 Actually holds the data. More...
 
static Counts _counts
 Actually holds the data. More...
 
static Threads::atomic< unsigned int_n_objects
 The number of objects. More...
 
static Threads::atomic< unsigned int_n_objects
 The number of objects. More...
 
static Threads::spin_mutex _mutex
 Mutual exclusion object to enable thread-safe reference counting. More...
 
static Threads::spin_mutex _mutex
 Mutual exclusion object to enable thread-safe reference counting. More...
 
static bool _enable_print_counter = true
 Flag to control whether reference count information is printed when print_info is called. More...
 
static bool _enable_print_counter = true
 Flag to control whether reference count information is printed when print_info is called. More...
 

Detailed Description


The Tet4 is an element in 3D composed of 4 nodes.

It is numbered like this:

*   TET4:
*         3
*         o                 zeta
*        /|\                 ^
*       / | \                |
*      /  |  \               |
*   0 o...|...o 2            o---> eta
*      \  |  /                \
*       \ | /                  \
*        \|/                    xi (out of page)
*         o
*         1
* 

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

Author
Benjamin S. Kirk
Date
2002 A 3D tetrahedral element with 4 nodes.

Definition at line 59 of file cell_tet4.h.

Member Typedef Documentation

◆ ConstNeighborPtrIter

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

Definition at line 309 of file elem.h.

◆ Counts [1/2]

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

Data structure to log the information.

The log is identified by the class name.

Definition at line 119 of file reference_counter.h.

◆ Counts [2/2]

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

Data structure to log the information.

The log is identified by the class name.

Definition at line 119 of file reference_counter.h.

◆ NeighborPtrIter

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

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

Definition at line 308 of file elem.h.

◆ Predicate

Useful iterator typedefs.

Definition at line 1713 of file elem.h.

Member Enumeration Documentation

◆ Diagonal

enum libMesh::Tet::Diagonal
inherited

This enumeration keeps track of which diagonal is selected during refinement.

In general there are three possible diagonals to choose when splitting the octahedron, and by choosing the shortest one we obtain the best element shape.

Enumerator
DIAG_02_13 
DIAG_03_12 
DIAG_01_23 
INVALID_DIAG 

Definition at line 162 of file cell_tet.h.

163  {
164  DIAG_02_13=0, // diagonal between edges (0,2) and (1,3)
165  DIAG_03_12=1, // diagonal between edges (0,3) and (1,2)
166  DIAG_01_23=2, // diagonal between edges (0,1) and (2,3)
167  INVALID_DIAG=99 // diagonal not yet selected
168  };

◆ RefinementState

Enumeration of possible element refinement states.

Enumerator
COARSEN 
DO_NOTHING 
REFINE 
JUST_REFINED 
JUST_COARSENED 
INACTIVE 
COARSEN_INACTIVE 
INVALID_REFINEMENTSTATE 

Definition at line 1305 of file elem.h.

Constructor & Destructor Documentation

◆ Tet4() [1/3]

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

Constructor.

By default this element has no parent.

Definition at line 67 of file cell_tet4.h.

67  :
69  {}
Node * _nodelinks_data[num_nodes]
Data for links to nodes.
Definition: cell_tet4.h:256
Tet(const unsigned int nn, Elem *p, Node **nodelinkdata)
Default tetrahedral element, takes number of nodes and parent.
Definition: cell_tet.h:44
virtual unsigned int n_nodes() const override
Definition: cell_tet4.h:85

◆ Tet4() [2/3]

libMesh::Tet4::Tet4 ( Tet4 &&  )
delete

◆ Tet4() [3/3]

libMesh::Tet4::Tet4 ( const Tet4 )
delete

◆ ~Tet4()

virtual libMesh::Tet4::~Tet4 ( )
virtualdefault

Member Function Documentation

◆ _get_bracketing_node_cache()

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

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

Definition at line 2051 of file elem.h.

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

2052  {
2053  static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> c;
2054  libmesh_error();
2055  return c;
2056  }

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

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

2066  {
2067  static std::vector<std::vector<std::vector<signed char>>> c;
2068  libmesh_error();
2069  return c;
2070  }

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

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

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

2779 {
2780 #ifdef LIBMESH_ENABLE_AMR
2781  if ((this->refinement_flag() == INACTIVE) ||
2782  (this->refinement_flag() == COARSEN_INACTIVE))
2783  return false;
2784  else
2785  return true;
2786 #else
2787  return true;
2788 #endif
2789 }
RefinementState refinement_flag() const
Definition: elem.h:3047

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

References libMesh::ElemInternal::active_family_tree().

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

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

◆ active_family_tree() [2/2]

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

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

Definition at line 1765 of file elem.C.

References libMesh::ElemInternal::active_family_tree().

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

◆ active_family_tree_by_neighbor() [1/2]

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

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

Definition at line 1885 of file elem.C.

References libMesh::ElemInternal::active_family_tree_by_neighbor().

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

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

◆ active_family_tree_by_neighbor() [2/2]

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

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

Definition at line 1894 of file elem.C.

References libMesh::ElemInternal::active_family_tree_by_neighbor().

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

◆ active_family_tree_by_side() [1/2]

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

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

Definition at line 1791 of file elem.C.

References libMesh::ElemInternal::active_family_tree_by_side().

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

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

◆ active_family_tree_by_side() [2/2]

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

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

Definition at line 1800 of file elem.C.

References libMesh::ElemInternal::active_family_tree_by_side().

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

◆ active_family_tree_by_topological_neighbor() [1/2]

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

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

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

Definition at line 1903 of file elem.C.

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

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

1909 {
1911  mesh, point_locator, pb,
1912  reset);
1913 }
MeshBase & mesh
void active_family_tree_by_topological_neighbor(T elem, std::vector< T > &family, T neighbor_in, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb, bool reset=true)

◆ active_family_tree_by_topological_neighbor() [2/2]

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

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

Definition at line 1917 of file elem.C.

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

1923 {
1925  mesh, point_locator, pb,
1926  reset);
1927 }
MeshBase & mesh
void active_family_tree_by_topological_neighbor(T elem, std::vector< T > &family, T neighbor_in, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb, bool reset=true)

◆ add_child() [1/2]

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

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

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

Definition at line 1668 of file elem.C.

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

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

1669 {
1670  const unsigned int nc = this->n_children();
1671 
1672  if (!_children)
1673  {
1674  _children = std::make_unique<Elem *[]>(nc);
1675 
1676  for (unsigned int c = 0; c != nc; c++)
1677  this->set_child(c, nullptr);
1678  }
1679 
1680  for (unsigned int c = 0; c != nc; c++)
1681  {
1682  if (this->_children[c] == nullptr || this->_children[c] == remote_elem)
1683  {
1684  libmesh_assert_equal_to (this, elem->parent());
1685  this->set_child(c, elem);
1686  return;
1687  }
1688  }
1689 
1690  libmesh_error_msg("Error: Tried to add a child to an element with full children array");
1691 }
virtual unsigned int n_children() const =0
void set_child(unsigned int c, Elem *elem)
Sets the pointer to the child for this element.
Definition: elem.h:3019
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2103
const RemoteElem * remote_elem
Definition: remote_elem.C:54

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

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

1696 {
1697  if (!this->has_children())
1698  {
1699  const unsigned int nc = this->n_children();
1700  _children = std::make_unique<Elem *[]>(nc);
1701 
1702  for (unsigned int i = 0; i != nc; i++)
1703  this->set_child(i, nullptr);
1704  }
1705 
1706  libmesh_assert (this->_children[c] == nullptr || this->child_ptr(c) == remote_elem);
1707  libmesh_assert (elem == remote_elem || this == elem->parent());
1708 
1709  this->set_child(c, elem);
1710 }
const Elem * parent() const
Definition: elem.h:2867
virtual unsigned int n_children() const =0
libmesh_assert(ctx)
void set_child(unsigned int c, Elem *elem)
Sets the pointer to the child for this element.
Definition: elem.h:3019
bool has_children() const
Definition: elem.h:2816
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2103
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:3000
const RemoteElem * remote_elem
Definition: remote_elem.C:54

◆ add_extra_integers() [1/2]

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

Assigns a set of extra integers to this DofObject.

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

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

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

Definition at line 490 of file dof_object.C.

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

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

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

◆ add_extra_integers() [2/2]

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

Assigns a set of extra integers to this DofObject.

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

Any newly-added values will be copied from default_values.

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

Definition at line 542 of file dof_object.C.

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

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

◆ add_system()

void libMesh::DofObject::add_system ( )
inherited

Adds an additional system to the DofObject.

Definition at line 195 of file dof_object.C.

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

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

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

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

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

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

1635 {
1636 #ifdef LIBMESH_ENABLE_AMR
1637 
1638  // Use a fast, DistributedMesh-safe definition
1639  const bool is_ancestor =
1640  !this->active() && !this->subactive();
1641 
1642  // But check for inconsistencies if we have time
1643 #ifdef DEBUG
1644  if (!is_ancestor && this->has_children())
1645  {
1646  for (auto & c : this->child_ref_range())
1647  {
1648  if (&c != remote_elem)
1649  {
1650  libmesh_assert(!c.active());
1651  libmesh_assert(!c.ancestor());
1652  }
1653  }
1654  }
1655 #endif // DEBUG
1656 
1657  return is_ancestor;
1658 
1659 #else
1660  return false;
1661 #endif
1662 }
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:2188
libmesh_assert(ctx)
bool subactive() const
Definition: elem.h:2796
bool active() const
Definition: elem.h:2778
bool has_children() const
Definition: elem.h:2816
const RemoteElem * remote_elem
Definition: remote_elem.C:54

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

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

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

2012 {
2013  const unsigned int nc = this->n_children();
2014  libmesh_assert_less(child, nc);
2015 
2016  // Cached return values, indexed first by embedding_matrix version,
2017  // then by child number, then by child node number.
2018  std::vector<std::vector<std::vector<signed char>>> &
2019  cached_parent_indices = this->_get_parent_indices_cache();
2020 
2021  unsigned int em_vers = this->embedding_matrix_version();
2022 
2023  // We may be updating the cache on one thread, and while that
2024  // happens we can't safely access the cache from other threads.
2025  Threads::spin_mutex::scoped_lock lock(parent_indices_mutex);
2026 
2027  if (em_vers >= cached_parent_indices.size())
2028  cached_parent_indices.resize(em_vers+1);
2029 
2030  if (child >= cached_parent_indices[em_vers].size())
2031  {
2032  const signed char nn = cast_int<signed char>(this->n_nodes());
2033 
2034  cached_parent_indices[em_vers].resize(nc);
2035 
2036  for (unsigned int c = 0; c != nc; ++c)
2037  {
2038  const unsigned int ncn = this->n_nodes_in_child(c);
2039  cached_parent_indices[em_vers][c].resize(ncn);
2040  for (unsigned int cn = 0; cn != ncn; ++cn)
2041  {
2042  for (signed char n = 0; n != nn; ++n)
2043  {
2044  const Real em_val = this->embedding_matrix
2045  (c, cn, n);
2046  if (em_val == 1)
2047  {
2048  cached_parent_indices[em_vers][c][cn] = n;
2049  break;
2050  }
2051 
2052  if (em_val != 0)
2053  {
2054  cached_parent_indices[em_vers][c][cn] =
2055  -1;
2056  break;
2057  }
2058 
2059  // We should never see an all-zero embedding matrix
2060  // row
2061  libmesh_assert_not_equal_to (n+1, nn);
2062  }
2063  }
2064  }
2065  }
2066 
2067  const signed char cache_val =
2068  cached_parent_indices[em_vers][child][child_node];
2069  if (cache_val == -1)
2070  return libMesh::invalid_uint;
2071 
2072  return cached_parent_indices[em_vers][child][child_node];
2073 }
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:286
virtual unsigned int embedding_matrix_version() const
Definition: elem.h:1892
Threads::spin_mutex parent_indices_mutex
Definition: elem.C:95
virtual unsigned int n_children() const =0
virtual Real embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
virtual std::vector< std::vector< std::vector< signed char > > > & _get_parent_indices_cache() const
Elem subclasses which don&#39;t do their own child-to-parent node calculations will need to supply a stat...
Definition: elem.h:2065
virtual unsigned int n_nodes() const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:634

◆ boundary_sides_begin()

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

Iterator accessor functions.

Definition at line 3032 of file elem.C.

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

3033 {
3034  Predicates::BoundarySide<SideIter> bsp;
3035  return side_iterator(this->_first_side(), this->_last_side(), bsp);
3036 }
SideIter _last_side()
Definition: elem.h:3301
SideIter _first_side()
Side iterator helper functions.
Definition: elem.h:3293

◆ boundary_sides_end()

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

Definition at line 3041 of file elem.C.

References libMesh::Elem::_last_side().

3042 {
3043  Predicates::BoundarySide<SideIter> bsp;
3044  return side_iterator(this->_last_side(), this->_last_side(), bsp);
3045 }
SideIter _last_side()
Definition: elem.h:3301

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

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

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

2283 {
2284  std::vector<std::pair<dof_id_type, dof_id_type>> returnval;
2285 
2286  const std::vector<std::pair<unsigned char, unsigned char>> & pbc =
2287  this->parent_bracketing_nodes(child,child_node);
2288 
2289  for (const auto & pb : pbc)
2290  {
2291  const unsigned short n_n = this->n_nodes();
2292  if (pb.first < n_n && pb.second < n_n)
2293  returnval.emplace_back(this->node_id(pb.first), this->node_id(pb.second));
2294  else
2295  {
2296  // We must be on a non-full-order higher order element...
2297  libmesh_assert_not_equal_to(this->default_order(), FIRST);
2298  libmesh_assert_not_equal_to
2299  (second_order_equivalent_type (this->type(), true),
2300  this->type());
2301  libmesh_assert_equal_to
2302  (second_order_equivalent_type (this->type(), false),
2303  this->type());
2304 
2305  // And that's a shame, because this is a nasty search:
2306 
2307  // Build the full-order type
2308  ElemType full_type =
2309  second_order_equivalent_type(this->type(), /*full_ordered=*/ true);
2310  std::unique_ptr<Elem> full_elem = Elem::build(full_type);
2311 
2314 
2315  // Find the bracketing nodes by figuring out what
2316  // already-created children will have them.
2317 
2318  // This only doesn't break horribly because we add children
2319  // and nodes in straightforward + hierarchical orders...
2320  for (unsigned int c=0; c <= child; ++c)
2321  for (auto n : make_range(this->n_nodes_in_child(c)))
2322  {
2323  if (c == child && n == child_node)
2324  break;
2325 
2326  if (pb.first == full_elem->as_parent_node(c,n))
2327  {
2328  // We should be consistent
2329  if (pt1 != DofObject::invalid_id)
2330  libmesh_assert_equal_to(pt1, this->child_ptr(c)->node_id(n));
2331 
2332  pt1 = this->child_ptr(c)->node_id(n);
2333  }
2334 
2335  if (pb.second == full_elem->as_parent_node(c,n))
2336  {
2337  // We should be consistent
2338  if (pt2 != DofObject::invalid_id)
2339  libmesh_assert_equal_to(pt2, this->child_ptr(c)->node_id(n));
2340 
2341  pt2 = this->child_ptr(c)->node_id(n);
2342  }
2343  }
2344 
2345  // We should *usually* find all bracketing nodes by the time
2346  // we query them (again, because of the child & node add
2347  // order)
2348  //
2349  // The exception is if we're a HEX20, in which case we will
2350  // find pairs of vertex nodes and edge nodes bracketing the
2351  // new central node but we *won't* find the pairs of face
2352  // nodes which we would have had on a HEX27. In that case
2353  // we'll still have enough bracketing nodes for a
2354  // topological lookup, but we won't be able to make the
2355  // following assertions.
2356  if (this->type() != HEX20)
2357  {
2358  libmesh_assert_not_equal_to (pt1, DofObject::invalid_id);
2359  libmesh_assert_not_equal_to (pt2, DofObject::invalid_id);
2360  }
2361 
2362  if (pt1 != DofObject::invalid_id &&
2363  pt2 != DofObject::invalid_id)
2364  returnval.emplace_back(pt1, pt2);
2365  }
2366  }
2367 
2368  return returnval;
2369 }
ElemType
Defines an enum for geometric element types.
virtual unsigned int n_nodes() const =0
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition: elem.C:273
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
Definition: elem.C:2760
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:134
virtual Order default_order() const =0
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes(unsigned int c, unsigned int n) const
Definition: elem.C:2078
virtual ElemType type() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2299
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:634
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:3000
uint8_t dof_id_type
Definition: id_types.h:67

◆ build()

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

Definition at line 273 of file elem.C.

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

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

275 {
276  switch (type)
277  {
278  // 0D elements
279  case NODEELEM:
280  return std::make_unique<NodeElem>(p);
281 
282  // 1D elements
283  case EDGE2:
284  return std::make_unique<Edge2>(p);
285  case EDGE3:
286  return std::make_unique<Edge3>(p);
287  case EDGE4:
288  return std::make_unique<Edge4>(p);
289 
290  // 2D elements
291  case TRI3:
292  return std::make_unique<Tri3>(p);
293  case TRISHELL3:
294  return std::make_unique<TriShell3>(p);
295  case TRI3SUBDIVISION:
296  return std::make_unique<Tri3Subdivision>(p);
297  case TRI6:
298  return std::make_unique<Tri6>(p);
299  case TRI7:
300  return std::make_unique<Tri7>(p);
301  case QUAD4:
302  return std::make_unique<Quad4>(p);
303  case QUADSHELL4:
304  return std::make_unique<QuadShell4>(p);
305  case QUAD8:
306  return std::make_unique<Quad8>(p);
307  case QUADSHELL8:
308  return std::make_unique<QuadShell8>(p);
309  case QUAD9:
310  return std::make_unique<Quad9>(p);
311 
312  // 3D elements
313  case TET4:
314  return std::make_unique<Tet4>(p);
315  case TET10:
316  return std::make_unique<Tet10>(p);
317  case TET14:
318  return std::make_unique<Tet14>(p);
319  case HEX8:
320  return std::make_unique<Hex8>(p);
321  case HEX20:
322  return std::make_unique<Hex20>(p);
323  case HEX27:
324  return std::make_unique<Hex27>(p);
325  case PRISM6:
326  return std::make_unique<Prism6>(p);
327  case PRISM15:
328  return std::make_unique<Prism15>(p);
329  case PRISM18:
330  return std::make_unique<Prism18>(p);
331  case PRISM20:
332  return std::make_unique<Prism20>(p);
333  case PRISM21:
334  return std::make_unique<Prism21>(p);
335  case PYRAMID5:
336  return std::make_unique<Pyramid5>(p);
337  case PYRAMID13:
338  return std::make_unique<Pyramid13>(p);
339  case PYRAMID14:
340  return std::make_unique<Pyramid14>(p);
341  case PYRAMID18:
342  return std::make_unique<Pyramid18>(p);
343 
344 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
345  // 1D infinite elements
346  case INFEDGE2:
347  return std::make_unique<InfEdge2>(p);
348 
349  // 2D infinite elements
350  case INFQUAD4:
351  return std::make_unique<InfQuad4>(p);
352  case INFQUAD6:
353  return std::make_unique<InfQuad6>(p);
354 
355  // 3D infinite elements
356  case INFHEX8:
357  return std::make_unique<InfHex8>(p);
358  case INFHEX16:
359  return std::make_unique<InfHex16>(p);
360  case INFHEX18:
361  return std::make_unique<InfHex18>(p);
362  case INFPRISM6:
363  return std::make_unique<InfPrism6>(p);
364  case INFPRISM12:
365  return std::make_unique<InfPrism12>(p);
366 #endif
367 
368  default:
369  libmesh_error_msg("ERROR: Undefined element type == " << Utility::enum_to_string(type));
370  }
371 }
std::string enum_to_string(const T e)
virtual ElemType type() const =0

◆ build_edge_ptr() [1/4]

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

Builds a EDGE2 built coincident with face i.

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

Implements libMesh::Elem.

Definition at line 175 of file cell_tet4.C.

176 {
177  return this->simple_build_edge_ptr<Edge2,Tet4>(i);
178 }

◆ build_edge_ptr() [2/4]

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

Rebuilds a EDGE2 coincident with edge i.

Implements libMesh::Elem.

Definition at line 182 of file cell_tet4.C.

References libMesh::EDGE2.

183 {
184  this->simple_build_edge_ptr<Tet4>(edge, i, EDGE2);
185 }

◆ build_edge_ptr() [3/4]

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

Definition at line 2668 of file elem.h.

References libMesh::Elem::build_edge_ptr().

2669 {
2670  // Call the non-const version of this function, return the result as
2671  // a std::unique_ptr<const Elem>.
2672  Elem * me = const_cast<Elem *>(this);
2673  const Elem * e = const_cast<const Elem *>(me->build_edge_ptr(i).release());
2674  return std::unique_ptr<const Elem>(e);
2675 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220

◆ build_edge_ptr() [4/4]

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

Definition at line 2681 of file elem.h.

References libMesh::Elem::build_edge_ptr().

2683 {
2684  // Hand off to the non-const version of this function
2685  Elem * me = const_cast<Elem *>(this);
2686  std::unique_ptr<Elem> e {const_cast<Elem *>(elem.release())};
2687  me->build_edge_ptr(e, i);
2688  elem = std::move(e);
2689 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220

◆ build_side_ptr() [1/4]

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

Builds a TRI3 built coincident with face i.

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

Implements libMesh::Elem.

Definition at line 159 of file cell_tet4.C.

161 {
162  return this->simple_build_side_ptr<Tri3, Tet4>(i, proxy);
163 }

◆ build_side_ptr() [2/4]

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

Rebuilds a TRI3 built coincident with face i.

Implements libMesh::Elem.

Definition at line 167 of file cell_tet4.C.

References libMesh::TRI3.

169 {
170  this->simple_build_side_ptr<Tet4>(side, i, TRI3);
171 }

◆ build_side_ptr() [3/4]

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

Definition at line 2546 of file elem.h.

References libMesh::Elem::build_side_ptr().

2547 {
2548  // Call the non-const version of this function, return the result as
2549  // a std::unique_ptr<const Elem>.
2550  Elem * me = const_cast<Elem *>(this);
2551  const Elem * s = const_cast<const Elem *>(me->build_side_ptr(i, proxy).release());
2552  return std::unique_ptr<const Elem>(s);
2553 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220

◆ build_side_ptr() [4/4]

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

Definition at line 2559 of file elem.h.

References libMesh::Elem::build_side_ptr().

2561 {
2562  // Hand off to the non-const version of this function
2563  Elem * me = const_cast<Elem *>(this);
2564  std::unique_ptr<Elem> e {const_cast<Elem *>(elem.release())};
2565  me->build_side_ptr(e, i);
2566  elem = std::move(e);
2567 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220

◆ build_with_id()

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

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

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

Definition at line 375 of file elem.C.

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

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

377 {
378  // Call the other build() method with nullptr parent, then set the
379  // required id.
380  auto temp = Elem::build(type, nullptr);
381  temp->set_id(id);
382  return temp;
383 }
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition: elem.C:273
virtual ElemType type() const =0

◆ center_node_on_side()

unsigned int libMesh::Elem::center_node_on_side ( const unsigned short  side) const
virtualinherited
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 in libMesh::Prism20, libMesh::Prism21, libMesh::Prism18, libMesh::Hex27, libMesh::Pyramid18, libMesh::Pyramid14, libMesh::RemoteElem, libMesh::Tri7, libMesh::Tri6, libMesh::Quad9, libMesh::Edge, and libMesh::Quad8.

Definition at line 3148 of file elem.C.

References libMesh::invalid_uint, and libMesh::Elem::n_sides().

3149 {
3150  libmesh_assert_less (side, this->n_sides());
3151  return invalid_uint;
3152 }
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:286
virtual unsigned int n_sides() const =0

◆ centroid()

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

Calls Elem::vertex_average() for backwards compatibility.

This method has now been deprecated, so it will be removed at some point in the future. Calls to Elem::centroid() in user code should be updated to either call Elem::vertex_average() or Elem::true_centroid() on a case by case basis.

Definition at line 394 of file elem.C.

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

395 {
396  libmesh_do_once(libMesh::err
397  << "Elem::centroid() has been deprecated. Replace with either "
398  << "Elem::vertex_average() to maintain existing behavior, or "
399  << "the more expensive Elem::true_centroid() "
400  << "in cases where the true 'geometric' centroid is required."
401  << std::endl);
402  libmesh_deprecated();
403 
404  return Elem::vertex_average();
405 }
OStreamProxy err
Point vertex_average() const
Definition: elem.C:498

◆ child_neighbor() [1/2]

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

Definition at line 2449 of file elem.h.

References libMesh::Elem::neighbor_ptr_range().

2450 {
2451  for (auto n : elem->neighbor_ptr_range())
2452  if (n && n->parent() == this)
2453  return n;
2454 
2455  return nullptr;
2456 }

◆ child_neighbor() [2/2]

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

Definition at line 2461 of file elem.h.

References libMesh::Elem::neighbor_ptr_range().

2462 {
2463  for (auto n : elem->neighbor_ptr_range())
2464  if (n && n->parent() == this)
2465  return n;
2466 
2467  return nullptr;
2468 }

◆ child_ptr() [1/2]

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

Definition at line 3000 of file elem.h.

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

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

3001 {
3004 
3005  return _children[i];
3006 }
libmesh_assert(ctx)
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2103

◆ child_ptr() [2/2]

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

Definition at line 3009 of file elem.h.

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

3010 {
3013 
3014  return _children[i];
3015 }
libmesh_assert(ctx)
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2103

◆ child_ref_range() [1/2]

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

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

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

Definition at line 2188 of file elem.h.

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

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

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

◆ child_ref_range() [2/2]

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

Definition at line 2196 of file elem.h.

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

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

◆ choose_diagonal()

void libMesh::Tet::choose_diagonal ( ) const
protectedinherited

Derived classes use this function to select an initial diagonal during refinement.

The optimal choice is the shortest of the three.

Definition at line 194 of file cell_tet.C.

References libMesh::Tet::_diagonal_selection, libMesh::Tet::DIAG_01_23, libMesh::Tet::DIAG_02_13, libMesh::Tet::DIAG_03_12, libMesh::Tet::INVALID_DIAG, libMesh::TensorTools::norm_sq(), libMesh::Elem::point(), and libMesh::Real.

Referenced by libMesh::Tet10::embedding_matrix(), embedding_matrix(), libMesh::Tet14::embedding_matrix(), libMesh::Tet::embedding_matrix_version(), and libMesh::Tet14::parent_bracketing_nodes().

195 {
196  // Check for uninitialized diagonal selection
198  {
199  Real diag_01_23 = (this->point(0) + this->point(1) - this->point(2) - this->point(3)).norm_sq();
200  Real diag_02_13 = (this->point(0) - this->point(1) + this->point(2) - this->point(3)).norm_sq();
201  Real diag_03_12 = (this->point(0) - this->point(1) - this->point(2) + this->point(3)).norm_sq();
202 
204 
205  if (diag_01_23 < diag_02_13 || diag_03_12 < diag_02_13)
206  {
207  if (diag_01_23 < diag_03_12)
209 
210  else
212  }
213  }
214 }
Diagonal _diagonal_selection
The currently-selected diagonal used during refinement.
Definition: cell_tet.h:237
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
auto norm_sq(const T &a) -> decltype(std::norm(a))
Definition: tensor_tools.h:104
const Point & point(const unsigned int i) const
Definition: elem.h:2277

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

References libMesh::DofObject::set_n_systems().

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

◆ clear_old_dof_object()

void libMesh::DofObject::clear_old_dof_object ( )
inherited

Sets the old_dof_object to nullptr.

Definition at line 128 of file dof_object.C.

References libMesh::DofObject::old_dof_object.

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

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

◆ close_to_point()

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

Reimplemented in libMesh::NodeElem.

Definition at line 2400 of file elem.C.

References libMesh::Elem::point_test().

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

2401 {
2402  // This test uses the user's passed-in tolerance for the
2403  // bounding box test as well, thereby allowing the routine to
2404  // find points which are not only "in" the element, but also
2405  // "nearby" to within some tolerance.
2406  return this->point_test(p, tol, tol);
2407 }
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:2412

◆ coarsen()

void libMesh::Elem::coarsen ( )
inherited

Coarsen the element.

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

Definition at line 163 of file elem_refinement.C.

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

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

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

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

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

2938 {
2939  switch (et)
2940  {
2941  case NODEELEM:
2942  return NODEELEM;
2943  case EDGE2:
2944  case EDGE3:
2945  return EDGE3;
2946 
2947  case EDGE4:
2948  return EDGE4;
2949 
2950  case TRI3:
2951  case TRI6:
2952  case TRI7:
2953  return TRI7;
2954 
2955  // Currently there is no TRISHELL6, so similarly to other types
2956  // where this is the case, we just return the input.
2957  case TRISHELL3:
2958  return TRISHELL3;
2959 
2960  case QUAD4:
2961  case QUAD8:
2962  case QUAD9:
2963  return QUAD9;
2964 
2965  case QUADSHELL4:
2966  case QUADSHELL8:
2967  {
2968  // There is no QUADSHELL9, so in that sense QUADSHELL8 is the
2969  // "full ordered" element.
2970  return QUADSHELL8;
2971  }
2972 
2973  case TET4:
2974  case TET10:
2975  case TET14:
2976  return TET14;
2977 
2978  case HEX8:
2979  case HEX20:
2980  case HEX27:
2981  return HEX27;
2982 
2983  // We don't strictly need the 21st node for DoFs, but some code
2984  // depends on it for e.g. refinement patterns
2985  case PRISM6:
2986  case PRISM15:
2987  case PRISM18:
2988  case PRISM20:
2989  case PRISM21:
2990  return PRISM21;
2991 
2992  case PYRAMID5:
2993  case PYRAMID13:
2994  case PYRAMID14:
2995  case PYRAMID18:
2996  return PYRAMID18;
2997 
2998 
2999 
3000 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
3001  case INFEDGE2:
3002  return INFEDGE2;
3003 
3004  case INFQUAD4:
3005  case INFQUAD6:
3006  return INFQUAD6;
3007 
3008  case INFHEX8:
3009  case INFHEX16:
3010  case INFHEX18:
3011  return INFHEX18;
3012 
3013  // Probably ought to implement INFPRISM13 and/or 14; until then
3014  // we'll just return the not-complete-order ElemType, in
3015  // accordance which what seems like bad precedent...
3016  case INFPRISM6:
3017  case INFPRISM12:
3018  return INFPRISM12;
3019 #endif // LIBMESH_ENABLE_INFINITE_ELEMENTS
3020 
3021  default:
3022  {
3023  // what did we miss?
3024  libmesh_error_msg("No complete order equivalent element type for et = "
3025  << Utility::enum_to_string(et));
3026  }
3027  }
3028 }
std::string enum_to_string(const T e)

◆ compute_key() [1/4]

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

◆ compute_key() [2/4]

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

Definition at line 3139 of file elem.h.

References libMesh::Utility::hashword2().

3141 {
3142  // Order the two so that n0 < n1
3143  if (n0 > n1) std::swap (n0, n1);
3144 
3145  return Utility::hashword2(n0, n1);
3146 }
uint32_t hashword2(const uint32_t &first, const uint32_t &second, uint32_t initval=0)
This is a hard-coded version of hashword for hashing exactly 2 numbers.
Definition: hashword.h:210

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

References libMesh::Utility::hashword().

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

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

References libMesh::Utility::hashword().

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

◆ connectivity()

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

Implements libMesh::Elem.

Definition at line 189 of file cell_tet4.C.

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

192 {
194  libmesh_assert_less (sc, this->n_sub_elem());
195  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
196 
197 
198  switch (iop)
199  {
200  case TECPLOT:
201  {
202  conn.resize(8);
203  conn[0] = this->node_id(0)+1;
204  conn[1] = this->node_id(1)+1;
205  conn[2] = this->node_id(2)+1;
206  conn[3] = this->node_id(2)+1;
207  conn[4] = this->node_id(3)+1;
208  conn[5] = this->node_id(3)+1;
209  conn[6] = this->node_id(3)+1;
210  conn[7] = this->node_id(3)+1;
211  return;
212  }
213 
214  case VTK:
215  {
216  conn.resize(4);
217  conn[0] = this->node_id(0);
218  conn[1] = this->node_id(1);
219  conn[2] = this->node_id(2);
220  conn[3] = this->node_id(3);
221  return;
222  }
223 
224  default:
225  libmesh_error_msg("Unsupported IO package " << iop);
226  }
227 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2087
virtual unsigned int n_sub_elem() const override
Definition: cell_tet4.h:90
libmesh_assert(ctx)
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2299

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

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

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

781 {
782  unsigned int num_contained_edges = 0;
783 
784  // Our vertices are the first numbered nodes
785  for (auto n : make_range(e->n_vertices()))
786  {
787  if (this->contains_point(e->point(n)))
788  {
789  num_contained_edges++;
790  if (num_contained_edges>=2)
791  {
792  return true;
793  }
794  }
795  }
796  return false;
797 }
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2375
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:134

◆ contains_point()

bool libMesh::Tet4::contains_point ( const Point p,
Real  tol 
) const
overridevirtual

Uses simple geometric tests to determine if the point p is inside the tetrahedron.

Reimplemented from libMesh::Elem.

Definition at line 374 of file cell_tet4.C.

References libMesh::Elem::point().

375 {
376  // See the response by Tony Noe on this thread.
377  // http://bbs.dartmouth.edu/~fangq/MATH/download/source/Point_in_Tetrahedron.htm
378  Point
379  col1 = point(1) - point(0),
380  col2 = point(2) - point(0),
381  col3 = point(3) - point(0);
382 
383  Point r;
384 
385  libmesh_try
386  {
387  RealTensorValue(col1(0), col2(0), col3(0),
388  col1(1), col2(1), col3(1),
389  col1(2), col2(2), col3(2)).solve(p - point(0), r);
390  }
391  libmesh_catch (ConvergenceFailure &)
392  {
393  // The Jacobian was singular, therefore the Tet had
394  // zero volume. In this degenerate case, it is not
395  // possible for the Tet to contain any points.
396  return false;
397  }
398 
399  // The point p is inside the tetrahedron if r1 + r2 + r3 < 1 and
400  // 0 <= ri <= 1 for i = 1,2,3.
401  return
402  r(0) > -tol &&
403  r(1) > -tol &&
404  r(2) > -tol &&
405  r(0) + r(1) + r(2) < 1.0 + tol;
406 }
TensorValue< Real > RealTensorValue
Useful typedefs to allow transparent switching between Real and Complex data types.
const Point & point(const unsigned int i) const
Definition: elem.h:2277

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

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

743 {
744  // Our vertices are the first numbered nodes
745  const unsigned int nv = e->n_vertices();
746  const unsigned int my_nv = this->n_vertices();
747 
748  // Check for vertex-to-vertex containment first; contains_point() is
749  // expensive
750  for (auto n : make_range(nv))
751  {
752  const Node * vertex = e->node_ptr(n);
753  for (auto my_n : make_range(my_nv))
754  if (&this->node_ref(my_n) == vertex)
755  return true;
756  }
757 
758  // If e is in our mesh, then we might be done testing
759  if (mesh_connection)
760  {
761  const unsigned int l = this->level();
762  const unsigned int el = e->level();
763 
764  if (l >= el)
765  return false;
766 
767  // We could also return false for l==el-1 iff we knew we had no
768  // triangular faces, but we don't have an API to check that.
769  }
770 
771  // Our vertices are the first numbered nodes
772  for (auto n : make_range(nv))
773  if (this->contains_point(e->point(n)))
774  return true;
775  return false;
776 }
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2375
const Node & node_ref(const unsigned int i) const
Definition: elem.h:2353
unsigned int level() const
Definition: elem.h:2911
virtual unsigned int n_vertices() const =0
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:134

◆ contract()

void libMesh::Elem::contract ( )
inherited

Contract an active element, i.e.

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

Definition at line 228 of file elem_refinement.C.

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

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

◆ debug_buffer()

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

Print our buffer for debugging.

Definition at line 660 of file dof_object.C.

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

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

◆ default_order()

Order libMesh::Tet4::default_order ( ) const
overridevirtual
Returns
FIRST.

Implements libMesh::Elem.

Definition at line 154 of file cell_tet4.C.

References libMesh::FIRST.

155 {
156  return FIRST;
157 }

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

References libMesh::Elem::default_order().

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

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

◆ diagonal_selection()

Diagonal libMesh::Tet::diagonal_selection ( ) const
inlineinherited
Returns
The diagonal that has been selected during refinement.

Definition at line 173 of file cell_tet.h.

References libMesh::Tet::_diagonal_selection.

Referenced by libMesh::Tet::embedding_matrix_version().

173 { return _diagonal_selection; }
Diagonal _diagonal_selection
The currently-selected diagonal used during refinement.
Definition: cell_tet.h:237

◆ dim()

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

Implements libMesh::Elem.

Definition at line 61 of file cell.h.

61 { return 3; }

◆ disable_print_counter_info() [1/2]

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 100 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

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

◆ disable_print_counter_info() [2/2]

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 100 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

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

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

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

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

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

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

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

1051 {
1052  libmesh_assert_less (s, this->n_systems());
1053  libmesh_assert_less (vg, this->n_var_groups(s));
1054  libmesh_assert_less (vig, this->n_vars(s,vg));
1055 
1056  const unsigned int
1057  start_idx_sys = this->start_idx(s);
1058 
1059  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1060 
1061  const dof_id_type
1062  base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
1063 
1064  // if the first component is invalid, they
1065  // are all invalid
1066  if (base_idx == invalid_id)
1067  return invalid_id;
1068 
1069  // otherwise the index is the first component
1070  // index augmented by the component number
1071  else
1072  return cast_int<dof_id_type>(base_idx + vig*n_comp + comp);
1073 }
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:995
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_systems() const
Definition: dof_object.h:930
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
index_buffer_t _idx_buf
Definition: dof_object.h:675
uint8_t dof_id_type
Definition: id_types.h:67

◆ edge_index_range()

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

Definition at line 2501 of file elem.h.

References libMesh::Elem::n_edges().

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

2502 {
2503  return {0, cast_int<unsigned short>(this->n_edges())};
2504 }
virtual unsigned int n_edges() const =0

◆ embedding_matrix()

Real libMesh::Tet4::embedding_matrix ( const unsigned int  i,
const unsigned int  j,
const unsigned int  k 
) const
overrideprotectedvirtual

Matrix used to create the elements children.

Implements libMesh::Elem.

Definition at line 411 of file cell_tet4.C.

References libMesh::Tet::_diagonal_selection, _embedding_matrix, libMesh::Tet::choose_diagonal(), and libMesh::Tet::DIAG_02_13.

414 {
415  // Choose an optimal diagonal, if one has not already been selected
416  this->choose_diagonal();
417 
418  // Permuted j and k indices
419  unsigned int
420  jp=j,
421  kp=k;
422 
423  if ((i>3) && (this->_diagonal_selection!=DIAG_02_13))
424  {
425  // Just the enum value cast to an unsigned int...
426  const unsigned ds = static_cast<unsigned int>(this->_diagonal_selection);
427 
428  // Permute j, k:
429  // ds==1 ds==2
430  // 0 -> 1 0 -> 2
431  // 1 -> 2 1 -> 0
432  // 2 -> 0 2 -> 1
433  if (jp != 3)
434  jp = (jp+ds)%3;
435 
436  if (kp != 3)
437  kp = (kp+ds)%3;
438  }
439 
440  // Debugging
441  // libMesh::err << "Selected diagonal " << _diagonal_selection << std::endl;
442  // libMesh::err << "j=" << j << std::endl;
443  // libMesh::err << "k=" << k << std::endl;
444  // libMesh::err << "jp=" << jp << std::endl;
445  // libMesh::err << "kp=" << kp << std::endl;
446 
447  // Call embedding matrix with permuted indices
448  return this->_embedding_matrix[i][jp][kp];
449 }
Diagonal _diagonal_selection
The currently-selected diagonal used during refinement.
Definition: cell_tet.h:237
static const Real _embedding_matrix[num_children][num_nodes][num_nodes]
Matrix that computes new nodal locations/solution values from current nodes/solution.
Definition: cell_tet4.h:273
void choose_diagonal() const
Derived classes use this function to select an initial diagonal during refinement.
Definition: cell_tet.C:194

◆ embedding_matrix_version()

virtual unsigned int libMesh::Tet::embedding_matrix_version ( ) const
inlinefinaloverridevirtualinherited

Tetrahedral elements permute the embedding matrix depending on which interior diagonal is used to subdivide into child elements.

But we want to cache topology data based on that matrix. So we return a "version number" based on the diagonal selection.

Reimplemented from libMesh::Elem.

Definition at line 193 of file cell_tet.h.

References libMesh::Tet::choose_diagonal(), and libMesh::Tet::diagonal_selection().

194  {
195  this->choose_diagonal();
196  return this->diagonal_selection();
197  }
Diagonal diagonal_selection() const
Definition: cell_tet.h:173
void choose_diagonal() const
Derived classes use this function to select an initial diagonal during refinement.
Definition: cell_tet.C:194

◆ enable_print_counter_info() [1/2]

void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Definition at line 94 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

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

◆ enable_print_counter_info() [2/2]

void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Definition at line 94 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

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

◆ family_tree() [1/2]

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

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

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

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

Definition at line 1725 of file elem.C.

References libMesh::ElemInternal::family_tree().

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

◆ family_tree() [2/2]

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

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

Definition at line 1733 of file elem.C.

References libMesh::ElemInternal::family_tree().

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

◆ family_tree_by_neighbor() [1/2]

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

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

Definition at line 1809 of file elem.C.

References libMesh::ElemInternal::family_tree_by_neighbor().

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

◆ family_tree_by_neighbor() [2/2]

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

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

Definition at line 1818 of file elem.C.

References libMesh::ElemInternal::family_tree_by_neighbor().

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

◆ family_tree_by_side() [1/2]

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

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

Definition at line 1773 of file elem.C.

References libMesh::ElemInternal::family_tree_by_side().

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

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

◆ family_tree_by_side() [2/2]

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

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

Definition at line 1782 of file elem.C.

References libMesh::ElemInternal::family_tree_by_side().

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

◆ family_tree_by_subneighbor() [1/2]

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

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

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

Definition at line 1845 of file elem.C.

References libMesh::ElemInternal::family_tree_by_subneighbor().

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

◆ family_tree_by_subneighbor() [2/2]

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

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

Definition at line 1855 of file elem.C.

References libMesh::ElemInternal::family_tree_by_subneighbor().

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

◆ find_edge_neighbors() [1/2]

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

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

Definition at line 891 of file elem.C.

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

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

894 {
895  // Simple but perhaps suboptimal code: find elements containing the
896  // first point, then winnow this set down by removing elements which
897  // don't also contain the second point
898 
899  libmesh_assert(this->contains_point(p2));
900  this->find_point_neighbors(p1, neighbor_set);
901 
902  std::set<const Elem *>::iterator it = neighbor_set.begin();
903  const std::set<const Elem *>::iterator end = neighbor_set.end();
904 
905  while (it != end)
906  {
907  // As of C++11, set::erase returns an iterator to the element
908  // following the erased element, or end.
909  if (!(*it)->contains_point(p2))
910  it = neighbor_set.erase(it);
911  else
912  ++it;
913  }
914 }
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2375
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:801
libmesh_assert(ctx)

◆ find_edge_neighbors() [2/2]

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

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

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

Definition at line 918 of file elem.C.

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

919 {
920  neighbor_set.clear();
921  neighbor_set.insert(this);
922 
923  std::set<const Elem *> untested_set, next_untested_set;
924  untested_set.insert(this);
925 
926  while (!untested_set.empty())
927  {
928  // Loop over all the elements in the patch that haven't already
929  // been tested
930  for (const auto & elem : untested_set)
931  {
932  for (auto current_neighbor : elem->neighbor_ptr_range())
933  {
934  if (current_neighbor &&
935  current_neighbor != remote_elem) // we have a real neighbor on this side
936  {
937  if (current_neighbor->active()) // ... if it is active
938  {
939  if (this->contains_edge_of(current_neighbor) // ... and touches us
940  || current_neighbor->contains_edge_of(this))
941  {
942  // Make sure we'll test it
943  if (!neighbor_set.count(current_neighbor))
944  next_untested_set.insert (current_neighbor);
945 
946  // And add it
947  neighbor_set.insert (current_neighbor);
948  }
949  }
950 #ifdef LIBMESH_ENABLE_AMR
951  else // ... the neighbor is *not* active,
952  { // ... so add *all* neighboring
953  // active children
954  std::vector<const Elem *> active_neighbor_children;
955 
956  current_neighbor->active_family_tree_by_neighbor
957  (active_neighbor_children, elem);
958 
959  for (const auto & current_child : active_neighbor_children)
960  if (this->contains_edge_of(current_child) || current_child->contains_edge_of(this))
961  {
962  // Make sure we'll test it
963  if (!neighbor_set.count(current_child))
964  next_untested_set.insert (current_child);
965 
966  neighbor_set.insert (current_child);
967  }
968  }
969 #endif // #ifdef LIBMESH_ENABLE_AMR
970  }
971  }
972  }
973  untested_set.swap(next_untested_set);
974  next_untested_set.clear();
975  }
976 }
bool contains_edge_of(const Elem *e) const
Definition: elem.C:780
const RemoteElem * remote_elem
Definition: remote_elem.C:54

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

References libMesh::ElemInternal::find_interior_neighbors().

981 {
982  ElemInternal::find_interior_neighbors(this, neighbor_set);
983 }
void find_interior_neighbors(T this_elem, std::set< T > &neighbor_set)

◆ find_interior_neighbors() [2/2]

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

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

Definition at line 987 of file elem.C.

References libMesh::ElemInternal::find_interior_neighbors().

988 {
989  ElemInternal::find_interior_neighbors(this, neighbor_set);
990 }
void find_interior_neighbors(T this_elem, std::set< T > &neighbor_set)

◆ find_point_neighbors() [1/4]

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

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

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

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

Definition at line 801 of file elem.C.

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

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

803 {
804  libmesh_assert(this->contains_point(p));
805  libmesh_assert(this->active());
806 
807  neighbor_set.clear();
808  neighbor_set.insert(this);
809 
810  std::set<const Elem *> untested_set, next_untested_set;
811  untested_set.insert(this);
812 
813 #ifdef LIBMESH_ENABLE_AMR
814  std::vector<const Elem *> active_neighbor_children;
815 #endif // #ifdef LIBMESH_ENABLE_AMR
816 
817  while (!untested_set.empty())
818  {
819  // Loop over all the elements in the patch that haven't already
820  // been tested
821  for (const auto & elem : untested_set)
822  for (auto current_neighbor : elem->neighbor_ptr_range())
823  {
824  if (current_neighbor &&
825  current_neighbor != remote_elem) // we have a real neighbor on this side
826  {
827  if (current_neighbor->active()) // ... if it is active
828  {
829  auto it = neighbor_set.lower_bound(current_neighbor);
830  if ((it == neighbor_set.end() || *it != current_neighbor) &&
831  current_neighbor->contains_point(p)) // ... don't have and touches p
832  {
833  // Add it and test it
834  next_untested_set.insert(current_neighbor);
835  neighbor_set.emplace_hint(it, current_neighbor);
836  }
837  }
838 #ifdef LIBMESH_ENABLE_AMR
839  else // ... the neighbor is *not* active,
840  { // ... so add *all* neighboring
841  // active children that touch p
842  active_neighbor_children.clear();
843  current_neighbor->active_family_tree_by_neighbor
844  (active_neighbor_children, elem);
845 
846  for (const auto & current_child : active_neighbor_children)
847  {
848  auto it = neighbor_set.lower_bound(current_child);
849  if ((it == neighbor_set.end() || *it != current_child) &&
850  current_child->contains_point(p))
851  {
852  // Add it and test it
853  next_untested_set.insert(current_child);
854  neighbor_set.emplace_hint(it, current_child);
855  }
856  }
857  }
858 #endif // #ifdef LIBMESH_ENABLE_AMR
859  }
860  }
861  untested_set.swap(next_untested_set);
862  next_untested_set.clear();
863  }
864 }
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2375
libmesh_assert(ctx)
bool active() const
Definition: elem.h:2778
const RemoteElem * remote_elem
Definition: remote_elem.C:54

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

References libMesh::Elem::find_point_neighbors().

869 {
870  this->find_point_neighbors(neighbor_set, this);
871 }
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:801

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

References libMesh::ElemInternal::find_point_neighbors().

877 {
878  ElemInternal::find_point_neighbors(this, neighbor_set, start_elem);
879 }
void find_point_neighbors(T this_elem, std::set< T > &neighbor_set, T start_elem)

◆ find_point_neighbors() [4/4]

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

Non-const version of function above.

Fills a set of non-const Elem pointers.

Definition at line 883 of file elem.C.

References libMesh::ElemInternal::find_point_neighbors().

885 {
886  ElemInternal::find_point_neighbors(this, neighbor_set, start_elem);
887 }
void find_point_neighbors(T this_elem, std::set< T > &neighbor_set, T start_elem)

◆ first_order_equivalent_type()

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

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

Definition at line 2692 of file elem.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::INFEDGE2, libMesh::INFHEX16, libMesh::INFHEX18, libMesh::INFHEX8, libMesh::INFPRISM12, libMesh::INFPRISM6, libMesh::INFQUAD4, libMesh::INFQUAD6, libMesh::INVALID_ELEM, libMesh::NODEELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM20, libMesh::PRISM21, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID18, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::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().

2693 {
2694  switch (et)
2695  {
2696  case NODEELEM:
2697  return NODEELEM;
2698  case EDGE2:
2699  case EDGE3:
2700  case EDGE4:
2701  return EDGE2;
2702  case TRI3:
2703  case TRI6:
2704  case TRI7:
2705  return TRI3;
2706  case TRISHELL3:
2707  return TRISHELL3;
2708  case QUAD4:
2709  case QUAD8:
2710  case QUAD9:
2711  return QUAD4;
2712  case QUADSHELL4:
2713  case QUADSHELL8:
2714  return QUADSHELL4;
2715  case TET4:
2716  case TET10:
2717  case TET14:
2718  return TET4;
2719  case HEX8:
2720  case HEX27:
2721  case HEX20:
2722  return HEX8;
2723  case PRISM6:
2724  case PRISM15:
2725  case PRISM18:
2726  case PRISM20:
2727  case PRISM21:
2728  return PRISM6;
2729  case PYRAMID5:
2730  case PYRAMID13:
2731  case PYRAMID14:
2732  case PYRAMID18:
2733  return PYRAMID5;
2734 
2735 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2736 
2737  case INFEDGE2:
2738  return INFEDGE2;
2739  case INFQUAD4:
2740  case INFQUAD6:
2741  return INFQUAD4;
2742  case INFHEX8:
2743  case INFHEX16:
2744  case INFHEX18:
2745  return INFHEX8;
2746  case INFPRISM6:
2747  case INFPRISM12:
2748  return INFPRISM6;
2749 
2750 #endif
2751 
2752  default:
2753  // unknown element
2754  return INVALID_ELEM;
2755  }
2756 }

◆ flip()

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

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

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

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

Implements libMesh::Elem.

Definition at line 614 of file cell_tet4.C.

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

615 {
616  swap2nodes(0,2);
617  swap2neighbors(1,2);
618  swap2boundarysides(1,2,boundary_info);
619  swap2boundaryedges(0,1,boundary_info);
620  swap2boundaryedges(3,5,boundary_info);
621 }
void swap2boundaryedges(unsigned short e1, unsigned short e2, BoundaryInfo *boundary_info) const
Swaps two edges in boundary_info, if it is non-null.
Definition: elem.C:3171
void swap2boundarysides(unsigned short s1, unsigned short s2, BoundaryInfo *boundary_info) const
Swaps two sides in boundary_info, if it is non-null.
Definition: elem.C:3155
void swap2nodes(unsigned int n1, unsigned int n2)
Swaps two node_ptrs.
Definition: elem.h:1933
void swap2neighbors(unsigned int n1, unsigned int n2)
Swaps two neighbor_ptrs.
Definition: elem.h:1943

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

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

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

1140 {
1141 #ifndef NDEBUG
1142  const unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
1143 #endif
1144  libmesh_assert_less(index+n_more_integers, this->n_extra_integers());
1145  libmesh_assert_less(this->n_systems(), _idx_buf.size());
1146 
1147  const unsigned int start_idx_i = this->start_idx_ints();
1148 
1149  libmesh_assert_less(start_idx_i+index+n_more_integers, _idx_buf.size());
1150  T returnval;
1151  std::memcpy(&returnval, &_idx_buf[start_idx_i+index], sizeof(T));
1152  return returnval;
1153 }
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1266
unsigned int n_systems() const
Definition: dof_object.h:930
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1163
index_buffer_t _idx_buf
Definition: dof_object.h:675
uint8_t dof_id_type
Definition: id_types.h:67

◆ get_extra_integer()

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

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

Definition at line 1095 of file dof_object.h.

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

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

1096 {
1097  libmesh_assert_less(index, this->n_extra_integers());
1098  libmesh_assert_less(this->n_systems(), _idx_buf.size());
1099 
1100  const unsigned int start_idx_i = this->start_idx_ints();
1101 
1102  libmesh_assert_less(start_idx_i+index, _idx_buf.size());
1103  return _idx_buf[start_idx_i+index];
1104 }
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1266
unsigned int n_systems() const
Definition: dof_object.h:930
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1163
index_buffer_t _idx_buf
Definition: dof_object.h:675

◆ get_info() [1/3]

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

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

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

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

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

◆ get_info() [2/3]

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

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

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

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

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

◆ get_info() [3/3]

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

Prints relevant information about the element to a string.

Definition at line 2549 of file elem.C.

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

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

2550 {
2551  std::ostringstream oss;
2552 
2553  oss << " Elem Information" << '\n'
2554  << " id()=";
2555 
2556  if (this->valid_id())
2557  oss << this->id();
2558  else
2559  oss << "invalid";
2560 
2561 #ifdef LIBMESH_ENABLE_UNIQUE_ID
2562  oss << ", unique_id()=";
2563  if (this->valid_unique_id())
2564  oss << this->unique_id();
2565  else
2566  oss << "invalid";
2567 #endif
2568 
2569  oss << ", subdomain_id()=" << this->subdomain_id();
2570  oss << ", processor_id()=" << this->processor_id() << '\n';
2571 
2572  oss << " type()=" << Utility::enum_to_string(this->type()) << '\n'
2573  << " dim()=" << this->dim() << '\n'
2574  << " n_nodes()=" << this->n_nodes() << '\n';
2575 
2576  oss << " mapping=" << Utility::enum_to_string(this->mapping_type()) << '\n';
2577 
2578  for (auto n : this->node_index_range())
2579  {
2580  oss << " " << n << this->node_ref(n);
2581  if (this->mapping_type() == RATIONAL_BERNSTEIN_MAP)
2582  {
2583  const unsigned char datum_index = this->mapping_data();
2584  oss << " weight=" <<
2585  this->node_ref(n).get_extra_datum<Real>(datum_index) << '\n';
2586  }
2587  }
2588 
2589  oss << " n_sides()=" << this->n_sides() << '\n';
2590 
2591  for (auto s : this->side_index_range())
2592  {
2593  oss << " neighbor(" << s << ")=";
2594  if (this->neighbor_ptr(s))
2595  oss << this->neighbor_ptr(s)->id() << '\n';
2596  else
2597  oss << "nullptr\n";
2598  }
2599 
2600  if (!this->infinite())
2601  {
2602  oss << " hmin()=" << this->hmin()
2603  << ", hmax()=" << this->hmax() << '\n'
2604  << " volume()=" << this->volume() << '\n';
2605  }
2606  oss << " active()=" << this->active()
2607  << ", ancestor()=" << this->ancestor()
2608  << ", subactive()=" << this->subactive()
2609  << ", has_children()=" << this->has_children() << '\n'
2610  << " parent()=";
2611  if (this->parent())
2612  oss << this->parent()->id() << '\n';
2613  else
2614  oss << "nullptr\n";
2615  oss << " level()=" << this->level()
2616  << ", p_level()=" << this->p_level() << '\n'
2617 #ifdef LIBMESH_ENABLE_AMR
2618  << " refinement_flag()=" << Utility::enum_to_string(this->refinement_flag()) << '\n'
2619  << " p_refinement_flag()=" << Utility::enum_to_string(this->p_refinement_flag()) << '\n'
2620 #endif
2621 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2622  << " infinite()=" << this->infinite() << '\n';
2623  if (this->infinite())
2624  oss << " origin()=" << this->origin() << '\n'
2625 #endif
2626  ;
2627 
2628  oss << " DoFs=";
2629  for (auto s : make_range(this->n_systems()))
2630  for (auto v : make_range(this->n_vars(s)))
2631  for (auto c : make_range(this->n_comp(s,v)))
2632  oss << '(' << s << '/' << v << '/' << this->dof_number(s,v,c) << ") ";
2633 
2634 
2635  return oss.str();
2636 }
unsigned char mapping_data() const
Definition: elem.h:2973
RefinementState refinement_flag() const
Definition: elem.h:3047
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:1025
const Elem * parent() const
Definition: elem.h:2867
virtual Point origin() const
Definition: elem.h:1767
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:995
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2510
RefinementState p_refinement_flag() const
Definition: elem.h:3063
unique_id_type unique_id() const
Definition: dof_object.h:839
unsigned int p_level() const
Definition: elem.h:2945
virtual Real hmax() const
Definition: elem.C:532
bool ancestor() const
Definition: elem.C:1634
ElemMappingType mapping_type() const
Definition: elem.h:2957
const Node & node_ref(const unsigned int i) const
Definition: elem.h:2353
dof_id_type id() const
Definition: dof_object.h:823
virtual Real hmin() const
Definition: elem.C:512
virtual unsigned int n_nodes() const =0
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_systems() const
Definition: dof_object.h:930
bool valid_unique_id() const
Definition: dof_object.h:886
std::string enum_to_string(const T e)
virtual unsigned int n_sides() const =0
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2407
unsigned int level() const
Definition: elem.h:2911
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
subdomain_id_type subdomain_id() const
Definition: elem.h:2391
bool valid_id() const
Definition: dof_object.h:878
virtual unsigned short dim() const =0
bool subactive() const
Definition: elem.h:2796
virtual Real volume() const
Definition: elem.C:3050
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:134
IntRange< unsigned short > node_index_range() const
Definition: elem.h:2492
T get_extra_datum(const unsigned int index) const
Gets the value on this object of the extra datum associated with index, which should have been obtain...
Definition: dof_object.h:1139
virtual bool infinite() const =0
bool active() const
Definition: elem.h:2778
processor_id_type processor_id() const
Definition: dof_object.h:898
virtual ElemType type() const =0
bool has_children() const
Definition: elem.h:2816

◆ get_node_index()

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

Definition at line 2369 of file elem.h.

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

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

2370 {
2371  for (auto n : make_range(this->n_nodes()))
2372  if (this->_nodes[n] == node_ptr)
2373  return n;
2374 
2375  return libMesh::invalid_uint;
2376 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2087
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:286
virtual unsigned int n_nodes() const =0
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2331
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:134

◆ get_nodes()

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

Definition at line 2323 of file elem.h.

References libMesh::Elem::_nodes.

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

2324 {
2325  return _nodes;
2326 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2087

◆ get_old_dof_object() [1/2]

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

◆ get_old_dof_object() [2/2]

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

Definition at line 97 of file dof_object.h.

References libMesh::DofObject::old_dof_object.

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

◆ get_old_dof_object_ref() [1/2]

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

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

Definition at line 104 of file dof_object.h.

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

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

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

◆ get_old_dof_object_ref() [2/2]

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

Definition at line 110 of file dof_object.h.

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

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

◆ hack_p_level()

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

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

Definition at line 3101 of file elem.h.

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

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

3102 {
3103  if (p == 0)
3104  libmesh_assert_not_equal_to
3106 
3107  _p_level = cast_int<unsigned char>(p);
3108 }
unsigned char _p_level
p refinement level - the difference between the polynomial degree on this element and the minimum pol...
Definition: elem.h:2132
RefinementState p_refinement_flag() const
Definition: elem.h:3063

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

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

3114 {
3115  _pflag = cast_int<unsigned char>(pflag);
3116  this->hack_p_level(p);
3117 }
unsigned char _pflag
p refinement flag.
Definition: elem.h:2122
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:3101

◆ has_affine_map()

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

Reimplemented from libMesh::Elem.

Definition at line 136 of file cell_tet4.h.

136 { return true; }

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

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

2831 {
2832 #ifdef LIBMESH_ENABLE_AMR
2833  if (!_children)
2834  return false;
2835  else
2836  for (auto & c : child_ref_range())
2837  if (c.has_children())
2838  return true;
2839 #endif
2840  return false;
2841 }
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:2188
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2103

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

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

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

1220 {
1221  if (sys == libMesh::invalid_uint)
1222  {
1223  for (auto s : make_range(this->n_systems()))
1224  if (this->n_vars(s))
1225  return true;
1226  }
1227 
1228  else
1229  {
1230  libmesh_assert_less (sys, this->n_systems());
1231 
1232  if (this->n_vars(sys))
1233  return true;
1234  }
1235 
1236  return false;
1237 }
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:286
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_systems() const
Definition: dof_object.h:930
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:134

◆ has_extra_integers()

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

◆ has_invertible_map()

bool libMesh::Tet4::has_invertible_map ( Real  tol) const
overridevirtual
Returns
true if the element has non-zero volume(), false otherwise.

Reimplemented from libMesh::Elem.

Definition at line 124 of file cell_tet4.C.

References volume().

125 {
126  return this->volume() > tol;
127 }
virtual Real volume() const override
An optimized method for computing the area of a 4-node tetrahedron.
Definition: cell_tet4.C:321

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

References libMesh::Elem::neighbor_ptr_range().

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

2438 {
2439  for (auto n : this->neighbor_ptr_range())
2440  if (n == elem)
2441  return true;
2442 
2443  return false;
2444 }
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Returns a range with all neighbors of an element, usable in range-based for loops.
Definition: elem.h:3326

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

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

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

1162 {
1163  // First see if this is a normal "interior" neighbor
1164  if (has_neighbor(elem))
1165  return true;
1166 
1167  for (auto n : this->side_index_range())
1168  if (this->topological_neighbor(n, mesh, point_locator, pb))
1169  return true;
1170 
1171  return false;
1172 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2437
const Elem * topological_neighbor(const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
Definition: elem.C:1121
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2510
MeshBase & mesh

◆ hmax()

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

Definition at line 532 of file elem.C.

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

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

533 {
534  Real h_max=0;
535 
536  // Avoid calling a virtual a lot of times
537  const auto n_vertices = this->n_vertices();
538 
539  for (unsigned int n_outer=0; n_outer<n_vertices; n_outer++)
540  for (unsigned int n_inner=n_outer+1; n_inner<n_vertices; n_inner++)
541  {
542  const auto diff = (this->point(n_outer) - this->point(n_inner));
543 
544  h_max = std::max(h_max, diff.norm_sq());
545  }
546 
547  return std::sqrt(h_max);
548 }
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
Definition: type_vector.h:53
virtual unsigned int n_vertices() const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Point & point(const unsigned int i) const
Definition: elem.h:2277

◆ hmin()

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

Definition at line 512 of file elem.C.

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

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

513 {
514  Real h_min=std::numeric_limits<Real>::max();
515 
516  // Avoid calling a virtual a lot of times
517  const auto n_vertices = this->n_vertices();
518 
519  for (unsigned int n_outer=0; n_outer<n_vertices; n_outer++)
520  for (unsigned int n_inner=n_outer+1; n_inner<n_vertices; n_inner++)
521  {
522  const auto diff = (this->point(n_outer) - this->point(n_inner));
523 
524  h_min = std::min(h_min, diff.norm_sq());
525  }
526 
527  return std::sqrt(h_min);
528 }
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
Definition: type_vector.h:53
virtual unsigned int n_vertices() const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Point & point(const unsigned int i) const
Definition: elem.h:2277

◆ id()

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

Definition at line 823 of file dof_object.h.

References libMesh::DofObject::_id.

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

824 {
825  return _id;
826 }
dof_id_type _id
The id of the DofObject.
Definition: dof_object.h:578

◆ increment_constructor_count() [1/2]

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

Increments the construction counter.

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

Definition at line 183 of file reference_counter.h.

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

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

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

◆ increment_constructor_count() [2/2]

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

Increments the construction counter.

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

Definition at line 183 of file reference_counter.h.

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

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

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

◆ increment_destructor_count() [1/2]

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

Increments the destruction counter.

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

Definition at line 207 of file reference_counter.h.

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

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

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

◆ increment_destructor_count() [2/2]

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

Increments the destruction counter.

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

Definition at line 207 of file reference_counter.h.

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

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

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

◆ infinite() [1/2]

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

Implements libMesh::Elem.

Definition at line 75 of file cell.h.

75 { return false; }

◆ infinite() [2/2]

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

Definition at line 1771 of file elem.h.

1771 { return false; }

◆ interior_parent() [1/2]

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

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

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

Definition at line 994 of file elem.C.

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

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

995 {
996  // interior parents make no sense for full-dimensional elements.
997  if (this->dim() >= LIBMESH_DIM)
998  return nullptr;
999 
1000  // they USED TO BE only good for level-0 elements, but we now
1001  // support keeping interior_parent() valid on refined boundary
1002  // elements.
1003  // if (this->level() != 0)
1004  // return this->parent()->interior_parent();
1005 
1006  // We store the interior_parent pointer after both the parent
1007  // neighbor and neighbor pointers
1008  Elem * interior_p = _elemlinks[1+this->n_sides()];
1009 
1010  // If we have an interior_parent, we USED TO assume it was a
1011  // one-higher-dimensional interior element, but we now allow e.g.
1012  // edge elements to have a 3D interior_parent with no
1013  // intermediate 2D element.
1014  // libmesh_assert (!interior_p ||
1015  // interior_p->dim() == (this->dim()+1));
1016  libmesh_assert (!interior_p ||
1017  (interior_p == remote_elem) ||
1018  (interior_p->dim() > this->dim()));
1019 
1020  // If an element in a multi-dimensional mesh has an interior_parent
1021  // link, it should be at our level or coarser, just like a neighbor
1022  // link. Our collect_families() code relies on this, but it might
1023  // be tempting for users to manually assign something that breaks
1024  // it.
1025  //
1026  // However, we *also* create temporary side elements, and we don't
1027  // bother with creating ancestors for those, so they can be at level
1028  // 0 even when they're sides of non-level-0 elements.
1029  libmesh_assert (!interior_p ||
1030  (interior_p->level() <= this->level()) ||
1031  (this->level() == 0 &&
1032  this->id() == DofObject::invalid_id));
1033 
1034  return interior_p;
1035 }
dof_id_type id() const
Definition: dof_object.h:823
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2093
libmesh_assert(ctx)
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220
virtual unsigned int n_sides() const =0
unsigned int level() const
Definition: elem.h:2911
virtual unsigned short dim() const =0
const RemoteElem * remote_elem
Definition: remote_elem.C:54

◆ interior_parent() [2/2]

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

Definition at line 1039 of file elem.C.

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

1040 {
1041  // See the const version for comments
1042  if (this->dim() >= LIBMESH_DIM)
1043  return nullptr;
1044 
1045  Elem * interior_p = _elemlinks[1+this->n_sides()];
1046 
1047  libmesh_assert (!interior_p ||
1048  (interior_p == remote_elem) ||
1049  (interior_p->dim() > this->dim()));
1050 
1051  return interior_p;
1052 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2093
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220
virtual unsigned int n_sides() const =0
virtual unsigned short dim() const =0
const RemoteElem * remote_elem
Definition: remote_elem.C:54

◆ invalidate()

void libMesh::DofObject::invalidate ( )
inlineinherited

Invalidates all the indices for this DofObject.

Definition at line 783 of file dof_object.h.

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

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

784 {
785  this->invalidate_dofs ();
786  this->invalidate_id ();
787  this->invalidate_processor_id ();
788 }
void invalidate_id()
Sets the id to invalid_id.
Definition: dof_object.h:767
void invalidate_processor_id()
Sets the processor id to invalid_processor_id.
Definition: dof_object.h:775
void invalidate_dofs(const unsigned int sys_num=libMesh::invalid_uint)
Sets all degree of freedom numbers to invalid_id.
Definition: dof_object.h:746

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

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

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

747 {
748  const unsigned int n_sys = this->n_systems();
749  // If the user does not specify the system number...
750  if (sys_num >= n_sys)
751  {
752  for (auto s : make_range(n_sys))
753  for (auto vg : make_range(this->n_var_groups(s)))
754  if (this->n_comp_group(s,vg))
755  this->set_vg_dof_base(s,vg,invalid_id);
756  }
757  // ...otherwise invalidate the dofs for all systems
758  else
759  for (auto vg : make_range(this->n_var_groups(sys_num)))
760  if (this->n_comp_group(sys_num,vg))
761  this->set_vg_dof_base(sys_num,vg,invalid_id);
762 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
void set_vg_dof_base(const unsigned int s, const unsigned int vg, const dof_id_type db)
VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for di...
Definition: dof_object.h:1290
unsigned int n_systems() const
Definition: dof_object.h:930
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
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:134
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1008

◆ invalidate_id()

void libMesh::DofObject::invalidate_id ( )
inlineinherited

Sets the id to invalid_id.

Definition at line 767 of file dof_object.h.

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

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

768 {
769  this->set_id (invalid_id);
770 }
dof_id_type & set_id()
Definition: dof_object.h:831
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477

◆ invalidate_processor_id()

void libMesh::DofObject::invalidate_processor_id ( )
inlineinherited

Sets the processor id to invalid_processor_id.

Definition at line 775 of file dof_object.h.

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

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

776 {
778 }
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
Definition: dof_object.h:488
processor_id_type processor_id() const
Definition: dof_object.h:898

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

References libMesh::Elem::parent().

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

2851 {
2852 #ifdef LIBMESH_ENABLE_AMR
2853  const Elem * e = descendant;
2854  while (e)
2855  {
2856  if (this == e)
2857  return true;
2858  e = e->parent();
2859  }
2860 #endif
2861  return false;
2862 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220

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

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

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

1932 {
1933  libmesh_assert_less (c, this->n_children());
1934  libmesh_assert_less (e, this->n_edges());
1935 
1936  std::unique_ptr<const Elem> my_edge = this->build_edge_ptr(e);
1937  std::unique_ptr<const Elem> child_edge = this->child_ptr(c)->build_edge_ptr(e);
1938 
1939  // We're assuming that an overlapping child edge has the same
1940  // number and orientation as its parent
1941  return (child_edge->node_id(0) == my_edge->node_id(0) ||
1942  child_edge->node_id(1) == my_edge->node_id(1));
1943 }
virtual unsigned int n_children() const =0
virtual unsigned int n_edges() const =0
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i)=0
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:3000

◆ is_child_on_side()

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

Implements libMesh::Elem.

Definition at line 93 of file cell_tet4.C.

References libMesh::Tet::is_child_on_side_helper().

95 {
96  // OK, for the Tet4, this is pretty obvious... it is sets of nodes
97  // not equal to the current node. But if we want this algorithm to
98  // be generic and work for Tet10 also it helps to do it this way.
99  const unsigned int nodes_opposite[4][3] =
100  {
101  {1,2,3}, // nodes opposite node 0
102  {0,2,3}, // nodes opposite node 1
103  {0,1,3}, // nodes opposite node 2
104  {0,1,2} // nodes opposite node 3
105  };
106 
107  // Call the base class helper function
108  return Tet::is_child_on_side_helper(c, s, nodes_opposite);
109 }
bool is_child_on_side_helper(const unsigned int c, const unsigned int s, const unsigned int checked_nodes[][3]) const
Called by descendant classes with appropriate data to determine if child c is on side s...
Definition: cell_tet.C:142

◆ is_child_on_side_helper()

bool libMesh::Tet::is_child_on_side_helper ( const unsigned int  c,
const unsigned int  s,
const unsigned int  checked_nodes[][3] 
) const
protectedinherited

Called by descendant classes with appropriate data to determine if child c is on side s.

Only works if LIBMESH_ENABLE_AMR.

Definition at line 142 of file cell_tet.C.

References std::abs(), libMesh::Elem::embedding_matrix(), libMesh::Tet::n_children(), libMesh::Tet::n_sides(), libMesh::Real, and side_nodes_map.

Referenced by is_child_on_side(), libMesh::Tet10::is_child_on_side(), and libMesh::Tet14::is_child_on_side().

145 {
146  libmesh_assert_less (c, this->n_children());
147  libmesh_assert_less (s, this->n_sides());
148 
149  // For the 4 vertices, child c touches vertex c, so we can return
150  // true if that vertex is on side s
151  for (unsigned int i = 0; i != 3; ++i)
152  if (Tet4::side_nodes_map[s][i] == c)
153  return true;
154 
155  // If we are a "vertex child" and we didn't already return true,
156  // we must not be on the side in question
157  if (c < 4)
158  return false;
159 
160  // For the 4 non-vertex children, the child ordering depends on the
161  // diagonal selection. We'll let the embedding matrix figure that
162  // out: if this child has three nodes that don't depend on the
163  // position of the node_facing_side[s], then we're on side s. Which
164  // three nodes those are depends on the subclass, so their responsibility
165  // is to call this function with the proper check_nodes array
166  const unsigned int node_facing_side[4] = {3, 2, 0, 1};
167  const unsigned int n = node_facing_side[s];
168 
169  // Add up the absolute values of the entries of the embedding matrix for the
170  // nodes opposite node n. If it is equal to zero, then the child in question is
171  // on side s, so return true.
172  Real embedding_sum = 0.;
173  for (unsigned i=0; i<3; ++i)
174  embedding_sum += std::abs(this->embedding_matrix(c, checked_nodes[n][i], n));
175 
176  return ( std::abs(embedding_sum) < 1.e-3 );
177 }
static const 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:196
virtual unsigned int n_sides() const override final
Definition: cell_tet.h:74
virtual unsigned int n_children() const override final
Definition: cell_tet.h:94
virtual Real embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
Definition: type_vector.h:57
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ is_edge()

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

Implements libMesh::Elem.

Definition at line 68 of file cell_tet4.C.

69 {
70  return false;
71 }

◆ is_edge_on_side()

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

Implements libMesh::Elem.

Definition at line 218 of file cell_tet.C.

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

220 {
221  libmesh_assert_less (e, this->n_edges());
222  libmesh_assert_less (s, this->n_sides());
223 
224  return (edge_sides_map[e][0] == s || edge_sides_map[e][1] == s);
225 }
static const unsigned int edge_sides_map[6][2]
This maps each edge to the sides that contain said edge.
Definition: cell_tet.h:211
virtual unsigned int n_sides() const override final
Definition: cell_tet.h:74
virtual unsigned int n_edges() const override final
Definition: cell_tet.h:84

◆ is_face()

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

Implements libMesh::Elem.

Definition at line 73 of file cell_tet4.C.

74 {
75  return false;
76 }

◆ is_flipped()

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

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

Implements libMesh::Elem.

Definition at line 238 of file cell_tet.C.

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

239 {
240  return (triple_product(this->point(1)-this->point(0),
241  this->point(2)-this->point(0),
242  this->point(3)-this->point(0)) < 0);
243 }
T triple_product(const TypeVector< T > &a, const TypeVector< T > &b, const TypeVector< T > &c)
Definition: type_vector.h:1068
const Point & point(const unsigned int i) const
Definition: elem.h:2277

◆ is_linear()

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

Reimplemented from libMesh::Elem.

Definition at line 147 of file cell_tet4.h.

147 { return true; }

◆ is_mid_infinite_edge_node()

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

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

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

Definition at line 1758 of file elem.h.

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

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

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

◆ is_node_on_edge()

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

Implements libMesh::Elem.

Definition at line 78 of file cell_tet4.C.

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

80 {
81  libmesh_assert_less (e, n_edges());
82  return std::find(std::begin(edge_nodes_map[e]),
83  std::end(edge_nodes_map[e]),
84  n) != std::end(edge_nodes_map[e]);
85 }
virtual unsigned int n_edges() const override final
Definition: cell_tet.h:84
static const 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:202

◆ is_node_on_side()

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

Implements libMesh::Elem.

Definition at line 131 of file cell_tet4.C.

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

133 {
134  libmesh_assert_less (s, n_sides());
135  return std::find(std::begin(side_nodes_map[s]),
136  std::end(side_nodes_map[s]),
137  n) != std::end(side_nodes_map[s]);
138 }
static const 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:196
virtual unsigned int n_sides() const override final
Definition: cell_tet.h:74

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

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

577  { return false; }

◆ is_semilocal()

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

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

Definition at line 665 of file elem.C.

References libMesh::Elem::find_point_neighbors().

666 {
667  std::set<const Elem *> point_neighbors;
668 
669  this->find_point_neighbors(point_neighbors);
670 
671  for (const auto & elem : point_neighbors)
672  if (elem->processor_id() == my_pid)
673  return true;
674 
675  return false;
676 }
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:801

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

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

1691 { return false; }

◆ is_vertex()

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

Implements libMesh::Elem.

Definition at line 63 of file cell_tet4.C.

64 {
65  return true;
66 }

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

References libMesh::Elem::is_vertex().

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

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

◆ is_vertex_on_parent()

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

Definition at line 3108 of file elem.C.

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

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

3110 {
3111 #ifdef LIBMESH_ENABLE_AMR
3112 
3113  unsigned int my_n_vertices = this->n_vertices();
3114  for (unsigned int n_parent = 0; n_parent != my_n_vertices;
3115  ++n_parent)
3116  if (this->node_ptr(n_parent) == this->child_ptr(c)->node_ptr(n))
3117  return true;
3118  return false;
3119 
3120 #else
3121 
3122  // No AMR?
3123  libmesh_ignore(c,n);
3124  libmesh_error_msg("ERROR: AMR disabled, how did we get here?");
3125  return true;
3126 
3127 #endif
3128 }
void libmesh_ignore(const Args &...)
virtual unsigned int n_vertices() const =0
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2331
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:3000

◆ key() [1/5]

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

Implements libMesh::Elem.

Definition at line 64 of file cell_tet.C.

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

65 {
66  libmesh_assert_less (s, this->n_sides());
67 
68  return this->compute_key(this->node_id(Tet4::side_nodes_map[s][0]),
69  this->node_id(Tet4::side_nodes_map[s][1]),
70  this->node_id(Tet4::side_nodes_map[s][2]));
71 }
static const 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:196
virtual unsigned int n_sides() const override final
Definition: cell_tet.h:74
static dof_id_type compute_key(dof_id_type n0)
Definition: elem.h:3131
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2299

◆ key() [2/5]

dof_id_type libMesh::Tet::key
override

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

Definition at line 64 of file cell_tet.C.

65 {
66  libmesh_assert_less (s, this->n_sides());
67 
68  return this->compute_key(this->node_id(Tet4::side_nodes_map[s][0]),
69  this->node_id(Tet4::side_nodes_map[s][1]),
70  this->node_id(Tet4::side_nodes_map[s][2]));
71 }
static const 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:196
virtual unsigned int n_sides() const override final
Definition: cell_tet.h:74
static dof_id_type compute_key(dof_id_type n0)
Definition: elem.h:3131
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2299

◆ key() [3/5]

dof_id_type libMesh::Elem::key

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

Definition at line 563 of file elem.C.

564 {
565  const unsigned short n_n = this->n_nodes();
566 
567  std::array<dof_id_type, Elem::max_n_nodes> node_ids;
568 
569  for (unsigned short n=0; n != n_n; ++n)
570  node_ids[n] = this->node_id(n);
571 
572  // Always sort, so that different local node numberings hash to the
573  // same value.
574  std::sort (node_ids.begin(), node_ids.begin()+n_n);
575 
576  return Utility::hashword(node_ids.data(), n_n);
577 }
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval=0)
The hashword function takes an array of uint32_t&#39;s of length &#39;length&#39; and computes a single key from ...
Definition: hashword.h:153
virtual unsigned int n_nodes() const override
Definition: cell_tet4.h:85
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2299

◆ key() [4/5]

virtual dof_id_type libMesh::Elem::key

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

◆ key() [5/5]

dof_id_type libMesh::Tet4::key ( ) const
overridevirtual
Returns
An id associated with the global node ids of this element. The id is not necessarily unique, but should be close.

Reimplemented from libMesh::Elem.

Definition at line 364 of file cell_tet4.C.

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

365 {
366  return this->compute_key(this->node_id(0),
367  this->node_id(1),
368  this->node_id(2),
369  this->node_id(3));
370 }
static dof_id_type compute_key(dof_id_type n0)
Definition: elem.h:3131
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2299

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

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

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

554 {
555  libmesh_assert_less ( n1, this->n_vertices() );
556  libmesh_assert_less ( n2, this->n_vertices() );
557 
558  return (this->point(n1) - this->point(n2)).norm();
559 }
virtual unsigned int n_vertices() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:2277

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

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

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

2912 {
2913 #ifdef LIBMESH_ENABLE_AMR
2914 
2915  // if I don't have a parent I was
2916  // created directly from file
2917  // or by the user, so I am a
2918  // level-0 element
2919  if (this->parent() == nullptr)
2920  return 0;
2921 
2922  // if the parent and this element are of different
2923  // dimensionality we are at the same level as
2924  // the parent (e.g. we are the 2D side of a
2925  // 3D element)
2926  if (this->dim() != this->parent()->dim())
2927  return this->parent()->level();
2928 
2929  // otherwise we are at a level one
2930  // higher than our parent
2931  return (this->parent()->level() + 1);
2932 
2933 #else
2934 
2935  // Without AMR all elements are
2936  // at level 0.
2937  return 0;
2938 
2939 #endif
2940 }
const Elem * parent() const
Definition: elem.h:2867
unsigned int level() const
Definition: elem.h:2911
virtual unsigned short dim() const =0

◆ libmesh_assert_valid_neighbors()

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

Checks for consistent neighbor links on this element.

Definition at line 1191 of file elem.C.

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

1192 {
1193  for (auto n : this->side_index_range())
1194  {
1195  const Elem * neigh = this->neighbor_ptr(n);
1196 
1197  // Any element might have a remote neighbor; checking
1198  // to make sure that's not inaccurate is tough.
1199  if (neigh == remote_elem)
1200  continue;
1201 
1202  if (neigh)
1203  {
1204  // Only subactive elements have subactive neighbors
1205  libmesh_assert (this->subactive() || !neigh->subactive());
1206 
1207  const Elem * elem = this;
1208 
1209  // If we're subactive but our neighbor isn't, its
1210  // return neighbor link will be to our first active
1211  // ancestor OR to our inactive ancestor of the same
1212  // level as neigh,
1213  if (this->subactive() && !neigh->subactive())
1214  {
1215  for (elem = this; !elem->active();
1216  elem = elem->parent())
1217  libmesh_assert(elem);
1218  }
1219  else
1220  {
1221  unsigned int rev = neigh->which_neighbor_am_i(elem);
1222  libmesh_assert_less (rev, neigh->n_neighbors());
1223 
1224  if (this->subactive() && !neigh->subactive())
1225  {
1226  while (neigh->neighbor_ptr(rev) != elem)
1227  {
1228  libmesh_assert(elem->parent());
1229  elem = elem->parent();
1230  }
1231  }
1232  else
1233  {
1234  const Elem * nn = neigh->neighbor_ptr(rev);
1235  libmesh_assert(nn);
1236 
1237  for (; elem != nn; elem = elem->parent())
1238  libmesh_assert(elem);
1239  }
1240  }
1241  }
1242  // If we don't have a neighbor and we're not subactive, our
1243  // ancestors shouldn't have any neighbors in this same
1244  // direction.
1245  else if (!this->subactive())
1246  {
1247  const Elem * my_parent = this->parent();
1248  if (my_parent &&
1249  // A parent with a different dimension isn't really one of
1250  // our ancestors, it means we're on a boundary mesh and this
1251  // is an interior mesh element for which we're on a side.
1252  // Nothing to test for in that case.
1253  (my_parent->dim() == this->dim()))
1254  libmesh_assert (!my_parent->neighbor_ptr(n));
1255  }
1256  }
1257 }
const Elem * parent() const
Definition: elem.h:2867
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2510
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2407
virtual unsigned short dim() const =0
bool subactive() const
Definition: elem.h:2796
const RemoteElem * remote_elem
Definition: remote_elem.C:54

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

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

1180 {
1181  libmesh_assert(this->valid_id());
1182  for (auto n : this->node_index_range())
1183  {
1184  libmesh_assert(this->node_ptr(n));
1185  libmesh_assert(this->node_ptr(n)->valid_id());
1186  }
1187 }
libmesh_assert(ctx)
bool valid_id() const
Definition: dof_object.h:878
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2331
IntRange< unsigned short > node_index_range() const
Definition: elem.h:2492

◆ local_edge_node()

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

Implements libMesh::Elem.

Reimplemented in libMesh::Tet14, and libMesh::Tet10.

Definition at line 97 of file cell_tet.C.

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

99 {
100  libmesh_assert_less (edge, this->n_edges());
101  libmesh_assert_less (edge_node, Tet4::nodes_per_edge);
102 
103  return Tet4::edge_nodes_map[edge][edge_node];
104 }
virtual unsigned int n_edges() const override final
Definition: cell_tet.h:84
static const 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:202
static const int nodes_per_edge
Definition: cell_tet4.h:190

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

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

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

2312 {
2313  for (auto n : make_range(this->n_nodes()))
2314  if (this->node_id(n) == i)
2315  return n;
2316 
2317  return libMesh::invalid_uint;
2318 }
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:286
virtual unsigned int n_nodes() const =0
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:134
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2299

◆ local_side_node()

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

Implements libMesh::Elem.

Reimplemented in libMesh::Tet14, and libMesh::Tet10.

Definition at line 86 of file cell_tet.C.

References libMesh::Tet::n_sides(), nodes_per_side, and side_nodes_map.

88 {
89  libmesh_assert_less (side, this->n_sides());
90  libmesh_assert_less (side_node, Tet4::nodes_per_side);
91 
92  return Tet4::side_nodes_map[side][side_node];
93 }
static const 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:196
virtual unsigned int n_sides() const override final
Definition: cell_tet.h:74
static const int nodes_per_side
Definition: cell_tet4.h:189

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

References libMesh::invalid_uint.

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

1685  { return invalid_uint; }
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:286

◆ loose_bounding_box()

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

Reimplemented from libMesh::Elem.

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

Definition at line 26 of file cell.C.

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

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

◆ low_order_key()

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

Implements libMesh::Elem.

Definition at line 75 of file cell_tet.C.

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

76 {
77  libmesh_assert_less (s, this->n_sides());
78 
79  return this->compute_key(this->node_id(Tet4::side_nodes_map[s][0]),
80  this->node_id(Tet4::side_nodes_map[s][1]),
81  this->node_id(Tet4::side_nodes_map[s][2]));
82 }
static const 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:196
virtual unsigned int n_sides() const override final
Definition: cell_tet.h:74
static dof_id_type compute_key(dof_id_type n0)
Definition: elem.h:3131
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2299

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

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

1264 {
1265  Elem * neigh = this->neighbor_ptr(n);
1266 
1267  // Don't bother calling this function unless it's necessary
1268  libmesh_assert(neigh);
1269  libmesh_assert(!neigh->is_remote());
1270 
1271  // We never have neighbors more refined than us
1272  libmesh_assert_less_equal (neigh->level(), this->level());
1273 
1274  // We never have subactive neighbors of non subactive elements
1275  libmesh_assert(!neigh->subactive() || this->subactive());
1276 
1277  // If we have a neighbor less refined than us then it must not
1278  // have any more refined descendants we could have pointed to
1279  // instead.
1280  libmesh_assert((neigh->level() == this->level()) ||
1281  (neigh->active() && !this->subactive()) ||
1282  (!neigh->has_children() && this->subactive()));
1283 
1284  // If neigh is at our level, then its family might have
1285  // remote_elem neighbor links which need to point to us
1286  // instead, but if not, then we're done.
1287  if (neigh->level() != this->level())
1288  return;
1289 
1290  // What side of neigh are we on? nn.
1291  //
1292  // We can't use the usual Elem method because we're in the middle of
1293  // restoring topology. We can't compare side_ptr nodes because
1294  // users want to abuse neighbor_ptr to point to
1295  // not-technically-neighbors across mesh slits. We can't compare
1296  // node locations because users want to move those
1297  // not-technically-neighbors until they're
1298  // not-even-geometrically-neighbors.
1299 
1300  // Find any elements that ought to point to elem
1301  std::vector<Elem *> neigh_family;
1302 #ifdef LIBMESH_ENABLE_AMR
1303  if (this->active())
1304  neigh->family_tree_by_side(neigh_family, nn);
1305  else
1306 #endif
1307  neigh_family.push_back(neigh);
1308 
1309  // And point them to elem
1310  for (auto & neigh_family_member : neigh_family)
1311  {
1312  // Only subactive elements point to other subactive elements
1313  if (this->subactive() && !neigh_family_member->subactive())
1314  continue;
1315 
1316  // Ideally, the neighbor link ought to either be correct
1317  // already or ought to be to remote_elem.
1318  //
1319  // However, if we're redistributing a newly created elem,
1320  // after an AMR step but before find_neighbors has fixed up
1321  // neighbor links, we might have an out of date neighbor
1322  // link to elem's parent instead.
1323 #ifdef LIBMESH_ENABLE_AMR
1324  libmesh_assert((neigh_family_member->neighbor_ptr(nn) &&
1325  (neigh_family_member->neighbor_ptr(nn)->active() ||
1326  neigh_family_member->neighbor_ptr(nn)->is_ancestor_of(this))) ||
1327  (neigh_family_member->neighbor_ptr(nn) == remote_elem) ||
1328  ((this->refinement_flag() == JUST_REFINED) &&
1329  (this->parent() != nullptr) &&
1330  (neigh_family_member->neighbor_ptr(nn) == this->parent())));
1331 #else
1332  libmesh_assert((neigh_family_member->neighbor_ptr(nn) == this) ||
1333  (neigh_family_member->neighbor_ptr(nn) == remote_elem));
1334 #endif
1335 
1336  neigh_family_member->set_neighbor(nn, this);
1337  }
1338 }
RefinementState refinement_flag() const
Definition: elem.h:3047
const Elem * parent() const
Definition: elem.h:2867
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2407
unsigned int level() const
Definition: elem.h:2911
bool subactive() const
Definition: elem.h:2796
bool active() const
Definition: elem.h:2778
const RemoteElem * remote_elem
Definition: remote_elem.C:54

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

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

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

1342 {
1343  libmesh_assert_not_equal_to (this, remote_elem);
1344 
1345  // We need to have handled any children first
1346 #if defined(LIBMESH_ENABLE_AMR) && defined(DEBUG)
1347  if (this->has_children())
1348  for (auto & child : this->child_ref_range())
1349  libmesh_assert_equal_to (&child, remote_elem);
1350 #endif
1351 
1352  // Remotify any neighbor links
1353  for (auto neigh : this->neighbor_ptr_range())
1354  {
1355  if (neigh && neigh != remote_elem)
1356  {
1357  // My neighbor should never be more refined than me; my real
1358  // neighbor would have been its parent in that case.
1359  libmesh_assert_greater_equal (this->level(), neigh->level());
1360 
1361  if (this->level() == neigh->level() &&
1362  neigh->has_neighbor(this))
1363  {
1364 #ifdef LIBMESH_ENABLE_AMR
1365  // My neighbor may have descendants which also consider me a
1366  // neighbor
1367  std::vector<Elem *> family;
1368  neigh->total_family_tree_by_neighbor (family, this);
1369 
1370  // FIXME - There's a lot of ugly const_casts here; we
1371  // may want to make remote_elem non-const
1372  for (auto & n : family)
1373  {
1374  libmesh_assert (n);
1375  if (n == remote_elem)
1376  continue;
1377  unsigned int my_s = n->which_neighbor_am_i(this);
1378  libmesh_assert_less (my_s, n->n_neighbors());
1379  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1380  n->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1381  }
1382 #else
1383  unsigned int my_s = neigh->which_neighbor_am_i(this);
1384  libmesh_assert_less (my_s, neigh->n_neighbors());
1385  libmesh_assert_equal_to (neigh->neighbor_ptr(my_s), this);
1386  neigh->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1387 #endif
1388  }
1389 #ifdef LIBMESH_ENABLE_AMR
1390  // Even if my neighbor doesn't link back to me, it might
1391  // have subactive descendants which do
1392  else if (neigh->has_children())
1393  {
1394  // If my neighbor at the same level doesn't have me as a
1395  // neighbor, I must be subactive
1396  libmesh_assert(this->level() > neigh->level() ||
1397  this->subactive());
1398 
1399  // My neighbor must have some ancestor of mine as a
1400  // neighbor
1401  Elem * my_ancestor = this->parent();
1402  libmesh_assert(my_ancestor);
1403  while (!neigh->has_neighbor(my_ancestor))
1404  {
1405  my_ancestor = my_ancestor->parent();
1406  libmesh_assert(my_ancestor);
1407  }
1408 
1409  // My neighbor may have descendants which consider me a
1410  // neighbor
1411  std::vector<Elem *> family;
1412  neigh->total_family_tree_by_subneighbor (family, my_ancestor, this);
1413 
1414  for (auto & n : family)
1415  {
1416  libmesh_assert (n);
1417  if (n->is_remote())
1418  continue;
1419  unsigned int my_s = n->which_neighbor_am_i(this);
1420  libmesh_assert_less (my_s, n->n_neighbors());
1421  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1422  // TODO: we may want to make remote_elem non-const.
1423  n->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1424  }
1425  }
1426 #endif
1427  }
1428  }
1429 
1430 #ifdef LIBMESH_ENABLE_AMR
1431  // Remotify parent's child link
1432  Elem * my_parent = this->parent();
1433  if (my_parent &&
1434  // As long as it's not already remote
1435  my_parent != remote_elem &&
1436  // And it's a real parent, not an interior parent
1437  this->dim() == my_parent->dim())
1438  {
1439  unsigned int me = my_parent->which_child_am_i(this);
1440  libmesh_assert_equal_to (my_parent->child_ptr(me), this);
1441  my_parent->set_child(me, const_cast<RemoteElem *>(remote_elem));
1442  }
1443 #endif
1444 }
const Elem * parent() const
Definition: elem.h:2867
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:2188
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220
unsigned int level() const
Definition: elem.h:2911
virtual unsigned short dim() const =0
bool subactive() const
Definition: elem.h:2796
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Returns a range with all neighbors of an element, usable in range-based for loops.
Definition: elem.h:3326
bool has_children() const
Definition: elem.h:2816
const RemoteElem * remote_elem
Definition: remote_elem.C:54

◆ mapping_data()

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

Definition at line 2973 of file elem.h.

References libMesh::Elem::_map_data.

Referenced by libMesh::MeshTools::Modification::all_tri(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::get_info(), libMesh::rational_fe_shape(), libMesh::rational_fe_shape_deriv(), libMesh::rational_fe_shape_second_deriv(), libMesh::rational_fe_weighted_shapes(), and libMesh::rational_fe_weighted_shapes_derivs().

2974 {
2975  return _map_data;
2976 }
unsigned char _map_data
Mapping function data; currently used when needed to store the RATIONAL_BERNSTEIN nodal weight data i...
Definition: elem.h:2145

◆ mapping_type()

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

Definition at line 2957 of file elem.h.

References libMesh::Elem::_map_type.

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

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

◆ master_point()

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

Implements libMesh::Elem.

Definition at line 63 of file cell_tet.h.

References libMesh::Tet::_master_points, and libMesh::Elem::n_nodes().

64  {
65  libmesh_assert_less(i, this->n_nodes());
66  return Point(_master_points[i][0],
67  _master_points[i][1],
68  _master_points[i][2]);
69  }
static const Real _master_points[14][3]
Master element node locations.
Definition: cell_tet.h:223
virtual unsigned int n_nodes() const =0

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

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

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

3084 {
3085  // This is undefined for subactive elements,
3086  // which have no active descendants
3087  libmesh_assert (!this->subactive());
3088  if (this->active())
3089  return this->p_level();
3090 
3091  unsigned int max_p_level = _p_level;
3092  for (auto & c : child_ref_range())
3093  max_p_level = std::max(max_p_level,
3094  c.max_descendant_p_level());
3095  return max_p_level;
3096 }
unsigned char _p_level
p refinement level - the difference between the polynomial degree on this element and the minimum pol...
Definition: elem.h:2132
unsigned int p_level() const
Definition: elem.h:2945
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:2188
libmesh_assert(ctx)
bool subactive() const
Definition: elem.h:2796
bool active() const
Definition: elem.h:2778

◆ min_and_max_angle()

std::pair< Real, Real > libMesh::Tet4::min_and_max_angle ( ) const
Returns
The min and max dihedral angles for the tetrahedron.
Note
There are 6 dihedral angles (angles between the planar faces) for the Tet4. Dihedral angles near 180 deg. are generally bad for interpolation. Small dihedral angles are not necessarily bad for interpolation, but they can affect the stiffness matrix condition number.

Definition at line 339 of file cell_tet4.C.

References libMesh::TensorTools::norm(), libMesh::TypeVector< T >::norm(), libMesh::Elem::point(), and libMesh::Real.

340 {
341  Point n[4];
342 
343  // Compute the outward normal vectors on each face
344  n[0] = (this->point(2) - this->point(0)).cross(this->point(1) - this->point(0));
345  n[1] = (this->point(1) - this->point(0)).cross(this->point(3) - this->point(0));
346  n[2] = (this->point(2) - this->point(1)).cross(this->point(3) - this->point(1));
347  n[3] = (this->point(0) - this->point(2)).cross(this->point(3) - this->point(2));
348 
349  Real dihedral_angles[6]; // 01, 02, 03, 12, 13, 23
350 
351  // Compute dihedral angles
352  for (unsigned int k=0,i=0; i<4; ++i)
353  for (unsigned int j=i+1; j<4; ++j,k+=1)
354  dihedral_angles[k] = std::acos(n[i]*n[j] / n[i].norm() / n[j].norm()); // return value is between 0 and PI
355 
356  // Return max/min dihedral angles
357  return std::make_pair(*std::min_element(dihedral_angles, dihedral_angles+6),
358  *std::max_element(dihedral_angles, dihedral_angles+6));
359 
360 }
auto norm(const T &a) -> decltype(std::abs(a))
Definition: tensor_tools.h:74
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Point & point(const unsigned int i) const
Definition: elem.h:2277

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

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

1978 {
1979  libmesh_assert(!this->subactive());
1980  libmesh_assert(neighbor_in->active());
1981 
1982  // If we're an active element this is simple
1983  if (this->active())
1984  {
1985  unsigned int new_p_level = this->p_level();
1986  if (this->p_refinement_flag() == Elem::REFINE)
1987  new_p_level += 1;
1988  if (this->p_refinement_flag() == Elem::COARSEN)
1989  {
1990  libmesh_assert_greater (new_p_level, 0);
1991  new_p_level -= 1;
1992  }
1993  return std::min(current_min, new_p_level);
1994  }
1995 
1996  libmesh_assert(has_neighbor(neighbor_in));
1997 
1998  unsigned int min_p_level = current_min;
1999 
2000  for (auto & c : this->child_ref_range())
2001  if (&c != remote_elem && c.has_neighbor(neighbor_in))
2002  min_p_level =
2003  c.min_new_p_level_by_neighbor(neighbor_in, min_p_level);
2004 
2005  return min_p_level;
2006 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2437
RefinementState p_refinement_flag() const
Definition: elem.h:3063
unsigned int p_level() const
Definition: elem.h:2945
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:2188
libmesh_assert(ctx)
bool subactive() const
Definition: elem.h:2796
bool active() const
Definition: elem.h:2778
const RemoteElem * remote_elem
Definition: remote_elem.C:54

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

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

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

1949 {
1950  libmesh_assert(!this->subactive());
1951  libmesh_assert(neighbor_in->active());
1952 
1953  // If we're an active element this is simple
1954  if (this->active())
1955  return std::min(current_min, this->p_level());
1956 
1957  libmesh_assert(has_neighbor(neighbor_in));
1958 
1959  // The p_level() of an ancestor element is already the minimum
1960  // p_level() of its children - so if that's high enough, we don't
1961  // need to examine any children.
1962  if (current_min <= this->p_level())
1963  return current_min;
1964 
1965  unsigned int min_p_level = current_min;
1966 
1967  for (auto & c : this->child_ref_range())
1968  if (&c != remote_elem && c.has_neighbor(neighbor_in))
1969  min_p_level =
1970  c.min_p_level_by_neighbor(neighbor_in, min_p_level);
1971 
1972  return min_p_level;
1973 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2437
unsigned int p_level() const
Definition: elem.h:2945
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:2188
libmesh_assert(ctx)
bool subactive() const
Definition: elem.h:2796
bool active() const
Definition: elem.h:2778
const RemoteElem * remote_elem
Definition: remote_elem.C:54

◆ n_children()

virtual unsigned int libMesh::Tet::n_children ( ) const
inlinefinaloverridevirtualinherited
Returns
8.

Implements libMesh::Elem.

Definition at line 94 of file cell_tet.h.

Referenced by libMesh::Tet::is_child_on_side_helper().

94 { return 8; }

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

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

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

997 {
998  libmesh_assert_less (s, this->n_systems());
999  libmesh_assert_less (var, this->n_vars(s));
1000 
1001  return this->n_comp_group(s,this->var_to_vg(s,var));
1002 }
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in...
Definition: dof_object.h:1334
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_systems() const
Definition: dof_object.h:930
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1008

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

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

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

1010 {
1011  libmesh_assert_less (s, this->n_systems());
1012  libmesh_assert_less (vg, this->n_var_groups(s));
1013 
1014  const unsigned int
1015  start_idx_sys = this->start_idx(s);
1016 
1017  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
1018 
1019  return (_idx_buf[start_idx_sys + 2*vg] % ncv_magic);
1020 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
unsigned int n_systems() const
Definition: dof_object.h:930
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
index_buffer_t _idx_buf
Definition: dof_object.h:675
static const index_t ncv_magic
Above we introduced the chimera ncv, which is a hybrid of the form ncv = ncv_magic*nv + nc where nv a...
Definition: dof_object.h:686

◆ n_dofs()

unsigned int libMesh::DofObject::n_dofs ( const unsigned int  s,
const unsigned int  var = libMesh::invalid_uint 
) const
inlineinherited
Returns
The number of degrees of freedom associated with system s for this object. Optionally only counts degrees of freedom for variable number var

Definition at line 801 of file dof_object.h.

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

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

803 {
804  libmesh_assert_less (s, this->n_systems());
805 
806  unsigned int num = 0;
807 
808  // Count all variables
809  if (var == libMesh::invalid_uint)
810  for (auto v : make_range(this->n_vars(s)))
811  num += this->n_comp(s,v);
812 
813  // Only count specified variable
814  else
815  num = this->n_comp(s,var);
816 
817  return num;
818 }
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:286
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:995
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_systems() const
Definition: dof_object.h:930
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:134

◆ n_edges()

virtual unsigned int libMesh::Tet::n_edges ( ) const
inlinefinaloverridevirtualinherited

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

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

Referenced by libMesh::DofObject::add_extra_integers(), libMesh::MeshTools::Modification::all_tri(), libMesh::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::DofObject::set_extra_datum(), libMesh::DofObject::set_extra_integer(), libMesh::DofObject::set_n_systems(), libMesh::DofObject::set_n_vars_per_group(), DofObjectTest< Node >::testAddExtraData(), DofObjectTest< Node >::testAddSystemExtraInts(), DofObjectTest< Node >::testSetNSystemsExtraInts(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

1164 {
1165  if (_idx_buf.empty())
1166  return 0;
1167 
1168  const int hdr = dof_id_signed_type(_idx_buf[0]);
1169  if (hdr >= 0)
1170  return 0;
1171 
1172  const unsigned int start_idx_i = this->start_idx_ints();
1173 
1174  return _idx_buf.size() - start_idx_i;
1175 }
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1266
int8_t dof_id_signed_type
Definition: id_types.h:68
index_buffer_t _idx_buf
Definition: dof_object.h:675

◆ n_faces()

virtual unsigned int libMesh::Tet::n_faces ( ) const
inlinefinaloverridevirtualinherited
Returns
4. All tetrahedra have 4 faces.

Implements libMesh::Elem.

Definition at line 89 of file cell_tet.h.

89 { return 4; }

◆ n_neighbors()

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

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

Definition at line 670 of file elem.h.

References libMesh::Elem::n_sides().

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

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

◆ n_nodes()

virtual unsigned int libMesh::Tet4::n_nodes ( ) const
inlineoverridevirtual
Returns
4.

Implements libMesh::Elem.

Definition at line 85 of file cell_tet4.h.

References num_nodes.

85 { return num_nodes; }
static const int num_nodes
Geometric constants for Tet4.
Definition: cell_tet4.h:185

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

References libMesh::Elem::n_nodes().

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

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

◆ n_objects() [1/2]

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

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

Definition at line 85 of file reference_counter.h.

References libMesh::ReferenceCounter::_n_objects.

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

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

◆ n_objects() [2/2]

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

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

Definition at line 85 of file reference_counter.h.

References libMesh::ReferenceCounter::_n_objects.

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

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

◆ n_permutations()

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

Four sides, three orientations.

Implements libMesh::Elem.

Definition at line 204 of file cell_tet.h.

204 { return 12; }

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

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

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

941 {
942  const int hdr = _idx_buf.empty() ?
943  0 : cast_int<int>(dof_id_signed_type(_idx_buf[0]));
944  return std::abs(hdr);
945 }
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
Definition: type_vector.h:57
int8_t dof_id_signed_type
Definition: id_types.h:68
index_buffer_t _idx_buf
Definition: dof_object.h:675

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

Definition at line 2666 of file elem.C.

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

2667 {
2668  // for linear elements, always return 0
2669  return 0;
2670 }

◆ n_sides()

virtual unsigned int libMesh::Tet::n_sides ( ) const
inlinefinaloverridevirtualinherited

◆ n_sub_elem()

virtual unsigned int libMesh::Tet4::n_sub_elem ( ) const
inlineoverridevirtual
Returns
1.

Implements libMesh::Elem.

Definition at line 90 of file cell_tet4.h.

Referenced by connectivity().

90 { return 1; }

◆ n_systems()

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

Definition at line 930 of file dof_object.h.

References libMesh::DofObject::_idx_buf.

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

931 {
932  const int hdr = _idx_buf.empty() ?
933  0 : cast_int<int>(dof_id_signed_type(_idx_buf[0]));
934  return hdr >= 0 ? hdr : (-hdr-1);
935 }
int8_t dof_id_signed_type
Definition: id_types.h:68
index_buffer_t _idx_buf
Definition: dof_object.h:675

◆ n_var_groups()

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

◆ n_vars() [1/2]

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

Definition at line 960 of file dof_object.h.

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

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

962 {
963  libmesh_assert_less (s, this->n_systems());
964  libmesh_assert_less (vg, this->n_var_groups(s));
965 
966  const unsigned int start_idx_sys = this->start_idx(s);
967 
968  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
969 
970  return (cast_int<unsigned int>
971  (_idx_buf[start_idx_sys + 2*vg]) >> ncv_magic_exp);
972 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
unsigned int n_systems() const
Definition: dof_object.h:930
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
index_buffer_t _idx_buf
Definition: dof_object.h:675
static const index_t ncv_magic_exp
Definition: dof_object.h:687

◆ n_vars() [2/2]

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

Definition at line 977 of file dof_object.h.

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

978 {
979  libmesh_assert_less (s, this->n_systems());
980 
981  const unsigned int nvg = this->n_var_groups(s);
982 
983  unsigned int val=0;
984 
985  for (unsigned int vg=0; vg<nvg; vg++)
986  val += this->n_vars(s,vg);
987 
988  return val;
989 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_systems() const
Definition: dof_object.h:930

◆ n_vertices()

virtual unsigned int libMesh::Tet::n_vertices ( ) const
inlinefinaloverridevirtualinherited

◆ neighbor_ptr() [1/2]

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

Definition at line 2407 of file elem.h.

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

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

2408 {
2409  libmesh_assert_less (i, this->n_neighbors());
2410 
2411  return _elemlinks[i+1];
2412 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2093
unsigned int n_neighbors() const
Definition: elem.h:670

◆ neighbor_ptr() [2/2]

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

Definition at line 2417 of file elem.h.

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

2418 {
2419  libmesh_assert_less (i, this->n_neighbors());
2420 
2421  return _elemlinks[i+1];
2422 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2093
unsigned int n_neighbors() const
Definition: elem.h:670

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

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

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

3327 {
3328  return {_elemlinks+1, _elemlinks + 1 + this->n_neighbors()};
3329 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2093
unsigned int n_neighbors() const
Definition: elem.h:670

◆ neighbor_ptr_range() [2/2]

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

Definition at line 3333 of file elem.h.

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

3334 {
3335  return {_elemlinks+1, _elemlinks + 1 + this->n_neighbors()};
3336 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2093
unsigned int n_neighbors() const
Definition: elem.h:670

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

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

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

2300 {
2301  libmesh_assert_less (i, this->n_nodes());
2302  libmesh_assert(_nodes[i]);
2303  libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);
2304 
2305  return _nodes[i]->id();
2306 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2087
dof_id_type id() const
Definition: dof_object.h:823
virtual unsigned int n_nodes() const =0
libmesh_assert(ctx)
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477

◆ node_index_range()

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

◆ node_ptr() [1/2]

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

Definition at line 2331 of file elem.h.

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

Referenced by libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::BoundaryInfo::add_elements(), libMesh::MeshRefinement::add_node(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), assemble_shell(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::InfHex8::build_edge_ptr(), libMesh::InfPrism6::build_edge_ptr(), libMesh::InfHex18::build_edge_ptr(), libMesh::InfPrism12::build_edge_ptr(), libMesh::InfHex16::build_edge_ptr(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::InfQuad4::build_side_ptr(), libMesh::InfHex8::build_side_ptr(), libMesh::InfPrism6::build_side_ptr(), libMesh::InfHex18::build_side_ptr(), libMesh::Pyramid5::build_side_ptr(), libMesh::InfQuad6::build_side_ptr(), libMesh::Prism6::build_side_ptr(), libMesh::InfPrism12::build_side_ptr(), libMesh::InfHex16::build_side_ptr(), libMesh::Pyramid13::build_side_ptr(), libMesh::Prism15::build_side_ptr(), libMesh::Edge::build_side_ptr(), libMesh::Prism18::build_side_ptr(), libMesh::Pyramid14::build_side_ptr(), libMesh::Prism20::build_side_ptr(), libMesh::Prism21::build_side_ptr(), libMesh::Pyramid18::build_side_ptr(), libMesh::BoundaryInfo::clear_stitched_boundary_side_ids(), libMesh::FEMap::compute_affine_map(), libMesh::FEMap::compute_map(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::Elem::contains_vertex_of(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::MeshTools::Subdivision::find_one_ring(), libMesh::MeshTools::Modification::flatten(), libMesh::ReplicatedMesh::get_boundary_points(), libMesh::Elem::get_node_index(), libMesh::Elem::is_vertex_on_parent(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::Elem::libmesh_assert_valid_node_pointers(), libMesh::Elem::node_ref(), libMesh::Tri3Subdivision::prepare_subdivision_properties(), libMesh::FE< Dim, LAGRANGE_VEC >::shape(), libMesh::Tet::side_ptr(), libMesh::Prism::side_ptr(), libMesh::Pyramid::side_ptr(), libMesh::Hex::side_ptr(), libMesh::Tri::side_ptr(), libMesh::Edge::side_ptr(), libMesh::Quad::side_ptr(), libMesh::InfPrism::side_ptr(), libMesh::InfHex::side_ptr(), libMesh::InfQuad::side_ptr(), libMesh::Elem::simple_build_edge_ptr(), libMesh::Elem::simple_build_side_ptr(), libMesh::Elem::simple_side_ptr(), libMesh::MeshTools::Modification::smooth(), libMesh::UnstructuredMesh::stitching_helper(), libMesh::Elem::swap2nodes(), SystemsTest::testDofCouplingWithVarGroups(), InfFERadialTest::testInfQuants_numericDeriv(), and InfFERadialTest::testSides().

2332 {
2333  libmesh_assert_less (i, this->n_nodes());
2334  libmesh_assert(_nodes[i]);
2335 
2336  return _nodes[i];
2337 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2087
virtual unsigned int n_nodes() const =0
libmesh_assert(ctx)

◆ node_ptr() [2/2]

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

Definition at line 2342 of file elem.h.

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

2343 {
2344  libmesh_assert_less (i, this->n_nodes());
2345  libmesh_assert(_nodes[i]);
2346 
2347  return _nodes[i];
2348 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2087
virtual unsigned int n_nodes() const =0
libmesh_assert(ctx)

◆ node_ref() [1/2]

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

◆ node_ref() [2/2]

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

Definition at line 2361 of file elem.h.

References libMesh::Elem::node_ptr().

2362 {
2363  return *this->node_ptr(i);
2364 }
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2331

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

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

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

◆ nodes_on_edge()

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

Implements libMesh::Elem.

Definition at line 148 of file cell_tet4.C.

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

149 {
150  libmesh_assert_less(e, n_edges());
151  return {std::begin(edge_nodes_map[e]), std::end(edge_nodes_map[e])};
152 }
virtual unsigned int n_edges() const override final
Definition: cell_tet.h:84
static const 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:202

◆ nodes_on_side()

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

Implements libMesh::Elem.

Definition at line 141 of file cell_tet4.C.

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

142 {
143  libmesh_assert_less(s, n_sides());
144  return {std::begin(side_nodes_map[s]), std::end(side_nodes_map[s])};
145 }
static const 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:196
virtual unsigned int n_sides() const override final
Definition: cell_tet.h:74

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

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

2641 {
2642  // Tell any of my neighbors about my death...
2643  // Looks strange, huh?
2644  for (auto n : this->side_index_range())
2645  {
2646  Elem * current_neighbor = this->neighbor_ptr(n);
2647  if (current_neighbor && current_neighbor != remote_elem)
2648  {
2649  // Note: it is possible that I see the neighbor
2650  // (which is coarser than me)
2651  // but they don't see me, so avoid that case.
2652  if (current_neighbor->level() == this->level())
2653  {
2654  const unsigned int w_n_a_i = current_neighbor->which_neighbor_am_i(this);
2655  libmesh_assert_less (w_n_a_i, current_neighbor->n_neighbors());
2656  current_neighbor->set_neighbor(w_n_a_i, nullptr);
2657  this->set_neighbor(n, nullptr);
2658  }
2659  }
2660  }
2661 }
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2510
void set_neighbor(const unsigned int i, Elem *n)
Assigns n as the neighbor.
Definition: elem.h:2427
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2407
unsigned int level() const
Definition: elem.h:2911
const RemoteElem * remote_elem
Definition: remote_elem.C:54

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

References libMesh::Elem::has_neighbor().

2747 {
2748  // By convention, the element is on the boundary
2749  // if it has a nullptr neighbor.
2750  return this->has_neighbor(nullptr);
2751 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2437

◆ operator=() [1/2]

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

◆ operator=() [2/2]

Tet4& libMesh::Tet4::operator= ( Tet4 &&  )
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 581 of file elem.C.

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

582 {
583  // If the elements aren't the same type, they aren't equal
584  if (this->type() != rhs.type())
585  return false;
586 
587  const unsigned short n_n = this->n_nodes();
588  libmesh_assert_equal_to(n_n, rhs.n_nodes());
589 
590  // Make two sorted arrays of global node ids and compare them for
591  // equality.
592  std::array<dof_id_type, Elem::max_n_nodes> this_ids, rhs_ids;
593 
594  for (unsigned short n = 0; n != n_n; n++)
595  {
596  this_ids[n] = this->node_id(n);
597  rhs_ids[n] = rhs.node_id(n);
598  }
599 
600  // Sort the vectors to rule out different local node numberings.
601  std::sort(this_ids.begin(), this_ids.begin()+n_n);
602  std::sort(rhs_ids.begin(), rhs_ids.begin()+n_n);
603 
604  // If the node ids match, the elements are equal!
605  for (unsigned short n = 0; n != n_n; ++n)
606  if (this_ids[n] != rhs_ids[n])
607  return false;
608  return true;
609 }
virtual unsigned int n_nodes() const =0
virtual ElemType type() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2299

◆ opposite_node()

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

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

Definition at line 3140 of file elem.C.

3142 {
3143  // If the subclass didn't rederive this, using it is an error
3144  libmesh_not_implemented();
3145 }

◆ opposite_side()

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

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

Definition at line 3132 of file elem.C.

3133 {
3134  // If the subclass didn't rederive this, using it is an error
3135  libmesh_not_implemented();
3136 }

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

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

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

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

◆ origin()

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

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

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

Definition at line 1767 of file elem.h.

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

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

◆ p_level()

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

Definition at line 2945 of file elem.h.

References libMesh::Elem::_p_level.

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

2946 {
2947 #ifdef LIBMESH_ENABLE_AMR
2948  return _p_level;
2949 #else
2950  return 0;
2951 #endif
2952 }
unsigned char _p_level
p refinement level - the difference between the polynomial degree on this element and the minimum pol...
Definition: elem.h:2132

◆ p_refinement_flag()

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

◆ pack_indexing()

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

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

Definition at line 642 of file dof_object.C.

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

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

◆ packed_indexing_size()

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

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

Definition at line 560 of file dof_object.C.

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

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

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

◆ parent() [1/2]

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

Definition at line 2867 of file elem.h.

References libMesh::Elem::_elemlinks.

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

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

◆ parent() [2/2]

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

Definition at line 2875 of file elem.h.

References libMesh::Elem::_elemlinks.

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

◆ parent_bracketing_nodes()

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

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

Definition at line 2078 of file elem.C.

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

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

2080 {
2081  // Indexed first by embedding matrix type, then by child id, then by
2082  // child node, then by bracketing pair
2083  std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> &
2084  cached_bracketing_nodes = this->_get_bracketing_node_cache();
2085 
2086  const unsigned int em_vers = this->embedding_matrix_version();
2087 
2088  // We may be updating the cache on one thread, and while that
2089  // happens we can't safely access the cache from other threads.
2090  Threads::spin_mutex::scoped_lock lock(parent_bracketing_nodes_mutex);
2091 
2092  if (cached_bracketing_nodes.size() <= em_vers)
2093  cached_bracketing_nodes.resize(em_vers+1);
2094 
2095  const unsigned int nc = this->n_children();
2096 
2097  // If we haven't cached the bracketing nodes corresponding to this
2098  // embedding matrix yet, let's do so now.
2099  if (cached_bracketing_nodes[em_vers].size() < nc)
2100  {
2101  // If we're a second-order element but we're not a full-order
2102  // element, then some of our bracketing nodes may not exist
2103  // except on the equivalent full-order element. Let's build an
2104  // equivalent full-order element and make a copy of its cache to
2105  // use.
2106  if (this->default_order() != FIRST &&
2107  second_order_equivalent_type(this->type(), /*full_ordered=*/ true) != this->type())
2108  {
2109  // Check that we really are the non-full-order type
2110  libmesh_assert_equal_to
2111  (second_order_equivalent_type (this->type(), false),
2112  this->type());
2113 
2114  // Build the full-order type
2115  ElemType full_type =
2116  second_order_equivalent_type(this->type(), /*full_ordered=*/ true);
2117  std::unique_ptr<Elem> full_elem = Elem::build(full_type);
2118 
2119  // This won't work for elements with multiple
2120  // embedding_matrix versions, but every such element is full
2121  // order anyways.
2122  libmesh_assert_equal_to(em_vers, 0);
2123 
2124  // Make sure its cache has been built. We temporarily
2125  // release our mutex lock so that the inner call can
2126  // re-acquire it.
2127  lock.release();
2128  full_elem->parent_bracketing_nodes(0,0);
2129 
2130  // And then we need to lock again, so that if someone *else*
2131  // grabbed our lock before we did we don't risk accessing
2132  // cached_bracketing_nodes while they're working on it.
2133  // Threading is hard.
2134  lock.acquire(parent_bracketing_nodes_mutex);
2135 
2136  // Copy its cache
2137  cached_bracketing_nodes =
2138  full_elem->_get_bracketing_node_cache();
2139 
2140  // Now we don't need to build the cache ourselves.
2141  return cached_bracketing_nodes[em_vers][child][child_node];
2142  }
2143 
2144  cached_bracketing_nodes[em_vers].resize(nc);
2145 
2146  const unsigned int nn = this->n_nodes();
2147 
2148  // We have to examine each child
2149  for (unsigned int c = 0; c != nc; ++c)
2150  {
2151  const unsigned int ncn = this->n_nodes_in_child(c);
2152 
2153  cached_bracketing_nodes[em_vers][c].resize(ncn);
2154 
2155  // We have to examine each node in that child
2156  for (unsigned int n = 0; n != ncn; ++n)
2157  {
2158  // If this child node isn't a vertex or an infinite
2159  // child element's mid-infinite-edge node, then we need
2160  // to find bracketing nodes on the child.
2161  if (!this->is_vertex_on_child(c, n)
2162 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2163  && !this->is_mid_infinite_edge_node(n)
2164 #endif
2165  )
2166  {
2167  // Use the embedding matrix to find the child node
2168  // location in parent master element space
2169  Point bracketed_pt;
2170 
2171  for (unsigned int pn = 0; pn != nn; ++pn)
2172  {
2173  const Real em_val =
2174  this->embedding_matrix(c,n,pn);
2175 
2176  libmesh_assert_not_equal_to (em_val, 1);
2177  if (em_val != 0.)
2178  bracketed_pt.add_scaled(this->master_point(pn), em_val);
2179  }
2180 
2181  // Check each pair of nodes on the child which are
2182  // also both parent nodes
2183  for (unsigned int n1 = 0; n1 != ncn; ++n1)
2184  {
2185  if (n1 == n)
2186  continue;
2187 
2188  unsigned int parent_n1 =
2189  this->as_parent_node(c,n1);
2190 
2191  if (parent_n1 == libMesh::invalid_uint)
2192  continue;
2193 
2194  Point p1 = this->master_point(parent_n1);
2195 
2196  for (unsigned int n2 = n1+1; n2 < nn; ++n2)
2197  {
2198  if (n2 == n)
2199  continue;
2200 
2201  unsigned int parent_n2 =
2202  this->as_parent_node(c,n2);
2203 
2204  if (parent_n2 == libMesh::invalid_uint)
2205  continue;
2206 
2207  Point p2 = this->master_point(parent_n2);
2208 
2209  Point pmid = (p1 + p2)/2;
2210 
2211  if (pmid == bracketed_pt)
2212  {
2213  cached_bracketing_nodes[em_vers][c][n].emplace_back(parent_n1, parent_n2);
2214  break;
2215  }
2216  else
2217  libmesh_assert(!pmid.absolute_fuzzy_equals(bracketed_pt));
2218  }
2219  }
2220  }
2221  // If this child node is a parent node, we need to
2222  // find bracketing nodes on the parent.
2223  else
2224  {
2225  unsigned int parent_node = this->as_parent_node(c,n);
2226 
2227  Point bracketed_pt;
2228 
2229  // If we're not a parent node, use the embedding
2230  // matrix to find the child node location in parent
2231  // master element space
2232  if (parent_node == libMesh::invalid_uint)
2233  {
2234  for (unsigned int pn = 0; pn != nn; ++pn)
2235  {
2236  const Real em_val =
2237  this->embedding_matrix(c,n,pn);
2238 
2239  libmesh_assert_not_equal_to (em_val, 1);
2240  if (em_val != 0.)
2241  bracketed_pt.add_scaled(this->master_point(pn), em_val);
2242  }
2243  }
2244  // If we're a parent node then we need no arithmetic
2245  else
2246  bracketed_pt = this->master_point(parent_node);
2247 
2248  for (unsigned int n1 = 0; n1 != nn; ++n1)
2249  {
2250  if (n1 == parent_node)
2251  continue;
2252 
2253  Point p1 = this->master_point(n1);
2254 
2255  for (unsigned int n2 = n1+1; n2 < nn; ++n2)
2256  {
2257  if (n2 == parent_node)
2258  continue;
2259 
2260  Point pmid = (p1 + this->master_point(n2))/2;
2261 
2262  if (pmid == bracketed_pt)
2263  {
2264  cached_bracketing_nodes[em_vers][c][n].emplace_back(n1, n2);
2265  break;
2266  }
2267  else
2268  libmesh_assert(!pmid.absolute_fuzzy_equals(bracketed_pt));
2269  }
2270  }
2271  }
2272  }
2273  }
2274  }
2275 
2276  return cached_bracketing_nodes[em_vers][child][child_node];
2277 }
ElemType
Defines an enum for geometric element types.
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:286
virtual unsigned int embedding_matrix_version() const
Definition: elem.h:1892
virtual unsigned int n_children() const =0
virtual Real embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
virtual unsigned int n_nodes() const =0
virtual unsigned int as_parent_node(unsigned int c, unsigned int n) const
Definition: elem.C:2010
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition: elem.C:273
libmesh_assert(ctx)
Threads::spin_mutex parent_bracketing_nodes_mutex
Definition: elem.C:96
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
Definition: elem.C:2760
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Point master_point(const unsigned int i) const =0
virtual bool is_vertex_on_child(unsigned int, unsigned int n) const
Definition: elem.h:720
virtual Order default_order() const =0
virtual std::vector< std::vector< std::vector< std::vector< std::pair< unsigned char, unsigned char > > > > > & _get_bracketing_node_cache() const
Elem subclasses which don&#39;t do their own bracketing node calculations will need to supply a static ca...
Definition: elem.h:2051
virtual ElemType type() const =0
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:634
virtual bool is_mid_infinite_edge_node(const unsigned int) const
Definition: elem.h:1758

◆ permute()

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

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

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

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

Implements libMesh::Elem.

Definition at line 580 of file cell_tet4.C.

References libMesh::MeshTools::Modification::rotate(), libMesh::Elem::swap3neighbors(), and libMesh::Elem::swap3nodes().

581 {
582  libmesh_assert_less (perm_num, 12);
583 
584  const unsigned int side = perm_num % 4;
585  const unsigned int rotate = perm_num / 4;
586 
587  for (unsigned int i = 0; i != rotate; ++i)
588  {
589  swap3nodes(0,1,2);
590  swap3neighbors(1,2,3);
591  }
592 
593  switch (side) {
594  case 0:
595  break;
596  case 1:
597  swap3nodes(0,2,3);
598  swap3neighbors(0,2,1);
599  break;
600  case 2:
601  swap3nodes(2,0,3);
602  swap3neighbors(0,1,2);
603  break;
604  case 3:
605  swap3nodes(2,1,3);
606  swap3neighbors(0,1,3);
607  break;
608  default:
609  libmesh_error();
610  }
611 }
void swap3neighbors(unsigned int n1, unsigned int n2, unsigned int n3)
Swaps three neighbor_ptrs, "rotating" them.
Definition: elem.h:1974
void swap3nodes(unsigned int n1, unsigned int n2, unsigned int n3)
Swaps three node_ptrs, "rotating" them.
Definition: elem.h:1965
RealTensorValue rotate(MeshBase &mesh, const Real phi, const Real theta=0., const Real psi=0.)
Rotates the mesh in the xy plane.

◆ point() [1/2]

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

Definition at line 2277 of file elem.h.

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

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

2278 {
2279  libmesh_assert_less (i, this->n_nodes());
2280  libmesh_assert(_nodes[i]);
2281  libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);
2282 
2283  return *_nodes[i];
2284 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2087
virtual unsigned int n_nodes() const =0
libmesh_assert(ctx)
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477

◆ point() [2/2]

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

Definition at line 2289 of file elem.h.

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

2290 {
2291  libmesh_assert_less (i, this->n_nodes());
2292 
2293  return *_nodes[i];
2294 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2087
virtual unsigned int n_nodes() const =0

◆ print_dof_info()

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

Print out info for debugging.

Definition at line 670 of file dof_object.C.

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

671 {
672  libMesh::out << this->id() << " [ ";
673 
674  for (auto s : make_range(this->n_systems()))
675  {
676  libMesh::out << "s:" << s << " ";
677  for (auto var : make_range(this->n_vars(s)))
678  {
679  libMesh::out << "v:" << var << " ";
680  for (auto comp : make_range(this->n_comp(s,var)))
681  {
682  libMesh::out << "c:" << comp << " dof:" << this->dof_number(s,var,comp) << " ";
683  }
684  }
685  }
686 
687  libMesh::out << "]\n";
688 }
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:1025
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:995
dof_id_type id() const
Definition: dof_object.h:823
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_systems() const
Definition: dof_object.h:930
OStreamProxy out
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:134

◆ print_info() [1/3]

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

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

Definition at line 81 of file reference_counter.C.

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

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

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

◆ print_info() [2/3]

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

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

Definition at line 81 of file reference_counter.C.

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

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

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

◆ print_info() [3/3]

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

Prints relevant information about the element.

Definition at line 2541 of file elem.C.

References libMesh::Elem::get_info().

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

2542 {
2543  os << this->get_info()
2544  << std::endl;
2545 }
std::string get_info() const
Prints relevant information about the element to a string.
Definition: elem.C:2549

◆ processor_id() [1/3]

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

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

Definition at line 898 of file dof_object.h.

References libMesh::DofObject::_processor_id.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::DistributedMesh::add_node(), libMesh::MeshRefinement::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::DistributedMesh::add_point(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Patch::build_around_element(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), 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::UnstructuredMesh::copy_nodes_and_elements(), 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::MeshFunction::find_element(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::Modification::flatten(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::RBEIMConstruction::initialize_qp_data(), libMesh::DistributedMesh::insert_elem(), libMesh::DofObject::invalidate_processor_id(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), AugmentSparsityOnInterface::mesh_reinit(), ExodusTest< elem_type >::meshes_equal_enough(), libMesh::PeriodicBoundaries::neighbor(), libMesh::RBEIMEvaluation::node_distribute_bfs(), OverlappingCouplingFunctor::operator()(), AugmentSparsityOnInterface::operator()(), AugmentSparsityOnNodes::operator()(), libMesh::GhostPointNeighbors::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SortAndCopy::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectEdges::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectSides::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectInteriors::operator()(), libMesh::CompareDofObjectsByPIDAndThenID::operator()(), libMesh::DistributedMesh::own_node(), libMesh::XdrIO::pack_element(), libMesh::LinearPartitioner::partition_range(), libMesh::SFCPartitioner::partition_range(), libMesh::CentroidPartitioner::partition_range(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::process_mesh_constraint_rows(), libMesh::DofObject::processor_id(), libMesh::CheckpointIO::read_connectivity(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::DofMap::scatter_constraints(), libMesh::Partitioner::set_interface_node_processor_ids_BFS(), libMesh::Partitioner::set_interface_node_processor_ids_linear(), libMesh::Partitioner::set_interface_node_processor_ids_petscpartitioner(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), ParsedFEMFunctionTest::setUp(), libMesh::Partitioner::single_partition_range(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id_once(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), DofObjectTest< Node >::testInvalidateProcId(), EquationSystemsTest::testPostInitAddElem(), DofObjectTest< Node >::testSetProcId(), BoundaryInfoTest::testShellFaceConstraints(), DofObjectTest< Node >::testValidProcId(), libMesh::DTKAdapter::update_variable_values(), libMesh::GmshIO::write_mesh(), and libMesh::Nemesis_IO_Helper::write_sidesets().

899 {
900  return _processor_id;
901 }
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:589

◆ processor_id() [2/3]

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

Definition at line 906 of file dof_object.h.

References libMesh::DofObject::_processor_id.

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

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

References libMesh::DofObject::processor_id().

915 {
916  this->processor_id() = pid;
917 }
processor_id_type processor_id() const
Definition: dof_object.h:898

◆ qual_bounds()

std::pair< Real, Real > libMesh::Tet::qual_bounds ( const ElemQuality  q) const
overridevirtualinherited
Returns
The suggested quality bounds for the hex based on quality measure q. These are the values suggested by the CUBIT User's Manual.

Reimplemented from libMesh::Elem.

Definition at line 255 of file cell_tet.C.

References libMesh::ASPECT_RATIO_BETA, libMesh::ASPECT_RATIO_GAMMA, libMesh::CONDITION, libMesh::DISTORTION, libMesh::JACOBIAN, libMesh::out, libMesh::SHAPE, and libMesh::SIZE.

256 {
257  std::pair<Real, Real> bounds;
258 
259  switch (q)
260  {
261 
262  case ASPECT_RATIO_BETA:
263  case ASPECT_RATIO_GAMMA:
264  bounds.first = 1.;
265  bounds.second = 3.;
266  break;
267 
268  case SIZE:
269  case SHAPE:
270  bounds.first = 0.2;
271  bounds.second = 1.;
272  break;
273 
274  case CONDITION:
275  bounds.first = 1.;
276  bounds.second = 3.;
277  break;
278 
279  case DISTORTION:
280  bounds.first = 0.6;
281  bounds.second = 1.;
282  break;
283 
284  case JACOBIAN:
285  bounds.first = 0.5;
286  bounds.second = 1.414;
287  break;
288 
289  default:
290  libMesh::out << "Warning: Invalid quality measure chosen." << std::endl;
291  bounds.first = -1;
292  bounds.second = -1;
293  }
294 
295  return bounds;
296 }
OStreamProxy out

◆ quality()

Real libMesh::Tet::quality ( const ElemQuality  q) const
overridevirtualinherited
Returns
A quantitative assessment of element quality based on the quality metric q specified by the user.

Reimplemented from libMesh::Elem.

Definition at line 247 of file cell_tet.C.

References libMesh::Elem::quality().

248 {
249  return Elem::quality(q); // Not implemented
250 }
virtual Real quality(const ElemQuality q) const
Definition: elem.C:1582

◆ quasicircumcenter()

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

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

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

Definition at line 962 of file elem.h.

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

963  { libmesh_not_implemented(); }

◆ raw_child_ptr()

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

Definition at line 2991 of file elem.h.

References libMesh::Elem::_children.

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

2992 {
2993  if (!_children)
2994  return nullptr;
2995 
2996  return _children[i];
2997 }
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2103

◆ reference_elem()

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

Definition at line 387 of file elem.C.

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

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

388 {
389  return &(ReferenceElem::get(this->type()));
390 }
virtual ElemType type() const =0
const Elem & get(const ElemType type_in)

◆ refine()

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

Refine the element.

Definition at line 87 of file elem_refinement.C.

References libMesh::Elem::_children, libMesh::Elem::active(), libMesh::MeshRefinement::add_elem(), libMesh::MeshRefinement::add_node(), libMesh::Elem::ancestor(), libMesh::Elem::build(), libMesh::Elem::child_ptr(), libMesh::Elem::INACTIVE, libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_systems(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::parent(), libMesh::Elem::REFINE, libMesh::Elem::refinement_flag(), libMesh::remote_elem, libMesh::DofObject::set_extra_integer(), libMesh::DofObject::set_n_systems(), libMesh::Elem::set_p_level(), libMesh::Elem::set_p_refinement_flag(), libMesh::Elem::set_refinement_flag(), libMesh::Elem::subactive(), and libMesh::Elem::type().

88 {
89  libmesh_assert_equal_to (this->refinement_flag(), Elem::REFINE);
90  libmesh_assert (this->active());
91 
92  const unsigned int nc = this->n_children();
93 
94  // Create my children if necessary
95  if (!_children)
96  {
97  _children = std::make_unique<Elem *[]>(nc);
98 
99  unsigned int parent_p_level = this->p_level();
100  const unsigned int nei = this->n_extra_integers();
101  for (unsigned int c = 0; c != nc; c++)
102  {
103  auto current_child = Elem::build(this->type(), this);
104  _children[c] = current_child.get();
105 
106  current_child->set_refinement_flag(Elem::JUST_REFINED);
107  current_child->set_p_level(parent_p_level);
108  current_child->set_p_refinement_flag(this->p_refinement_flag());
109 
110  for (auto cnode : current_child->node_index_range())
111  {
112  Node * node =
113  mesh_refinement.add_node(*this, c, cnode,
114  current_child->processor_id());
115  node->set_n_systems (this->n_systems());
116  current_child->set_node(cnode) = node;
117  }
118 
119  Elem * added_child = mesh_refinement.add_elem (std::move(current_child));
120  added_child->set_n_systems(this->n_systems());
121  libmesh_assert_equal_to (added_child->n_extra_integers(),
122  this->n_extra_integers());
123  for (unsigned int i=0; i != nei; ++i)
124  added_child->set_extra_integer(i, this->get_extra_integer(i));
125  }
126  }
127  else
128  {
129  unsigned int parent_p_level = this->p_level();
130  for (unsigned int c = 0; c != nc; c++)
131  {
132  Elem * current_child = this->child_ptr(c);
133  if (current_child != remote_elem)
134  {
135  libmesh_assert(current_child->subactive());
136  current_child->set_refinement_flag(Elem::JUST_REFINED);
137  current_child->set_p_level(parent_p_level);
138  current_child->set_p_refinement_flag(this->p_refinement_flag());
139  }
140  }
141  }
142 
143  // Un-set my refinement flag now
145 
146  // Leave the p refinement flag set - we will need that later to get
147  // projection operations correct
148  // this->set_p_refinement_flag(Elem::INACTIVE);
149 
150 #ifndef NDEBUG
151  for (unsigned int c = 0; c != nc; c++)
152  if (this->child_ptr(c) != remote_elem)
153  {
154  libmesh_assert_equal_to (this->child_ptr(c)->parent(), this);
155  libmesh_assert(this->child_ptr(c)->active());
156  }
157 #endif
158  libmesh_assert (this->ancestor());
159 }
RefinementState refinement_flag() const
Definition: elem.h:3047
const Elem * parent() const
Definition: elem.h:2867
RefinementState p_refinement_flag() const
Definition: elem.h:3063
void set_refinement_flag(const RefinementState rflag)
Sets the value of the refinement flag for the element.
Definition: elem.h:3055
virtual unsigned int n_children() const =0
unsigned int p_level() const
Definition: elem.h:2945
bool ancestor() const
Definition: elem.C:1634
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition: elem.C:273
unsigned int n_systems() const
Definition: dof_object.h:930
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1163
bool active() const
Definition: elem.h:2778
virtual ElemType type() const =0
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element&#39;s children.
Definition: elem.h:2103
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:3000
const RemoteElem * remote_elem
Definition: remote_elem.C:54

◆ refinement_flag()

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

Definition at line 3047 of file elem.h.

References libMesh::Elem::_rflag.

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

3048 {
3049  return static_cast<RefinementState>(_rflag);
3050 }
RefinementState
Enumeration of possible element refinement states.
Definition: elem.h:1305
unsigned char _rflag
h refinement flag.
Definition: elem.h:2116

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

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

Referenced by MeshDeletionsTest::testDeleteElem().

1448 {
1449  libmesh_assert_not_equal_to (this, remote_elem);
1450 
1451  // We need to have handled any children first
1452 #ifdef LIBMESH_ENABLE_AMR
1453  libmesh_assert (!this->has_children());
1454 #endif
1455 
1456  // Nullify any neighbor links
1457  for (auto neigh : this->neighbor_ptr_range())
1458  {
1459  if (neigh && neigh != remote_elem)
1460  {
1461  // My neighbor should never be more refined than me; my real
1462  // neighbor would have been its parent in that case.
1463  libmesh_assert_greater_equal (this->level(), neigh->level());
1464 
1465  if (this->level() == neigh->level() &&
1466  neigh->has_neighbor(this))
1467  {
1468 #ifdef LIBMESH_ENABLE_AMR
1469  // My neighbor may have descendants which also consider me a
1470  // neighbor
1471  std::vector<Elem *> family;
1472  neigh->total_family_tree_by_neighbor (family, this);
1473 
1474  for (auto & n : family)
1475  {
1476  libmesh_assert (n);
1477  if (n->is_remote())
1478  continue;
1479  unsigned int my_s = n->which_neighbor_am_i(this);
1480  libmesh_assert_less (my_s, n->n_neighbors());
1481  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1482  n->set_neighbor(my_s, nullptr);
1483  }
1484 #else
1485  unsigned int my_s = neigh->which_neighbor_am_i(this);
1486  libmesh_assert_less (my_s, neigh->n_neighbors());
1487  libmesh_assert_equal_to (neigh->neighbor_ptr(my_s), this);
1488  neigh->set_neighbor(my_s, nullptr);
1489 #endif
1490  }
1491 #ifdef LIBMESH_ENABLE_AMR
1492  // Even if my neighbor doesn't link back to me, it might
1493  // have subactive descendants which do
1494  else if (neigh->has_children())
1495  {
1496  // If my neighbor at the same level doesn't have me as a
1497  // neighbor, I must be subactive
1498  libmesh_assert(this->level() > neigh->level() ||
1499  this->subactive());
1500 
1501  // My neighbor must have some ancestor of mine as a
1502  // neighbor
1503  Elem * my_ancestor = this->parent();
1504  libmesh_assert(my_ancestor);
1505  while (!neigh->has_neighbor(my_ancestor))
1506  {
1507  my_ancestor = my_ancestor->parent();
1508  libmesh_assert(my_ancestor);
1509  }
1510 
1511  // My neighbor may have descendants which consider me a
1512  // neighbor
1513  std::vector<Elem *> family;
1514  neigh->total_family_tree_by_subneighbor (family, my_ancestor, this);
1515 
1516  for (auto & n : family)
1517  {
1518  libmesh_assert (n);
1519  if (n->is_remote())
1520  continue;
1521  unsigned int my_s = n->which_neighbor_am_i(this);
1522  libmesh_assert_less (my_s, n->n_neighbors());
1523  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1524  n->set_neighbor(my_s, nullptr);
1525  }
1526  }
1527 #endif
1528  }
1529  }
1530 
1531 #ifdef LIBMESH_ENABLE_AMR
1532  // We can't currently delete a child with a parent!
1533  libmesh_assert (!this->parent());
1534 #endif
1535 }
const Elem * parent() const
Definition: elem.h:2867
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220
unsigned int level() const
Definition: elem.h:2911
bool subactive() const
Definition: elem.h:2796
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Returns a range with all neighbors of an element, usable in range-based for loops.
Definition: elem.h:3326
bool has_children() const
Definition: elem.h:2816
const RemoteElem * remote_elem
Definition: remote_elem.C:54

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

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

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

1715 {
1716  libmesh_assert(this->has_children());
1717 
1718  libmesh_assert(this->child_ptr(c));
1719 
1720  this->set_child(c, elem);
1721 }
libmesh_assert(ctx)
void set_child(unsigned int c, Elem *elem)
Sets the pointer to the child for this element.
Definition: elem.h:3019
bool has_children() const
Definition: elem.h:2816
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:3000

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

Definition at line 2674 of file elem.C.

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

2676 {
2677  // for linear elements, always return 0
2678  return 0;
2679 }

◆ second_order_child_vertex()

std::pair< unsigned short int, unsigned short int > libMesh::Elem::second_order_child_vertex ( const unsigned int  n) const
virtualinherited
Returns
A pair (c,v), where c == child index, and v == element-local index of the \( n^{th} \) second-order node on the parent element. For linear elements, (0,0) is returned.
Note
The return values are always less than this->n_children() and this->child_ptr(c)->n_vertices().
n has to be greater than or equal to this->n_vertices().
On refined second-order elements, the return value will satisfy this->node_ptr(n) == this->child_ptr(c)->node_ptr(v).

Reimplemented in libMesh::Prism21, libMesh::Prism20, libMesh::Prism18, libMesh::Hex27, libMesh::Tet14, libMesh::Prism15, libMesh::InfHex18, libMesh::Tet10, libMesh::Hex20, libMesh::Tri7, libMesh::InfHex16, libMesh::Tri6, libMesh::Quad9, libMesh::InfPrism12, libMesh::Quad8, libMesh::InfQuad6, and libMesh::Edge3.

Definition at line 2684 of file elem.C.

2685 {
2686  // for linear elements, always return 0
2687  return std::pair<unsigned short int, unsigned short int>(0,0);
2688 }

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

References libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::Utility::enum_to_string(), libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::INFEDGE2, libMesh::INFHEX16, libMesh::INFHEX18, libMesh::INFHEX8, libMesh::INFPRISM12, libMesh::INFPRISM6, libMesh::INFQUAD4, libMesh::INFQUAD6, libMesh::NODEELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM20, libMesh::PRISM21, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID18, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::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().

2762 {
2763  switch (et)
2764  {
2765  case NODEELEM:
2766  return NODEELEM;
2767  case EDGE2:
2768  case EDGE3:
2769  {
2770  // full_ordered not relevant
2771  return EDGE3;
2772  }
2773 
2774  case EDGE4:
2775  {
2776  // full_ordered not relevant
2777  return EDGE4;
2778  }
2779 
2780  case TRI3:
2781  case TRI6:
2782  {
2783  // full_ordered not relevant
2784  return TRI6;
2785  }
2786 
2787  case TRI7:
2788  return TRI7;
2789 
2790  // Currently there is no TRISHELL6, so similarly to other types
2791  // where this is the case, we just return the input.
2792  case TRISHELL3:
2793  return TRISHELL3;
2794 
2795  case QUAD4:
2796  case QUAD8:
2797  {
2798  if (full_ordered)
2799  return QUAD9;
2800  else
2801  return QUAD8;
2802  }
2803 
2804  case QUADSHELL4:
2805  case QUADSHELL8:
2806  {
2807  // There is no QUADSHELL9, so in that sense QUADSHELL8 is the
2808  // "full ordered" element.
2809  return QUADSHELL8;
2810  }
2811 
2812  case QUAD9:
2813  {
2814  // full_ordered not relevant
2815  return QUAD9;
2816  }
2817 
2818  case TET4:
2819  case TET10:
2820  {
2821  // full_ordered not relevant
2822  return TET10;
2823  }
2824 
2825  case TET14:
2826  return TET14;
2827 
2828  case HEX8:
2829  case HEX20:
2830  {
2831  // see below how this correlates with INFHEX8
2832  if (full_ordered)
2833  return HEX27;
2834  else
2835  return HEX20;
2836  }
2837 
2838  case HEX27:
2839  {
2840  // full_ordered not relevant
2841  return HEX27;
2842  }
2843 
2844  case PRISM6:
2845  case PRISM15:
2846  {
2847  if (full_ordered)
2848  return PRISM18;
2849  else
2850  return PRISM15;
2851  }
2852 
2853  // full_ordered not relevant, already fully second order
2854  case PRISM18:
2855  return PRISM18;
2856  case PRISM20:
2857  return PRISM20;
2858  case PRISM21:
2859  return PRISM21;
2860  case PYRAMID18:
2861  return PYRAMID18;
2862 
2863  case PYRAMID5:
2864  case PYRAMID13:
2865  {
2866  if (full_ordered)
2867  return PYRAMID14;
2868  else
2869  return PYRAMID13;
2870  }
2871 
2872  case PYRAMID14:
2873  {
2874  // full_ordered not relevant
2875  return PYRAMID14;
2876  }
2877 
2878 
2879 
2880 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2881 
2882  // infinite elements
2883  case INFEDGE2:
2884  {
2885  return INFEDGE2;
2886  }
2887 
2888  case INFQUAD4:
2889  case INFQUAD6:
2890  {
2891  // full_ordered not relevant
2892  return INFQUAD6;
2893  }
2894 
2895  case INFHEX8:
2896  case INFHEX16:
2897  {
2898  /*
2899  * Note that this matches with \p Hex8:
2900  * For full-ordered, \p InfHex18 and \p Hex27
2901  * belong together, and for not full-ordered,
2902  * \p InfHex16 and \p Hex20 belong together.
2903  */
2904  if (full_ordered)
2905  return INFHEX18;
2906  else
2907  return INFHEX16;
2908  }
2909 
2910  case INFHEX18:
2911  {
2912  // full_ordered not relevant
2913  return INFHEX18;
2914  }
2915 
2916  case INFPRISM6:
2917  case INFPRISM12:
2918  {
2919  // full_ordered not relevant
2920  return INFPRISM12;
2921  }
2922 
2923 #endif
2924 
2925 
2926  default:
2927  {
2928  // what did we miss?
2929  libmesh_error_msg("No second order equivalent element type for et = "
2930  << Utility::enum_to_string(et));
2931  }
2932  }
2933 }
std::string enum_to_string(const T e)

◆ select_diagonal()

void libMesh::Tet::select_diagonal ( const Diagonal  diag) const
inherited

Allows the user to select the diagonal for the refinement.

This function may only be called before the element is ever refined.

Definition at line 129 of file cell_tet.C.

References libMesh::Tet::_diagonal_selection, and libMesh::Tet::INVALID_DIAG.

130 {
131  libmesh_assert_equal_to (_diagonal_selection, INVALID_DIAG);
132  _diagonal_selection = diag;
133 }
Diagonal _diagonal_selection
The currently-selected diagonal used during refinement.
Definition: cell_tet.h:237

◆ set_buffer()

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

Definition at line 712 of file dof_object.h.

References libMesh::DofObject::_idx_buf.

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

713  { _idx_buf = buf; }
index_buffer_t _idx_buf
Definition: dof_object.h:675

◆ set_dof_number()

void libMesh::DofObject::set_dof_number ( const unsigned int  s,
const unsigned int  var,
const unsigned int  comp,
const dof_id_type  dn 
)
inherited

Sets the global degree of freedom number for variable var, component comp for system s associated with this DofObject.

Definition at line 454 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::dof_number(), libMesh::DofObject::invalid_id, libMesh::libmesh_assert(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), libMesh::DofObject::start_idx(), libMesh::DofObject::system_var_to_vg_var(), and libMesh::DofObject::var_to_vg().

458 {
459  libmesh_assert_less (s, this->n_systems());
460  libmesh_assert_less (var, this->n_vars(s));
461  libmesh_assert_less (comp, this->n_comp(s,var));
462 
463  const unsigned int
464  vg = this->var_to_vg(s,var),
465 #ifndef NDEBUG
466  ncg = this->n_comp_group(s,vg),
467 #endif
468  vig = this->system_var_to_vg_var(s,vg,var),
469  start_idx_sys = this->start_idx(s);
470 
471  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
472 
473  dof_id_type & base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
474 
475  // We intend to change all dof numbers together or not at all
476  if (comp || vig)
477  libmesh_assert ((dn == invalid_id && base_idx == invalid_id) ||
478  (dn == base_idx + vig*ncg + comp));
479 
480  // only explicitly store the base index for vig==0, comp==0
481  else
482  base_idx = dn;
483 
484  libmesh_assert_equal_to (this->dof_number(s, var, comp), dn);
485 }
unsigned int system_var_to_vg_var(const unsigned int s, const unsigned int vg, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in...
Definition: dof_object.h:1352
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:1025
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:995
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in...
Definition: dof_object.h:1334
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_systems() const
Definition: dof_object.h:930
libmesh_assert(ctx)
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1008
uint8_t dof_id_type
Definition: id_types.h:67

◆ set_extra_datum()

template<typename T >
void libMesh::DofObject::set_extra_datum ( const unsigned int  index,
const T  value 
)
inlineinherited

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

Definition at line 1119 of file dof_object.h.

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

Referenced by libMesh::ExodusII_IO::read(), libMesh::DynaIO::read_mesh(), and DofObjectTest< Node >::testAddExtraData().

1121 {
1122 #ifndef NDEBUG
1123  const unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
1124 #endif
1125  libmesh_assert_less(index+n_more_integers, this->n_extra_integers());
1126  libmesh_assert_less(this->n_pseudo_systems(), _idx_buf.size());
1127 
1128  const unsigned int start_idx_i = this->start_idx_ints();
1129 
1130  libmesh_assert_less(start_idx_i+index+n_more_integers, _idx_buf.size());
1131  std::memcpy(&_idx_buf[start_idx_i+index], &value, sizeof(T));
1132 }
unsigned int n_pseudo_systems() const
Definition: dof_object.h:940
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1266
static const bool value
Definition: xdr_io.C:54
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1163
index_buffer_t _idx_buf
Definition: dof_object.h:675
uint8_t dof_id_type
Definition: id_types.h:67

◆ set_extra_integer()

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

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

Definition at line 1079 of file dof_object.h.

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

Referenced by libMesh::SyncElementIntegers::act_on_data(), libMesh::BoundaryInfo::add_elements(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::create_submesh(), libMesh::ExodusII_IO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::CheckpointIO::read_nodes(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::Elem::refine(), DofObjectTest< Node >::testAddExtraData(), DofObjectTest< Node >::testAddSystemExtraInts(), DofObjectTest< Node >::testSetNSystemsExtraInts(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

1081 {
1082  libmesh_assert_less(index, this->n_extra_integers());
1083  libmesh_assert_less(this->n_pseudo_systems(), _idx_buf.size());
1084 
1085  const unsigned int start_idx_i = this->start_idx_ints();
1086 
1087  libmesh_assert_less(start_idx_i+index, _idx_buf.size());
1088  _idx_buf[start_idx_i+index] = value;
1089 }
unsigned int n_pseudo_systems() const
Definition: dof_object.h:940
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1266
static const bool value
Definition: xdr_io.C:54
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1163
index_buffer_t _idx_buf
Definition: dof_object.h:675

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

References libMesh::DofObject::set_id().

197  { this->set_id() = dofid; }
dof_id_type & set_id()
Definition: dof_object.h:831

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

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

Referenced by libMesh::BoundaryInfo::add_elements(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::Edge::Edge(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Hex::Hex(), libMesh::InfHex::InfHex(), libMesh::InfQuad::InfQuad(), libMesh::NodeElem::NodeElem(), libMesh::Prism::Prism(), libMesh::Pyramid::Pyramid(), libMesh::Quad::Quad(), libMesh::Tet::Tet(), and libMesh::Tri::Tri().

1057 {
1058  // interior parents make no sense for full-dimensional elements.
1059  libmesh_assert (!p ||
1060  this->dim() < LIBMESH_DIM);
1061 
1062  // If we have an interior_parent, we USED TO assume it was a
1063  // one-higher-dimensional interior element, but we now allow e.g.
1064  // edge elements to have a 3D interior_parent with no
1065  // intermediate 2D element.
1066  // libmesh_assert (!p ||
1067  // p->dim() == (this->dim()+1));
1068  libmesh_assert (!p ||
1069  (p == remote_elem) ||
1070  (p->dim() > this->dim()));
1071 
1072  _elemlinks[1+this->n_sides()] = p;
1073 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2093
libmesh_assert(ctx)
virtual unsigned int n_sides() const =0
virtual unsigned short dim() const =0
const RemoteElem * remote_elem
Definition: remote_elem.C:54

◆ set_mapping_data()

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

Sets the value of the mapping data for the element.

Definition at line 2981 of file elem.h.

References libMesh::Elem::_map_data.

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

2982 {
2983  _map_data = data;
2984 }
unsigned char _map_data
Mapping function data; currently used when needed to store the RATIONAL_BERNSTEIN nodal weight data i...
Definition: elem.h:2145

◆ set_mapping_type()

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

Sets the value of the mapping type for the element.

Definition at line 2965 of file elem.h.

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

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

2966 {
2967  _map_type = cast_int<unsigned char>(type);
2968 }
unsigned char _map_type
Mapping function type; currently either 0 (LAGRANGE) or 1 (RATIONAL_BERNSTEIN).
Definition: elem.h:2139
virtual ElemType type() const =0

◆ set_n_comp()

void libMesh::DofObject::set_n_comp ( const unsigned int  s,
const unsigned int  var,
const unsigned int  ncomp 
)
inherited

Sets the number of components for Variable var of system s associated with this DofObject.

Definition at line 385 of file dof_object.C.

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

388 {
389  libmesh_assert_less (s, this->n_systems());
390  libmesh_assert_less (var, this->n_vars(s));
391 
392  this->set_n_comp_group(s, this->var_to_vg(s,var), ncomp);
393 }
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in...
Definition: dof_object.h:1334
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_systems() const
Definition: dof_object.h:930
void set_n_comp_group(const unsigned int s, const unsigned int vg, const unsigned int ncomp)
Sets the number of components for VariableGroup vg of system s associated with this DofObject...
Definition: dof_object.C:397

◆ set_n_comp_group()

void libMesh::DofObject::set_n_comp_group ( const unsigned int  s,
const unsigned int  vg,
const unsigned int  ncomp 
)
inherited

Sets the number of components for VariableGroup vg of system s associated with this DofObject.

Definition at line 397 of file dof_object.C.

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

Referenced by libMesh::DofMap::reinit(), libMesh::DofObject::set_n_comp(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), and DofObjectTest< Node >::testManualDofCalculation().

400 {
401  libmesh_assert_less (s, this->n_systems());
402  libmesh_assert_less (vg, this->n_var_groups(s));
403 
404  // Check for trivial return
405  if (ncomp == this->n_comp_group(s,vg)) return;
406 
407 #ifndef NDEBUG
408  if (ncomp >= ncv_magic)
409  {
410  const index_t ncvm = ncv_magic;
411  libmesh_error_msg("ERROR: ncomp must be less than DofObject::ncv_magic!\n" \
412  << "ncomp = " \
413  << ncomp \
414  << ", ncv_magic = " \
415  << ncvm \
416  << "\nrecompile and try again!");
417  }
418 #endif
419 
420  const unsigned int
421  start_idx_sys = this->start_idx(s),
422  n_vars_group = this->n_vars(s,vg),
423  base_offset = start_idx_sys + 2*vg;
424 
425  libmesh_assert_less ((base_offset + 1), _idx_buf.size());
426 
427  // if (ncomp)
428  // libMesh::out << "s,vg,ncomp="
429  // << s << ","
430  // << vg << ","
431  // << ncomp << '\n';
432 
433  // set the number of components, maintaining the number
434  // of variables in the group
435  _idx_buf[base_offset] = ncv_magic*n_vars_group + ncomp;
436 
437  // We use (invalid_id - 1) to signify no
438  // components for this object
439  _idx_buf[base_offset + 1] = (ncomp == 0) ? invalid_id - 1 : invalid_id;
440 
441  // this->debug_buffer();
442  // libMesh::out << "s,vg = " << s << "," << vg << '\n'
443  // << "base_offset=" << base_offset << '\n'
444  // << "this->n_comp(s,vg)=" << this->n_comp(s,vg) << '\n'
445  // << "this->n_comp_group(s,vg)=" << this->n_comp_group(s,vg) << '\n'
446  // << "this->n_vars(s,vg)=" << this->n_vars(s,vg) << '\n'
447  // << "this->n_var_groups(s)=" << this->n_var_groups(s) << '\n';
448 
449  libmesh_assert_equal_to (ncomp, this->n_comp_group(s,vg));
450 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
dof_id_type index_t
DoF index information.
Definition: dof_object.h:673
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_systems() const
Definition: dof_object.h:930
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1008
static const index_t ncv_magic
Above we introduced the chimera ncv, which is a hybrid of the form ncv = ncv_magic*nv + nc where nv a...
Definition: dof_object.h:686

◆ set_n_systems()

void libMesh::DofObject::set_n_systems ( const unsigned int  s)
inherited

Sets the number of systems for this DofObject.

If this number is a change, also clears all variable count and DoF indexing associated with this DofObject.

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

Definition at line 150 of file dof_object.C.

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

Referenced by libMesh::DofObject::add_system(), libMesh::DofObject::clear_dofs(), libMesh::Elem::refine(), DofObjectTest< Node >::testManualDofCalculation(), DofObjectTest< Node >::testSetNSystems(), DofObjectTest< Node >::testSetNSystemsExtraInts(), DofObjectTest< Node >::testSetNVariableGroups(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

151 {
152  const unsigned int old_ns = this->n_systems();
153 
154  // Check for trivial return
155  if (ns == old_ns)
156  return;
157 
158  const unsigned int nei = this->n_extra_integers();
159  const dof_id_type header_size = ns + bool(nei);
160  const dof_id_type hdr = nei ?
161  static_cast<dof_id_type>(-static_cast<std::ptrdiff_t>(header_size))
162  : header_size;
163  index_buffer_t new_buf(header_size + nei, hdr);
164  if (nei)
165  {
166  const unsigned int start_idx_ints = old_ns ?
167  cast_int<unsigned int>(_idx_buf[old_ns]) :
168  1;
169  libmesh_assert_less(start_idx_ints, _idx_buf.size());
170  std::copy(_idx_buf.begin()+start_idx_ints,
171  _idx_buf.end(),
172  new_buf.begin()+header_size);
173  if (ns)
174  std::fill(new_buf.begin()+1, new_buf.begin()+ns+1, ns+1);
175  }
176 
177  // vector swap trick to force deallocation when shrinking
178  new_buf.swap(_idx_buf);
179 
180 #ifdef DEBUG
181  libmesh_assert_equal_to(nei, this->n_extra_integers());
182 
183  // check that all systems now exist and that they have 0 size
184  libmesh_assert_equal_to (ns, this->n_systems());
185  for (auto s : make_range(this->n_systems()))
186  {
187  libmesh_assert_equal_to (this->n_vars(s), 0);
188  libmesh_assert_equal_to (this->n_var_groups(s), 0);
189  }
190 #endif
191 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1266
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_systems() const
Definition: dof_object.h:930
std::vector< index_t > index_buffer_t
Definition: dof_object.h:674
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:134
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1163
index_buffer_t _idx_buf
Definition: dof_object.h:675
uint8_t dof_id_type
Definition: id_types.h:67

◆ set_n_vars_per_group()

void libMesh::DofObject::set_n_vars_per_group ( const unsigned int  s,
const std::vector< unsigned int > &  nvpg 
)
inherited

Sets number of variables in each group associated with system s for this DofObject.

Implicit in this is also setting the number of VariableGroup variable groups for the system. Has the effect of setting the number of components to 0 even when called even with (nvg == this->n_var_groups(s)).

Definition at line 247 of file dof_object.C.

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

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

249 {
250  const unsigned int n_sys = this->n_systems();
251 
252  libmesh_assert_less (s, n_sys);
253 
254  // number of variable groups for this system - inferred
255  const unsigned int nvg = cast_int<unsigned int>(nvpg.size());
256 
257  // BSK - note that for compatibility with the previous implementation
258  // calling this method when (nvars == this->n_vars()) requires that
259  // we invalidate the DOF indices and set the number of components to 0.
260  // Note this was a bit of a surprise to me - there was no quick return in
261  // the old method, which caused removal and readdition of the DOF indices
262  // even in the case of (nvars == this->n_vars()), resulting in n_comp(s,v)
263  // implicitly becoming 0 regardless of any previous value.
264  // quick return?
265  if (nvg == this->n_var_groups(s))
266  {
267  for (unsigned int vg=0; vg<nvg; vg++)
268  {
269  this->set_n_comp_group(s,vg,0);
270  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
271  }
272  return;
273  }
274 
275  const bool hei = this->has_extra_integers();
276 
277  // since there is ample opportunity to screw up other systems, let us
278  // cache their current sizes and later assert that they are unchanged.
279 #ifdef DEBUG
280  const unsigned int nei = this->n_extra_integers();
281 
282  DofObject::index_buffer_t old_system_sizes, old_extra_integers;
283  old_system_sizes.reserve(n_sys);
284  old_extra_integers.reserve(nei);
285 
286  for (unsigned int s_ctr=0; s_ctr<n_sys; s_ctr++)
287  old_system_sizes.push_back(this->n_var_groups(s_ctr));
288 
289  for (unsigned int ei=0; ei != nei; ++ei)
290  old_extra_integers.push_back(this->get_extra_integer(ei));
291 #endif
292 
293  // remove current indices if we have some
294  if (this->n_var_groups(s) != 0)
295  {
296  const unsigned int old_nvg_s = this->n_var_groups(s);
297 
298  DofObject::index_buffer_t::iterator
299  it = _idx_buf.begin(),
300  end = _idx_buf.begin();
301 
302  std::advance(it, this->start_idx(s));
303  std::advance(end, this->end_idx(s));
304  _idx_buf.erase(it,end);
305 
306  for (unsigned int ctr=(s+1); ctr<n_sys; ctr++)
307  _idx_buf[ctr] -= 2*old_nvg_s;
308 
309  if (hei)
310  _idx_buf[n_sys] -= 2*old_nvg_s;
311  }
312 
313  // better not have any now!
314  libmesh_assert_equal_to (this->n_var_groups(s), 0);
315 
316  // Make sure we didn't screw up any of our sizes!
317 #ifdef DEBUG
318  for (auto s_ctr : make_range(this->n_systems()))
319  if (s_ctr != s)
320  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
321 
322  libmesh_assert_equal_to (nei, this->n_extra_integers());
323 
324  for (unsigned int ei=0; ei != nei; ++ei)
325  libmesh_assert_equal_to(old_extra_integers[ei], this->get_extra_integer(ei));
326 #endif
327 
328  // OK, if the user requested 0 that is what we have
329  if (nvg == 0)
330  return;
331 
332  {
333  // array to hold new indices
334  DofObject::index_buffer_t var_idxs(2*nvg);
335  for (unsigned int vg=0; vg<nvg; vg++)
336  {
337  var_idxs[2*vg ] = ncv_magic*nvpg[vg] + 0;
338  var_idxs[2*vg + 1] = invalid_id - 1;
339  }
340 
341  DofObject::index_buffer_t::iterator it = _idx_buf.begin();
342  std::advance(it, this->end_idx(s));
343  _idx_buf.insert(it, var_idxs.begin(), var_idxs.end());
344 
345  for (unsigned int ctr=(s+1); ctr<n_sys; ctr++)
346  _idx_buf[ctr] += 2*nvg;
347 
348  if (hei)
349  _idx_buf[n_sys] += 2*nvg;
350 
351  // resize _idx_buf to fit so no memory is wasted.
353  }
354 
355  libmesh_assert_equal_to (nvg, this->n_var_groups(s));
356 
357 #ifdef DEBUG
358 
359  libmesh_assert_equal_to (this->n_var_groups(s), nvpg.size());
360 
361  for (auto vg : make_range(this->n_var_groups(s)))
362  {
363  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
364  libmesh_assert_equal_to (this->n_comp_group(s,vg), 0);
365  }
366 
367  for (auto v : make_range(this->n_vars(s)))
368  libmesh_assert_equal_to (this->n_comp(s,v), 0);
369 
370  // again, all other system sizes should be unchanged!
371  for (auto s_ctr : make_range(this->n_systems()))
372  if (s_ctr != s)
373  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
374 
375  // Extra integers count and values should also be unchanged!
376  libmesh_assert_equal_to (nei, this->n_extra_integers());
377 
378  for (unsigned int ei=0; ei != nei; ++ei)
379  libmesh_assert_equal_to(old_extra_integers[ei], this->get_extra_integer(ei));
380 #endif
381 }
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:995
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
unsigned int end_idx(const unsigned int s) const
The ending index for system s.
Definition: dof_object.h:1253
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_systems() const
Definition: dof_object.h:930
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
bool has_extra_integers() const
Returns whether extra integers are associated to the DofObject.
Definition: dof_object.h:1181
std::vector< index_t > index_buffer_t
Definition: dof_object.h:674
void set_n_comp_group(const unsigned int s, const unsigned int vg, const unsigned int ncomp)
Sets the number of components for VariableGroup vg of system s associated with this DofObject...
Definition: dof_object.C:397
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
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:134
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1163
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1008
dof_id_type get_extra_integer(const unsigned int index) const
Gets the value on this object of the extra integer associated with index, which should have been obta...
Definition: dof_object.h:1095
static const index_t ncv_magic
Above we introduced the chimera ncv, which is a hybrid of the form ncv = ncv_magic*nv + nc where nv a...
Definition: dof_object.h:686

◆ set_neighbor()

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

◆ set_node()

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

Reimplemented in libMesh::RemoteElem.

Definition at line 2381 of file elem.h.

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

Referenced by LinearElasticityWithContact::add_contact_edge_elements(), add_cube_convex_hull_to_mesh(), libMesh::UnstructuredMesh::all_first_order(), AllSecondOrderTest::allCompleteOrderMixed(), AllSecondOrderTest::allCompleteOrderRange(), AllSecondOrderTest::allSecondOrderMixed(), AllSecondOrderTest::allSecondOrderRange(), libMesh::TetGenMeshInterface::assign_nodes_to_elem(), libMesh::MeshTools::Generation::build_cube(), GetBoundaryPointsTest::build_mesh(), MixedDimensionMeshTest::build_mesh(), MeshfunctionDFEM::build_mesh(), SlitMeshTest::build_mesh(), MixedDimensionNonUniformRefinement::build_mesh(), MixedDimensionNonUniformRefinementTriangle::build_mesh(), MixedDimensionNonUniformRefinement3D::build_mesh(), OverlappingTestBase::build_quad_mesh(), libMesh::TriangleWrapper::copy_tri_to_mesh(), libMesh::UnstructuredMesh::create_submesh(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::AbaqusIO::read_elements(), libMesh::GmshIO::read_mesh(), libMesh::DynaIO::read_mesh(), libMesh::MatlabIO::read_stream(), libMesh::RemoteElem::set_node(), PerElemTest< elem_type >::setUp(), libMesh::FE< Dim, LAGRANGE_VEC >::shape(), libMesh::UnstructuredMesh::stitching_helper(), libMesh::Elem::swap2nodes(), SystemsTest::testDofCouplingWithVarGroups(), MeshTriangulationTest::testEdgesMesh(), MeshTriangulationTest::testHalfDomain(), NodalNeighborsTest::testOrientation(), MeshTriangulationTest::testPoly2TriBad1DMultiBoundary(), MeshTriangulationTest::testPoly2TriBad2DMultiBoundary(), MeshTriangulationTest::testPoly2TriBadEdges(), EquationSystemsTest::testPostInitAddElem(), SystemsTest::testProjectMatrix3D(), InfFERadialTest::testRefinement(), EquationSystemsTest::testReinitWithNodeElem(), BoundaryInfoTest::testShellFaceConstraints(), InfFERadialTest::testSides(), MeshSubdomainIDTest::testUnpartitioned(), and libMesh::Poly2TriTriangulator::triangulate_current_points().

2382 {
2383  libmesh_assert_less (i, this->n_nodes());
2384 
2385  return _nodes[i];
2386 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2087
virtual unsigned int n_nodes() const =0

◆ set_old_dof_object()

void libMesh::DofObject::set_old_dof_object ( )
inherited

Sets the old_dof_object to a copy of this.

Definition at line 135 of file dof_object.C.

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

136 {
137  this->clear_old_dof_object();
138 
140 
141  // Make a new DofObject, assign a copy of \p this.
142  // Make sure the copy ctor for DofObject works!!
143  this->old_dof_object = this->construct(this);
144 }
std::unique_ptr< DofObject > construct(const DofObject *other=nullptr)
Convenient factory function that calls either the (deep) copy constructor or the default constructor ...
Definition: dof_object.h:736
void clear_old_dof_object()
Sets the old_dof_object to nullptr.
Definition: dof_object.C:128
libmesh_assert(ctx)
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88

◆ set_p_level()

void libMesh::Elem::set_p_level ( const unsigned int  p)
inherited

Sets the value of the p-refinement level for the element.

The following functions only apply when AMR is enabled and thus are not present otherwise.

Note
The maximum p-refinement level is currently 255.

Definition at line 41 of file elem_refinement.C.

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

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::Elem::coarsen(), libMesh::Elem::Elem(), libMesh::Elem::refine(), libMesh::Elem::set_p_level(), and VolumeTest::testHex20PLevelTrueCentroid().

42 {
43  // Maintain the parent's p level as the minimum of it's children
44  if (this->parent() != nullptr)
45  {
46  unsigned int parent_p_level = this->parent()->p_level();
47 
48  // If our new p level is less than our parents, our parents drops
49  if (parent_p_level > p)
50  {
51  this->parent()->set_p_level(p);
52 
53  // And we should keep track of the drop, in case we need to
54  // do a projection later.
56  }
57  // If we are the lowest p level and it increases, so might
58  // our parent's, but we have to check every other child to see
59  else if (parent_p_level == _p_level && _p_level < p)
60  {
61  _p_level = cast_int<unsigned char>(p);
62  parent_p_level = cast_int<unsigned char>(p);
63  for (auto & c : this->parent()->child_ref_range())
64  parent_p_level = std::min(parent_p_level,
65  c.p_level());
66 
67  // When its children all have a higher p level, the parent's
68  // should rise
69  if (parent_p_level > this->parent()->p_level())
70  {
71  this->parent()->set_p_level(parent_p_level);
72 
73  // And we should keep track of the rise, in case we need to
74  // do a projection later.
76  }
77 
78  return;
79  }
80  }
81 
82  this->hack_p_level(p);
83 }
void set_p_level(const unsigned int p)
Sets the value of the p-refinement level for the element.
const Elem * parent() const
Definition: elem.h:2867
unsigned char _p_level
p refinement level - the difference between the polynomial degree on this element and the minimum pol...
Definition: elem.h:2132
unsigned int p_level() const
Definition: elem.h:2945
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:2188
void set_p_refinement_flag(const RefinementState pflag)
Sets the value of the p-refinement flag for the element.
Definition: elem.h:3071
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:3101

◆ set_p_refinement_flag()

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

Sets the value of the p-refinement flag for the element.

Definition at line 3071 of file elem.h.

References libMesh::Elem::_pflag, libMesh::Elem::JUST_REFINED, and libMesh::Elem::p_level().

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshRefinement::make_flags_parallel_consistent(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::refine(), and libMesh::Elem::set_p_level().

3072 {
3073  if (this->p_level() == 0)
3074  libmesh_assert_not_equal_to
3075  (pflag, Elem::JUST_REFINED);
3076 
3077  _pflag = cast_int<unsigned char>(pflag);
3078 }
unsigned char _pflag
p refinement flag.
Definition: elem.h:2122
unsigned int p_level() const
Definition: elem.h:2945

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

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

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

2884 {
2885  // We no longer support using parent() as interior_parent()
2886  libmesh_assert_equal_to(this->dim(), p ? p->dim() : this->dim());
2887  _elemlinks[0] = p;
2888 }
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:2093
virtual unsigned short dim() const =0

◆ set_refinement_flag()

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

◆ set_unique_id() [1/2]

unique_id_type & libMesh::DofObject::set_unique_id ( )
inlineinherited
Returns
The globally unique_id for this DofObject as a writable reference. Deprecated; use the API taking an input instead.

Definition at line 852 of file dof_object.h.

References libMesh::DofObject::_unique_id.

Referenced by libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::create_submesh(), libMesh::ReplicatedMesh::insert_elem(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_node(), ExodusTest< elem_type >::meshes_equal_enough(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read_nodes(), and libMesh::XdrIO::read_serialized_nodes().

853 {
854 #ifdef LIBMESH_ENABLE_UNIQUE_ID
855  libmesh_deprecated();
856  return _unique_id;
857 #else
858  libmesh_not_implemented();
859 #endif
860 }
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:572

◆ set_unique_id() [2/2]

void libMesh::DofObject::set_unique_id ( unique_id_type  new_id)
inlineinherited

Sets the unique_id for this DofObject.

Definition at line 865 of file dof_object.h.

References libMesh::DofObject::_unique_id, and libMesh::libmesh_ignore().

866 {
867 #ifdef LIBMESH_ENABLE_UNIQUE_ID
868  _unique_id = new_id;
869 #else
870  libmesh_ignore(new_id);
871  libmesh_not_implemented();
872 #endif
873 }
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:572
void libmesh_ignore(const Args &...)

◆ set_vg_dof_base()

void libMesh::DofObject::set_vg_dof_base ( const unsigned int  s,
const unsigned int  vg,
const dof_id_type  db 
)
inlineinherited

VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base.

Definition at line 1290 of file dof_object.h.

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

Referenced by libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofObject::invalidate_dofs(), libMesh::DofMap::reinit(), libMesh::DofMap::set_nonlocal_dof_objects(), and DofObjectTest< Node >::testManualDofCalculation().

1293 {
1294  libmesh_assert_less (s, this->n_systems());
1295  libmesh_assert_less (vg, this->n_var_groups(s));
1296 
1297  const unsigned int
1298  start_idx_sys = this->start_idx(s);
1299 
1300  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1301 
1302  _idx_buf[start_idx_sys + 2*vg + 1] = db;
1303 
1304  libmesh_assert_equal_to (this->vg_dof_base(s,vg), db);
1305 }
dof_id_type vg_dof_base(const unsigned int s, const unsigned int vg) const
VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for di...
Definition: dof_object.h:1310
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
unsigned int n_systems() const
Definition: dof_object.h:930
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
index_buffer_t _idx_buf
Definition: dof_object.h:675

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

References libMesh::Elem::n_sides().

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::BoundaryInfo::add_elements(), libMesh::MeshTools::Modification::all_tri(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), compute_enriched_soln(), libMesh::FEAbstract::compute_node_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::BoundaryInfo::copy_boundary_ids(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::MeshTools::Modification::flatten(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), libMesh::Elem::get_info(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::Elem::has_topological_neighbor(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_constraints(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_node_constraints(), libMesh::LaplaceMeshSmoother::init(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::Elem::nullify_neighbors(), libMesh::PostscriptIO::plot_quadratic_elem(), libMesh::MeshTools::Modification::smooth(), libMesh::UnstructuredMesh::stitching_helper(), and MeshBaseTest::testMeshBaseVerifyIsPrepared().

2511 {
2512  return {0, cast_int<unsigned short>(this->n_sides())};
2513 }
virtual unsigned int n_sides() const =0

◆ side_ptr() [1/4]

std::unique_ptr< Elem > libMesh::Tet::side_ptr ( const unsigned int  i)
finaloverridevirtualinherited
Returns
A primitive (3-noded) triangle for face i.

Implements libMesh::Elem.

Definition at line 107 of file cell_tet.C.

References libMesh::Tet::n_sides(), libMesh::Elem::node_ptr(), and side_nodes_map.

108 {
109  libmesh_assert_less (i, this->n_sides());
110 
111  std::unique_ptr<Elem> face = std::make_unique<Tri3>();
112 
113  for (auto n : face->node_index_range())
114  face->set_node(n) = this->node_ptr(Tet4::side_nodes_map[i][n]);
115 
116  return face;
117 }
static const 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:196
virtual unsigned int n_sides() const override final
Definition: cell_tet.h:74
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2331

◆ side_ptr() [2/4]

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

Rebuilds a primitive (3-noded) triangle for face i.

Implements libMesh::Elem.

Definition at line 121 of file cell_tet.C.

References libMesh::TRI3.

123 {
124  this->simple_side_ptr<Tet,Tet4>(side, i, TRI3);
125 }

◆ side_ptr() [3/4]

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

Definition at line 2519 of file elem.h.

References libMesh::Elem::side_ptr().

2520 {
2521  // Call the non-const version of this function, return the result as
2522  // a std::unique_ptr<const Elem>.
2523  Elem * me = const_cast<Elem *>(this);
2524  const Elem * s = const_cast<const Elem *>(me->side_ptr(i).release());
2525  return std::unique_ptr<const Elem>(s);
2526 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220

◆ side_ptr() [4/4]

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

Definition at line 2532 of file elem.h.

References libMesh::Elem::side_ptr().

2534 {
2535  // Hand off to the non-const version of this function
2536  Elem * me = const_cast<Elem *>(this);
2537  std::unique_ptr<Elem> e {const_cast<Elem *>(elem.release())};
2538  me->side_ptr(e, i);
2539  elem = std::move(e);
2540 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220

◆ side_type()

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

Implements libMesh::Elem.

Definition at line 624 of file cell_tet4.C.

References libMesh::TRI3.

625 {
626  libmesh_assert_less (s, 4);
627  return TRI3;
628 }

◆ sides_on_edge()

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

Implements libMesh::Elem.

Definition at line 229 of file cell_tet.C.

References libMesh::Tet::edge_sides_map, and libMesh::Tet::n_edges().

230 {
231  libmesh_assert_less (e, this->n_edges());
232  return {edge_sides_map[e][0], edge_sides_map[e][1]};
233 }
static const unsigned int edge_sides_map[6][2]
This maps each edge to the sides that contain said edge.
Definition: cell_tet.h:211
virtual unsigned int n_edges() const override final
Definition: cell_tet.h:84

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

References libMesh::Elem::mapping_type(), libMesh::Elem::n_edges(), libMesh::Elem::node_ptr(), libMesh::Elem::p_level(), and libMesh::Elem::subdomain_id().

2696 {
2697  libmesh_assert_less (i, this->n_edges());
2698 
2699  std::unique_ptr<Elem> edge = std::make_unique<Edgeclass>(this);
2700 
2701  for (auto n : edge->node_index_range())
2702  edge->set_node(n) = this->node_ptr(Subclass::edge_nodes_map[i][n]);
2703 
2704  edge->set_interior_parent(this);
2705  edge->set_mapping_type(this->mapping_type());
2706  edge->subdomain_id() = this->subdomain_id();
2707 #ifdef LIBMESH_ENABLE_AMR
2708  edge->set_p_level(this->p_level());
2709 #endif
2710 
2711  return edge;
2712 }
unsigned int p_level() const
Definition: elem.h:2945
ElemMappingType mapping_type() const
Definition: elem.h:2957
virtual unsigned int n_edges() const =0
subdomain_id_type subdomain_id() const
Definition: elem.h:2391
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2331

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

References libMesh::Elem::mapping_type(), libMesh::Elem::n_edges(), libMesh::Elem::node_ptr(), libMesh::Elem::p_level(), and libMesh::Elem::subdomain_id().

2723 {
2724  libmesh_assert_less (i, this->n_edges());
2725 
2726  if (!edge.get() || edge->type() != edgetype)
2727  {
2728  Subclass & real_me = cast_ref<Subclass&>(*this);
2729  edge = real_me.Subclass::build_edge_ptr(i);
2730  }
2731  else
2732  {
2733  edge->set_mapping_type(this->mapping_type());
2734  edge->subdomain_id() = this->subdomain_id();
2735 #ifdef LIBMESH_ENABLE_AMR
2736  edge->set_p_level(this->p_level());
2737 #endif
2738  for (auto n : edge->node_index_range())
2739  edge->set_node(n) = this->node_ptr(Subclass::edge_nodes_map[i][n]);
2740  }
2741 }
unsigned int p_level() const
Definition: elem.h:2945
ElemMappingType mapping_type() const
Definition: elem.h:2957
virtual unsigned int n_edges() const =0
subdomain_id_type subdomain_id() const
Definition: elem.h:2391
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2331

◆ simple_build_side_ptr() [1/2]

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

An implementation for simple (all sides equal) elements.

Definition at line 2574 of file elem.h.

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

2576 {
2577  libmesh_assert_less (i, this->n_sides());
2578 
2579  std::unique_ptr<Elem> face;
2580  if (proxy)
2581  {
2582 #ifdef LIBMESH_ENABLE_DEPRECATED
2583  face = std::make_unique<Side<Sideclass,Subclass>>(this,i);
2584  libmesh_deprecated();
2585 #else
2586  libmesh_error();
2587 #endif
2588  }
2589  else
2590  {
2591  face = std::make_unique<Sideclass>(this);
2592  for (auto n : face->node_index_range())
2593  face->set_node(n) = this->node_ptr(Subclass::side_nodes_map[i][n]);
2594  }
2595 
2596 #ifdef LIBMESH_ENABLE_DEPRECATED
2597  if (!proxy) // proxy sides used to leave parent() set
2598 #endif
2599  face->set_parent(nullptr);
2600  face->set_interior_parent(this);
2601 
2602  face->set_mapping_type(this->mapping_type());
2603  face->subdomain_id() = this->subdomain_id();
2604 #ifdef LIBMESH_ENABLE_AMR
2605  face->set_p_level(this->p_level());
2606 #endif
2607 
2608  return face;
2609 }
unsigned int p_level() const
Definition: elem.h:2945
ElemMappingType mapping_type() const
Definition: elem.h:2957
virtual unsigned int n_sides() const =0
subdomain_id_type subdomain_id() const
Definition: elem.h:2391
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2331

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

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

2619 {
2620  libmesh_assert_less (i, this->n_sides());
2621 
2622  if (!side.get() || side->type() != sidetype)
2623  {
2624  Subclass & real_me = cast_ref<Subclass&>(*this);
2625  side = real_me.Subclass::build_side_ptr(i, false);
2626  }
2627  else
2628  {
2629  side->subdomain_id() = this->subdomain_id();
2630  side->set_mapping_type(this->mapping_type());
2631 #ifdef LIBMESH_ENABLE_AMR
2632  side->set_p_level(this->p_level());
2633 #endif
2634  for (auto n : side->node_index_range())
2635  side->set_node(n) = this->node_ptr(Subclass::side_nodes_map[i][n]);
2636  }
2637 }
unsigned int p_level() const
Definition: elem.h:2945
ElemMappingType mapping_type() const
Definition: elem.h:2957
virtual unsigned int n_sides() const =0
subdomain_id_type subdomain_id() const
Definition: elem.h:2391
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2331

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

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

2647 {
2648  libmesh_assert_less (i, this->n_sides());
2649 
2650  if (!side.get() || side->type() != sidetype)
2651  {
2652  Subclass & real_me = cast_ref<Subclass&>(*this);
2653  side = real_me.Subclass::side_ptr(i);
2654  }
2655  else
2656  {
2657  side->subdomain_id() = this->subdomain_id();
2658 
2659  for (auto n : side->node_index_range())
2660  side->set_node(n) = this->node_ptr(Mapclass::side_nodes_map[i][n]);
2661  }
2662 }
virtual unsigned int n_sides() const =0
subdomain_id_type subdomain_id() const
Definition: elem.h:2391
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2331

◆ subactive()

bool libMesh::Elem::subactive ( ) const
inlineinherited
Returns
true if the element is subactive (i.e. has no active descendants), false otherwise or if AMR is disabled.

Definition at line 2796 of file elem.h.

References libMesh::Elem::active(), libMesh::Elem::has_children(), and libMesh::Elem::parent().

Referenced by libMesh::HPCoarsenTest::add_projection(), libMesh::Elem::ancestor(), libMesh::FEAbstract::compute_node_constraints(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_constraints(), libMesh::InfFE< Dim, T_radial, T_map >::inf_compute_node_constraints(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::Elem::refine(), libMesh::Elem::remove_links_to_me(), and libMesh::UnstructuredMesh::stitching_helper().

2797 {
2798 #ifdef LIBMESH_ENABLE_AMR
2799  if (this->active())
2800  return false;
2801  if (!this->has_children())
2802  return true;
2803  for (const Elem * my_ancestor = this->parent();
2804  my_ancestor != nullptr;
2805  my_ancestor = my_ancestor->parent())
2806  if (my_ancestor->active())
2807  return true;
2808 #endif
2809 
2810  return false;
2811 }
const Elem * parent() const
Definition: elem.h:2867
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220
bool active() const
Definition: elem.h:2778
bool has_children() const
Definition: elem.h:2816

◆ subdomain_id() [1/2]

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

Definition at line 2391 of file elem.h.

References libMesh::Elem::_sbd_id.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::SyncSubdomainIds::act_on_data(), LinearElasticityWithContact::add_contact_edge_elements(), libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Modification::all_tri(), AllSecondOrderTest::allCompleteOrderRange(), AllSecondOrderTest::allSecondOrderRange(), libMesh::AbaqusIO::assign_subdomain_ids(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::InfHex8::build_edge_ptr(), libMesh::InfPrism6::build_edge_ptr(), libMesh::InfHex18::build_edge_ptr(), libMesh::InfPrism12::build_edge_ptr(), libMesh::InfHex16::build_edge_ptr(), MixedDimensionMeshTest::build_mesh(), MixedDimensionNonUniformRefinement::build_mesh(), MixedDimensionNonUniformRefinementTriangle::build_mesh(), MixedDimensionNonUniformRefinement3D::build_mesh(), OverlappingTestBase::build_quad_mesh(), libMesh::InfQuad4::build_side_ptr(), libMesh::InfHex8::build_side_ptr(), libMesh::InfPrism6::build_side_ptr(), libMesh::InfHex18::build_side_ptr(), libMesh::Pyramid5::build_side_ptr(), libMesh::InfQuad6::build_side_ptr(), libMesh::Prism6::build_side_ptr(), libMesh::InfPrism12::build_side_ptr(), libMesh::InfHex16::build_side_ptr(), libMesh::Pyramid13::build_side_ptr(), libMesh::Prism15::build_side_ptr(), libMesh::Prism18::build_side_ptr(), libMesh::Pyramid14::build_side_ptr(), libMesh::Prism20::build_side_ptr(), libMesh::Prism21::build_side_ptr(), libMesh::Pyramid18::build_side_ptr(), libMesh::MeshTools::Modification::change_subdomain_id(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::TriangleWrapper::copy_tri_to_mesh(), libMesh::DofMap::dof_indices(), libMesh::Elem::Elem(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::MeshTools::Modification::flatten(), libMesh::SyncSubdomainIds::gather_data(), libMesh::Elem::get_info(), MeshExtruderTest::QueryElemSubdomainID::get_subdomain_for_layer(), libMesh::UNVIO::groups_in(), libMesh::DofMap::old_dof_indices(), libMesh::PointLocatorNanoflann::operator()(), libMesh::XdrIO::pack_element(), libMesh::CheckpointIO::read_connectivity(), libMesh::GmshIO::read_mesh(), libMesh::DynaIO::read_mesh(), libMesh::Prism::side_ptr(), libMesh::Pyramid::side_ptr(), libMesh::Edge::side_ptr(), libMesh::InfPrism::side_ptr(), libMesh::InfHex::side_ptr(), libMesh::InfQuad::side_ptr(), libMesh::Elem::simple_build_edge_ptr(), libMesh::Elem::simple_build_side_ptr(), libMesh::Elem::simple_side_ptr(), SystemsTest::testDofCouplingWithVarGroups(), MeshExtruderTest::testExtruder(), and SystemsTest::tripleValueTest().

2392 {
2393  return _sbd_id;
2394 }
subdomain_id_type _sbd_id
The subdomain to which this element belongs.
Definition: elem.h:2109

◆ subdomain_id() [2/2]

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

Definition at line 2399 of file elem.h.

References libMesh::Elem::_sbd_id.

2400 {
2401  return _sbd_id;
2402 }
subdomain_id_type _sbd_id
The subdomain to which this element belongs.
Definition: elem.h:2109

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

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

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

3174 {
3175  std::vector<boundary_id_type> ids1, ids2;
3176  boundary_info->edge_boundary_ids(this, e1, ids1);
3177  boundary_info->edge_boundary_ids(this, e2, ids2);
3178  boundary_info->remove_edge(this, e1);
3179  boundary_info->remove_edge(this, e2);
3180  if (!ids1.empty())
3181  boundary_info->add_edge(this, e2, ids1);
3182  if (!ids2.empty())
3183  boundary_info->add_edge(this, e1, ids2);
3184 }

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

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

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

3158 {
3159  std::vector<boundary_id_type> ids1, ids2;
3160  boundary_info->boundary_ids(this, s1, ids1);
3161  boundary_info->boundary_ids(this, s2, ids2);
3162  boundary_info->remove_side(this, s1);
3163  boundary_info->remove_side(this, s2);
3164  if (!ids1.empty())
3165  boundary_info->add_side(this, s2, ids1);
3166  if (!ids2.empty())
3167  boundary_info->add_side(this, s1, ids2);
3168 }

◆ swap2neighbors()

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

Swaps two neighbor_ptrs.

Definition at line 1943 of file elem.h.

References libMesh::Elem::neighbor_ptr(), and libMesh::Elem::set_neighbor().

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

1944  {
1945  Elem * temp = this->neighbor_ptr(n1);
1946  this->set_neighbor(n1, this->neighbor_ptr(n2));
1947  this->set_neighbor(n2, temp);
1948  }
void set_neighbor(const unsigned int i, Elem *n)
Assigns n as the neighbor.
Definition: elem.h:2427
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2407

◆ swap2nodes()

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

Swaps two node_ptrs.

Definition at line 1933 of file elem.h.

References libMesh::Elem::node_ptr(), and libMesh::Elem::set_node().

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

1934  {
1935  Node * temp = this->node_ptr(n1);
1936  this->set_node(n1) = this->node_ptr(n2);
1937  this->set_node(n2) = temp;
1938  }
virtual Node *& set_node(const unsigned int i)
Definition: elem.h:2381
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2331

◆ swap3neighbors()

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

◆ swap3nodes()

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

◆ swap4neighbors()

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

Swaps four neighbor_ptrs, "rotating" them.

Definition at line 1994 of file elem.h.

References libMesh::Elem::swap2neighbors(), and libMesh::Elem::swap3neighbors().

Referenced by libMesh::InfHex8::permute(), libMesh::Quad4::permute(), libMesh::Pyramid5::permute(), libMesh::Quad8::permute(), libMesh::Hex8::permute(), libMesh::Quad9::permute(), libMesh::InfHex16::permute(), libMesh::Pyramid13::permute(), libMesh::InfHex18::permute(), libMesh::Hex20::permute(), libMesh::Pyramid14::permute(), libMesh::Pyramid18::permute(), and libMesh::Hex27::permute().

1996  {
1997  swap3neighbors(n1, n2, n3);
1998  swap2neighbors(n3, n4);
1999  }
void swap3neighbors(unsigned int n1, unsigned int n2, unsigned int n3)
Swaps three neighbor_ptrs, "rotating" them.
Definition: elem.h:1974
void swap2neighbors(unsigned int n1, unsigned int n2)
Swaps two neighbor_ptrs.
Definition: elem.h:1943

◆ swap4nodes()

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

Swaps four node_ptrs, "rotating" them.

Definition at line 1984 of file elem.h.

References libMesh::Elem::swap2nodes(), and libMesh::Elem::swap3nodes().

Referenced by libMesh::InfHex8::permute(), libMesh::Quad4::permute(), libMesh::Pyramid5::permute(), libMesh::Quad8::permute(), libMesh::Hex8::permute(), libMesh::Quad9::permute(), libMesh::InfHex16::permute(), libMesh::Pyramid13::permute(), libMesh::InfHex18::permute(), libMesh::Hex20::permute(), libMesh::Pyramid14::permute(), libMesh::Pyramid18::permute(), and libMesh::Hex27::permute().

1986  {
1987  swap3nodes(n1, n2, n3);
1988  swap2nodes(n3, n4);
1989  }
void swap3nodes(unsigned int n1, unsigned int n2, unsigned int n3)
Swaps three node_ptrs, "rotating" them.
Definition: elem.h:1965
void swap2nodes(unsigned int n1, unsigned int n2)
Swaps two node_ptrs.
Definition: elem.h:1933

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

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

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::BoundaryInfo::add_elements(), libMesh::BoundaryInfo::boundary_ids(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::ExodusII_IO::read_elemental_variable(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::BoundaryInfo::sides_with_boundary_id(), and ExtraIntegersTest::test_final_integers().

2894 {
2895  const Elem * tp = this;
2896 
2897  // Keep getting the element's parent
2898  // until that parent is at level-0
2899  while (tp->parent() != nullptr)
2900  tp = tp->parent();
2901 
2902  libmesh_assert(tp);
2903  libmesh_assert_equal_to (tp->level(), 0);
2904 
2905  return tp;
2906 }
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220

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

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

Referenced by libMesh::Elem::has_topological_neighbor(), libMesh::GhostPointNeighbors::operator()(), libMesh::DefaultCoupling::operator()(), and libMesh::MeshRefinement::topological_neighbor().

1125 {
1126  libmesh_assert_less (i, this->n_neighbors());
1127 
1128  const Elem * neighbor_i = this->neighbor_ptr(i);
1129  if (neighbor_i != nullptr)
1130  return neighbor_i;
1131 
1132  if (pb)
1133  {
1134  // Since the neighbor is nullptr it must be on a boundary. We need
1135  // see if this is a periodic boundary in which case it will have a
1136  // topological neighbor
1137  std::vector<boundary_id_type> bc_ids;
1138  mesh.get_boundary_info().boundary_ids(this, cast_int<unsigned short>(i), bc_ids);
1139  for (const auto & id : bc_ids)
1140  if (pb->boundary(id))
1141  {
1142  neighbor_i = pb->neighbor(id, point_locator, this, i);
1143 
1144  // Since coarse elements do not have more refined
1145  // neighbors we need to make sure that we don't return one
1146  // of these types of neighbors.
1147  if (neighbor_i)
1148  while (level() < neighbor_i->level())
1149  neighbor_i = neighbor_i->parent();
1150  return neighbor_i;
1151  }
1152  }
1153 
1154  return nullptr;
1155 }
MeshBase & mesh
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2407
unsigned int level() const
Definition: elem.h:2911
unsigned int n_neighbors() const
Definition: elem.h:670

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

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

1083 {
1084  libmesh_assert_less (i, this->n_neighbors());
1085 
1086  Elem * neighbor_i = this->neighbor_ptr(i);
1087  if (neighbor_i != nullptr)
1088  return neighbor_i;
1089 
1090  if (pb)
1091  {
1092  // Since the neighbor is nullptr it must be on a boundary. We need
1093  // see if this is a periodic boundary in which case it will have a
1094  // topological neighbor
1095  std::vector<boundary_id_type> bc_ids;
1096  mesh.get_boundary_info().boundary_ids(this, cast_int<unsigned short>(i), bc_ids);
1097  for (const auto & id : bc_ids)
1098  if (pb->boundary(id))
1099  {
1100  // Since the point locator inside of periodic boundaries
1101  // returns a const pointer we will retrieve the proper
1102  // pointer directly from the mesh object.
1103  const Elem * const cn = pb->neighbor(id, point_locator, this, i);
1104  neighbor_i = const_cast<Elem *>(cn);
1105 
1106  // Since coarse elements do not have more refined
1107  // neighbors we need to make sure that we don't return one
1108  // of these types of neighbors.
1109  if (neighbor_i)
1110  while (level() < neighbor_i->level())
1111  neighbor_i = neighbor_i->parent();
1112  return neighbor_i;
1113  }
1114  }
1115 
1116  return nullptr;
1117 }
MeshBase & mesh
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2407
unsigned int level() const
Definition: elem.h:2911
unsigned int n_neighbors() const
Definition: elem.h:670

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

References libMesh::DofObject::id(), libMesh::Elem::interior_parent(), libMesh::make_range(), libMesh::Elem::n_neighbors(), libMesh::Elem::n_nodes(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_id(), libMesh::Elem::parent(), and libMesh::Elem::type().

614 {
615  // If the elements aren't the same type, they aren't equal
616  if (this->type() != rhs.type())
617  return false;
618 
619  libmesh_assert_equal_to(this->n_nodes(), rhs.n_nodes());
620 
621  for (auto n : make_range(this->n_nodes()))
622  if (this->node_id(n) != rhs.node_id(n))
623  return false;
624 
625  for (auto neigh : make_range(this->n_neighbors()))
626  {
627  if (!this->neighbor_ptr(neigh))
628  {
629  if (rhs.neighbor_ptr(neigh))
630  return false;
631  continue;
632  }
633  if (!rhs.neighbor_ptr(neigh) ||
634  this->neighbor_ptr(neigh)->id() !=
635  rhs.neighbor_ptr(neigh)->id())
636  return false;
637  }
638 
639  if (this->parent())
640  {
641  if (!rhs.parent())
642  return false;
643  if (this->parent()->id() != rhs.parent()->id())
644  return false;
645  }
646  else if (rhs.parent())
647  return false;
648 
649  if (this->interior_parent())
650  {
651  if (!rhs.interior_parent())
652  return false;
653  if (this->interior_parent()->id() !=
654  rhs.interior_parent()->id())
655  return false;
656  }
657  else if (rhs.interior_parent())
658  return false;
659 
660  return true;
661 }
const Elem * parent() const
Definition: elem.h:2867
const Elem * interior_parent() const
Definition: elem.C:994
dof_id_type id() const
Definition: dof_object.h:823
virtual unsigned int n_nodes() const =0
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2407
unsigned int n_neighbors() const
Definition: elem.h:670
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:134
virtual ElemType type() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2299

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

References libMesh::ElemInternal::total_family_tree().

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

1743 {
1744  ElemInternal::total_family_tree(this, family, reset);
1745 }
void total_family_tree(T elem, std::vector< T > &family, bool reset)
Definition: elem_internal.h:67

◆ total_family_tree() [2/2]

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

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

Definition at line 1749 of file elem.C.

References libMesh::ElemInternal::total_family_tree().

1751 {
1752  ElemInternal::total_family_tree(this, family, reset);
1753 }
void total_family_tree(T elem, std::vector< T > &family, bool reset)
Definition: elem_internal.h:67

◆ total_family_tree_by_neighbor() [1/2]

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

Same as the family_tree_by_neighbor() member, but also adds any subactive descendants.

Definition at line 1827 of file elem.C.

References libMesh::ElemInternal::total_family_tree_by_neighbor().

1830 {
1831  ElemInternal::total_family_tree_by_neighbor(this, family, neighbor, reset);
1832 }
void total_family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)

◆ total_family_tree_by_neighbor() [2/2]

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

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

Definition at line 1836 of file elem.C.

References libMesh::ElemInternal::total_family_tree_by_neighbor().

1839 {
1840  ElemInternal::total_family_tree_by_neighbor(this, family, neighbor, reset);
1841 }
void total_family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)

◆ total_family_tree_by_subneighbor() [1/2]

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

Same as the family_tree_by_subneighbor() member, but also adds any subactive descendants.

Definition at line 1865 of file elem.C.

References libMesh::ElemInternal::total_family_tree_by_subneighbor().

1869 {
1870  ElemInternal::total_family_tree_by_subneighbor(this, family, neighbor, subneighbor, reset);
1871 }
void total_family_tree_by_subneighbor(T elem, std::vector< T > &family, T neighbor_in, T subneighbor, bool reset=true)

◆ total_family_tree_by_subneighbor() [2/2]

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

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

Definition at line 1875 of file elem.C.

References libMesh::ElemInternal::total_family_tree_by_subneighbor().

1879 {
1880  ElemInternal::total_family_tree_by_subneighbor(this, family, neighbor, subneighbor, reset);
1881 }
void total_family_tree_by_subneighbor(T elem, std::vector< T > &family, T neighbor_in, T subneighbor, bool reset=true)

◆ true_centroid()

Point libMesh::Tet4::true_centroid ( ) const
overridevirtual

The centroid of a 4-node tetrahedron is simply given by the average of its vertex positions.

Reimplemented from libMesh::Elem.

Definition at line 314 of file cell_tet4.C.

References libMesh::Elem::vertex_average().

315 {
316  return Elem::vertex_average();
317 }
Point vertex_average() const
Definition: elem.C:498

◆ type()

virtual ElemType libMesh::Tet4::type ( ) const
inlineoverridevirtual
Returns
TET4.

Implements libMesh::Elem.

Definition at line 80 of file cell_tet4.h.

References libMesh::TET4.

80 { return TET4; }

◆ unique_id()

unique_id_type libMesh::DofObject::unique_id ( ) const
inlineinherited
Returns
The globally unique_id for this DofObject

Definition at line 839 of file dof_object.h.

References libMesh::DofObject::_unique_id, libMesh::DofObject::invalid_unique_id, libMesh::libmesh_assert(), and libMesh::DofObject::valid_unique_id().

Referenced by libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::MeshTools::Modification::all_tri(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::get_info(), libMesh::ReplicatedMesh::insert_elem(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_node(), libMesh::XdrIO::pack_element(), libMesh::ExodusII_IO::read_elemental_variable(), SlitMeshRefinedSystemTest::testRestart(), and libMesh::XdrIO::write_serialized_nodes().

840 {
841 #ifdef LIBMESH_ENABLE_UNIQUE_ID
843  return _unique_id;
844 #else
845  return invalid_unique_id;
846 #endif
847 }
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:572
static const unique_id_type invalid_unique_id
An invalid unique_id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482
libmesh_assert(ctx)
bool valid_unique_id() const
Definition: dof_object.h:886

◆ unpack_indexing()

void libMesh::DofObject::unpack_indexing ( std::vector< largest_id_type >::const_iterator  begin)
inherited

A method for creating our index buffer from packed data - basically with our current implementation we investigate the size term and then copy.

Definition at line 595 of file dof_object.C.

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

596 {
597  _idx_buf.clear();
598 
599 #ifdef LIBMESH_ENABLE_AMR
600  this->clear_old_dof_object();
601  const bool has_old_dof_object = cast_int<bool>(*begin++);
602 #endif
603 
604  const largest_id_type size = *begin++;
605  _idx_buf.reserve(size);
606  std::copy(begin, begin+size, back_inserter(_idx_buf));
607 
608  // Check as best we can for internal consistency now
609  libmesh_assert(_idx_buf.empty() ||
611  cast_int<dof_id_signed_type>(_idx_buf.size())));
612 #ifdef DEBUG
613  if (!_idx_buf.empty())
614  {
615  const int hdr = cast_int<int>(dof_id_signed_type(_idx_buf[0]));
616  const unsigned int ns = hdr >= 0 ? hdr : (-hdr-1);
617  for (unsigned int i=1; i < ns; ++i)
618  {
619  if (hdr > 0 || i > 1)
620  libmesh_assert_greater_equal (_idx_buf[i], _idx_buf[i-1]);
621  else
622  libmesh_assert_greater_equal (_idx_buf[i], ns);
623  libmesh_assert_equal_to ((_idx_buf[i] - _idx_buf[i-1])%2, 0);
624  libmesh_assert_less_equal (_idx_buf[i], _idx_buf.size());
625  }
626  if (hdr < 0 && ns > 0)
627  libmesh_assert_less_equal(_idx_buf[ns], _idx_buf.size());
628  }
629 #endif
630 
631 #ifdef LIBMESH_ENABLE_AMR
632  if (has_old_dof_object)
633  {
634  this->old_dof_object = this->construct();
635  this->old_dof_object->unpack_indexing(begin+size);
636  }
637 #endif
638 }
std::unique_ptr< DofObject > construct(const DofObject *other=nullptr)
Convenient factory function that calls either the (deep) copy constructor or the default constructor ...
Definition: dof_object.h:736
uint64_t largest_id_type
Definition: id_types.h:148
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
Definition: type_vector.h:57
void clear_old_dof_object()
Sets the old_dof_object to nullptr.
Definition: dof_object.C:128
libmesh_assert(ctx)
int8_t dof_id_signed_type
Definition: id_types.h:68
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88
index_buffer_t _idx_buf
Definition: dof_object.h:675

◆ unpackable_indexing_size()

unsigned int libMesh::DofObject::unpackable_indexing_size ( std::vector< largest_id_type >::const_iterator  begin)
staticinherited

If we have indices packed into an buffer for communications, how much of that buffer applies to this dof object?

Definition at line 575 of file dof_object.C.

576 {
577 #ifdef LIBMESH_ENABLE_AMR
578  const bool has_old_dof_object = cast_int<bool>(*begin++);
579 
580  static const int dof_header_size = 2;
581 #else
582  static const bool has_old_dof_object = false;
583  static const int dof_header_size = 1;
584 #endif
585 
586  const largest_id_type this_indexing_size = *begin++;
587 
588  return cast_int<unsigned int>
589  (dof_header_size + this_indexing_size +
590  (has_old_dof_object ?
591  unpackable_indexing_size(begin+this_indexing_size) : 0));
592 }
static unsigned int unpackable_indexing_size(std::vector< largest_id_type >::const_iterator begin)
If we have indices packed into an buffer for communications, how much of that buffer applies to this ...
Definition: dof_object.C:575
uint64_t largest_id_type
Definition: id_types.h:148

◆ valid_id()

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

◆ valid_processor_id()

bool libMesh::DofObject::valid_processor_id ( ) const
inlineinherited
Returns
true if this DofObject has a valid id set, false otherwise.

Definition at line 922 of file dof_object.h.

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

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

923 {
925 }
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
Definition: dof_object.h:488
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:589

◆ valid_unique_id()

bool libMesh::DofObject::valid_unique_id ( ) const
inlineinherited
Returns
true if this DofObject has a valid unique_id set, false otherwise.

Definition at line 886 of file dof_object.h.

References libMesh::DofObject::_unique_id, and libMesh::DofObject::invalid_unique_id.

Referenced by libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::Elem::get_info(), libMesh::ReplicatedMesh::insert_elem(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_node(), and libMesh::DofObject::unique_id().

887 {
888 #ifdef LIBMESH_ENABLE_UNIQUE_ID
890 #else
891  return false;
892 #endif
893 }
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:572
static const unique_id_type invalid_unique_id
An invalid unique_id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482

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

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

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::DofObject::dof_number(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), and libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs().

1195 {
1196  std::pair<unsigned int, unsigned int> returnval(0,0);
1197 
1198  unsigned int & vg = returnval.first;
1199  unsigned int & offset = returnval.second;
1200 
1201  unsigned int vg_start = 0;
1202  for (; ; vg++)
1203  {
1204  libmesh_assert_less(vg, this->n_var_groups(s));
1205 
1206  const unsigned int vg_end = vg_start + this->n_vars(s,vg);
1207  if (var < vg_end)
1208  {
1209  offset = var - vg_start;
1210  return returnval;
1211  }
1212  vg_start = vg_end;
1213  }
1214 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960

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

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

Referenced by libMesh::Elem::centroid(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::Poly2TriTriangulator::insert_refinement_points(), A0::interior_assembly(), A1::interior_assembly(), OutputAssembly::interior_assembly(), SlitFunc::operator()(), libMesh::LocationMap< T >::point_of(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_second_deriv(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), libMesh::Tri3::true_centroid(), and true_centroid().

499 {
500  Point cp;
501 
502  const auto n_vertices = this->n_vertices();
503 
504  for (unsigned int n=0; n<n_vertices; n++)
505  cp.add (this->point(n));
506 
507  return (cp /= static_cast<Real>(n_vertices));
508 }
virtual unsigned int n_vertices() const =0

◆ vg_dof_base()

dof_id_type libMesh::DofObject::vg_dof_base ( const unsigned int  s,
const unsigned int  vg 
) const
inlineinherited

VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base.

Definition at line 1310 of file dof_object.h.

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

Referenced by libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::reinit(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::DofObject::set_vg_dof_base(), and DofObjectTest< Node >::testManualDofCalculation().

1312 {
1313  libmesh_assert_less (s, this->n_systems());
1314  libmesh_assert_less (vg, this->n_var_groups(s));
1315 
1316  const unsigned int
1317  start_idx_sys = this->start_idx(s);
1318 
1319  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1320 
1321  // #ifdef DEBUG
1322  // std::cout << " [ ";
1323  // for (auto i : _idx_buf)
1324  // std::cout << i << " ";
1325  // std::cout << "]\n";
1326  // #endif
1327 
1328  return _idx_buf[start_idx_sys + 2*vg + 1];
1329 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
unsigned int n_systems() const
Definition: dof_object.h:930
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
index_buffer_t _idx_buf
Definition: dof_object.h:675

◆ volume()

Real libMesh::Tet4::volume ( ) const
overridevirtual

An optimized method for computing the area of a 4-node tetrahedron.

Reimplemented from libMesh::Elem.

Definition at line 321 of file cell_tet4.C.

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

Referenced by has_invertible_map().

322 {
323  // The volume of a tetrahedron is 1/6 the box product formed
324  // by its base and apex vectors
325  Point a = point(3) - point(0);
326 
327  // b is the vector pointing from 0 to 1
328  Point b = point(1) - point(0);
329 
330  // c is the vector pointing from 0 to 2
331  Point c = point(2) - point(0);
332 
333  return triple_product(a, b, c) / 6.;
334 }
T triple_product(const TypeVector< T > &a, const TypeVector< T > &b, const TypeVector< T > &c)
Definition: type_vector.h:1068
const Point & point(const unsigned int i) const
Definition: elem.h:2277

◆ which_child_am_i()

unsigned int libMesh::Elem::which_child_am_i ( const Elem e) const
inlineinherited
Returns
The child index which e corresponds to.

I.e. if c = a->which_child_am_i(e); then a->child_ptr(c) will be e.

Definition at line 3029 of file elem.h.

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

Referenced by libMesh::BoundaryInfo::boundary_ids(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::make_links_to_me_remote(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::BoundaryInfo::sides_with_boundary_id(), libMesh::MeshTools::Modification::smooth(), and libMesh::Parallel::sync_element_data_by_parent_id().

3030 {
3031  libmesh_assert(e);
3032  libmesh_assert (this->has_children());
3033 
3034  unsigned int nc = this->n_children();
3035  for (unsigned int c=0; c != nc; c++)
3036  if (this->child_ptr(c) == e)
3037  return c;
3038 
3039  libmesh_error_msg("ERROR: which_child_am_i() was called with a non-child!");
3040 
3041  return libMesh::invalid_uint;
3042 }
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:286
virtual unsigned int n_children() const =0
libmesh_assert(ctx)
bool has_children() const
Definition: elem.h:2816
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:3000

◆ which_neighbor_am_i()

unsigned int libMesh::Elem::which_neighbor_am_i ( const Elem e) const
inlineinherited

This function tells you which neighbor e is.

I.e. if s = a->which_neighbor_am_i(e); then a->neighbor(s) will be an ancestor of e.

Definition at line 2756 of file elem.h.

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

Referenced by assemble_ellipticdg(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::BoundaryInfo::clear_stitched_boundary_side_ids(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::Poly2TriTriangulator::insert_refinement_points(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::Elem::nullify_neighbors(), and MeshBaseTest::testMeshBaseVerifyIsPrepared().

2757 {
2758  libmesh_assert(e);
2759 
2760  const Elem * eparent = e;
2761 
2762  while (eparent->level() > this->level())
2763  {
2764  eparent = eparent->parent();
2765  libmesh_assert(eparent);
2766  }
2767 
2768  for (auto s : make_range(this->n_sides()))
2769  if (this->neighbor_ptr(s) == eparent)
2770  return s;
2771 
2772  return libMesh::invalid_uint;
2773 }
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:286
libmesh_assert(ctx)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:2220
virtual unsigned int n_sides() const =0
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2407
unsigned int level() const
Definition: elem.h:2911
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:134

◆ which_node_am_i()

unsigned int libMesh::Elem::which_node_am_i ( unsigned int  side,
unsigned int  side_node 
) const
inherited

This function is deprecated, call local_side_node(side, side_node) instead.

Definition at line 733 of file elem.C.

References libMesh::Elem::local_side_node().

735 {
736  libmesh_deprecated();
737  return local_side_node(side, side_node);
738 }
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const =0

◆ which_side_am_i()

unsigned int libMesh::Elem::which_side_am_i ( const Elem e) const
inherited

This function tells you which side the boundary element e is.

I.e. if e = a->build_side_ptr(s) or e = a->side_ptr(s); then a->which_side_am_i(e) will be s.

Note
An exact floating point comparison of the nodal positions of e is made with the nodal positions of this in order to perform this test. The idea is that the test will return a valid side id if e either directly shares Node pointers with this, or was created by exactly copying some of the nodes of this (e.g. through BoundaryMesh::sync()). In these circumstances, non-fuzzy floating point equality is expected.
Returns
The side of this the element which e is, otherwise invalid_uint.

Definition at line 680 of file elem.C.

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

681 {
682  libmesh_assert(e);
683 
684  const unsigned int ns = this->n_sides();
685  const unsigned int nn = this->n_nodes();
686 
687  const unsigned int en = e->n_nodes();
688 
689  // e might be on any side until proven otherwise
690  std::vector<bool> might_be_side(ns, true);
691 
692  for (unsigned int i=0; i != en; ++i)
693  {
694  Point side_point = e->point(i);
695  unsigned int local_node_id = libMesh::invalid_uint;
696 
697  // Look for a node of this that's contiguous with node i of
698  // e. Note that the exact floating point comparison of Point
699  // positions is intentional, see the class documentation for
700  // this function.
701  for (unsigned int j=0; j != nn; ++j)
702  if (this->point(j) == side_point)
703  local_node_id = j;
704 
705  // If a node of e isn't contiguous with some node of this, then
706  // e isn't a side of this.
707  if (local_node_id == libMesh::invalid_uint)
708  return libMesh::invalid_uint;
709 
710  // If a node of e isn't contiguous with some node on side s of
711  // this, then e isn't on side s.
712  for (unsigned int s=0; s != ns; ++s)
713  if (!this->is_node_on_side(local_node_id, s))
714  might_be_side[s] = false;
715  }
716 
717  for (unsigned int s=0; s != ns; ++s)
718  if (might_be_side[s])
719  {
720 #ifdef DEBUG
721  for (unsigned int s2=s+1; s2 < ns; ++s2)
722  libmesh_assert (!might_be_side[s2]);
723 #endif
724  return s;
725  }
726 
727  // Didn't find any matching side
728  return libMesh::invalid_uint;
729 }
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:286
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
virtual unsigned int n_nodes() const =0
libmesh_assert(ctx)
virtual unsigned int n_sides() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:2277

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

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

1541 {
1542  libmesh_assert (out_stream.good());
1544  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
1545 
1546  switch (iop)
1547  {
1548  case TECPLOT:
1549  {
1550  // This connectivity vector will be used repeatedly instead
1551  // of being reconstructed inside the loop.
1552  std::vector<dof_id_type> conn;
1553  for (auto sc : make_range(this->n_sub_elem()))
1554  {
1555  this->connectivity(sc, TECPLOT, conn);
1556 
1557  std::copy(conn.begin(),
1558  conn.end(),
1559  std::ostream_iterator<dof_id_type>(out_stream, " "));
1560 
1561  out_stream << '\n';
1562  }
1563  return;
1564  }
1565 
1566  case UCD:
1567  {
1568  for (auto i : this->node_index_range())
1569  out_stream << this->node_id(i)+1 << "\t";
1570 
1571  out_stream << '\n';
1572  return;
1573  }
1574 
1575  default:
1576  libmesh_error_msg("Unsupported IO package " << iop);
1577  }
1578 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2087
libmesh_assert(ctx)
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:134
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const =0
IntRange< unsigned short > node_index_range() const
Definition: elem.h:2492
virtual unsigned int n_sub_elem() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2299

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

Referenced by libMesh::Elem::add_child(), libMesh::Elem::child_ptr(), libMesh::Elem::child_ref_range(), libMesh::Elem::contract(), libMesh::Elem::has_ancestor_children(), libMesh::Elem::has_children(), libMesh::Elem::raw_child_ptr(), libMesh::Elem::refine(), and libMesh::Elem::set_child().

◆ _counts [1/2]

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

Actually holds the data.

Definition at line 124 of file reference_counter.h.

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

◆ _counts [2/2]

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

Actually holds the data.

Definition at line 124 of file reference_counter.h.

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

◆ _diagonal_selection

Diagonal libMesh::Tet::_diagonal_selection
mutableprotectedinherited

◆ _elemlinks

Elem** libMesh::Elem::_elemlinks
protectedinherited

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

Definition at line 2093 of file elem.h.

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

◆ _elemlinks_data

Elem* libMesh::Tet::_elemlinks_data[5+(LIBMESH_DIM >3)]
protectedinherited

Data for links to parent/neighbor/interior_parent elements.

Definition at line 218 of file cell_tet.h.

◆ _embedding_matrix

const Real libMesh::Tet4::_embedding_matrix
staticprotected

Matrix that computes new nodal locations/solution values from current nodes/solution.

Definition at line 273 of file cell_tet4.h.

Referenced by embedding_matrix().

◆ _enable_print_counter [1/2]

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 143 of file reference_counter.h.

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

◆ _enable_print_counter [2/2]

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 143 of file reference_counter.h.

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

◆ _map_data

unsigned char libMesh::Elem::_map_data
protectedinherited

Mapping function data; currently used when needed to store the RATIONAL_BERNSTEIN nodal weight data index.

Definition at line 2145 of file elem.h.

Referenced by libMesh::Elem::Elem(), libMesh::Elem::mapping_data(), and libMesh::Elem::set_mapping_data().

◆ _map_type

unsigned char libMesh::Elem::_map_type
protectedinherited

Mapping function type; currently either 0 (LAGRANGE) or 1 (RATIONAL_BERNSTEIN).

Definition at line 2139 of file elem.h.

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

◆ _master_points

const Real libMesh::Tet::_master_points
staticprotectedinherited
Initial value:
=
{
{0, 0, 0},
{1, 0, 0},
{0, 1, 0},
{0, 0, 1},
{0.5, 0, 0},
{0.5, 0.5, 0},
{0, 0.5, 0},
{0, 0, 0.5},
{0.5, 0, 0.5},
{0, 0.5, 0.5},
{1/Real(3), 1/Real(3), 0},
{1/Real(3), 0, 1/Real(3)},
{1/Real(3), 1/Real(3), 1/Real(3)},
{0, 1/Real(3), 1/Real(3)}
}

Master element node locations.

Definition at line 223 of file cell_tet.h.

Referenced by libMesh::Tet::master_point().

◆ _mutex [1/2]

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

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 137 of file reference_counter.h.

◆ _mutex [2/2]

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

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 137 of file reference_counter.h.

◆ _n_objects [1/2]

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects.

Print the reference count information when the number returns to 0.

Definition at line 132 of file reference_counter.h.

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

◆ _n_objects [2/2]

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects.

Print the reference count information when the number returns to 0.

Definition at line 132 of file reference_counter.h.

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

◆ _nodelinks_data

Node* libMesh::Tet4::_nodelinks_data[num_nodes]
protected

Data for links to nodes.

Definition at line 256 of file cell_tet4.h.

◆ _nodes

Node** libMesh::Elem::_nodes
protectedinherited

◆ _p_level

unsigned char libMesh::Elem::_p_level
protectedinherited

p refinement level - the difference between the polynomial degree on this element and the minimum polynomial degree on the mesh.

This is stored as an unsigned char to save space. In theory, these last four bytes might have been padding anyway.

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

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

◆ _rflag

unsigned char libMesh::Elem::_rflag
protectedinherited

h refinement flag.

This is stored as an unsigned char to save space.

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

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

◆ affine_tol

constexpr Real libMesh::Elem::affine_tol = TOLERANCE*TOLERANCE
staticprotectedinherited

◆ edge_nodes_map

const unsigned int libMesh::Tet4::edge_nodes_map
static
Initial value:
=
{
{0, 1},
{1, 2},
{0, 2},
{0, 3},
{1, 3},
{2, 3}
}

This maps the \( j^{th} \) node of the \( i^{th} \) edge to element node numbers.

Definition at line 202 of file cell_tet4.h.

Referenced by is_node_on_edge(), libMesh::Tet::local_edge_node(), and nodes_on_edge().

◆ edge_sides_map

const unsigned int libMesh::Tet::edge_sides_map
staticinherited
Initial value:
=
{
{0, 1},
{0, 2},
{0, 3},
{1, 3},
{1, 2},
{2, 3}
}

This maps each edge to the sides that contain said edge.

Definition at line 211 of file cell_tet.h.

Referenced by libMesh::Tet::is_edge_on_side(), and libMesh::Tet::sides_on_edge().

◆ invalid_id

const dof_id_type libMesh::DofObject::invalid_id = static_cast<dof_id_type>(-1)
staticinherited

An invalid id to distinguish an uninitialized DofObject.

Definition at line 477 of file dof_object.h.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::Node::active(), libMesh::MeshBase::add_elem_datum(), libMesh::MeshBase::add_elem_integers(), libMesh::DofObject::add_extra_integers(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::TopologyMap::add_node(), libMesh::MeshRefinement::add_node(), libMesh::MeshBase::add_node_datum(), libMesh::MeshBase::add_node_integers(), libMesh::ReplicatedMesh::add_point(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::DofMap::assert_no_nodes_missed(), libMesh::Elem::bracketing_nodes(), ExtraIntegersTest::checkpoint_helper(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_nodes(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_sides(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::TopologyMap::find(), libMesh::DofMap::gather_constraints(), libMesh::MeshBase::get_elemset_code(), libMesh::ReplicatedMesh::insert_node(), libMesh::Poly2TriTriangulator::insert_refinement_points(), libMesh::Elem::interior_parent(), libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::invalidate_id(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::Node::Node(), libMesh::Elem::node_id(), libMesh::DofMap::old_dof_indices(), libMesh::DistributedMesh::own_node(), libMesh::XdrIO::pack_element(), libMesh::SFCPartitioner::partition_range(), libMesh::Elem::point(), libMesh::ExodusII_IO::read(), libMesh::System::read_legacy_data(), libMesh::DynaIO::read_mesh(), libMesh::System::read_parallel_data(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::DofMap::SCALAR_dof_indices(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Parallel::sync_node_data_by_element_id_once(), ExtraIntegersTest::test_and_set_initial_data(), DofObjectTest< Node >::testAddExtraData(), DofObjectTest< Node >::testAddSystemExtraInts(), NodalNeighborsTest::testEdge2(), NodalNeighborsTest::testEdge3(), NodalNeighborsTest::testEdge4(), ExtraIntegersTest::testExtraIntegersExodusReading(), InfFERadialTest::testRefinement(), DofObjectTest< Node >::testSetNSystemsExtraInts(), DofObjectTest< Node >::testSetNVariableGroupsExtraInts(), DofObjectTest< Node >::testValidId(), WriteElemsetData::testWriteImpl(), libMesh::Poly2TriTriangulator::triangulate_current_points(), libMesh::DofObject::valid_id(), libMesh::System::write_parallel_data(), and libMesh::XdrIO::write_serialized_connectivity().

◆ invalid_processor_id

const processor_id_type libMesh::DofObject::invalid_processor_id = static_cast<processor_id_type>(-1)
staticinherited

An invalid processor_id to distinguish DoFs that have not been assigned to a processor.

Definition at line 488 of file dof_object.h.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::DistributedMesh::add_node(), libMesh::MeshRefinement::add_node(), libMesh::MeshCommunication::allgather(), libMesh::Node::choose_processor_id(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubProjector::construct_projection(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshTools::create_bounding_box(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::Elem::Elem(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::MeshCommunication::find_global_indices(), libMesh::MeshBase::get_info(), libMesh::DistributedMesh::insert_elem(), libMesh::DofObject::invalidate_processor_id(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshBase::n_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), libMesh::MeshBase::n_unpartitioned_elem(), libMesh::MeshBase::n_unpartitioned_nodes(), libMesh::SparsityPattern::Build::operator()(), libMesh::Partitioner::processor_pairs_to_interface_nodes(), libMesh::Nemesis_IO_Helper::read_var_names_impl(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DistributedMesh::renumber_nodes_and_elements(), OverlappingFunctorTest::run_coupling_functor_test(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::send_and_insert_dof_values(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_dofobject_data_by_xyz(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id_once(), DofObjectTest< Node >::testValidProcId(), libMesh::MeshTools::total_weight(), libMesh::DofObject::valid_processor_id(), and libMesh::CheckpointIO::write().

◆ invalid_subdomain_id

const subdomain_id_type libMesh::Elem::invalid_subdomain_id = std::numeric_limits<subdomain_id_type>::max()
staticinherited

A static integral constant representing an invalid subdomain id.

See also DofObject::{invalid_id, invalid_unique_id, invalid_processor_id}.

Note
We don't use the static_cast(-1) trick here since subdomain_id_type is sometimes a signed integer for compatibility reasons (see libmesh/id_types.h).
Normally you can declare static const integral types directly in the header file (C++ standard, 9.4.2/4) but std::numeric_limits<T>::max() is not considered a "constant expression". This one is therefore defined in elem.C. http://stackoverflow.com/questions/2738435/using-numeric-limitsmax-in-constant-expressions

Definition at line 238 of file elem.h.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::BoundaryInfo::add_elements(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), libMesh::MeshBase::get_id_by_name(), main(), libMesh::BoundaryInfo::sync(), and MeshSubdomainIDTest::testMultiple().

◆ invalid_unique_id

const unique_id_type libMesh::DofObject::invalid_unique_id = static_cast<unique_id_type>(-1)
staticinherited

An invalid unique_id to distinguish an uninitialized DofObject.

Definition at line 482 of file dof_object.h.

Referenced by libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DofObject::unique_id(), and libMesh::DofObject::valid_unique_id().

◆ LIBMESH_ENABLE_TOPOLOGY_CACHES

libMesh::Tet4::LIBMESH_ENABLE_TOPOLOGY_CACHES
protected

Definition at line 275 of file cell_tet4.h.

◆ max_n_nodes

const unsigned int libMesh::Elem::max_n_nodes = 27
staticinherited

The maximum number of nodes any element can contain.

This is useful for replacing heap vectors with stack arrays.

Definition at line 621 of file elem.h.

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

◆ nodes_per_edge

const int libMesh::Tet4::nodes_per_edge = 2
static

Definition at line 190 of file cell_tet4.h.

Referenced by libMesh::Tet::local_edge_node().

◆ nodes_per_side

const int libMesh::Tet4::nodes_per_side = 3
static

Definition at line 189 of file cell_tet4.h.

Referenced by libMesh::Tet::local_side_node().

◆ num_children

const int libMesh::Tet4::num_children = 8
static

Definition at line 188 of file cell_tet4.h.

◆ num_edges

const int libMesh::Tet4::num_edges = 6
static

Definition at line 187 of file cell_tet4.h.

◆ num_nodes

const int libMesh::Tet4::num_nodes = 4
static

Geometric constants for Tet4.

Definition at line 185 of file cell_tet4.h.

Referenced by n_nodes().

◆ num_sides

const int libMesh::Tet4::num_sides = 4
static

Definition at line 186 of file cell_tet4.h.

◆ old_dof_object

std::unique_ptr<DofObject> libMesh::DofObject::old_dof_object
protectedinherited

This object on the last mesh.

Useful for projecting solutions from one mesh to another.

Public access to old_dof_object is now officially deprecated and will be removed in future libMesh versions. Use the get_old_dof_object() accessor instead.

Definition at line 88 of file dof_object.h.

Referenced by libMesh::DofObject::clear_old_dof_object(), libMesh::DofObject::get_old_dof_object(), libMesh::DofObject::get_old_dof_object_ref(), libMesh::DofObject::operator=(), libMesh::DofObject::pack_indexing(), libMesh::DofObject::packed_indexing_size(), libMesh::DofObject::set_old_dof_object(), and libMesh::DofObject::unpack_indexing().

◆ side_nodes_map

const unsigned int libMesh::Tet4::side_nodes_map
static
Initial value:
=
{
{0, 2, 1},
{0, 1, 3},
{1, 2, 3},
{2, 0, 3}
}

This maps the \( j^{th} \) node of the \( i^{th} \) side to element node numbers.

Definition at line 196 of file cell_tet4.h.

Referenced by libMesh::Tet::is_child_on_side_helper(), is_node_on_side(), libMesh::Tet::key(), libMesh::Tet::local_side_node(), libMesh::Tet::low_order_key(), nodes_on_side(), and libMesh::Tet::side_ptr().

◆ type_to_n_edges_map

const unsigned int libMesh::Elem::type_to_n_edges_map
staticinherited

This array maps the integer representation of the ElemType enum to the number of edges on the element.

Definition at line 695 of file elem.h.

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

◆ type_to_n_nodes_map

const unsigned int libMesh::Elem::type_to_n_nodes_map
staticinherited

◆ type_to_n_sides_map

const unsigned int libMesh::Elem::type_to_n_sides_map
staticinherited

This array maps the integer representation of the ElemType enum to the number of sides on the element.

Definition at line 641 of file elem.h.

Referenced by ElemTest< elem_type >::test_static_data(), MeshGenerationTest::testBuildCube(), and MeshGenerationTest::testBuildSquare().


The documentation for this class was generated from the following files: