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

QuadShell8 is almost identical to Quad8. More...

#include <face_quad8_shell.h>

Inheritance diagram for libMesh::QuadShell8:
[legend]

Public Types

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

Public Member Functions

 QuadShell8 (Elem *p=libmesh_nullptr)
 Constructor. More...
 
virtual ElemType type () const libmesh_override
 
virtual unsigned int n_nodes () const libmesh_override
 
virtual unsigned int n_sub_elem () const libmesh_override
 
virtual bool is_vertex (const unsigned int i) const libmesh_override
 
virtual bool is_edge (const unsigned int i) const libmesh_override
 
virtual bool is_face (const unsigned int i) const libmesh_override
 
virtual bool is_node_on_side (const unsigned int n, const unsigned int s) const libmesh_override
 
virtual bool is_node_on_edge (const unsigned int n, const unsigned int e) const libmesh_override
 
virtual bool has_affine_map () const libmesh_override
 
virtual Order default_order () const libmesh_override
 
virtual dof_id_type key (const unsigned int s) const libmesh_override
 
virtual dof_id_type key () const libmesh_override
 
virtual unsigned int which_node_am_i (unsigned int side, unsigned int side_node) const libmesh_override
 
virtual UniquePtr< Elembuild_side_ptr (const unsigned int i, bool proxy) libmesh_override
 
UniquePtr< const Elembuild_side_ptr (const unsigned int i, bool proxy=true) const
 
virtual void connectivity (const unsigned int sf, const IOPackage iop, std::vector< dof_id_type > &conn) const libmesh_override
 
virtual unsigned int n_second_order_adjacent_vertices (const unsigned int) const libmesh_override
 
virtual unsigned short int second_order_adjacent_vertex (const unsigned int n, const unsigned int v) const libmesh_override
 
virtual std::pair< unsigned short int, unsigned short intsecond_order_child_vertex (const unsigned int n) const libmesh_override
 
virtual Real volume () const libmesh_override
 An optimized method for approximating the area of a QUAD8 using quadrature. More...
 
virtual BoundingBox loose_bounding_box () const libmesh_override
 
virtual Point master_point (const unsigned int i) const libmesh_override
 
virtual unsigned int n_sides () const libmesh_override
 
virtual unsigned int n_vertices () const libmesh_override
 
virtual unsigned int n_edges () const libmesh_override
 
virtual unsigned int n_children () const libmesh_override
 
virtual bool is_child_on_side (const unsigned int c, const unsigned int s) const libmesh_override
 
virtual unsigned int opposite_side (const unsigned int s) const libmesh_override
 
virtual unsigned int opposite_node (const unsigned int n, const unsigned int s) const libmesh_override
 
virtual UniquePtr< Elemside_ptr (const unsigned int i) libmesh_override
 
UniquePtr< const Elemside_ptr (unsigned int i) const
 
virtual Real quality (const ElemQuality q) const libmesh_override
 
virtual std::pair< Real, Realqual_bounds (const ElemQuality q) const libmesh_override
 
virtual unsigned int dim () const libmesh_override
 
virtual unsigned int n_faces () const libmesh_override
 
virtual UniquePtr< Elembuild_edge_ptr (const unsigned int i) libmesh_override
 build_side and build_edge are identical for faces. More...
 
UniquePtr< const Elembuild_edge_ptr (const unsigned int i) const
 
virtual bool is_edge_on_side (const unsigned int e, const unsigned int s) const libmesh_override
 is_edge_on_side is trivial in 2D. More...
 
virtual bool infinite () const libmesh_override
 
const Pointpoint (const unsigned int i) const
 
Pointpoint (const unsigned int i)
 
dof_id_type node_id (const unsigned int i) const
 
dof_id_type node (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)
 
Nodeget_node (const unsigned int i) const
 
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
 
const Elemneighbor_ptr (unsigned int i) const
 
Elemneighbor_ptr (unsigned int i)
 
Elemneighbor (const unsigned int i) const
 
SimpleRange< NeighborPtrIterneighbor_ptr_range ()
 Returns a range with all neighbors of an element, usable in range-based for loops. More...
 
SimpleRange< ConstNeighborPtrIterneighbor_ptr_range () const
 
const Elemtopological_neighbor (const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
 
Elemtopological_neighbor (const unsigned int i, MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb)
 
bool has_topological_neighbor (const Elem *elem, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
 
void set_neighbor (const unsigned int i, Elem *n)
 Assigns n as the $ i^{th} $ neighbor. More...
 
bool has_neighbor (const Elem *elem) const
 
Elemchild_neighbor (Elem *elem)
 
const Elemchild_neighbor (const Elem *elem) const
 
bool on_boundary () const
 
bool is_semilocal (const processor_id_type my_pid) const
 
unsigned int which_neighbor_am_i (const Elem *e) const
 This function tells you which neighbor e is. More...
 
unsigned int which_side_am_i (const Elem *e) const
 This function tells you which side the boundary element e is. More...
 
bool contains_vertex_of (const Elem *e) const
 
bool contains_edge_of (const Elem *e) const
 
void find_point_neighbors (const Point &p, std::set< const Elem * > &neighbor_set) const
 This function finds all active elements (including this one) which are in the same manifold as this element and which touch the current active element at the specified point, which should be a point in the current element. More...
 
void find_point_neighbors (std::set< const Elem * > &neighbor_set) const
 This function finds all active elements (including this one) in the same manifold as this element which touch this active element at any point. More...
 
void find_point_neighbors (std::set< const Elem * > &neighbor_set, const Elem *start_elem) const
 This function finds all active elements (including this one) in the same manifold as start_elem (which must be active and must touch this element) which touch this element at any point. More...
 
void find_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 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)
 Resets the appropriate neighbor 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 unsigned int is_vertex_on_child (unsigned int, unsigned int n) const
 
virtual bool is_vertex_on_parent (unsigned int c, unsigned int n) const
 
UniquePtr< Elemside (const unsigned int i) const
 
UniquePtr< Elembuild_side (const unsigned int i, bool proxy=true) const
 
UniquePtr< Elembuild_edge (const unsigned int i) const
 Creates an element coincident with edge i. More...
 
virtual Point centroid () const
 
virtual Real hmin () const
 
virtual Real hmax () const
 
virtual bool contains_point (const Point &p, Real tol=TOLERANCE) const
 
virtual bool close_to_point (const Point &p, Real tol) const
 
virtual bool is_linear () const
 
void print_info (std::ostream &os=libMesh::out) const
 Prints relevant information about the element. More...
 
std::string get_info () const
 Prints relevant information about the element to a string. More...
 
bool active () const
 
bool ancestor () const
 
bool subactive () const
 
bool has_children () const
 
bool has_ancestor_children () const
 
bool is_ancestor_of (const Elem *descendant) const
 
const Elemparent () const
 
Elemparent ()
 
void set_parent (Elem *p)
 Sets the pointer to the element's parent. More...
 
const Elemtop_parent () const
 
const Eleminterior_parent () const
 
Eleminterior_parent ()
 
void set_interior_parent (Elem *p)
 Sets the pointer to the element's interior_parent. More...
 
Real length (const unsigned int n1, const unsigned int n2) const
 
unsigned int level () const
 
unsigned int p_level () const
 
const Elemraw_child_ptr (unsigned int i) const
 
const Elemchild_ptr (unsigned int i) const
 
Elemchild_ptr (unsigned int i)
 
Elemchild (const unsigned int i) const
 
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, const bool reset=true) const
 Fills the vector family with the children of this element, recursively. More...
 
void total_family_tree (std::vector< const Elem * > &active_family, const bool reset=true) const
 Same as the family_tree() member, but also adds any subactive descendants. More...
 
void active_family_tree (std::vector< const Elem * > &active_family, const bool reset=true) const
 Same as the family_tree() member, but only adds the active children. More...
 
void family_tree_by_side (std::vector< const Elem * > &family, const unsigned int side, const bool reset=true) const
 Same as the family_tree() member, but only adds elements which are next to side. More...
 
void active_family_tree_by_side (std::vector< const Elem * > &family, const unsigned int side, const bool reset=true) const
 Same as the active_family_tree() member, but only adds elements which are next to side. More...
 
void family_tree_by_neighbor (std::vector< const Elem * > &family, const Elem *neighbor, const bool reset=true) const
 Same as the family_tree() member, but only adds elements which are next to neighbor. More...
 
void total_family_tree_by_neighbor (std::vector< const Elem * > &family, const Elem *neighbor, const bool reset=true) const
 Same as the family_tree_by_neighbor() member, but also adds any subactive descendants. More...
 
void family_tree_by_subneighbor (std::vector< const Elem * > &family, const Elem *neighbor, const Elem *subneighbor, const bool reset=true) const
 Same as the family_tree() member, but only adds elements which are next to subneighbor. More...
 
void total_family_tree_by_subneighbor (std::vector< const Elem * > &family, const Elem *neighbor, const Elem *subneighbor, const bool reset=true) const
 Same as the family_tree_by_subneighbor() member, but also adds any subactive descendants. More...
 
