20 #ifndef LIBMESH_DISTRIBUTED_MESH_H 21 #define LIBMESH_DISTRIBUTED_MESH_H 24 #include "libmesh_config.h" 26 #if LIBMESH_MAPVECTOR_CHUNK_SIZE == 1 27 # include "libmesh/mapvector.h" 29 # include "libmesh/chunked_mapvector.h" 32 #include "libmesh/unstructured_mesh.h" 61 template <
typename Obj>
62 #if LIBMESH_MAPVECTOR_CHUNK_SIZE == 1 119 virtual std::unique_ptr<MeshBase>
clone ()
const override 120 {
return std::make_unique<DistributedMesh>(*this); }
130 virtual void clear()
override;
184 template <
typename T>
212 template <
typename T>
281 #ifdef LIBMESH_ENABLE_UNIQUE_ID 307 virtual Node *
add_node (std::unique_ptr<Node> n)
override final;
309 #ifdef LIBMESH_ENABLE_DEPRECATED 329 virtual Elem *
add_elem (std::unique_ptr<Elem> e)
override final;
393 #ifdef LIBMESH_ENABLE_AMR 460 #ifdef LIBMESH_ENABLE_UNIQUE_ID 491 #endif // LIBMESH_DISTRIBUTED_MESH_H The definition of the element_iterator struct.
This mapvector templated class is intended to provide the performance characteristics of a std::map w...
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) override final
functions for adding /deleting nodes elements.
ElemType
Defines an enum for geometric element types.
The SimpleRange templated class is intended to make it easy to construct ranges from pairs of iterato...
virtual void update_parallel_id_counts() override
Updates parallel caches so that methods like n_elem() accurately reflect changes on other processors...
virtual dof_id_type parallel_n_nodes() const override
virtual Elem * add_elem(Elem *e) override final
Add elem e to the end of the element array.
A Node is like a Point, but with more information.
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
virtual void libmesh_assert_valid_parallel_ids() const override
Verify id and processor_id consistency of our elements and nodes containers.
virtual void fix_broken_node_and_element_numbering() override
There is no reason for a user to ever call this function.
dofobject_container< Elem >::const_veclike_iterator const_elem_iterator_imp
virtual void set_distributed() override final
Asserts that not all elements and nodes of the mesh necessarily exist on the current processor...
virtual void renumber_elem(dof_id_type old_id, dof_id_type new_id) override final
Changes the id of element old_id, both by changing elem(old_id)->id() and by moving elem(old_id) in t...
bool _is_serial_on_proc_0
A boolean remembering whether we're serialized to proc 0 or not.
dof_id_type _n_nodes
Cached data from the last renumber_nodes_and_elements call.
virtual void clear() override
Clear all internal data.
virtual void renumber_nodes_and_elements() override
Remove nullptr elements from arrays.
virtual SimpleRange< const_element_iterator > active_subdomain_elements_ptr_range(subdomain_id_type sid) const override final
virtual dof_id_type n_nodes() const override final
dof_id_type _next_free_local_node_id
Guaranteed globally unused IDs for use when adding new nodes or elements.
virtual void allgather() override
Gathers all elements and nodes of the mesh onto every processor.
virtual SimpleRange< element_iterator > active_local_subdomain_elements_ptr_range(subdomain_id_type sid) override final
This is the base class from which all geometric element types are derived.
bool _is_serial
A boolean remembering whether we're serialized or not.
void libmesh_assert_valid_parallel_flags() const
Verify refinement_flag and p_refinement_flag consistency of our elements containers.
The libMesh namespace provides an interface to certain functionality in the library.
virtual void delete_elem(Elem *e) override final
Removes element e from the mesh.
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 desce...
virtual Node * add_node(Node *n) override final
Add Node n to the end of the vertex array.
virtual const Point & point(const dof_id_type i) const override final
virtual unique_id_type parallel_max_unique_id() const override
dofobject_container< Node >::veclike_iterator node_iterator_imp
Typedefs for the container implementation.
virtual void delete_remote_elements() override
Deletes all nonlocal elements of the mesh except for "ghosts" which touch a local element...
void libmesh_assert_valid_parallel_object_ids(const dofobject_container< T > &) const
Verify id, processor_id, and if applicable unique_id consistency of a parallel objects container...
uint8_t processor_id_type
This is the MeshBase class.
void libmesh_assert_valid_parallel_p_levels() const
Verify p_level consistency of our elements containers.
This class handles the numbering of degrees of freedom on a mesh.
processor_id_type pid unsigned int level std::set< subdomain_id_type > ss const DofMap &dof_map LIBMESH_COMMA unsigned int dof_map LIBMESH_COMMA var_num unsigned char rflag processor_id_type pid const DofMap &dof_map LIBMESH_COMMA unsigned int dof_map LIBMESH_COMMA var_num DECLARE_NODE_ITERATORS(multi_evaluable_, std::vector< const DofMap * > dof_maps, dof_maps) protected dofobject_container< Node > _nodes
Move node and elements from a DistributedMesh.
virtual const Elem * elem_ptr(const dof_id_type i) const override final
virtual dof_id_type parallel_n_elem() const override
virtual void move_nodes_and_elements(MeshBase &&other_mesh)=0
Move node and elements from other_mesh to this mesh.
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
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...
The UnstructuredMesh class is derived from the MeshBase class.
processor_id_type pid unsigned int level std::set< subdomain_id_type > ss const DofMap &dof_map LIBMESH_COMMA unsigned int var_num
DECLARE_ELEM_ITERATORS(,,)
Elem and Node iterator accessor functions.
virtual bool is_serial_on_zero() const override final
virtual void set_next_unique_id(unique_id_type id) override
Sets the next available unique id to be used.
virtual void clear_elems() override
Clear internal Elem data.
virtual SimpleRange< const_element_iterator > active_local_subdomain_elements_ptr_range(subdomain_id_type sid) const override final
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
virtual void own_node(Node &n) override final
Takes ownership of node n on this partition of a distributed mesh, by setting n.processor_id() to thi...
processor_id_type pid unsigned int level std::set< subdomain_id_type > ss const DofMap &dof_map LIBMESH_COMMA unsigned int dof_map LIBMESH_COMMA var_num unsigned char rflag DECLARE_NODE_ITERATORS(active_,,) DECLARE_NODE_ITERATORS(local_
virtual void clear_extra_ghost_elems()
Clears extra ghost elements.
const std::set< Elem * > & extra_ghost_elems() const
Const accessor to the ghosted elements.
unsigned int level ElemType type std::set< subdomain_id_type > ss
virtual const Node * query_node_ptr(const dof_id_type i) const override final
virtual bool subclass_locally_equals(const MeshBase &other_mesh) const override
Shim to allow operator == (&) to behave like a virtual function without having to be one...
dof_id_type parallel_max_node_id() const
The DistributedMesh class is derived from the MeshBase class, and is intended to provide identical fu...
unsigned int level ElemType type
dof_id_type _next_free_unpartitioned_node_id
dofobject_container< Elem > _elements
The elements in the mesh.
virtual void delete_node(Node *n) override final
Removes the Node n from the mesh.
dofobject_container< Node >::const_veclike_iterator const_node_iterator_imp
virtual SimpleRange< const_element_iterator > active_subdomain_set_elements_ptr_range(std::set< subdomain_id_type > ss) const override final
virtual void renumber_node(dof_id_type old_id, dof_id_type new_id) override final
Changes the id of node old_id, both by changing node(old_id)->id() and by moving node(old_id) in the ...
virtual void redistribute() override
Redistribute elements between processors.
virtual std::unique_ptr< MeshBase > clone() const override
Virtual copy-constructor, creates a copy of this mesh.
DistributedMesh & operator=(const DistributedMesh &)=delete
Copy assignment is not allowed.
virtual dof_id_type n_active_elem() const override final
dof_id_type _next_free_unpartitioned_elem_id
DistributedMesh(const Parallel::Communicator &comm_in, unsigned char dim=1)
Constructor.
virtual bool is_replicated() const override final
virtual void gather_to_zero() override
Gathers all elements and nodes of the mesh onto processor zero.
virtual Elem * insert_elem(Elem *e) override final
Insert elem e to the element array, preserving its id and replacing/deleting any existing element wit...
virtual dof_id_type max_node_id() const override final
This chunked_mapvector templated class is intended to provide the asymptotic performance characterist...
unsigned int level ElemType type std::set< subdomain_id_type > virtual ss SimpleRange< element_iterator > active_subdomain_elements_ptr_range(subdomain_id_type sid) override final
virtual SimpleRange< element_iterator > active_subdomain_set_elements_ptr_range(std::set< subdomain_id_type > ss) override final
virtual void update_post_partitioning() override
Recalculate cached data after elements and nodes have been repartitioned.
unique_id_type _next_unpartitioned_unique_id
The next available unique id for assigning ids to unpartitioned DOF objects.
dofobject_container< Elem >::veclike_iterator elem_iterator_imp
Typedefs for the container implementation.
virtual MeshBase & assign(MeshBase &&other_mesh) override
Shim to call the move assignment operator for this class.
virtual dof_id_type n_elem() const override final
virtual ~DistributedMesh()
Destructor.
virtual Node * insert_node(Node *n) override final
These methods are deprecated.
virtual bool is_serial() const override final
virtual dof_id_type max_elem_id() const override final
dof_id_type _next_free_local_elem_id
processor_id_type pid unsigned int level std::set< subdomain_id_type > ss const DofMap &dof_map LIBMESH_COMMA unsigned int dof_map LIBMESH_COMMA var_num unsigned char rflag
bool _deleted_coarse_elements
A boolean remembering whether we've recently deleted top-level elements or not.
virtual void reserve_elem(const dof_id_type) override final
Reserves space for a known number of elements.
A Point defines a location in LIBMESH_DIM dimensional Real space.
dof_id_type renumber_dof_objects(dofobject_container< T > &)
Renumber a parallel objects container.
dof_id_type parallel_max_elem_id() const
virtual const Node * node_ptr(const dof_id_type i) const override final
virtual void reserve_nodes(const dof_id_type) override final
Reserves space for a known number of nodes.
virtual const Elem * query_elem_ptr(const dof_id_type i) const override final