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

#include <parallel_mesh.h>

Inheritance diagram for libMesh::ParallelMesh:
[legend]

Public Types

typedef Predicates::multi_predicate Predicate
 We need an empty, generic class to act as a predicate for this and derived mesh classes. More...
 

Public Member Functions

 ParallelMesh (const Parallel::Communicator &comm_in, unsigned char dim=1)
 
 ParallelMesh (const UnstructuredMesh &other_mesh)
 
virtual std::unique_ptr< MeshBaseclone () const override
 Virtual copy-constructor, creates a copy of this mesh. More...
 
 ~ParallelMesh ()
 
virtual void clear () override
 Clear all internal data. More...
 
virtual void redistribute () override
 Redistribute elements between processors. More...
 
virtual void update_post_partitioning () override
 Recalculate cached data after elements and nodes have been repartitioned. More...
 
virtual bool is_serial () const override
 
virtual bool is_serial_on_zero () const override
 
virtual void set_distributed () override
 Asserts that not all elements and nodes of the mesh necessarily exist on the current processor. More...
 
virtual bool is_replicated () const override
 
template<typename T >
void libmesh_assert_valid_parallel_object_ids (const mapvector< T *, dof_id_type > &) const
 Verify id, processor_id, and if applicable unique_id consistency of a parallel objects container. More...
 
virtual void libmesh_assert_valid_parallel_ids () const override
 Verify id and processor_id consistency of our elements and nodes containers. More...
 
void libmesh_assert_valid_parallel_p_levels () const
 Verify p_level consistency of our elements containers. More...
 
void libmesh_assert_valid_parallel_flags () const
 Verify refinement_flag and p_refinement_flag consistency of our elements containers. More...
 
template<typename T >
dof_id_type renumber_dof_objects (mapvector< T *, dof_id_type > &)
 Renumber a parallel objects container. More...
 
virtual void renumber_nodes_and_elements () override
 Remove nullptr elements from arrays. More...
 
virtual void allgather () override
 Gathers all elements and nodes of the mesh onto every processor. More...
 
virtual void gather_to_zero () override
 Gathers all elements and nodes of the mesh onto processor zero. More...
 
virtual void delete_remote_elements () override
 Deletes all nonlocal elements of the mesh except for "ghosts" which touch a local element, and deletes all nodes which are not part of a local or ghost element. More...
 
virtual void add_extra_ghost_elem (Elem *e)
 Inserts the element and adds it to a list of elements that should not get deleted or have their descendants deleted by delete_remote_elements. More...
 
virtual void clear_extra_ghost_elems ()
 Clears extra ghost elements. More...
 
virtual void clear_extra_ghost_elems (const std::set< Elem * > &extra_ghost_elems)
 Clears specified extra ghost elements. More...
 
const std::set< Elem * > & extra_ghost_elems () const
 Const accessor to the ghosted elements. More...
 
virtual dof_id_type n_nodes () const override
 
virtual dof_id_type max_node_id () const override
 
virtual void reserve_nodes (const dof_id_type) override
 Reserves space for a known number of nodes. More...
 
virtual dof_id_type n_elem () const override
 
virtual dof_id_type n_active_elem () const override
 
virtual dof_id_type max_elem_id () const override
 
virtual void reserve_elem (const dof_id_type) override
 Reserves space for a known number of elements. More...
 
virtual void update_parallel_id_counts () override
 Updates parallel caches so that methods like n_elem() accurately reflect changes on other processors. More...
 
virtual dof_id_type parallel_n_nodes () const override
 
dof_id_type parallel_max_node_id () const
 
virtual dof_id_type parallel_n_elem () const override
 
dof_id_type parallel_max_elem_id () const
 
virtual unique_id_type parallel_max_unique_id () const override
 
virtual const Pointpoint (const dof_id_type i) const override
 
virtual const Nodenode_ptr (const dof_id_type i) const override
 
virtual Nodenode_ptr (const dof_id_type i) override
 
virtual const Nodequery_node_ptr (const dof_id_type i) const override
 
virtual Nodequery_node_ptr (const dof_id_type i) override
 
virtual const Elemelem_ptr (const dof_id_type i) const override
 
virtual Elemelem_ptr (const dof_id_type i) override
 
virtual const Elemquery_elem_ptr (const dof_id_type i) const override
 
virtual Elemquery_elem_ptr (const dof_id_type i) override
 
virtual Nodeadd_point (const Point &p, const dof_id_type id=DofObject::invalid_id, const processor_id_type proc_id=DofObject::invalid_processor_id) override
 functions for adding /deleting nodes elements. More...
 
virtual Nodeadd_node (Node *n) override
 Add Node n to the end of the vertex array. More...
 
virtual Nodeinsert_node (Node *n) override
 Calls add_node(). More...
 
virtual void own_node (Node &n) override
 Takes ownership of node n on this partition of a distributed mesh, by setting n.processor_id() to this->processor_id(), as well as changing n.id() and moving it in the mesh's internal container to give it a new authoritative id. More...
 
virtual void delete_node (Node *n) override
 Removes the Node n from the mesh. More...
 
virtual void renumber_node (dof_id_type old_id, dof_id_type new_id) override
 Changes the id of node old_id, both by changing node(old_id)->id() and by moving node(old_id) in the mesh's internal container. More...
 
virtual Elemadd_elem (Elem *e) override
 Add elem e to the end of the element array. More...
 
virtual Eleminsert_elem (Elem *e) override
 Insert elem e to the element array, preserving its id and replacing/deleting any existing element with the same id. More...
 
virtual void delete_elem (Elem *e) override
 Removes element e from the mesh. More...
 
virtual void renumber_elem (dof_id_type old_id, dof_id_type new_id) override
 Changes the id of element old_id, both by changing elem(old_id)->id() and by moving elem(old_id) in the mesh's internal container. More...
 
virtual void fix_broken_node_and_element_numbering () override
 There is no reason for a user to ever call this function. More...
 
virtual element_iterator elements_begin () override
 Elem iterator accessor functions. More...
 
virtual const_element_iterator elements_begin () const override
 
virtual element_iterator elements_end () override
 
virtual const_element_iterator elements_end () const override
 
virtual SimpleRange< element_iteratorelement_ptr_range () override
 
virtual SimpleRange< const_element_iteratorelement_ptr_range () const override
 
virtual element_iterator active_elements_begin () override
 Active, local, and negation forms of the element iterators described above. More...
 
virtual const_element_iterator active_elements_begin () const override
 
virtual element_iterator active_elements_end () override
 
virtual const_element_iterator active_elements_end () const override
 
virtual SimpleRange< element_iteratoractive_element_ptr_range () override
 
virtual SimpleRange< const_element_iteratoractive_element_ptr_range () const override
 
virtual element_iterator ancestor_elements_begin () override
 Iterate over elements for which elem->ancestor() is true. More...
 
virtual const_element_iterator ancestor_elements_begin () const override
 
virtual element_iterator ancestor_elements_end () override
 
virtual const_element_iterator ancestor_elements_end () const override
 
virtual element_iterator subactive_elements_begin () override
 Iterate over elements for which elem->subactive() is true. More...
 
virtual const_element_iterator subactive_elements_begin () const override
 
virtual element_iterator subactive_elements_end () override
 
virtual const_element_iterator subactive_elements_end () const override
 
virtual element_iterator not_active_elements_begin () override
 
virtual const_element_iterator not_active_elements_begin () const override
 
virtual element_iterator not_active_elements_end () override
 
virtual const_element_iterator not_active_elements_end () const override
 
virtual element_iterator not_ancestor_elements_begin () override
 
virtual const_element_iterator not_ancestor_elements_begin () const override
 
virtual element_iterator not_ancestor_elements_end () override
 
virtual const_element_iterator not_ancestor_elements_end () const override
 
virtual element_iterator not_subactive_elements_begin () override
 
virtual const_element_iterator not_subactive_elements_begin () const override
 
virtual element_iterator not_subactive_elements_end () override
 
virtual const_element_iterator not_subactive_elements_end () const override
 
virtual element_iterator local_elements_begin () override
 
virtual const_element_iterator local_elements_begin () const override
 
virtual element_iterator local_elements_end () override
 
virtual const_element_iterator local_elements_end () const override
 
virtual element_iterator semilocal_elements_begin () override
 Iterate over elements for which elem->is_semilocal() is true for the current processor. More...
 
virtual const_element_iterator semilocal_elements_begin () const override
 
virtual element_iterator semilocal_elements_end () override
 
virtual const_element_iterator semilocal_elements_end () const override
 
virtual element_iterator active_semilocal_elements_begin () override
 
virtual const_element_iterator active_semilocal_elements_begin () const override
 
virtual element_iterator active_semilocal_elements_end () override
 
virtual const_element_iterator active_semilocal_elements_end () const override
 
virtual element_iterator facelocal_elements_begin () override
 Iterate over elements which are on or have a neighbor on the current processor. More...
 
virtual const_element_iterator facelocal_elements_begin () const override
 
virtual element_iterator facelocal_elements_end () override
 
virtual const_element_iterator facelocal_elements_end () const override
 
virtual element_iterator not_local_elements_begin () override
 
virtual const_element_iterator not_local_elements_begin () const override
 
virtual element_iterator not_local_elements_end () override
 
virtual const_element_iterator not_local_elements_end () const override
 
virtual element_iterator active_local_elements_begin () override
 
virtual const_element_iterator active_local_elements_begin () const override
 
virtual element_iterator active_local_elements_end () override
 
virtual const_element_iterator active_local_elements_end () const override
 
virtual SimpleRange< element_iteratoractive_local_element_ptr_range () override
 
virtual SimpleRange< const_element_iteratoractive_local_element_ptr_range () const override
 
virtual element_iterator active_not_local_elements_begin () override
 
virtual const_element_iterator active_not_local_elements_begin () const override
 
virtual element_iterator active_not_local_elements_end () override
 
virtual const_element_iterator active_not_local_elements_end () const override
 
virtual element_iterator level_elements_begin (unsigned int level) override
 Iterate over elements of a given level. More...
 
virtual const_element_iterator level_elements_begin (unsigned int level) const override
 
virtual element_iterator level_elements_end (unsigned int level) override
 
virtual const_element_iterator level_elements_end (unsigned int level) const override
 
virtual element_iterator not_level_elements_begin (unsigned int level) override
 
virtual const_element_iterator not_level_elements_begin (unsigned int level) const override
 
virtual element_iterator not_level_elements_end (unsigned int level) override
 
virtual const_element_iterator not_level_elements_end (unsigned int level) const override
 
virtual element_iterator local_level_elements_begin (unsigned int level) override
 
virtual const_element_iterator local_level_elements_begin (unsigned int level) const override
 
virtual element_iterator local_level_elements_end (unsigned int level) override
 
virtual const_element_iterator local_level_elements_end (unsigned int level) const override
 
virtual element_iterator local_not_level_elements_begin (unsigned int level) override
 
virtual const_element_iterator local_not_level_elements_begin (unsigned int level) const override
 
virtual element_iterator local_not_level_elements_end (unsigned int level) override
 
virtual const_element_iterator local_not_level_elements_end (unsigned int level) const override
 
virtual element_iterator pid_elements_begin (processor_id_type proc_id) override
 Iterate over all elements with a specified processor id. More...
 
virtual const_element_iterator pid_elements_begin (processor_id_type proc_id) const override
 
virtual element_iterator pid_elements_end (processor_id_type proc_id) override
 
virtual const_element_iterator pid_elements_end (processor_id_type proc_id) const override
 
virtual element_iterator type_elements_begin (ElemType type) override
 Iterate over all elements with a specified geometric type. More...
 
virtual const_element_iterator type_elements_begin (ElemType type) const override
 
virtual element_iterator type_elements_end (ElemType type) override
 
virtual const_element_iterator type_elements_end (ElemType type) const override
 
virtual element_iterator active_type_elements_begin (ElemType type) override
 
virtual const_element_iterator active_type_elements_begin (ElemType type) const override
 
virtual element_iterator active_type_elements_end (ElemType type) override
 
virtual const_element_iterator active_type_elements_end (ElemType type) const override
 
virtual element_iterator active_pid_elements_begin (processor_id_type proc_id) override
 
virtual const_element_iterator active_pid_elements_begin (processor_id_type proc_id) const override
 
virtual element_iterator active_pid_elements_end (processor_id_type proc_id) override
 
virtual const_element_iterator active_pid_elements_end (processor_id_type proc_id) const override
 
virtual element_iterator unpartitioned_elements_begin () override
 Iterate over unpartitioned elements in the Mesh. More...
 
virtual const_element_iterator unpartitioned_elements_begin () const override
 
virtual element_iterator unpartitioned_elements_end () override
 
virtual const_element_iterator unpartitioned_elements_end () const override
 
virtual element_iterator active_unpartitioned_elements_begin () override
 Iterate over active unpartitioned elements in the Mesh. More...
 
virtual const_element_iterator active_unpartitioned_elements_begin () const override
 
virtual element_iterator active_unpartitioned_elements_end () override
 
virtual const_element_iterator active_unpartitioned_elements_end () const override
 
virtual element_iterator active_local_subdomain_elements_begin (subdomain_id_type subdomain_id) override
 
virtual const_element_iterator active_local_subdomain_elements_begin (subdomain_id_type subdomain_id) const override
 
virtual element_iterator active_local_subdomain_elements_end (subdomain_id_type subdomain_id) override
 
virtual const_element_iterator active_local_subdomain_elements_end (subdomain_id_type subdomain_id) const override
 
virtual SimpleRange< element_iteratoractive_local_subdomain_elements_ptr_range (subdomain_id_type subdomain_id) override
 
virtual SimpleRange< const_element_iteratoractive_local_subdomain_elements_ptr_range (subdomain_id_type subdomain_id) const override
 
virtual element_iterator active_subdomain_elements_begin (subdomain_id_type subdomain_id) override
 
virtual const_element_iterator active_subdomain_elements_begin (subdomain_id_type subdomain_id) const override
 
virtual element_iterator active_subdomain_elements_end (subdomain_id_type subdomain_id) override
 
virtual const_element_iterator active_subdomain_elements_end (subdomain_id_type subdomain_id) const override
 
virtual SimpleRange< element_iteratoractive_subdomain_elements_ptr_range (subdomain_id_type subdomain_id) override
 
virtual SimpleRange< const_element_iteratoractive_subdomain_elements_ptr_range (subdomain_id_type subdomain_id) const override
 
virtual element_iterator active_subdomain_set_elements_begin (std::set< subdomain_id_type > ss) override
 
virtual const_element_iterator active_subdomain_set_elements_begin (std::set< subdomain_id_type > ss) const override
 
virtual element_iterator active_subdomain_set_elements_end (std::set< subdomain_id_type > ss) override
 
virtual const_element_iterator active_subdomain_set_elements_end (std::set< subdomain_id_type > ss) const override
 
virtual SimpleRange< element_iteratoractive_subdomain_set_elements_ptr_range (std::set< subdomain_id_type > ss) override
 
virtual SimpleRange< const_element_iteratoractive_subdomain_set_elements_ptr_range (std::set< subdomain_id_type > ss) const override
 
virtual element_iterator ghost_elements_begin () override
 Iterate over "ghost" elements in the Mesh. More...
 
virtual const_element_iterator ghost_elements_begin () const override
 
virtual element_iterator ghost_elements_end () override
 
virtual const_element_iterator ghost_elements_end () const override
 
virtual element_iterator evaluable_elements_begin (const DofMap &dof_map, unsigned int var_num=libMesh::invalid_uint) override
 Iterate over elements in the Mesh where the solution (as distributed by the given DofMap) can be evaluated, for the given variable var_num, or for all variables by default. More...
 
virtual const_element_iterator evaluable_elements_begin (const DofMap &dof_map, unsigned int var_num=libMesh::invalid_uint) const override
 
virtual element_iterator evaluable_elements_end (const DofMap &dof_map, unsigned int var_num=libMesh::invalid_uint) override
 
virtual const_element_iterator evaluable_elements_end (const DofMap &dof_map, unsigned int var_num=libMesh::invalid_uint) const override
 
virtual element_iterator flagged_elements_begin (unsigned char rflag) override
 Iterate over all elements with a specified refinement flag. More...
 
virtual const_element_iterator flagged_elements_begin (unsigned char rflag) const override
 
virtual element_iterator flagged_elements_end (unsigned char rflag) override
 
virtual const_element_iterator flagged_elements_end (unsigned char rflag) const override
 
virtual element_iterator flagged_pid_elements_begin (unsigned char rflag, processor_id_type pid) override
 Iterate over all elements with a specified refinement flag on a specified processor. More...
 
virtual const_element_iterator flagged_pid_elements_begin (unsigned char rflag, processor_id_type pid) const override
 
virtual element_iterator flagged_pid_elements_end (unsigned char rflag, processor_id_type pid) override
 
virtual const_element_iterator flagged_pid_elements_end (unsigned char rflag, processor_id_type pid) const override
 
virtual node_iterator nodes_begin () override
 Node iterator accessor functions. More...
 
virtual const_node_iterator nodes_begin () const override
 
virtual node_iterator nodes_end () override
 
virtual const_node_iterator nodes_end () const override
 
virtual SimpleRange< node_iteratornode_ptr_range () override
 
virtual SimpleRange< const_node_iteratornode_ptr_range () const override
 
virtual node_iterator active_nodes_begin () override
 Iterate over only the active nodes in the Mesh. More...
 
virtual const_node_iterator active_nodes_begin () const override
 
virtual node_iterator active_nodes_end () override
 
virtual const_node_iterator active_nodes_end () const override
 
virtual node_iterator local_nodes_begin () override
 Iterate over local nodes (nodes whose processor_id() matches the current processor). More...
 
virtual const_node_iterator local_nodes_begin () const override
 
virtual node_iterator local_nodes_end () override
 
virtual const_node_iterator local_nodes_end () const override
 
virtual SimpleRange< node_iteratorlocal_node_ptr_range () override
 
virtual SimpleRange< const_node_iteratorlocal_node_ptr_range () const override
 
virtual node_iterator pid_nodes_begin (processor_id_type proc_id) override
 Iterate over nodes with processor_id() == proc_id. More...
 
virtual const_node_iterator pid_nodes_begin (processor_id_type proc_id) const override
 
virtual node_iterator pid_nodes_end (processor_id_type proc_id) override
 
virtual const_node_iterator pid_nodes_end (processor_id_type proc_id) const override
 
virtual node_iterator bid_nodes_begin (boundary_id_type bndry_id) override
 Iterate over nodes for which BoundaryInfo::has_boundary_id(node, bndry_id) is true. More...
 
virtual const_node_iterator bid_nodes_begin (boundary_id_type bndry_id) const override
 
virtual node_iterator bid_nodes_end (boundary_id_type bndry_id) override
 
virtual const_node_iterator bid_nodes_end (boundary_id_type bndry_id) const override
 
virtual node_iterator bnd_nodes_begin () override
 Iterate over nodes for which BoundaryInfo::n_boundary_ids(node) > 0. More...
 
virtual const_node_iterator bnd_nodes_begin () const override
 
virtual node_iterator bnd_nodes_end () override
 
virtual const_node_iterator bnd_nodes_end () const override
 
virtual node_iterator evaluable_nodes_begin (const DofMap &dof_map, unsigned int var_num=libMesh::invalid_uint) override
 Iterate over nodes in the Mesh where the solution (as distributed by the given DofMap) can be evaluated, for the given variable var_num, or for all variables by default. More...
 
virtual const_node_iterator evaluable_nodes_begin (const DofMap &dof_map, unsigned int var_num=libMesh::invalid_uint) const override
 
virtual node_iterator evaluable_nodes_end (const DofMap &dof_map, unsigned int var_num=libMesh::invalid_uint) override
 
virtual const_node_iterator evaluable_nodes_end (const DofMap &dof_map, unsigned int var_num=libMesh::invalid_uint) const override
 
virtual void read (const std::string &name, void *mesh_data=nullptr, bool skip_renumber_nodes_and_elements=false, bool skip_find_neighbors=false) override
 Reads the file specified by name. More...
 
virtual void write (const std::string &name) override
 Write the file specified by name. More...
 
void write (const std::string &name, const std::vector< Number > &values, const std::vector< std::string > &variable_names)
 Write to the file specified by name. More...
 
virtual void all_first_order () override
 Converts a mesh with higher-order elements into a mesh with linear elements. More...
 
virtual void all_second_order (const bool full_ordered=true) override
 Converts a (conforming, non-refined) mesh with linear elements into a mesh with second-order elements. More...
 
void create_pid_mesh (UnstructuredMesh &pid_mesh, const processor_id_type pid) const
 Generates a new mesh containing all the elements which are assigned to processor pid. More...
 
void create_submesh (UnstructuredMesh &new_mesh, const const_element_iterator &it, const const_element_iterator &it_end) const
 Constructs a mesh called "new_mesh" from the current mesh by iterating over the elements between it and it_end and adding them to the new mesh. More...
 
virtual void copy_nodes_and_elements (const UnstructuredMesh &other_mesh, const bool skip_find_neighbors=false, dof_id_type element_id_offset=0, dof_id_type node_id_offset=0, unique_id_type unique_id_offset=0)
 Deep copy of nodes and elements from another unstructured mesh class (used by subclass copy constructors and by mesh merging operations) More...
 
virtual void find_neighbors (const bool reset_remote_elements=false, const bool reset_current_list=true) override
 Other functions from MeshBase requiring re-definition. More...
 