void active_family_tree_by_neighbor (std::vector< const Elem * > &family, const Elem *neighbor, const 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_topological_neighbor (std::vector< const Elem * > &family, const Elem *neighbor, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb, const bool reset=true) const
 Same as the active_family_tree_by_neighbor() member, but the neighbor here may be a topological (e.g. More...
 
RefinementState refinement_flag () const
 
void set_refinement_flag (const RefinementState rflag)
 Sets the value of the refinement flag for the element. More...
 
RefinementState p_refinement_flag () const
 
void set_p_refinement_flag (const RefinementState pflag)
 Sets the value of the p-refinement flag for the element. More...
 
unsigned int max_descendant_p_level () const
 
unsigned int min_p_level_by_neighbor (const Elem *neighbor, unsigned int current_min) const
 
unsigned int min_new_p_level_by_neighbor (const Elem *neighbor, unsigned int current_min) const
 
void set_p_level (const unsigned int p)
 Sets the value of the p-refinement level for the element. More...
 
void hack_p_level (const unsigned int p)
 Sets the value of the p-refinement level for the element without altering the p-level of its ancestors. More...
 
virtual void refine (MeshRefinement &mesh_refinement)
 Refine the element. More...
 
void coarsen ()
 Coarsen the element. More...
 
void contract ()
 Contract an active element, i.e. More...
 
void libmesh_assert_valid_neighbors () const
 Checks for consistent neighbor links on this element. More...
 
void libmesh_assert_valid_node_pointers () const
 Checks for a valid id and pointers to nodes with valid ids on this element. More...
 
side_iterator boundary_sides_begin ()
 Iterator accessor functions. More...
 
side_iterator boundary_sides_end ()
 
virtual bool is_mid_infinite_edge_node (const unsigned int) const
 
virtual Point origin () const
 
virtual unsigned int as_parent_node (unsigned int c, unsigned int n) const
 
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes (unsigned int c, unsigned int n) const
 
virtual const std::vector< std::pair< dof_id_type, dof_id_type > > bracketing_nodes (unsigned int c, unsigned int n) const
 
virtual unsigned int embedding_matrix_version () const
 
void nullify_neighbors ()
 Replaces this element with NULL for all of its neighbors. More...
 
void clear_old_dof_object ()
 Sets the old_dof_object to libmesh_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 and return to a pristine state. More...
 
void invalidate_dofs (const unsigned int sys_num=libMesh::invalid_uint)
 Sets all degree of freedom numbers to invalid_id. More...
 
void invalidate_id ()
 Sets the id to invalid_id. More...
 
void invalidate_processor_id ()
 Sets the processor id to invalid_processor_id. More...
 
void invalidate ()
 Invalidates all the indices for this DofObject. More...
 
unsigned int n_dofs (const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
 
dof_id_type id () const
 
dof_id_typeset_id ()
 
void set_id (const dof_id_type dofid)
 Sets the id for this DofObject. More...
 
unique_id_type unique_id () const
 
unique_id_typeset_unique_id ()
 
bool valid_id () const
 
bool valid_unique_id () const
 
processor_id_type processor_id () const
 
processor_id_typeprocessor_id ()
 
void processor_id (const processor_id_type pid)
 Sets the processor_id for this DofObject. More...
 
bool valid_processor_id () const
 
unsigned int n_systems () const
 
void set_n_systems (const unsigned int s)
 Sets the number of systems for this DofObject. 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
 
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...
 
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 void print_info (std::ostream &out=libMesh::out)
 Prints the reference information, by default to libMesh::out. More...
 
static void print_info (std::ostream &out=libMesh::out)
 Prints the reference information, by default to libMesh::out. More...
 
static std::string get_info ()
 Gets a string containing the reference information. More...
 
static std::string get_info ()
 Gets a string containing the reference information. More...
 
static ElemType second_order_equivalent_type (const ElemType et, const bool full_ordered=true)
 
static ElemType first_order_equivalent_type (const ElemType et)
 
static UniquePtr< Elembuild (const ElemType type, Elem *p=libmesh_nullptr)
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. More...
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. More...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() More...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() More...
 
static void disable_print_counter_info ()
 
static void disable_print_counter_info ()
 
static unsigned int unpackable_indexing_size (std::vector< largest_id_type >::const_iterator begin)
 If we have indices packed into an buffer for communications, how much of that buffer applies to this dof object? More...
 

Public Attributes

DofObjectold_dof_object
 This object on the last mesh. More...
 

Static Public Attributes

static const unsigned int side_nodes_map [4][3]
 This maps the $ j^{th} $ node of the $ i^{th} $ side to element node numbers. 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 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 float embedding_matrix (const unsigned int i, const unsigned int j, const unsigned int k) const libmesh_override
 Matrix used to create the elements children. More...
 
virtual std::vector< std::vector< std::vector< std::vector< std::pair< unsigned char, unsigned char > > > > > & _get_bracketing_node_cache () const
 Elem subclasses which don't do their own bracketing node calculations will need to supply a static cache, since the default calculation is slow. More...
 
virtual std::vector< std::vector< std::vector< signed char > > > & _get_parent_indices_cache () const
 Elem subclasses which don't do their own child-to-parent node calculations will need to supply a static cache, since the default calculation is slow. More...
 
void increment_constructor_count (const std::string &name)
 Increments the construction counter. More...
 
void increment_constructor_count (const std::string &name)
 Increments the construction counter. More...
 
void increment_destructor_count (const std::string &name)
 Increments the destruction counter. More...
 
void increment_destructor_count (const std::string &name)
 Increments the destruction counter. More...
 

Static Protected Member Functions

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

Protected Attributes

Node_nodelinks_data [8]
 Data for links to nodes. More...
 
 LIBMESH_ENABLE_TOPOLOGY_CACHES
 
Elem_elemlinks_data [5+(LIBMESH_DIM >2)]
 Data for links to parent/neighbor/interior_parent elements. More...
 
Node ** _nodes
 Pointers to the nodes we are connected to. More...
 
Elem ** _elemlinks
 Pointers to this element's parent and neighbors, and for lower-dimensional elements' interior_parent. More...
 
Elem ** _children
 Pointers to this element's children. More...
 
subdomain_id_type _sbd_id
 The subdomain to which this element belongs. More...
 
unsigned char _rflag
 h refinement flag. More...
 
unsigned char _pflag
 p refinement flag. More...
 
unsigned char _p_level
 p refinement level - the difference between the polynomial degree on this element and the minimum polynomial degree on the mesh. More...
 

Static Protected Attributes

static const float _embedding_matrix [4][8][8]
 Matrix that computes new nodal locations/solution values from current nodes/solution. More...
 
static const unsigned short int _second_order_adjacent_vertices [4][2]
 Matrix that tells which vertices define the location of mid-side (or second-order) nodes. More...
 
static const unsigned short int _second_order_vertex_child_number [9]
 Vector that names a child sharing each second order node. More...
 
static const unsigned short int _second_order_vertex_child_index [9]
 Vector that names the child vertex index for each second order node. More...
 
static const Real _master_points [9][3]
 Master element node locations. More...
 
static const int _child_node_lookup [4][9]
 Lookup table from child id, child node id to "possible node location" (a simple dictionary-index in a 5x5 grid) 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

QuadShell8 is almost identical to Quad8.

The only difference is with the type of boundary data we store for this case. We need this "stub" class in order to differentiate between this class and other classes when reading/writing Mesh files.

Author
Sylvain Vallaghe
Date
2017 A 2D quadrilateral shell element with 8 nodes.

Definition at line 36 of file face_quad8_shell.h.

Member Typedef Documentation

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

Definition at line 299 of file elem.h.

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.

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.

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

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

Definition at line 298 of file elem.h.

Useful iterator typedefs.

Definition at line 1426 of file elem.h.

Member Enumeration Documentation

Enumeration of possible element refinement states.

Enumerator
COARSEN 
DO_NOTHING 
REFINE 
JUST_REFINED 
JUST_COARSENED 
INACTIVE 
COARSEN_INACTIVE 
INVALID_REFINEMENTSTATE 

Definition at line 1125 of file elem.h.

Constructor & Destructor Documentation

libMesh::QuadShell8::QuadShell8 ( Elem p = libmesh_nullptr)
explicit

Constructor.

By default this element has no parent.

Definition at line 43 of file face_quad8_shell.h.

43  :
44  Quad8(p) {}
Quad8(Elem *p=libmesh_nullptr)
Constructor.
Definition: face_quad8.h:57

Member Function Documentation

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

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

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

1580  {
1581  static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> c;
1582  libmesh_error();
1583  return c;
1584  }
virtual std::vector<std::vector<std::vector<signed char> > >& libMesh::Elem::_get_parent_indices_cache ( ) const
protectedvirtualinherited

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

References libMesh::Elem::nullify_neighbors().

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

1594  {
1595  static std::vector<std::vector<std::vector<signed char>>> c;
1596  libmesh_error();
1597  return c;
1598  }
bool libMesh::Elem::active ( ) const
inherited
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 2257 of file elem.h.

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

Referenced by libMesh::MeshRefinement::_coarsen_elements(), libMesh::DofMap::_dof_indices(), libMesh::MeshRefinement::_refine_elements(), libMesh::Elem::active_family_tree(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::active_family_tree_by_side(), libMesh::Elem::active_family_tree_by_topological_neighbor(), libMesh::HPCoarsenTest::add_projection(), libMesh::Elem::ancestor(), assemble_ellipticdg(), libMesh::Patch::build_around_element(), libMesh::ParmetisPartitioner::build_graph(), libMesh::Elem::coarsen(), libMesh::MeshRefinement::coarsen_elements(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), libMesh::connect_families(), libMesh::UnstructuredMesh::contract(), libMesh::Elem::contract(), libMesh::DofMap::dof_indices(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::Elem::family_tree(), libMesh::Elem::family_tree_by_neighbor(), libMesh::Elem::family_tree_by_side(), libMesh::Elem::family_tree_by_subneighbor(), libMesh::Elem::find_interior_neighbors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::Elem::get_info(), libMesh::ErrorVector::is_active_elem(), libMesh::Elem::is_linear(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshTools::libmesh_assert_valid_remote_elems(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_local(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::DofMap::old_dof_indices(), libMesh::PointLocatorTree::operator()(), libMesh::MetisPartitioner::partition_range(), libMesh::Elem::refine(), libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::MeshRefinement::refine_elements(), libMesh::Elem::subactive(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::MeshRefinement::test_level_one(), EquationSystemsTest::testRefineThenReinitPreserveFlags(), and libMesh::Parallel::Packing< Elem * >::unpack().

2258 {
2259 #ifdef LIBMESH_ENABLE_AMR
2260  if ((this->refinement_flag() == INACTIVE) ||
2261  (this->refinement_flag() == COARSEN_INACTIVE))
2262  return false;
2263  else
2264  return true;
2265 #else
2266  return true;
2267 #endif
2268 }
RefinementState refinement_flag() const
Definition: elem.h:2505
void libMesh::Elem::active_family_tree ( std::vector< const Elem * > &  active_family,
const 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 1724 of file elem.C.

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

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

1726 {
1727  // The "family tree" doesn't include subactive elements
1728  libmesh_assert(!this->subactive());
1729 
1730  // Clear the vector if the flag reset tells us to.
1731  if (reset)
1732  active_family.clear();
1733 
1734  // Add this element to the family tree if it is active
1735  if (this->active())
1736  active_family.push_back(this);
1737 
1738  // Otherwise recurse into the element's children.
1739  // Do not clear the vector any more.
1740  else
1741  for (auto & c : this->child_ref_range())
1742  if (!c.is_remote())
1743  c.active_family_tree (active_family, false);
1744 }
bool subactive() const
Definition: elem.h:2275
bool active() const
Definition: elem.h:2257
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:1699
libmesh_assert(j)
void libMesh::Elem::active_family_tree_by_neighbor ( std::vector< const Elem * > &  family,
const Elem neighbor,
const bool  reset = true 
) const
inherited

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

Definition at line 1984 of file elem.C.

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

Referenced by libMesh::Elem::find_edge_neighbors(), libMesh::Patch::find_face_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::GhostPointNeighbors::operator()(), and libMesh::DefaultCoupling::operator()().

1987 {
1988  // The "family tree" doesn't include subactive elements or
1989  // remote_elements
1990  libmesh_assert(!this->subactive());
1991  libmesh_assert(this != remote_elem);
1992 
1993  // Clear the vector if the flag reset tells us to.
1994  if (reset)
1995  family.clear();
1996 
1997  // This only makes sense if we're already a neighbor
1998 #ifndef NDEBUG
1999  if (this->level() >= neighbor_in->level())
2000  libmesh_assert (this->has_neighbor(neighbor_in));
2001 #endif
2002 
2003  // Add an active element to the family tree.
2004  if (this->active())
2005  family.push_back(this);
2006 
2007  // Or recurse into an ancestor element's children.
2008  // Do not clear the vector any more.
2009  else if (!this->active())
2010  for (auto & c : this->child_ref_range())
2011  if (&c != remote_elem && c.has_neighbor(neighbor_in))
2012  c.active_family_tree_by_neighbor (family, neighbor_in, false);
2013 }
bool subactive() const
Definition: elem.h:2275
bool active() const
Definition: elem.h:2257
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:1699
libmesh_assert(j)
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2010
unsigned int level() const
Definition: elem.h:2388
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::Elem::active_family_tree_by_side ( std::vector< const Elem * > &  family,
const unsigned int  side,
const bool  reset = true 
) const
inherited

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

Definition at line 1777 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree_by_side(), libMesh::Elem::child_ptr(), libMesh::Elem::is_child_on_side(), libMesh::Elem::is_remote(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::Elem::n_sides(), libMesh::remote_elem, and libMesh::Elem::subactive().

Referenced by libMesh::Elem::active_family_tree_by_side(), libMesh::Nemesis_IO_Helper::write_sidesets(), and libMesh::ExodusII_IO_Helper::write_sidesets().

1780 {
1781  // The "family tree" doesn't include subactive or remote elements
1782  libmesh_assert(!this->subactive());
1783  libmesh_assert(this != remote_elem);
1784 
1785  // Clear the vector if the flag reset tells us to.
1786  if (reset)
1787  family.clear();
1788 
1789  libmesh_assert_less (s, this->n_sides());
1790 
1791  // Add an active element to the family tree.
1792  if (this->active())
1793  family.push_back(this);
1794 
1795  // Or recurse into an ancestor element's children.
1796  // Do not clear the vector any more.
1797  else
1798  {
1799  const unsigned int nc = this->n_children();
1800  for (unsigned int c = 0; c != nc; c++)
1801  if (!this->child_ptr(c)->is_remote() && this->is_child_on_side(c, s))
1802  this->child_ptr(c)->active_family_tree_by_side (family, s, false);
1803  }
1804 }
bool subactive() const
Definition: elem.h:2275
bool active() const
Definition: elem.h:2257
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const =0
libmesh_assert(j)
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2445
virtual unsigned int n_sides() const =0
virtual bool is_remote() const
Definition: elem.h:530
virtual unsigned int n_children() const =0
void active_family_tree_by_side(std::vector< const Elem * > &family, const unsigned int side, const bool reset=true) const
Same as the active_family_tree() member, but only adds elements which are next to side...
Definition: elem.C:1777
const RemoteElem * remote_elem
Definition: remote_elem.C:57
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,
const 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 1942 of file elem.C.

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

Referenced by libMesh::DefaultCoupling::operator()(), and libMesh::Elem::total_family_tree_by_subneighbor().

1948 {
1949  // The "family tree" doesn't include subactive elements or
1950  // remote_elements
1951  libmesh_assert(!this->subactive());
1952  libmesh_assert(this != remote_elem);
1953 
1954  // Clear the vector if the flag reset tells us to.
1955  if (reset)
1956  family.clear();
1957 
1958  // This only makes sense if we're already a topological neighbor
1959 #ifndef NDEBUG
1960  if (this->level() >= neighbor_in->level())
1961  libmesh_assert (this->has_topological_neighbor(neighbor_in,
1962  mesh,
1963  point_locator,
1964  pb));
1965 #endif
1966 
1967  // Add an active element to the family tree.
1968  if (this->active())
1969  family.push_back(this);
1970 
1971  // Or recurse into an ancestor element's children.
1972  // Do not clear the vector any more.
1973  else if (!this->active())
1974  for (auto & c : this->child_ref_range())
1975  if (&c != remote_elem &&
1976  c.has_topological_neighbor(neighbor_in, mesh, point_locator,
1977  pb))
1978  c.active_family_tree_by_topological_neighbor
1979  (family, neighbor_in, mesh, point_locator, pb, false);
1980 }
bool subactive() const
Definition: elem.h:2275
bool active() const
Definition: elem.h:2257
bool has_topological_neighbor(const Elem *elem, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
Definition: elem.C:1104
MeshBase & mesh
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:1699
libmesh_assert(j)
unsigned int level() const
Definition: elem.h:2388
const RemoteElem * remote_elem
Definition: remote_elem.C:57
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 1608 of file elem.C.

References libMesh::Elem::_children, libmesh_nullptr, 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_remote_elem(), libMesh::XdrIO::read_serialized_connectivity(), and libMesh::Parallel::Packing< Elem * >::unpack().

1609 {
1610  const unsigned int nc = this->n_children();
1611 
1612  if (_children == libmesh_nullptr)
1613  {
1614  _children = new Elem *[nc];
1615 
1616  for (unsigned int c = 0; c != nc; c++)
1617  this->set_child(c, libmesh_nullptr);
1618  }
1619 
1620  for (unsigned int c = 0; c != nc; c++)
1621  {
1622  if (this->_children[c] == libmesh_nullptr || this->_children[c] == remote_elem)
1623  {
1624  libmesh_assert_equal_to (this, elem->parent());
1625  this->set_child(c, elem);
1626  return;
1627  }
1628  }
1629 
1630  libmesh_error_msg("Error: Tried to add a child to an element with full children array");
1631 }
const class libmesh_nullptr_t libmesh_nullptr
Elem ** _children
Pointers to this element&#39;s children.
Definition: elem.h:1627
virtual unsigned int n_children() const =0
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
void set_child(unsigned int c, Elem *elem)
Sets the pointer to the child for this element.
Definition: elem.h:2477
const RemoteElem * remote_elem
Definition: remote_elem.C:57
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 1635 of file elem.C.

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

1636 {
1637  if (!this->has_children())
1638  {
1639  const unsigned int nc = this->n_children();
1640  _children = new Elem *[nc];
1641 
1642  for (unsigned int i = 0; i != nc; i++)
1643  this->set_child(i, libmesh_nullptr);
1644  }
1645 
1646  libmesh_assert (this->_children[c] == libmesh_nullptr || this->child_ptr(c) == remote_elem);
1647  libmesh_assert (elem == remote_elem || this == elem->parent());
1648 
1649  this->set_child(c, elem);
1650 }
bool has_children() const
Definition: elem.h:2295
const Elem * parent() const
Definition: elem.h:2346
const class libmesh_nullptr_t libmesh_nullptr
libmesh_assert(j)
Elem ** _children
Pointers to this element&#39;s children.
Definition: elem.h:1627
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2445
virtual unsigned int n_children() const =0
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
void set_child(unsigned int c, Elem *elem)
Sets the pointer to the child for this element.
Definition: elem.h:2477
const RemoteElem * remote_elem
Definition: remote_elem.C:57
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::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), and libMesh::DofObject::set_n_systems().

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

196 {
197  // quick return?
198  if (this->n_systems() == 0)
199  {
200  this->set_n_systems(1);
201  return;
202  }
203 
204  DofObject::index_buffer_t::iterator it = _idx_buf.begin();
205 
206  std::advance(it, this->n_systems());
207 
208  // this inserts the current vector size at the position for the new system - creating the
209  // entry we need for the new system indicating there are 0 variables.
210  _idx_buf.insert(it, cast_int<dof_id_type>(_idx_buf.size()));
211 
212  // cache this value before we screw it up!
213  const unsigned int ns_orig = this->n_systems();
214 
215  // increment the number of systems and the offsets for each of
216  // the systems including the new one we just added.
217  for (unsigned int i=0; i<ns_orig+1; i++)
218  _idx_buf[i]++;
219 
220  libmesh_assert_equal_to (this->n_systems(), (ns_orig+1));
221  libmesh_assert_equal_to (this->n_vars(ns_orig), 0);
222  libmesh_assert_equal_to (this->n_var_groups(ns_orig), 0);
223 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:735
void set_n_systems(const unsigned int s)
Sets the number of systems for this DofObject.
Definition: dof_object.C:165
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_systems() const
Definition: dof_object.h:726
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 1574 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::contract(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), libMesh::Elem::is_linear(), libMesh::MeshRefinement::make_coarsening_compatible(), and libMesh::Elem::refine().

1575 {
1576 #ifdef LIBMESH_ENABLE_AMR
1577 
1578  // Use a fast, DistributedMesh-safe definition
1579  const bool is_ancestor =
1580  !this->active() && !this->subactive();
1581 
1582  // But check for inconsistencies if we have time
1583 #ifdef DEBUG
1584  if (!is_ancestor && this->has_children())
1585  {
1586  for (auto & c : this->child_ref_range())
1587  {
1588  if (&c != remote_elem)
1589  {
1590  libmesh_assert(!c.active());
1591  libmesh_assert(!c.ancestor());
1592  }
1593  }
1594  }
1595 #endif // DEBUG
1596 
1597  return is_ancestor;
1598 
1599 #else
1600  return false;
1601 #endif
1602 }
bool has_children() const
Definition: elem.h:2295
bool subactive() const
Definition: elem.h:2275
bool active() const
Definition: elem.h:2257
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:1699
libmesh_assert(j)
const RemoteElem * remote_elem
Definition: remote_elem.C:57
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 2080 of file elem.C.

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

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

2082 {
2083  const unsigned int nc = this->n_children();
2084  libmesh_assert_less(child, nc);
2085 
2086  // Cached return values, indexed first by embedding_matrix version,
2087  // then by child number, then by child node number.
2088  std::vector<std::vector<std::vector<signed char>>> &
2089  cached_parent_indices = this->_get_parent_indices_cache();
2090 
2091  unsigned int em_vers = this->embedding_matrix_version();
2092 
2093  // We may be updating the cache on one thread, and while that
2094  // happens we can't safely access the cache from other threads.
2095  Threads::spin_mutex::scoped_lock lock(parent_indices_mutex);
2096 
2097  if (em_vers >= cached_parent_indices.size())
2098  cached_parent_indices.resize(em_vers+1);
2099 
2100  if (child >= cached_parent_indices[em_vers].size())
2101  {
2102  const unsigned int nn = this->n_nodes();
2103 
2104  cached_parent_indices[em_vers].resize(nc);
2105 
2106  for (unsigned int c = 0; c != nc; ++c)
2107  {
2108  const unsigned int ncn = this->n_nodes_in_child(c);
2109  cached_parent_indices[em_vers][c].resize(ncn);
2110  for (unsigned int cn = 0; cn != ncn; ++cn)
2111  {
2112  for (unsigned int n = 0; n != nn; ++n)
2113  {
2114  const float em_val = this->embedding_matrix
2115  (c, cn, n);
2116  if (em_val == 1)
2117  {
2118  cached_parent_indices[em_vers][c][cn] = n;
2119  break;
2120  }
2121 
2122  if (em_val != 0)
2123  {
2124  cached_parent_indices[em_vers][c][cn] =
2125  -1;
2126  break;
2127  }
2128 
2129  // We should never see an all-zero embedding matrix
2130  // row
2131  libmesh_assert_not_equal_to (n+1, nn);
2132  }
2133  }
2134  }
2135  }
2136 
2137  const signed char cache_val =
2138  cached_parent_indices[em_vers][child][child_node];
2139  if (cache_val == -1)
2140  return libMesh::invalid_uint;
2141 
2142  return cached_parent_indices[em_vers][child][child_node];
2143 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
Definition: libmesh.h:184
Threads::spin_mutex parent_indices_mutex
Definition: elem.C:80
Elem * child(const unsigned int i) const
Definition: elem.h:2465
virtual unsigned int n_nodes() const =0
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:582
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:1593
virtual unsigned int n_children() const =0
virtual unsigned int embedding_matrix_version() const
Definition: elem.h:1536
virtual float embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
Elem::side_iterator libMesh::Elem::boundary_sides_begin ( )
inherited

Iterator accessor functions.

Definition at line 2948 of file elem.C.

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

2949 {
2950  Predicates::BoundarySide<SideIter> bsp;
2951  return side_iterator(this->_first_side(), this->_last_side(), bsp);
2952 }
SideIter _last_side()
Definition: elem.h:2830
SideIter _first_side()
Side iterator helper functions.
Definition: elem.h:2822
Elem::side_iterator libMesh::Elem::boundary_sides_end ( )
inherited

Definition at line 2957 of file elem.C.

References libMesh::Elem::_last_side().

2958 {
2959  Predicates::BoundarySide<SideIter> bsp;
2960  return side_iterator(this->_last_side(), this->_last_side(), bsp);
2961 }
SideIter _last_side()
Definition: elem.h:2830
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 2353 of file elem.C.

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

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

2355 {
2356  std::vector<std::pair<dof_id_type, dof_id_type>> returnval;
2357 
2358  const std::vector<std::pair<unsigned char, unsigned char>> & pbc =
2359  this->parent_bracketing_nodes(child,child_node);
2360 
2361  for (std::size_t i = 0; i != pbc.size(); ++i)
2362  {
2363  const unsigned short n_n = this->n_nodes();
2364  if (pbc[i].first < n_n && pbc[i].second < n_n)
2365  returnval.push_back(std::make_pair(this->node_id(pbc[i].first),
2366  this->node_id(pbc[i].second)));
2367  else
2368  {
2369  // We must be on a non-full-order higher order element...
2370  libmesh_assert_not_equal_to(this->default_order(), FIRST);
2371  libmesh_assert_not_equal_to
2372  (second_order_equivalent_type (this->type(), true),
2373  this->type());
2374  libmesh_assert_equal_to
2375  (second_order_equivalent_type (this->type(), false),
2376  this->type());
2377 
2378  // And that's a shame, because this is a nasty search:
2379 
2380  // Build the full-order type
2381  ElemType full_type =
2382  second_order_equivalent_type(this->type(), /*full_ordered=*/ true);
2383  UniquePtr<Elem> full_elem = Elem::build(full_type);
2384 
2387 
2388  // Find the bracketing nodes by figuring out what
2389  // already-created children will have them.
2390 
2391  // This only doesn't break horribly because we add children
2392  // and nodes in straightforward + hierarchical orders...
2393  for (unsigned int c=0; c <= child; ++c)
2394  for (unsigned int n=0; n != this->n_nodes_in_child(c); ++n)
2395  {
2396  if (c == child && n == child_node)
2397  break;
2398 
2399  if (pbc[i].first == full_elem->as_parent_node(c,n))
2400  {
2401  // We should be consistent
2402  if (pt1 != DofObject::invalid_id)
2403  libmesh_assert_equal_to(pt1, this->child_ptr(c)->node_id(n));
2404 
2405  pt1 = this->child_ptr(c)->node_id(n);
2406  }
2407 
2408  if (pbc[i].second == full_elem->as_parent_node(c,n))
2409  {
2410  // We should be consistent
2411  if (pt2 != DofObject::invalid_id)
2412  libmesh_assert_equal_to(pt2, this->child_ptr(c)->node_id(n));
2413 
2414  pt2 = this->child_ptr(c)->node_id(n);
2415  }
2416  }
2417 
2418  // We should *usually* find all bracketing nodes by the time
2419  // we query them (again, because of the child & node add
2420  // order)
2421  //
2422  // The exception is if we're a HEX20, in which case we will
2423  // find pairs of vertex nodes and edge nodes bracketing the
2424  // new central node but we *won't* find the pairs of face
2425  // nodes which we would have had on a HEX27. In that case
2426  // we'll still have enough bracketing nodes for a
2427  // topological lookup, but we won't be able to make the
2428  // following assertions.
2429  if (this->type() != HEX20)
2430  {
2431  libmesh_assert_not_equal_to (pt1, DofObject::invalid_id);
2432  libmesh_assert_not_equal_to (pt2, DofObject::invalid_id);
2433  }
2434 
2435  if (pt1 != DofObject::invalid_id &&
2436  pt2 != DofObject::invalid_id)
2437  returnval.push_back(std::make_pair(pt1, pt2));
2438  }
2439  }
2440 
2441  return returnval;
2442 }
static UniquePtr< Elem > build(const ElemType type, Elem *p=libmesh_nullptr)
Definition: elem.C:238
virtual ElemType type() const =0
ElemType
Defines an enum for geometric element types.
Elem * child(const unsigned int i) const
Definition: elem.h:2465
virtual unsigned int n_nodes() const =0
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:582
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2445
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:324
virtual Order default_order() const =0
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
Definition: elem.C:2783
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes(unsigned int c, unsigned int n) const
Definition: elem.C:2148
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1831
uint8_t dof_id_type
Definition: id_types.h:64
UniquePtr< Elem > libMesh::Elem::build ( const ElemType  type,
Elem p = libmesh_nullptr 
)
staticinherited
Returns
An Elem of type type wrapped in a smart pointer.

Definition at line 238 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_nullptr, libMesh::NODEELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI3SUBDIVISION, libMesh::TRI6, and libMesh::TRISHELL3.

Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::Elem::bracketing_nodes(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::MeshTools::Generation::build_sphere(), ContainsPointTest::containsPointTri3Helper(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::UnstructuredMesh::create_submesh(), libMesh::MeshTools::Modification::flatten(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::RBDataDeserialization::load_rb_eim_evaluation_data(), libMesh::Elem::origin(), libMesh::Elem::parent_bracketing_nodes(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::VTKIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::AbaqusIO::read_elements(), libMesh::UCDIO::read_implementation(), libMesh::GmshIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::Elem::refine(), ElemTest< elem_type >::setUp(), FETest< order, family, elem_type >::setUp(), ContainsPointTest::testContainsPointTet4(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), DofMapTest::testDofOwner(), PointLocatorTest::testLocator(), EquationSystemsTest::testPostInitAddElem(), libMesh::Parallel::Packing< Elem * >::unpack(), and libMesh::GMVIO::write_ascii_old_impl().

240 {
241  Elem * elem = libmesh_nullptr;
242 
243  switch (type)
244  {
245  // 0D elements
246  case NODEELEM:
247  {
248  elem = new NodeElem(p);
249  break;
250  }
251 
252  // 1D elements
253  case EDGE2:
254  {
255  elem = new Edge2(p);
256  break;
257  }
258  case EDGE3:
259  {
260  elem = new Edge3(p);
261  break;
262  }
263  case EDGE4:
264  {
265  elem = new Edge4(p);
266  break;
267  }
268 
269 
270 
271  // 2D elements
272  case TRI3:
273  {
274  elem = new Tri3(p);
275  break;
276  }
277  case TRISHELL3:
278  {
279  elem = new TriShell3(p);
280  break;
281  }
282  case TRI3SUBDIVISION:
283  {
284  elem = new Tri3Subdivision(p);
285  break;
286  }
287  case TRI6:
288  {
289  elem = new Tri6(p);
290  break;
291  }
292  case QUAD4:
293  {
294  elem = new Quad4(p);
295  break;
296  }
297  case QUADSHELL4:
298  {
299  elem = new QuadShell4(p);
300  break;
301  }
302  case QUAD8:
303  {
304  elem = new Quad8(p);
305  break;
306  }
307  case QUADSHELL8:
308  {
309  elem = new QuadShell8(p);
310  break;
311  }
312  case QUAD9:
313  {
314  elem = new Quad9(p);
315  break;
316  }
317 
318 
319  // 3D elements
320  case TET4:
321  {
322  elem = new Tet4(p);
323  break;
324  }
325  case TET10:
326  {
327  elem = new Tet10(p);
328  break;
329  }
330  case HEX8:
331  {
332  elem = new Hex8(p);
333  break;
334  }
335  case HEX20:
336  {
337  elem = new Hex20(p);
338  break;
339  }
340  case HEX27:
341  {
342  elem = new Hex27(p);
343  break;
344  }
345  case PRISM6:
346  {
347  elem = new Prism6(p);
348  break;
349  }
350  case PRISM15:
351  {
352  elem = new Prism15(p);
353  break;
354  }
355  case PRISM18:
356  {
357  elem = new Prism18(p);
358  break;
359  }
360  case PYRAMID5:
361  {
362  elem = new Pyramid5(p);
363  break;
364  }
365  case PYRAMID13:
366  {
367  elem = new Pyramid13(p);
368  break;
369  }
370  case PYRAMID14:
371  {
372  elem = new Pyramid14(p);
373  break;
374  }
375 
376 
377 
378 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
379 
380  // 1D infinite elements
381  case INFEDGE2:
382  {
383  elem = new InfEdge2(p);
384  break;
385  }
386 
387 
388  // 2D infinite elements
389  case INFQUAD4:
390  {
391  elem = new InfQuad4(p);
392  break;
393  }
394  case INFQUAD6:
395  {
396  elem = new InfQuad6(p);
397  break;
398  }
399 
400 
401  // 3D infinite elements
402  case INFHEX8:
403  {
404  elem = new InfHex8(p);
405  break;
406  }
407  case INFHEX16:
408  {
409  elem = new InfHex16(p);
410  break;
411  }
412  case INFHEX18:
413  {
414  elem = new InfHex18(p);
415  break;
416  }
417  case INFPRISM6:
418  {
419  elem = new InfPrism6(p);
420  break;
421  }
422  case INFPRISM12:
423  {
424  elem = new InfPrism12(p);
425  break;
426  }
427 
428 #endif
429 
430  default:
431  libmesh_error_msg("ERROR: Undefined element type!");
432  }
433 
434  return UniquePtr<Elem>(elem);
435 }
virtual ElemType type() const =0
const class libmesh_nullptr_t libmesh_nullptr
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
UniquePtr< Elem > libMesh::Elem::build_edge ( const unsigned int  i) const
inherited

Creates an element coincident with edge i.

Deprecated:
This method will eventually be removed since it hands back a non-const pointer to an edge that could be used to indirectly modify this Elem. Please use the the const-correct build_edge_ptr() function instead.

Definition at line 2159 of file elem.h.

References libMesh::Elem::build_edge_ptr().

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

2160 {
2161  // Call the const version of build_edge_ptr(), and const_cast the result.
2162  libmesh_deprecated();
2163  Elem * e = const_cast<Elem *>(this->build_edge_ptr(i).release());
2164  return UniquePtr<Elem>(e);
2165 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
virtual UniquePtr< Elem > build_edge_ptr(const unsigned int i)=0
virtual UniquePtr<Elem> libMesh::Face::build_edge_ptr ( const unsigned int  i)
virtualinherited
UniquePtr< const Elem > libMesh::Elem::build_edge_ptr ( const unsigned int  i) const
inherited

Definition at line 2145 of file elem.h.

References libMesh::Elem::build_edge_ptr().

2146 {
2147  // Call the non-const version of this function, return the result as
2148  // a UniquePtr<const Elem>.
2149  Elem * me = const_cast<Elem *>(this);
2150  const Elem * e = const_cast<const Elem *>(me->build_edge_ptr(i).release());
2151  return UniquePtr<const Elem>(e);
2152 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
UniquePtr< Elem > libMesh::Elem::build_side ( const unsigned int  i,
bool  proxy = true 
) const
inherited
Returns
A proxy element coincident with side i.
Deprecated:
This method will eventually be removed since it hands back a non-const pointer to a side that could be used to indirectly modify this. Please use the the const-correct build_side_ptr() function instead.

Definition at line 2132 of file elem.h.

References libMesh::Elem::build_side_ptr().

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

2133 {
2134  // Call the const version of build_side_ptr(), and const_cast the result.
2135  libmesh_deprecated();
2136  Elem * s = const_cast<Elem *>(this->build_side_ptr(i, proxy).release());
2137  return UniquePtr<Elem>(s);
2138 }
virtual UniquePtr< Elem > build_side_ptr(const unsigned int i, bool proxy=true)=0
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
UniquePtr< Elem > libMesh::Quad8::build_side_ptr ( const unsigned int  i,
bool  proxy 
)
virtualinherited
Returns
An element coincident with side i wrapped in a smart pointer.

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

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

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

Implements libMesh::Elem.

Definition at line 204 of file face_quad8.C.

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

Referenced by libMesh::Quad8::default_order().

206 {
207  libmesh_assert_less (i, this->n_sides());
208 
209  if (proxy)
210  return UniquePtr<Elem>(new Side<Edge3,Quad8>(this,i));
211 
212  else
213  {
214  Elem * edge = new Edge3;
215  edge->subdomain_id() = this->subdomain_id();
216 
217  // Set the nodes
218  for (unsigned n=0; n<edge->n_nodes(); ++n)
219  edge->set_node(n) = this->node_ptr(Quad8::side_nodes_map[i][n]);
220 
221  return UniquePtr<Elem>(edge);
222  }
223 
224  libmesh_error_msg("We'll never get here!");
225  return UniquePtr<Elem>();
226 }
static const unsigned int side_nodes_map[4][3]
This maps the node of the side to element node numbers.
Definition: face_quad8.h:172
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1874
subdomain_id_type subdomain_id() const
Definition: elem.h:1951
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
virtual unsigned int n_sides() const libmesh_override
Definition: face_quad.h:85
UniquePtr< const Elem > libMesh::Elem::build_side_ptr ( const unsigned int  i,
bool  proxy = true 
) const
inherited

Definition at line 2118 of file elem.h.

References libMesh::Elem::build_side_ptr().

2119 {
2120  // Call the non-const version of this function, return the result as
2121  // a UniquePtr<const Elem>.
2122  Elem * me = const_cast<Elem *>(this);
2123  const Elem * s = const_cast<const Elem *>(me->build_side_ptr(i, proxy).release());
2124  return UniquePtr<const Elem>(s);
2125 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
Point libMesh::Elem::centroid ( ) const
virtualinherited
Returns
The centroid of the element. The centroid is computed as the average of all the element vertices.

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

Definition at line 446 of file elem.C.

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

Referenced by BoundaryMeshTest::build_mesh(), libMesh::CentroidPartitioner::compute_centroids(), libMesh::UnstructuredMesh::find_neighbors(), A0::interior_assembly(), A1::interior_assembly(), OutputAssembly::interior_assembly(), libMesh::Elem::is_vertex_on_child(), SlitFunc::operator()(), libMesh::SFCPartitioner::partition_range(), libMesh::LocationMap< T >::point_of(), BoundaryMeshTest::sanityCheck(), libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), ElemTest< elem_type >::test_bounding_box(), DefaultCouplingTest::testCoupling(), and PointNeighborCouplingTest::testCoupling().

447 {
448  Point cp;
449 
450  for (unsigned int n=0; n<this->n_vertices(); n++)
451  cp.add (this->point(n));
452 
453  return (cp /= static_cast<Real>(this->n_vertices()));
454 }
virtual unsigned int n_vertices() const =0
Elem * libMesh::Elem::child ( const unsigned int  i) const
inherited
Returns
A non-constant pointer to the $ i^{th} $ child for this element.
Deprecated:
Use the more accurately-named and const correct child_ptr() function instead.

Definition at line 2465 of file elem.h.

References libMesh::Elem::child_ptr().

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

2466 {
2467  // Support the deprecated interface by calling the new,
2468  // const-correct interface and casting the result to an Elem *.
2469  libmesh_deprecated();
2470  return const_cast<Elem *>(this->child_ptr(i));
2471 }
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2445
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
Elem * libMesh::Elem::child_neighbor ( Elem elem)
inherited
Returns
If elem is a neighbor of a child of this element, a pointer to that child, otherwise NULL.

Definition at line 2022 of file elem.h.

References libmesh_nullptr, and libMesh::Elem::neighbor_ptr_range().

2023 {
2024  for (auto n : elem->neighbor_ptr_range())
2025  if (n && n->parent() == this)
2026  return n;
2027 
2028  return libmesh_nullptr;
2029 }
const class libmesh_nullptr_t libmesh_nullptr
const Elem * libMesh::Elem::child_neighbor ( const Elem elem) const
inherited
Returns
If elem is a neighbor of a child of this element, a pointer to that child, otherwise NULL.

Definition at line 2034 of file elem.h.

References libmesh_nullptr, and libMesh::Elem::neighbor_ptr_range().

2035 {
2036  for (auto n : elem->neighbor_ptr_range())
2037  if (n && n->parent() == this)
2038  return n;
2039 
2040  return libmesh_nullptr;
2041 }
const class libmesh_nullptr_t libmesh_nullptr
const Elem * libMesh::Elem::child_ptr ( unsigned int  i) const
inherited
Elem * libMesh::Elem::child_ptr ( unsigned int  i)
inherited
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 2454 of file elem.h.

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

2455 {
2458 
2459  return _children[i];
2460 }
libmesh_assert(j)
Elem ** _children
Pointers to this element&#39;s children.
Definition: elem.h:1627
SimpleRange< Elem::ChildRefIter > libMesh::Elem::child_ref_range ( )
inherited

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

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

Referenced by libMesh::Elem::active_family_tree(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::active_family_tree_by_topological_neighbor(), libMesh::HPCoarsenTest::add_projection(), libMesh::Elem::ancestor(), libMesh::OldSolutionValue< Output, point_output >::check_old_context(), libMesh::Elem::coarsen(), libMesh::FEGenericBase< OutputType >::coarsened_dof_values(), libMesh::connect_children(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::Elem::family_tree(), libMesh::Elem::family_tree_by_neighbor(), libMesh::Elem::family_tree_by_subneighbor(), libMesh::Elem::find_interior_neighbors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::Elem::has_ancestor_children(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_remote_elems(), 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::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), libMesh::BuildProjectionList::operator()(), libMesh::Elem::set_p_level(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::Elem::total_family_tree(), libMesh::Elem::total_family_tree_by_neighbor(), libMesh::Elem::total_family_tree_by_subneighbor(), and libMesh::XdrIO::write_serialized_connectivity().

1700 {
1702  return {_children, _children + this->n_children()};
1703 }
libmesh_assert(j)
Elem ** _children
Pointers to this element&#39;s children.
Definition: elem.h:1627
virtual unsigned int n_children() const =0
SimpleRange< Elem::ConstChildRefIter > libMesh::Elem::child_ref_range ( ) const
inherited

Definition at line 1707 of file elem.h.

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

1708 {
1710  return {_children, _children + this->n_children()};
1711 }
libmesh_assert(j)
Elem ** _children
Pointers to this element&#39;s children.
Definition: elem.h:1627
virtual unsigned int n_children() const =0
void libMesh::DofObject::clear_dofs ( )
inherited

Clear the DofMap data structures and return to a pristine state.

Definition at line 598 of file dof_object.h.

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

Referenced by libMesh::DofObject::set_n_systems(), and libMesh::DofObject::~DofObject().

599 {
600  // vector swap trick to force deallocation
601  index_buffer_t().swap(_idx_buf);
602 
603  libmesh_assert_equal_to (this->n_systems(), 0);
604  libmesh_assert (_idx_buf.empty());
605 }
libmesh_assert(j)
std::vector< index_t > index_buffer_t
Definition: dof_object.h:484
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_systems() const
Definition: dof_object.h:726
void libMesh::DofObject::clear_old_dof_object ( )
inherited

Sets the old_dof_object to libmesh_nullptr.

Definition at line 142 of file dof_object.C.

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

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

143 {
144  delete this->old_dof_object;
146 }
const class libmesh_nullptr_t libmesh_nullptr
DofObject * old_dof_object
This object on the last mesh.
Definition: dof_object.h:79
bool libMesh::Elem::close_to_point ( const Point p,
Real  tol 
) const
virtualinherited
Returns
true if this element is "close" to the point p, where "close" is determined by the tolerance tol.

Definition at line 2473 of file elem.C.

References libMesh::Elem::point_test().

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

2474 {
2475  // This test uses the user's passed-in tolerance for the
2476  // bounding box test as well, thereby allowing the routine to
2477  // find points which are not only "in" the element, but also
2478  // "nearby" to within some tolerance.
2479  return this->point_test(p, tol, tol);
2480 }
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:2485
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 106 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::point(), libMesh::Elem::refinement_flag(), libMesh::remote_elem, libMesh::Elem::set_p_level(), and libMesh::Elem::set_refinement_flag().

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

107 {
108  libmesh_assert_equal_to (this->refinement_flag(), Elem::COARSEN_INACTIVE);
109  libmesh_assert (!this->active());
110 
111  // We no longer delete children until MeshRefinement::contract()
112  // delete [] _children;
113  // _children = libmesh_nullptr;
114 
115  unsigned int parent_p_level = 0;
116 
117  // re-compute hanging node nodal locations
118  for (unsigned int c = 0, nc = this->n_children(); c != nc; ++c)
119  {
120  Elem * mychild = this->child_ptr(c);
121  if (mychild == remote_elem)
122  continue;
123  for (unsigned int nc=0; nc != mychild->n_nodes(); nc++)
124  {
125  Point new_pos;
126  bool calculated_new_pos = false;
127 
128  for (unsigned int n=0; n<this->n_nodes(); n++)
129  {
130  // The value from the embedding matrix
131  const float em_val = this->embedding_matrix(c,nc,n);
132 
133  // The node location is somewhere between existing vertices
134  if ((em_val != 0.) && (em_val != 1.))
135  {
136  new_pos.add_scaled (this->point(n), em_val);
137  calculated_new_pos = true;
138  }
139  }
140 
141  if (calculated_new_pos)
142  {
143  //Move the existing node back into it's original location
144  for (unsigned int i=0; i<LIBMESH_DIM; i++)
145  {
146  Point & child_node = mychild->point(nc);
147  child_node(i)=new_pos(i);
148  }
149  }
150  }
151  }
152 
153  for (auto & mychild : this->child_ref_range())
154  {
155  if (&mychild == remote_elem)
156  continue;
157  libmesh_assert_equal_to (mychild.refinement_flag(), Elem::COARSEN);
158  mychild.set_refinement_flag(Elem::INACTIVE);
159  if (mychild.p_level() > parent_p_level)
160  parent_p_level = mychild.p_level();
161  }
162 
164  this->set_p_level(parent_p_level);
165 
166  libmesh_assert (this->active());
167 }
void set_p_level(const unsigned int p)
Sets the value of the p-refinement level for the element.
Definition: elem.h:2559
bool active() const
Definition: elem.h:2257
void set_refinement_flag(const RefinementState rflag)
Sets the value of the refinement flag for the element.
Definition: elem.h:2513
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:1699
libmesh_assert(j)
virtual unsigned int n_nodes() const =0
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2445
virtual unsigned int n_children() const =0
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
const Point & point(const unsigned int i) const
Definition: elem.h:1809
RefinementState refinement_flag() const
Definition: elem.h:2505
virtual float embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
const RemoteElem * remote_elem
Definition: remote_elem.C:57
dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0)
staticprotectedinherited
dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0,
dof_id_type  n1 
)
staticprotectedinherited
Returns
A hash key computed from two node ids.

Definition at line 2629 of file elem.h.

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

2631 {
2632  // Order the two so that n0 < n1
2633  if (n0 > n1) std::swap (n0, n1);
2634 
2635  return Utility::hashword2(n0, n1);
2636 }
void swap(Iterator &lhs, Iterator &rhs)
swap, used to implement op=
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
dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0,
dof_id_type  n1,
dof_id_type  n2 
)
staticprotectedinherited
Returns
A hash key computed from three node ids.

Definition at line 2641 of file elem.h.

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

2644 {
2645  // Order the numbers such that n0 < n1 < n2.
2646  // We'll do it in 3 steps like this:
2647  //
2648  // n0 n1 n2
2649  // min(n0,n1) max(n0,n1) n2
2650  // min(n0,n1) min(n2,max(n0,n1) max(n2,max(n0,n1)
2651  // |\ /| |
2652  // | \ / | |
2653  // | / | |
2654  // | / \| |
2655  // gb min= min max gb max
2656 
2657  // Step 1
2658  if (n0 > n1) std::swap (n0, n1);
2659 
2660  // Step 2
2661  if (n1 > n2) std::swap (n1, n2);
2662 
2663  // Step 3
2664  if (n0 > n1) std::swap (n0, n1);
2665 
2666  libmesh_assert ((n0 < n1) && (n1 < n2));
2667 
2668  dof_id_type array[3] = {n0, n1, n2};
2669  return Utility::hashword(array, 3);
2670 }
libmesh_assert(j)
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
void swap(Iterator &lhs, Iterator &rhs)
swap, used to implement op=
uint8_t dof_id_type
Definition: id_types.h:64
dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0,
dof_id_type  n1,
dof_id_type  n2,
dof_id_type  n3 
)
staticprotectedinherited
Returns
A hash key computed from four node ids.

Definition at line 2675 of file elem.h.

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

2679 {
2680  // Sort first
2681  // Step 1
2682  if (n0 > n1) std::swap (n0, n1);
2683 
2684  // Step 2
2685  if (n2 > n3) std::swap (n2, n3);
2686 
2687  // Step 3
2688  if (n0 > n2) std::swap (n0, n2);
2689 
2690  // Step 4
2691  if (n1 > n3) std::swap (n1, n3);
2692 
2693  // Finally sort step 5
2694  if (n1 > n2) std::swap (n1, n2);
2695 
2696  libmesh_assert ((n0 < n1) && (n1 < n2) && (n2 < n3));
2697 
2698  dof_id_type array[4] = {n0, n1, n2, n3};
2699  return Utility::hashword(array, 4);
2700 }
libmesh_assert(j)
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
void swap(Iterator &lhs, Iterator &rhs)
swap, used to implement op=
uint8_t dof_id_type
Definition: id_types.h:64
void libMesh::Quad8::connectivity ( const unsigned int  sc,
const IOPackage  iop,
std::vector< dof_id_type > &  conn 
) const
virtualinherited
Returns
The connectivity for this element in a specific format, which is specified by the IOPackage tag.

Implements libMesh::Elem.

Definition at line 233 of file face_quad8.C.

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

Referenced by libMesh::Quad8::default_order().

236 {
237  libmesh_assert_less (sf, this->n_sub_elem());
238  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
239 
240  switch (iop)
241  {
242  // Note: TECPLOT connectivity is output as four triangles with
243  // a central quadrilateral. Therefore, the first four connectivity
244  // arrays are degenerate quads (triangles in Tecplot).
245  case TECPLOT:
246  {
247  // Create storage
248  conn.resize(4);
249 
250  switch(sf)
251  {
252  case 0:
253  // linear sub-tri 0
254  conn[0] = this->node_id(0)+1;
255  conn[1] = this->node_id(4)+1;
256  conn[2] = this->node_id(7)+1;
257  conn[3] = this->node_id(7)+1;
258 
259  return;
260 
261  case 1:
262  // linear sub-tri 1
263  conn[0] = this->node_id(4)+1;
264  conn[1] = this->node_id(1)+1;
265  conn[2] = this->node_id(5)+1;
266  conn[3] = this->node_id(5)+1;
267 
268  return;
269 
270  case 2:
271  // linear sub-tri 2
272  conn[0] = this->node_id(5)+1;
273  conn[1] = this->node_id(2)+1;
274  conn[2] = this->node_id(6)+1;
275  conn[3] = this->node_id(6)+1;
276 
277  return;
278 
279  case 3:
280  // linear sub-tri 3
281  conn[0] = this->node_id(7)+1;
282  conn[1] = this->node_id(6)+1;
283  conn[2] = this->node_id(3)+1;
284  conn[3] = this->node_id(3)+1;
285 
286  return;
287 
288  case 4:
289  // linear sub-quad
290  conn[0] = this->node_id(4)+1;
291  conn[1] = this->node_id(5)+1;
292  conn[2] = this->node_id(6)+1;
293  conn[3] = this->node_id(7)+1;
294 
295  return;
296 
297  default:
298  libmesh_error_msg("Invalid sf = " << sf);
299  }
300  }
301 
302 
303  // Note: VTK connectivity is output as four triangles with
304  // a central quadrilateral. Therefore most of the connectivity
305  // arrays have length three.
306  case VTK:
307  {
308  // Create storage
309  conn.resize(8);
310  conn[0] = this->node_id(0);
311  conn[1] = this->node_id(1);
312  conn[2] = this->node_id(2);
313  conn[3] = this->node_id(3);
314  conn[4] = this->node_id(4);
315  conn[5] = this->node_id(5);
316  conn[6] = this->node_id(6);
317  conn[7] = this->node_id(7);
318  return;
319  /*
320  conn.resize(3);
321 
322  switch (sf)
323  {
324  case 0:
325  // linear sub-tri 0
326  conn[0] = this->node_id(0);
327  conn[1] = this->node_id(4);
328  conn[2] = this->node_id(7);
329 
330  return;
331 
332  case 1:
333  // linear sub-tri 1
334  conn[0] = this->node_id(4);
335  conn[1] = this->node_id(1);
336  conn[2] = this->node_id(5);
337 
338  return;
339 
340  case 2:
341  // linear sub-tri 2
342  conn[0] = this->node_id(5);
343  conn[1] = this->node_id(2);
344  conn[2] = this->node_id(6);
345 
346  return;
347 
348  case 3:
349  // linear sub-tri 3
350  conn[0] = this->node_id(7);
351  conn[1] = this->node_id(6);
352  conn[2] = this->node_id(3);
353 
354  return;
355 
356  case 4:
357  conn.resize(4);
358 
359  // linear sub-quad
360  conn[0] = this->node_id(4);
361  conn[1] = this->node_id(5);
362  conn[2] = this->node_id(6);
363  conn[3] = this->node_id(7);
364  */
365  // return;
366 
367  // default:
368  // libmesh_error_msg("Invalid sf = " << sf);
369  // }
370  }
371 
372  default:
373  libmesh_error_msg("Unsupported IO package " << iop);
374  }
375 }
virtual unsigned int n_sub_elem() const libmesh_override
Definition: face_quad8.h:73
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1831
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 584 of file elem.C.

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

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

585 {
586  unsigned int num_contained_edges = 0;
587 
588  // Our vertices are the first numbered nodes
589  for (unsigned int n = 0; n != e->n_vertices(); ++n)
590  {
591  if (this->contains_point(e->point(n)))
592  {
593  num_contained_edges++;
594  if (num_contained_edges>=2)
595  {
596  return true;
597  }
598  }
599  }
600  return false;
601 }
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2448
bool libMesh::Elem::contains_point ( const Point p,
Real  tol = TOLERANCE 
) const
virtualinherited
Returns
true if the point p is contained in this element, false otherwise.

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

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

Reimplemented in libMesh::libmesh_final< T >, libMesh::InfHex, libMesh::Tri3, libMesh::InfPrism, and libMesh::InfQuad4.

Definition at line 2448 of file elem.C.

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

Referenced by libMesh::Elem::contains_edge_of(), libMesh::Elem::contains_vertex_of(), libMesh::Elem::find_edge_neighbors(), libMesh::Elem::find_interior_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::PointLocatorTree::operator()(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::Elem::qual_bounds(), NavierSystem::side_constraint(), FETest< order, family, elem_type >::testGradU(), FETest< order, family, elem_type >::testGradUComp(), PointLocatorTest::testLocator(), and FETest< order, family, elem_type >::testU().

2449 {
2450  // We currently allow the user to enlarge the bounding box by
2451  // providing a tol > TOLERANCE (so this routine is identical to
2452  // Elem::close_to_point()), but print a warning so that the
2453  // user can eventually switch his code over to calling close_to_point()
2454  // instead, which is intended to be used for this purpose.
2455  if (tol > TOLERANCE)
2456  {
2457  libmesh_do_once(libMesh::err
2458  << "WARNING: Resizing bounding box to match user-specified tolerance!\n"
2459  << "In the future, calls to Elem::contains_point() with tol > TOLERANCE\n"
2460  << "will be more optimized, but should not be used\n"
2461  << "to search for points 'close to' elements!\n"
2462  << "Instead, use Elem::close_to_point() for this purpose.\n"
2463  << std::endl;);
2464  return this->point_test(p, tol, tol);
2465  }
2466  else
2467  return this->point_test(p, TOLERANCE, tol);
2468 }
OStreamProxy err
static const Real TOLERANCE
bool point_test(const Point &p, Real box_tol, Real map_tol) const
Shared private implementation used by the contains_point() and close_to_point() routines.
Definition: elem.C:2485
bool libMesh::Elem::contains_vertex_of ( const Elem e) const
inherited
Returns
true if a vertex of e is contained in this element.

Definition at line 573 of file elem.C.

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

Referenced by libMesh::Elem::find_interior_neighbors(), and libMesh::Elem::find_point_neighbors().

574 {
575  // Our vertices are the first numbered nodes
576  for (unsigned int n = 0; n != e->n_vertices(); ++n)
577  if (this->contains_point(e->point(n)))
578  return true;
579  return false;
580 }
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2448
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 171 of file elem_refinement.C.

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

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

172 {
173  // Subactive elements get deleted entirely, not contracted
174  libmesh_assert (this->active());
175 
176  // Active contracted elements no longer can have children
177  delete [] _children;
179 
180  if (this->refinement_flag() == Elem::JUST_COARSENED)
182 }
bool active() const
Definition: elem.h:2257
const class libmesh_nullptr_t libmesh_nullptr
void set_refinement_flag(const RefinementState rflag)
Sets the value of the refinement flag for the element.
Definition: elem.h:2513
libmesh_assert(j)
Elem ** _children
Pointers to this element&#39;s children.
Definition: elem.h:1627
RefinementState refinement_flag() const
Definition: elem.h:2505
void libMesh::DofObject::debug_buffer ( ) const
inherited

Print our buffer for debugging.

Definition at line 550 of file dof_object.C.

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

551 {
552  libMesh::out << " [ ";
553  for (std::size_t i=0; i<_idx_buf.size(); i++)
554  libMesh::out << _idx_buf[i] << " ";
555  libMesh::out << "]\n";
556 }
OStreamProxy out
index_buffer_t _idx_buf
Definition: dof_object.h:485
virtual Order libMesh::Quad8::default_order ( ) const
virtualinherited
virtual unsigned int libMesh::Face::dim ( ) const
virtualinherited
Returns
2, the dimensionality of the object.

Implements libMesh::Elem.

Definition at line 55 of file face.h.

55 { return 2; }
void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 107 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

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

108 {
109  _enable_print_counter = false;
110  return;
111 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 107 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

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

108 {
109  _enable_print_counter = false;
110  return;
111 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
dof_id_type libMesh::DofObject::dof_number ( const unsigned int  s,
const unsigned int  var,
const unsigned int  comp 
) const
inherited
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 810 of file dof_object.h.

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

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::allgather_recursive_constraints(), assemble_shell(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::dof_indices(), libMesh::DofObject::DofObject(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), 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::DofObject::operator=(), libMesh::DofObject::print_dof_info(), LinearElasticityWithContact::residual_and_jacobian(), libMesh::HPCoarsenTest::select_refinement(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_id(), libMesh::DofMap::set_nonlocal_dof_objects(), ParsedFEMFunctionTest::setUp(), DofObjectTest< Node >::testJensEftangBug(), DofObjectTest< Node >::testManualDofCalculation(), libMesh::BoundaryVolumeSolutionTransfer::transfer_boundary_volume(), libMesh::BoundaryVolumeSolutionTransfer::transfer_volume_boundary(), and libMesh::DTKAdapter::update_variable_values().

813 {
814  libmesh_assert_less (s, this->n_systems());
815  libmesh_assert_less (var, this->n_vars(s));
816  libmesh_assert_less (comp, this->n_comp(s,var));
817 
818  const unsigned int
819  vg = this->var_to_vg(s,var),
820  start_idx_sys = this->start_idx(s);
821 
822  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
823 
824  const dof_id_type
825  base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
826 
827  // if the first component is invalid, they
828  // are all invalid
829  if (base_idx == invalid_id)
830  return invalid_id;
831 
832  // otherwise the index is the first component
833  // index augmented by the component number
834  else
835  {
836  const unsigned int
837  ncg = this->n_comp_group(s,vg),
838  vig = this->system_var_to_vg_var(s,vg,var);
839 
840  // std::cout << "base_idx, var, vg, vig, ncg, comp="
841  // << base_idx << " "
842  // << var << " "
843  // << vg << " "
844  // << vig << " "
845  // << ncg << " "
846  // << comp << '\n';
847 
848  return cast_int<dof_id_type>(base_idx + vig*ncg + comp);
849  }
850 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:793
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
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:965
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:324
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:878
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:946
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:780
unsigned int n_systems() const
Definition: dof_object.h:726
uint8_t dof_id_type
Definition: id_types.h:64
IntRange< unsigned short > libMesh::Elem::edge_index_range ( ) const
inherited
virtual float libMesh::Quad8::embedding_matrix ( const unsigned int  i,
const unsigned int  j,
const unsigned int  k 
) const
protectedvirtualinherited

Matrix used to create the elements children.

Implements libMesh::Elem.

Definition at line 200 of file face_quad8.h.

References libMesh::Quad8::_embedding_matrix.

203  { return _embedding_matrix[i][j][k]; }
static const float _embedding_matrix[4][8][8]
Matrix that computes new nodal locations/solution values from current nodes/solution.
Definition: face_quad8.h:209
virtual unsigned int libMesh::Elem::embedding_matrix_version ( ) const
virtualinherited
Returns
A "version number" that identifies which embedding matrix is in use.

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

Reimplemented in libMesh::Tet.

Definition at line 1536 of file elem.h.

References libMesh::Elem::compute_key().

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

1536 { return 0; }
void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Definition at line 101 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

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

102 {
103  _enable_print_counter = true;
104  return;
105 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Definition at line 101 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

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

102 {
103  _enable_print_counter = true;
104  return;
105 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
void libMesh::Elem::family_tree ( std::vector< const Elem * > &  family,
const 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 1681 of file elem.C.

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

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

1683 {
1684  // The "family tree" doesn't include subactive elements
1685  libmesh_assert(!this->subactive());
1686 
1687  // Clear the vector if the flag reset tells us to.
1688  if (reset)
1689  family.clear();
1690 
1691  // Add this element to the family tree.
1692  family.push_back(this);
1693 
1694  // Recurse into the elements children, if it has them.
1695  // Do not clear the vector any more.
1696  if (!this->active())
1697  for (auto & c : this->child_ref_range())
1698  if (!c.is_remote())
1699  c.family_tree (family, false);
1700 }
bool subactive() const
Definition: elem.h:2275
bool active() const
Definition: elem.h:2257
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:1699
libmesh_assert(j)
void libMesh::Elem::family_tree_by_neighbor ( std::vector< const Elem * > &  family,
const Elem neighbor,
const bool  reset = true 
) const
inherited

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

Definition at line 1808 of file elem.C.

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

1811 {
1812  // The "family tree" doesn't include subactive elements
1813  libmesh_assert(!this->subactive());
1814 
1815  // Clear the vector if the flag reset tells us to.
1816  if (reset)
1817  family.clear();
1818 
1819  // This only makes sense if we're already a neighbor
1820  libmesh_assert (this->has_neighbor(neighbor_in));
1821 
1822  // Add this element to the family tree.
1823  family.push_back(this);
1824 
1825  // Recurse into the elements children, if it's not active.
1826  // Do not clear the vector any more.
1827  if (!this->active())
1828  for (auto & c : this->child_ref_range())
1829  if (&c != remote_elem && c.has_neighbor(neighbor_in))
1830  c.family_tree_by_neighbor (family, neighbor_in, false);
1831 }
bool subactive() const
Definition: elem.h:2275
bool active() const
Definition: elem.h:2257
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:1699
libmesh_assert(j)
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2010
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::Elem::family_tree_by_side ( std::vector< const Elem * > &  family,
const unsigned int  side,
const bool  reset = true 
) const
inherited

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

Definition at line 1748 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ptr(), libMesh::Elem::family_tree_by_side(), libMesh::Elem::is_child_on_side(), libMesh::Elem::is_remote(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::Elem::n_sides(), and libMesh::Elem::subactive().

Referenced by libMesh::Elem::family_tree_by_side(), and libMesh::Elem::make_links_to_me_local().

1751 {
1752  // The "family tree" doesn't include subactive elements
1753  libmesh_assert(!this->subactive());
1754 
1755  // Clear the vector if the flag reset tells us to.
1756  if (reset)
1757  family.clear();
1758 
1759  libmesh_assert_less (s, this->n_sides());
1760 
1761  // Add this element to the family tree.
1762  family.push_back(this);
1763 
1764  // Recurse into the elements children, if it has them.
1765  // Do not clear the vector any more.
1766  if (!this->active())
1767  {
1768  const unsigned int nc = this->n_children();
1769  for (unsigned int c = 0; c != nc; c++)
1770  if (!this->child_ptr(c)->is_remote() && this->is_child_on_side(c, s))
1771  this->child_ptr(c)->family_tree_by_side (family, s, false);
1772  }
1773 }
void family_tree_by_side(std::vector< const Elem * > &family, const unsigned int side, const bool reset=true) const
Same as the family_tree() member, but only adds elements which are next to side.
Definition: elem.C:1748
bool subactive() const
Definition: elem.h:2275
bool active() const
Definition: elem.h:2257
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const =0
libmesh_assert(j)
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2445
virtual unsigned int n_sides() const =0
virtual bool is_remote() const
Definition: elem.h:530
virtual unsigned int n_children() const =0
void libMesh::Elem::family_tree_by_subneighbor ( std::vector< const Elem * > &  family,
const Elem neighbor,
const Elem subneighbor,
const 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 1859 of file elem.C.

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

1863 {
1864  // The "family tree" doesn't include subactive elements
1865  libmesh_assert(!this->subactive());
1866 
1867  // Clear the vector if the flag reset tells us to.
1868  if (reset)
1869  family.clear();
1870 
1871  // To simplify this function we need an existing neighbor
1872  libmesh_assert (neighbor_in);
1873  libmesh_assert_not_equal_to (neighbor_in, remote_elem);
1874  libmesh_assert (this->has_neighbor(neighbor_in));
1875 
1876  // This only makes sense if subneighbor descends from neighbor
1877  libmesh_assert (subneighbor);
1878  libmesh_assert_not_equal_to (subneighbor, remote_elem);
1879  libmesh_assert (neighbor_in->is_ancestor_of(subneighbor));
1880 
1881  // Add this element to the family tree if applicable.
1882  if (neighbor_in == subneighbor)
1883  family.push_back(this);
1884 
1885  // Recurse into the elements children, if it's not active.
1886  // Do not clear the vector any more.
1887  if (!this->active())
1888  for (auto & c : this->child_ref_range())
1889  if (&c != remote_elem)
1890  for (auto child_neigh : c.neighbor_ptr_range())
1891  if (child_neigh &&
1892  (child_neigh == neighbor_in ||
1893  (child_neigh->parent() == neighbor_in &&
1894  child_neigh->is_ancestor_of(subneighbor))))
1895  c.family_tree_by_subneighbor (family, child_neigh,
1896  subneighbor, false);
1897 }
bool subactive() const
Definition: elem.h:2275
bool active() const
Definition: elem.h:2257
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:1699
libmesh_assert(j)
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2010
const RemoteElem * remote_elem
Definition: remote_elem.C:57
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 770 of file elem.C.

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

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

773 {
774  // Simple but perhaps suboptimal code: find elements containing the
775  // first point, then winnow this set down by removing elements which
776  // don't also contain the second point
777 
778  libmesh_assert(this->contains_point(p2));
779  this->find_point_neighbors(p1, neighbor_set);
780 
781  std::set<const Elem *>::iterator it = neighbor_set.begin();
782  const std::set<const Elem *>::iterator end = neighbor_set.end();
783 
784  while (it != end)
785  {
786  std::set<const Elem *>::iterator current = it++;
787 
788  const Elem * elem = *current;
789  // This won't invalidate iterator it, because it is already
790  // pointing to the next element
791  if (!elem->contains_point(p2))
792  neighbor_set.erase(current);
793  }
794 }
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
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:605
libmesh_assert(j)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2448
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 798 of file elem.C.

References libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::contains_edge_of(), end, libMesh::Elem::neighbor_ptr_range(), and libMesh::remote_elem.

799 {
800  neighbor_set.clear();
801  neighbor_set.insert(this);
802 
803  std::set<const Elem *> untested_set, next_untested_set;
804  untested_set.insert(this);
805 
806  while (!untested_set.empty())
807  {
808  // Loop over all the elements in the patch that haven't already
809  // been tested
810  std::set<const Elem *>::const_iterator it = untested_set.begin();
811  const std::set<const Elem *>::const_iterator end = untested_set.end();
812 
813  for (; it != end; ++it)
814  {
815  const Elem * elem = *it;
816 
817  for (auto current_neighbor : elem->neighbor_ptr_range())
818  {
819  if (current_neighbor &&
820  current_neighbor != remote_elem) // we have a real neighbor on this side
821  {
822  if (current_neighbor->active()) // ... if it is active
823  {
824  if (this->contains_edge_of(current_neighbor) // ... and touches us
825  || current_neighbor->contains_edge_of(this))
826  {
827  // Make sure we'll test it
828  if (!neighbor_set.count(current_neighbor))
829  next_untested_set.insert (current_neighbor);
830 
831  // And add it
832  neighbor_set.insert (current_neighbor);
833  }
834  }
835 #ifdef LIBMESH_ENABLE_AMR
836  else // ... the neighbor is *not* active,
837  { // ... so add *all* neighboring
838  // active children
839  std::vector<const Elem *> active_neighbor_children;
840 
841  current_neighbor->active_family_tree_by_neighbor
842  (active_neighbor_children, elem);
843 
844  std::vector<const Elem *>::const_iterator
845  child_it = active_neighbor_children.begin();
846  const std::vector<const Elem *>::const_iterator
847  child_end = active_neighbor_children.end();
848  for (; child_it != child_end; ++child_it)
849  {
850  const Elem * current_child = *child_it;
851  if (this->contains_edge_of(*child_it) ||
852  (*child_it)->contains_edge_of(this))
853  {
854  // Make sure we'll test it
855  if (!neighbor_set.count(current_child))
856  next_untested_set.insert (current_child);
857 
858  neighbor_set.insert (current_child);
859  }
860  }
861  }
862 #endif // #ifdef LIBMESH_ENABLE_AMR
863  }
864  }
865  }
866  untested_set.swap(next_untested_set);
867  next_untested_set.clear();
868  }
869 }
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
bool contains_edge_of(const Elem *e) const
Definition: elem.C:584
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
const RemoteElem * remote_elem
Definition: remote_elem.C:57
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 872 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child(), libMesh::Elem::child_ref_range(), libMesh::Elem::contains_point(), libMesh::Elem::contains_vertex_of(), libMesh::Elem::dim(), end, libMesh::Elem::find_point_neighbors(), libMesh::Elem::interior_parent(), libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::node_ref_range(), and libMesh::Elem::subactive().

Referenced by libMesh::MetisPartitioner::partition_range().

873 {
874  neighbor_set.clear();
875 
876  if ((this->dim() >= LIBMESH_DIM) ||
877  !this->interior_parent())
878  return;
879 
880  const Elem * ip = this->interior_parent();
881  libmesh_assert (ip->contains_vertex_of(this) ||
882  this->contains_vertex_of(ip));
883 
884  libmesh_assert (!ip->subactive());
885 
886 #ifdef LIBMESH_ENABLE_AMR
887  while (!ip->active()) // only possible with AMR, be careful because
888  { // ip->child_ptr(c) is only good with AMR.
889  for (auto & child : ip->child_ref_range())
890  {
891  if (child.contains_vertex_of(this) ||
892  this->contains_vertex_of(&child))
893  {
894  ip = &child;
895  break;
896  }
897  }
898  }
899 #endif
900 
901  this->find_point_neighbors(neighbor_set, ip);
902 
903  // Now we have all point neighbors from the interior manifold, but
904  // we need to weed out any neighbors that *only* intersect us at one
905  // point (or at one edge, if we're a 1-D element in 3D).
906  //
907  // The refinement hierarchy helps us here: if the interior element
908  // has a lower or equal refinement level then we can discard it iff
909  // it doesn't contain all our vertices. If it has a higher
910  // refinement level then we can discard it iff we don't contain at
911  // least dim()+1 of its vertices
912  std::set<const Elem *>::iterator it = neighbor_set.begin();
913  const std::set<const Elem *>::iterator end = neighbor_set.end();
914 
915  while (it != end)
916  {
917  std::set<const Elem *>::iterator current = it++;
918  const Elem * elem = *current;
919 
920  // This won't invalidate iterator it, because it is already
921  // pointing to the next element
922  if (elem->level() > this->level())
923  {
924  unsigned int vertices_contained = 0;
925  for (auto & n : elem->node_ref_range())
926  if (this->contains_point(n))
927  vertices_contained++;
928 
929  if (vertices_contained <= this->dim())
930  {
931  neighbor_set.erase(current);
932  continue;
933  }
934  }
935  else
936  {
937  for (auto & n : this->node_ref_range())
938  {
939  if (!elem->contains_point(n))
940  {
941  neighbor_set.erase(current);
942  break;
943  }
944  }
945  }
946  }
947 }
const Elem * interior_parent() const
Definition: elem.C:951
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
Elem * child(const unsigned int i) const
Definition: elem.h:2465
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:605
bool contains_vertex_of(const Elem *e) const
Definition: elem.C:573
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:1699
libmesh_assert(j)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
SimpleRange< NodeRefIter > node_ref_range()
Returns a range with all nodes of an element, usable in range-based for loops.
Definition: elem.h:2047
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2388
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2448
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 605 of file elem.C.

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

Referenced by libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::Elem::find_edge_neighbors(), libMesh::MeshFunction::find_element(), libMesh::MeshFunction::find_elements(), libMesh::Elem::find_interior_neighbors(), libMesh::Patch::find_point_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::Elem::is_semilocal(), and libMesh::PointNeighborCoupling::operator()().

607 {
608  libmesh_assert(this->contains_point(p));
609  libmesh_assert(this->active());
610 
611  neighbor_set.clear();
612  neighbor_set.insert(this);
613 
614  std::set<const Elem *> untested_set, next_untested_set;
615  untested_set.insert(this);
616 
617  while (!untested_set.empty())
618  {
619  // Loop over all the elements in the patch that haven't already
620  // been tested
621  std::set<const Elem *>::const_iterator it = untested_set.begin();
622  const std::set<const Elem *>::const_iterator end = untested_set.end();
623 
624  for (; it != end; ++it)
625  {
626  const Elem * elem = *it;
627 
628  for (auto current_neighbor : elem->neighbor_ptr_range())
629  {
630  if (current_neighbor &&
631  current_neighbor != remote_elem) // we have a real neighbor on this side
632  {
633  if (current_neighbor->active()) // ... if it is active
634  {
635  if (current_neighbor->contains_point(p)) // ... and touches p
636  {
637  // Make sure we'll test it
638  if (!neighbor_set.count(current_neighbor))
639  next_untested_set.insert (current_neighbor);
640 
641  // And add it
642  neighbor_set.insert (current_neighbor);
643  }
644  }
645 #ifdef LIBMESH_ENABLE_AMR
646  else // ... the neighbor is *not* active,
647  { // ... so add *all* neighboring
648  // active children that touch p
649  std::vector<const Elem *> active_neighbor_children;
650 
651  current_neighbor->active_family_tree_by_neighbor
652  (active_neighbor_children, elem);
653 
654  std::vector<const Elem *>::const_iterator
655  child_it = active_neighbor_children.begin();
656  const std::vector<const Elem *>::const_iterator
657  child_end = active_neighbor_children.end();
658  for (; child_it != child_end; ++child_it)
659  {
660  const Elem * current_child = *child_it;
661  if (current_child->contains_point(p))
662  {
663  // Make sure we'll test it
664  if (!neighbor_set.count(current_child))
665  next_untested_set.insert (current_child);
666 
667  neighbor_set.insert (current_child);
668  }
669  }
670  }
671 #endif // #ifdef LIBMESH_ENABLE_AMR
672  }
673  }
674  }
675  untested_set.swap(next_untested_set);
676  next_untested_set.clear();
677  }
678 }
bool active() const
Definition: elem.h:2257
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
libmesh_assert(j)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2448
const RemoteElem * remote_elem
Definition: remote_elem.C:57
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 682 of file elem.C.

References libMesh::Elem::find_point_neighbors().

683 {
684  this->find_point_neighbors(neighbor_set, this);
685 }
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:605
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 689 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::contains_vertex_of(), end, libMesh::libmesh_assert(), libMesh::Elem::neighbor_ptr_range(), and libMesh::remote_elem.

691 {
692  libmesh_assert(start_elem);
693  libmesh_assert(start_elem->active());
694  libmesh_assert(start_elem->contains_vertex_of(this) ||
695  this->contains_vertex_of(start_elem));
696 
697  neighbor_set.clear();
698  neighbor_set.insert(start_elem);
699 
700  std::set<const Elem *> untested_set, next_untested_set;
701  untested_set.insert(start_elem);
702 
703  while (!untested_set.empty())
704  {
705  // Loop over all the elements in the patch that haven't already
706  // been tested
707  std::set<const Elem *>::const_iterator it = untested_set.begin();
708  const std::set<const Elem *>::const_iterator end = untested_set.end();
709 
710  for (; it != end; ++it)
711  {
712  const Elem * elem = *it;
713 
714  for (auto current_neighbor : elem->neighbor_ptr_range())
715  {
716  if (current_neighbor &&
717  current_neighbor != remote_elem) // we have a real neighbor on this side
718  {
719  if (current_neighbor->active()) // ... if it is active
720  {
721  if (this->contains_vertex_of(current_neighbor) // ... and touches us
722  || current_neighbor->contains_vertex_of(this))
723  {
724  // Make sure we'll test it
725  if (!neighbor_set.count(current_neighbor))
726  next_untested_set.insert (current_neighbor);
727 
728  // And add it
729  neighbor_set.insert (current_neighbor);
730  }
731  }
732 #ifdef LIBMESH_ENABLE_AMR
733  else // ... the neighbor is *not* active,
734  { // ... so add *all* neighboring
735  // active children
736  std::vector<const Elem *> active_neighbor_children;
737 
738  current_neighbor->active_family_tree_by_neighbor
739  (active_neighbor_children, elem);
740 
741  std::vector<const Elem *>::const_iterator
742  child_it = active_neighbor_children.begin();
743  const std::vector<const Elem *>::const_iterator
744  child_end = active_neighbor_children.end();
745  for (; child_it != child_end; ++child_it)
746  {
747  const Elem * current_child = *child_it;
748  if (this->contains_vertex_of(current_child) ||
749  (current_child)->contains_vertex_of(this))
750  {
751  // Make sure we'll test it
752  if (!neighbor_set.count(current_child))
753  next_untested_set.insert (current_child);
754 
755  neighbor_set.insert (current_child);
756  }
757  }
758  }
759 #endif // #ifdef LIBMESH_ENABLE_AMR
760  }
761  }
762  }
763  untested_set.swap(next_untested_set);
764  next_untested_set.clear();
765  }
766 }
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
bool contains_vertex_of(const Elem *e) const
Definition: elem.C:573
libmesh_assert(j)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
const RemoteElem * remote_elem
Definition: remote_elem.C:57
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 2724 of file elem.C.

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

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::Elem::is_linear(), and libMesh::GMVIO::write_ascii_old_impl().

2725 {
2726  switch (et)
2727  {
2728  case EDGE2:
2729  case EDGE3:
2730  case EDGE4:
2731  return EDGE2;
2732  case TRI3:
2733  case TRI6:
2734  return TRI3;
2735  case TRISHELL3:
2736  return TRISHELL3;
2737  case QUAD4:
2738  case QUAD8:
2739  case QUAD9:
2740  return QUAD4;
2741  case QUADSHELL4:
2742  case QUADSHELL8:
2743  return QUADSHELL4;
2744  case TET4:
2745  case TET10:
2746  return TET4;
2747  case HEX8:
2748  case HEX27:
2749  case HEX20:
2750  return HEX8;
2751  case PRISM6:
2752  case PRISM15:
2753  case PRISM18:
2754  return PRISM6;
2755  case PYRAMID5:
2756  case PYRAMID13:
2757  case PYRAMID14:
2758  return PYRAMID5;
2759 
2760 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2761 
2762  case INFQUAD4:
2763  case INFQUAD6:
2764  return INFQUAD4;
2765  case INFHEX8:
2766  case INFHEX16:
2767  case INFHEX18:
2768  return INFHEX8;
2769  case INFPRISM6:
2770  case INFPRISM12:
2771  return INFPRISM6;
2772 
2773 #endif
2774 
2775  default:
2776  // unknown element
2777  return INVALID_ELEM;
2778  }
2779 }
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 (Counts::iterator it = _counts.begin();
59  it != _counts.end(); ++it)
60  {
61  const std::string name(it->first);
62  const unsigned int creations = it->second.first;
63  const unsigned int destructions = it->second.second;
64 
65  oss << "| " << name << " reference count information:\n"
66  << "| Creations: " << creations << '\n'
67  << "| Destructions: " << destructions << '\n';
68  }
69 
70  oss << " ---------------------------------------------------------------------------- \n";
71 
72  return oss.str();
73 
74 #else
75 
76  return "";
77 
78 #endif
79 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
static Counts _counts
Actually holds the data.
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 (Counts::iterator it = _counts.begin();
59  it != _counts.end(); ++it)
60  {
61  const std::string name(it->first);
62  const unsigned int creations = it->second.first;
63  const unsigned int destructions = it->second.second;
64 
65  oss << "| " << name << " reference count information:\n"
66  << "| Creations: " << creations << '\n'
67  << "| Destructions: " << destructions << '\n';
68  }
69 
70  oss << " ---------------------------------------------------------------------------- \n";
71 
72  return oss.str();
73 
74 #else
75 
76  return "";
77 
78 #endif
79 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
static Counts _counts
Actually holds the data.
std::string libMesh::Elem::get_info ( ) const
inherited

Prints relevant information about the element to a string.

Definition at line 2595 of file elem.C.

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

Referenced by libMesh::Elem::is_linear(), and libMesh::Elem::print_info().

2596 {
2597  std::ostringstream oss;
2598 
2599  oss << " Elem Information" << '\n'
2600  << " id()=";
2601 
2602  if (this->valid_id())
2603  oss << this->id();
2604  else
2605  oss << "invalid";
2606 
2607 #ifdef LIBMESH_ENABLE_UNIQUE_ID
2608  oss << ", unique_id()=";
2609  if (this->valid_unique_id())
2610  oss << this->unique_id();
2611  else
2612  oss << "invalid";
2613 #endif
2614 
2615  oss << ", processor_id()=" << this->processor_id() << '\n';
2616 
2617  oss << " type()=" << Utility::enum_to_string(this->type()) << '\n'
2618  << " dim()=" << this->dim() << '\n'
2619  << " n_nodes()=" << this->n_nodes() << '\n';
2620 
2621  for (unsigned int n=0; n != this->n_nodes(); ++n)
2622  oss << " " << n << this->node_ref(n);
2623 
2624  oss << " n_sides()=" << this->n_sides() << '\n';
2625 
2626  for (unsigned int s=0; s != this->n_sides(); ++s)
2627  {
2628  oss << " neighbor(" << s << ")=";
2629  if (this->neighbor_ptr(s))
2630  oss << this->neighbor_ptr(s)->id() << '\n';
2631  else
2632  oss << "NULL\n";
2633  }
2634 
2635  oss << " hmin()=" << this->hmin()
2636  << ", hmax()=" << this->hmax() << '\n'
2637  << " volume()=" << this->volume() << '\n'
2638  << " active()=" << this->active()
2639  << ", ancestor()=" << this->ancestor()
2640  << ", subactive()=" << this->subactive()
2641  << ", has_children()=" << this->has_children() << '\n'
2642  << " parent()=";
2643  if (this->parent())
2644  oss << this->parent()->id() << '\n';
2645  else
2646  oss << "NULL\n";
2647  oss << " level()=" << this->level()
2648  << ", p_level()=" << this->p_level() << '\n'
2649 #ifdef LIBMESH_ENABLE_AMR
2650  << " refinement_flag()=" << Utility::enum_to_string(this->refinement_flag()) << '\n'
2651  << " p_refinement_flag()=" << Utility::enum_to_string(this->p_refinement_flag()) << '\n'
2652 #endif
2653 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2654  << " infinite()=" << this->infinite() << '\n';
2655  if (this->infinite())
2656  oss << " origin()=" << this->origin() << '\n'
2657 #endif
2658  ;
2659 
2660  oss << " DoFs=";
2661  for (unsigned int s=0; s != this->n_systems(); ++s)
2662  for (unsigned int v=0; v != this->n_vars(s); ++v)
2663  for (unsigned int c=0; c != this->n_comp(s,v); ++c)
2664  oss << '(' << s << '/' << v << '/' << this->dof_number(s,v,c) << ") ";
2665 
2666 
2667  return oss.str();
2668 }
bool ancestor() const
Definition: elem.C:1574
bool has_children() const
Definition: elem.h:2295
bool valid_id() const
Definition: dof_object.h:674
bool subactive() const
Definition: elem.h:2275
bool active() const
Definition: elem.h:2257
virtual ElemType type() const =0
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
unsigned int p_level() const
Definition: elem.h:2422
const Elem * parent() const
Definition: elem.h:2346
virtual Real hmin() const
Definition: elem.C:458
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:810
virtual Real volume() const
Definition: elem.C:2966
bool valid_unique_id() const
Definition: dof_object.h:682
virtual bool infinite() const =0
virtual unsigned int n_nodes() const =0
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:1967
const Node & node_ref(const unsigned int i) const
Definition: elem.h:1896
RefinementState p_refinement_flag() const
Definition: elem.h:2521
virtual unsigned int n_sides() const =0
virtual Point origin() const
Definition: elem.h:1480
std::string enum_to_string(const T e)
virtual Real hmax() const
Definition: elem.C:475
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2388
RefinementState refinement_flag() const
Definition: elem.h:2505
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:780
dof_id_type id() const
Definition: dof_object.h:632
unsigned int n_systems() const
Definition: dof_object.h:726
unique_id_type unique_id() const
Definition: dof_object.h:649
processor_id_type processor_id() const
Definition: dof_object.h:694
Node * libMesh::Elem::get_node ( const unsigned int  i) const
inherited
Returns
The pointer to local Node i.
Deprecated:
Use the less ambiguously named node_ptr() instead.

Definition at line 1913 of file elem.h.

References libMesh::Elem::node_ptr().

1914 {
1915  // This const function has incorrectly returned a non-const pointer
1916  // for years. Now that it is reimplemented in terms of the new
1917  // interface which does return a const pointer, we need to use a
1918  // const_cast to mimic the old (incorrect) behavior. This function
1919  // is now deprecated and eventually will be removed entirely,
1920  // obviating the need for this ugly cast.
1921  libmesh_deprecated();
1922  return const_cast<Node *>(this->node_ptr(i));
1923 }
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1874
unsigned int libMesh::Elem::get_node_index ( const Node node_ptr) const
inherited
Returns
The local index for the Node pointer node_ptr, or invalid_id if node_ptr is not a local node.

Definition at line 1929 of file elem.h.

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

Referenced by libMesh::ElemCutter::find_intersection_points().

1930 {
1931  for (unsigned int n=0; n != this->n_nodes(); ++n)
1932  if (this->_nodes[n] == node_ptr)
1933  return n;
1934 
1935  return libMesh::invalid_uint;
1936 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:1615
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
Definition: libmesh.h:184
virtual unsigned int n_nodes() const =0
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1874
const Node *const * libMesh::Elem::get_nodes ( ) const
inherited
Returns
A pointer to an array of local node pointers.

Definition at line 1866 of file elem.h.

References libMesh::Elem::_nodes.

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

1867 {
1868  return _nodes;
1869 }
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:1615
void libMesh::Elem::hack_p_level ( const unsigned int  p)
inherited

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

Definition at line 2606 of file elem.h.

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

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

2607 {
2608  if (p == 0)
2609  libmesh_assert_not_equal_to
2611 
2612  _p_level = cast_int<unsigned char>(p);
2613 }
unsigned char _p_level
p refinement level - the difference between the polynomial degree on this element and the minimum pol...
Definition: elem.h:1656
RefinementState p_refinement_flag() const
Definition: elem.h:2521
bool libMesh::Quad8::has_affine_map ( ) const
virtualinherited
Returns
true if the element map is definitely affine within numerical tolerances.

Reimplemented from libMesh::Elem.

Definition at line 137 of file face_quad8.C.

References libMesh::Elem::point(), and libMesh::TypeVector< T >::relative_fuzzy_equals().

Referenced by libMesh::Quad8::is_node_on_edge().

138 {
139  // make sure corners form a parallelogram
140  Point v = this->point(1) - this->point(0);
141  if (!v.relative_fuzzy_equals(this->point(2) - this->point(3)))
142  return false;
143  // make sure sides are straight
144  v /= 2;
145  if (!v.relative_fuzzy_equals(this->point(4) - this->point(0)) ||
146  !v.relative_fuzzy_equals(this->point(6) - this->point(3)))
147  return false;
148  v = (this->point(3) - this->point(0))/2;
149  if (!v.relative_fuzzy_equals(this->point(7) - this->point(0)) ||
150  !v.relative_fuzzy_equals(this->point(5) - this->point(1)))
151  return false;
152  return true;
153 }
const Point & point(const unsigned int i) const
Definition: elem.h:1809
bool libMesh::Elem::has_ancestor_children ( ) const
inherited
Returns
true if the element has any descendants other than its immediate children, false otherwise, or if AMR is disabled.

Definition at line 2309 of file elem.h.

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

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

2310 {
2311 #ifdef LIBMESH_ENABLE_AMR
2312  if (_children == libmesh_nullptr)
2313  return false;
2314  else
2315  for (auto & c : child_ref_range())
2316  if (c.has_children())
2317  return true;
2318 #endif
2319  return false;
2320 }
const class libmesh_nullptr_t libmesh_nullptr
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:1699
Elem ** _children
Pointers to this element&#39;s children.
Definition: elem.h:1627
bool libMesh::Elem::has_children ( ) const
inherited
Returns
true if the element has any children (active or not), false otherwise, or if AMR is disabled.

Definition at line 2295 of file elem.h.

References libMesh::Elem::_children, and libmesh_nullptr.

Referenced by libMesh::Elem::add_child(), libMesh::UnstructuredMesh::all_first_order(), libMesh::Elem::ancestor(), libMesh::connect_children(), libMesh::connect_families(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::Elem::get_info(), libMesh::Elem::is_linear(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_remote_elems(), 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::FEMSystem::mesh_position_set(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::Elem::remove_links_to_me(), libMesh::Elem::replace_child(), libMesh::Elem::set_child(), libMesh::Elem::subactive(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Elem::total_family_tree(), libMesh::Elem::total_family_tree_by_neighbor(), libMesh::Elem::total_family_tree_by_subneighbor(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::Elem::which_child_am_i(), and libMesh::CheckpointIO::write_remote_elem().

2296 {
2297 #ifdef LIBMESH_ENABLE_AMR
2298  if (_children == libmesh_nullptr)
2299  return false;
2300  else
2301  return true;
2302 #else
2303  return false;
2304 #endif
2305 }
const class libmesh_nullptr_t libmesh_nullptr
Elem ** _children
Pointers to this element&#39;s children.
Definition: elem.h:1627
bool libMesh::DofObject::has_dofs ( const unsigned int  s = libMesh::invalid_uint) const
inherited
Returns
true if any system has variables which have been assigned, false otherwise.

Definition at line 855 of file dof_object.h.

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

Referenced by libMesh::DofMap::old_dof_indices(), libMesh::DofMap::reinit(), and libMesh::DofObject::set_id().

856 {
857  if (sys == libMesh::invalid_uint)
858  {
859  for (unsigned int s=0; s<this->n_systems(); s++)
860  if (this->n_vars(s))
861  return true;
862  }
863 
864  else
865  {
866  libmesh_assert_less (sys, this->n_systems());
867 
868  if (this->n_vars(sys))
869  return true;
870  }
871 
872  return false;
873 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
Definition: libmesh.h:184
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
ImplicitSystem & sys
unsigned int n_systems() const
Definition: dof_object.h:726
bool libMesh::Elem::has_neighbor ( const Elem elem) const
inherited
Returns
true if the element elem in question is a neighbor of this element, false otherwise.

Definition at line 2010 of file elem.h.

References libMesh::Elem::neighbor_ptr_range().

Referenced by libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::family_tree_by_neighbor(), libMesh::Elem::family_tree_by_subneighbor(), 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(), libMesh::Elem::on_boundary(), libMesh::Elem::total_family_tree_by_neighbor(), and libMesh::Elem::total_family_tree_by_subneighbor().

2011 {
2012  for (auto n : this->neighbor_ptr_range())
2013  if (n == elem)
2014  return true;
2015 
2016  return false;
2017 }
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Returns a range with all neighbors of an element, usable in range-based for loops.
Definition: elem.h:2855
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 1104 of file elem.C.

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

Referenced by libMesh::Elem::active_family_tree_by_topological_neighbor(), and libMesh::MeshRefinement::has_topological_neighbor().

1108 {
1109  // First see if this is a normal "interior" neighbor
1110  if (has_neighbor(elem))
1111  return true;
1112 
1113  for (auto n : this->side_index_range())
1114  if (this->topological_neighbor(n, mesh, point_locator, pb))
1115  return true;
1116 
1117  return false;
1118 }
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2083
MeshBase & mesh
const Elem * topological_neighbor(const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
Definition: elem.C:1067
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2010
Real libMesh::Elem::hmax ( ) const
virtualinherited
Returns
The maximum vertex separation for the element.

Definition at line 475 of file elem.C.

References std::max(), libMesh::Elem::n_vertices(), libMesh::TypeVector< T >::norm_sq(), libMesh::Elem::point(), and libMesh::Real.

Referenced by libMesh::DiscontinuityMeasure::boundary_side_integration(), libMesh::KellyErrorEstimator::boundary_side_integration(), libMesh::OldSolutionValue< 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(), libMesh::Elem::is_vertex_on_child(), libMesh::PointLocatorBase::locate_node(), and libMesh::Elem::point_test().

476 {
477  Real h_max=0;
478 
479  for (unsigned int n_outer=0; n_outer<this->n_vertices(); n_outer++)
480  for (unsigned int n_inner=n_outer+1; n_inner<this->n_vertices(); n_inner++)
481  {
482  const Point diff = (this->point(n_outer) - this->point(n_inner));
483 
484  h_max = std::max(h_max, diff.norm_sq());
485  }
486 
487  return std::sqrt(h_max);
488 }
long double max(long double a, double b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Point & point(const unsigned int i) const
Definition: elem.h:1809
virtual unsigned int n_vertices() const =0
Real libMesh::Elem::hmin ( ) const
virtualinherited
Returns
The minimum vertex separation for the element.

Definition at line 458 of file elem.C.

References std::max(), std::min(), libMesh::Elem::n_vertices(), libMesh::TypeVector< T >::norm_sq(), libMesh::Elem::point(), and libMesh::Real.

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

459 {
461 
462  for (unsigned int n_outer=0; n_outer<this->n_vertices(); n_outer++)
463  for (unsigned int n_inner=n_outer+1; n_inner<this->n_vertices(); n_inner++)
464  {
465  const Point diff = (this->point(n_outer) - this->point(n_inner));
466 
467  h_min = std::min(h_min, diff.norm_sq());
468  }
469 
470  return std::sqrt(h_min);
471 }
long double max(long double a, double b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Point & point(const unsigned int i) const
Definition: elem.h:1809
virtual unsigned int n_vertices() const =0
long double min(long double a, double b)
dof_id_type libMesh::DofObject::id ( ) const
inherited
Returns
The id for this DofObject

Definition at line 632 of file dof_object.h.

References libMesh::DofObject::_id, libMesh::libmesh_assert(), and libMesh::DofObject::valid_id().

Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::BoundaryInfo::_find_id_maps(), 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::RBConstruction::add_scaled_matrix_and_vector(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), assemble_ellipticdg(), libMesh::ParmetisPartitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEMap::compute_single_point_map(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::UnstructuredMesh::create_submesh(), libMesh::ReplicatedMesh::delete_elem(), libMesh::DistributedMesh::delete_elem(), libMesh::ReplicatedMesh::delete_node(), libMesh::DistributedMesh::delete_node(), libMesh::MeshBase::detect_interior_parents(), libMesh::DTKAdapter::DTKAdapter(), libMesh::UNVIO::elements_out(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), 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::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::get_local_constraints(), libMesh::ParmetisPartitioner::initialize(), libMesh::TreeNode< N >::insert(), libMesh::ReplicatedMesh::insert_elem(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_node(), libMesh::FE< Dim, T >::inverse_map(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), LinearElasticityWithContact::move_mesh(), libMesh::Elem::node_id(), libMesh::VTKIO::nodes_to_vtk(), libMesh::CompareElemIdsByLevel::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::BoundaryInfo::operator=(), libMesh::Parallel::Packing< const Node * >::pack(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::MetisPartitioner::partition_range(), libMesh::SFCPartitioner::partition_range(), libMesh::DofObject::print_dof_info(), libMesh::DistributedMesh::query_elem_ptr(), libMesh::DistributedMesh::query_node_ptr(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::AbaqusIO::read_elements(), libMesh::DistributedMesh::renumber_elem(), libMesh::DistributedMesh::renumber_node(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::DofMap::scatter_constraints(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::MeshTools::Modification::smooth(), libMesh::ReplicatedMesh::stitching_helper(), 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(), MixedDimensionMeshTest::testPointLocatorTree(), DofObjectTest< Node >::testSetId(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::CheckpointIO::write_connectivity(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::CheckpointIO::write_nodes(), libMesh::CheckpointIO::write_remote_elem(), and libMesh::XdrIO::write_serialized_connectivity().

633 {
634  libmesh_assert (this->valid_id());
635  return _id;
636 }
bool valid_id() const
Definition: dof_object.h:674
dof_id_type _id
The id of the DofObject.
Definition: dof_object.h:419
libmesh_assert(j)
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
protectedinherited

Increments the construction counter.

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

Definition at line 185 of file reference_counter.h.

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

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

186 {
187  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188  std::pair<unsigned int, unsigned int> & p = _counts[name];
189 
190  p.first++;
191 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
static Counts _counts
Actually holds the data.
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
protectedinherited

Increments the construction counter.

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

Definition at line 185 of file reference_counter.h.

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

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

186 {
187  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188  std::pair<unsigned int, unsigned int> & p = _counts[name];
189 
190  p.first++;
191 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
static Counts _counts
Actually holds the data.
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
protectedinherited

Increments the destruction counter.

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

Definition at line 198 of file reference_counter.h.

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

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

199 {
200  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
201  std::pair<unsigned int, unsigned int> & p = _counts[name];
202 
203  p.second++;
204 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
static Counts _counts
Actually holds the data.
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
protectedinherited

Increments the destruction counter.

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

Definition at line 198 of file reference_counter.h.

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

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

199 {
200  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
201  std::pair<unsigned int, unsigned int> & p = _counts[name];
202 
203  p.second++;
204 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
static Counts _counts
Actually holds the data.
virtual bool libMesh::Face::infinite ( ) const
virtualinherited
Returns
false. All classes derived from Face are finite elements.

Implements libMesh::Elem.

Reimplemented in libMesh::libmesh_final< T >.

Definition at line 82 of file face.h.

82 { return false; }
const Elem * libMesh::Elem::interior_parent ( ) const
inherited
Returns
The higher-dimensional Elem for which this Elem is a face.

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

This method is not safe to call if this->dim() == LIBMESH_DIM; in such cases no data storage for an interior parent pointer has been allocated.

Definition at line 951 of file elem.C.

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

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

952 {
953  // interior parents make no sense for full-dimensional elements.
954  libmesh_assert_less (this->dim(), LIBMESH_DIM);
955 
956  // they USED TO BE only good for level-0 elements, but we now
957  // support keeping interior_parent() valid on refined boundary
958  // elements.
959  // if (this->level() != 0)
960  // return this->parent()->interior_parent();
961 
962  // We store the interior_parent pointer after both the parent
963  // neighbor and neighbor pointers
964  Elem * interior_p = _elemlinks[1+this->n_sides()];
965 
966  // If we have an interior_parent, we USED TO assume it was a
967  // one-higher-dimensional interior element, but we now allow e.g.
968  // edge elements to have a 3D interior_parent with no
969  // intermediate 2D element.
970  // libmesh_assert (!interior_p ||
971  // interior_p->dim() == (this->dim()+1));
972  libmesh_assert (!interior_p ||
973  (interior_p == remote_elem) ||
974  (interior_p->dim() > this->dim()));
975 
976  // We require consistency between AMR of interior and of boundary
977  // elements
978  if (interior_p && (interior_p != remote_elem))
979  libmesh_assert_less_equal (interior_p->level(), this->level());
980 
981  return interior_p;
982 }
libmesh_assert(j)
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:1621
virtual unsigned int n_sides() const =0
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2388
const RemoteElem * remote_elem
Definition: remote_elem.C:57
Elem * libMesh::Elem::interior_parent ( )
inherited

Definition at line 986 of file elem.C.

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

987 {
988  // See the const version for comments
989  libmesh_assert_less (this->dim(), LIBMESH_DIM);
990  Elem * interior_p = _elemlinks[1+this->n_sides()];
991 
992  libmesh_assert (!interior_p ||
993  (interior_p == remote_elem) ||
994  (interior_p->dim() > this->dim()));
995  if (interior_p && (interior_p != remote_elem))
996  libmesh_assert_less_equal (interior_p->level(), this->level());
997 
998  return interior_p;
999 }
libmesh_assert(j)
Elem ** _elemlinks
Pointers to this element&#39;s parent and neighbors, and for lower-dimensional elements&#39; interior_parent...
Definition: elem.h:1621
virtual unsigned int n_sides() const =0
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2388
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::DofObject::invalidate ( )
inherited

Invalidates all the indices for this DofObject.

Definition at line 588 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().

589 {
590  this->invalidate_dofs ();
591  this->invalidate_id ();
592  this->invalidate_processor_id ();
593 }
void invalidate_id()
Sets the id to invalid_id.
Definition: dof_object.h:572
void invalidate_processor_id()
Sets the processor id to invalid_processor_id.
Definition: dof_object.h:580
void invalidate_dofs(const unsigned int sys_num=libMesh::invalid_uint)
Sets all degree of freedom numbers to invalid_id.
Definition: dof_object.h:552
void libMesh::DofObject::invalidate_dofs ( const unsigned int  sys_num = libMesh::invalid_uint)
inherited

Sets all degree of freedom numbers to invalid_id.

Definition at line 552 of file dof_object.h.

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

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

553 {
554  // If the user does not specify the system number...
555  if (sys_num >= this->n_systems())
556  {
557  for (unsigned int s=0; s<this->n_systems(); s++)
558  for (unsigned int vg=0; vg<this->n_var_groups(s); vg++)
559  if (this->n_comp_group(s,vg))
560  this->set_vg_dof_base(s,vg,invalid_id);
561  }
562  // ...otherwise invalidate the dofs for all systems
563  else
564  for (unsigned int vg=0; vg<this->n_var_groups(sys_num); vg++)
565  if (this->n_comp_group(sys_num,vg))
566  this->set_vg_dof_base(sys_num,vg,invalid_id);
567 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:793
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:902
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:735
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:324
unsigned int n_systems() const
Definition: dof_object.h:726
void libMesh::DofObject::invalidate_id ( )
inherited

Sets the id to invalid_id.

Definition at line 572 of file dof_object.h.

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

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

573 {
574  this->set_id (invalid_id);
575 }
dof_id_type & set_id()
Definition: dof_object.h:641
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:324
void libMesh::DofObject::invalidate_processor_id ( )
inherited

Sets the processor id to invalid_processor_id.

Definition at line 580 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().

581 {
583 }
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:335
processor_id_type processor_id() const
Definition: dof_object.h:694
bool libMesh::Elem::is_ancestor_of ( const Elem descendant) const
inherited
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 2325 of file elem.h.

References libMesh::Elem::parent().

Referenced by libMesh::Elem::family_tree_by_subneighbor(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::is_linear(), libMesh::Elem::make_links_to_me_local(), and libMesh::Elem::total_family_tree_by_subneighbor().

2330 {
2331 #ifdef LIBMESH_ENABLE_AMR
2332  const Elem * e = descendant;
2333  while (e)
2334  {
2335  if (this == e)
2336  return true;
2337  e = e->parent();
2338  }
2339 #endif
2340  return false;
2341 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
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 1665 of file elem.C.

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

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

1667 {
1668  libmesh_assert_less (c, this->n_children());
1669  libmesh_assert_less (e, this->n_edges());
1670 
1671  UniquePtr<const Elem> my_edge = this->build_edge_ptr(e);
1672  UniquePtr<const Elem> child_edge = this->build_edge_ptr(e);
1673 
1674  // We're assuming that an overlapping child edge has the same
1675  // number and orientation as its parent
1676  return (child_edge->node_id(0) == my_edge->node_id(0) ||
1677  child_edge->node_id(1) == my_edge->node_id(1));
1678 }
virtual unsigned int n_edges() const =0
virtual unsigned int n_children() const =0
virtual UniquePtr< Elem > build_edge_ptr(const unsigned int i)=0
bool libMesh::Quad::is_child_on_side ( const unsigned int  c,
const unsigned int  s 
) const
virtualinherited
Returns
true if the specified child is on the specified side.

Implements libMesh::Elem.

Definition at line 98 of file face_quad.C.

References libMesh::Quad::n_children(), and libMesh::Quad::n_sides().

Referenced by libMesh::Quad::n_children().

100 {
101  libmesh_assert_less (c, this->n_children());
102  libmesh_assert_less (s, this->n_sides());
103 
104  // A quad's children and nodes don't share the same ordering:
105  // child 2 and 3 are swapped;
106  unsigned int n = (c < 2) ? c : 5-c;
107  return (n == s || n == (s+1)%4);
108 }
virtual unsigned int n_children() const libmesh_override
Definition: face_quad.h:100
virtual unsigned int n_sides() const libmesh_override
Definition: face_quad.h:85
bool libMesh::Quad8::is_edge ( const unsigned int  i) const
virtualinherited
Returns
true if the specified (local) node number is an edge.

Implements libMesh::Elem.

Definition at line 113 of file face_quad8.C.

Referenced by libMesh::Quad8::n_sub_elem().

114 {
115  if (i < 4)
116  return false;
117  return true;
118 }
virtual bool libMesh::Face::is_edge_on_side ( const unsigned int  e,
const unsigned int  s 
) const
virtualinherited

is_edge_on_side is trivial in 2D.

Implements libMesh::Elem.

Definition at line 72 of file face.h.

74  { return (e == s); }
bool libMesh::Quad8::is_face ( const unsigned int  i) const
virtualinherited
Returns
true if the specified (local) node number is a face.

Implements libMesh::Elem.

Definition at line 120 of file face_quad8.C.

Referenced by libMesh::Quad8::n_sub_elem().

121 {
122  return false;
123 }
virtual bool libMesh::Elem::is_linear ( ) const
virtualinherited
virtual bool libMesh::Elem::is_mid_infinite_edge_node ( const unsigned int  ) const
virtualinherited
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 1471 of file elem.h.

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

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

1472  { libmesh_assert (!this->infinite()); return false; }
libmesh_assert(j)
virtual bool infinite() const =0
virtual bool libMesh::Quad8::is_node_on_edge ( const unsigned int  n,
const unsigned int  e 
) const
virtualinherited
Returns
true if the specified (local) node number is on the specified edge (== is_node_on_side in 2D).

Implements libMesh::Elem.

Definition at line 101 of file face_quad8.h.

References libMesh::Quad8::has_affine_map(), and libMesh::Quad8::is_node_on_side().

103  { return this->is_node_on_side(n,e); }
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const libmesh_override
Definition: face_quad8.C:125
bool libMesh::Quad8::is_node_on_side ( const unsigned int  n,
const unsigned int  s 
) const
virtualinherited
Returns
true if the specified (local) node number is on the specified side.

Implements libMesh::Elem.

Definition at line 125 of file face_quad8.C.

References libMesh::Quad::n_sides(), and libMesh::Quad8::side_nodes_map.

Referenced by libMesh::Quad8::is_node_on_edge(), and libMesh::Quad8::n_sub_elem().

127 {
128  libmesh_assert_less (s, n_sides());
129  for (unsigned int i = 0; i != 3; ++i)
130  if (side_nodes_map[s][i] == n)
131  return true;
132  return false;
133 }
static const unsigned int side_nodes_map[4][3]
This maps the node of the side to element node numbers.
Definition: face_quad8.h:172
virtual unsigned int n_sides() const libmesh_override
Definition: face_quad.h:85
virtual bool libMesh::Elem::is_remote ( ) const
virtualinherited
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 NULL neighbor only if it lies on the physical boundary of the domain.

Reimplemented in libMesh::RemoteElem.

Definition at line 530 of file elem.h.

References libMesh::Elem::connectivity(), libMesh::Elem::dim(), libMesh::out, libMesh::Elem::type(), and libMesh::Elem::write_connectivity().

Referenced by libMesh::Elem::active_family_tree_by_side(), libMesh::Elem::family_tree_by_side(), and libMesh::Elem::make_links_to_me_local().

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

Definition at line 552 of file elem.C.

References end, libMesh::Elem::find_point_neighbors(), and libMesh::DofObject::processor_id().

Referenced by libMesh::Patch::add_semilocal_face_neighbors(), and libMesh::Patch::add_semilocal_point_neighbors().

553 {
554  std::set<const Elem *> point_neighbors;
555 
556  this->find_point_neighbors(point_neighbors);
557 
558  std::set<const Elem *>::const_iterator it = point_neighbors.begin();
559  const std::set<const Elem *>::const_iterator end = point_neighbors.end();
560 
561  for (; it != end; ++it)
562  {
563  const Elem * elem = *it;
564  if (elem->processor_id() == my_pid)
565  return true;
566  }
567 
568  return false;
569 }
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
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:605
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
bool libMesh::Quad8::is_vertex ( const unsigned int  i) const
virtualinherited
Returns
true if the specified (local) node number is a vertex.

Implements libMesh::Elem.

Definition at line 106 of file face_quad8.C.

Referenced by libMesh::Quad8::n_sub_elem().

107 {
108  if (i < 4)
109  return true;
110  return false;
111 }
virtual unsigned int libMesh::Elem::is_vertex_on_child ( unsigned  int,
unsigned int  n 
) const
virtualinherited
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 3019 of file elem.C.

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

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

3021 {
3022 #ifdef LIBMESH_ENABLE_AMR
3023 
3024  unsigned int my_n_vertices = this->n_vertices();
3025  for (unsigned int n_parent = 0; n_parent != my_n_vertices;
3026  ++n_parent)
3027  if (this->node_ptr(n_parent) == this->child_ptr(c)->node_ptr(n))
3028  return true;
3029  return false;
3030 
3031 #else
3032 
3033  // No AMR?
3034  libmesh_ignore(c);
3035  libmesh_ignore(n);
3036  libmesh_error_msg("ERROR: AMR disabled, how did we get here?");
3037  return true;
3038 
3039 #endif
3040 }
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1874
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2445
void libmesh_ignore(const T &)
virtual unsigned int n_vertices() const =0
dof_id_type libMesh::Quad8::key ( const unsigned int  s) const
virtualinherited
Returns
An id associated with the s side of this element. The id is not necessarily unique, but should be close. This is particularly useful in the MeshBase::find_neighbors() routine.

We reimplement this method here for the Quad8 since we can use the center node of each edge to provide a perfect (unique) key.

Reimplemented from libMesh::Quad.

Definition at line 157 of file face_quad8.C.

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

158 {
159  libmesh_assert_less (s, this->n_sides());
160 
161  switch (s)
162  {
163  case 0:
164 
165  return
166  this->compute_key (this->node_id(4));
167 
168  case 1:
169 
170  return
171  this->compute_key (this->node_id(5));
172 
173  case 2:
174 
175  return
176  this->compute_key (this->node_id(6));
177 
178  case 3:
179 
180  return
181  this->compute_key (this->node_id(7));
182 
183  default:
184  libmesh_error_msg("Invalid side s = " << s);
185  }
186 
187  libmesh_error_msg("We'll never get here!");
188  return 0;
189 }
virtual unsigned int n_sides() const libmesh_override
Definition: face_quad.h:85
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1831
static dof_id_type compute_key(dof_id_type n0)
Definition: elem.h:2621
dof_id_type libMesh::Quad::key ( ) const
virtualinherited
Returns
An id associated with the global node ids of this element. The id is not necessarily unique, but should be close.

Reimplemented from libMesh::Elem.

Reimplemented in libMesh::Quad9.

Definition at line 74 of file face_quad.C.

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

Referenced by libMesh::Quad8::default_order(), and libMesh::Quad::n_children().

75 {
76  return this->compute_key(this->node_id(0),
77  this->node_id(1),
78  this->node_id(2),
79  this->node_id(3));
80 }
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1831
static dof_id_type compute_key(dof_id_type n0)
Definition: elem.h:2621
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 492 of file elem.C.

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

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

494 {
495  libmesh_assert_less ( n1, this->n_vertices() );
496  libmesh_assert_less ( n2, this->n_vertices() );
497 
498  return (this->point(n1) - this->point(n2)).norm();
499 }
const Point & point(const unsigned int i) const
Definition: elem.h:1809
virtual unsigned int n_vertices() const =0
unsigned int libMesh::Elem::level ( ) const
inherited
Returns
The refinement level of the current element.

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

Definition at line 2388 of file elem.h.

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

Referenced by libMesh::MeshRefinement::_coarsen_elements(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::active_family_tree_by_topological_neighbor(), libMesh::BoundaryInfo::add_edge(), libMesh::BoundaryInfo::add_shellface(), libMesh::BoundaryInfo::add_side(), libMesh::UnstructuredMesh::all_second_order(), assemble_ellipticdg(), libMesh::BoundaryInfo::boundary_ids(), libMesh::FEAbstract::compute_node_constraints(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), 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::Elem::find_interior_neighbors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::Elem::get_info(), libMesh::Elem::interior_parent(), libMesh::Elem::is_linear(), libMesh::Elem::level(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::nullify_neighbors(), libMesh::CompareElemIdsByLevel::operator()(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::Parallel::Packing< const Elem * >::packable_size(), libMesh::BoundaryInfo::remove_edge(), libMesh::Elem::remove_links_to_me(), libMesh::BoundaryInfo::remove_shellface(), libMesh::BoundaryInfo::remove_side(), BoundaryMeshTest::sanityCheck(), libMesh::BoundaryInfo::shellface_boundary_ids(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::ReplicatedMesh::stitching_helper(), libMesh::MeshRefinement::test_level_one(), libMesh::Elem::top_parent(), libMesh::Elem::topological_neighbor(), libMesh::Parallel::Packing< Elem * >::unpack(), and libMesh::Elem::which_neighbor_am_i().

2389 {
2390 #ifdef LIBMESH_ENABLE_AMR
2391 
2392  // if I don't have a parent I was
2393  // created directly from file
2394  // or by the user, so I am a
2395  // level-0 element
2396  if (this->parent() == libmesh_nullptr)
2397  return 0;
2398 
2399  // if the parent and this element are of different
2400  // dimensionality we are at the same level as
2401  // the parent (e.g. we are the 2D side of a
2402  // 3D element)
2403  if (this->dim() != this->parent()->dim())
2404  return this->parent()->level();
2405 
2406  // otherwise we are at a level one
2407  // higher than our parent
2408  return (this->parent()->level() + 1);
2409 
2410 #else
2411 
2412  // Without AMR all elements are
2413  // at level 0.
2414  return 0;
2415 
2416 #endif
2417 }
const Elem * parent() const
Definition: elem.h:2346
const class libmesh_nullptr_t libmesh_nullptr
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2388
void libMesh::Elem::libmesh_assert_valid_neighbors ( ) const
inherited

Checks for consistent neighbor links on this element.

Definition at line 1137 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().

1138 {
1139  for (auto n : this->side_index_range())
1140  {
1141  const Elem * neigh = this->neighbor_ptr(n);
1142 
1143  // Any element might have a remote neighbor; checking
1144  // to make sure that's not inaccurate is tough.
1145  if (neigh == remote_elem)
1146  continue;
1147 
1148  if (neigh)
1149  {
1150  // Only subactive elements have subactive neighbors
1151  libmesh_assert (this->subactive() || !neigh->subactive());
1152 
1153  const Elem * elem = this;
1154 
1155  // If we're subactive but our neighbor isn't, its
1156  // return neighbor link will be to our first active
1157  // ancestor OR to our inactive ancestor of the same
1158  // level as neigh,
1159  if (this->subactive() && !neigh->subactive())
1160  {
1161  for (elem = this; !elem->active();
1162  elem = elem->parent())
1163  libmesh_assert(elem);
1164  }
1165  else
1166  {
1167  unsigned int rev = neigh->which_neighbor_am_i(elem);
1168  libmesh_assert_less (rev, neigh->n_neighbors());
1169 
1170  if (this->subactive() && !neigh->subactive())
1171  {
1172  while (neigh->neighbor_ptr(rev) != elem)
1173  {
1174  libmesh_assert(elem->parent());
1175  elem = elem->parent();
1176  }
1177  }
1178  else
1179  {
1180  const Elem * nn = neigh->neighbor_ptr(rev);
1181  libmesh_assert(nn);
1182 
1183  for (; elem != nn; elem = elem->parent())
1184  libmesh_assert(elem);
1185  }
1186  }
1187  }
1188  // If we don't have a neighbor and we're not subactive, our
1189  // ancestors shouldn't have any neighbors in this same
1190  // direction.
1191  else if (!this->subactive())
1192  {
1193  const Elem * my_parent = this->parent();
1194  if (my_parent &&
1195  // A parent with a different dimension isn't really one of
1196  // our ancestors, it means we're on a boundary mesh and this
1197  // is an interior mesh element for which we're on a side.
1198  // Nothing to test for in that case.
1199  (my_parent->dim() == this->dim()))
1200  libmesh_assert (!my_parent->neighbor_ptr(n));
1201  }
1202  }
1203 }
bool subactive() const
Definition: elem.h:2275
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2083
const Elem * parent() const
Definition: elem.h:2346
libmesh_assert(j)
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:1967
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
virtual unsigned int dim() const =0
const RemoteElem * remote_elem
Definition: remote_elem.C:57
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 1125 of file elem.C.

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

1126 {
1127  libmesh_assert(this->valid_id());
1128  for (unsigned int n=0; n != this->n_nodes(); ++n)
1129  {
1130  libmesh_assert(this->node_ptr(n));
1131  libmesh_assert(this->node_ptr(n)->valid_id());
1132  }
1133 }
bool valid_id() const
Definition: dof_object.h:674
libmesh_assert(j)
virtual unsigned int n_nodes() const =0
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1874
unsigned int libMesh::Elem::local_node ( const dof_id_type  i) const
inherited
Returns
The local id number of global Node id i, or invalid_uint if Node id i is not local.

Definition at line 1854 of file elem.h.

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

Referenced by libMesh::MeshTools::find_nodal_neighbors(), and libMesh::ReplicatedMesh::stitching_helper().

1855 {
1856  for (unsigned int n=0; n != this->n_nodes(); ++n)
1857  if (this->node_id(n) == i)
1858  return n;
1859 
1860  return libMesh::invalid_uint;
1861 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
Definition: libmesh.h:184
virtual unsigned int n_nodes() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1831
BoundingBox libMesh::Quad8::loose_bounding_box ( ) const
virtualinherited
Returns
A bounding box (not necessarily the minimal bounding box) containing the geometric element.

Reimplemented from libMesh::Elem.

Definition at line 379 of file face_quad8.C.

References std::abs(), std::max(), libMesh::Elem::point(), and libMesh::Real.

380 {
381  // This might have curved edges, or might be a curved surface in
382  // 3-space, in which case the full bounding box can be larger than
383  // the bounding box of just the nodes.
384  //
385  //
386  // FIXME - I haven't yet proven the formula below to be correct for
387  // biquadratics - RHS
388  Point pmin, pmax;
389 
390  for (unsigned d=0; d<LIBMESH_DIM; ++d)
391  {
392  Real center = this->point(0)(d);
393  for (unsigned int p=1; p != 8; ++p)
394  center += this->point(p)(d);
395  center /= 8;
396 
397  Real hd = std::abs(center - this->point(0)(d));
398  for (unsigned int p=0; p != 8; ++p)
399  hd = std::max(hd, std::abs(center - this->point(p)(d)));
400 
401  pmin(d) = center - hd;
402  pmax(d) = center + hd;
403  }
404 
405  return BoundingBox(pmin, pmax);
406 }
double abs(double a)
long double max(long double a, double b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Point & point(const unsigned int i) const
Definition: elem.h:1809
void libMesh::Elem::make_links_to_me_local ( unsigned int  n)
inherited

Resets the appropriate neighbor 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 1209 of file elem.C.

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

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

1210 {
1211  Elem * neigh = this->neighbor_ptr(n);
1212 
1213  // Don't bother calling this function unless it's necessary
1214  libmesh_assert(neigh);
1215  libmesh_assert(!neigh->is_remote());
1216 
1217  // We never have neighbors more refined than us
1218  libmesh_assert_less_equal (neigh->level(), this->level());
1219 
1220  // We never have subactive neighbors of non subactive elements
1221  libmesh_assert(!neigh->subactive() || this->subactive());
1222 
1223  // If we have a neighbor less refined than us then it must not
1224  // have any more refined descendants we could have pointed to
1225  // instead.
1226  libmesh_assert((neigh->level() == this->level()) ||
1227  (neigh->active() && !this->subactive()) ||
1228  (!neigh->has_children() && this->subactive()));
1229 
1230  // If neigh is at our level, then its family might have
1231  // remote_elem neighbor links which need to point to us
1232  // instead, but if not, then we're done.
1233  if (neigh->level() != this->level())
1234  return;
1235 
1236  // What side of neigh are we on? We can't use the usual Elem
1237  // method because we're in the middle of restoring topology
1238  const UniquePtr<Elem> my_side = this->side_ptr(n);
1239  unsigned int nn = 0;
1240  for (; nn != neigh->n_sides(); ++nn)
1241  {
1242  const UniquePtr<Elem> neigh_side = neigh->side_ptr(nn);
1243  if (*my_side == *neigh_side)
1244  break;
1245  }
1246 
1247  // we had better be on *some* side of neigh
1248  libmesh_assert_less (nn, neigh->n_sides());
1249 
1250  // Find any elements that ought to point to elem
1251  std::vector<const Elem *> neigh_family;
1252 #ifdef LIBMESH_ENABLE_AMR
1253  if (this->active())
1254  neigh->family_tree_by_side(neigh_family, nn);
1255  else if (neigh->subactive())
1256 #endif
1257  neigh_family.push_back(neigh);
1258 
1259  // And point them to elem
1260  for (std::size_t i = 0; i != neigh_family.size(); ++i)
1261  {
1262  Elem * neigh_family_member = const_cast<Elem *>(neigh_family[i]);
1263 
1264  // Only subactive elements point to other subactive elements
1265  if (this->subactive() && !neigh_family_member->subactive())
1266  continue;
1267 
1268  // Ideally, the neighbor link ought to either be correct
1269  // already or ought to be to remote_elem.
1270  //
1271  // However, if we're redistributing a newly created elem,
1272  // after an AMR step but before find_neighbors has fixed up
1273  // neighbor links, we might have an out of date neighbor
1274  // link to elem's parent instead.
1275 #ifdef LIBMESH_ENABLE_AMR
1276  libmesh_assert((neigh_family_member->neighbor_ptr(nn) &&
1277  (neigh_family_member->neighbor_ptr(nn)->active() ||
1278  neigh_family_member->neighbor_ptr(nn)->is_ancestor_of(this))) ||
1279  (neigh_family_member->neighbor_ptr(nn) == remote_elem) ||
1280  ((this->refinement_flag() == JUST_REFINED) &&
1281  (this->parent() != libmesh_nullptr) &&
1282  (neigh_family_member->neighbor_ptr(nn) == this->parent())));
1283 #else
1284  libmesh_assert((neigh_family_member->neighbor_ptr(nn) == this) ||
1285  (neigh_family_member->neighbor_ptr(nn) == remote_elem));
1286 #endif
1287 
1288  neigh_family_member->set_neighbor(nn, this);
1289  }
1290 }
bool subactive() const
Definition: elem.h:2275
bool active() const
Definition: elem.h:2257
const Elem * parent() const
Definition: elem.h:2346
const class libmesh_nullptr_t libmesh_nullptr
libmesh_assert(j)
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:1967
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1731
unsigned int level() const
Definition: elem.h:2388
RefinementState refinement_flag() const
Definition: elem.h:2505
virtual UniquePtr< Elem > side_ptr(unsigned int i)=0
const RemoteElem * remote_elem
Definition: remote_elem.C:57
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 1293 of file elem.C.

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

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

1294 {
1295  libmesh_assert_not_equal_to (this, remote_elem);
1296 
1297  // We need to have handled any children first
1298 #if defined(LIBMESH_ENABLE_AMR) && defined(DEBUG)
1299  if (this->has_children())
1300  for (auto & child : this->child_ref_range())
1301  libmesh_assert_equal_to (&child, remote_elem);
1302 #endif
1303 
1304  // Remotify any neighbor links
1305  for (auto neigh : this->neighbor_ptr_range())
1306  {
1307  if (neigh && neigh != remote_elem)
1308  {
1309  // My neighbor should never be more refined than me; my real
1310  // neighbor would have been its parent in that case.
1311  libmesh_assert_greater_equal (this->level(), neigh->level());
1312 
1313  if (this->level() == neigh->level() &&
1314  neigh->has_neighbor(this))
1315  {
1316 #ifdef LIBMESH_ENABLE_AMR
1317  // My neighbor may have descendants which also consider me a
1318  // neighbor
1319  std::vector<const Elem *> family;
1320  neigh->total_family_tree_by_neighbor (family, this);
1321 
1322  // FIXME - There's a lot of ugly const_casts here; we
1323  // may want to make remote_elem non-const and create
1324  // non-const versions of the family_tree methods
1325  for (std::size_t i=0; i != family.size(); ++i)
1326  {
1327  Elem * n = const_cast<Elem *>(family[i]);
1328  libmesh_assert (n);
1329  if (n == remote_elem)
1330  continue;
1331  unsigned int my_s = n->which_neighbor_am_i(this);
1332  libmesh_assert_less (my_s, n->n_neighbors());
1333  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1334  n->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1335  }
1336 #else
1337  unsigned int my_s = neigh->which_neighbor_am_i(this);
1338  libmesh_assert_less (my_s, neigh->n_neighbors());
1339  libmesh_assert_equal_to (neigh->neighbor_ptr(my_s), this);
1340  neigh->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1341 #endif
1342  }
1343 #ifdef LIBMESH_ENABLE_AMR
1344  // Even if my neighbor doesn't link back to me, it might
1345  // have subactive descendants which do
1346  else if (neigh->has_children())
1347  {
1348  // If my neighbor at the same level doesn't have me as a
1349  // neighbor, I must be subactive
1350  libmesh_assert(this->level() > neigh->level() ||
1351  this->subactive());
1352 
1353  // My neighbor must have some ancestor of mine as a
1354  // neighbor
1355  Elem * my_ancestor = this->parent();
1356  libmesh_assert(my_ancestor);
1357  while (!neigh->has_neighbor(my_ancestor))
1358  {
1359  my_ancestor = my_ancestor->parent();
1360  libmesh_assert(my_ancestor);
1361  }
1362 
1363  // My neighbor may have descendants which consider me a
1364  // neighbor
1365  std::vector<const Elem *> family;
1366  neigh->total_family_tree_by_subneighbor (family, my_ancestor, this);
1367 
1368  // FIXME - There's a lot of ugly const_casts here; we
1369  // may want to make remote_elem non-const and create
1370  // non-const versions of the family_tree methods
1371  for (std::size_t i=0; i != family.size(); ++i)
1372  {
1373  Elem * n = const_cast<Elem *>(family[i]);
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  }
1383 #endif
1384  }
1385  }
1386 
1387 #ifdef LIBMESH_ENABLE_AMR
1388  // Remotify parent's child link
1389  Elem * my_parent = this->parent();
1390  if (my_parent &&
1391  // As long as it's not already remote
1392  my_parent != remote_elem &&