20#ifndef LIBMESH_REPLICATED_MESH_H
21#define LIBMESH_REPLICATED_MESH_H
24#include "libmesh/unstructured_mesh.h"
29#include <unordered_map>
105 virtual std::unique_ptr<MeshBase>
clone ()
const override
107 auto returnval = std::make_unique<ReplicatedMesh>(*
this);
122 virtual void clear()
override;
146 {
return cast_int<dof_id_type>(_nodes.size()); }
149 { _nodes.reserve (nn); }
160 {
return cast_int<dof_id_type>(
_elements.size()); }
162#ifdef LIBMESH_ENABLE_UNIQUE_ID
193 virtual Node *
add_node (std::unique_ptr<Node> n)
override final;
197 virtual Elem *
add_elem (std::unique_ptr<Elem> e)
override final;
235 std::unordered_map<dof_id_type, std::vector<std::vector<Point>>>
get_boundary_points()
const;
287#ifdef LIBMESH_ENABLE_AMR
This class handles the numbering of degrees of freedom on a mesh.
static constexpr dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
static constexpr processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
This is the base class from which all geometric element types are derived.
This is the MeshBase class.
void subdomain_ids(std::set< subdomain_id_type > &ids, const bool global=true) const
Constructs a list of all subdomain identifiers in the local mesh if global == false,...
A Node is like a Point, but with more information.
A Point defines a location in LIBMESH_DIM dimensional Real space.
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
DECLARE_ELEM_ITERATORS(,,)
Elem and Node iterator accessor functions.
virtual void clear() override
Clear all internal data.
virtual SimpleRange< const_element_iterator > active_subdomain_elements_ptr_range(subdomain_id_type sid) const override final
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.
std::vector< Elem * > _elements
The elements in the mesh.
virtual Node * add_node(Node *n) override final
Add Node n to the end of the vertex array.
virtual void update_parallel_id_counts() override
Updates parallel caches so that methods like n_elem() accurately reflect changes on other processors.
unsigned int level ElemType type
virtual void move_nodes_and_elements(MeshBase &&other_mesh) override
Move node and elements from a ReplicatedMesh.
ReplicatedMesh(ReplicatedMesh &&)=delete
Move-constructor deleted in MeshBase.
std::vector< Node * >::iterator node_iterator_imp
Typedefs for the container implementation.
virtual SimpleRange< element_iterator > active_local_subdomain_elements_ptr_range(subdomain_id_type sid) override final
std::vector< Node * >::const_iterator const_node_iterator_imp
virtual void delete_node(Node *n) override final
Removes the Node n from the mesh.
DECLARE_ELEM_ITERATORS(semilocal_,,) DECLARE_ELEM_ITERATORS(ghost_
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 dof_id_type max_node_id() const override final
virtual dof_id_type max_elem_id() const override final
virtual const Node * 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.
DECLARE_ELEM_ITERATORS(ancestor_,,) DECLARE_ELEM_ITERATORS(subactive_
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...
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_
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 dof_id_typ _n_nodes)
The vertices (spatial coordinates) of the mesh.
virtual dof_id_type n_active_elem() const override final
virtual void reserve_nodes(const dof_id_type nn) override final
Reserves space for a known number of nodes.
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 SimpleRange< const_element_iterator > active_local_subdomain_elements_ptr_range(subdomain_id_type sid) const override final
virtual SimpleRange< element_iterator > active_subdomain_set_elements_ptr_range(std::set< subdomain_id_type > ss) override final
virtual void reserve_elem(const dof_id_type ne) override final
Reserves space for a known number of elements.
virtual dof_id_type n_elem() const override final
virtual void delete_elem(Elem *e) override final
Removes element e from the mesh.
virtual const Elem * query_elem_ptr(const dof_id_type i) const override final
processor_id_type pid unsigned int level std::set< subdomain_id_type > virtual ss SimpleRange< element_iterator > active_subdomain_elements_ptr_range(subdomain_id_type sid) override final
std::unordered_map< dof_id_type, std::vector< std::vector< Point > > > get_boundary_points() const
Return all points on boundary.
virtual const Elem * elem_ptr(const dof_id_type i) const override final
virtual Elem * add_elem(Elem *e) override final
Add elem e to the end of the element array.
ReplicatedMesh & operator=(const ReplicatedMesh &)=delete
Copy assignment is not allowed.
virtual SimpleRange< const_element_iterator > active_subdomain_set_elements_ptr_range(std::set< subdomain_id_type > ss) const override final
const DofMap &dof_map LIBMESH_COMMA unsigned int var_num
virtual dof_id_type n_nodes() const override final
std::vector< Elem * >::const_iterator const_elem_iterator_imp
unsigned int level ElemType type std::set< subdomain_id_type > ss
std::vector< dof_id_type > get_disconnected_subdomains(std::vector< subdomain_id_type > *subdomain_ids=nullptr) const
Return IDs of representative elements of all disconnected subdomains.
virtual MeshBase & assign(MeshBase &&other_mesh) override
Shim to call the move assignment operator for this class.
DECLARE_ELEM_ITERATORS(active_,,)
virtual void clear_elems() override
Clear internal Elem data.
virtual void fix_broken_node_and_element_numbering() override
There is no reason for a user to ever call this function.
const DofMap &dof_map LIBMESH_COMMA unsigned int dof_map LIBMESH_COMMA var_num unsigned char rflag
std::vector< Elem * >::iterator elem_iterator_imp
Typedefs for the container implementation.
virtual const Point & point(const dof_id_type i) const override final
virtual void set_next_unique_id(unique_id_type id) override final
Sets the next available unique id to be used.
virtual unique_id_type parallel_max_unique_id() const override final
virtual std::unique_ptr< MeshBase > clone() const override
Virtual copy-constructor, creates a copy of this mesh.
virtual const Node * query_node_ptr(const dof_id_type i) const override final
virtual void renumber_nodes_and_elements() override
After partitioning a mesh it is useful to renumber the nodes and elements so that they lie in contigu...
virtual ~ReplicatedMesh()
Destructor.
virtual dof_id_type parallel_n_nodes() const override final
virtual dof_id_type parallel_n_elem() const override final
The SimpleRange templated class is intended to make it easy to construct ranges from pairs of iterato...
The UnstructuredMesh class is derived from the MeshBase class.
The libMesh namespace provides an interface to certain functionality in the library.
ElemType
Defines an enum for geometric element types.
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
uint8_t processor_id_type
The definition of the element_iterator struct.