virtual bool contract () override
 Delete subactive (i.e. More...
 
virtual std::unique_ptr< Partitioner > & partitioner ()
 A partitioner to use at each prepare_for_use() More...
 
const BoundaryInfoget_boundary_info () const
 The information about boundary ids on the mesh. More...
 
BoundaryInfoget_boundary_info ()
 Writable information about boundary ids on the mesh. More...
 
bool is_prepared () const
 
unsigned int mesh_dimension () const
 
void set_mesh_dimension (unsigned char d)
 Resets the logical dimension of the mesh. More...
 
const std::set< unsigned char > & elem_dimensions () const
 
void set_elem_dimensions (const std::set< unsigned char > &elem_dims)
 Most of the time you should not need to call this, as the element dimensions will be set automatically by a call to cache_elem_dims(), therefore only call this if you know what you're doing. More...
 
unsigned int spatial_dimension () const
 
void set_spatial_dimension (unsigned char d)
 Sets the "spatial dimension" of the Mesh. More...
 
dof_id_type n_nodes_on_proc (const processor_id_type proc) const
 
dof_id_type n_local_nodes () const
 
dof_id_type n_unpartitioned_nodes () const
 
unique_id_type next_unique_id ()
 
void set_next_unique_id (unique_id_type id)
 Sets the next unique id to be used. More...
 
dof_id_type n_elem_on_proc (const processor_id_type proc) const
 
dof_id_type n_local_elem () const
 
dof_id_type n_unpartitioned_elem () const
 
dof_id_type n_active_elem_on_proc (const processor_id_type proc) const
 
dof_id_type n_active_local_elem () const
 
dof_id_type n_sub_elem () const
 
dof_id_type n_active_sub_elem () const
 Same as n_sub_elem(), but only counts active elements. More...
 
virtual const Nodenode_ref (const dof_id_type i) const
 
virtual Nodenode_ref (const dof_id_type i)
 
virtual const Nodenode (const dof_id_type i) const
 
virtual Nodenode (const dof_id_type i)
 
virtual const Elemelem_ref (const dof_id_type i) const
 
virtual Elemelem_ref (const dof_id_type i)
 
virtual const Elemelem (const dof_id_type i) const
 
virtual Elemelem (const dof_id_type i)
 
virtual const Elemquery_elem (const dof_id_type i) const
 
virtual Elemquery_elem (const dof_id_type i)
 
ElemMappingType default_mapping_type () const
 Returns the default master space to physical space mapping basis functions to be used on newly added elements. More...
 
void set_default_mapping_type (const ElemMappingType type)
 Set the default master space to physical space mapping basis functions to be used on newly added elements. More...
 
unsigned char default_mapping_data () const
 Returns any default data value used by the master space to physical space mapping. More...
 
void set_default_mapping_data (const unsigned char data)
 Set the default master space to physical space mapping basis functions to be used on newly added elements. More...
 
unsigned int add_elem_integer (const std::string &name, bool allocate_data=true)
 Register an integer datum (of type dof_id_type) to be added to each element in the mesh. More...
 
std::vector< unsigned intadd_elem_integers (const std::vector< std::string > &names, bool allocate_data=true)
 Register integer data (of type dof_id_type) to be added to each element in the mesh, one string name for each new integer. More...
 
unsigned int get_elem_integer_index (const std::string &name) const
 
bool has_elem_integer (const std::string &name) const
 
const std::string & get_elem_integer_name (unsigned int i) const
 
unsigned int n_elem_integers () const
 
template<typename T >
unsigned int add_elem_datum (const std::string &name, bool allocate_data=true)
 Register a datum (of type T) to be added to each element in the mesh. More...
 
template<typename T >
std::vector< unsigned intadd_elem_data (const std::vector< std::string > &names, bool allocate_data=true)
 Register data (of type T) to be added to each element in the mesh. More...
 
unsigned int add_node_integer (const std::string &name, bool allocate_data=true)
 Register an integer datum (of type dof_id_type) to be added to each node in the mesh. More...
 
std::vector< unsigned intadd_node_integers (const std::vector< std::string > &names, bool allocate_data=true)
 Register integer data (of type dof_id_type) to be added to each node in the mesh. More...
 
unsigned int get_node_integer_index (const std::string &name) const
 
bool has_node_integer (const std::string &name) const
 
const std::string & get_node_integer_name (unsigned int i) const
 
unsigned int n_node_integers () const
 
template<typename T >
unsigned int add_node_datum (const std::string &name, bool allocate_data=true)
 Register a datum (of type T) to be added to each node in the mesh. More...
 
template<typename T >
std::vector< unsigned intadd_node_data (const std::vector< std::string > &name, bool allocate_data=true)
 Register data (of type T) to be added to each node in the mesh. More...
 
void prepare_for_use (const bool skip_renumber_nodes_and_elements=false, const bool skip_find_neighbors=false)
 Prepare a newly ecreated (or read) mesh for use. More...
 
virtual void partition (const unsigned int n_parts)
 Call the default partitioner (currently metis_partition()). More...
 
void partition ()
 
void allow_renumbering (bool allow)
 If false is passed in then this mesh will no longer be renumbered when being prepared for use. More...
 
bool allow_renumbering () const
 
void allow_remote_element_removal (bool allow)
 If false is passed in then this mesh will no longer have remote elements deleted when being prepared for use; i.e. More...
 
bool allow_remote_element_removal () const
 
void skip_noncritical_partitioning (bool skip)
 If true is passed in then the elements on this mesh will no longer be (re)partitioned, and the nodes on this mesh will only be repartitioned if they are found "orphaned" via coarsening or other removal of the last element responsible for their node/element processor id consistency. More...
 
bool skip_noncritical_partitioning () const
 
void skip_partitioning (bool skip)
 If true is passed in then nothing on this mesh will be (re)partitioned. More...
 
bool skip_partitioning () const
 
void add_ghosting_functor (GhostingFunctor &ghosting_functor)
 Adds a functor which can specify ghosting requirements for use on distributed meshes. More...
 
void add_ghosting_functor (std::shared_ptr< GhostingFunctor > ghosting_functor)
 Adds a functor which can specify ghosting requirements for use on distributed meshes. More...
 
void remove_ghosting_functor (GhostingFunctor &ghosting_functor)
 Removes a functor which was previously added to the set of ghosting functors. More...
 
std::set< GhostingFunctor * >::const_iterator ghosting_functors_begin () const
 Beginning of range of ghosting functors. More...
 
std::set< GhostingFunctor * >::const_iterator ghosting_functors_end () const
 End of range of ghosting functors. More...
 
GhostingFunctordefault_ghosting ()
 Default ghosting functor. More...
 
void subdomain_ids (std::set< subdomain_id_type > &ids) const
 Constructs a list of all subdomain identifiers in the global mesh. More...
 
subdomain_id_type n_subdomains () const
 
unsigned int n_partitions () const
 
std::string get_info () const
 
void print_info (std::ostream &os=libMesh::out) const
 Prints relevant information about the mesh. More...
 
unsigned int recalculate_n_partitions ()
 In a few (very rare) cases, the user may have manually tagged the elements with specific processor IDs by hand, without using a partitioner. More...
 
const PointLocatorBasepoint_locator () const
 
std::unique_ptr< PointLocatorBasesub_point_locator () const
 
void set_point_locator_close_to_point_tol (Real val)
 Set value used by PointLocatorBase::close_to_point_tol(). More...
 
Real get_point_locator_close_to_point_tol () const
 
void clear_point_locator ()
 Releases the current PointLocator object. More...
 
void set_count_lower_dim_elems_in_point_locator (bool count_lower_dim_elems)
 In the point locator, do we count lower dimensional elements when we refine point locator regions? This is relevant in tree-based point locators, for example. More...
 
bool get_count_lower_dim_elems_in_point_locator () const
 Get the current value of _count_lower_dim_elems_in_point_locator. More...
 
std::string & subdomain_name (subdomain_id_type id)
 
const std::string & subdomain_name (subdomain_id_type id) const
 
subdomain_id_type get_id_by_name (const std::string &name) const
 
std::map< subdomain_id_type, std::string > & set_subdomain_name_map ()
 
const std::map< subdomain_id_type, std::string > & get_subdomain_name_map () const
 
void cache_elem_dims ()
 Search the mesh and cache the different dimensions of the elements present in the mesh. More...
 
void detect_interior_parents ()
 Search the mesh for elements that have a neighboring element of dim+1 and set that element as the interior parent. More...
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Public Attributes

std::unique_ptr< BoundaryInfoboundary_info
 This class holds the boundary information. More...
 

Protected Member Functions

unsigned intset_n_partitions ()
 
void size_elem_extra_integers ()
 Size extra-integer arrays of all elements in the mesh. More...
 
void size_node_extra_integers ()
 Size extra-integer arrays of all nodes in the mesh. More...
 
std::pair< std::vector< unsigned int >, std::vector< unsigned int > > merge_extra_integer_names (const MeshBase &other)
 Merge extra-integer arrays from an other mesh. More...
 

Protected Attributes

mapvector< Node *, dof_id_type_nodes
 The vertices (spatial coordinates) of the mesh. More...
 
mapvector< Elem *, dof_id_type_elements
 The elements in the mesh. More...
 
bool _is_serial
 A boolean remembering whether we're serialized or not. More...
 
bool _is_serial_on_proc_0
 A boolean remembering whether we're serialized to proc 0 or not. More...
 
dof_id_type _n_nodes
 Cached data from the last renumber_nodes_and_elements call. More...
 
dof_id_type _n_elem
 
dof_id_type _max_node_id
 
dof_id_type _max_elem_id
 
dof_id_type _next_free_local_node_id
 Guaranteed globally unused IDs for use when adding new nodes or elements. More...
 
dof_id_type _next_free_local_elem_id
 
dof_id_type _next_free_unpartitioned_node_id
 
dof_id_type _next_free_unpartitioned_elem_id
 
unique_id_type _next_unpartitioned_unique_id
 The next available unique id for assigning ids to unpartitioned DOF objects. More...
 
std::set< Elem * > _extra_ghost_elems
 These are extra ghost elements that we want to make sure not to delete when we call delete_remote_elements() More...
 
unsigned int _n_parts
 The number of partitions the mesh has. More...
 
ElemMappingType _default_mapping_type
 The default mapping type (typically Lagrange) between master and physical space to assign to newly added elements. More...
 
unsigned char _default_mapping_data
 The default mapping data (unused with Lagrange, used for nodal weight lookup index with rational bases) to assign to newly added elements. More...
 
bool _is_prepared
 Flag indicating if the mesh has been prepared for use. More...
 
std::unique_ptr< PointLocatorBase_point_locator
 A PointLocator class for this mesh. More...
 
bool _count_lower_dim_elems_in_point_locator
 Do we count lower dimensional elements in point locator refinement? This is relevant in tree-based point locators, for example. More...
 
std::unique_ptr< Partitioner_partitioner
 A partitioner to use at each prepare_for_use(). More...
 
unique_id_type _next_unique_id
 The next available unique id for assigning ids to DOF objects. More...
 
bool _skip_noncritical_partitioning
 If this is true then no partitioning should be done with the possible exception of orphaned nodes. More...
 
bool _skip_all_partitioning
 If this is true then no partitioning should be done. More...
 
bool _skip_renumber_nodes_and_elements
 If this is true then renumbering will be kept to a minimum. More...
 
bool _allow_remote_element_removal
 If this is false then even on DistributedMesh remote elements will not be deleted during mesh preparation. More...
 
std::map< subdomain_id_type, std::string > _block_id_to_name
 This structure maintains the mapping of named blocks for file formats that support named blocks. More...
 
std::set< unsigned char > _elem_dims
 We cache the dimension of the elements present in the mesh. More...
 
unsigned char _spatial_dimension
 The "spatial dimension" of the Mesh. More...
 
std::vector< std::string > _elem_integer_names
 The array of names for integer data associated with each element in the mesh. More...
 
std::vector< std::string > _node_integer_names
 The array of names for integer data associated with each node in the mesh. More...
 
std::unique_ptr< GhostingFunctor_default_ghosting
 The default geometric GhostingFunctor, used to implement standard libMesh element ghosting behavior. More...
 
std::set< GhostingFunctor * > _ghosting_functors
 The list of all GhostingFunctor objects to be used when distributing a DistributedMesh. More...
 
std::map< GhostingFunctor *, std::shared_ptr< GhostingFunctor > > _shared_functors
 Hang on to references to any GhostingFunctor objects we were passed in shared_ptr form. More...
 
Real _point_locator_close_to_point_tol
 If nonzero, we will call PointLocatorBase::set_close_to_point_tol() on any PointLocators that we create. More...
 
const Parallel::Communicator & _communicator
 

Private Types

typedef mapvector< Elem *, dof_id_type >::veclike_iterator elem_iterator_imp
 Typedefs for the container implementation. More...
 
typedef mapvector< Elem *, dof_id_type >::const_veclike_iterator const_elem_iterator_imp
 
typedef mapvector< Node *, dof_id_type >::veclike_iterator node_iterator_imp
 Typedefs for the container implementation. More...
 
typedef mapvector< Node *, dof_id_type >::const_veclike_iterator const_node_iterator_imp
 

Detailed Description

Definition at line 34 of file parallel_mesh.h.

Member Typedef Documentation

◆ const_elem_iterator_imp

typedef mapvector<Elem *, dof_id_type>::const_veclike_iterator libMesh::DistributedMesh::const_elem_iterator_imp
privateinherited

Definition at line 601 of file distributed_mesh.h.

◆ const_node_iterator_imp

typedef mapvector<Node *, dof_id_type>::const_veclike_iterator libMesh::DistributedMesh::const_node_iterator_imp
privateinherited

Definition at line 608 of file distributed_mesh.h.

◆ elem_iterator_imp

typedef mapvector<Elem *, dof_id_type>::veclike_iterator libMesh::DistributedMesh::elem_iterator_imp
privateinherited

Typedefs for the container implementation.

In this case, it's just a std::vector<Elem *>.

Definition at line 600 of file distributed_mesh.h.

◆ node_iterator_imp

typedef mapvector<Node *, dof_id_type>::veclike_iterator libMesh::DistributedMesh::node_iterator_imp
privateinherited

Typedefs for the container implementation.

In this case, it's just a std::vector<Node *>.

Definition at line 607 of file distributed_mesh.h.

◆ Predicate

We need an empty, generic class to act as a predicate for this and derived mesh classes.

Definition at line 1209 of file mesh_base.h.

Constructor & Destructor Documentation

◆ ParallelMesh() [1/2]

libMesh::ParallelMesh::ParallelMesh ( const Parallel::Communicator &  comm_in,
unsigned char  dim = 1 
)
inlineexplicit

Definition at line 38 of file parallel_mesh.h.

40  : DistributedMesh(comm_in,dim) {}

◆ ParallelMesh() [2/2]

libMesh::ParallelMesh::ParallelMesh ( const UnstructuredMesh other_mesh)
inline

Definition at line 42 of file parallel_mesh.h.

42 : DistributedMesh(other_mesh) {}

◆ ~ParallelMesh()

libMesh::ParallelMesh::~ParallelMesh ( )
inline

Definition at line 47 of file parallel_mesh.h.

47 {}

Member Function Documentation

◆ active_element_ptr_range() [1/2]

virtual SimpleRange<const_element_iterator> libMesh::DistributedMesh::active_element_ptr_range ( ) const
inlineoverridevirtualinherited

◆ active_element_ptr_range() [2/2]

virtual SimpleRange<element_iterator> libMesh::DistributedMesh::active_element_ptr_range ( )
inlineoverridevirtualinherited

◆ active_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_elements_begin ( )
overridevirtualinherited

Active, local, and negation forms of the element iterators described above.

An "active" element is an element without children (i.e. has not been refined). A "local" element is one whose processor_id() matches the current processor.

Implements libMesh::MeshBase.

Referenced by libMesh::DistributedMesh::active_element_ptr_range().

◆ active_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_elements_end ( )
overridevirtualinherited

◆ active_local_element_ptr_range() [1/2]

virtual SimpleRange<const_element_iterator> libMesh::DistributedMesh::active_local_element_ptr_range ( ) const
inlineoverridevirtualinherited

◆ active_local_element_ptr_range() [2/2]

virtual SimpleRange<element_iterator> libMesh::DistributedMesh::active_local_element_ptr_range ( )
inlineoverridevirtualinherited

◆ active_local_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_local_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_local_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_local_elements_begin ( )
overridevirtualinherited

◆ active_local_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_local_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_local_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_local_elements_end ( )
overridevirtualinherited

◆ active_local_subdomain_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_local_subdomain_elements_begin ( subdomain_id_type  subdomain_id) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_local_subdomain_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_local_subdomain_elements_begin ( subdomain_id_type  subdomain_id)
overridevirtualinherited

◆ active_local_subdomain_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_local_subdomain_elements_end ( subdomain_id_type  subdomain_id) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_local_subdomain_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_local_subdomain_elements_end ( subdomain_id_type  subdomain_id)
overridevirtualinherited

◆ active_local_subdomain_elements_ptr_range() [1/2]

virtual SimpleRange<const_element_iterator> libMesh::DistributedMesh::active_local_subdomain_elements_ptr_range ( subdomain_id_type  subdomain_id) const
inlineoverridevirtualinherited

◆ active_local_subdomain_elements_ptr_range() [2/2]

virtual SimpleRange<element_iterator> libMesh::DistributedMesh::active_local_subdomain_elements_ptr_range ( subdomain_id_type  subdomain_id)
inlineoverridevirtualinherited

◆ active_nodes_begin() [1/2]

virtual const_node_iterator libMesh::DistributedMesh::active_nodes_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_nodes_begin() [2/2]

virtual node_iterator libMesh::DistributedMesh::active_nodes_begin ( )
overridevirtualinherited

Iterate over only the active nodes in the Mesh.

Implements libMesh::MeshBase.

◆ active_nodes_end() [1/2]

virtual const_node_iterator libMesh::DistributedMesh::active_nodes_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_nodes_end() [2/2]

virtual node_iterator libMesh::DistributedMesh::active_nodes_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_not_local_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_not_local_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_not_local_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_not_local_elements_begin ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_not_local_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_not_local_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_not_local_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_not_local_elements_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_pid_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_pid_elements_begin ( processor_id_type  proc_id) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_pid_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_pid_elements_begin ( processor_id_type  proc_id)
overridevirtualinherited

◆ active_pid_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_pid_elements_end ( processor_id_type  proc_id) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_pid_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_pid_elements_end ( processor_id_type  proc_id)
overridevirtualinherited

◆ active_semilocal_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_semilocal_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_semilocal_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_semilocal_elements_begin ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_semilocal_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_semilocal_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_semilocal_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_semilocal_elements_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_subdomain_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_subdomain_elements_begin ( subdomain_id_type  subdomain_id) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_subdomain_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_subdomain_elements_begin ( subdomain_id_type  subdomain_id)
overridevirtualinherited

◆ active_subdomain_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_subdomain_elements_end ( subdomain_id_type  subdomain_id) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_subdomain_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_subdomain_elements_end ( subdomain_id_type  subdomain_id)
overridevirtualinherited

◆ active_subdomain_elements_ptr_range() [1/2]

virtual SimpleRange<const_element_iterator> libMesh::DistributedMesh::active_subdomain_elements_ptr_range ( subdomain_id_type  subdomain_id) const
inlineoverridevirtualinherited

◆ active_subdomain_elements_ptr_range() [2/2]

virtual SimpleRange<element_iterator> libMesh::DistributedMesh::active_subdomain_elements_ptr_range ( subdomain_id_type  subdomain_id)
inlineoverridevirtualinherited

◆ active_subdomain_set_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_subdomain_set_elements_begin ( std::set< subdomain_id_type ss) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_subdomain_set_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_subdomain_set_elements_begin ( std::set< subdomain_id_type ss)
overridevirtualinherited

◆ active_subdomain_set_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_subdomain_set_elements_end ( std::set< subdomain_id_type ss) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_subdomain_set_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_subdomain_set_elements_end ( std::set< subdomain_id_type ss)
overridevirtualinherited

◆ active_subdomain_set_elements_ptr_range() [1/2]

virtual SimpleRange<const_element_iterator> libMesh::DistributedMesh::active_subdomain_set_elements_ptr_range ( std::set< subdomain_id_type ss) const
inlineoverridevirtualinherited

◆ active_subdomain_set_elements_ptr_range() [2/2]

virtual SimpleRange<element_iterator> libMesh::DistributedMesh::active_subdomain_set_elements_ptr_range ( std::set< subdomain_id_type ss)
inlineoverridevirtualinherited

◆ active_type_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_type_elements_begin ( ElemType  type) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_type_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_type_elements_begin ( ElemType  type)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_type_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_type_elements_end ( ElemType  type) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_type_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_type_elements_end ( ElemType  type)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_unpartitioned_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_unpartitioned_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_unpartitioned_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_unpartitioned_elements_begin ( )
overridevirtualinherited

Iterate over active unpartitioned elements in the Mesh.

Implements libMesh::MeshBase.

◆ active_unpartitioned_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::active_unpartitioned_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ active_unpartitioned_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::active_unpartitioned_elements_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ add_elem()

Elem * libMesh::DistributedMesh::add_elem ( Elem e)
overridevirtualinherited

Add elem e to the end of the element array.

To add an element locally, set e->processor_id() before adding it. To ensure a specific element id, call e->set_id() before adding it; only do this in parallel if you are manually keeping ids consistent.

Users should call MeshBase::prepare_for_use() after elements are added to and/or deleted from the mesh.

Implements libMesh::MeshBase.

Definition at line 436 of file distributed_mesh.C.

437 {
438  // Don't try to add nullptrs!
439  libmesh_assert(e);
440 
441  // Trying to add an existing element is a no-op
442  if (e->valid_id() && _elements[e->id()] == e)
443  return e;
444 
445  const processor_id_type elem_procid = e->processor_id();
446 
447  if (!e->valid_id())
448  {
449  // We should only be creating new ids past the end of the range
450  // of existing ids
451  libmesh_assert_greater_equal(_next_free_unpartitioned_elem_id,
452  _max_elem_id);
453  libmesh_assert_greater_equal(_next_free_local_elem_id, _max_elem_id);
454 
455  // Use the unpartitioned ids for unpartitioned elems, and
456  // temporarily for ghost elems
458  if (elem_procid == this->processor_id())
459  next_id = &_next_free_local_elem_id;
460  e->set_id (*next_id);
461  }
462 
463  {
464  // Advance next_ids up high enough that each is pointing to an
465  // unused id and any subsequent increments will still point us
466  // to unused ids
467  _max_elem_id = std::max(_max_elem_id,
468  static_cast<dof_id_type>(e->id()+1));
469 
472  ((_max_elem_id-1) / (this->n_processors() + 1) + 1) *
473  (this->n_processors() + 1) + this->n_processors();
476  ((_max_elem_id + this->n_processors() - 1) / (this->n_processors() + 1) + 1) *
477  (this->n_processors() + 1) + this->processor_id();
478 
479 #ifndef NDEBUG
480  // We need a const mapvector so we don't inadvertently create
481  // nullptr entries when testing for non-nullptr ones
482  const mapvector<Elem *, dof_id_type> & const_elements = _elements;
483 #endif
485  libmesh_assert(!const_elements[_next_free_local_elem_id]);
486  }
487 
488  // Don't try to overwrite existing elems
489  libmesh_assert (!_elements[e->id()]);
490 
491  _elements[e->id()] = e;
492 
493  // Try to make the cached elem data more accurate
494  if (elem_procid == this->processor_id() ||
495  elem_procid == DofObject::invalid_processor_id)
496  _n_elem++;
497 
498 #ifdef LIBMESH_ENABLE_UNIQUE_ID
499  if (!e->valid_unique_id())
500  {
501  if (processor_id() == e->processor_id())
502  {
503  e->set_unique_id() = _next_unique_id;
504  _next_unique_id += this->n_processors() + 1;
505  }
506  else
507  {
508  e->set_unique_id() = _next_unpartitioned_unique_id;
510  }
511  }
512 #endif
513 
514  // Unpartitioned elems should be added on every processor
515  // And shouldn't be added in the same batch as ghost elems
516  // But we might be just adding on processor 0 to
517  // broadcast later
518  // #ifdef DEBUG
519  // if (elem_procid == DofObject::invalid_processor_id)
520  // {
521  // dof_id_type elem_id = e->id();
522  // this->comm().max(elem_id);
523  // libmesh_assert_equal_to (elem_id, e->id());
524  // }
525  // #endif
526 
527  // Make sure any new element is given space for any extra integers
528  // we've requested
529  e->add_extra_integers(_elem_integer_names.size());
530 
531  // And set mapping type and data on any new element
532  e->set_mapping_type(this->default_mapping_type());
533  e->set_mapping_data(this->default_mapping_data());
534 
535  return e;
536 }

References libMesh::MeshBase::_elem_integer_names, libMesh::DistributedMesh::_elements, libMesh::DistributedMesh::_max_elem_id, libMesh::DistributedMesh::_n_elem, libMesh::DistributedMesh::_next_free_local_elem_id, libMesh::DistributedMesh::_next_free_unpartitioned_elem_id, libMesh::MeshBase::_next_unique_id, libMesh::DistributedMesh::_next_unpartitioned_unique_id, libMesh::DofObject::add_extra_integers(), libMesh::MeshBase::default_mapping_data(), libMesh::MeshBase::default_mapping_type(), libMesh::DofObject::id(), libMesh::DofObject::invalid_processor_id, libMesh::libmesh_assert(), libMesh::ParallelObject::n_processors(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::DofObject::set_id(), libMesh::Elem::set_mapping_data(), libMesh::Elem::set_mapping_type(), libMesh::DofObject::set_unique_id(), libMesh::DofObject::valid_id(), and libMesh::DofObject::valid_unique_id().

Referenced by libMesh::DistributedMesh::add_extra_ghost_elem(), and SlitMeshTest::build_mesh().

◆ add_elem_data()

template<typename T >
std::vector< unsigned int > libMesh::MeshBase::add_elem_data ( const std::vector< std::string > &  names,
bool  allocate_data = true 
)
inlineinherited

Register data (of type T) to be added to each element in the mesh.

If the mesh already has elements, data is allocated in each.

Returns
The starting index number for the new data, or for the existing data if one by the same name has already been added.

If type T is larger than dof_id_type, each datum will end up spanning multiple index values, but will be queried with the starting index number.

No type checking is done with this function! If you add data of type T, don't try to access it with a call specifying type U.

Definition at line 1992 of file mesh_base.h.

1994 {
1995  std::vector<unsigned int> returnval(names.size());
1996 
1997  const std::size_t old_size = _elem_integer_names.size();
1998 
1999  for (auto i : index_range(names))
2000  returnval[i] = this->add_elem_datum<T>(names[i], false);
2001 
2002  if (allocate_data && old_size != _elem_integer_names.size())
2003  this->size_elem_extra_integers();
2004 
2005  return returnval;
2006 }

References libMesh::MeshBase::_elem_integer_names, libMesh::index_range(), and libMesh::MeshBase::size_elem_extra_integers().

◆ add_elem_datum()

template<typename T >
unsigned int libMesh::MeshBase::add_elem_datum ( const std::string &  name,
bool  allocate_data = true 
)
inlineinherited

Register a datum (of type T) to be added to each element in the mesh.

If the mesh already has elements, data by default is allocated in each of them. This may be expensive to do repeatedly; use add_elem_data instead.

Returns
The index numbers for the new data, and/or for existing data if data by some of the same names has already been added.

If type T is larger than dof_id_type, its data will end up spanning multiple index values, but will be queried with the starting index number.

No type checking is done with this function! If you add data of type T, don't try to access it with a call specifying type U.

Definition at line 1973 of file mesh_base.h.

1975 {
1976  const std::size_t old_size = _elem_integer_names.size();
1977 
1978  unsigned int start_idx = this->add_elem_integer(name, false);
1979  unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
1980  for (unsigned int i=0; i != n_more_integers; ++i)
1981  this->add_elem_integer(name+"__"+std::to_string(i));
1982 
1983  if (allocate_data && old_size != _elem_integer_names.size())
1984  this->size_elem_extra_integers();
1985 
1986  return start_idx;
1987 }

References libMesh::MeshBase::_elem_integer_names, libMesh::MeshBase::add_elem_integer(), and libMesh::MeshBase::size_elem_extra_integers().

Referenced by ExtraIntegersTest::build_mesh().

◆ add_elem_integer()

unsigned int libMesh::MeshBase::add_elem_integer ( const std::string &  name,
bool  allocate_data = true 
)
inherited

Register an integer datum (of type dof_id_type) to be added to each element in the mesh.

If the mesh already has elements, data by default is allocated in each of them. This may be expensive to do repeatedly; use add_elem_integers instead.

Returns
The index number for the new datum, or for the existing datum if one by the same name has already been added.

Definition at line 176 of file mesh_base.C.

178 {
179  for (auto i : index_range(_elem_integer_names))
180  if (_elem_integer_names[i] == name)
181  return i;
182 
183  _elem_integer_names.push_back(name);
184  if (allocate_data)
185  this->size_elem_extra_integers();
186  return _elem_integer_names.size()-1;
187 }

References libMesh::MeshBase::_elem_integer_names, libMesh::index_range(), libMesh::Quality::name(), and libMesh::MeshBase::size_elem_extra_integers().

Referenced by libMesh::MeshBase::add_elem_datum(), ExtraIntegersTest::build_mesh(), ExtraIntegersTest::checkpoint_helper(), libMesh::CheckpointIO::read_header(), and ExtraIntegersTest::test_helper().

◆ add_elem_integers()

std::vector< unsigned int > libMesh::MeshBase::add_elem_integers ( const std::vector< std::string > &  names,
bool  allocate_data = true 
)
inherited

Register integer data (of type dof_id_type) to be added to each element in the mesh, one string name for each new integer.

If the mesh already has elements, data by default is allocated in each of them.

Returns
The index numbers for the new data, and/or for existing data if data by some of the same names has already been added.

Definition at line 191 of file mesh_base.C.

193 {
194  std::unordered_map<std::string, std::size_t> name_indices;
195  for (auto i : index_range(_elem_integer_names))
196  name_indices[_elem_integer_names[i]] = i;
197 
198  std::vector<unsigned int> returnval(names.size());
199 
200  bool added_an_integer = false;
201  for (auto i : index_range(names))
202  {
203  const std::string & name = names[i];
204  auto it = name_indices.find(name);
205  if (it != name_indices.end())
206  returnval[i] = it->second;
207  else
208  {
209  returnval[i] = _elem_integer_names.size();
210  name_indices[name] = returnval[i];
211  _elem_integer_names.push_back(name);
212  added_an_integer = true;
213  }
214  }
215 
216  if (allocate_data && added_an_integer)
217  this->size_elem_extra_integers();
218 
219  return returnval;
220 }

References libMesh::MeshBase::_elem_integer_names, libMesh::index_range(), and libMesh::Quality::name().

Referenced by MeshStitchTest::testMeshStitch().

◆ add_extra_ghost_elem()

void libMesh::DistributedMesh::add_extra_ghost_elem ( Elem e)
virtualinherited

Inserts the element and adds it to a list of elements that should not get deleted or have their descendants deleted by delete_remote_elements.

This is handy for inserting otherwise off-processor elements that you want to keep track of on this processor.

Definition at line 1475 of file distributed_mesh.C.

1476 {
1477  // First add the elem like normal
1478  add_elem(e);
1479 
1480  // Now add it to the set that won't be deleted when we call
1481  // delete_remote_elements()
1482  _extra_ghost_elems.insert(e);
1483 }

References libMesh::DistributedMesh::_extra_ghost_elems, and libMesh::DistributedMesh::add_elem().

◆ add_ghosting_functor() [1/2]

void libMesh::MeshBase::add_ghosting_functor ( GhostingFunctor ghosting_functor)
inlineinherited

Adds a functor which can specify ghosting requirements for use on distributed meshes.

Multiple ghosting functors can be added; any element which is required by any functor will be ghosted.

GhostingFunctor memory must be managed by the code which calls this function; the GhostingFunctor lifetime is expected to extend until either the functor is removed or the Mesh is destructed.

Definition at line 1089 of file mesh_base.h.

1090  { _ghosting_functors.insert(&ghosting_functor); }

References libMesh::MeshBase::_ghosting_functors.

Referenced by libMesh::DofMap::add_algebraic_ghosting_functor(), libMesh::DofMap::add_coupling_functor(), libMesh::MeshBase::add_ghosting_functor(), main(), and EquationSystemsTest::testDisableDefaultGhosting().

◆ add_ghosting_functor() [2/2]

void libMesh::MeshBase::add_ghosting_functor ( std::shared_ptr< GhostingFunctor ghosting_functor)
inlineinherited

Adds a functor which can specify ghosting requirements for use on distributed meshes.

Multiple ghosting functors can be added; any element which is required by any functor will be ghosted.

GhostingFunctor memory when using this method is managed by the shared_ptr mechanism.

Definition at line 1100 of file mesh_base.h.

1101  { _shared_functors[ghosting_functor.get()] = ghosting_functor;
1102  this->add_ghosting_functor(*ghosting_functor); }

References libMesh::MeshBase::_shared_functors, and libMesh::MeshBase::add_ghosting_functor().

◆ add_node()

Node * libMesh::DistributedMesh::add_node ( Node n)
overridevirtualinherited

Add Node n to the end of the vertex array.

Implements libMesh::MeshBase.

Definition at line 663 of file distributed_mesh.C.

664 {
665  // Don't try to add nullptrs!
666  libmesh_assert(n);
667 
668  // Trying to add an existing node is a no-op
669  if (n->valid_id() && _nodes[n->id()] == n)
670  return n;
671 
672  const processor_id_type node_procid = n->processor_id();
673 
674  if (!n->valid_id())
675  {
676  // We should only be creating new ids past the end of the range
677  // of existing ids
678  libmesh_assert_greater_equal(_next_free_unpartitioned_node_id,
679  _max_node_id);
680  libmesh_assert_greater_equal(_next_free_local_node_id, _max_node_id);
681 
682  // Use the unpartitioned ids for unpartitioned nodes,
683  // and temporarily for ghost nodes
685  if (node_procid == this->processor_id())
686  next_id = &_next_free_local_node_id;
687  n->set_id (*next_id);
688  }
689 
690  {
691  // Advance next_ids up high enough that each is pointing to an
692  // unused id and any subsequent increments will still point us
693  // to unused ids
694  _max_node_id = std::max(_max_node_id,
695  static_cast<dof_id_type>(n->id()+1));
696 
699  ((_max_node_id-1) / (this->n_processors() + 1) + 1) *
700  (this->n_processors() + 1) + this->n_processors();
703  ((_max_node_id + this->n_processors() - 1) / (this->n_processors() + 1) + 1) *
704  (this->n_processors() + 1) + this->processor_id();
705 
706 #ifndef NDEBUG
707  // We need a const mapvector so we don't inadvertently create
708  // nullptr entries when testing for non-nullptr ones
709  const mapvector<Node *,dof_id_type> & const_nodes = _nodes;
710 #endif
713  }
714 
715  // Don't try to overwrite existing nodes
716  libmesh_assert (!_nodes[n->id()]);
717 
718  _nodes[n->id()] = n;
719 
720  // Try to make the cached node data more accurate
721  if (node_procid == this->processor_id() ||
722  node_procid == DofObject::invalid_processor_id)
723  _n_nodes++;
724 
725 #ifdef LIBMESH_ENABLE_UNIQUE_ID
726  if (!n->valid_unique_id())
727  {
728  if (processor_id() == n->processor_id())
729  {
730  n->set_unique_id() = _next_unique_id;
731  _next_unique_id += this->n_processors();
732  }
733  else
734  {
735  n->set_unique_id() = _next_unpartitioned_unique_id;
737  }
738  }
739 #endif
740 
741  n->add_extra_integers(_node_integer_names.size());
742 
743  // Unpartitioned nodes should be added on every processor
744  // And shouldn't be added in the same batch as ghost nodes
745  // But we might be just adding on processor 0 to
746  // broadcast later
747  // #ifdef DEBUG
748  // if (node_procid == DofObject::invalid_processor_id)
749  // {
750  // dof_id_type node_id = n->id();
751  // this->comm().max(node_id);
752  // libmesh_assert_equal_to (node_id, n->id());
753  // }
754  // #endif
755 
756  return n;
757 }

References libMesh::DistributedMesh::_max_node_id, libMesh::DistributedMesh::_n_nodes, libMesh::DistributedMesh::_next_free_local_node_id, libMesh::DistributedMesh::_next_free_unpartitioned_node_id, libMesh::MeshBase::_next_unique_id, libMesh::DistributedMesh::_next_unpartitioned_unique_id, libMesh::MeshBase::_node_integer_names, libMesh::DistributedMesh::_nodes, libMesh::DofObject::add_extra_integers(), libMesh::DofObject::id(), libMesh::DofObject::invalid_processor_id, libMesh::libmesh_assert(), libMesh::ParallelObject::n_processors(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::DofObject::set_id(), libMesh::DofObject::set_unique_id(), libMesh::DofObject::valid_id(), and libMesh::DofObject::valid_unique_id().

Referenced by libMesh::DistributedMesh::add_point(), libMesh::DistributedMesh::insert_node(), and libMesh::DistributedMesh::own_node().

◆ add_node_data()

template<typename T >
std::vector< unsigned int > libMesh::MeshBase::add_node_data ( const std::vector< std::string > &  name,
bool  allocate_data = true 
)
inlineinherited

Register data (of type T) to be added to each node in the mesh.

If the mesh already has nodes, data by default is allocated in each.

Returns
The starting index number for the new data, or for the existing data if one by the same name has already been added.

If type T is larger than dof_id_type, its data will end up spanning multiple index values, but will be queried with the starting index number.

No type checking is done with this function! If you add data of type T, don't try to access it with a call specifying type U.

Definition at line 2030 of file mesh_base.h.

2032 {
2033  std::vector<unsigned int> returnval(names.size());
2034 
2035  const std::size_t old_size = _node_integer_names.size();
2036 
2037  for (auto i : index_range(names))
2038  returnval[i] = this->add_node_datum<T>(names[i], false);
2039 
2040  if (allocate_data && old_size != _node_integer_names.size())
2041  this->size_node_extra_integers();
2042 
2043  return returnval;
2044 }

References libMesh::MeshBase::_node_integer_names, libMesh::index_range(), and libMesh::MeshBase::size_node_extra_integers().

◆ add_node_datum()

template<typename T >
unsigned int libMesh::MeshBase::add_node_datum ( const std::string &  name,
bool  allocate_data = true 
)
inlineinherited

Register a datum (of type T) to be added to each node in the mesh.

If the mesh already has nodes, data by default is allocated in each of them. This may be expensive to do repeatedly; use add_node_data instead.

Returns
The starting index number for the new datum, or for the existing datum if one by the same name has already been added.

If type T is larger than dof_id_type, its data will end up spanning multiple index values, but will be queried with the starting index number.

No type checking is done with this function! If you add data of type T, don't try to access it with a call specifying type U.

Definition at line 2011 of file mesh_base.h.

2013 {
2014  const std::size_t old_size = _node_integer_names.size();
2015 
2016  unsigned int start_idx = this->add_node_integer(name, false);
2017  unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
2018  for (unsigned int i=0; i != n_more_integers; ++i)
2019  this->add_node_integer(name+"__"+std::to_string(i), false);
2020 
2021  if (allocate_data && old_size != _node_integer_names.size())
2022  this->size_node_extra_integers();
2023 
2024  return start_idx;
2025 }

References libMesh::MeshBase::_node_integer_names, libMesh::MeshBase::add_node_integer(), and libMesh::MeshBase::size_node_extra_integers().

Referenced by ExtraIntegersTest::build_mesh(), libMesh::DynaIO::read_mesh(), RationalMapTest< elem_type >::setUp(), and FETest< order, family, elem_type >::setUp().

◆ add_node_integer()

unsigned int libMesh::MeshBase::add_node_integer ( const std::string &  name,
bool  allocate_data = true 
)
inherited

Register an integer datum (of type dof_id_type) to be added to each node in the mesh.

If the mesh already has nodes, data by default is allocated in each of them. This may be expensive to do repeatedly; use add_node_integers instead.

Returns
The index number for the new datum, or for the existing datum if one by the same name has already been added.

Definition at line 247 of file mesh_base.C.

249 {
250  for (auto i : index_range(_node_integer_names))
251  if (_node_integer_names[i] == name)
252  return i;
253 
254  _node_integer_names.push_back(name);
255  if (allocate_data)
256  this->size_node_extra_integers();
257  return _node_integer_names.size()-1;
258 }

References libMesh::index_range(), and libMesh::Quality::name().

Referenced by libMesh::MeshBase::add_node_datum(), ExtraIntegersTest::build_mesh(), ExtraIntegersTest::checkpoint_helper(), libMesh::CheckpointIO::read_header(), RationalMapTest< elem_type >::setUp(), FETest< order, family, elem_type >::setUp(), and ExtraIntegersTest::test_helper().

◆ add_node_integers()

std::vector< unsigned int > libMesh::MeshBase::add_node_integers ( const std::vector< std::string > &  names,
bool  allocate_data = true 
)
inherited

Register integer data (of type dof_id_type) to be added to each node in the mesh.

If the mesh already has nodes, data by default is allocated in each.

Returns
The index numbers for the new data, and/or for existing data if data by some of the same names has already been added.

Definition at line 262 of file mesh_base.C.

264 {
265  std::unordered_map<std::string, std::size_t> name_indices;
266  for (auto i : index_range(_node_integer_names))
267  name_indices[_node_integer_names[i]] = i;
268 
269  std::vector<unsigned int> returnval(names.size());
270 
271  bool added_an_integer = false;
272  for (auto i : index_range(names))
273  {
274  const std::string & name = names[i];
275  auto it = name_indices.find(name);
276  if (it != name_indices.end())
277  returnval[i] = it->second;
278  else
279  {
280  returnval[i] = _node_integer_names.size();
281  name_indices[name] = returnval[i];
282  _node_integer_names.push_back(name);
283  added_an_integer = true;
284  }
285  }
286 
287  if (allocate_data && added_an_integer)
288  this->size_node_extra_integers();
289 
290  return returnval;
291 }

References libMesh::index_range(), and libMesh::Quality::name().

Referenced by MeshStitchTest::testMeshStitch().

◆ add_point()

Node * libMesh::DistributedMesh::add_point ( const Point p,
const dof_id_type  id = DofObject::invalid_id,
const processor_id_type  proc_id = DofObject::invalid_processor_id 
)
overridevirtualinherited

functions for adding /deleting nodes elements.

Implements libMesh::MeshBase.

Definition at line 625 of file distributed_mesh.C.

628 {
629  auto n_it = _nodes.find(id);
630  if (n_it != _nodes.end().it)
631  {
632  Node * n = n_it->second;
633  libmesh_assert (n);
634  libmesh_assert_equal_to (n->id(), id);
635 
636  *n = p;
637  n->processor_id() = proc_id;
638 
639  return n;
640  }
641 
642  Node * n = Node::build(p, id).release();
643  n->processor_id() = proc_id;
644 
645  return DistributedMesh::add_node(n);
646 }

References libMesh::DistributedMesh::_nodes, libMesh::DistributedMesh::add_node(), libMesh::Node::build(), libMesh::DofObject::id(), libMesh::libmesh_assert(), and libMesh::DofObject::processor_id().

Referenced by SlitMeshTest::build_mesh().

◆ all_first_order()

void libMesh::UnstructuredMesh::all_first_order ( )
overridevirtualinherited

Converts a mesh with higher-order elements into a mesh with linear elements.

For example, a mesh consisting of Tet10 will be converted to a mesh with Tet4 etc.

Prepare to identify (and then delete) a bunch of no-longer-used nodes.

If the second order element had any boundary conditions they should be transferred to the first-order element. The old boundary conditions will be removed from the BoundaryInfo data structure by insert_elem.

Implements libMesh::MeshBase.

Definition at line 860 of file unstructured_mesh.C.

861 {
862  /*
863  * when the mesh is not prepared,
864  * at least renumber the nodes and
865  * elements, so that the node ids
866  * are correct
867  */
868  if (!this->_is_prepared)
870 
871  START_LOG("all_first_order()", "Mesh");
872 
876  std::vector<bool> node_touched_by_me(this->max_node_id(), false);
877 
878  // Loop over the high-ordered elements.
879  // First make sure they _are_ indeed high-order, and then replace
880  // them with an equivalent first-order element.
881  for (auto & so_elem : element_ptr_range())
882  {
883  libmesh_assert(so_elem);
884 
885  /*
886  * build the first-order equivalent, add to
887  * the new_elements list.
888  */
889  Elem * lo_elem = Elem::build
891  (so_elem->type()), so_elem->parent()).release();
892 
893  const unsigned short n_sides = so_elem->n_sides();
894 
895  for (unsigned short s=0; s != n_sides; ++s)
896  if (so_elem->neighbor_ptr(s) == remote_elem)
897  lo_elem->set_neighbor(s, const_cast<RemoteElem *>(remote_elem));
898 
899 #ifdef LIBMESH_ENABLE_AMR
900  /*
901  * Reset the parent links of any child elements
902  */
903  if (so_elem->has_children())
904  for (unsigned int c = 0, nc = so_elem->n_children(); c != nc; ++c)
905  {
906  Elem * child = so_elem->child_ptr(c);
907  if (child != remote_elem)
908  child->set_parent(lo_elem);
909  lo_elem->add_child(child, c);
910  }
911 
912  /*
913  * Reset the child link of any parent element
914  */
915  if (so_elem->parent())
916  {
917  unsigned int c =
918  so_elem->parent()->which_child_am_i(so_elem);
919  lo_elem->parent()->replace_child(lo_elem, c);
920  }
921 
922  /*
923  * Copy as much data to the new element as makes sense
924  */
925  lo_elem->set_p_level(so_elem->p_level());
926  lo_elem->set_refinement_flag(so_elem->refinement_flag());
927  lo_elem->set_p_refinement_flag(so_elem->p_refinement_flag());
928 #endif
929 
930  libmesh_assert_equal_to (lo_elem->n_vertices(), so_elem->n_vertices());
931 
932  /*
933  * By definition the vertices of the linear and
934  * second order element are identically numbered.
935  * transfer these.
936  */
937  for (unsigned int v=0, snv=so_elem->n_vertices(); v < snv; v++)
938  {
939  lo_elem->set_node(v) = so_elem->node_ptr(v);
940  node_touched_by_me[lo_elem->node_id(v)] = true;
941  }
942 
943  /*
944  * find_neighbors relies on remote_elem neighbor links being
945  * properly maintained.
946  */
947  for (unsigned short s=0; s != n_sides; s++)
948  {
949  if (so_elem->neighbor_ptr(s) == remote_elem)
950  lo_elem->set_neighbor(s, const_cast<RemoteElem*>(remote_elem));
951  }
952 
960  (this->get_boundary_info(), so_elem, lo_elem);
961 
962  /*
963  * The new first-order element is ready.
964  * Inserting it into the mesh will replace and delete
965  * the second-order element.
966  */
967  lo_elem->set_id(so_elem->id());
968 #ifdef LIBMESH_ENABLE_UNIQUE_ID
969  lo_elem->set_unique_id() = so_elem->unique_id();
970 #endif
971  lo_elem->processor_id() = so_elem->processor_id();
972  lo_elem->subdomain_id() = so_elem->subdomain_id();
973  this->insert_elem(lo_elem);
974  }
975 
976  // Deleting nodes does not invalidate iterators, so this is safe.
977  for (const auto & node : this->node_ptr_range())
978  if (!node_touched_by_me[node->id()])
979  this->delete_node(node);
980 
981  // If crazy people applied boundary info to non-vertices and then
982  // deleted those non-vertices, we should make sure their boundary id
983  // caches are correct.
985 
986  STOP_LOG("all_first_order()", "Mesh");
987 
988  // On hanging nodes that used to also be second order nodes, we
989  // might now have an invalid nodal processor_id()
991 
992  // delete or renumber nodes if desired
993  this->prepare_for_use();
994 }

References libMesh::MeshBase::_is_prepared, libMesh::Elem::add_child(), libMesh::Elem::build(), libMesh::Elem::child_ptr(), libMesh::BoundaryInfo::copy_boundary_ids(), libMesh::MeshBase::delete_node(), libMesh::MeshBase::element_ptr_range(), libMesh::Elem::first_order_equivalent_type(), libMesh::MeshBase::get_boundary_info(), libMesh::DofObject::id(), libMesh::MeshBase::insert_elem(), libMesh::libmesh_assert(), libMesh::MeshBase::max_node_id(), libMesh::Elem::n_vertices(), libMesh::MeshBase::node(), libMesh::Elem::node_id(), libMesh::MeshBase::node_ptr_range(), libMesh::Elem::parent(), libMesh::MeshBase::prepare_for_use(), libMesh::DofObject::processor_id(), libMesh::BoundaryInfo::regenerate_id_sets(), libMesh::remote_elem, libMesh::MeshBase::renumber_nodes_and_elements(), libMesh::Elem::replace_child(), libMesh::DofObject::set_id(), libMesh::Elem::set_neighbor(), libMesh::Elem::set_node(), libMesh::Partitioner::set_node_processor_ids(), libMesh::Elem::set_p_level(), libMesh::Elem::set_p_refinement_flag(), libMesh::Elem::set_parent(), libMesh::Elem::set_refinement_flag(), libMesh::DofObject::set_unique_id(), and libMesh::Elem::subdomain_id().

◆ all_second_order()

void libMesh::UnstructuredMesh::all_second_order ( const bool  full_ordered = true)
overridevirtualinherited

Converts a (conforming, non-refined) mesh with linear elements into a mesh with second-order elements.

For example, a mesh consisting of Tet4 will be converted to a mesh with Tet10 etc.

Note
For some elements like Hex8 there exist two higher order equivalents, Hex20 and Hex27. When full_ordered is true (default), then Hex27 is built. Otherwise, Hex20 is built. The same holds obviously for Quad4, Prism6, etc.

On distributed meshes we currently only support unpartitioned meshes (where we'll add every node in sync) or completely-partitioned meshes (where we'll sync nodes later); let's keep track to make sure we're not in any in-between state.

Loop over the low-ordered elements in the elements vector. First make sure they _are indeed low-order, and then replace them with an equivalent second-order element. Don't forget to delete the low-order element, or else it will leak!

If the linear element had any boundary conditions they should be transferred to the second-order element. The old boundary conditions will be removed from the BoundaryInfo data structure by insert_elem.

Also, prepare_for_use() will reconstruct most of our neighbor links, but if we have any remote_elem links in a distributed mesh, they need to be preserved. We do that in the same loop here.

Implements libMesh::MeshBase.

Definition at line 998 of file unstructured_mesh.C.

999 {
1000  // This function must be run on all processors at once
1001  parallel_object_only();
1002 
1003  /*
1004  * when the mesh is not prepared,
1005  * at least renumber the nodes and
1006  * elements, so that the node ids
1007  * are correct
1008  */
1009  if (!this->_is_prepared)
1010  this->renumber_nodes_and_elements ();
1011 
1012  /*
1013  * If the mesh is empty
1014  * then we have nothing to do
1015  */
1016  if (!this->n_elem())
1017  return;
1018 
1019  /*
1020  * If the mesh is already second order
1021  * then we have nothing to do.
1022  * We have to test for this in a round-about way to avoid
1023  * a bug on distributed parallel meshes with more processors
1024  * than elements.
1025  */
1026  bool already_second_order = false;
1027  if (this->elements_begin() != this->elements_end() &&
1028  (*(this->elements_begin()))->default_order() != FIRST)
1029  already_second_order = true;
1030  this->comm().max(already_second_order);
1031  if (already_second_order)
1032  return;
1033 
1034  START_LOG("all_second_order()", "Mesh");
1035 
1036  /*
1037  * this map helps in identifying second order
1038  * nodes. Namely, a second-order node:
1039  * - edge node
1040  * - face node
1041  * - bubble node
1042  * is uniquely defined through a set of adjacent
1043  * vertices. This set of adjacent vertices is
1044  * used to identify already added higher-order
1045  * nodes. We are safe to use node id's since we
1046  * make sure that these are correctly numbered.
1047  */
1048  std::map<std::vector<dof_id_type>, Node *> adj_vertices_to_so_nodes;
1049 
1050  /*
1051  * for speed-up of the \p add_point() method, we
1052  * can reserve memory. Guess the number of additional
1053  * nodes for different dimensions
1054  */
1055  switch (this->mesh_dimension())
1056  {
1057  case 1:
1058  /*
1059  * in 1D, there can only be order-increase from Edge2
1060  * to Edge3. Something like 1/2 of n_nodes() have
1061  * to be added
1062  */
1063  this->reserve_nodes(static_cast<unsigned int>
1064  (1.5*static_cast<double>(this->n_nodes())));
1065  break;
1066 
1067  case 2:
1068  /*
1069  * in 2D, either refine from Tri3 to Tri6 (double the nodes)
1070  * or from Quad4 to Quad8 (again, double) or Quad9 (2.25 that much)
1071  */
1072  this->reserve_nodes(static_cast<unsigned int>
1073  (2*static_cast<double>(this->n_nodes())));
1074  break;
1075 
1076 
1077  case 3:
1078  /*
1079  * in 3D, either refine from Tet4 to Tet10 (factor = 2.5) up to
1080  * Hex8 to Hex27 (something > 3). Since in 3D there _are_ already
1081  * quite some nodes, and since we do not want to overburden the memory by
1082  * a too conservative guess, use the lower bound
1083  */
1084  this->reserve_nodes(static_cast<unsigned int>
1085  (2.5*static_cast<double>(this->n_nodes())));
1086  break;
1087 
1088  default:
1089  // Hm?
1090  libmesh_error_msg("Unknown mesh dimension " << this->mesh_dimension());
1091  }
1092 
1093 
1094 
1095  /*
1096  * form a vector that will hold the node id's of
1097  * the vertices that are adjacent to the son-th
1098  * second-order node. Pull this outside of the
1099  * loop so that silly compilers don't repeatedly
1100  * create and destroy the vector.
1101  */
1102  std::vector<dof_id_type> adjacent_vertices_ids;
1103 
1111  n_partitioned_elem = 0;
1112  const processor_id_type my_pid = this->processor_id();
1113 
1120  element_iterator
1121  it = elements_begin(),
1122  endit = elements_end();
1123 
1124  for (; it != endit; ++it)
1125  {
1126  // the linear-order element
1127  Elem * lo_elem = *it;
1128 
1129  libmesh_assert(lo_elem);
1130 
1131  // make sure it is linear order
1132  if (lo_elem->default_order() != FIRST)
1133  libmesh_error_msg("ERROR: This is not a linear element: type=" << lo_elem->type());
1134 
1135  // this does _not_ work for refined elements
1136  libmesh_assert_equal_to (lo_elem->level (), 0);
1137 
1138  const processor_id_type lo_pid = lo_elem->processor_id();
1139 
1140  if (lo_pid == DofObject::invalid_processor_id)
1142  else
1143  ++n_partitioned_elem;
1144 
1145  /*
1146  * build the second-order equivalent, add to
1147  * the new_elements list. Note that this here
1148  * is the only point where \p full_ordered
1149  * is necessary. The remaining code works well
1150  * for either type of second-order equivalent, e.g.
1151  * Hex20 or Hex27, as equivalents for Hex8
1152  */
1153  Elem * so_elem =
1155  full_ordered) ).release();
1156 
1157  libmesh_assert_equal_to (lo_elem->n_vertices(), so_elem->n_vertices());
1158 
1159 
1160  /*
1161  * By definition the vertices of the linear and
1162  * second order element are identically numbered.
1163  * transfer these.
1164  */
1165  for (unsigned int v=0, lnv=lo_elem->n_vertices(); v < lnv; v++)
1166  so_elem->set_node(v) = lo_elem->node_ptr(v);
1167 
1168  /*
1169  * Now handle the additional mid-side nodes. This
1170  * is simply handled through a map that remembers
1171  * the already-added nodes. This map maps the global
1172  * ids of the vertices (that uniquely define this
1173  * higher-order node) to the new node.
1174  * Notation: son = second-order node
1175  */
1176  const unsigned int son_begin = so_elem->n_vertices();
1177  const unsigned int son_end = so_elem->n_nodes();
1178 
1179 
1180  for (unsigned int son=son_begin; son<son_end; son++)
1181  {
1182  const unsigned int n_adjacent_vertices =
1183  so_elem->n_second_order_adjacent_vertices(son);
1184 
1185  adjacent_vertices_ids.resize(n_adjacent_vertices);
1186 
1187  for (unsigned int v=0; v<n_adjacent_vertices; v++)
1188  adjacent_vertices_ids[v] =
1189  so_elem->node_id( so_elem->second_order_adjacent_vertex(son,v) );
1190 
1191  /*
1192  * \p adjacent_vertices_ids is now in order of the current
1193  * side. sort it, so that comparisons with the
1194  * \p adjacent_vertices_ids created through other elements'
1195  * sides can match
1196  */
1197  std::sort(adjacent_vertices_ids.begin(),
1198  adjacent_vertices_ids.end());
1199 
1200 
1201  // does this set of vertices already have a mid-node added?
1202  auto pos = adj_vertices_to_so_nodes.equal_range (adjacent_vertices_ids);
1203 
1204  // no, not added yet
1205  if (pos.first == pos.second)
1206  {
1207  /*
1208  * for this set of vertices, there is no
1209  * second_order node yet. Add it.
1210  *
1211  * compute the location of the new node as
1212  * the average over the adjacent vertices.
1213  */
1214  Point new_location = this->point(adjacent_vertices_ids[0]);
1215  for (unsigned int v=1; v<n_adjacent_vertices; v++)
1216  new_location += this->point(adjacent_vertices_ids[v]);
1217 
1218  new_location /= static_cast<Real>(n_adjacent_vertices);
1219 
1220  /* Add the new point to the mesh.
1221  * If we are on a serialized mesh, then we're doing this
1222  * all in sync, and the node processor_id will be
1223  * consistent between processors.
1224  * If we are on a distributed mesh, we can fix
1225  * inconsistent processor ids later, but only if every
1226  * processor gives new nodes a *locally* consistent
1227  * processor id, so we'll give the new node the
1228  * processor id of an adjacent element for now and then
1229  * we'll update that later if appropriate.
1230  */
1231  Node * so_node = this->add_point
1232  (new_location, DofObject::invalid_id, lo_pid);
1233 
1234  /*
1235  * insert the new node with its defining vertex
1236  * set into the map, and relocate pos to this
1237  * new entry, so that the so_elem can use
1238  * \p pos for inserting the node
1239  */
1240  adj_vertices_to_so_nodes.insert(pos.first,
1241  std::make_pair(adjacent_vertices_ids,
1242  so_node));
1243 
1244  so_elem->set_node(son) = so_node;
1245  }
1246  // yes, already added.
1247  else
1248  {
1249  Node * so_node = pos.first->second;
1250  libmesh_assert(so_node);
1251 
1252  so_elem->set_node(son) = so_node;
1253 
1254  // We need to ensure that the processor who should own a
1255  // node *knows* they own the node. And because
1256  // Node::choose_processor_id() may depend on Node id,
1257  // which may not yet be authoritative, we still have to
1258  // use a dumb-but-id-independent partitioning heuristic.
1259  processor_id_type chosen_pid =
1260  std::min (so_node->processor_id(), lo_pid);
1261 
1262  // Plus, if we just discovered that we own this node,
1263  // then on a distributed mesh we need to make sure to
1264  // give it a valid id, not just a placeholder id!
1265  if (!this->is_replicated() &&
1266  so_node->processor_id() != my_pid &&
1267  chosen_pid == my_pid)
1268  this->own_node(*so_node);
1269 
1270  so_node->processor_id() = chosen_pid;
1271  }
1272  }
1273 
1274  /*
1275  * find_neighbors relies on remote_elem neighbor links being
1276  * properly maintained.
1277  */
1278  for (auto s : lo_elem->side_index_range())
1279  {
1280  if (lo_elem->neighbor_ptr(s) == remote_elem)
1281  so_elem->set_neighbor(s, const_cast<RemoteElem*>(remote_elem));
1282  }
1283 
1296  (this->get_boundary_info(), lo_elem, so_elem);
1297 
1298  /*
1299  * The new second-order element is ready.
1300  * Inserting it into the mesh will replace and delete
1301  * the first-order element.
1302  */
1303  so_elem->set_id(lo_elem->id());
1304 #ifdef LIBMESH_ENABLE_UNIQUE_ID
1305  so_elem->set_unique_id() = lo_elem->unique_id();
1306 #endif
1307  so_elem->processor_id() = lo_pid;
1308  so_elem->subdomain_id() = lo_elem->subdomain_id();
1309  this->insert_elem(so_elem);
1310  }
1311 
1312  // we can clear the map
1313  adj_vertices_to_so_nodes.clear();
1314 
1315 
1316  STOP_LOG("all_second_order()", "Mesh");
1317 
1318  // On a DistributedMesh our ghost node processor ids may be bad,
1319  // the ids of nodes touching remote elements may be inconsistent,
1320  // unique_ids of newly added non-local nodes remain unset, and our
1321  // partitioning of new nodes may not be well balanced.
1322  //
1323  // make_nodes_parallel_consistent() will fix all this.
1324  if (!this->is_replicated())
1325  {
1326  dof_id_type max_unpartitioned_elem = n_unpartitioned_elem;
1327  this->comm().max(max_unpartitioned_elem);
1328  if (max_unpartitioned_elem)
1329  {
1330  // We'd better be effectively serialized here. In theory we
1331  // could support more complicated cases but in practice we
1332  // only support "completely partitioned" and/or "serialized"
1333  if (!this->comm().verify(n_unpartitioned_elem) ||
1334  !this->comm().verify(n_partitioned_elem) ||
1335  !this->is_serial())
1336  libmesh_not_implemented();
1337  }
1338  else
1339  {
1340  MeshCommunication().make_nodes_parallel_consistent (*this);
1341  }
1342  }
1343 
1344  // renumber nodes, elements etc
1345  this->prepare_for_use(/*skip_renumber =*/ false);
1346 }

