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 106 {
return std::make_unique<ReplicatedMesh>(*this); }
116 virtual void clear()
override;
135 {
return cast_int<dof_id_type>(_nodes.size()); }
138 { _nodes.reserve (nn); }
149 {
return cast_int<dof_id_type>(
_elements.size()); }
151 #ifdef LIBMESH_ENABLE_UNIQUE_ID 182 virtual Node *
add_node (std::unique_ptr<Node> n)
override final;
184 #ifdef LIBMESH_ENABLE_DEPRECATED 204 virtual Elem *
add_elem (std::unique_ptr<Elem> e)
override final;
242 std::unordered_map<dof_id_type, std::vector<std::vector<Point>>>
get_boundary_points()
const;
294 #ifdef LIBMESH_ENABLE_AMR 350 #endif // LIBMESH_REPLICATED_MESH_H virtual dof_id_type n_nodes() const override final
The definition of the element_iterator struct.
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 dof_id_type max_node_id() 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...
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
A Node is like a Point, but with more information.
virtual dof_id_type n_elem() const override final
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
virtual const Node * query_node_ptr(const dof_id_type i) const override final
std::vector< Elem * > _elements
The elements in the mesh.
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 ~ReplicatedMesh()
Destructor.
virtual void set_next_unique_id(unique_id_type id) override final
Sets the next available unique id to be used.
std::vector< Elem * >::const_iterator const_elem_iterator_imp
virtual void reserve_elem(const dof_id_type ne) override final
Reserves space for a known number of elements.
std::vector< Node * >::iterator node_iterator_imp
Typedefs for the container implementation.
virtual void reserve_nodes(const dof_id_type nn) override final
Reserves space for a known number of nodes.
virtual Node * insert_node(Node *n) override final
These methods are deprecated.
virtual SimpleRange< element_iterator > active_local_subdomain_elements_ptr_range(subdomain_id_type sid) override final
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 dof_id_type max_elem_id() const override final
This is the base class from which all geometric element types are derived.
virtual dof_id_type parallel_n_elem() const override final
The libMesh namespace provides an interface to certain functionality in the library.
std::unordered_map< dof_id_type, std::vector< std::vector< Point > > > get_boundary_points() const
Return all points on boundary.
virtual void delete_elem(Elem *e) override final
Removes element e from the mesh.
virtual Node * add_node(Node *n) override final
Add Node n to the end of the vertex array.
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 MeshBase & assign(MeshBase &&other_mesh) override
Shim to call the move assignment operator for this class.
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
uint8_t processor_id_type
This is the MeshBase class.
virtual const Elem * query_elem_ptr(const dof_id_type i) const override final
virtual unique_id_type parallel_max_unique_id() const override final
virtual void delete_node(Node *n) override final
Removes the Node n from the mesh.
This class handles the numbering of degrees of freedom on a mesh.
virtual const Elem * elem_ptr(const dof_id_type i) const override final
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...
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
virtual void clear() override
Clear all internal data.
The UnstructuredMesh class is derived from the MeshBase class.
std::vector< Node * >::const_iterator const_node_iterator_imp
virtual void move_nodes_and_elements(MeshBase &&other_mesh) override
Move node and elements from a ReplicatedMesh.
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, and in the global mesh if global == true (default).
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
DECLARE_ELEM_ITERATORS(,,)
Elem and Node iterator accessor functions.
const DofMap &dof_map LIBMESH_COMMA unsigned int var_num
virtual Elem * add_elem(Elem *e) override final
Add elem e to the end of the element array.
virtual void renumber_nodes_and_elements() override
Remove nullptr elements from arrays.
unsigned int level ElemType type std::set< subdomain_id_type > ss
virtual const Point & point(const dof_id_type i) const override final
unsigned int level ElemType type
virtual SimpleRange< const_element_iterator > active_subdomain_elements_ptr_range(subdomain_id_type sid) const override final
virtual dof_id_type n_active_elem() const override final
ReplicatedMesh & operator=(const ReplicatedMesh &)=delete
Copy assignment is not allowed.
virtual void update_parallel_id_counts() override
Updates parallel caches so that methods like n_elem() accurately reflect changes on other processors...
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.
virtual std::unique_ptr< MeshBase > clone() const override
Virtual copy-constructor, creates a copy of this mesh.
virtual const Node * node_ptr(const dof_id_type i) const override final
virtual dof_id_type parallel_n_nodes() const override final
std::vector< Elem * >::iterator elem_iterator_imp
Typedefs for the container implementation.
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.
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 Elem * insert_elem(Elem *e) override final
Insert elem e to the element array, preserving its id and replacing/deleting any existing element wit...
ReplicatedMesh(const Parallel::Communicator &comm_in, unsigned char dim=1)
Constructor.
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 dof_map LIBMESH_COMMA var_num unsigned char rflag
A Point defines a location in LIBMESH_DIM dimensional Real space.
virtual SimpleRange< element_iterator > active_subdomain_set_elements_ptr_range(std::set< subdomain_id_type > ss) override final
virtual SimpleRange< const_element_iterator > active_local_subdomain_elements_ptr_range(subdomain_id_type sid) const override final