References libMesh::MeshBase::_is_prepared, libMesh::MeshBase::add_point(), libMesh::Elem::build(), libMesh::ParallelObject::comm(), libMesh::BoundaryInfo::copy_boundary_ids(), libMesh::Elem::default_order(), libMesh::MeshBase::elements_begin(), libMesh::MeshBase::elements_end(), libMesh::FIRST, libMesh::MeshBase::get_boundary_info(), libMesh::DofObject::id(), libMesh::MeshBase::insert_elem(), libMesh::DofObject::invalid_id, libMesh::DofObject::invalid_processor_id, libMesh::MeshBase::is_replicated(), libMesh::MeshBase::is_serial(), libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::MeshBase::mesh_dimension(), libMesh::MeshBase::MeshCommunication, libMesh::MeshBase::n_elem(), libMesh::MeshBase::n_nodes(), libMesh::Elem::n_nodes(), libMesh::Elem::n_second_order_adjacent_vertices(), libMesh::MeshBase::n_unpartitioned_elem(), libMesh::Elem::n_vertices(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_id(), libMesh::Elem::node_ptr(), libMesh::MeshBase::own_node(), libMesh::MeshBase::point(), libMesh::MeshBase::prepare_for_use(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::remote_elem, libMesh::MeshBase::renumber_nodes_and_elements(), libMesh::MeshBase::reserve_nodes(), libMesh::Elem::second_order_adjacent_vertex(), libMesh::Elem::second_order_equivalent_type(), libMesh::DofObject::set_id(), libMesh::Elem::set_neighbor(), libMesh::Elem::set_node(), libMesh::DofObject::set_unique_id(), libMesh::Elem::side_index_range(), libMesh::Elem::subdomain_id(), libMesh::Elem::type(), and libMesh::DofObject::unique_id().

◆ allgather()

void libMesh::DistributedMesh::allgather ( )
overridevirtualinherited

Gathers all elements and nodes of the mesh onto every processor.

Reimplemented from libMesh::MeshBase.

Definition at line 1495 of file distributed_mesh.C.

1496 {
1497  if (_is_serial)
1498  return;
1499  MeshCommunication().allgather(*this);
1500  _is_serial = true;
1501  _is_serial_on_proc_0 = true;
1502 
1503  // Make sure our caches are up to date and our
1504  // DofObjects are well packed
1505 #ifdef DEBUG
1506  libmesh_assert_equal_to (this->n_nodes(), this->parallel_n_nodes());
1507  libmesh_assert_equal_to (this->n_elem(), this->parallel_n_elem());
1508  const dof_id_type pmax_node_id = this->parallel_max_node_id();
1509  const dof_id_type pmax_elem_id = this->parallel_max_elem_id();
1510  libmesh_assert_equal_to (this->max_node_id(), pmax_node_id);
1511  libmesh_assert_equal_to (this->max_elem_id(), pmax_elem_id);
1512 
1513  // If we've disabled renumbering we can't be sure we're contiguous
1514  // libmesh_assert_equal_to (this->n_nodes(), this->max_node_id());
1515  // libmesh_assert_equal_to (this->n_elem(), this->max_elem_id());
1516 
1517  // Make sure our neighbor links are all fine
1519 
1520  // Make sure our ids and flags are consistent
1523 #endif
1524 }

References libMesh::DistributedMesh::_is_serial, libMesh::DistributedMesh::_is_serial_on_proc_0, libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_ids(), libMesh::DistributedMesh::max_elem_id(), libMesh::DistributedMesh::max_node_id(), libMesh::MeshBase::MeshCommunication, libMesh::DistributedMesh::n_elem(), libMesh::DistributedMesh::n_nodes(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::DistributedMesh::parallel_n_elem(), and libMesh::DistributedMesh::parallel_n_nodes().

◆ allow_remote_element_removal() [1/2]

bool libMesh::MeshBase::allow_remote_element_removal ( ) const
inlineinherited

◆ allow_remote_element_removal() [2/2]

void libMesh::MeshBase::allow_remote_element_removal ( bool  allow)
inlineinherited

If false is passed in then this mesh will no longer have remote elements deleted when being prepared for use; i.e.

even a DistributedMesh will remain (if it is already) serialized. This may adversely affect performance and memory use.

Definition at line 1034 of file mesh_base.h.

1034 { _allow_remote_element_removal = allow; }

References libMesh::MeshBase::_allow_remote_element_removal.

Referenced by libMesh::DynaIO::add_spline_constraints(), AllSecondOrderTest::allSecondOrder(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), main(), MeshInputTest::testDynaReadElem(), and MeshInputTest::testDynaReadPatch().

◆ allow_renumbering() [1/2]

bool libMesh::MeshBase::allow_renumbering ( ) const
inlineinherited

◆ allow_renumbering() [2/2]

void libMesh::MeshBase::allow_renumbering ( bool  allow)
inlineinherited

If false is passed in then this mesh will no longer be renumbered when being prepared for use.

This may slightly adversely affect performance during subsequent element access, particularly when using a distributed mesh.

Important! When allow_renumbering(false) is set, ReplicatedMesh::n_elem() and ReplicatedMesh::n_nodes() will return wrong values whenever adaptive refinement is followed by adaptive coarsening. (Uniform refinement followed by uniform coarsening is OK.) This is due to the fact that n_elem() and n_nodes() are currently O(1) functions that just return the size of the respective underlying vectors, and this size is wrong when the numbering includes "gaps" from nodes and elements that have been deleted. We plan to implement a caching mechanism in the near future that will fix this incorrect behavior.

Definition at line 1025 of file mesh_base.h.

References libMesh::MeshBase::_skip_renumber_nodes_and_elements.

Referenced by libMesh::DynaIO::add_spline_constraints(), GetBoundaryPointsTest::build_mesh(), SlitMeshTest::build_mesh(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), main(), libMesh::RBEIMEvaluation::RBEIMEvaluation(), libMesh::NameBasedIO::read(), libMesh::GMVIO::read(), MeshInputTest::testDynaReadElem(), MeshInputTest::testDynaReadPatch(), SystemsTest::testProjectMatrix1D(), SystemsTest::testProjectMatrix2D(), SystemsTest::testProjectMatrix3D(), EquationSystemsTest::testRefineThenReinitPreserveFlags(), EquationSystemsTest::testRepartitionThenReinit(), WriteSidesetData::testWrite(), and WriteVecAndScalar::testWrite().

◆ ancestor_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::ancestor_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ ancestor_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::ancestor_elements_begin ( )
overridevirtualinherited

Iterate over elements for which elem->ancestor() is true.

Implements libMesh::MeshBase.

◆ ancestor_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::ancestor_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ ancestor_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::ancestor_elements_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ bid_nodes_begin() [1/2]

virtual const_node_iterator libMesh::DistributedMesh::bid_nodes_begin ( boundary_id_type  bndry_id) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ bid_nodes_begin() [2/2]

virtual node_iterator libMesh::DistributedMesh::bid_nodes_begin ( boundary_id_type  bndry_id)
overridevirtualinherited

Iterate over nodes for which BoundaryInfo::has_boundary_id(node, bndry_id) is true.

Implements libMesh::MeshBase.

◆ bid_nodes_end() [1/2]

virtual const_node_iterator libMesh::DistributedMesh::bid_nodes_end ( boundary_id_type  bndry_id) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ bid_nodes_end() [2/2]

virtual node_iterator libMesh::DistributedMesh::bid_nodes_end ( boundary_id_type  bndry_id)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ bnd_nodes_begin() [1/2]

virtual const_node_iterator libMesh::DistributedMesh::bnd_nodes_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ bnd_nodes_begin() [2/2]

virtual node_iterator libMesh::DistributedMesh::bnd_nodes_begin ( )
overridevirtualinherited

Iterate over nodes for which BoundaryInfo::n_boundary_ids(node) > 0.

Implements libMesh::MeshBase.

◆ bnd_nodes_end() [1/2]

virtual const_node_iterator libMesh::DistributedMesh::bnd_nodes_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ bnd_nodes_end() [2/2]

virtual node_iterator libMesh::DistributedMesh::bnd_nodes_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ cache_elem_dims()

void libMesh::MeshBase::cache_elem_dims ( )
inherited

Search the mesh and cache the different dimensions of the elements present in the mesh.

This is done in prepare_for_use(), but can be done manually by other classes after major mesh modifications.

Definition at line 753 of file mesh_base.C.

754 {
755  // This requires an inspection on every processor
756  parallel_object_only();
757 
758  // Need to clear _elem_dims first in case all elements of a
759  // particular dimension have been deleted.
760  _elem_dims.clear();
761 
762  for (const auto & elem : this->active_element_ptr_range())
763  _elem_dims.insert(cast_int<unsigned char>(elem->dim()));
764 
765  // Some different dimension elements may only live on other processors
766  this->comm().set_union(_elem_dims);
767 
768  // If the largest element dimension found is larger than the current
769  // _spatial_dimension, increase _spatial_dimension.
770  unsigned int max_dim = this->mesh_dimension();
771  if (max_dim > _spatial_dimension)
772  _spatial_dimension = cast_int<unsigned char>(max_dim);
773 
774  // _spatial_dimension may need to increase from 1->2 or 2->3 if the
775  // mesh is full of 1D elements but they are not x-aligned, or the
776  // mesh is full of 2D elements but they are not in the x-y plane.
777  // If the mesh is x-aligned or x-y planar, we will end up checking
778  // every node's coordinates and not breaking out of the loop
779  // early...
780 #if LIBMESH_DIM > 1
781  if (_spatial_dimension < 3)
782  {
783  for (const auto & node : this->node_ptr_range())
784  {
785  // Note: the exact floating point comparison is intentional,
786  // we don't want to get tripped up by tolerances.
787  if ((*node)(1) != 0.)
788  {
789  _spatial_dimension = 2;
790 #if LIBMESH_DIM == 2
791  // If libmesh is compiled in 2D mode, this is the
792  // largest spatial dimension possible so we can break
793  // out.
794  break;
795 #endif
796  }
797 
798 #if LIBMESH_DIM > 2
799  if ((*node)(2) != 0.)
800  {
801  // Spatial dimension can't get any higher than this, so
802  // we can break out.
803  _spatial_dimension = 3;
804  break;
805  }
806 #endif
807  }
808  }
809 #endif // LIBMESH_DIM > 1
810 }

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

◆ clear()

void libMesh::DistributedMesh::clear ( )
overridevirtualinherited

Clear all internal data.

Reimplemented from libMesh::MeshBase.

Definition at line 832 of file distributed_mesh.C.

833 {
834  // Call parent clear function
835  MeshBase::clear();
836 
837  // Clear our elements and nodes
838  // There is no need to remove the elements from
839  // the BoundaryInfo data structure since we
840  // already cleared it.
841  for (auto & elem : _elements)
842  delete elem;
843 
844  // clear the nodes data structure
845  // There is no need to remove the nodes from
846  // the BoundaryInfo data structure since we
847  // already cleared it.
848  for (auto & node : _nodes)
849  delete node;
850 
851  _elements.clear();
852  _nodes.clear();
853 
854  // We're no longer distributed if we were before
855  _is_serial = true;
856  _is_serial_on_proc_0 = true;
857 
858  // Correct our caches
859  _n_nodes = 0;
860  _n_elem = 0;
861  _max_node_id = 0;
862  _max_elem_id = 0;
867 }

References libMesh::DistributedMesh::_elements, libMesh::DistributedMesh::_is_serial, libMesh::DistributedMesh::_is_serial_on_proc_0, libMesh::DistributedMesh::_max_elem_id, libMesh::DistributedMesh::_max_node_id, libMesh::DistributedMesh::_n_elem, libMesh::DistributedMesh::_n_nodes, libMesh::DistributedMesh::_next_free_local_elem_id, libMesh::DistributedMesh::_next_free_local_node_id, libMesh::DistributedMesh::_next_free_unpartitioned_elem_id, libMesh::DistributedMesh::_next_free_unpartitioned_node_id, libMesh::DistributedMesh::_nodes, libMesh::MeshBase::clear(), libMesh::MeshBase::elem(), libMesh::ParallelObject::n_processors(), libMesh::MeshBase::node(), and libMesh::ParallelObject::processor_id().

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

◆ clear_extra_ghost_elems() [1/2]

virtual void libMesh::DistributedMesh::clear_extra_ghost_elems ( )
inlinevirtualinherited

Clears extra ghost elements.

Definition at line 216 of file distributed_mesh.h.

216 { _extra_ghost_elems.clear(); }

References libMesh::DistributedMesh::_extra_ghost_elems.

◆ clear_extra_ghost_elems() [2/2]

void libMesh::DistributedMesh::clear_extra_ghost_elems ( const std::set< Elem * > &  extra_ghost_elems)
virtualinherited

Clears specified extra ghost elements.

Definition at line 1486 of file distributed_mesh.C.

1487 {
1488  std::set<Elem *> tmp;
1489  std::set_difference(_extra_ghost_elems.begin(), _extra_ghost_elems.end(),
1490  extra_ghost_elems.begin(), extra_ghost_elems.end(),
1491  std::inserter(tmp, tmp.begin()));
1492  _extra_ghost_elems = tmp;
1493 }

References libMesh::DistributedMesh::_extra_ghost_elems, and libMesh::DistributedMesh::extra_ghost_elems().

◆ clear_point_locator()

void libMesh::MeshBase::clear_point_locator ( )
inherited

Releases the current PointLocator object.

Definition at line 696 of file mesh_base.C.

697 {
698  _point_locator.reset(nullptr);
699 }

Referenced by libMesh::UnstructuredMesh::contract(), and libMesh::MeshCommunication::delete_remote_elements().

◆ clone()

virtual std::unique_ptr<MeshBase> libMesh::ParallelMesh::clone ( ) const
inlineoverridevirtual

Virtual copy-constructor, creates a copy of this mesh.

Reimplemented from libMesh::DistributedMesh.

Definition at line 44 of file parallel_mesh.h.

45  { return libmesh_make_unique<ParallelMesh>(*this); }

◆ comm()

const Parallel::Communicator& libMesh::ParallelObject::comm ( ) const
inlineinherited
Returns
A reference to the Parallel::Communicator object used by this mesh.

Definition at line 94 of file parallel_object.h.

95  { return _communicator; }

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::__libmesh_petsc_diff_solver_jacobian(), libMesh::__libmesh_petsc_diff_solver_monitor(), libMesh::__libmesh_petsc_diff_solver_residual(), libMesh::__libmesh_tao_equality_constraints(), libMesh::__libmesh_tao_equality_constraints_jacobian(), libMesh::__libmesh_tao_gradient(), libMesh::__libmesh_tao_hessian(), libMesh::__libmesh_tao_inequality_constraints(), libMesh::__libmesh_tao_inequality_constraints_jacobian(), libMesh::__libmesh_tao_objective(), libMesh::MeshRefinement::_coarsen_elements(), libMesh::ExactSolution::_compute_error(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_get_diagonal(), libMesh::SlepcEigenSolver< libMesh::Number >::_petsc_shell_matrix_get_diagonal(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_mult(), libMesh::SlepcEigenSolver< libMesh::Number >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_mult_add(), libMesh::EquationSystems::_read_impl(), libMesh::MeshRefinement::_refine_elements(), libMesh::MeshRefinement::_smooth_flags(), libMesh::DofMap::add_constraints_to_send_list(), add_cube_convex_hull_to_mesh(), libMesh::PetscDMWrapper::add_dofs_helper(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::TransientRBConstruction::add_IC_to_RB_space(), libMesh::ImplicitSystem::add_matrix(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::DynaIO::add_spline_constraints(), libMesh::System::add_vector(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::TransientRBConstruction::allocate_data_structures(), libMesh::RBConstruction::allocate_data_structures(), libMesh::TransientRBConstruction::assemble_affine_expansion(), libMesh::FEMSystem::assemble_qoi(), libMesh::MeshCommunication::assign_global_indices(), libMesh::DofMap::attach_matrix(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::PetscDMWrapper::build_section(), libMesh::PetscDMWrapper::build_sf(), libMesh::System::calculate_norm(), libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::RBConstruction::compute_Fq_representor_innerprods(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::RBConstruction::compute_output_dual_innerprods(), libMesh::RBConstruction::compute_residual_dual_norm_slow(), libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set(), libMesh::Problem_Interface::computeF(), libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshTools::create_bounding_box(), libMesh::DofMap::create_dof_constraints(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::MeshTools::create_subdomain_bounding_box(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), DMlibMeshFunction(), DMlibMeshJacobian(), DMlibMeshSetSystem_libMesh(), DMVariableBounds_libMesh(), libMesh::DTKSolutionTransfer::DTKSolutionTransfer(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::TransientRBConstruction::enrich_RB_space(), libMesh::RBConstruction::enrich_RB_space(), libMesh::EpetraVector< T >::EpetraVector(), AssembleOptimization::equality_constraints(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::RBEIMConstruction::evaluate_mesh_function(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_error_tolerance(), libMesh::MeshRefinement::flag_elements_by_mean_stddev(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::DofMap::gather_constraints(), libMesh::MeshfreeInterpolation::gather_remote_data(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::DofMap::get_info(), libMesh::ImplicitSystem::get_linear_solver(), AssembleOptimization::inequality_constraints(), AssembleOptimization::inequality_constraints_jacobian(), libMesh::LocationMap< T >::init(), libMesh::TimeSolver::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::EigenSystem::init_matrices(), libMesh::OptimizationSystem::initialize_equality_constraints_storage(), libMesh::OptimizationSystem::initialize_inequality_constraints_storage(), libMesh::RBEIMConstruction::initialize_rb_construction(), integrate_function(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::MeshTools::libmesh_assert_valid_unique_ids(), libMesh::libmesh_petsc_preconditioner_apply(), libMesh::libmesh_petsc_snes_fd_residual(), libMesh::libmesh_petsc_snes_jacobian(), libMesh::libmesh_petsc_snes_mffd_residual(), libMesh::libmesh_petsc_snes_postcheck(), libMesh::libmesh_petsc_snes_residual(), libMesh::libmesh_petsc_snes_residual_helper(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshCommunication::make_elems_parallel_consistent(), libMesh::MeshRefinement::make_flags_parallel_consistent(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_new_nodes_parallel_consistent(), libMesh::MeshCommunication::make_node_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_unique_ids_parallel_consistent(), libMesh::MeshCommunication::make_nodes_parallel_consistent(), libMesh::MeshCommunication::make_p_levels_parallel_consistent(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::TransientRBConstruction::mass_matrix_scaled_matvec(), libMesh::FEMSystem::mesh_position_set(), LinearElasticityWithContact::move_mesh(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshTools::n_active_levels(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::DofMap::n_constrained_dofs(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::CondensedEigenSystem::n_global_non_condensed_dofs(), libMesh::MeshTools::n_levels(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::MeshTools::n_p_levels(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::ReplicatedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_n_elem(), libMesh::DistributedMesh::parallel_n_nodes(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::MeshTools::paranoid_n_levels(), libMesh::petsc_auto_fieldsplit(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::print_dof_constraints(), FEMParameters::read(), libMesh::Nemesis_IO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::System::read_header(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::System::read_legacy_data(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::System::read_SCALAR_dofs(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::System::read_serialized_vector(), libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::DistributedMesh::renumber_dof_objects(), LinearElasticityWithContact::residual_and_jacobian(), OverlappingAlgebraicGhostingTest::run_ghosting_test(), OverlappingCouplingGhostingTest::run_sparsity_pattern_test(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::TransientRBConstruction::set_error_temporal_data(), libMesh::RBEIMConstruction::set_explicit_sys_subvector(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::PetscDiffSolver::setup_petsc_data(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::split_mesh(), libMesh::BoundaryInfo::sync(), libMesh::MeshRefinement::test_level_one(), MeshfunctionDFEM::test_mesh_function_dfem(), MeshfunctionDFEM::test_mesh_function_dfem_grad(), MeshFunctionTest::test_p_level(), libMesh::MeshRefinement::test_unflagged(), SystemsTest::testBlockRestrictedVarNDofs(), PointLocatorTest::testLocator(), BoundaryInfoTest::testMesh(), SystemsTest::testProjectCubeWithMeshFunction(), CheckpointIOTest::testSplitter(), libMesh::MeshTools::total_weight(), libMesh::MeshFunctionSolutionTransfer::transfer(), libMesh::MeshfreeSolutionTransfer::transfer(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::TransientRBConstruction::update_RB_initial_condition_all_N(), libMesh::RBEIMConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_RB_system_matrices(), libMesh::RBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_residual_terms(), libMesh::RBConstruction::update_residual_terms(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), libMesh::VTKIO::write_nodal_data(), libMesh::RBEvaluation::write_out_vectors(), libMesh::TransientRBConstruction::write_riesz_representors_to_files(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::RBDataSerialization::RBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::TransientRBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::RBEIMEvaluationSerialization::write_to_file(), and libMesh::RBDataSerialization::RBSCMEvaluationSerialization::write_to_file().

◆ contract()

bool libMesh::UnstructuredMesh::contract ( )
overridevirtualinherited

Delete subactive (i.e.

children of coarsened) elements. This removes all elements descended from currently active elements in the mesh.

Implements libMesh::MeshBase.

Definition at line 797 of file unstructured_mesh.C.

798 {
799  LOG_SCOPE ("contract()", "Mesh");
800 
801  // Flag indicating if this call actually changes the mesh
802  bool mesh_changed = false;
803 
804 #ifdef DEBUG
805  for (const auto & elem : this->element_ptr_range())
807 #endif
808 
809  // Loop over the elements.
810  for (auto & elem : this->element_ptr_range())
811  {
812  // Delete all the subactive ones
813  if (elem->subactive())
814  {
815  // No level-0 element should be subactive.
816  // Note that we CAN'T test elem->level(), as that
817  // touches elem->parent()->dim(), and elem->parent()
818  // might have already been deleted!
820 
821  // Delete the element
822  // This just sets a pointer to nullptr, and doesn't
823  // invalidate any iterators
824  this->delete_elem(elem);
825 
826  // the mesh has certainly changed
827  mesh_changed = true;
828  }
829  else
830  {
831  // Compress all the active ones
832  if (elem->active())
833  elem->contract();
834  else
836  }
837  }
838 
839  // Strip any newly-created nullptr voids out of the element array
841 
842  // FIXME: Need to understand why deleting subactive children
843  // invalidates the point locator. For now we will clear it explicitly
844  this->clear_point_locator();
845 
846  // Allow our GhostingFunctor objects to reinit if necessary.
847  for (auto & gf : as_range(this->ghosting_functors_begin(),
848  this->ghosting_functors_end()))
849  {
850  libmesh_assert(gf);
851  gf->mesh_reinit();
852  }
853 
854  return mesh_changed;
855 }

References libMesh::Elem::active(), libMesh::Elem::ancestor(), libMesh::as_range(), libMesh::MeshBase::clear_point_locator(), libMesh::Elem::contract(), libMesh::MeshBase::delete_elem(), libMesh::MeshBase::elem(), libMesh::MeshBase::element_ptr_range(), libMesh::MeshBase::ghosting_functors_begin(), libMesh::MeshBase::ghosting_functors_end(), libMesh::libmesh_assert(), libMesh::Elem::parent(), libMesh::MeshBase::renumber_nodes_and_elements(), and libMesh::Elem::subactive().

◆ copy_nodes_and_elements()

void libMesh::UnstructuredMesh::copy_nodes_and_elements ( const UnstructuredMesh other_mesh,
const bool  skip_find_neighbors = false,
dof_id_type  element_id_offset = 0,
dof_id_type  node_id_offset = 0,
unique_id_type  unique_id_offset = 0 
)
virtualinherited

Deep copy of nodes and elements from another unstructured mesh class (used by subclass copy constructors and by mesh merging operations)

This will not copy most "high level" data in the mesh; that is done separately by constructors. An exception is that, if the other_mesh has element or node extra_integer data, any names for that data which do not already exist on this mesh are added so that all such data can be copied.

Definition at line 61 of file unstructured_mesh.C.

70 {
71  LOG_SCOPE("copy_nodes_and_elements()", "UnstructuredMesh");
72 
73  std::pair<std::vector<unsigned int>, std::vector<unsigned int>>
74  extra_int_maps = this->merge_extra_integer_names(other_mesh);
75 
76  const unsigned int n_old_node_ints = extra_int_maps.second.size(),
77  n_new_node_ints = _node_integer_names.size(),
78  n_old_elem_ints = extra_int_maps.first.size(),
79  n_new_elem_ints = _elem_integer_names.size();
80 
81  // If we are partitioned into fewer parts than the incoming mesh,
82  // then we need to "wrap" the other Mesh's processor ids to fit
83  // within our range. This can happen, for example, while stitching
84  // ReplicatedMeshes with small numbers of elements in parallel...
85  bool wrap_proc_ids = (_n_parts < other_mesh._n_parts);
86 
87  // We're assuming our subclass data needs no copy
88  libmesh_assert_equal_to (_is_prepared, other_mesh._is_prepared);
89 
90  // We're assuming the other mesh has proper element number ordering,
91  // so that we add parents before their children, and that the other
92  // mesh is consistently partitioned.
93 #ifdef DEBUG
95  MeshTools::libmesh_assert_valid_procids<Node>(other_mesh);
96 #endif
97 
98  //Copy in Nodes
99  {
100  //Preallocate Memory if necessary
101  this->reserve_nodes(other_mesh.n_nodes());
102 
103  for (const auto & oldn : other_mesh.node_ptr_range())
104  {
105  processor_id_type added_pid = cast_int<processor_id_type>
106  (wrap_proc_ids ? oldn->processor_id() % _n_parts : oldn->processor_id());
107 
108  // Add new nodes in old node Point locations
109  Node * newn =
110  this->add_point(*oldn,
111  oldn->id() + node_id_offset,
112  added_pid);
113 
114  newn->add_extra_integers(n_new_node_ints);
115  for (unsigned int i = 0; i != n_old_node_ints; ++i)
116  newn->set_extra_integer(extra_int_maps.second[i],
117  oldn->get_extra_integer(i));
118 
119 #ifdef LIBMESH_ENABLE_UNIQUE_ID
120  newn->set_unique_id() =
121  oldn->unique_id() + unique_id_offset;
122 #endif
123  }
124  }
125 
126  //Copy in Elements
127  {
128  //Preallocate Memory if necessary
129  this->reserve_elem(other_mesh.n_elem());
130 
131  // Declare a map linking old and new elements, needed to copy the neighbor lists
132  typedef std::unordered_map<const Elem *, Elem *> map_type;
133  map_type old_elems_to_new_elems;
134 
135  // Loop over the elements
136  for (const auto & old : other_mesh.element_ptr_range())
137  {
138  // Build a new element
139  Elem * newparent = old->parent() ?
140  this->elem_ptr(old->parent()->id() + element_id_offset) :
141  nullptr;
142  std::unique_ptr<Elem> ap = Elem::build(old->type(), newparent);
143  Elem * el = ap.release();
144 
145  el->subdomain_id() = old->subdomain_id();
146 
147 #ifdef LIBMESH_ENABLE_AMR
148  if (old->has_children())
149  for (unsigned int c = 0, nc = old->n_children(); c != nc; ++c)
150  if (old->child_ptr(c) == remote_elem)
151  el->add_child(const_cast<RemoteElem *>(remote_elem), c);
152 
153  //Create the parent's child pointers if necessary
154  if (newparent)
155  {
156  unsigned int oldc = old->parent()->which_child_am_i(old);
157  newparent->add_child(el, oldc);
158  }
159 
160  // Copy the refinement flags
161  el->set_refinement_flag(old->refinement_flag());
162 
163  // Use hack_p_level since we may not have sibling elements
164  // added yet
165  el->hack_p_level(old->p_level());
166 
167  el->set_p_refinement_flag(old->p_refinement_flag());
168 #endif // #ifdef LIBMESH_ENABLE_AMR
169 
170  //Assign all the nodes
171  for (auto i : el->node_index_range())
172  el->set_node(i) =
173  this->node_ptr(old->node_id(i) + node_id_offset);
174 
175  // And start it off with the same processor id (mod _n_parts).
176  el->processor_id() = cast_int<processor_id_type>
177  (wrap_proc_ids ? old->processor_id() % _n_parts : old->processor_id());
178 
179  // Give it the same element and unique ids
180  el->set_id(old->id() + element_id_offset);
181 
182  el->add_extra_integers(n_new_elem_ints);
183  for (unsigned int i = 0; i != n_old_elem_ints; ++i)
184  el->set_extra_integer(extra_int_maps.first[i],
185  old->get_extra_integer(i));
186 
187 #ifdef LIBMESH_ENABLE_UNIQUE_ID
188  el->set_unique_id() =
189  old->unique_id() + unique_id_offset;
190 #endif
191 
192  //Hold onto it
193  if (!skip_find_neighbors)
194  {
195  for (auto s : old->side_index_range())
196  if (old->neighbor_ptr(s) == remote_elem)
197  el->set_neighbor(s, const_cast<RemoteElem *>(remote_elem));
198  this->add_elem(el);
199  }
200  else
201  {
202  Elem * new_el = this->add_elem(el);
203  old_elems_to_new_elems[old] = new_el;
204  }
205  }
206 
207  // Loop (again) over the elements to fill in the neighbors
208  if (skip_find_neighbors)
209  {
210  old_elems_to_new_elems[remote_elem] = const_cast<RemoteElem*>(remote_elem);
211 
212  for (const auto & old_elem : other_mesh.element_ptr_range())
213  {
214  Elem * new_elem = old_elems_to_new_elems[old_elem];
215  for (auto s : old_elem->side_index_range())
216  {
217  const Elem * old_neighbor = old_elem->neighbor_ptr(s);
218  Elem * new_neighbor = old_elems_to_new_elems[old_neighbor];
219  new_elem->set_neighbor(s, new_neighbor);
220  }
221  }
222  }
223  }
224 
225  //Finally prepare the new Mesh for use. Keep the same numbering and
226  //partitioning for now.
227  this->allow_renumbering(false);
228  this->allow_remote_element_removal(false);
229 
230  // We should generally be able to skip *all* partitioning here
231  // because we're only adding one already-consistent mesh to another.
232  this->skip_partitioning(true);
233 
234  this->prepare_for_use(false, skip_find_neighbors);
235 
236  //But in the long term, use the same renumbering and partitioning
237  //policies as our source mesh.
238  this->allow_renumbering(other_mesh.allow_renumbering());
239  this->allow_remote_element_removal(other_mesh.allow_remote_element_removal());
240  this->skip_partitioning(other_mesh._skip_all_partitioning);
241  this->skip_noncritical_partitioning(other_mesh._skip_noncritical_partitioning);
242 }

References libMesh::MeshBase::_elem_integer_names, libMesh::MeshBase::_is_prepared, libMesh::MeshBase::_n_parts, libMesh::MeshBase::_node_integer_names, libMesh::MeshBase::_skip_all_partitioning, libMesh::MeshBase::_skip_noncritical_partitioning, libMesh::Elem::add_child(), libMesh::MeshBase::add_elem(), libMesh::DofObject::add_extra_integers(), libMesh::MeshBase::add_point(), libMesh::MeshBase::allow_remote_element_removal(), libMesh::MeshBase::allow_renumbering(), libMesh::Elem::build(), libMesh::MeshBase::elem_ptr(), libMesh::MeshBase::element_ptr_range(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshBase::merge_extra_integer_names(), libMesh::MeshBase::n_elem(), libMesh::MeshBase::n_nodes(), libMesh::Elem::neighbor_ptr(), libMesh::MeshBase::node_ptr(), libMesh::MeshBase::node_ptr_range(), libMesh::Elem::parent(), libMesh::MeshBase::prepare_for_use(), libMesh::DofObject::processor_id(), libMesh::remote_elem, libMesh::MeshBase::reserve_elem(), libMesh::MeshBase::reserve_nodes(), libMesh::Elem::set_neighbor(), libMesh::MeshBase::skip_noncritical_partitioning(), libMesh::MeshBase::skip_partitioning(), and libMesh::Elem::subdomain_id().

Referenced by libMesh::DistributedMesh::DistributedMesh(), libMesh::ReplicatedMesh::ReplicatedMesh(), and libMesh::ReplicatedMesh::stitching_helper().

◆ create_pid_mesh()

void libMesh::UnstructuredMesh::create_pid_mesh ( UnstructuredMesh pid_mesh,
const processor_id_type  pid 
) const
inherited

Generates a new mesh containing all the elements which are assigned to processor pid.

This mesh is written to the pid_mesh reference which you must create and pass to the function.

Definition at line 672 of file unstructured_mesh.C.

674 {
675 
676  // Issue a warning if the number the number of processors
677  // currently available is less that that requested for
678  // partitioning. This is not necessarily an error since
679  // you may run on one processor and still partition the
680  // mesh into several partitions.
681 #ifdef DEBUG
682  if (this->n_processors() < pid)
683  {
684  libMesh::out << "WARNING: You are creating a "
685  << "mesh for a processor id (="
686  << pid
687  << ") greater than "
688  << "the number of processors available for "
689  << "the calculation. (="
690  << this->n_processors()
691  << ")."
692  << std::endl;
693  }
694 #endif
695 
696  this->create_submesh (pid_mesh,
697  this->active_pid_elements_begin(pid),
698  this->active_pid_elements_end(pid));
699 }

References libMesh::MeshBase::active_pid_elements_begin(), libMesh::MeshBase::active_pid_elements_end(), libMesh::UnstructuredMesh::create_submesh(), libMesh::ParallelObject::n_processors(), and libMesh::out.

◆ create_submesh()

void libMesh::UnstructuredMesh::create_submesh ( UnstructuredMesh new_mesh,
const const_element_iterator it,
const const_element_iterator it_end 
) const
inherited

Constructs a mesh called "new_mesh" from the current mesh by iterating over the elements between it and it_end and adding them to the new mesh.

Definition at line 707 of file unstructured_mesh.C.

710 {
711  // Just in case the subdomain_mesh already has some information
712  // in it, get rid of it.
713  new_mesh.clear();
714 
715  // If we're not serial, our submesh isn't either.
716  // There are no remote elements to delete on an empty mesh, but
717  // calling the method to do so marks the mesh as parallel.
718  if (!this->is_serial())
719  new_mesh.delete_remote_elements();
720 
721  // Fail if (*this == new_mesh), we cannot create a submesh inside ourself!
722  // This may happen if the user accidentally passes the original mesh into
723  // this function! We will check this by making sure we did not just
724  // clear ourself.
725  libmesh_assert_not_equal_to (this->n_nodes(), 0);
726  libmesh_assert_not_equal_to (this->n_elem(), 0);
727 
728  // Container to catch boundary IDs handed back by BoundaryInfo
729  std::vector<boundary_id_type> bc_ids;
730 
731  // Put any extra integers on the new mesh too
732  new_mesh.merge_extra_integer_names(*this);
733  const unsigned int n_node_ints = _node_integer_names.size(),
734  n_elem_ints = _elem_integer_names.size();
735 
736  for (const auto & old_elem : as_range(it, it_end))
737  {
738  // Add an equivalent element type to the new_mesh.
739  // Copy ids for this element.
740  Elem * new_elem = Elem::build(old_elem->type()).release();
741  new_elem->set_id() = old_elem->id();
742 #ifdef LIBMESH_ENABLE_UNIQUE_ID
743  new_elem->set_unique_id() = old_elem->unique_id();
744 #endif
745  new_elem->subdomain_id() = old_elem->subdomain_id();
746  new_elem->processor_id() = old_elem->processor_id();
747 
748  new_elem->add_extra_integers(n_elem_ints);
749  for (unsigned int i = 0; i != n_elem_ints; ++i)
750  new_elem->set_extra_integer(i, old_elem->get_extra_integer(i));
751 
752  new_mesh.add_elem (new_elem);
753 
754  libmesh_assert(new_elem);
755 
756  // Loop over the nodes on this element.
757  for (auto n : old_elem->node_index_range())
758  {
759  const dof_id_type this_node_id = old_elem->node_id(n);
760 
761  // Add this node to the new mesh if it's not there already
762  if (!new_mesh.query_node_ptr(this_node_id))
763  {
764  Node * newn =
765  new_mesh.add_point (old_elem->point(n),
766  this_node_id,
767  old_elem->node_ptr(n)->processor_id());
768 
769  newn->add_extra_integers(n_node_ints);
770  for (unsigned int i = 0; i != n_node_ints; ++i)
771  newn->set_extra_integer(i, old_elem->node_ptr(n)->get_extra_integer(i));
772 
773 #ifdef LIBMESH_ENABLE_UNIQUE_ID
774  newn->set_unique_id() = old_elem->node_ptr(n)->unique_id();
775 #endif
776  }
777 
778  // Define this element's connectivity on the new mesh
779  new_elem->set_node(n) = new_mesh.node_ptr(this_node_id);
780  }
781 
782  // Maybe add boundary conditions for this element
783  for (auto s : old_elem->side_index_range())
784  {
785  this->get_boundary_info().boundary_ids(old_elem, s, bc_ids);
786  new_mesh.get_boundary_info().add_side (new_elem, s, bc_ids);
787  }
788  } // end loop over elements
789 
790  // Prepare the new_mesh for use
791  new_mesh.prepare_for_use(/*skip_renumber =*/false);
792 }

References libMesh::MeshBase::_elem_integer_names, libMesh::MeshBase::_node_integer_names, libMesh::MeshBase::add_elem(), libMesh::DofObject::add_extra_integers(), libMesh::MeshBase::add_point(), libMesh::BoundaryInfo::add_side(), libMesh::as_range(), libMesh::BoundaryInfo::boundary_ids(), libMesh::Elem::build(), libMesh::MeshBase::clear(), libMesh::MeshBase::delete_remote_elements(), libMesh::MeshBase::get_boundary_info(), libMesh::MeshBase::is_serial(), libMesh::libmesh_assert(), libMesh::MeshBase::merge_extra_integer_names(), libMesh::MeshBase::n_elem(), libMesh::MeshBase::n_nodes(), libMesh::MeshBase::node_ptr(), libMesh::MeshBase::prepare_for_use(), libMesh::DofObject::processor_id(), libMesh::MeshBase::query_node_ptr(), libMesh::DofObject::set_extra_integer(), libMesh::DofObject::set_id(), libMesh::Elem::set_node(), libMesh::DofObject::set_unique_id(), and libMesh::Elem::subdomain_id().

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

◆ default_ghosting()

GhostingFunctor& libMesh::MeshBase::default_ghosting ( )
inlineinherited

Default ghosting functor.

Definition at line 1125 of file mesh_base.h.

1125 { return *_default_ghosting; }

References libMesh::MeshBase::_default_ghosting.

◆ default_mapping_data()

unsigned char libMesh::MeshBase::default_mapping_data ( ) const
inlineinherited

◆ default_mapping_type()

ElemMappingType libMesh::MeshBase::default_mapping_type ( ) const
inlineinherited

Returns the default master space to physical space mapping basis functions to be used on newly added elements.

Definition at line 708 of file mesh_base.h.

708  {
709  return _default_mapping_type;
710  }

References libMesh::MeshBase::_default_mapping_type.

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

◆ delete_elem()

void libMesh::DistributedMesh::delete_elem ( Elem e)
overridevirtualinherited

Removes element e from the mesh.

This method must be implemented in derived classes in such a way that it does not invalidate element iterators. Users should call MeshBase::prepare_for_use() after elements are added to and/or deleted from the mesh.

Note
Calling this method may produce isolated nodes, i.e. nodes not connected to any element.

Implements libMesh::MeshBase.

Definition at line 582 of file distributed_mesh.C.

583 {
584  libmesh_assert (e);
585 
586  // Try to make the cached elem data more accurate
587  processor_id_type elem_procid = e->processor_id();
588  if (elem_procid == this->processor_id() ||
589  elem_procid == DofObject::invalid_processor_id)
590  _n_elem--;
591 
592  // Delete the element from the BoundaryInfo object
593  this->get_boundary_info().remove(e);
594 
595  // But not yet from the container; we might invalidate
596  // an iterator that way!
597 
598  //_elements.erase(e->id());
599 
600  // Instead, we set it to nullptr for now
601 
602  _elements[e->id()] = nullptr;
603 
604  // delete the element
605  delete e;
606 }

References libMesh::DistributedMesh::_elements, libMesh::DistributedMesh::_n_elem, libMesh::MeshBase::get_boundary_info(), libMesh::DofObject::id(), libMesh::DofObject::invalid_processor_id, libMesh::libmesh_assert(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), and libMesh::BoundaryInfo::remove().

Referenced by libMesh::DistributedMesh::insert_elem().

◆ delete_node()

void libMesh::DistributedMesh::delete_node ( Node n)
overridevirtualinherited

Removes the Node n from the mesh.

Implements libMesh::MeshBase.

Definition at line 768 of file distributed_mesh.C.

769 {
770  libmesh_assert(n);
771  libmesh_assert(_nodes[n->id()]);
772 
773  // Try to make the cached elem data more accurate
774  processor_id_type node_procid = n->processor_id();
775  if (node_procid == this->processor_id() ||
776  node_procid == DofObject::invalid_processor_id)
777  _n_nodes--;
778 
779  // Delete the node from the BoundaryInfo object
780  this->get_boundary_info().remove(n);
781 
782  // But not yet from the container; we might invalidate
783  // an iterator that way!
784 
785  //_nodes.erase(n->id());
786 
787  // Instead, we set it to nullptr for now
788 
789  _nodes[n->id()] = nullptr;
790 
791  // delete the node
792  delete n;
793 }

References libMesh::DistributedMesh::_n_nodes, libMesh::DistributedMesh::_nodes, libMesh::MeshBase::get_boundary_info(), libMesh::DofObject::id(), libMesh::DofObject::invalid_processor_id, libMesh::libmesh_assert(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), and libMesh::BoundaryInfo::remove().

◆ delete_remote_elements()

void libMesh::DistributedMesh::delete_remote_elements ( )
overridevirtualinherited

Deletes all nonlocal elements of the mesh except for "ghosts" which touch a local element, and deletes all nodes which are not part of a local or ghost element.

Reimplemented from libMesh::MeshBase.

Definition at line 1406 of file distributed_mesh.C.

1407 {
1408 #ifdef DEBUG
1409  // Make sure our neighbor links are all fine
1411 
1412  // And our child/parent links, and our flags
1414 
1415  // Make sure our ids and flags are consistent
1418 
1419  libmesh_assert_equal_to (this->n_nodes(), this->parallel_n_nodes());
1420  libmesh_assert_equal_to (this->n_elem(), this->parallel_n_elem());
1421  const dof_id_type pmax_node_id = this->parallel_max_node_id();
1422  const dof_id_type pmax_elem_id = this->parallel_max_elem_id();
1423  libmesh_assert_equal_to (this->max_node_id(), pmax_node_id);
1424  libmesh_assert_equal_to (this->max_elem_id(), pmax_elem_id);
1425 #endif
1426 
1427  _is_serial = false;
1428  _is_serial_on_proc_0 = false;
1429 
1430  MeshCommunication().delete_remote_elements(*this, _extra_ghost_elems);
1431 
1432  libmesh_assert_equal_to (this->max_elem_id(), this->parallel_max_elem_id());
1433 
1434  // Now make sure the containers actually shrink - strip
1435  // any newly-created nullptr voids out of the element array
1436  mapvector<Elem *,dof_id_type>::veclike_iterator e_it = _elements.begin();
1437  const mapvector<Elem *,dof_id_type>::veclike_iterator e_end = _elements.end();
1438  while (e_it != e_end)
1439  if (!*e_it)
1440  e_it = _elements.erase(e_it);
1441  else
1442  ++e_it;
1443 
1444  mapvector<Node *,dof_id_type>::veclike_iterator n_it = _nodes.begin();
1445  const mapvector<Node *,dof_id_type>::veclike_iterator n_end = _nodes.end();
1446  while (n_it != n_end)
1447  if (!*n_it)
1448  n_it = _nodes.erase(n_it);
1449  else
1450  ++n_it;
1451 
1452  // We may have deleted no-longer-connected nodes or coarsened-away
1453  // elements; let's update our caches.
1454  this->update_parallel_id_counts();
1455 
1456 #ifdef DEBUG
1457  // We might not have well-packed objects if the user didn't allow us
1458  // to renumber
1459  // libmesh_assert_equal_to (this->n_nodes(), this->max_node_id());
1460  // libmesh_assert_equal_to (this->n_elem(), this->max_elem_id());
1461 
1462  // Make sure our neighbor links are all fine
1464 
1465  // And our child/parent links, and our flags
1467 
1468  // Make sure our ids and flags are consistent
1471 #endif
1472 }

References libMesh::DistributedMesh::_elements, libMesh::DistributedMesh::_extra_ghost_elems, libMesh::DistributedMesh::_is_serial, libMesh::DistributedMesh::_is_serial_on_proc_0, libMesh::DistributedMesh::_nodes, libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_ids(), libMesh::MeshTools::libmesh_assert_valid_refinement_tree(), libMesh::DistributedMesh::max_elem_id(), libMesh::DistributedMesh::max_node_id(), libMesh::MeshBase::MeshCommunication, libMesh::DistributedMesh::n_elem(), libMesh::DistributedMesh::n_nodes(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::DistributedMesh::parallel_n_elem(), libMesh::DistributedMesh::parallel_n_nodes(), and libMesh::DistributedMesh::update_parallel_id_counts().

◆ detect_interior_parents()

void libMesh::MeshBase::detect_interior_parents ( )
inherited

Search the mesh for elements that have a neighboring element of dim+1 and set that element as the interior parent.

Definition at line 812 of file mesh_base.C.

813 {
814  // This requires an inspection on every processor
815  parallel_object_only();
816 
817  // Check if the mesh contains mixed dimensions. If so, then set interior parents, otherwise return.
818  if (this->elem_dimensions().size() == 1)
819  return;
820 
821  //This map will be used to set interior parents
822  std::unordered_map<dof_id_type, std::vector<dof_id_type>> node_to_elem;
823 
824  for (const auto & elem : this->active_element_ptr_range())
825  {
826  // Populating the node_to_elem map, same as MeshTools::build_nodes_to_elem_map
827  for (auto n : IntRange<unsigned int>(0, elem->n_vertices()))
828  {
829  libmesh_assert_less (elem->id(), this->max_elem_id());
830 
831  node_to_elem[elem->node_id(n)].push_back(elem->id());
832  }
833  }
834 
835  // Automatically set interior parents
836  for (const auto & element : this->element_ptr_range())
837  {
838  // Ignore an 3D element or an element that already has an interior parent
839  if (element->dim()>=LIBMESH_DIM || element->interior_parent())
840  continue;
841 
842  // Start by generating a SET of elements that are dim+1 to the current
843  // element at each vertex of the current element, thus ignoring interior nodes.
844  // If one of the SET of elements is empty, then we will not have an interior parent
845  // since an interior parent must be connected to all vertices of the current element
846  std::vector<std::set<dof_id_type>> neighbors( element->n_vertices() );
847 
848  bool found_interior_parents = false;
849 
850  for (auto n : IntRange<unsigned int>(0, element->n_vertices()))
851  {
852  std::vector<dof_id_type> & element_ids = node_to_elem[element->node_id(n)];
853  for (const auto & eid : element_ids)
854  if (this->elem_ref(eid).dim() == element->dim()+1)
855  neighbors[n].insert(eid);
856 
857  if (neighbors[n].size()>0)
858  {
859  found_interior_parents = true;
860  }
861  else
862  {
863  // We have found an empty set, no reason to continue
864  // Ensure we set this flag to false before the break since it could have
865  // been set to true for previous vertex
866  found_interior_parents = false;
867  break;
868  }
869  }
870 
871  // If we have successfully generated a set of elements for each vertex, we will compare
872  // the set for vertex 0 will the sets for the vertices until we find a id that exists in
873  // all sets. If found, this is our an interior parent id. The interior parent id found
874  // will be the lowest element id if there is potential for multiple interior parents.
875  if (found_interior_parents)
876  {
877  std::set<dof_id_type> & neighbors_0 = neighbors[0];
878  for (const auto & interior_parent_id : neighbors_0)
879  {
880  found_interior_parents = false;
881  for (auto n : IntRange<unsigned int>(1, element->n_vertices()))
882  {
883  if (neighbors[n].find(interior_parent_id)!=neighbors[n].end())
884  {
885  found_interior_parents=true;
886  }
887  else
888  {
889  found_interior_parents=false;
890  break;
891  }
892  }
893  if (found_interior_parents)
894  {
895  element->set_interior_parent(this->elem_ptr(interior_parent_id));
896  break;
897  }
898  }
899  }
900  }
901 }

References dim.

◆ elem() [1/2]

virtual Elem* libMesh::MeshBase::elem ( const dof_id_type  i)
inlinevirtualinherited
Returns
A writable pointer to the \( i^{th} \) element, which should be present in this processor's subset of the mesh data structure.

Definition at line 569 of file mesh_base.h.

570  {
571  libmesh_deprecated();
572  return this->elem_ptr(i);
573  }

References libMesh::MeshBase::elem_ptr().

◆ elem() [2/2]

virtual const Elem* libMesh::MeshBase::elem ( const dof_id_type  i) const
inlinevirtualinherited
Returns
A pointer to the \( i^{th} \) element, which should be present in this processor's subset of the mesh data structure.

Definition at line 554 of file mesh_base.h.

555  {
556  libmesh_deprecated();
557  return this->elem_ptr(i);
558  }

References libMesh::MeshBase::elem_ptr().

Referenced by libMesh::ReplicatedMesh::clear(), libMesh::DistributedMesh::clear(), libMesh::UnstructuredMesh::contract(), libMesh::DistributedMesh::DistributedMesh(), libMesh::ReplicatedMesh::get_boundary_points(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), libMesh::DistributedMesh::renumber_nodes_and_elements(), and libMesh::ReplicatedMesh::stitching_helper().

◆ elem_dimensions()

const std::set<unsigned char>& libMesh::MeshBase::elem_dimensions ( ) const
inlineinherited
Returns
A const reference to a std::set of element dimensions present in the mesh.

Definition at line 225 of file mesh_base.h.

226  { return _elem_dims; }

References libMesh::MeshBase::_elem_dims.

Referenced by libMesh::System::calculate_norm(), and libMesh::TreeNode< N >::insert().

◆ elem_ptr() [1/2]

const Elem * libMesh::DistributedMesh::elem_ptr ( const dof_id_type  i) const
overridevirtualinherited
Returns
A pointer to the \( i^{th} \) element, which should be present in this processor's subset of the mesh data structure.

Implements libMesh::MeshBase.

Definition at line 382 of file distributed_mesh.C.

383 {
385  libmesh_assert_equal_to (_elements[i]->id(), i);
386 
387  return _elements[i];
388 }

References libMesh::DistributedMesh::_elements, and libMesh::libmesh_assert().

Referenced by libMesh::DistributedMesh::DistributedMesh().

◆ elem_ptr() [2/2]

Elem * libMesh::DistributedMesh::elem_ptr ( const dof_id_type  i)
overridevirtualinherited
Returns
A writable pointer to the \( i^{th} \) element, which should be present in this processor's subset of the mesh data structure.

Implements libMesh::MeshBase.

Definition at line 393 of file distributed_mesh.C.

394 {
396  libmesh_assert_equal_to (_elements[i]->id(), i);
397 
398  return _elements[i];
399 }

References libMesh::DistributedMesh::_elements, and libMesh::libmesh_assert().

◆ elem_ref() [1/2]

virtual Elem& libMesh::MeshBase::elem_ref ( const dof_id_type  i)
inlinevirtualinherited
Returns
A writable reference to the \( i^{th} \) element, which should be present in this processor's subset of the mesh data structure.

Definition at line 530 of file mesh_base.h.

530  {
531  return *this->elem_ptr(i);
532  }

References libMesh::MeshBase::elem_ptr().

◆ elem_ref() [2/2]

virtual const Elem& libMesh::MeshBase::elem_ref ( const dof_id_type  i) const
inlinevirtualinherited

◆ element_ptr_range() [1/2]

virtual SimpleRange<const_element_iterator> libMesh::DistributedMesh::element_ptr_range ( ) const
inlineoverridevirtualinherited

◆ element_ptr_range() [2/2]

virtual SimpleRange<element_iterator> libMesh::DistributedMesh::element_ptr_range ( )
inlineoverridevirtualinherited

◆ elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::elements_begin ( )
overridevirtualinherited

Elem iterator accessor functions.

Implements libMesh::MeshBase.

Referenced by libMesh::DistributedMesh::element_ptr_range().

◆ elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::elements_end ( )
overridevirtualinherited

◆ evaluable_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::evaluable_elements_begin ( const DofMap dof_map,
unsigned int  var_num = libMesh::invalid_uint 
) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ evaluable_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::evaluable_elements_begin ( const DofMap dof_map,
unsigned int  var_num = libMesh::invalid_uint 
)
overridevirtualinherited

Iterate over elements in the Mesh where the solution (as distributed by the given DofMap) can be evaluated, for the given variable var_num, or for all variables by default.

Implements libMesh::MeshBase.

◆ evaluable_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::evaluable_elements_end ( const DofMap dof_map,
unsigned int  var_num = libMesh::invalid_uint 
) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ evaluable_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::evaluable_elements_end ( const DofMap dof_map,
unsigned int  var_num = libMesh::invalid_uint 
)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ evaluable_nodes_begin() [1/2]

virtual const_node_iterator libMesh::DistributedMesh::evaluable_nodes_begin ( const DofMap dof_map,
unsigned int  var_num = libMesh::invalid_uint 
) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ evaluable_nodes_begin() [2/2]

virtual node_iterator libMesh::DistributedMesh::evaluable_nodes_begin ( const DofMap dof_map,
unsigned int  var_num = libMesh::invalid_uint 
)
overridevirtualinherited

Iterate over nodes in the Mesh where the solution (as distributed by the given DofMap) can be evaluated, for the given variable var_num, or for all variables by default.

Implements libMesh::MeshBase.

◆ evaluable_nodes_end() [1/2]

virtual const_node_iterator libMesh::DistributedMesh::evaluable_nodes_end ( const DofMap dof_map,
unsigned int  var_num = libMesh::invalid_uint 
) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ evaluable_nodes_end() [2/2]

virtual node_iterator libMesh::DistributedMesh::evaluable_nodes_end ( const DofMap dof_map,
unsigned int  var_num = libMesh::invalid_uint 
)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ extra_ghost_elems()

const std::set<Elem *>& libMesh::DistributedMesh::extra_ghost_elems ( ) const
inlineinherited

Const accessor to the ghosted elements.

Definition at line 226 of file distributed_mesh.h.

226 { return _extra_ghost_elems; }

References libMesh::DistributedMesh::_extra_ghost_elems.

Referenced by libMesh::DistributedMesh::clear_extra_ghost_elems().

◆ facelocal_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::facelocal_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ facelocal_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::facelocal_elements_begin ( )
overridevirtualinherited

Iterate over elements which are on or have a neighbor on the current processor.

Implements libMesh::MeshBase.

◆ facelocal_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::facelocal_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ facelocal_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::facelocal_elements_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ find_neighbors()

void libMesh::UnstructuredMesh::find_neighbors ( const bool  reset_remote_elements = false,
const bool  reset_current_list = true 
)
overridevirtualinherited

Other functions from MeshBase requiring re-definition.

Here we look at all of the child elements which don't already have valid neighbors.

If a child element has a nullptr neighbor it is either because it is on the boundary or because its neighbor is at a different level. In the latter case we must get the neighbor from the parent.

If a child element has a remote_elem neighbor on a boundary it shares with its parent, that info may have become out-dated through coarsening of the neighbor's parent. In this case, if the parent's neighbor is active then the child should share it.

Furthermore, that neighbor better be active, otherwise we missed a child somewhere.

We also need to look through children ordered by increasing refinement level in order to add new interior_parent() links in boundary elements which have just been generated by refinement, and fix links in boundary elements whose previous interior_parent() has just been coarsened away.

Implements libMesh::MeshBase.

Definition at line 257 of file unstructured_mesh.C.

259 {
260  // We might actually want to run this on an empty mesh
261  // (e.g. the boundary mesh for a nonexistent bcid!)
262  // libmesh_assert_not_equal_to (this->n_nodes(), 0);
263  // libmesh_assert_not_equal_to (this->n_elem(), 0);
264 
265  // This function must be run on all processors at once
266  parallel_object_only();
267 
268  LOG_SCOPE("find_neighbors()", "Mesh");
269 
270  //TODO:[BSK] This should be removed later?!
271  if (reset_current_list)
272  for (const auto & e : this->element_ptr_range())
273  for (auto s : e->side_index_range())
274  if (e->neighbor_ptr(s) != remote_elem || reset_remote_elements)
275  e->set_neighbor(s, nullptr);
276 
277  // Find neighboring elements by first finding elements
278  // with identical side keys and then check to see if they
279  // are neighbors
280  {
281  // data structures -- Use the hash_multimap if available
282  typedef unsigned int key_type;
283  typedef std::pair<Elem *, unsigned char> val_type;
284  typedef std::pair<key_type, val_type> key_val_pair;
285 
286  typedef std::unordered_multimap<key_type, val_type> map_type;
287 
288  // A map from side keys to corresponding elements & side numbers
289  map_type side_to_elem_map;
290 
291  // Pull objects out of the loop to reduce heap operations
292  std::unique_ptr<Elem> my_side, their_side;
293 
294  for (const auto & element : this->element_ptr_range())
295  {
296  for (auto ms : element->side_index_range())
297  {
298  next_side:
299  // If we haven't yet found a neighbor on this side, try.
300  // Even if we think our neighbor is remote, that
301  // information may be out of date.
302  if (element->neighbor_ptr(ms) == nullptr ||
303  element->neighbor_ptr(ms) == remote_elem)
304  {
305  // Get the key for the side of this element
306  const unsigned int key = element->key(ms);
307 
308  // Look for elements that have an identical side key
309  auto bounds = side_to_elem_map.equal_range(key);
310 
311  // May be multiple keys, check all the possible
312  // elements which _might_ be neighbors.
313  if (bounds.first != bounds.second)
314  {
315  // Get the side for this element
316  element->side_ptr(my_side, ms);
317 
318  // Look at all the entries with an equivalent key
319  while (bounds.first != bounds.second)
320  {
321  // Get the potential element
322  Elem * neighbor = bounds.first->second.first;
323 
324  // Get the side for the neighboring element
325  const unsigned int ns = bounds.first->second.second;
326  neighbor->side_ptr(their_side, ns);
327  //libmesh_assert(my_side.get());
328  //libmesh_assert(their_side.get());
329 
330  // If found a match with my side
331  //
332  // We need special tests here for 1D:
333  // since parents and children have an equal
334  // side (i.e. a node), we need to check
335  // ns != ms, and we also check level() to
336  // avoid setting our neighbor pointer to
337  // any of our neighbor's descendants
338  if ((*my_side == *their_side) &&
339  (element->level() == neighbor->level()) &&
340  ((element->dim() != 1) || (ns != ms)))
341  {
342  // So share a side. Is this a mixed pair
343  // of subactive and active/ancestor
344  // elements?
345  // If not, then we're neighbors.
346  // If so, then the subactive's neighbor is
347 
348  if (element->subactive() ==
349  neighbor->subactive())
350  {
351  // an element is only subactive if it has
352  // been coarsened but not deleted
353  element->set_neighbor (ms,neighbor);
354  neighbor->set_neighbor(ns,element);
355  }
356  else if (element->subactive())
357  {
358  element->set_neighbor(ms,neighbor);
359  }
360  else if (neighbor->subactive())
361  {
362  neighbor->set_neighbor(ns,element);
363  }
364  side_to_elem_map.erase (bounds.first);
365 
366  // get out of this nested crap
367  goto next_side;
368  }
369 
370  ++bounds.first;
371  }
372  }
373 
374  // didn't find a match...
375  // Build the map entry for this element
376  key_val_pair kvp;
377 
378  kvp.first = key;
379  kvp.second.first = element;
380  kvp.second.second = cast_int<unsigned char>(ms);
381  side_to_elem_map.insert (kvp);
382  }
383  }
384  }
385  }
386 
387 #ifdef LIBMESH_ENABLE_AMR
388 
416  const unsigned int n_levels = MeshTools::n_levels(*this);
417  for (unsigned int level = 1; level < n_levels; ++level)
418  {
419  for (auto & current_elem : as_range(level_elements_begin(level),
420  level_elements_end(level)))
421  {
422  libmesh_assert(current_elem);
423  Elem * parent = current_elem->parent();
424  libmesh_assert(parent);
425  const unsigned int my_child_num = parent->which_child_am_i(current_elem);
426 
427  for (auto s : current_elem->side_index_range())
428  {
429  if (current_elem->neighbor_ptr(s) == nullptr ||
430  (current_elem->neighbor_ptr(s) == remote_elem &&
431  parent->is_child_on_side(my_child_num, s)))
432  {
433  Elem * neigh = parent->neighbor_ptr(s);
434 
435  // If neigh was refined and had non-subactive children
436  // made remote earlier, then our current elem should
437  // actually have one of those remote children as a
438  // neighbor
439  if (neigh &&
440  (neigh->ancestor() ||
441  // If neigh has subactive children which should have
442  // matched as neighbors of the current element but
443  // did not, then those likewise must be remote
444  // children.
445  (current_elem->subactive() && neigh->has_children() &&
446  (neigh->level()+1) == current_elem->level())))
447  {
448 #ifdef DEBUG
449  // Let's make sure that "had children made remote"
450  // situation is actually the case
451  libmesh_assert(neigh->has_children());
452  bool neigh_has_remote_children = false;
453  for (auto & child : neigh->child_ref_range())
454  if (&child == remote_elem)
455  neigh_has_remote_children = true;
456  libmesh_assert(neigh_has_remote_children);
457 
458  // And let's double-check that we don't have
459  // a remote_elem neighboring an active local element
460  if (current_elem->active())
461  libmesh_assert_not_equal_to (current_elem->processor_id(),
462  this->processor_id());
463 #endif // DEBUG
464  neigh = const_cast<RemoteElem *>(remote_elem);
465  }
466  // If neigh and current_elem are more than one level
467  // apart, figuring out whether we have a remote
468  // neighbor here becomes much harder.
469  else if (neigh && (current_elem->subactive() &&
470  neigh->has_children()))
471  {
472  // Find the deepest descendant of neigh which
473  // we could consider for a neighbor. If we run
474  // out of neigh children, then that's our
475  // neighbor. If we find a potential neighbor
476  // with remote_children and we don't find any
477  // potential neighbors among its non-remote
478  // children, then our neighbor must be remote.
479  while (neigh != remote_elem &&
480  neigh->has_children())
481  {
482  bool found_neigh = false;
483  for (unsigned int c = 0, nc = neigh->n_children();
484  !found_neigh && c != nc; ++c)
485  {
486  Elem * child = neigh->child_ptr(c);
487  if (child == remote_elem)
488  continue;
489  for (auto ncn : child->neighbor_ptr_range())
490  {
491  if (ncn != remote_elem &&
492  ncn->is_ancestor_of(current_elem))
493  {
494  neigh = ncn;
495  found_neigh = true;
496  break;
497  }
498  }
499  }
500  if (!found_neigh)
501  neigh = const_cast<RemoteElem *>(remote_elem);
502  }
503  }
504  current_elem->set_neighbor(s, neigh);
505 #ifdef DEBUG
506  if (neigh != nullptr && neigh != remote_elem)
507  // We ignore subactive elements here because
508  // we don't care about neighbors of subactive element.
509  if ((!neigh->active()) && (!current_elem->subactive()))
510  {
511  libMesh::err << "On processor " << this->processor_id()
512  << std::endl;
513  libMesh::err << "Bad element ID = " << current_elem->id()
514  << ", Side " << s << ", Bad neighbor ID = " << neigh->id() << std::endl;
515  libMesh::err << "Bad element proc_ID = " << current_elem->processor_id()
516  << ", Bad neighbor proc_ID = " << neigh->processor_id() << std::endl;
517  libMesh::err << "Bad element size = " << current_elem->hmin()
518  << ", Bad neighbor size = " << neigh->hmin() << std::endl;
519  libMesh::err << "Bad element center = " << current_elem->centroid()
520  << ", Bad neighbor center = " << neigh->centroid() << std::endl;
521  libMesh::err << "ERROR: "
522  << (current_elem->active()?"Active":"Ancestor")
523  << " Element at level "
524  << current_elem->level() << std::endl;
525  libMesh::err << "with "
526  << (parent->active()?"active":
527  (parent->subactive()?"subactive":"ancestor"))
528  << " parent share "
529  << (neigh->subactive()?"subactive":"ancestor")
530  << " neighbor at level " << neigh->level()
531  << std::endl;
532  NameBasedIO(*this).write ("bad_mesh.gmv");
533  libmesh_error_msg("Problematic mesh written to bad_mesh.gmv.");
534  }
535 #endif // DEBUG
536  }
537  }
538 
539  // We can skip to the next element if we're full-dimension
540  // and therefore don't have any interior parents
541  if (current_elem->dim() >= LIBMESH_DIM)
542  continue;
543 
544  // We have no interior parents unless we can find one later
545  current_elem->set_interior_parent(nullptr);
546 
547  Elem * pip = parent->interior_parent();
548 
549  if (!pip)
550  continue;
551 
552  // If there's no interior_parent children, whether due to a
553  // remote element or a non-conformity, then there's no
554  // children to search.
555  if (pip == remote_elem || pip->active())
556  {
557  current_elem->set_interior_parent(pip);
558  continue;
559  }
560 
561  // For node comparisons we'll need a sensible tolerance
562  Real node_tolerance = current_elem->hmin() * TOLERANCE;
563 
564  // Otherwise our interior_parent should be a child of our
565  // parent's interior_parent.
566  for (auto & child : pip->child_ref_range())
567  {
568  // If we have a remote_elem, that might be our
569  // interior_parent. We'll set it provisionally now and
570  // keep trying to find something better.
571  if (&child == remote_elem)
572  {
573  current_elem->set_interior_parent
574  (const_cast<RemoteElem *>(remote_elem));
575  continue;
576  }
577 
578  bool child_contains_our_nodes = true;
579  for (auto & n : current_elem->node_ref_range())
580  {
581  bool child_contains_this_node = false;
582  for (auto & cn : child.node_ref_range())
583  if (cn.absolute_fuzzy_equals
584  (n, node_tolerance))
585  {
586  child_contains_this_node = true;
587  break;
588  }
589  if (!child_contains_this_node)
590  {
591  child_contains_our_nodes = false;
592  break;
593  }
594  }
595  if (child_contains_our_nodes)
596  {
597  current_elem->set_interior_parent(&child);
598  break;
599  }
600  }
601 
602  // We should have found *some* interior_parent at this
603  // point, whether semilocal or remote.
604  libmesh_assert(current_elem->interior_parent());
605  }
606  }
607 
608 #endif // AMR
609 
610 
611 #ifdef DEBUG
613  !reset_remote_elements);
615 #endif
616 }

References libMesh::Elem::active(), libMesh::Elem::ancestor(), libMesh::as_range(), libMesh::Elem::centroid(), libMesh::Elem::child_ptr(), libMesh::Elem::child_ref_range(), libMesh::MeshBase::element_ptr_range(), libMesh::err, libMesh::Elem::has_children(), libMesh::Elem::hmin(), libMesh::DofObject::id(), libMesh::Elem::interior_parent(), libMesh::Elem::is_ancestor_of(), libMesh::Elem::is_child_on_side(), libMesh::Elem::level(), libMesh::MeshBase::level_elements_begin(), libMesh::MeshBase::level_elements_end(), libMesh::libmesh_assert(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::Elem::n_children(), libMesh::MeshTools::n_levels(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::neighbor_ptr_range(), libMesh::Elem::parent(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::Real, libMesh::remote_elem, libMesh::Elem::set_interior_parent(), libMesh::Elem::set_neighbor(), libMesh::Elem::side_ptr(), libMesh::Elem::subactive(), libMesh::TOLERANCE, libMesh::Elem::which_child_am_i(), and libMesh::NameBasedIO::write().

Referenced by libMesh::TriangleWrapper::copy_tri_to_mesh(), and libMesh::DistributedMesh::redistribute().

◆ fix_broken_node_and_element_numbering()

void libMesh::DistributedMesh::fix_broken_node_and_element_numbering ( )
overridevirtualinherited

There is no reason for a user to ever call this function.

This function restores a previously broken element/node numbering such that mesh.node_ref(n).id() == n.

Implements libMesh::MeshBase.

Definition at line 1365 of file distributed_mesh.C.

1366 {
1367  // We need access to iterators for the underlying containers,
1368  // not the mapvector<> reimplementations.
1371 
1372  // Nodes first
1373  for (auto & pr : nodes)
1374  if (pr.second != nullptr)
1375  pr.second->set_id() = pr.first;
1376 
1377  // Elements next
1378  for (const auto & pr : elems)
1379  if (pr.second != nullptr)
1380  pr.second->set_id() = pr.first;
1381 }

References libMesh::DistributedMesh::_elements, and libMesh::DistributedMesh::_nodes.

◆ flagged_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::flagged_elements_begin ( unsigned char  rflag) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ flagged_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::flagged_elements_begin ( unsigned char  rflag)
overridevirtualinherited

Iterate over all elements with a specified refinement flag.

Implements libMesh::MeshBase.

◆ flagged_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::flagged_elements_end ( unsigned char  rflag) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ flagged_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::flagged_elements_end ( unsigned char  rflag)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ flagged_pid_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::flagged_pid_elements_begin ( unsigned char  rflag,
processor_id_type  pid 
) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ flagged_pid_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::flagged_pid_elements_begin ( unsigned char  rflag,
processor_id_type  pid 
)
overridevirtualinherited

Iterate over all elements with a specified refinement flag on a specified processor.

Implements libMesh::MeshBase.

◆ flagged_pid_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::flagged_pid_elements_end ( unsigned char  rflag,
processor_id_type  pid 
) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ flagged_pid_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::flagged_pid_elements_end ( unsigned char  rflag,
processor_id_type  pid 
)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ gather_to_zero()

void libMesh::DistributedMesh::gather_to_zero ( )
overridevirtualinherited

Gathers all elements and nodes of the mesh onto processor zero.

Reimplemented from libMesh::MeshBase.

Definition at line 1526 of file distributed_mesh.C.

1527 {
1529  return;
1530 
1531  _is_serial_on_proc_0 = true;
1532  MeshCommunication().gather(0, *this);
1533 }

References libMesh::DistributedMesh::_is_serial_on_proc_0, and libMesh::MeshBase::MeshCommunication.

◆ get_boundary_info() [1/2]

BoundaryInfo& libMesh::MeshBase::get_boundary_info ( )
inlineinherited

Writable information about boundary ids on the mesh.

Definition at line 137 of file mesh_base.h.

137 { return *boundary_info; }

References libMesh::MeshBase::boundary_info.

◆ get_boundary_info() [2/2]

const BoundaryInfo& libMesh::MeshBase::get_boundary_info ( ) const
inlineinherited

The information about boundary ids on the mesh.

Definition at line 132 of file mesh_base.h.

132 { return *boundary_info; }

References libMesh::MeshBase::boundary_info.

Referenced by libMesh::MeshRefinement::_coarsen_elements(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Subdivision::all_subdivision(), libMesh::MeshTools::Modification::all_tri(), LinearElasticity::assemble(), assemble_elasticity(), assemble_poisson(), assemble_shell(), libMesh::AbaqusIO::assign_boundary_node_ids(), libMesh::AbaqusIO::assign_sideset_ids(), AssemblyA0::boundary_assembly(), AssemblyF0::boundary_assembly(), AssemblyA1::boundary_assembly(), AssemblyF1::boundary_assembly(), AssemblyF2::boundary_assembly(), AssemblyA2::boundary_assembly(), libMesh::MeshTools::Generation::build_delaunay_square(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::MeshTools::Modification::change_boundary_id(), libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::TriangleWrapper::copy_tri_to_mesh(), libMesh::UnstructuredMesh::create_submesh(), libMesh::TetGenMeshInterface::delete_2D_hull_elements(), libMesh::ReplicatedMesh::delete_elem(), libMesh::DistributedMesh::delete_elem(), libMesh::ReplicatedMesh::delete_node(), libMesh::DistributedMesh::delete_node(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DistributedMesh::DistributedMesh(), libMesh::MeshTools::Modification::flatten(), libMesh::UNVIO::groups_in(), LinearElasticityWithContact::initialize_contact_load_paths(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), main(), AugmentSparsityOnInterface::mesh_reinit(), libMesh::Parallel::Packing< const Node * >::pack(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::Parallel::Packing< const Node * >::packable_size(), libMesh::Parallel::Packing< const Elem * >::packable_size(), libMesh::TetGenMeshInterface::pointset_convexhull(), libMesh::Nemesis_IO::prepare_to_write_nodal_data(), libMesh::AbaqusIO::read(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::CheckpointIO::read_bcs(), libMesh::CheckpointIO::read_header(), libMesh::GmshIO::read_mesh(), libMesh::CheckpointIO::read_nodesets(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::ReplicatedMesh::renumber_nodes_and_elements(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::ReplicatedMesh::ReplicatedMesh(), libMesh::ReplicatedMesh::stitching_helper(), libMesh::BoundaryInfo::sync(), AllTriTest::test_helper_2D(), AllTriTest::test_helper_3D(), SystemsTest::testBoundaryProjectCube(), BoundaryInfoTest::testEdgeBoundaryConditions(), BoundaryInfoTest::testMesh(), BoundaryInfoTest::testShellFaceConstraints(), WriteEdgesetData::testWrite(), WriteSidesetData::testWrite(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::FroIO::write(), libMesh::Nemesis_IO::write(), libMesh::ExodusII_IO::write(), libMesh::XdrIO::write(), libMesh::CheckpointIO::write(), libMesh::GmshIO::write_mesh(), libMesh::XdrIO::write_serialized_bcs_helper(), and libMesh::XdrIO::write_serialized_nodesets().

◆ get_count_lower_dim_elems_in_point_locator()

bool libMesh::MeshBase::get_count_lower_dim_elems_in_point_locator ( ) const
inherited

Get the current value of _count_lower_dim_elems_in_point_locator.

Definition at line 710 of file mesh_base.C.

711 {
713 }

Referenced by libMesh::TreeNode< N >::insert().

◆ get_elem_integer_index()

unsigned int libMesh::MeshBase::get_elem_integer_index ( const std::string &  name) const
inherited

Definition at line 224 of file mesh_base.C.

225 {
226  for (auto i : index_range(_elem_integer_names))
227  if (_elem_integer_names[i] == name)
228  return i;
229 
230  libmesh_error_msg("Unknown elem integer " << name);
231  return libMesh::invalid_uint;
232 }

References libMesh::index_range(), libMesh::invalid_uint, and libMesh::Quality::name().

◆ get_elem_integer_name()

const std::string& libMesh::MeshBase::get_elem_integer_name ( unsigned int  i) const
inlineinherited

Definition at line 818 of file mesh_base.h.

819  { return _elem_integer_names[i]; }

References libMesh::MeshBase::_elem_integer_names.

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

◆ get_id_by_name()

subdomain_id_type libMesh::MeshBase::get_id_by_name ( const std::string &  name) const
inherited
Returns
The id of the named subdomain if it exists, Elem::invalid_subdomain_id otherwise.

Definition at line 737 of file mesh_base.C.

738 {
739  // Linear search over the map values.
740  std::map<subdomain_id_type, std::string>::const_iterator
741  iter = _block_id_to_name.begin(),
742  end_iter = _block_id_to_name.end();
743 
744  for ( ; iter != end_iter; ++iter)
745  if (iter->second == name)
746  return iter->first;
747 
748  // If we made it here without returning, we don't have a subdomain
749  // with the requested name, so return Elem::invalid_subdomain_id.
751 }

References libMesh::Quality::name().

◆ get_info()

std::string libMesh::MeshBase::get_info ( ) const
inherited
Returns
A string containing relevant information about the mesh.

Definition at line 551 of file mesh_base.C.

552 {
553  std::ostringstream oss;
554 
555  oss << " Mesh Information:" << '\n';
556 
557  if (!_elem_dims.empty())
558  {
559  oss << " elem_dimensions()={";
560  std::copy(_elem_dims.begin(),
561  --_elem_dims.end(), // --end() is valid if the set is non-empty
562  std::ostream_iterator<unsigned int>(oss, ", "));
563  oss << cast_int<unsigned int>(*_elem_dims.rbegin());
564  oss << "}\n";
565  }
566 
567  oss << " spatial_dimension()=" << this->spatial_dimension() << '\n'
568  << " n_nodes()=" << this->n_nodes() << '\n'
569  << " n_local_nodes()=" << this->n_local_nodes() << '\n'
570  << " n_elem()=" << this->n_elem() << '\n'
571  << " n_local_elem()=" << this->n_local_elem() << '\n'
572 #ifdef LIBMESH_ENABLE_AMR
573  << " n_active_elem()=" << this->n_active_elem() << '\n'
574 #endif
575  << " n_subdomains()=" << static_cast<std::size_t>(this->n_subdomains()) << '\n'
576  << " n_partitions()=" << static_cast<std::size_t>(this->n_partitions()) << '\n'
577  << " n_processors()=" << static_cast<std::size_t>(this->n_processors()) << '\n'
578  << " n_threads()=" << static_cast<std::size_t>(libMesh::n_threads()) << '\n'
579  << " processor_id()=" << static_cast<std::size_t>(this->processor_id()) << '\n';
580 
581  return oss.str();
582 }

References libMesh::MeshTools::n_elem(), n_nodes, and libMesh::n_threads().

◆ get_node_integer_index()

unsigned int libMesh::MeshBase::get_node_integer_index ( const std::string &  name) const
inherited

Definition at line 295 of file mesh_base.C.

296 {
297  for (auto i : index_range(_node_integer_names))
298  if (_node_integer_names[i] == name)
299  return i;
300 
301  libmesh_error_msg("Unknown node integer " << name);
302  return libMesh::invalid_uint;
303 }

References libMesh::index_range(), libMesh::invalid_uint, and libMesh::Quality::name().

◆ get_node_integer_name()

const std::string& libMesh::MeshBase::get_node_integer_name ( unsigned int  i) const
inlineinherited

Definition at line 915 of file mesh_base.h.

916  { return _node_integer_names[i]; }

References libMesh::MeshBase::_node_integer_names.

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

◆ get_point_locator_close_to_point_tol()

Real libMesh::MeshBase::get_point_locator_close_to_point_tol ( ) const
inherited

Definition at line 919 of file mesh_base.C.

920 {
922 }

◆ get_subdomain_name_map()

const std::map<subdomain_id_type, std::string>& libMesh::MeshBase::get_subdomain_name_map ( ) const
inlineinherited

◆ ghost_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::ghost_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ ghost_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::ghost_elements_begin ( )
overridevirtualinherited

Iterate over "ghost" elements in the Mesh.

A ghost element is one which is not local, but is semilocal.

Implements libMesh::MeshBase.

◆ ghost_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::ghost_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ ghost_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::ghost_elements_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ ghosting_functors_begin()

std::set<GhostingFunctor *>::const_iterator libMesh::MeshBase::ghosting_functors_begin ( ) const
inlineinherited

◆ ghosting_functors_end()

std::set<GhostingFunctor *>::const_iterator libMesh::MeshBase::ghosting_functors_end ( ) const
inlineinherited

◆ has_elem_integer()

bool libMesh::MeshBase::has_elem_integer ( const std::string &  name) const
inherited

Definition at line 236 of file mesh_base.C.

237 {
238  for (auto & entry : _elem_integer_names)
239  if (entry == name)
240  return true;
241 
242  return false;
243 }

References libMesh::Quality::name().

◆ has_node_integer()

bool libMesh::MeshBase::has_node_integer ( const std::string &  name) const
inherited

Definition at line 307 of file mesh_base.C.

308 {
309  for (auto & entry : _node_integer_names)
310  if (entry == name)
311  return true;
312 
313  return false;
314 }

References libMesh::Quality::name().

◆ insert_elem()

Elem * libMesh::DistributedMesh::insert_elem ( Elem e)
overridevirtualinherited

Insert elem e to the element array, preserving its id and replacing/deleting any existing element with the same id.

Users should call MeshBase::prepare_for_use() after elements are added to and/or deleted from the mesh.

Implements libMesh::MeshBase.

Definition at line 540 of file distributed_mesh.C.

541 {
542  if (_elements[e->id()])
543  this->delete_elem(_elements[e->id()]);
544 
545 #ifdef LIBMESH_ENABLE_UNIQUE_ID
546  if (!e->valid_unique_id())
547  {
548  if (processor_id() == e->processor_id())
549  {
550  e->set_unique_id() = _next_unique_id;
551  _next_unique_id += this->n_processors() + 1;
552  }
553  else
554  {
555  e->set_unique_id() = _next_unpartitioned_unique_id;
557  }
558  }
559 #endif
560 
561  // Try to make the cached elem data more accurate
562  processor_id_type elem_procid = e->processor_id();
563  if (elem_procid == this->processor_id() ||
564  elem_procid == DofObject::invalid_processor_id)
565  _n_elem++;
566 
567  _elements[e->id()] = e;
568 
569  // Make sure any new element is given space for any extra integers
570  // we've requested
571  e->add_extra_integers(_elem_integer_names.size());
572 
573  // And set mapping type and data on any new element
574  e->set_mapping_type(this->default_mapping_type());
575  e->set_mapping_data(this->default_mapping_data());
576 
577  return e;
578 }

References libMesh::MeshBase::_elem_integer_names, libMesh::DistributedMesh::_elements, libMesh::DistributedMesh::_n_elem, libMesh::MeshBase::_next_unique_id, libMesh::DistributedMesh::_next_unpartitioned_unique_id, libMesh::DofObject::add_extra_integers(), libMesh::MeshBase::default_mapping_data(), libMesh::MeshBase::default_mapping_type(), libMesh::DistributedMesh::delete_elem(), libMesh::DofObject::id(), libMesh::DofObject::invalid_processor_id, libMesh::ParallelObject::n_processors(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::Elem::set_mapping_data(), libMesh::Elem::set_mapping_type(), libMesh::DofObject::set_unique_id(), and libMesh::DofObject::valid_unique_id().

◆ insert_node()

Node * libMesh::DistributedMesh::insert_node ( Node n)
overridevirtualinherited

Calls add_node().

Implements libMesh::MeshBase.

Definition at line 761 of file distributed_mesh.C.

762 {
763  return DistributedMesh::add_node(n);
764 }

References libMesh::DistributedMesh::add_node().

◆ is_prepared()

bool libMesh::MeshBase::is_prepared ( ) const
inlineinherited
Returns
true if the mesh has been prepared via a call to prepare_for_use, false otherwise.

Definition at line 152 of file mesh_base.h.

153  { return _is_prepared; }

References libMesh::MeshBase::_is_prepared.

Referenced by libMesh::MeshRefinement::_refine_elements(), and libMesh::DofMap::create_dof_constraints().

◆ is_replicated()

virtual bool libMesh::DistributedMesh::is_replicated ( ) const
inlineoverridevirtualinherited
Returns
true if new elements and nodes can and should be created in synchronization on all processors, false otherwise

Reimplemented from libMesh::MeshBase.

Definition at line 141 of file distributed_mesh.h.

142  { return false; }

◆ is_serial()

virtual bool libMesh::DistributedMesh::is_serial ( ) const
inlineoverridevirtualinherited
Returns
true if all elements and nodes of the mesh exist on the current processor, false otherwise

Reimplemented from libMesh::MeshBase.

Definition at line 119 of file distributed_mesh.h.

120  { return _is_serial; }

References libMesh::DistributedMesh::_is_serial.

Referenced by libMesh::DistributedMesh::redistribute().

◆ is_serial_on_zero()

virtual bool libMesh::DistributedMesh::is_serial_on_zero ( ) const
inlineoverridevirtualinherited
Returns
true if all elements and nodes of the mesh exist on the processor 0, false otherwise

Reimplemented from libMesh::MeshBase.

Definition at line 126 of file distributed_mesh.h.

127  { return _is_serial || _is_serial_on_proc_0; }

References libMesh::DistributedMesh::_is_serial, and libMesh::DistributedMesh::_is_serial_on_proc_0.

◆ level_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::level_elements_begin ( unsigned int  level) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ level_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::level_elements_begin ( unsigned int  level)
overridevirtualinherited

Iterate over elements of a given level.

Implements libMesh::MeshBase.

◆ level_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::level_elements_end ( unsigned int  level) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ level_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::level_elements_end ( unsigned int  level)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ libmesh_assert_valid_parallel_flags()

void libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags ( ) const
inherited

Verify refinement_flag and p_refinement_flag consistency of our elements containers.

Calls libmesh_assert() on each possible failure.

Definition at line 999 of file distributed_mesh.C.

1000 {
1001 #if defined(LIBMESH_ENABLE_AMR) && !defined(NDEBUG)
1002  // This function must be run on all processors at once
1003  parallel_object_only();
1004 
1005  dof_id_type pmax_elem_id = this->parallel_max_elem_id();
1006 
1007  for (dof_id_type i=0; i != pmax_elem_id; ++i)
1008  {
1009  Elem * el = _elements[i]; // Returns nullptr if there's no map entry
1010 
1011  unsigned int refinement_flag = el ?
1012  static_cast<unsigned int> (el->refinement_flag()) : libMesh::invalid_uint;
1013  unsigned int p_refinement_flag = el ?
1014  static_cast<unsigned int> (el->p_refinement_flag()) : libMesh::invalid_uint;
1015 
1016  libmesh_assert(this->comm().semiverify(el ? &refinement_flag : nullptr));
1017 
1018  // p refinement flags aren't always kept correct on inactive
1019  // ghost elements
1020  libmesh_assert(this->comm().semiverify((el && el->active()) ? &p_refinement_flag : nullptr));
1021  }
1022 #endif // LIBMESH_ENABLE_AMR
1023 }

References libMesh::DistributedMesh::_elements, libMesh::Elem::active(), libMesh::ParallelObject::comm(), libMesh::invalid_uint, libMesh::libmesh_assert(), libMesh::Elem::p_refinement_flag(), libMesh::DistributedMesh::parallel_max_elem_id(), and libMesh::Elem::refinement_flag().

Referenced by libMesh::DistributedMesh::allgather(), libMesh::DistributedMesh::delete_remote_elements(), and libMesh::DistributedMesh::renumber_nodes_and_elements().

◆ libmesh_assert_valid_parallel_ids()

void libMesh::DistributedMesh::libmesh_assert_valid_parallel_ids ( ) const
overridevirtualinherited

◆ libmesh_assert_valid_parallel_object_ids()

template<typename T >
void libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids ( const mapvector< T *, dof_id_type > &  objects) const
inherited

Verify id, processor_id, and if applicable unique_id consistency of a parallel objects container.

Calls libmesh_assert() on each possible failure in that container.

Definition at line 912 of file distributed_mesh.C.

913 {
914  // This function must be run on all processors at once
915  parallel_object_only();
916 
917  const dof_id_type pmax_node_id = this->parallel_max_node_id();
918  const dof_id_type pmax_elem_id = this->parallel_max_elem_id();
919  const dof_id_type pmax_id = std::max(pmax_node_id, pmax_elem_id);
920 
921  for (dof_id_type i=0; i != pmax_id; ++i)
922  {
923  T * obj = objects[i]; // Returns nullptr if there's no map entry
924 
925  // Local lookups by id should return the requested object
926  libmesh_assert(!obj || obj->id() == i);
927 
928  // All processors with an object should agree on id
929 #ifndef NDEBUG
930  const dof_id_type dofid = obj && obj->valid_id() ?
931  obj->id() : DofObject::invalid_id;
932  libmesh_assert(this->comm().semiverify(obj ? &dofid : nullptr));
933 #endif
934 
935  // All processors with an object should agree on processor id
936  const dof_id_type procid = obj && obj->valid_processor_id() ?
937  obj->processor_id() : DofObject::invalid_processor_id;
938  libmesh_assert(this->comm().semiverify(obj ? &procid : nullptr));
939 
940  dof_id_type min_procid = procid;
941  this->comm().min(min_procid);
942 
943  // Either:
944  // 1.) I own this elem (min_procid == this->processor_id()) *and* I have a valid pointer to it (obj != nullptr)
945  // or
946  // 2.) I don't own this elem (min_procid != this->processor_id()). (In this case I may or may not have a valid pointer to it.)
947 
948  // Original assert logic
949  // libmesh_assert (min_procid != this->processor_id() || obj);
950 
951  // More human-understandable logic...
953  ((min_procid == this->processor_id()) && obj)
954  ||
955  (min_procid != this->processor_id())
956  );
957 
958 #if defined(LIBMESH_ENABLE_UNIQUE_ID) && !defined(NDEBUG)
959  // All processors with an object should agree on unique id
960  const unique_id_type uniqueid = obj ? obj->unique_id() : 0;
961  libmesh_assert(this->comm().semiverify(obj ? &uniqueid : nullptr));
962 #endif
963  }
964 }

References libMesh::ParallelObject::comm(), libMesh::DofObject::invalid_id, libMesh::DofObject::invalid_processor_id, libMesh::libmesh_assert(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), and libMesh::ParallelObject::processor_id().

Referenced by libMesh::DistributedMesh::libmesh_assert_valid_parallel_ids().

◆ libmesh_assert_valid_parallel_p_levels()

void libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels ( ) const
inherited

Verify p_level consistency of our elements containers.

Calls libmesh_assert() on each possible failure.

Definition at line 976 of file distributed_mesh.C.

977 {
978 #ifndef NDEBUG
979  // This function must be run on all processors at once
980  parallel_object_only();
981 
982  dof_id_type pmax_elem_id = this->parallel_max_elem_id();
983 
984  for (dof_id_type i=0; i != pmax_elem_id; ++i)
985  {
986  Elem * el = _elements[i]; // Returns nullptr if there's no map entry
987 
988  unsigned int p_level = el ? (el->p_level()) : libMesh::invalid_uint;
989 
990  // All processors with an active element should agree on p level
991  libmesh_assert(this->comm().semiverify((el && el->active()) ? &p_level : nullptr));
992  }
993 #endif
994 }

References libMesh::DistributedMesh::_elements, libMesh::Elem::active(), libMesh::ParallelObject::comm(), libMesh::invalid_uint, libMesh::libmesh_assert(), libMesh::Elem::p_level(), and libMesh::DistributedMesh::parallel_max_elem_id().

Referenced by libMesh::DistributedMesh::renumber_nodes_and_elements().

◆ local_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::local_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ local_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::local_elements_begin ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ local_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::local_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ local_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::local_elements_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ local_level_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::local_level_elements_begin ( unsigned int  level) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ local_level_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::local_level_elements_begin ( unsigned int  level)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ local_level_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::local_level_elements_end ( unsigned int  level) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ local_level_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::local_level_elements_end ( unsigned int  level)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ local_node_ptr_range() [1/2]

virtual SimpleRange<const_node_iterator> libMesh::DistributedMesh::local_node_ptr_range ( ) const
inlineoverridevirtualinherited

◆ local_node_ptr_range() [2/2]

virtual SimpleRange<node_iterator> libMesh::DistributedMesh::local_node_ptr_range ( )
inlineoverridevirtualinherited

◆ local_nodes_begin() [1/2]

virtual const_node_iterator libMesh::DistributedMesh::local_nodes_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ local_nodes_begin() [2/2]

virtual node_iterator libMesh::DistributedMesh::local_nodes_begin ( )
overridevirtualinherited

Iterate over local nodes (nodes whose processor_id() matches the current processor).

Implements libMesh::MeshBase.

Referenced by libMesh::DistributedMesh::local_node_ptr_range(), and main().

◆ local_nodes_end() [1/2]

virtual const_node_iterator libMesh::DistributedMesh::local_nodes_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ local_nodes_end() [2/2]

virtual node_iterator libMesh::DistributedMesh::local_nodes_end ( )
overridevirtualinherited

◆ local_not_level_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::local_not_level_elements_begin ( unsigned int  level) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ local_not_level_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::local_not_level_elements_begin ( unsigned int  level)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ local_not_level_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::local_not_level_elements_end ( unsigned int  level) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ local_not_level_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::local_not_level_elements_end ( unsigned int  level)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ max_elem_id()

virtual dof_id_type libMesh::DistributedMesh::max_elem_id ( ) const
inlineoverridevirtualinherited

◆ max_node_id()

virtual dof_id_type libMesh::DistributedMesh::max_node_id ( ) const
inlineoverridevirtualinherited

◆ merge_extra_integer_names()

std::pair< std::vector< unsigned int >, std::vector< unsigned int > > libMesh::MeshBase::merge_extra_integer_names ( const MeshBase other)
protectedinherited

Merge extra-integer arrays from an other mesh.

Returns two mappings from index values in other to (possibly newly created) index values with the same string name in this mesh, the first for element integers and the second for node integers.

Definition at line 944 of file mesh_base.C.

945 {
946  std::pair<std::vector<unsigned int>, std::vector<unsigned int>> returnval;
947  returnval.first = this->add_elem_integers(other._elem_integer_names);
948  returnval.second = this->add_node_integers(other._node_integer_names);
949  return returnval;
950 }

References libMesh::MeshBase::_elem_integer_names, and libMesh::MeshBase::_node_integer_names.

Referenced by libMesh::UnstructuredMesh::copy_nodes_and_elements(), and libMesh::UnstructuredMesh::create_submesh().

◆ mesh_dimension()

unsigned int libMesh::MeshBase::mesh_dimension ( ) const
inherited
Returns
The logical dimension of the mesh; i.e. the manifold dimension of the elements in the mesh. If we ever support multi-dimensional meshes (e.g. hexes and quads in the same mesh) then this will return the largest such dimension.

Definition at line 135 of file mesh_base.C.

136 {
137  if (!_elem_dims.empty())
138  return cast_int<unsigned int>(*_elem_dims.rbegin());
139  return 0;
140 }

References libMesh::MeshBase::_elem_dims.

Referenced by libMesh::HPCoarsenTest::add_projection(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), assemble(), LinearElasticity::assemble(), assemble_1D(), AssembleOptimization::assemble_A_and_F(), assemble_biharmonic(), assemble_cd(), assemble_elasticity(), assemble_ellipticdg(), assemble_helmholtz(), assemble_laplace(), assemble_mass(), assemble_matrices(), assemble_poisson(), assemble_SchroedingerEquation(), assemble_shell(), assemble_stokes(), assemble_wave(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::EquationSystems::build_variable_names(), compute_jacobian(), compute_residual(), LinearElasticityWithContact::compute_stresses(), LinearElasticity::compute_stresses(), compute_stresses(), LargeDeformationElasticity::compute_stresses(), libMesh::DofMap::create_dof_constraints(), libMesh::MeshTools::Modification::distort(), SolidSystem::element_time_derivative(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::ReplicatedMesh::get_boundary_points(), libMesh::LaplaceMeshSmoother::init(), libMesh::PointLocatorTree::init(), SolidSystem::init_data(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::RBEIMAssembly::initialize_fe(), integrate_function(), LaplaceYoung::jacobian(), LargeDeformationElasticity::jacobian(), main(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::GMVIO::read(), libMesh::VTKIO::read(), libMesh::System::read_header(), libMesh::UCDIO::read_implementation(), libMesh::XdrIO::read_serialized_connectivity(), LaplaceYoung::residual(), LargeDeformationElasticity::residual(), LinearElasticityWithContact::residual_and_jacobian(), SolidSystem::save_initial_mesh(), setup(), libMesh::MeshTools::Modification::smooth(), MeshSpatialDimensionTest::test1D(), MeshSpatialDimensionTest::test2D(), InfFERadialTest::testSingleOrder(), libMesh::BoundaryVolumeSolutionTransfer::transfer(), libMesh::DTKSolutionTransfer::transfer(), libMesh::DofMap::use_coupled_neighbor_dofs(), libMesh::PostscriptIO::write(), libMesh::CheckpointIO::write(), libMesh::TecplotIO::write_binary(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::UCDIO::write_implementation(), libMesh::UCDIO::write_nodal_data(), libMesh::EnsightIO::write_scalar_ascii(), libMesh::GnuPlotIO::write_solution(), and libMesh::EnsightIO::write_vector_ascii().

◆ n_active_elem()

dof_id_type libMesh::DistributedMesh::n_active_elem ( ) const
overridevirtualinherited
Returns
The number of active elements in the mesh.

Implemented in terms of active_element_iterators.

Implements libMesh::MeshBase.

Definition at line 1385 of file distributed_mesh.C.

1386 {
1387  parallel_object_only();
1388 
1389  // Get local active elements first
1390  dof_id_type active_elements =
1391  static_cast<dof_id_type>(std::distance (this->active_local_elements_begin(),
1392  this->active_local_elements_end()));
1393  this->comm().sum(active_elements);
1394 
1395  // Then add unpartitioned active elements, which should exist on
1396  // every processor
1397  active_elements +=
1398  static_cast<dof_id_type>(std::distance
1401  return active_elements;
1402 }

References libMesh::DistributedMesh::active_local_elements_begin(), libMesh::DistributedMesh::active_local_elements_end(), libMesh::DistributedMesh::active_pid_elements_begin(), libMesh::DistributedMesh::active_pid_elements_end(), libMesh::ParallelObject::comm(), distance(), and libMesh::DofObject::invalid_processor_id.

◆ n_active_elem_on_proc()

dof_id_type libMesh::MeshBase::n_active_elem_on_proc ( const processor_id_type  proc) const
inherited
Returns
The number of active elements on processor proc.

Definition at line 518 of file mesh_base.C.

519 {
520  libmesh_assert_less (proc_id, this->n_processors());
521  return static_cast<dof_id_type>(std::distance (this->active_pid_elements_begin(proc_id),
522  this->active_pid_elements_end (proc_id)));
523 }

References distance().

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

◆ n_active_local_elem()

dof_id_type libMesh::MeshBase::n_active_local_elem ( ) const
inlineinherited
Returns
The number of active elements on the local processor.

Definition at line 420 of file mesh_base.h.

421  { return this->n_active_elem_on_proc (this->processor_id()); }

References libMesh::MeshBase::n_active_elem_on_proc(), and libMesh::ParallelObject::processor_id().

Referenced by libMesh::VTKIO::cells_to_vtk().

◆ n_active_sub_elem()

dof_id_type libMesh::MeshBase::n_active_sub_elem ( ) const
inherited

Same as n_sub_elem(), but only counts active elements.

Definition at line 539 of file mesh_base.C.

540 {
541  dof_id_type ne=0;
542 
543  for (const auto & elem : this->active_element_ptr_range())
544  ne += elem->n_sub_elem();
545 
546  return ne;
547 }

Referenced by libMesh::TecplotIO::write_ascii(), libMesh::GMVIO::write_ascii_old_impl(), and libMesh::TecplotIO::write_binary().

◆ n_elem()

virtual dof_id_type libMesh::DistributedMesh::n_elem ( ) const
inlineoverridevirtualinherited
Returns
The number of elements in the mesh.

The standard n_elem() function may return a cached value on distributed meshes, and so can be called by any processor at any time.

Implements libMesh::MeshBase.

Definition at line 232 of file distributed_mesh.h.

232 { return _n_elem; }

References libMesh::DistributedMesh::_n_elem.

Referenced by libMesh::DistributedMesh::allgather(), libMesh::DistributedMesh::delete_remote_elements(), libMesh::DistributedMesh::DistributedMesh(), libMesh::DistributedMesh::renumber_nodes_and_elements(), SlitMeshTest::testMesh(), and MeshInputTest::testMeshMoveConstructor().

◆ n_elem_integers()

unsigned int libMesh::MeshBase::n_elem_integers ( ) const
inlineinherited

◆ n_elem_on_proc()

dof_id_type libMesh::MeshBase::n_elem_on_proc ( const processor_id_type  proc) const
inherited
Returns
The number of elements on processor proc.

Definition at line 505 of file mesh_base.C.

506 {
507  // We're either counting a processor's elements or unpartitioned
508  // elements
509  libmesh_assert (proc_id < this->n_processors() ||
511 
512  return static_cast<dof_id_type>(std::distance (this->pid_elements_begin(proc_id),
513  this->pid_elements_end (proc_id)));
514 }

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

Referenced by libMesh::MeshBase::n_local_elem(), and libMesh::MeshBase::n_unpartitioned_elem().

◆ n_local_elem()

dof_id_type libMesh::MeshBase::n_local_elem ( ) const
inlineinherited
Returns
The number of elements on the local processor.

Definition at line 403 of file mesh_base.h.

404  { return this->n_elem_on_proc (this->processor_id()); }

References libMesh::MeshBase::n_elem_on_proc(), and libMesh::ParallelObject::processor_id().

Referenced by libMesh::DTKAdapter::DTKAdapter(), and libMesh::DistributedMesh::parallel_n_elem().

◆ n_local_nodes()

dof_id_type libMesh::MeshBase::n_local_nodes ( ) const
inlineinherited
Returns
The number of nodes on the local processor.

Definition at line 303 of file mesh_base.h.

304  { return this->n_nodes_on_proc (this->processor_id()); }

References libMesh::MeshBase::n_nodes_on_proc(), and libMesh::ParallelObject::processor_id().

Referenced by libMesh::VTKIO::nodes_to_vtk(), and libMesh::DistributedMesh::parallel_n_nodes().

◆ n_node_integers()

unsigned int libMesh::MeshBase::n_node_integers ( ) const
inlineinherited

Definition at line 926 of file mesh_base.h.

926 { return _node_integer_names.size(); }

References libMesh::MeshBase::_node_integer_names.

Referenced by libMesh::CheckpointIO::read_nodes(), and libMesh::CheckpointIO::write().

◆ n_nodes()

virtual dof_id_type libMesh::DistributedMesh::n_nodes ( ) const
inlineoverridevirtualinherited
Returns
The number of nodes in the mesh.

This function and others must be defined in derived classes since the MeshBase class has no specific storage for nodes or elements. The standard n_nodes() function may return a cached value on distributed meshes, and so can be called by any processor at any time.

Implements libMesh::MeshBase.

Definition at line 229 of file distributed_mesh.h.

229 { return _n_nodes; }

References libMesh::DistributedMesh::_n_nodes.

Referenced by libMesh::DistributedMesh::allgather(), libMesh::DistributedMesh::delete_remote_elements(), libMesh::DistributedMesh::DistributedMesh(), libMesh::DistributedMesh::renumber_nodes_and_elements(), and SlitMeshTest::testMesh().

◆ n_nodes_on_proc()

dof_id_type libMesh::MeshBase::n_nodes_on_proc ( const processor_id_type  proc) const
inherited
Returns
The number of nodes on processor proc.

Definition at line 492 of file mesh_base.C.

493 {
494  // We're either counting a processor's nodes or unpartitioned
495  // nodes
496  libmesh_assert (proc_id < this->n_processors() ||
498 
499  return static_cast<dof_id_type>(std::distance (this->pid_nodes_begin(proc_id),
500  this->pid_nodes_end (proc_id)));
501 }

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

Referenced by libMesh::MeshBase::n_local_nodes(), and libMesh::MeshBase::n_unpartitioned_nodes().

◆ n_partitions()

unsigned int libMesh::MeshBase::n_partitions ( ) const
inlineinherited
Returns
The number of partitions which have been defined via a call to either mesh.partition() or by building a Partitioner object and calling partition.
Note
The partitioner object is responsible for setting this value.

Definition at line 1153 of file mesh_base.h.

1154  { return _n_parts; }

References libMesh::MeshBase::_n_parts.

Referenced by libMesh::BoundaryInfo::sync(), libMesh::NameBasedIO::write(), libMesh::GMVIO::write_ascii_new_impl(), and libMesh::GMVIO::write_ascii_old_impl().

◆ n_processors()

processor_id_type libMesh::ParallelObject::n_processors ( ) const
inlineinherited
Returns
The number of processors in the group.

Definition at line 100 of file parallel_object.h.

101  { return cast_int<processor_id_type>(_communicator.size()); }

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::DofMap::add_constraints_to_send_list(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::DistributedMesh::add_elem(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEMSystem::assembly(), libMesh::AztecLinearSolver< T >::AztecLinearSolver(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::DistributedMesh::clear(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::UnstructuredMesh::create_pid_mesh(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::EnsightIO::EnsightIO(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::Nemesis_IO_Helper::initialize(), libMesh::DistributedMesh::insert_elem(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshBase::partition(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::prepare_send_list(), libMesh::DofMap::print_dof_constraints(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_header(), libMesh::CheckpointIO::read_nodes(), libMesh::System::read_parallel_data(), libMesh::System::read_SCALAR_dofs(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::System::read_serialized_vector(), libMesh::DistributedMesh::renumber_dof_objects(), OverlappingFunctorTest::run_partitioner_test(), libMesh::DofMap::scatter_constraints(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), CheckpointIOTest::testSplitter(), WriteVecAndScalar::testWrite(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::VTKIO::write_nodal_data(), libMesh::System::write_parallel_data(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), and libMesh::XdrIO::write_serialized_nodesets().

◆ n_sub_elem()

dof_id_type libMesh::MeshBase::n_sub_elem ( ) const
inherited
Returns
The number of elements that will be written out in certain I/O formats.

For example, a 9-noded quadrilateral will be broken into 4 linear sub-elements for plotting purposes. Thus, for a mesh of 2 QUAD9 elements n_tecplot_elem() will return 8. Implemented in terms of element_iterators.

Definition at line 527 of file mesh_base.C.

528 {
529  dof_id_type ne=0;
530 
531  for (const auto & elem : this->element_ptr_range())
532  ne += elem->n_sub_elem();
533 
534  return ne;
535 }

◆ n_subdomains()

subdomain_id_type libMesh::MeshBase::n_subdomains ( ) const
inherited
Returns
The number of subdomains in the global mesh. Subdomains correspond to separate subsets of the mesh which could correspond e.g. to different materials in a solid mechanics application, or regions where different physical processes are important. The subdomain mapping is independent from the parallel decomposition.

Definition at line 477 of file mesh_base.C.

478 {
479  // This requires an inspection on every processor
480  parallel_object_only();
481 
482  std::set<subdomain_id_type> ids;
483 
484  this->subdomain_ids (ids);
485 
486  return cast_int<subdomain_id_type>(ids.size());
487 }

Referenced by libMesh::XdrIO::write(), and libMesh::NameBasedIO::write_nodal_data().

◆ n_unpartitioned_elem()

dof_id_type libMesh::MeshBase::n_unpartitioned_elem ( ) const
inlineinherited
Returns
The number of elements owned by no processor.

Definition at line 409 of file mesh_base.h.

References libMesh::DofObject::invalid_processor_id, and libMesh::MeshBase::n_elem_on_proc().

Referenced by libMesh::UnstructuredMesh::all_second_order(), and libMesh::DistributedMesh::parallel_n_elem().

◆ n_unpartitioned_nodes()

dof_id_type libMesh::MeshBase::n_unpartitioned_nodes ( ) const
inlineinherited
Returns
The number of nodes owned by no processor.

Definition at line 309 of file mesh_base.h.

References libMesh::DofObject::invalid_processor_id, and libMesh::MeshBase::n_nodes_on_proc().

Referenced by libMesh::DistributedMesh::parallel_n_nodes().

◆ next_unique_id()

unique_id_type libMesh::MeshBase::next_unique_id ( )
inlineinherited
Returns
The next unique id to be used.

Definition at line 322 of file mesh_base.h.

322 { return _next_unique_id; }

References libMesh::MeshBase::_next_unique_id.

◆ node() [1/2]

virtual Node& libMesh::MeshBase::node ( const dof_id_type  i)
inlinevirtualinherited
Returns
A reference to the \( i^{th} \) node, which should be present in this processor's subset of the mesh data structure.

Definition at line 485 of file mesh_base.h.

486  {
487  libmesh_deprecated();
488  return *this->node_ptr(i);
489  }

References libMesh::MeshBase::node_ptr().

◆ node() [2/2]

virtual const Node& libMesh::MeshBase::node ( const dof_id_type  i) const
inlinevirtualinherited
Returns
A constant reference (for reading only) to the \( i^{th} \) node, which should be present in this processor's subset of the mesh data structure.

Definition at line 471 of file mesh_base.h.

472  {
473  libmesh_deprecated();
474  return *this->node_ptr(i);
475  }

References libMesh::MeshBase::node_ptr().

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::ReplicatedMesh::clear(), libMesh::DistributedMesh::clear(), libMesh::ReplicatedMesh::get_boundary_points(), libMesh::ReplicatedMesh::renumber_nodes_and_elements(), libMesh::DistributedMesh::renumber_nodes_and_elements(), and libMesh::ReplicatedMesh::stitching_helper().

◆ node_ptr() [1/2]

const Node * libMesh::DistributedMesh::node_ptr ( const dof_id_type  i) const
overridevirtualinherited
Returns
A pointer to the \( i^{th} \) node, which should be present in this processor's subset of the mesh data structure.

Implements libMesh::MeshBase.

Definition at line 328 of file distributed_mesh.C.

329 {
331  libmesh_assert_equal_to (_nodes[i]->id(), i);
332 
333  return _nodes[i];
334 }

References libMesh::DistributedMesh::_nodes, and libMesh::libmesh_assert().

Referenced by SlitMeshTest::build_mesh().

◆ node_ptr() [2/2]

Node * libMesh::DistributedMesh::node_ptr ( const dof_id_type  i)
overridevirtualinherited
Returns
A writable pointer to the \( i^{th} \) node, which should be present in this processor's subset of the mesh data structure.

Implements libMesh::MeshBase.

Definition at line 339 of file distributed_mesh.C.

340 {
342  libmesh_assert_equal_to (_nodes[i]->id(), i);
343 
344  return _nodes[i];
345 }

References libMesh::DistributedMesh::_nodes, and libMesh::libmesh_assert().

◆ node_ptr_range() [1/2]

virtual SimpleRange<const_node_iterator> libMesh::DistributedMesh::node_ptr_range ( ) const
inlineoverridevirtualinherited

◆ node_ptr_range() [2/2]

virtual SimpleRange<node_iterator> libMesh::DistributedMesh::node_ptr_range ( )
inlineoverridevirtualinherited

◆ node_ref() [1/2]

virtual Node& libMesh::MeshBase::node_ref ( const dof_id_type  i)
inlinevirtualinherited
Returns
A reference to the \( i^{th} \) node, which should be present in this processor's subset of the mesh data structure.

Definition at line 459 of file mesh_base.h.

459  {
460  return *this->node_ptr(i);
461  }

References libMesh::MeshBase::node_ptr().

◆ node_ref() [2/2]

virtual const Node& libMesh::MeshBase::node_ref ( const dof_id_type  i) const
inlinevirtualinherited

◆ nodes_begin() [1/2]

virtual const_node_iterator libMesh::DistributedMesh::nodes_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ nodes_begin() [2/2]

virtual node_iterator libMesh::DistributedMesh::nodes_begin ( )
overridevirtualinherited

Node iterator accessor functions.

Implements libMesh::MeshBase.

Referenced by libMesh::DistributedMesh::node_ptr_range().

◆ nodes_end() [1/2]

virtual const_node_iterator libMesh::DistributedMesh::nodes_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ nodes_end() [2/2]

virtual node_iterator libMesh::DistributedMesh::nodes_end ( )
overridevirtualinherited

◆ not_active_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::not_active_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_active_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::not_active_elements_begin ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_active_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::not_active_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_active_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::not_active_elements_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_ancestor_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::not_ancestor_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_ancestor_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::not_ancestor_elements_begin ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_ancestor_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::not_ancestor_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_ancestor_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::not_ancestor_elements_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_level_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::not_level_elements_begin ( unsigned int  level) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_level_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::not_level_elements_begin ( unsigned int  level)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_level_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::not_level_elements_end ( unsigned int  level) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_level_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::not_level_elements_end ( unsigned int  level)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_local_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::not_local_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_local_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::not_local_elements_begin ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_local_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::not_local_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_local_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::not_local_elements_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_subactive_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::not_subactive_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_subactive_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::not_subactive_elements_begin ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_subactive_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::not_subactive_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ not_subactive_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::not_subactive_elements_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ own_node()

void libMesh::DistributedMesh::own_node ( Node n)
overridevirtualinherited

Takes ownership of node n on this partition of a distributed mesh, by setting n.processor_id() to this->processor_id(), as well as changing n.id() and moving it in the mesh's internal container to give it a new authoritative id.

Reimplemented from libMesh::MeshBase.

Definition at line 649 of file distributed_mesh.C.

650 {
651  // This had better be a node in our mesh
652  libmesh_assert(_nodes[n.id()] == &n);
653 
654  _nodes[n.id()] = nullptr;
655 
656  n.set_id(DofObject::invalid_id);
657  n.processor_id() = this->processor_id();
658 
659  this->add_node(&n);
660 }

References libMesh::DistributedMesh::_nodes, libMesh::DistributedMesh::add_node(), libMesh::DofObject::id(), libMesh::DofObject::invalid_id, libMesh::libmesh_assert(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), and libMesh::DofObject::set_id().

◆ parallel_max_elem_id()

dof_id_type libMesh::DistributedMesh::parallel_max_elem_id ( ) const
inherited

Definition at line 233 of file distributed_mesh.C.

234 {
235  // This function must be run on all processors at once
236  parallel_object_only();
237 
238  dof_id_type max_local = 0;
239 
240  mapvector<Elem *,dof_id_type>::maptype::const_reverse_iterator
241  rit = _elements.rbegin();
242 
243  const mapvector<Elem *,dof_id_type>::maptype::const_reverse_iterator
244  rend = _elements.rend();
245 
246  // Look for the maximum element id. Search backwards through
247  // elements so we can break out early. Beware of nullptr entries that
248  // haven't yet been cleared from _elements.
249  for (; rit != rend; ++rit)
250  if (rit->second)
251  {
252  libmesh_assert_equal_to(rit->second->id(), rit->first);
253  max_local = rit->first + 1;
254  break;
255  }
256 
257  this->comm().max(max_local);
258  return max_local;
259 }

References libMesh::DistributedMesh::_elements, and libMesh::ParallelObject::comm().

Referenced by libMesh::DistributedMesh::allgather(), libMesh::DistributedMesh::delete_remote_elements(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::DistributedMesh::renumber_nodes_and_elements(), and libMesh::DistributedMesh::update_parallel_id_counts().

◆ parallel_max_node_id()

dof_id_type libMesh::DistributedMesh::parallel_max_node_id ( ) const
inherited

Definition at line 291 of file distributed_mesh.C.

292 {
293  // This function must be run on all processors at once
294  parallel_object_only();
295 
296  dof_id_type max_local = 0;
297 
298  mapvector<Node *,dof_id_type>::maptype::const_reverse_iterator
299  rit = _nodes.rbegin();
300 
301  const mapvector<Node *,dof_id_type>::maptype::const_reverse_iterator
302  rend = _nodes.rend();
303 
304  // Look for the maximum element id. Search backwards through
305  // elements so we can break out early. Beware of nullptr entries that
306  // haven't yet been cleared from _elements.
307  for (; rit != rend; ++rit)
308  if (rit->second)
309  {
310  libmesh_assert_equal_to(rit->second->id(), rit->first);
311  max_local = rit->first + 1;
312  break;
313  }
314 
315  this->comm().max(max_local);
316  return max_local;
317 }

References libMesh::DistributedMesh::_nodes, and libMesh::ParallelObject::comm().

Referenced by libMesh::DistributedMesh::allgather(), libMesh::DistributedMesh::delete_remote_elements(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DistributedMesh::renumber_nodes_and_elements(), and libMesh::DistributedMesh::update_parallel_id_counts().

◆ parallel_max_unique_id()

unique_id_type libMesh::DistributedMesh::parallel_max_unique_id ( ) const
overridevirtualinherited
Returns
A number greater than or equal to the maximum unique_id in the mesh.

Implements libMesh::MeshBase.

Definition at line 264 of file distributed_mesh.C.

265 {
266  // This function must be run on all processors at once
267  parallel_object_only();
268 
269  unique_id_type max_local = std::max(_next_unique_id,
271  this->comm().max(max_local);
272  return max_local;
273 }

References libMesh::MeshBase::_next_unique_id, libMesh::DistributedMesh::_next_unpartitioned_unique_id, and libMesh::ParallelObject::comm().

Referenced by libMesh::DistributedMesh::update_parallel_id_counts().

◆ parallel_n_elem()

dof_id_type libMesh::DistributedMesh::parallel_n_elem ( ) const
overridevirtualinherited
Returns
The number of elements in the mesh.

The parallel_n_elem() function computes a parallel-synchronized value on distributed meshes, and so must be called in parallel only.

Implements libMesh::MeshBase.

Definition at line 220 of file distributed_mesh.C.

221 {
222  // This function must be run on all processors at once
223  parallel_object_only();
224 
225  dof_id_type n_local = this->n_local_elem();
226  this->comm().sum(n_local);
227  n_local += this->n_unpartitioned_elem();
228  return n_local;
229 }

References libMesh::ParallelObject::comm(), libMesh::MeshBase::n_local_elem(), and libMesh::MeshBase::n_unpartitioned_elem().

Referenced by libMesh::DistributedMesh::allgather(), libMesh::DistributedMesh::delete_remote_elements(), libMesh::DistributedMesh::renumber_nodes_and_elements(), and libMesh::DistributedMesh::update_parallel_id_counts().

◆ parallel_n_nodes()

dof_id_type libMesh::DistributedMesh::parallel_n_nodes ( ) const
overridevirtualinherited
Returns
The number of nodes in the mesh.

This function and others must be overridden in derived classes since the MeshBase class has no specific storage for nodes or elements. The parallel_n_nodes() function computes a parallel-synchronized value on distributed meshes, and so must be called in parallel only.

Implements libMesh::MeshBase.

Definition at line 278 of file distributed_mesh.C.

279 {
280  // This function must be run on all processors at once
281  parallel_object_only();
282 
283  dof_id_type n_local = this->n_local_nodes();
284  this->comm().sum(n_local);
285  n_local += this->n_unpartitioned_nodes();
286  return n_local;
287 }

References libMesh::ParallelObject::comm(), libMesh::MeshBase::n_local_nodes(), and libMesh::MeshBase::n_unpartitioned_nodes().

Referenced by libMesh::DistributedMesh::allgather(), libMesh::DistributedMesh::delete_remote_elements(), libMesh::DistributedMesh::renumber_nodes_and_elements(), and libMesh::DistributedMesh::update_parallel_id_counts().

◆ partition() [1/2]

void libMesh::MeshBase::partition ( )
inlineinherited

Definition at line 992 of file mesh_base.h.

993  { this->partition(this->n_processors()); }

References libMesh::ParallelObject::n_processors().

◆ partition() [2/2]

void libMesh::MeshBase::partition ( const unsigned int  n_parts)
virtualinherited

Call the default partitioner (currently metis_partition()).

Definition at line 599 of file mesh_base.C.

600 {
601  // If we get here and we have unpartitioned elements, we need that
602  // fixed.
603  if (this->n_unpartitioned_elem() > 0)
604  {
606  libmesh_assert (this->is_serial());
607  partitioner()->partition (*this, n_parts);
608  }
609  // A nullptr partitioner or a skip_partitioning(true) call or a
610  // skip_noncritical_partitioning(true) call means don't repartition;
611  // skip_noncritical_partitioning() checks all these.
612  else if (!skip_noncritical_partitioning())
613  {
614  partitioner()->partition (*this, n_parts);
615  }
616  else
617  {
618  // Adaptive coarsening may have "orphaned" nodes on processors
619  // whose elements no longer share them. We need to check for
620  // and possibly fix that.
622 
623  // Make sure locally cached partition count is correct
624  this->recalculate_n_partitions();
625 
626  // Make sure any other locally cached data is correct
627  this->update_post_partitioning();
628  }
629 }

References libMesh::MeshTools::correct_node_proc_ids(), libMesh::ReferenceElem::get(), and libMesh::libmesh_assert().

Referenced by main(), libMesh::split_mesh(), ExtraIntegersTest::test_helper(), MappedSubdomainPartitionerTest::testMappedSubdomainPartitioner(), EquationSystemsTest::testRepartitionThenReinit(), and CheckpointIOTest::testSplitter().

◆ partitioner()

virtual std::unique_ptr<Partitioner>& libMesh::MeshBase::partitioner ( )
inlinevirtualinherited

◆ pid_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::pid_elements_begin ( processor_id_type  proc_id) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ pid_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::pid_elements_begin ( processor_id_type  proc_id)
overridevirtualinherited

Iterate over all elements with a specified processor id.

Implements libMesh::MeshBase.

◆ pid_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::pid_elements_end ( processor_id_type  proc_id) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ pid_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::pid_elements_end ( processor_id_type  proc_id)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ pid_nodes_begin() [1/2]

virtual const_node_iterator libMesh::DistributedMesh::pid_nodes_begin ( processor_id_type  proc_id) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ pid_nodes_begin() [2/2]

virtual node_iterator libMesh::DistributedMesh::pid_nodes_begin ( processor_id_type  proc_id)
overridevirtualinherited

Iterate over nodes with processor_id() == proc_id.

Implements libMesh::MeshBase.

◆ pid_nodes_end() [1/2]

virtual const_node_iterator libMesh::DistributedMesh::pid_nodes_end ( processor_id_type  proc_id) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ pid_nodes_end() [2/2]

virtual node_iterator libMesh::DistributedMesh::pid_nodes_end ( processor_id_type  proc_id)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ point()

const Point & libMesh::DistributedMesh::point ( const dof_id_type  i) const
overridevirtualinherited
Returns
A constant reference (for reading only) to the \( i^{th} \) point, which should be present in this processor's subset of the mesh data structure.

Implements libMesh::MeshBase.

Definition at line 321 of file distributed_mesh.C.

322 {
323  return this->node_ref(i);
324 }

References libMesh::MeshBase::node_ref().

◆ point_locator()

const PointLocatorBase & libMesh::MeshBase::point_locator ( ) const
inherited
Returns
A pointer to a PointLocatorBase object for this mesh, constructing a master PointLocator first if necessary.

Definition at line 652 of file mesh_base.C.

653 {
654  libmesh_deprecated();
655 
656  if (_point_locator.get() == nullptr)
657  {
658  // PointLocator construction may not be safe within threads
660 
662 
664  _point_locator->set_close_to_point_tol(_point_locator_close_to_point_tol);
665  }
666 
667  return *_point_locator;
668 }

References libMesh::Threads::in_threads, libMesh::libmesh_assert(), and libMesh::TREE_ELEMENTS.

◆ prepare_for_use()

void libMesh::MeshBase::prepare_for_use ( const bool  skip_renumber_nodes_and_elements = false,
const bool  skip_find_neighbors = false 
)
inherited

Prepare a newly ecreated (or read) mesh for use.

This involves 4 steps: 1.) call find_neighbors() 2.) call partition() 3.) call renumber_nodes_and_elements() 4.) call cache_elem_dims()

The argument to skip renumbering is now deprecated - to prevent a mesh from being renumbered, set allow_renumbering(false).

If this is a distributed mesh, local copies of remote elements will be deleted here - to keep those elements replicated during preparation, set allow_remote_element_removal(false).

Definition at line 318 of file mesh_base.C.

319 {
320  LOG_SCOPE("prepare_for_use()", "MeshBase");
321 
322  parallel_object_only();
323 
324  libmesh_assert(this->comm().verify(this->is_serial()));
325 
326  // A distributed mesh may have processors with no elements (or
327  // processors with no elements of higher dimension, if we ever
328  // support mixed-dimension meshes), but we want consistent
329  // mesh_dimension anyways.
330  //
331  // cache_elem_dims() should get the elem_dimensions() and
332  // mesh_dimension() correct later, and we don't need it earlier.
333 
334 
335  // Renumber the nodes and elements so that they in contiguous
336  // blocks. By default, _skip_renumber_nodes_and_elements is false.
337  //
338  // We may currently change that by passing
339  // skip_renumber_nodes_and_elements==true to this function, but we
340  // should use the allow_renumbering() accessor instead.
341  //
342  // Instances where you if prepare_for_use() should not renumber the nodes
343  // and elements include reading in e.g. an xda/r or gmv file. In
344  // this case, the ordering of the nodes may depend on an accompanying
345  // solution, and the node ordering cannot be changed.
346 
347  if (skip_renumber_nodes_and_elements)
348  {
349  libmesh_deprecated();
350  this->allow_renumbering(false);
351  }
352 
353  // Mesh modification operations might not leave us with consistent
354  // id counts, but our partitioner might need that consistency.
357  else
359 
360  // Let all the elements find their neighbors
361  if (!skip_find_neighbors)
362  this->find_neighbors();
363 
364  // The user may have set boundary conditions. We require that the
365  // boundary conditions were set consistently. Because we examine
366  // neighbors when evaluating non-raw boundary condition IDs, this
367  // assert is only valid when our neighbor links are in place.
368 #ifdef DEBUG
370 #endif
371 
372  // Search the mesh for all the dimensions of the elements
373  // and cache them.
374  this->cache_elem_dims();
375 
376  // Search the mesh for elements that have a neighboring element
377  // of dim+1 and set that element as the interior parent
378  this->detect_interior_parents();
379 
380  // Fix up node unique ids in case mesh generation code didn't take
381  // exceptional care to do so.
382  // MeshCommunication().make_node_unique_ids_parallel_consistent(*this);
383 
384  // We're going to still require that mesh generation code gets
385  // element unique ids consistent.
386 #if defined(DEBUG) && defined(LIBMESH_ENABLE_UNIQUE_ID)
388 #endif
389 
390  // Reset our PointLocator. Any old locator is invalidated any time
391  // the elements in the underlying elements in the mesh have changed,
392  // so we clear it here.
393  this->clear_point_locator();
394 
395  // Allow our GhostingFunctor objects to reinit if necessary.
396  // Do this before partitioning and redistributing, and before
397  // deleting remote elements.
398  for (auto & gf : _ghosting_functors)
399  {
400  libmesh_assert(gf);
401  gf->mesh_reinit();
402  }
403 
404  // Partition the mesh unless *all* partitioning is to be skipped.
405  // If only noncritical partitioning is to be skipped, the
406  // partition() call will still check for orphaned nodes.
407  if (!skip_partitioning())
408  this->partition();
409 
410  // If we're using DistributedMesh, we'll probably want it
411  // parallelized.
413  this->delete_remote_elements();
414 
417 
418  // The mesh is now prepared for use.
419  _is_prepared = true;
420 
421 #if defined(DEBUG) && defined(LIBMESH_ENABLE_UNIQUE_ID)
424 #endif
425 }

References libMesh::libmesh_assert(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), and libMesh::MeshTools::libmesh_assert_valid_unique_ids().

Referenced by LinearElasticityWithContact::add_contact_edge_elements(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Subdivision::all_subdivision(), libMesh::MeshTools::Modification::all_tri(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::InfElemBuilder::build_inf_elem(), GetBoundaryPointsTest::build_mesh(), MixedDimensionMeshTest::build_mesh(), MeshfunctionDFEM::build_mesh(), SlitMeshTest::build_mesh(), MixedDimensionNonUniformRefinement::build_mesh(), MixedDimensionNonUniformRefinementTriangle::build_mesh(), MixedDimensionNonUniformRefinement3D::build_mesh(), libMesh::MeshRefinement::coarsen_elements(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::UnstructuredMesh::create_submesh(), libMesh::MeshTools::Modification::flatten(), main(), libMesh::MeshTools::Subdivision::prepare_subdivision_mesh(), libMesh::GMVIO::read(), libMesh::UnstructuredMesh::read(), libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::MeshRefinement::refine_elements(), libMesh::ReplicatedMesh::stitching_helper(), libMesh::BoundaryInfo::sync(), MeshSpatialDimensionTest::test1D(), MeshSpatialDimensionTest::test2D(), SystemsTest::testBlockRestrictedVarNDofs(), SystemsTest::testDofCouplingWithVarGroups(), MeshInputTest::testDynaReadElem(), MeshInputTest::testDynaReadPatch(), MeshInputTest::testExodusCopyElementSolution(), MeshInputTest::testExodusWriteElementDataFromDiscontinuousNodalData(), EquationSystemsTest::testPostInitAddElem(), SystemsTest::testProjectMatrix3D(), EquationSystemsTest::testReinitWithNodeElem(), BoundaryInfoTest::testShellFaceConstraints(), WriteVecAndScalar::testWrite(), tetrahedralize_domain(), libMesh::TriangleInterface::triangulate(), libMesh::MeshRefinement::uniformly_coarsen(), and libMesh::MeshRefinement::uniformly_refine().

◆ print_info()

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

Prints relevant information about the mesh.

Definition at line 585 of file mesh_base.C.

586 {
587  os << this->get_info()
588  << std::endl;
589 }

Referenced by assemble_and_solve(), libMesh::InfElemBuilder::build_inf_elem(), main(), and libMesh::operator<<().

◆ processor_id()

processor_id_type libMesh::ParallelObject::processor_id ( ) const
inlineinherited
Returns
The rank of this processor in the group.

Definition at line 106 of file parallel_object.h.

107  { return cast_int<processor_id_type>(_communicator.rank()); }

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::EquationSystems::_read_impl(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEMSystem::assembly(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::DistributedMesh::clear(), libMesh::ExodusII_IO_Helper::close(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::compute_communication_map_parameters(), libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_node_communication_maps(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::ExodusII_IO_Helper::create(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DistributedMesh::DistributedMesh(), libMesh::DofMap::end_dof(), libMesh::DofMap::end_old_dof(), libMesh::EnsightIO::EnsightIO(), libMesh::RBEIMConstruction::evaluate_mesh_function(), libMesh::MeshFunction::find_element(), libMesh::MeshFunction::find_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::DofMap::first_dof(), libMesh::DofMap::first_old_dof(), libMesh::Nemesis_IO_Helper::get_cmap_params(), libMesh::Nemesis_IO_Helper::get_eb_info_global(), libMesh::Nemesis_IO_Helper::get_elem_cmap(), libMesh::Nemesis_IO_Helper::get_elem_map(), libMesh::DofMap::get_info(), libMesh::Nemesis_IO_Helper::get_init_global(), libMesh::Nemesis_IO_Helper::get_init_info(), libMesh::Nemesis_IO_Helper::get_loadbal_param(), libMesh::DofMap::get_local_constraints(), libMesh::Nemesis_IO_Helper::get_node_cmap(), libMesh::Nemesis_IO_Helper::get_node_map(), libMesh::Nemesis_IO_Helper::get_ns_param_global(), libMesh::Nemesis_IO_Helper::get_ss_param_global(), libMesh::SparsityPattern::Build::handle_vi_vj(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), HeatSystem::init_data(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_element_variables(), libMesh::ExodusII_IO_Helper::initialize_global_variables(), libMesh::ExodusII_IO_Helper::initialize_nodal_variables(), libMesh::DistributedMesh::insert_elem(), libMesh::DofMap::is_evaluable(), libMesh::SparsityPattern::Build::join(), libMesh::DofMap::last_dof(), libMesh::TransientRBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEIMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DofMap::local_variable_indices(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), AugmentSparsityOnInterface::mesh_reinit(), libMesh::MeshBase::n_active_local_elem(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::DofMap::n_local_dofs(), libMesh::System::n_local_dofs(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::SparsityPattern::Build::operator()(), libMesh::DistributedMesh::own_node(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::print_dof_constraints(), libMesh::Nemesis_IO_Helper::put_cmap_params(), libMesh::Nemesis_IO_Helper::put_elem_cmap(), libMesh::Nemesis_IO_Helper::put_elem_map(), libMesh::Nemesis_IO_Helper::put_loadbal_param(), libMesh::Nemesis_IO_Helper::put_node_cmap(), libMesh::Nemesis_IO_Helper::put_node_map(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read(), libMesh::ExodusII_IO_Helper::read_elem_num_map(), libMesh::ExodusII_IO_Helper::read_global_values(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::System::read_header(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::System::read_legacy_data(), libMesh::ExodusII_IO_Helper::read_node_num_map(), libMesh::System::read_parallel_data(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::System::read_SCALAR_dofs(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::System::read_serialized_data(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::System::read_serialized_vector(), libMesh::System::read_serialized_vectors(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::LaplaceMeshSmoother::smooth(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), MeshInputTest::testDynaReadElem(), MeshInputTest::testDynaReadPatch(), MeshInputTest::testExodusCopyElementSolution(), MeshInputTest::testExodusWriteElementDataFromDiscontinuousNodalData(), SystemsTest::testProjectMatrix1D(), SystemsTest::testProjectMatrix2D(), SystemsTest::testProjectMatrix3D(), BoundaryInfoTest::testShellFaceConstraints(), CheckpointIOTest::testSplitter(), WriteVecAndScalar::testWrite(), libMesh::MeshTools::total_weight(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::DTKAdapter::update_variable_values(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), libMesh::CheckpointIO::write(), libMesh::EquationSystems::write(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO::write_element_data(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_element_values_element_major(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO::write_global_data(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::System::write_header(), libMesh::ExodusII_IO::write_information_records(), libMesh::ExodusII_IO_Helper::write_information_records(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::VTKIO::write_nodal_data(), libMesh::UCDIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), libMesh::Nemesis_IO_Helper::write_nodesets(), libMesh::ExodusII_IO_Helper::write_nodesets(), libMesh::RBEvaluation::write_out_vectors(), write_output_solvedata(), libMesh::System::write_parallel_data(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bc_names(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::System::write_serialized_data(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::XdrIO::write_serialized_subdomain_names(), libMesh::System::write_serialized_vector(), libMesh::System::write_serialized_vectors(), libMesh::ExodusII_IO_Helper::write_sideset_data(), libMesh::Nemesis_IO_Helper::write_sidesets(), libMesh::ExodusII_IO_Helper::write_sidesets(), libMesh::ExodusII_IO::write_timestep(), libMesh::ExodusII_IO_Helper::write_timestep(), and libMesh::ExodusII_IO::write_timestep_discontinuous().

◆ query_elem() [1/2]

virtual Elem* libMesh::MeshBase::query_elem ( const dof_id_type  i)
inlinevirtualinherited
Returns
A writable pointer to the \( i^{th} \) element, or nullptr if no such element exists in this processor's mesh data structure.

Definition at line 609 of file mesh_base.h.

610  {
611  libmesh_deprecated();
612  return this->query_elem_ptr(i);
613  }

References libMesh::MeshBase::query_elem_ptr().

◆ query_elem() [2/2]

virtual const Elem* libMesh::MeshBase::query_elem ( const dof_id_type  i) const
inlinevirtualinherited
Returns
A pointer to the \( i^{th} \) element, or nullptr if no such element exists in this processor's mesh data structure.

Definition at line 595 of file mesh_base.h.

596  {
597  libmesh_deprecated();
598  return this->query_elem_ptr(i);
599  }

References libMesh::MeshBase::query_elem_ptr().

◆ query_elem_ptr() [1/2]

const Elem * libMesh::DistributedMesh::query_elem_ptr ( const dof_id_type  i) const
overridevirtualinherited
Returns
A pointer to the \( i^{th} \) element, or nullptr if no such element exists in this processor's mesh data structure.

Implements libMesh::MeshBase.

Definition at line 404 of file distributed_mesh.C.

405 {
406  std::map<dof_id_type, Elem *>::const_iterator it = _elements.find(i);
407  if (it != _elements.end().it)
408  {
409  const Elem * e = it->second;
410  libmesh_assert (!e || e->id() == i);
411  return e;
412  }
413 
414  return nullptr;
415 }

References libMesh::DistributedMesh::_elements, libMesh::DofObject::id(), and libMesh::libmesh_assert().

Referenced by SlitMeshTest::testMesh().

◆ query_elem_ptr() [2/2]

Elem * libMesh::DistributedMesh::query_elem_ptr ( const dof_id_type  i)
overridevirtualinherited
Returns
A writable pointer to the \( i^{th} \) element, or nullptr if no such element exists in this processor's mesh data structure.

Implements libMesh::MeshBase.

Definition at line 420 of file distributed_mesh.C.

421 {
422  std::map<dof_id_type, Elem *>::const_iterator it = _elements.find(i);
423  if (it != _elements.end().it)
424  {
425  Elem * e = _elements[i];
426  libmesh_assert (!e || e->id() == i);
427  return e;
428  }
429 
430  return nullptr;
431 }

References libMesh::DistributedMesh::_elements, libMesh::DofObject::id(), and libMesh::libmesh_assert().

◆ query_node_ptr() [1/2]

const Node * libMesh::DistributedMesh::query_node_ptr ( const dof_id_type  i) const
overridevirtualinherited
Returns
A pointer to the \( i^{th} \) node, or nullptr if no such node exists in this processor's mesh data structure.

Implements libMesh::MeshBase.

Definition at line 350 of file distributed_mesh.C.

351 {
352  std::map<dof_id_type, Node *>::const_iterator it = _nodes.find(i);
353  if (it != _nodes.end().it)
354  {
355  const Node * n = it->second;
356  libmesh_assert (!n || n->id() == i);
357  return n;
358  }
359 
360  return nullptr;
361 }

References libMesh::DistributedMesh::_nodes, libMesh::DofObject::id(), and libMesh::libmesh_assert().

◆ query_node_ptr() [2/2]

Node * libMesh::DistributedMesh::query_node_ptr ( const dof_id_type  i)
overridevirtualinherited
Returns
A writable pointer to the \( i^{th} \) node, or nullptr if no such node exists in this processor's mesh data structure.

Implements libMesh::MeshBase.

Definition at line 366 of file distributed_mesh.C.

367 {
368  std::map<dof_id_type, Node *>::const_iterator it = _nodes.find(i);
369  if (it != _nodes.end().it)
370  {
371  Node * n = it->second;
372  libmesh_assert (!n || n->id() == i);
373  return n;
374  }
375 
376  return nullptr;
377 }

References libMesh::DistributedMesh::_nodes, libMesh::DofObject::id(), and libMesh::libmesh_assert().

◆ read()

void libMesh::UnstructuredMesh::read ( const std::string &  name,
void *  mesh_data = nullptr,
bool  skip_renumber_nodes_and_elements = false,
bool  skip_find_neighbors = false 
)
overridevirtualinherited

Reads the file specified by name.

Attempts to figure out the proper method by the file extension. This is now the only way to read a mesh. The UnstructuredMesh then initializes its data structures and is ready for use.

The skip_renumber_nodes_and_elements argument is now deprecated - to disallow renumbering, set MeshBase::allow_renumbering(false).

Set skip_find_neighbors=true to skip the find-neighbors operation during prepare_for_use. This operation isn't always necessary and it can be time-consuming, which is why we provide an option to skip it.

Implements libMesh::MeshBase.

Definition at line 620 of file unstructured_mesh.C.

624 {
625  // Set the skip_renumber_nodes_and_elements flag on all processors
626  // if necessary.
627  // This ensures that renumber_nodes_and_elements is *not* called
628  // during prepare_for_use() for certain types of mesh files.
629  // This is required in cases where there is an associated solution
630  // file which expects a certain ordering of the nodes.
631  if (name.rfind(".gmv") + 4 == name.size())
632  this->allow_renumbering(false);
633 
634  NameBasedIO(*this).read(name);
635 
636  if (skip_renumber_nodes_and_elements)
637  {
638  // Use MeshBase::allow_renumbering() yourself instead.
639  libmesh_deprecated();
640  this->allow_renumbering(false);
641  }
642 
643  // Done reading the mesh. Now prepare it for use.
644  this->prepare_for_use(/*skip_renumber (deprecated)*/ false,
645  skip_find_neighbors);
646 }

References libMesh::MeshBase::allow_renumbering(), libMesh::Quality::name(), libMesh::MeshBase::prepare_for_use(), and libMesh::NameBasedIO::read().

Referenced by ExtraIntegersTest::checkpoint_helper(), libMesh::RBEIMEvaluation::legacy_read_in_interpolation_points_elem(), main(), and SlitMeshRefinedSystemTest::testRestart().

◆ recalculate_n_partitions()

unsigned int libMesh::MeshBase::recalculate_n_partitions ( )
inherited

In a few (very rare) cases, the user may have manually tagged the elements with specific processor IDs by hand, without using a partitioner.

In this case, the Mesh will not know that the total number of partitions, _n_parts, has changed, unless you call this function. This is an O(N active elements) calculation. The return value is the number of partitions, and _n_parts is also set by this function.

Definition at line 631 of file mesh_base.C.

632 {
633  // This requires an inspection on every processor
634  parallel_object_only();
635 
636  unsigned int max_proc_id=0;
637 
638  for (const auto & elem : this->active_local_element_ptr_range())
639  max_proc_id = std::max(max_proc_id, static_cast<unsigned int>(elem->processor_id()));
640 
641  // The number of partitions is one more than the max processor ID.
642  _n_parts = max_proc_id+1;
643 
644  this->comm().max(_n_parts);
645 
646  return _n_parts;
647 }

◆ redistribute()

void libMesh::DistributedMesh::redistribute ( )
overridevirtualinherited

Redistribute elements between processors.

This gets called automatically by the Partitioner, and is a no-op in the case of a serialized mesh.

Reimplemented from libMesh::MeshBase.

Definition at line 871 of file distributed_mesh.C.

872 {
873  // If this is a truly parallel mesh, go through the redistribution/gather/delete remote steps
874  if (!this->is_serial())
875  {
876  // Construct a MeshCommunication object to actually redistribute the nodes
877  // and elements according to the partitioner, and then to re-gather the neighbors.
879  mc.redistribute(*this);
880 
882 
883  // We probably had valid neighbors previously, so that a quality
884  // new partitioning could be found, but we might not have valid
885  // neighbor links on the newly-redistributed elements
886  this->find_neighbors();
887 
888  // Is this necessary? If we are called from prepare_for_use(), this will be called
889  // anyway... but users can always call partition directly, in which case we do need
890  // to call delete_remote_elements()...
891  //
892  // Regardless of whether it's necessary, it isn't safe. We
893  // haven't communicated new node processor_ids yet, and we can't
894  // delete nodes until we do.
895  // this->delete_remote_elements();
896  }
897 }

References libMesh::UnstructuredMesh::find_neighbors(), libMesh::DistributedMesh::is_serial(), libMesh::MeshCommunication::redistribute(), and libMesh::DistributedMesh::update_parallel_id_counts().

◆ remove_ghosting_functor()

void libMesh::MeshBase::remove_ghosting_functor ( GhostingFunctor ghosting_functor)
inherited

Removes a functor which was previously added to the set of ghosting functors.

Definition at line 450 of file mesh_base.C.

451 {
452  _ghosting_functors.erase(&ghosting_functor);
453 
454  auto it = _shared_functors.find(&ghosting_functor);
455  if (it != _shared_functors.end())
456  _shared_functors.erase(it);
457 }

Referenced by libMesh::DofMap::clear(), libMesh::DofMap::remove_algebraic_ghosting_functor(), libMesh::DofMap::remove_coupling_functor(), EquationSystemsTest::testDisableDefaultGhosting(), and libMesh::DofMap::~DofMap().

◆ renumber_dof_objects()

template<typename T >
dof_id_type libMesh::DistributedMesh::renumber_dof_objects ( mapvector< T *, dof_id_type > &  objects)
inherited

Renumber a parallel objects container.

Returns
The smallest globally unused id for that container.

Definition at line 1029 of file distributed_mesh.C.

1030 {
1031  // This function must be run on all processors at once
1032  parallel_object_only();
1033 
1034  typedef typename mapvector<T *,dof_id_type>::veclike_iterator object_iterator;
1035 
1036  // In parallel we may not know what objects other processors have.
1037  // Start by figuring out how many
1038  dof_id_type unpartitioned_objects = 0;
1039 
1040  std::unordered_map<processor_id_type, dof_id_type>
1041  ghost_objects_from_proc;
1042 
1043  object_iterator it = objects.begin();
1044  object_iterator end = objects.end();
1045 
1046  while (it != end)
1047  {
1048  T * obj = *it;
1049 
1050  // Remove any nullptr container entries while we're here.
1051  if (!obj)
1052  it = objects.erase(it);
1053  else
1054  {
1055  processor_id_type obj_procid = obj->processor_id();
1056  if (obj_procid == DofObject::invalid_processor_id)
1057  unpartitioned_objects++;
1058  else
1059  ghost_objects_from_proc[obj_procid]++;
1060 
1061  // Finally, increment the iterator
1062  ++it;
1063  }
1064  }
1065 
1066  std::vector<dof_id_type> objects_on_proc(this->n_processors(), 0);
1067  auto this_it = ghost_objects_from_proc.find(this->processor_id());
1068  this->comm().allgather
1069  ((this_it == ghost_objects_from_proc.end()) ?
1070  dof_id_type(0) : this_it->second, objects_on_proc);
1071 
1072 #ifndef NDEBUG
1073  libmesh_assert(this->comm().verify(unpartitioned_objects));
1074  for (processor_id_type p=0, np=this->n_processors(); p != np; ++p)
1075  if (ghost_objects_from_proc.count(p))
1076  libmesh_assert_less_equal (ghost_objects_from_proc[p], objects_on_proc[p]);
1077  else
1078  libmesh_assert_less_equal (0, objects_on_proc[p]);
1079 #endif
1080 
1081  // We'll renumber objects in blocks by processor id
1082  std::vector<dof_id_type> first_object_on_proc(this->n_processors());
1083  for (processor_id_type i=1, np=this->n_processors(); i != np; ++i)
1084  first_object_on_proc[i] = first_object_on_proc[i-1] +
1085  objects_on_proc[i-1];
1086  dof_id_type next_id = first_object_on_proc[this->processor_id()];
1087  dof_id_type first_free_id =
1088  first_object_on_proc[this->n_processors()-1] +
1089  objects_on_proc[this->n_processors()-1] +
1090  unpartitioned_objects;
1091 
1092  // First set new local object ids and build request sets
1093  // for non-local object ids
1094 
1095  // Request sets to send to each processor
1096  std::map<processor_id_type, std::vector<dof_id_type>>
1097  requested_ids;
1098 
1099  // We know how many objects live on each processor, so reserve() space for
1100  // each.
1101  auto ghost_end = ghost_objects_from_proc.end();
1102  for (auto p : IntRange<processor_id_type>(0, this->n_processors()))
1103  if (p != this->processor_id())
1104  {
1105  const auto p_it = ghost_objects_from_proc.find(p);
1106  if (p_it != ghost_end)
1107  requested_ids[p].reserve(p_it->second);
1108  }
1109 
1110  end = objects.end();
1111  for (it = objects.begin(); it != end; ++it)
1112  {
1113  T * obj = *it;
1114  if (obj->processor_id() == this->processor_id())
1115  obj->set_id(next_id++);
1116  else if (obj->processor_id() != DofObject::invalid_processor_id)
1117  requested_ids[obj->processor_id()].push_back(obj->id());
1118  }
1119 
1120  // Next set ghost object ids from other processors
1121 
1122  auto gather_functor =
1123  [
1124 #ifndef NDEBUG
1125  this,
1126  &first_object_on_proc,
1127  &objects_on_proc,
1128 #endif
1129  &objects]
1130  (processor_id_type, const std::vector<dof_id_type> & ids,
1131  std::vector<dof_id_type> & new_ids)
1132  {
1133  std::size_t ids_size = ids.size();
1134  new_ids.resize(ids_size);
1135 
1136  for (std::size_t i=0; i != ids_size; ++i)
1137  {
1138  T * obj = objects[ids[i]];
1139  libmesh_assert(obj);
1140  libmesh_assert_equal_to (obj->processor_id(), this->processor_id());
1141  new_ids[i] = obj->id();
1142 
1143  libmesh_assert_greater_equal (new_ids[i],
1144  first_object_on_proc[this->processor_id()]);
1145  libmesh_assert_less (new_ids[i],
1146  first_object_on_proc[this->processor_id()] +
1147  objects_on_proc[this->processor_id()]);
1148  }
1149  };
1150 
1151  auto action_functor =
1152  [
1153 #ifndef NDEBUG
1154  &first_object_on_proc,
1155  &objects_on_proc,
1156 #endif
1157  &objects]
1158  (processor_id_type libmesh_dbg_var(pid),
1159  const std::vector<dof_id_type> & ids,
1160  const std::vector<dof_id_type> & data)
1161  {
1162  // Copy the id changes we've now been informed of
1163  for (auto i : index_range(ids))
1164  {
1165  T * obj = objects[ids[i]];
1166  libmesh_assert (obj);
1167  libmesh_assert_equal_to (obj->processor_id(), pid);
1168  libmesh_assert_greater_equal (data[i],
1169  first_object_on_proc[pid]);
1170  libmesh_assert_less (data[i],
1171  first_object_on_proc[pid] +
1172  objects_on_proc[pid]);
1173  obj->set_id(data[i]);
1174  }
1175  };
1176 
1177  const dof_id_type * ex = nullptr;
1178  Parallel::pull_parallel_vector_data
1179  (this->comm(), requested_ids, gather_functor, action_functor, ex);
1180 
1181 #ifdef LIBMESH_ENABLE_UNIQUE_ID
1182  auto unique_gather_functor =
1183  [
1184 #ifndef NDEBUG
1185  this,
1186 #endif
1187  &objects]
1188  (processor_id_type, const std::vector<dof_id_type> & ids,
1189  std::vector<unique_id_type> & data)
1190  {
1191  std::size_t ids_size = ids.size();
1192  data.resize(ids_size);
1193 
1194  for (std::size_t i=0; i != ids_size; ++i)
1195  {
1196  T * obj = objects[ids[i]];
1197  libmesh_assert(obj);
1198  libmesh_assert_equal_to (obj->processor_id(), this->processor_id());
1199  data[i] = obj->valid_unique_id() ? obj->unique_id() : DofObject::invalid_unique_id;
1200  }
1201  };
1202 
1203  auto unique_action_functor =
1204  [&objects]
1205  (processor_id_type libmesh_dbg_var(pid),
1206  const std::vector<dof_id_type> & ids,
1207  const std::vector<unique_id_type> & data)
1208  {
1209  for (auto i : index_range(ids))
1210  {
1211  T * obj = objects[ids[i]];
1212  libmesh_assert (obj);
1213  libmesh_assert_equal_to (obj->processor_id(), pid);
1214  if (!obj->valid_unique_id() && data[i] != DofObject::invalid_unique_id)
1215  obj->set_unique_id() = (data[i]);
1216  }
1217  };
1218 
1219  const unique_id_type * unique_ex = nullptr;
1220  Parallel::pull_parallel_vector_data
1221  (this->comm(), requested_ids, unique_gather_functor,
1222  unique_action_functor, unique_ex);
1223 #endif
1224 
1225  // Next set unpartitioned object ids
1226  next_id = 0;
1227  for (auto i : IntRange<processor_id_type>(0, this->n_processors()))
1228  next_id += objects_on_proc[i];
1229  for (it = objects.begin(); it != end; ++it)
1230  {
1231  T * obj = *it;
1232  if (obj->processor_id() == DofObject::invalid_processor_id)
1233  obj->set_id(next_id++);
1234  }
1235 
1236  // Finally shuffle around objects so that container indices
1237  // match ids
1238  it = objects.begin();
1239  end = objects.end();
1240  while (it != end)
1241  {
1242  T * obj = *it;
1243  if (obj) // don't try shuffling already-nullptr entries
1244  {
1245  T * next = objects[obj->id()];
1246  // If we have to move this object
1247  if (next != obj)
1248  {
1249  // nullptr out its original position for now
1250  // (our shuffling may put another object there shortly)
1251  *it = nullptr;
1252 
1253  // There may already be another object with this id that
1254  // needs to be moved itself
1255  while (next)
1256  {
1257  // We shouldn't be trying to give two objects the
1258  // same id
1259  libmesh_assert_not_equal_to (next->id(), obj->id());
1260  objects[obj->id()] = obj;
1261  obj = next;
1262  next = objects[obj->id()];
1263  }
1264  objects[obj->id()] = obj;
1265  }
1266  }
1267 
1268  // Remove any container entries that were left as nullptr.
1269  if (!obj)
1270  it = objects.erase(it);
1271  else
1272  ++it;
1273  }
1274 
1275  return first_free_id;
1276 }

References libMesh::mapvector< Val, index_t >::begin(), libMesh::ParallelObject::comm(), data, libMesh::mapvector< Val, index_t >::end(), end, libMesh::mapvector< Val, index_t >::erase(), libMesh::index_range(), libMesh::DofObject::invalid_processor_id, libMesh::DofObject::invalid_unique_id, libMesh::libmesh_assert(), libMesh::ParallelObject::n_processors(), libMesh::MeshTools::Subdivision::next, and libMesh::ParallelObject::processor_id().

Referenced by libMesh::DistributedMesh::renumber_nodes_and_elements().

◆ renumber_elem()

void libMesh::DistributedMesh::renumber_elem ( dof_id_type  old_id,
dof_id_type  new_id 
)
overridevirtualinherited

Changes the id of element old_id, both by changing elem(old_id)->id() and by moving elem(old_id) in the mesh's internal container.

No element with the id new_id should already exist.

Implements libMesh::MeshBase.

Definition at line 610 of file distributed_mesh.C.

612 {
613  Elem * el = _elements[old_id];
614  libmesh_assert (el);
615  libmesh_assert_equal_to (el->id(), old_id);
616 
617  el->set_id(new_id);
618  libmesh_assert (!_elements[new_id]);
619  _elements[new_id] = el;
620  _elements.erase(old_id);
621 }

References libMesh::DistributedMesh::_elements, libMesh::DofObject::id(), libMesh::libmesh_assert(), and libMesh::DofObject::set_id().

◆ renumber_node()

void libMesh::DistributedMesh::renumber_node ( dof_id_type  old_id,
dof_id_type  new_id 
)
overridevirtualinherited

Changes the id of node old_id, both by changing node(old_id)->id() and by moving node(old_id) in the mesh's internal container.

No element with the id new_id should already exist.

Implements libMesh::MeshBase.

Definition at line 797 of file distributed_mesh.C.

799 {
800  Node * nd = _nodes[old_id];
801  libmesh_assert (nd);
802  libmesh_assert_equal_to (nd->id(), old_id);
803 
804  nd->set_id(new_id);
805 
806  // If we have nodes shipped to this processor for NodeConstraints
807  // use, then those nodes will exist in _nodes, but may not be
808  // locatable via a TopologyMap due to the insufficiency of elements
809  // connecting to them. If local refinement then wants to create a
810  // *new* node in the same location, it will initially get a temporary
811  // id, and then make_node_ids_parallel_consistent() will try to move
812  // it to the canonical id. We need to account for this case to
813  // avoid false positives and memory leaks.
814 #ifdef LIBMESH_ENABLE_NODE_CONSTRAINTS
815  if (_nodes[new_id])
816  {
817  libmesh_assert_equal_to (*(Point *)_nodes[new_id],
818  *(Point *)_nodes[old_id]);
819  _nodes.erase(new_id);
820  }
821 #else
822  // If we aren't shipping nodes for NodeConstraints, there should be
823  // no reason for renumbering one node onto another.
824  libmesh_assert (!_nodes[new_id]);
825 #endif
826  _nodes[new_id] = nd;
827  _nodes.erase(old_id);
828 }

References libMesh::DistributedMesh::_nodes, libMesh::DofObject::id(), libMesh::libmesh_assert(), and libMesh::DofObject::set_id().

◆ renumber_nodes_and_elements()

void libMesh::DistributedMesh::renumber_nodes_and_elements ( )
overridevirtualinherited

Remove nullptr elements from arrays.

Implements libMesh::MeshBase.

Definition at line 1279 of file distributed_mesh.C.

1280 {
1281  parallel_object_only();
1282 
1283 #ifdef DEBUG
1284  // Make sure our ids and flags are consistent
1288 #endif
1289 
1290  LOG_SCOPE("renumber_nodes_and_elements()", "DistributedMesh");
1291 
1292  std::set<dof_id_type> used_nodes;
1293 
1294  // flag the nodes we need
1295  for (auto & elem : this->element_ptr_range())
1296  for (const Node & node : elem->node_ref_range())
1297  used_nodes.insert(node.id());
1298 
1299  // Nodes not connected to any local elements, and nullptr node entries
1300  // in our container, are deleted
1301  {
1302  node_iterator_imp it = _nodes.begin();
1303  node_iterator_imp end = _nodes.end();
1304 
1305  while (it != end)
1306  {
1307  Node * nd = *it;
1308  if (!nd)
1309  it = _nodes.erase(it);
1310  else if (!used_nodes.count(nd->id()))
1311  {
1312  // remove any boundary information associated with
1313  // this node
1314  this->get_boundary_info().remove (nd);
1315 
1316  // delete the node
1317  delete nd;
1318 
1319  it = _nodes.erase(it);
1320  }
1321  else
1322  ++it;
1323  }
1324  }
1325 
1327  {
1328  this->update_parallel_id_counts();
1329  return;
1330  }
1331 
1332  // Finally renumber all the elements
1333  _n_elem = this->renumber_dof_objects (this->_elements);
1334 
1335  // and all the remaining nodes
1336  _n_nodes = this->renumber_dof_objects (this->_nodes);
1337 
1338  // And figure out what IDs we should use when adding new nodes and
1339  // new elements
1340  this->update_parallel_id_counts();
1341 
1342  // Make sure our caches are up to date and our
1343  // DofObjects are well packed
1344 #ifdef DEBUG
1345  libmesh_assert_equal_to (this->n_nodes(), this->parallel_n_nodes());
1346  libmesh_assert_equal_to (this->n_elem(), this->parallel_n_elem());
1347  const dof_id_type pmax_node_id = this->parallel_max_node_id();
1348  const dof_id_type pmax_elem_id = this->parallel_max_elem_id();
1349  libmesh_assert_equal_to (this->max_node_id(), pmax_node_id);
1350  libmesh_assert_equal_to (this->max_elem_id(), pmax_elem_id);
1351  libmesh_assert_equal_to (this->n_nodes(), this->max_node_id());
1352  libmesh_assert_equal_to (this->n_elem(), this->max_elem_id());
1353 
1354  // Make sure our ids and flags are consistent
1357 
1358  // And make sure we've made our numbering monotonic
1360 #endif
1361 }

References libMesh::DistributedMesh::_elements, libMesh::DistributedMesh::_n_elem, libMesh::DistributedMesh::_n_nodes, libMesh::DistributedMesh::_nodes, libMesh::MeshBase::_skip_renumber_nodes_and_elements, libMesh::MeshBase::elem(), libMesh::DistributedMesh::element_ptr_range(), end, libMesh::MeshBase::get_boundary_info(), libMesh::DofObject::id(), libMesh::MeshTools::libmesh_assert_valid_elem_ids(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_ids(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::DistributedMesh::max_elem_id(), libMesh::DistributedMesh::max_node_id(), libMesh::DistributedMesh::n_elem(), libMesh::DistributedMesh::n_nodes(), libMesh::MeshBase::node(), libMesh::Elem::node_ref_range(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::DistributedMesh::parallel_n_elem(), libMesh::DistributedMesh::parallel_n_nodes(), libMesh::BoundaryInfo::remove(), libMesh::DistributedMesh::renumber_dof_objects(), and libMesh::DistributedMesh::update_parallel_id_counts().

◆ reserve_elem()

virtual void libMesh::DistributedMesh::reserve_elem ( const  ne)
inlineoverridevirtualinherited

Reserves space for a known number of elements.

Note
This method may or may not do anything, depending on the actual Mesh implementation. If you know the number of elements you will add and call this method before repeatedly calling add_point() the implementation will be more efficient.

Implements libMesh::MeshBase.

Definition at line 235 of file distributed_mesh.h.

235 {}

◆ reserve_nodes()

virtual void libMesh::DistributedMesh::reserve_nodes ( const  nn)
inlineoverridevirtualinherited

Reserves space for a known number of nodes.

Note
This method may or may not do anything, depending on the actual Mesh implementation. If you know the number of nodes you will add and call this method before repeatedly calling add_point() the implementation will be more efficient.

Implements libMesh::MeshBase.

Definition at line 231 of file distributed_mesh.h.

231 {}

◆ semilocal_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::semilocal_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ semilocal_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::semilocal_elements_begin ( )
overridevirtualinherited

Iterate over elements for which elem->is_semilocal() is true for the current processor.

Implements libMesh::MeshBase.

◆ semilocal_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::semilocal_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ semilocal_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::semilocal_elements_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ set_count_lower_dim_elems_in_point_locator()

void libMesh::MeshBase::set_count_lower_dim_elems_in_point_locator ( bool  count_lower_dim_elems)
inherited

In the point locator, do we count lower dimensional elements when we refine point locator regions? This is relevant in tree-based point locators, for example.

Definition at line 703 of file mesh_base.C.

704 {
705  _count_lower_dim_elems_in_point_locator = count_lower_dim_elems;
706 }

◆ set_default_mapping_data()

void libMesh::MeshBase::set_default_mapping_data ( const unsigned char  data)
inlineinherited

Set the default master space to physical space mapping basis functions to be used on newly added elements.

Definition at line 732 of file mesh_base.h.

732  {
734  }

References libMesh::MeshBase::_default_mapping_data, and data.

Referenced by libMesh::DynaIO::read_mesh(), RationalMapTest< elem_type >::setUp(), and FETest< order, family, elem_type >::setUp().

◆ set_default_mapping_type()

void libMesh::MeshBase::set_default_mapping_type ( const ElemMappingType  type)
inlineinherited

Set the default master space to physical space mapping basis functions to be used on newly added elements.

Definition at line 716 of file mesh_base.h.

716  {
717  _default_mapping_type = type;
718  }

References libMesh::MeshBase::_default_mapping_type.

Referenced by libMesh::DynaIO::read_mesh(), and RationalMapTest< elem_type >::setUp().

◆ set_distributed()

virtual void libMesh::DistributedMesh::set_distributed ( )
inlineoverridevirtualinherited

Asserts that not all elements and nodes of the mesh necessarily exist on the current processor.

Reimplemented from libMesh::MeshBase.

Definition at line 133 of file distributed_mesh.h.

134  { _is_serial = false;
135  _is_serial_on_proc_0 = false; }

References libMesh::DistributedMesh::_is_serial, and libMesh::DistributedMesh::_is_serial_on_proc_0.

◆ set_elem_dimensions()

void libMesh::MeshBase::set_elem_dimensions ( const std::set< unsigned char > &  elem_dims)
inherited

Most of the time you should not need to call this, as the element dimensions will be set automatically by a call to cache_elem_dims(), therefore only call this if you know what you're doing.

In some specialized situations, for example when adding a single Elem on all procs, it can be faster to skip calling cache_elem_dims() and simply specify the element dimensions manually, which is why this setter exists.

Definition at line 144 of file mesh_base.C.

145 {
146 #ifdef DEBUG
147  // In debug mode, we call cache_elem_dims() and then make sure
148  // the result actually agrees with what the user specified.
149  parallel_object_only();
150 
151  this->cache_elem_dims();
152  libmesh_assert_msg(_elem_dims == elem_dims, \
153  "Specified element dimensions does not match true element dimensions!");
154 #endif
155 
156  _elem_dims = elem_dims;
157 }

References libMesh::MeshBase::_elem_dims, and libMesh::MeshBase::cache_elem_dims().

◆ set_mesh_dimension()

void libMesh::MeshBase::set_mesh_dimension ( unsigned char  d)
inlineinherited

◆ set_n_partitions()

unsigned int& libMesh::MeshBase::set_n_partitions ( )
inlineprotectedinherited
Returns
A writable reference to the number of partitions.

Definition at line 1667 of file mesh_base.h.

1668  { return _n_parts; }

References libMesh::MeshBase::_n_parts.

Referenced by libMesh::BoundaryInfo::sync().

◆ set_next_unique_id()

void libMesh::MeshBase::set_next_unique_id ( unique_id_type  id)
inlineinherited

Sets the next unique id to be used.

Definition at line 327 of file mesh_base.h.

327 { _next_unique_id = id; }

References libMesh::MeshBase::_next_unique_id.

◆ set_point_locator_close_to_point_tol()

void libMesh::MeshBase::set_point_locator_close_to_point_tol ( Real  val)
inherited

Set value used by PointLocatorBase::close_to_point_tol().

Defaults to 0.0. If nonzero, calls close_to_point_tol() whenever a new PointLocator is built for use by this Mesh. Since the Mesh controls the creation and destruction of the PointLocator, if there are any parameters we need to customize on it, the Mesh will need to know about them.

Definition at line 905 of file mesh_base.C.

906 {
908  if (_point_locator)
909  {
910  if (val > 0.)
911  _point_locator->set_close_to_point_tol(val);
912  else
913  _point_locator->unset_close_to_point_tol();
914  }
915 }

◆ set_spatial_dimension()

void libMesh::MeshBase::set_spatial_dimension ( unsigned char  d)
inherited

Sets the "spatial dimension" of the Mesh.

See the documentation for Mesh::spatial_dimension() for more information.

Definition at line 166 of file mesh_base.C.

167 {
168  // The user can set the _spatial_dimension however they wish,
169  // libMesh will only *increase* the spatial dimension, however,
170  // never decrease it.
171  _spatial_dimension = d;
172 }

References libMesh::MeshBase::_spatial_dimension.

Referenced by MeshSpatialDimensionTest::test2D().

◆ set_subdomain_name_map()

std::map<subdomain_id_type, std::string>& libMesh::MeshBase::set_subdomain_name_map ( )
inlineinherited

◆ size_elem_extra_integers()

void libMesh::MeshBase::size_elem_extra_integers ( )
protectedinherited

Size extra-integer arrays of all elements in the mesh.

Definition at line 926 of file mesh_base.C.

927 {
928  const std::size_t new_size = _elem_integer_names.size();
929  for (auto elem : this->element_ptr_range())
930  elem->add_extra_integers(new_size);
931 }

Referenced by libMesh::MeshBase::add_elem_data(), libMesh::MeshBase::add_elem_datum(), and libMesh::MeshBase::add_elem_integer().

◆ size_node_extra_integers()

void libMesh::MeshBase::size_node_extra_integers ( )
protectedinherited

Size extra-integer arrays of all nodes in the mesh.

Definition at line 935 of file mesh_base.C.

936 {
937  const std::size_t new_size = _node_integer_names.size();
938  for (auto node : this->node_ptr_range())
939  node->add_extra_integers(new_size);
940 }

Referenced by libMesh::MeshBase::add_node_data(), and libMesh::MeshBase::add_node_datum().

◆ skip_noncritical_partitioning() [1/2]

bool libMesh::MeshBase::skip_noncritical_partitioning ( ) const
inlineinherited

◆ skip_noncritical_partitioning() [2/2]

void libMesh::MeshBase::skip_noncritical_partitioning ( bool  skip)
inlineinherited

If true is passed in then the elements on this mesh will no longer be (re)partitioned, and the nodes on this mesh will only be repartitioned if they are found "orphaned" via coarsening or other removal of the last element responsible for their node/element processor id consistency.

Note
It would probably be a bad idea to call this on a DistributedMesh before the first partitioning has happened... because no elements would get assigned to your processor pool.
Skipping partitioning can have adverse effects on your performance when using AMR... i.e. you could get large load imbalances. However you might still want to use this if the communication and computation of the rebalance and repartition is too high for your application.

It is also possible, for backwards-compatibility purposes, to skip noncritical partitioning by resetting the partitioner() pointer for this mesh.

Definition at line 1058 of file mesh_base.h.

1059  { _skip_noncritical_partitioning = skip; }

References libMesh::MeshBase::_skip_noncritical_partitioning.

Referenced by libMesh::MeshTools::correct_node_proc_ids().

◆ skip_partitioning() [1/2]

bool libMesh::MeshBase::skip_partitioning ( ) const
inlineinherited

◆ skip_partitioning() [2/2]

void libMesh::MeshBase::skip_partitioning ( bool  skip)
inlineinherited

If true is passed in then nothing on this mesh will be (re)partitioned.

Note
The caveats for skip_noncritical_partitioning() still apply, and removing elements from a mesh with this setting enabled can leave node processor ids in an inconsistent state (not matching any attached element), causing failures in other library code. Do not use this setting along with element deletion or coarsening.

Definition at line 1076 of file mesh_base.h.

1076 { _skip_all_partitioning = skip; }

References libMesh::MeshBase::_skip_all_partitioning.

◆ spatial_dimension()

unsigned int libMesh::MeshBase::spatial_dimension ( ) const
inherited
Returns
The "spatial dimension" of the mesh.

The spatial dimension is defined as:

1 - for an exactly x-aligned mesh of 1D elements 2 - for an exactly x-y planar mesh of 2D elements 3 - otherwise

No tolerance checks are performed to determine whether the Mesh is x-aligned or x-y planar, only strict equality with zero in the higher dimensions is checked. Also, x-z and y-z planar meshes are considered to have spatial dimension == 3.

The spatial dimension is updated during prepare_for_use() based on the dimensions of the various elements present in the Mesh, but is never automatically decreased by this function.

For example, if the user calls set_spatial_dimension(2) and then later inserts 3D elements into the mesh, Mesh::spatial_dimension() will return 3 after the next call to prepare_for_use(). On the other hand, if the user calls set_spatial_dimension(3) and then inserts only x-aligned 1D elements into the Mesh, mesh.spatial_dimension() will remain 3.

Definition at line 159 of file mesh_base.C.

160 {
161  return cast_int<unsigned int>(_spatial_dimension);
162 }

References libMesh::MeshBase::_spatial_dimension.

Referenced by MeshSpatialDimensionTest::test1D(), and MeshSpatialDimensionTest::test2D().

◆ sub_point_locator()

std::unique_ptr< PointLocatorBase > libMesh::MeshBase::sub_point_locator ( ) const
inherited
Returns
A pointer to a subordinate PointLocatorBase object for this mesh, constructing a master PointLocator first if necessary. This should not be used in threaded or non-parallel_only code unless the master has already been constructed.

Definition at line 672 of file mesh_base.C.

673 {
674  // If there's no master point locator, then we need one.
675  if (_point_locator.get() == nullptr)
676  {
677  // PointLocator construction may not be safe within threads
679 
680  // And it may require parallel communication
681  parallel_object_only();
682 
684 
686  _point_locator->set_close_to_point_tol(_point_locator_close_to_point_tol);
687  }
688 
689  // Otherwise there was a master point locator, and we can grab a
690  // sub-locator easily.
692 }

References libMesh::Threads::in_threads, libMesh::libmesh_assert(), and libMesh::TREE_ELEMENTS.

Referenced by MeshfunctionDFEM::build_mesh(), libMesh::DofMap::create_dof_constraints(), libMesh::MeshFunction::init(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::DefaultCoupling::mesh_reinit(), libMesh::PointNeighborCoupling::mesh_reinit(), libMesh::MeshRefinement::test_level_one(), PointLocatorTest::testLocator(), MixedDimensionMeshTest::testPointLocatorTree(), SystemsTest::testProjectCube(), SystemsTest::testProjectLine(), and SystemsTest::testProjectSquare().

◆ subactive_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::subactive_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ subactive_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::subactive_elements_begin ( )
overridevirtualinherited

Iterate over elements for which elem->subactive() is true.

Implements libMesh::MeshBase.

◆ subactive_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::subactive_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ subactive_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::subactive_elements_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ subdomain_ids()

void libMesh::MeshBase::subdomain_ids ( std::set< subdomain_id_type > &  ids) const
inherited

Constructs a list of all subdomain identifiers in the global mesh.

Subdomains correspond to separate subsets of the mesh which could correspond e.g. to different materials in a solid mechanics application, or regions where different physical processes are important. The subdomain mapping is independent from the parallel decomposition.

Definition at line 461 of file mesh_base.C.

462 {
463  // This requires an inspection on every processor
464  parallel_object_only();
465 
466  ids.clear();
467 
468  for (const auto & elem : this->active_local_element_ptr_range())
469  ids.insert(elem->subdomain_id());
470 
471  // Some subdomains may only live on other processors
472  this->comm().set_union(ids);
473 }

Referenced by libMesh::ReplicatedMesh::get_disconnected_subdomains(), and libMesh::TecplotIO::TecplotIO().

◆ subdomain_name() [1/2]

std::string & libMesh::MeshBase::subdomain_name ( subdomain_id_type  id)
inherited
Returns
A writable reference for getting/setting an optional name for a subdomain.

Definition at line 717 of file mesh_base.C.

718 {
719  return _block_id_to_name[id];
720 }

Referenced by libMesh::AbaqusIO::assign_subdomain_ids(), DMlibMeshSetSystem_libMesh(), libMesh::UNVIO::groups_in(), libMesh::ExodusII_IO::read(), libMesh::GmshIO::read_mesh(), and libMesh::TecplotIO::write_binary().

◆ subdomain_name() [2/2]

const std::string & libMesh::MeshBase::subdomain_name ( subdomain_id_type  id) const
inherited

Definition at line 722 of file mesh_base.C.

723 {
724  // An empty string to return when no matching subdomain name is found
725  static const std::string empty;
726 
727  std::map<subdomain_id_type, std::string>::const_iterator iter = _block_id_to_name.find(id);
728  if (iter == _block_id_to_name.end())
729  return empty;
730  else
731  return iter->second;
732 }

◆ type_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::type_elements_begin ( ElemType  type) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ type_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::type_elements_begin ( ElemType  type)
overridevirtualinherited

Iterate over all elements with a specified geometric type.

Implements libMesh::MeshBase.

◆ type_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::type_elements_end ( ElemType  type) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ type_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::type_elements_end ( ElemType  type)
overridevirtualinherited

Implements libMesh::MeshBase.

◆ unpartitioned_elements_begin() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::unpartitioned_elements_begin ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ unpartitioned_elements_begin() [2/2]

virtual element_iterator libMesh::DistributedMesh::unpartitioned_elements_begin ( )
overridevirtualinherited

Iterate over unpartitioned elements in the Mesh.

Implements libMesh::MeshBase.

◆ unpartitioned_elements_end() [1/2]

virtual const_element_iterator libMesh::DistributedMesh::unpartitioned_elements_end ( ) const
overridevirtualinherited

Implements libMesh::MeshBase.

◆ unpartitioned_elements_end() [2/2]

virtual element_iterator libMesh::DistributedMesh::unpartitioned_elements_end ( )
overridevirtualinherited

Implements libMesh::MeshBase.

◆ update_parallel_id_counts()

void libMesh::DistributedMesh::update_parallel_id_counts ( )
overridevirtualinherited

Updates parallel caches so that methods like n_elem() accurately reflect changes on other processors.

Implements libMesh::MeshBase.

Definition at line 178 of file distributed_mesh.C.

179 {
180  // This function must be run on all processors at once
181  parallel_object_only();
182 
183  _n_elem = this->parallel_n_elem();
184  _n_nodes = this->parallel_n_nodes();
187 
190  ((_max_elem_id-1) / (this->n_processors() + 1) + 1) *
191  (this->n_processors() + 1) + this->n_processors();
194  ((_max_elem_id + this->n_processors() - 1) / (this->n_processors() + 1) + 1) *
195  (this->n_processors() + 1) + this->processor_id();
196 
199  ((_max_node_id-1) / (this->n_processors() + 1) + 1) *
200  (this->n_processors() + 1) + this->n_processors();
203  ((_max_node_id + this->n_processors() - 1) / (this->n_processors() + 1) + 1) *
204  (this->n_processors() + 1) + this->processor_id();
205 
206 #ifdef LIBMESH_ENABLE_UNIQUE_ID
209  ((_next_unique_id-1) / (this->n_processors() + 1) + 1) *
210  (this->n_processors() + 1) + this->n_processors();
212  ((_next_unique_id + this->n_processors() - 1) / (this->n_processors() + 1) + 1) *
213  (this->n_processors() + 1) + this->processor_id();
214 #endif
215 }

References libMesh::DistributedMesh::_max_elem_id, libMesh::DistributedMesh::_max_node_id, libMesh::DistributedMesh::_n_elem, libMesh::DistributedMesh::_n_nodes, libMesh::DistributedMesh::_next_free_local_elem_id, libMesh::DistributedMesh::_next_free_local_node_id, libMesh::DistributedMesh::_next_free_unpartitioned_elem_id, libMesh::DistributedMesh::_next_free_unpartitioned_node_id, libMesh::MeshBase::_next_unique_id, libMesh::DistributedMesh::_next_unpartitioned_unique_id, libMesh::ParallelObject::n_processors(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::DistributedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_n_elem(), libMesh::DistributedMesh::parallel_n_nodes(), and libMesh::ParallelObject::processor_id().

Referenced by libMesh::DistributedMesh::delete_remote_elements(), libMesh::DistributedMesh::DistributedMesh(), libMesh::DistributedMesh::redistribute(), libMesh::DistributedMesh::renumber_nodes_and_elements(), and libMesh::DistributedMesh::update_post_partitioning().

◆ update_post_partitioning()

void libMesh::DistributedMesh::update_post_partitioning ( )
overridevirtualinherited

Recalculate cached data after elements and nodes have been repartitioned.

Reimplemented from libMesh::MeshBase.

Definition at line 901 of file distributed_mesh.C.

902 {
903  // this->recalculate_n_partitions();
904 
905  // Partitioning changes our numbers of unpartitioned objects
907 }

References libMesh::DistributedMesh::update_parallel_id_counts().

◆ write() [1/2]

void libMesh::UnstructuredMesh::write ( const std::string &  name)
overridevirtualinherited

Write the file specified by name.

Attempts to figure out the proper method by the file extension.

Implements libMesh::MeshBase.

Definition at line 650 of file unstructured_mesh.C.

651 {
652  LOG_SCOPE("write()", "Mesh");
653 
654  NameBasedIO(*this).write(name);
655 }

References libMesh::Quality::name(), and libMesh::NameBasedIO::write().

Referenced by libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), and main().

◆ write() [2/2]

void libMesh::UnstructuredMesh::write ( const std::string &  name,
const std::vector< Number > &  values,
const std::vector< std::string > &  variable_names 
)
inherited

Write to the file specified by name.

Attempts to figure out the proper method by the file extension. Also writes data.

Definition at line 659 of file unstructured_mesh.C.

662 {
663  LOG_SCOPE("write()", "Mesh");
664 
665  NameBasedIO(*this).write_nodal_data(name, v, vn);
666 }

References libMesh::Quality::name(), and libMesh::NameBasedIO::write_nodal_data().

Member Data Documentation

◆ _allow_remote_element_removal

bool libMesh::MeshBase::_allow_remote_element_removal
protectedinherited

If this is false then even on DistributedMesh remote elements will not be deleted during mesh preparation.

This is true by default.

Definition at line 1754 of file mesh_base.h.

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

◆ _block_id_to_name

std::map<subdomain_id_type, std::string> libMesh::MeshBase::_block_id_to_name
protectedinherited

This structure maintains the mapping of named blocks for file formats that support named blocks.

Currently this is only implemented for ExodusII

Definition at line 1761 of file mesh_base.h.

Referenced by libMesh::MeshBase::get_subdomain_name_map(), and libMesh::MeshBase::set_subdomain_name_map().

◆ _communicator

const Parallel::Communicator& libMesh::ParallelObject::_communicator
protectedinherited

◆ _count_lower_dim_elems_in_point_locator

bool libMesh::MeshBase::_count_lower_dim_elems_in_point_locator
protectedinherited

Do we count lower dimensional elements in point locator refinement? This is relevant in tree-based point locators, for example.

Definition at line 1713 of file mesh_base.h.

◆ _default_ghosting

std::unique_ptr<GhostingFunctor> libMesh::MeshBase::_default_ghosting
protectedinherited

The default geometric GhostingFunctor, used to implement standard libMesh element ghosting behavior.

We use a base class pointer here to avoid dragging in more header dependencies.

Definition at line 1812 of file mesh_base.h.

Referenced by libMesh::MeshBase::default_ghosting(), and libMesh::MeshBase::MeshBase().

◆ _default_mapping_data

unsigned char libMesh::MeshBase::_default_mapping_data
protectedinherited

The default mapping data (unused with Lagrange, used for nodal weight lookup index with rational bases) to assign to newly added elements.

Definition at line 1693 of file mesh_base.h.

Referenced by libMesh::MeshBase::default_mapping_data(), and libMesh::MeshBase::set_default_mapping_data().

◆ _default_mapping_type

ElemMappingType libMesh::MeshBase::_default_mapping_type
protectedinherited

The default mapping type (typically Lagrange) between master and physical space to assign to newly added elements.

Definition at line 1686 of file mesh_base.h.

Referenced by libMesh::MeshBase::default_mapping_type(), and libMesh::MeshBase::set_default_mapping_type().

◆ _elem_dims

std::set<unsigned char> libMesh::MeshBase::_elem_dims
protectedinherited

We cache the dimension of the elements present in the mesh.

So, if we have a mesh with 1D and 2D elements, this structure will contain 1 and 2.

Definition at line 1768 of file mesh_base.h.

Referenced by libMesh::MeshBase::elem_dimensions(), libMesh::MeshBase::mesh_dimension(), libMesh::MeshBase::MeshBase(), libMesh::MeshBase::set_elem_dimensions(), and libMesh::MeshBase::set_mesh_dimension().

◆ _elem_integer_names

std::vector<std::string> libMesh::MeshBase::_elem_integer_names
protectedinherited

◆ _elements

mapvector<Elem *, dof_id_type> libMesh::DistributedMesh::_elements
protectedinherited

◆ _extra_ghost_elems

std::set<Elem *> libMesh::DistributedMesh::_extra_ghost_elems
protectedinherited

◆ _ghosting_functors

std::set<GhostingFunctor *> libMesh::MeshBase::_ghosting_functors
protectedinherited

The list of all GhostingFunctor objects to be used when distributing a DistributedMesh.

Basically unused by ReplicatedMesh for now, but belongs to MeshBase because the cost is trivial.

Definition at line 1821 of file mesh_base.h.

Referenced by libMesh::MeshBase::add_ghosting_functor(), libMesh::MeshBase::ghosting_functors_begin(), libMesh::MeshBase::ghosting_functors_end(), and libMesh::MeshBase::MeshBase().

◆ _is_prepared

bool libMesh::MeshBase::_is_prepared
protectedinherited

◆ _is_serial

bool libMesh::DistributedMesh::_is_serial
protectedinherited

◆ _is_serial_on_proc_0

bool libMesh::DistributedMesh::_is_serial_on_proc_0
protectedinherited

◆ _max_elem_id

dof_id_type libMesh::DistributedMesh::_max_elem_id
protectedinherited

◆ _max_node_id

dof_id_type libMesh::DistributedMesh::_max_node_id
protectedinherited

◆ _n_elem

dof_id_type libMesh::DistributedMesh::_n_elem
protectedinherited

◆ _n_nodes

dof_id_type libMesh::DistributedMesh::_n_nodes
protectedinherited

◆ _n_parts

unsigned int libMesh::MeshBase::_n_parts
protectedinherited

The number of partitions the mesh has.

This is set by the partitioners, and may not be changed directly by the user.

Note
The number of partitions need not equal this->n_processors(), consider for example the case where you simply want to partition a mesh on one processor and view the result in GMV.

Definition at line 1680 of file mesh_base.h.

Referenced by libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshBase::n_partitions(), and libMesh::MeshBase::set_n_partitions().

◆ _next_free_local_elem_id

dof_id_type libMesh::DistributedMesh::_next_free_local_elem_id
protectedinherited

◆ _next_free_local_node_id

dof_id_type libMesh::DistributedMesh::_next_free_local_node_id
protectedinherited

Guaranteed globally unused IDs for use when adding new nodes or elements.

Definition at line 576 of file distributed_mesh.h.

Referenced by libMesh::DistributedMesh::add_node(), libMesh::DistributedMesh::clear(), libMesh::DistributedMesh::DistributedMesh(), and libMesh::DistributedMesh::update_parallel_id_counts().

◆ _next_free_unpartitioned_elem_id

dof_id_type libMesh::DistributedMesh::_next_free_unpartitioned_elem_id
protectedinherited

◆ _next_free_unpartitioned_node_id

dof_id_type libMesh::DistributedMesh::_next_free_unpartitioned_node_id
protectedinherited

◆ _next_unique_id

unique_id_type libMesh::MeshBase::_next_unique_id
protectedinherited

◆ _next_unpartitioned_unique_id

unique_id_type libMesh::DistributedMesh::_next_unpartitioned_unique_id
protectedinherited

◆ _node_integer_names

std::vector<std::string> libMesh::MeshBase::_node_integer_names
protectedinherited

◆ _nodes

mapvector<Node *, dof_id_type> libMesh::DistributedMesh::_nodes
protectedinherited

◆ _partitioner

std::unique_ptr<Partitioner> libMesh::MeshBase::_partitioner
protectedinherited

A partitioner to use at each prepare_for_use().

This will be built in the constructor of each derived class, but can be replaced by the user through the partitioner() accessor.

Definition at line 1721 of file mesh_base.h.

Referenced by libMesh::DistributedMesh::DistributedMesh(), libMesh::MeshBase::MeshBase(), libMesh::MeshBase::partitioner(), libMesh::ReplicatedMesh::ReplicatedMesh(), and libMesh::MeshBase::skip_noncritical_partitioning().

◆ _point_locator

std::unique_ptr<PointLocatorBase> libMesh::MeshBase::_point_locator
mutableprotectedinherited

A PointLocator class for this mesh.

This will not actually be built unless needed. Further, since we want our point_locator() method to be const (yet do the dynamic allocating) this needs to be mutable. Since the PointLocatorBase::build() member is used, and it operates on a constant reference to the mesh, this is OK.

Definition at line 1707 of file mesh_base.h.

◆ _point_locator_close_to_point_tol

Real libMesh::MeshBase::_point_locator_close_to_point_tol
protectedinherited

If nonzero, we will call PointLocatorBase::set_close_to_point_tol() on any PointLocators that we create.

Definition at line 1833 of file mesh_base.h.

◆ _shared_functors

std::map<GhostingFunctor *, std::shared_ptr<GhostingFunctor> > libMesh::MeshBase::_shared_functors
protectedinherited

Hang on to references to any GhostingFunctor objects we were passed in shared_ptr form.

Definition at line 1827 of file mesh_base.h.

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

◆ _skip_all_partitioning

bool libMesh::MeshBase::_skip_all_partitioning
protectedinherited

If this is true then no partitioning should be done.

Definition at line 1739 of file mesh_base.h.

Referenced by libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshBase::skip_noncritical_partitioning(), and libMesh::MeshBase::skip_partitioning().

◆ _skip_noncritical_partitioning

bool libMesh::MeshBase::_skip_noncritical_partitioning
protectedinherited

If this is true then no partitioning should be done with the possible exception of orphaned nodes.

Definition at line 1734 of file mesh_base.h.

Referenced by libMesh::UnstructuredMesh::copy_nodes_and_elements(), and libMesh::MeshBase::skip_noncritical_partitioning().

◆ _skip_renumber_nodes_and_elements

bool libMesh::MeshBase::_skip_renumber_nodes_and_elements
protectedinherited

If this is true then renumbering will be kept to a minimum.

This is set when prepare_for_use() is called.

Definition at line 1746 of file mesh_base.h.

Referenced by libMesh::MeshBase::allow_renumbering(), libMesh::ReplicatedMesh::renumber_nodes_and_elements(), and libMesh::DistributedMesh::renumber_nodes_and_elements().

◆ _spatial_dimension

unsigned char libMesh::MeshBase::_spatial_dimension
protectedinherited

The "spatial dimension" of the Mesh.

See the documentation for Mesh::spatial_dimension() for more information.

Definition at line 1774 of file mesh_base.h.

Referenced by libMesh::MeshBase::set_spatial_dimension(), and libMesh::MeshBase::spatial_dimension().

◆ boundary_info

std::unique_ptr<BoundaryInfo> libMesh::MeshBase::boundary_info
inherited

This class holds the boundary information.

It can store nodes, edges, and faces with a corresponding id that facilitates setting boundary conditions.

Direct access to this class will be removed in future libMesh versions. Use the get_boundary_info() accessor instead.

Definition at line 1659 of file mesh_base.h.

Referenced by libMesh::MeshBase::get_boundary_info(), and MeshInputTest::testMeshMoveConstructor().


The documentation for this class was generated from the following file:
libMesh::DistributedMesh::_nodes
mapvector< Node *, dof_id_type > _nodes
The vertices (spatial coordinates) of the mesh.
Definition: distributed_mesh.h:550
libMesh::MeshBase::pid_elements_begin
virtual element_iterator pid_elements_begin(processor_id_type proc_id)=0
Iterate over all elements with a specified processor id.
libMesh::MeshBase::MeshCommunication
friend class MeshCommunication
Make the MeshCommunication class a friend so that it can directly broadcast *_integer_names.
Definition: mesh_base.h:1857
libMesh::DistributedMesh::active_local_subdomain_elements_end
virtual element_iterator active_local_subdomain_elements_end(subdomain_id_type subdomain_id) override
libMesh::MeshBase::_is_prepared
bool _is_prepared
Flag indicating if the mesh has been prepared for use.
Definition: mesh_base.h:1698
libMesh::MeshBase::ghosting_functors_begin
std::set< GhostingFunctor * >::const_iterator ghosting_functors_begin() const
Beginning of range of ghosting functors.
Definition: mesh_base.h:1113
libMesh::dof_id_type
uint8_t dof_id_type
Definition: id_types.h:67
libMesh::BoundaryInfo::boundary_ids
std::vector< boundary_id_type > boundary_ids(const Node *node) const
Definition: boundary_info.C:985
libMesh::MeshBase::update_post_partitioning
virtual void update_post_partitioning()
Recalculate any cached data after elements and nodes have been repartitioned.
Definition: mesh_base.h:1006
libMesh::MeshBase::ghosting_functors_end
std::set< GhostingFunctor * >::const_iterator ghosting_functors_end() const
End of range of ghosting functors.
Definition: mesh_base.h:1119
libMesh::MeshBase::allow_renumbering
bool allow_renumbering() const
Definition: mesh_base.h:1026
libMesh::MeshTools::Subdivision::next
static const unsigned int next[3]
A lookup table for the increment modulo 3 operation, for iterating through the three nodes per elemen...
Definition: mesh_subdivision_support.h:102
libMesh::invalid_uint
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
Definition: libmesh.h:249
libMesh::DistributedMesh::_max_elem_id
dof_id_type _max_elem_id
Definition: distributed_mesh.h:570
libMesh::MeshBase::delete_node
virtual void delete_node(Node *n)=0
Removes the Node n from the mesh.
libMesh::MeshBase::reserve_nodes
virtual void reserve_nodes(const dof_id_type nn)=0
Reserves space for a known number of nodes.
libMesh::DistributedMesh::_extra_ghost_elems
std::set< Elem * > _extra_ghost_elems
These are extra ghost elements that we want to make sure not to delete when we call delete_remote_ele...
Definition: distributed_mesh.h:592
libMesh::MeshBase::default_mapping_type
ElemMappingType default_mapping_type() const
Returns the default master space to physical space mapping basis functions to be used on newly added ...
Definition: mesh_base.h:708
libMesh::MeshBase::merge_extra_integer_names
std::pair< std::vector< unsigned int >, std::vector< unsigned int > > merge_extra_integer_names(const MeshBase &other)
Merge extra-integer arrays from an other mesh.
Definition: mesh_base.C:944
libMesh::UnstructuredMesh::find_neighbors
virtual void find_neighbors(const bool reset_remote_elements=false, const bool reset_current_list=true) override
Other functions from MeshBase requiring re-definition.
Definition: unstructured_mesh.C:257
libMesh::MeshBase::_elem_dims
std::set< unsigned char > _elem_dims
We cache the dimension of the elements present in the mesh.
Definition: mesh_base.h:1768
libMesh::MeshBase::active_pid_elements_end
virtual element_iterator active_pid_elements_end(processor_id_type proc_id)=0
libMesh::DistributedMesh::active_elements_end
virtual element_iterator active_elements_end() override
libMesh::unique_id_type
uint8_t unique_id_type
Definition: id_types.h:86
libMesh::MeshBase::get_boundary_info
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
Definition: mesh_base.h:132
libMesh::MeshTools::libmesh_assert_valid_boundary_ids
void libmesh_assert_valid_boundary_ids(const MeshBase &mesh)
A function for verifying that boundary condition ids match across processors.
Definition: mesh_tools.C:1396
libMesh::DistributedMesh::max_elem_id
virtual dof_id_type max_elem_id() const override
Definition: distributed_mesh.h:234
libMesh::MeshBase::_default_ghosting
std::unique_ptr< GhostingFunctor > _default_ghosting
The default geometric GhostingFunctor, used to implement standard libMesh element ghosting behavior.
Definition: mesh_base.h:1812
libMesh::MeshBase::is_serial
virtual bool is_serial() const
Definition: mesh_base.h:159
libMesh::MeshBase::recalculate_n_partitions
unsigned int recalculate_n_partitions()
In a few (very rare) cases, the user may have manually tagged the elements with specific processor ID...
Definition: mesh_base.C:631
libMesh::DistributedMesh::elements_end
virtual element_iterator elements_end() override
libMesh::DistributedMesh::parallel_max_elem_id
dof_id_type parallel_max_elem_id() const
Definition: distributed_mesh.C:233
libMesh::n_threads
unsigned int n_threads()
Definition: libmesh_base.h:96
libMesh::MeshBase::point
virtual const Point & point(const dof_id_type i) const =0
libMesh::MeshBase::add_elem_integers
std::vector< unsigned int > add_elem_integers(const std::vector< std::string > &names, bool allocate_data=true)
Register integer data (of type dof_id_type) to be added to each element in the mesh,...
Definition: mesh_base.C:191
libMesh::MeshBase::delete_elem
virtual void delete_elem(Elem *e)=0
Removes element e from the mesh.
libMesh::DistributedMesh::active_subdomain_set_elements_begin
virtual element_iterator active_subdomain_set_elements_begin(std::set< subdomain_id_type > ss) override
libMesh::DistributedMesh::parallel_max_node_id
dof_id_type parallel_max_node_id() const
Definition: distributed_mesh.C:291
libMesh::MeshBase::active_local_element_ptr_range
virtual SimpleRange< element_iterator > active_local_element_ptr_range()=0
libMesh::MeshBase::pid_elements_end
virtual element_iterator pid_elements_end(processor_id_type proc_id)=0
libMesh::Elem::contract
void contract()
Contract an active element, i.e.
Definition: elem_refinement.C:230
libMesh::Elem::ancestor
bool ancestor() const
Definition: elem.C:1350
libMesh::MeshBase::active_element_ptr_range
virtual SimpleRange< element_iterator > active_element_ptr_range()=0
libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids
void libmesh_assert_valid_amr_elem_ids(const MeshBase &mesh)
A function for verifying that ids of elements are correctly sorted for AMR (parents have lower ids th...
Definition: mesh_tools.C:1315
libMesh::MeshBase::n_elem
virtual dof_id_type n_elem() const =0
libMesh::TREE_ELEMENTS
Definition: enum_point_locator_type.h:37
libMesh::MeshBase::elem_ref
virtual const Elem & elem_ref(const dof_id_type i) const
Definition: mesh_base.h:521
libMesh::DistributedMesh::_max_node_id
dof_id_type _max_node_id
Definition: distributed_mesh.h:570
libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids
void libmesh_assert_valid_parallel_object_ids(const mapvector< T *, dof_id_type > &) const
Verify id, processor_id, and if applicable unique_id consistency of a parallel objects container.
Definition: distributed_mesh.C:912
libMesh::DistributedMesh::parallel_max_unique_id
virtual unique_id_type parallel_max_unique_id() const override
Definition: distributed_mesh.C:264
libMesh::index_range
IntRange< std::size_t > index_range(const std::vector< T > &vec)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:106
libMesh::MeshBase::max_elem_id
virtual dof_id_type max_elem_id() const =0
libMesh::Elem::dim
virtual unsigned short dim() const =0
libMesh::DistributedMesh::active_pid_elements_end
virtual element_iterator active_pid_elements_end(processor_id_type proc_id) override
libMesh::MeshBase::detect_interior_parents
void detect_interior_parents()
Search the mesh for elements that have a neighboring element of dim+1 and set that element as the int...
Definition: mesh_base.C:812
libMesh::MeshTools::libmesh_assert_valid_neighbors
void libmesh_assert_valid_neighbors(const MeshBase &mesh, bool assert_valid_remote_elems=true)
A function for verifying that neighbor connectivity is correct (each element is a neighbor of or desc...
Definition: mesh_tools.C:2061
libMesh::MeshBase::_skip_all_partitioning
bool _skip_all_partitioning
If this is true then no partitioning should be done.
Definition: mesh_base.h:1739
libMesh::DistributedMesh::local_nodes_end
virtual node_iterator local_nodes_end() override
libMesh::MeshBase::_n_parts
unsigned int _n_parts
The number of partitions the mesh has.
Definition: mesh_base.h:1680
end
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end.
Definition: variant_filter_iterator.h:343
libMesh::TOLERANCE
static const Real TOLERANCE
Definition: libmesh_common.h:128
libMesh::DofObject::add_extra_integers
void add_extra_integers(const unsigned int n_integers)
Assigns a set of extra integers to this DofObject.
Definition: dof_object.C:503
libMesh::ParallelObject::comm
const Parallel::Communicator & comm() const
Definition: parallel_object.h:94
libMesh::DistributedMesh::active_local_subdomain_elements_begin
virtual element_iterator active_local_subdomain_elements_begin(subdomain_id_type subdomain_id) override
libMesh::DistributedMesh::max_node_id
virtual dof_id_type max_node_id() const override
Definition: distributed_mesh.h:230
libMesh::MeshBase::size_node_extra_integers
void size_node_extra_integers()
Size extra-integer arrays of all nodes in the mesh.
Definition: mesh_base.C:935
libMesh::MeshBase::n_partitions
unsigned int n_partitions() const
Definition: mesh_base.h:1153
libMesh::MeshBase::node_ptr
virtual const Node * node_ptr(const dof_id_type i) const =0
libMesh::MeshBase::mesh_dimension
unsigned int mesh_dimension() const
Definition: mesh_base.C:135
libMesh::MeshBase::_allow_remote_element_removal
bool _allow_remote_element_removal
If this is false then even on DistributedMesh remote elements will not be deleted during mesh prepara...
Definition: mesh_base.h:1754
libMesh::MeshBase::max_node_id
virtual dof_id_type max_node_id() const =0
libMesh::MeshBase::partition
void partition()
Definition: mesh_base.h:992
libMesh::DistributedMesh::active_subdomain_set_elements_end
virtual element_iterator active_subdomain_set_elements_end(std::set< subdomain_id_type > ss) override
libMesh::MeshBase::active_pid_elements_begin
virtual element_iterator active_pid_elements_begin(processor_id_type proc_id)=0
libMesh::DistributedMesh::active_pid_elements_begin
virtual element_iterator active_pid_elements_begin(processor_id_type proc_id) override
libMesh::MeshTools::libmesh_assert_valid_elem_ids
void libmesh_assert_valid_elem_ids(const MeshBase &mesh)
A function for verifying that ids and processor assignment of elements are correctly sorted (monotone...
Definition: mesh_tools.C:1292
libMesh::DofObject::processor_id
processor_id_type processor_id() const
Definition: dof_object.h:829
libMesh::MeshBase::elem_ptr
virtual const Elem * elem_ptr(const dof_id_type i) const =0
libMesh::MeshBase::elements_begin
virtual element_iterator elements_begin()=0
Iterate over all the elements in the Mesh.
libMesh::Elem::active
bool active() const
Definition: elem.h:2345
libMesh::MeshBase::pid_nodes_begin
virtual node_iterator pid_nodes_begin(processor_id_type proc_id)=0
Iterate over nodes with processor_id() == proc_id.
libMesh::MeshTools::n_levels
unsigned int n_levels(const MeshBase &mesh)
Definition: mesh_tools.C:656
libMesh::mapvector::maptype
std::map< index_t, Val > maptype
Definition: mapvector.h:42
libMesh::BoundaryInfo::remove
void remove(const Node *node)
Removes the boundary conditions associated with node node, if any exist.
Definition: boundary_info.C:1358
libMesh::MeshBase::_count_lower_dim_elems_in_point_locator
bool _count_lower_dim_elems_in_point_locator
Do we count lower dimensional elements in point locator refinement? This is relevant in tree-based po...
Definition: mesh_base.h:1713
dim
unsigned int dim
Definition: adaptivity_ex3.C:113
libMesh::MeshBase::query_elem_ptr
virtual const Elem * query_elem_ptr(const dof_id_type i) const =0
libMesh::MeshBase::add_node_integers
std::vector< unsigned int > add_node_integers(const std::vector< std::string > &names, bool allocate_data=true)
Register integer data (of type dof_id_type) to be added to each node in the mesh.
Definition: mesh_base.C:262
libMesh::BoundaryInfo::copy_boundary_ids
void copy_boundary_ids(const BoundaryInfo &old_boundary_info, const Elem *const old_elem, const Elem *const new_elem)
Definition: boundary_info.C:1328
libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags
void libmesh_assert_valid_parallel_flags() const
Verify refinement_flag and p_refinement_flag consistency of our elements containers.
Definition: distributed_mesh.C:999
libMesh::Elem::invalid_subdomain_id
static const subdomain_id_type invalid_subdomain_id
A static integral constant representing an invalid subdomain id.
Definition: elem.h:244
libMesh::DistributedMesh::nodes_begin
virtual node_iterator nodes_begin() override
Node iterator accessor functions.
libMesh::MeshBase::element_ptr_range
virtual SimpleRange< element_iterator > element_ptr_range()=0
libMesh::MeshBase::_default_mapping_data
unsigned char _default_mapping_data
The default mapping data (unused with Lagrange, used for nodal weight lookup index with rational base...
Definition: mesh_base.h:1693
libMesh::DistributedMesh::active_local_elements_end
virtual element_iterator active_local_elements_end() override
libMesh::DistributedMesh::_next_free_unpartitioned_node_id
dof_id_type _next_free_unpartitioned_node_id
Definition: distributed_mesh.h:578
libMesh::libmesh_assert
libmesh_assert(ctx)
libMesh::DistributedMesh::parallel_n_elem
virtual dof_id_type parallel_n_elem() const override
Definition: distributed_mesh.C:220
libMesh::MeshBase::own_node
virtual void own_node(Node &)
Takes ownership of node n on this partition of a distributed mesh, by setting n.processor_id() to thi...
Definition: mesh_base.h:656
libMesh::DofObject::invalid_unique_id
static const unique_id_type invalid_unique_id
An invalid unique_id to distinguish an uninitialized DofObject.
Definition: dof_object.h:426
libMesh::DistributedMesh::n_nodes
virtual dof_id_type n_nodes() const override
Definition: distributed_mesh.h:229
libMesh::MeshBase::n_local_nodes
dof_id_type n_local_nodes() const
Definition: mesh_base.h:303
libMesh::MeshBase::n_subdomains
subdomain_id_type n_subdomains() const
Definition: mesh_base.C:477
libMesh::Elem::subactive
bool subactive() const
Definition: elem.h:2363
libMesh::DistributedMesh::active_elements_begin
virtual element_iterator active_elements_begin() override
Active, local, and negation forms of the element iterators described above.
libMesh::Elem::node_ref_range
SimpleRange< NodeRefIter > node_ref_range()
Returns a range with all nodes of an element, usable in range-based for loops.
Definition: elem.h:2152
libMesh::PointLocatorBase::build
static std::unique_ptr< PointLocatorBase > build(PointLocatorType t, const MeshBase &mesh, const PointLocatorBase *master=nullptr)
Builds an PointLocator for the mesh mesh.
Definition: point_locator_base.C:66
libMesh::MeshTools::libmesh_assert_valid_unique_ids
void libmesh_assert_valid_unique_ids(const MeshBase &mesh)
A function for verifying that unique ids match across processors.
Definition: mesh_tools.C:1634
libMesh::MeshBase::_spatial_dimension
unsigned char _spatial_dimension
The "spatial dimension" of the Mesh.
Definition: mesh_base.h:1774
libMesh::MeshBase::level_elements_begin
virtual element_iterator level_elements_begin(unsigned int level)=0
Iterate over elements of a given level.
libMesh::MeshBase::_elem_integer_names
std::vector< std::string > _elem_integer_names
The array of names for integer data associated with each element in the mesh.
Definition: mesh_base.h:1780
libMesh::MeshBase::subdomain_ids
void subdomain_ids(std::set< subdomain_id_type > &ids) const
Constructs a list of all subdomain identifiers in the global mesh.
Definition: mesh_base.C:461
libMesh::ParallelObject::n_processors
processor_id_type n_processors() const
Definition: parallel_object.h:100
libMesh::Threads::in_threads
bool in_threads
A boolean which is true iff we are in a Threads:: function It may be useful to assert(!...
Definition: threads.C:31
libMesh::DistributedMesh::delete_elem
virtual void delete_elem(Elem *e) override
Removes element e from the mesh.
Definition: distributed_mesh.C:582
libMesh::MeshBase::_next_unique_id
unique_id_type _next_unique_id
The next available unique id for assigning ids to DOF objects.
Definition: mesh_base.h:1727
libMesh::MeshBase::node_ptr_range
virtual SimpleRange< node_iterator > node_ptr_range()=0
libMesh::DistributedMesh::_is_serial
bool _is_serial
A boolean remembering whether we're serialized or not.
Definition: distributed_mesh.h:560
libMesh::MeshBase::elem
virtual const Elem * elem(const dof_id_type i) const
Definition: mesh_base.h:554
libMesh::MeshBase::clear_point_locator
void clear_point_locator()
Releases the current PointLocator object.
Definition: mesh_base.C:696
libMesh::Elem::first_order_equivalent_type
static ElemType first_order_equivalent_type(const ElemType et)
Definition: elem.C:2369
libMesh::RemoteElem::is_child_on_side
virtual bool is_child_on_side(const unsigned int, const unsigned int) const override
Definition: remote_elem.h:152
libMesh::DistributedMesh::n_elem
virtual dof_id_type n_elem() const override
Definition: distributed_mesh.h:232
libMesh::ParallelObject::processor_id
processor_id_type processor_id() const
Definition: parallel_object.h:106
libMesh::DofObject::invalid_id
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:421
libMesh::MeshBase::pid_nodes_end
virtual node_iterator pid_nodes_end(processor_id_type proc_id)=0
libMesh::DistributedMesh::local_nodes_begin
virtual node_iterator local_nodes_begin() override
Iterate over local nodes (nodes whose processor_id() matches the current processor).
libMesh::ParallelObject::_communicator
const Parallel::Communicator & _communicator
Definition: parallel_object.h:112
libMesh::processor_id_type
uint8_t processor_id_type
Definition: id_types.h:104
libMesh::MeshBase::skip_noncritical_partitioning
bool skip_noncritical_partitioning() const
Definition: mesh_base.h:1061
libMesh::MeshBase::insert_elem
virtual Elem * insert_elem(Elem *e)=0
Insert elem e to the element array, preserving its id and replacing/deleting any existing element wit...
libMesh::MeshBase::add_elem_integer
unsigned int add_elem_integer(const std::string &name, bool allocate_data=true)
Register an integer datum (of type dof_id_type) to be added to each element in the mesh.
Definition: mesh_base.C:176
libMesh::Node::build
static std::unique_ptr< Node > build(const Node &n)
Definition: node.h:314
libMesh::DistributedMesh::add_elem
virtual Elem * add_elem(Elem *e) override
Add elem e to the end of the element array.
Definition: distributed_mesh.C:436
libMesh::MeshBase::elem_dimensions
const std::set< unsigned char > & elem_dimensions() const
Definition: mesh_base.h:225
libMesh::Elem::n_vertices
virtual unsigned int n_vertices() const =0
libMesh::DistributedMesh::_next_free_local_elem_id
dof_id_type _next_free_local_elem_id
Definition: distributed_mesh.h:576
libMesh::MeshBase::size_elem_extra_integers
void size_elem_extra_integers()
Size extra-integer arrays of all elements in the mesh.
Definition: mesh_base.C:926
libMesh::MeshBase::_ghosting_functors
std::set< GhostingFunctor * > _ghosting_functors
The list of all GhostingFunctor objects to be used when distributing a DistributedMesh.
Definition: mesh_base.h:1821
libMesh::MeshBase::spatial_dimension
unsigned int spatial_dimension() const
Definition: mesh_base.C:159
libMesh::MeshBase::node
virtual const Node & node(const dof_id_type i) const
Definition: mesh_base.h:471
libMesh::DistributedMesh::DistributedMesh
DistributedMesh(const Parallel::Communicator &comm_in, unsigned char dim=1)
Constructor.
Definition: distributed_mesh.C:40
libMesh::as_range
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libMesh::MeshBase::_point_locator_close_to_point_tol
Real _point_locator_close_to_point_tol
If nonzero, we will call PointLocatorBase::set_close_to_point_tol() on any PointLocators that we crea...
Definition: mesh_base.h:1833
libMesh::MeshBase::n_local_elem
dof_id_type n_local_elem() const
Definition: mesh_base.h:403
libMesh::MeshBase::add_node_integer
unsigned int add_node_integer(const std::string &name, bool allocate_data=true)
Register an integer datum (of type dof_id_type) to be added to each node in the mesh.
Definition: mesh_base.C:247
libMesh::MeshBase::n_active_elem_on_proc
dof_id_type n_active_elem_on_proc(const processor_id_type proc) const
Definition: mesh_base.C:518
libMesh::MeshBase::_shared_functors
std::map< GhostingFunctor *, std::shared_ptr< GhostingFunctor > > _shared_functors
Hang on to references to any GhostingFunctor objects we were passed in shared_ptr form.
Definition: mesh_base.h:1827
libMesh::BoundaryInfo::regenerate_id_sets
void regenerate_id_sets()
Clears and regenerates the cached sets of ids.
Definition: boundary_info.C:159
libMesh::DistributedMesh::nodes_end
virtual node_iterator nodes_end() override
libMesh::DistributedMesh::active_local_elements_begin
virtual element_iterator active_local_elements_begin() override
libMesh::MeshBase::_node_integer_names
std::vector< std::string > _node_integer_names
The array of names for integer data associated with each node in the mesh.
Definition: mesh_base.h:1786
libMesh::MeshBase::delete_remote_elements
virtual void delete_remote_elements()
When supported, deletes all nonlocal elements of the mesh except for "ghosts" which touch a local ele...
Definition: mesh_base.h:201
libMesh::MeshBase::cache_elem_dims
void cache_elem_dims()
Search the mesh and cache the different dimensions of the elements present in the mesh.
Definition: mesh_base.C:753
libMesh::MeshBase::_point_locator
std::unique_ptr< PointLocatorBase > _point_locator
A PointLocator class for this mesh.
Definition: mesh_base.h:1707
libMesh::MeshBase::node_ref
virtual const Node & node_ref(const dof_id_type i) const
Definition: mesh_base.h:451
libMesh::MeshBase::_partitioner
std::unique_ptr< Partitioner > _partitioner
A partitioner to use at each prepare_for_use().
Definition: mesh_base.h:1721
libMesh::MeshBase::renumber_nodes_and_elements
virtual void renumber_nodes_and_elements()=0
After partitioning a mesh it is useful to renumber the nodes and elements so that they lie in contigu...
libMesh::DistributedMesh::_next_free_unpartitioned_elem_id
dof_id_type _next_free_unpartitioned_elem_id
Definition: distributed_mesh.h:578
libMesh::Elem::parent
const Elem * parent() const
Definition: elem.h:2434
libMesh::MeshBase::n_nodes
virtual dof_id_type n_nodes() const =0
libMesh::MeshBase::add_ghosting_functor
void add_ghosting_functor(GhostingFunctor &ghosting_functor)
Adds a functor which can specify ghosting requirements for use on distributed meshes.
Definition: mesh_base.h:1089
libMesh::DistributedMesh::_n_nodes
dof_id_type _n_nodes
Cached data from the last renumber_nodes_and_elements call.
Definition: distributed_mesh.h:570
distance
Real distance(const Point &p)
Definition: subdomains_ex3.C:50
libMesh::MeshBase::boundary_info
std::unique_ptr< BoundaryInfo > boundary_info
This class holds the boundary information.
Definition: mesh_base.h:1659
libMesh::DistributedMesh::renumber_dof_objects
dof_id_type renumber_dof_objects(mapvector< T *, dof_id_type > &)
Renumber a parallel objects container.
Definition: distributed_mesh.C:1029
libMesh::MeshBase::_skip_renumber_nodes_and_elements
bool _skip_renumber_nodes_and_elements
If this is true then renumbering will be kept to a minimum.
Definition: mesh_base.h:1746
libMesh::ReferenceElem::get
const Elem & get(const ElemType type_in)
Definition: reference_elem.C:237
libMesh::MeshBase::_block_id_to_name
std::map< subdomain_id_type, std::string > _block_id_to_name
This structure maintains the mapping of named blocks for file formats that support named blocks.
Definition: mesh_base.h:1761
libMesh::Elem::is_ancestor_of
bool is_ancestor_of(const Elem *descendant) const
Definition: elem.h:2413
libMesh::DistributedMesh::active_subdomain_elements_begin
virtual element_iterator active_subdomain_elements_begin(subdomain_id_type subdomain_id) override
libMesh::MeshBase::add_elem
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
libMesh::DistributedMesh::element_ptr_range
virtual SimpleRange< element_iterator > element_ptr_range() override
Definition: distributed_mesh.h:308
libMesh::Partitioner::set_node_processor_ids
static void set_node_processor_ids(MeshBase &mesh)
This function is called after partitioning to set the processor IDs for the nodes.
Definition: partitioner.C:691
libMesh::MeshBase::n_unpartitioned_elem
dof_id_type n_unpartitioned_elem() const
Definition: mesh_base.h:409
libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels
void libmesh_assert_valid_parallel_p_levels() const
Verify p_level consistency of our elements containers.
Definition: distributed_mesh.C:976
libMesh::Elem::subdomain_id
subdomain_id_type subdomain_id() const
Definition: elem.h:2069
libMesh::DofObject::id
dof_id_type id() const
Definition: dof_object.h:767
libMesh::DistributedMesh::libmesh_assert_valid_parallel_ids
virtual void libmesh_assert_valid_parallel_ids() const override
Verify id and processor_id consistency of our elements and nodes containers.
Definition: distributed_mesh.C:968
libMesh::MeshBase::elements_end
virtual element_iterator elements_end()=0
libMesh::MeshBase::n_nodes_on_proc
dof_id_type n_nodes_on_proc(const processor_id_type proc) const
Definition: mesh_base.C:492
libMesh::MeshBase::n_elem_on_proc
dof_id_type n_elem_on_proc(const processor_id_type proc) const
Definition: mesh_base.C:505
libMesh::Elem::has_children
bool has_children() const
Definition: elem.h:2383
libMesh::DistributedMesh::extra_ghost_elems
const std::set< Elem * > & extra_ghost_elems() const
Const accessor to the ghosted elements.
Definition: distributed_mesh.h:226
libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents
void libmesh_assert_valid_amr_interior_parents(const MeshBase &mesh)
A function for verifying that any interior_parent pointers on elements are consistent with AMR (paren...
Definition: mesh_tools.C:1335
libMesh::MeshBase::n_unpartitioned_nodes
dof_id_type n_unpartitioned_nodes() const
Definition: mesh_base.h:309
libMesh::DofObject::invalid_processor_id
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
Definition: dof_object.h:432
libMesh::DistributedMesh::update_parallel_id_counts
virtual void update_parallel_id_counts() override
Updates parallel caches so that methods like n_elem() accurately reflect changes on other processors.
Definition: distributed_mesh.C:178
libMesh::DistributedMesh::is_serial
virtual bool is_serial() const override
Definition: distributed_mesh.h:119
libMesh::Elem::second_order_equivalent_type
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
Definition: elem.C:2432
libMesh::MeshBase::_default_mapping_type
ElemMappingType _default_mapping_type
The default mapping type (typically Lagrange) between master and physical space to assign to newly ad...
Definition: mesh_base.h:1686
data
IterBase * data
Ideally this private member data should have protected access.
Definition: variant_filter_iterator.h:337
libMesh::DistributedMesh::elements_begin
virtual element_iterator elements_begin() override
Elem iterator accessor functions.
libMesh::DistributedMesh::_next_unpartitioned_unique_id
unique_id_type _next_unpartitioned_unique_id
The next available unique id for assigning ids to unpartitioned DOF objects.
Definition: distributed_mesh.h:585
libMesh::DistributedMesh::_is_serial_on_proc_0
bool _is_serial_on_proc_0
A boolean remembering whether we're serialized to proc 0 or not.
Definition: distributed_mesh.h:565
libMesh::UnstructuredMesh::create_submesh
void create_submesh(UnstructuredMesh &new_mesh, const const_element_iterator &it, const const_element_iterator &it_end) const
Constructs a mesh called "new_mesh" from the current mesh by iterating over the elements between it a...
Definition: unstructured_mesh.C:707
libMesh::MeshTools::libmesh_assert_valid_refinement_tree
void libmesh_assert_valid_refinement_tree(const MeshBase &mesh)
A function for verifying that elements on this processor have valid descendants and consistent active...
Definition: mesh_tools.C:2026
libMesh::MeshBase::allow_remote_element_removal
bool allow_remote_element_removal() const
Definition: mesh_base.h:1035
libMesh::MeshBase::add_point
virtual Node * add_point(const Point &p, const dof_id_type id=DofObject::invalid_id, const processor_id_type proc_id=DofObject::invalid_processor_id)=0
Add a new Node at Point p to the end of the vertex array, with processor_id procid.
libMesh::MeshBase::level_elements_end
virtual element_iterator level_elements_end(unsigned int level)=0
libMesh::err
OStreamProxy err
libMesh::DistributedMesh::active_subdomain_elements_end
virtual element_iterator active_subdomain_elements_end(subdomain_id_type subdomain_id) override
libMesh::MeshBase::default_mapping_data
unsigned char default_mapping_data() const
Returns any default data value used by the master space to physical space mapping.
Definition: mesh_base.h:724
libMesh::DistributedMesh::_elements
mapvector< Elem *, dof_id_type > _elements
The elements in the mesh.
Definition: distributed_mesh.h:555
libMesh::Elem::node_id
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1977
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::MeshBase::prepare_for_use
void prepare_for_use(const bool skip_renumber_nodes_and_elements=false, const bool skip_find_neighbors=false)
Prepare a newly ecreated (or read) mesh for use.
Definition: mesh_base.C:318
libMesh::DistributedMesh::add_node
virtual Node * add_node(Node *n) override
Add Node n to the end of the vertex array.
Definition: distributed_mesh.C:663
libMesh::MeshBase::clear
virtual void clear()
Deletes all the element and node data that is currently stored.
Definition: mesh_base.C:429
libMesh::DistributedMesh::parallel_n_nodes
virtual dof_id_type parallel_n_nodes() const override
Definition: distributed_mesh.C:278
libMesh::Elem::n_sub_elem
virtual unsigned int n_sub_elem() const =0
libMesh::Elem::build
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition: elem.C:246
libMesh::MeshBase::update_parallel_id_counts
virtual void update_parallel_id_counts()=0
Updates parallel caches so that methods like n_elem() accurately reflect changes on other processors.
libMesh::out
OStreamProxy out
libMesh::DistributedMesh::_next_free_local_node_id
dof_id_type _next_free_local_node_id
Guaranteed globally unused IDs for use when adding new nodes or elements.
Definition: distributed_mesh.h:576
libMesh::MeshBase::_skip_noncritical_partitioning
bool _skip_noncritical_partitioning
If this is true then no partitioning should be done with the possible exception of orphaned nodes.
Definition: mesh_base.h:1734
libMesh::MeshBase::get_info
std::string get_info() const
Definition: mesh_base.C:551
libMesh::MeshBase::find_neighbors
virtual void find_neighbors(const bool reset_remote_elements=false, const bool reset_current_list=true)=0
Locate element face (edge in 2D) neighbors.
libMesh::FIRST
Definition: enum_order.h:42
libMesh::MeshBase::skip_partitioning
bool skip_partitioning() const
Definition: mesh_base.h:1078
libMesh::remote_elem
const RemoteElem * remote_elem
Definition: remote_elem.C:57
libMesh::MeshBase::reserve_elem
virtual void reserve_elem(const dof_id_type ne)=0
Reserves space for a known number of elements.
libMesh::MeshBase::n_active_elem
virtual dof_id_type n_active_elem() const =0
libMesh::MeshTools::correct_node_proc_ids
void correct_node_proc_ids(MeshBase &)
Changes the processor ids on each node so be the same as the id of the lowest element touching that n...
Definition: mesh_tools.C:2252
libMesh::DistributedMesh::_n_elem
dof_id_type _n_elem
Definition: distributed_mesh.h:570
libMesh::Quality::name
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
libMesh::MeshBase::is_replicated
virtual bool is_replicated() const
Definition: mesh_base.h:181
libMesh::DistributedMesh::node_iterator_imp
mapvector< Node *, dof_id_type >::veclike_iterator node_iterator_imp
Typedefs for the container implementation.
Definition: distributed_mesh.h:607
libMesh::MeshBase::partitioner
virtual std::unique_ptr< Partitioner > & partitioner()
A partitioner to use at each prepare_for_use()
Definition: mesh_base.h:127