20 #ifndef LIBMESH_MESH_BASE_H 21 #define LIBMESH_MESH_BASE_H 24 #include "libmesh/dof_object.h" 25 #include "libmesh/enum_order.h" 26 #include "libmesh/int_range.h" 27 #include "libmesh/libmesh_common.h" 28 #include "libmesh/multi_predicates.h" 29 #include "libmesh/point_locator_base.h" 30 #include "libmesh/variant_filter_iterator.h" 31 #include "libmesh/parallel_object.h" 32 #include "libmesh/simple_range.h" 39 #include "libmesh/vector_value.h" 46 class GhostingFunctor;
50 class PeriodicBoundary;
51 class PeriodicBoundaries;
62 template <
typename iterator_type,
typename object_type>
140 return !(*
this == other_mesh);
155 virtual std::unique_ptr<MeshBase>
clone()
const = 0;
184 virtual void clear ();
216 #ifdef LIBMESH_ENABLE_DEPRECATED 230 #endif // LIBMESH_ENABLE_DEPRECATED 596 #ifdef LIBMESH_ENABLE_UNIQUE_ID 652 #ifdef LIBMESH_ENABLE_UNIQUE_ID 980 virtual void find_neighbors (
const bool reset_remote_elements =
false,
981 const bool reset_current_list =
true,
982 const bool assert_valid =
true) = 0;
1006 #ifdef LIBMESH_ENABLE_AMR 1033 bool allocate_data =
true,
1050 std::vector<unsigned int>
add_elem_integers(
const std::vector<std::string> & names,
1051 bool allocate_data =
true,
1052 const std::vector<dof_id_type> * default_values =
nullptr);
1107 template <
typename T>
1109 bool allocate_data =
true,
1110 const T * default_value =
nullptr);
1132 template <
typename T>
1133 std::vector<unsigned int>
add_elem_data(
const std::vector<std::string> & names,
1134 bool allocate_data =
true,
1135 const std::vector<T> * default_values =
nullptr);
1155 bool allocate_data =
true,
1172 std::vector<unsigned int>
add_node_integers(
const std::vector<std::string> & names,
1173 bool allocate_data =
true,
1174 const std::vector<dof_id_type> * default_values =
nullptr);
1229 template <
typename T>
1231 bool allocate_data =
true,
1232 const T * default_value =
nullptr);
1254 template <
typename T>
1256 bool allocate_data =
true,
1257 const std::vector<T> * default_values =
nullptr);
1290 #ifdef LIBMESH_ENABLE_DEPRECATED 1291 void prepare_for_use (
const bool skip_renumber_nodes_and_elements,
const bool skip_find_neighbors);
1293 #endif // LIBMESH_ENABLE_DEPRECATED 1308 virtual void partition (
const unsigned int n_parts);
1488 void subdomain_ids (std::set<subdomain_id_type> & ids,
const bool global =
true)
const;
1535 std::string
get_info (
const unsigned int verbosity = 0,
const bool global =
true)
const;
1543 void print_info (std::ostream & os=
libMesh::out,
const unsigned int verbosity = 0,
const bool global =
true)
const;
1556 virtual void read (
const std::string &
name,
1557 void * mesh_data=
nullptr,
1558 bool skip_renumber_nodes_and_elements=
false,
1559 bool skip_find_neighbors=
false,
1560 bool skip_detect_interior_parents=
false) = 0;
1561 virtual void write (
const std::string &
name)
const = 0;
1609 const bool full_ordered =
true) = 0;
1708 #define ABSTRACT_ELEM_ITERATORS(TYPE, ARGDECL) \ 1709 virtual element_iterator TYPE##elements_begin(ARGDECL) = 0; \ 1710 virtual element_iterator TYPE##elements_end(ARGDECL) = 0; \ 1711 virtual const_element_iterator TYPE##elements_begin(ARGDECL) const = 0; \ 1712 virtual const_element_iterator TYPE##elements_end(ARGDECL) const = 0; \ 1713 virtual SimpleRange<element_iterator> TYPE##element_ptr_range(ARGDECL) = 0; \ 1714 virtual SimpleRange<const_element_iterator> TYPE##element_ptr_range(ARGDECL) const = 0; 1716 #define DECLARE_ELEM_ITERATORS(TYPE, ARGDECL, ARGS) \ 1717 virtual element_iterator TYPE##elements_begin(ARGDECL) override final; \ 1718 virtual element_iterator TYPE##elements_end(ARGDECL) override final; \ 1719 virtual const_element_iterator TYPE##elements_begin(ARGDECL) const override final; \ 1720 virtual const_element_iterator TYPE##elements_end(ARGDECL) const override final; \ 1721 virtual SimpleRange<element_iterator> TYPE##element_ptr_range(ARGDECL) override final { return {TYPE##elements_begin(ARGS), TYPE##elements_end(ARGS)}; } \ 1722 virtual SimpleRange<const_element_iterator> TYPE##element_ptr_range(ARGDECL) const override final { return {TYPE##elements_begin(ARGS), TYPE##elements_end(ARGS)}; } 1724 #define ABSTRACT_NODE_ITERATORS(TYPE, ARGDECL) \ 1725 virtual node_iterator TYPE##nodes_begin(ARGDECL) = 0; \ 1726 virtual node_iterator TYPE##nodes_end(ARGDECL) = 0; \ 1727 virtual const_node_iterator TYPE##nodes_begin(ARGDECL) const = 0; \ 1728 virtual const_node_iterator TYPE##nodes_end(ARGDECL) const = 0; \ 1729 virtual SimpleRange<node_iterator> TYPE##node_ptr_range(ARGDECL) = 0; \ 1730 virtual SimpleRange<const_node_iterator> TYPE##node_ptr_range(ARGDECL) const = 0; 1732 #define DECLARE_NODE_ITERATORS(TYPE, ARGDECL, ARGS) \ 1733 virtual node_iterator TYPE##nodes_begin(ARGDECL) override final; \ 1734 virtual node_iterator TYPE##nodes_end(ARGDECL) override final; \ 1735 virtual const_node_iterator TYPE##nodes_begin(ARGDECL) const override final; \ 1736 virtual const_node_iterator TYPE##nodes_end(ARGDECL) const override final; \ 1737 virtual SimpleRange<node_iterator> TYPE##node_ptr_range(ARGDECL) override final { return {TYPE##nodes_begin(ARGS), TYPE##nodes_end(ARGS)}; } \ 1738 virtual SimpleRange<const_node_iterator> TYPE##node_ptr_range(ARGDECL) const override final { return {TYPE##nodes_begin(ARGS), TYPE##nodes_end(ARGS)}; } 1740 #define LIBMESH_COMMA , 1821 #ifdef LIBMESH_ENABLE_AMR 1847 ABSTRACT_NODE_ITERATORS(,)
1848 ABSTRACT_NODE_ITERATORS(active_,)
1849 ABSTRACT_NODE_ITERATORS(local_,)
1850 ABSTRACT_NODE_ITERATORS(bnd_,)
1859 ABSTRACT_NODE_ITERATORS(multi_evaluable_,
std::vector<const
DofMap *> dof_maps)
1945 template <
typename T>
1947 bool precondition_constraint_operator =
false);
1956 bool print_nonlocal=
false)
const;
1965 #ifdef LIBMESH_ENABLE_DEPRECATED 1974 #endif // LIBMESH_ENABLE_DEPRECATED 2028 #ifdef LIBMESH_ENABLE_PERIODIC 2057 explicit operator bool()
const;
2084 #ifdef LIBMESH_ENABLE_PERIODIC 2182 mutable std::unique_ptr<ConstElemRange>
2208 #ifdef LIBMESH_ENABLE_UNIQUE_ID 2374 std::pair<std::vector<unsigned int>, std::vector<unsigned int>>
2446 #ifdef LIBMESH_ENABLE_DEPRECATED 2466 const Elem *
const &,
2471 const Elem *
const &,
2479 const Node *
const &,
2484 const Node *
const &,
2486 #endif // LIBMESH_ENABLE_DEPRECATED 2507 template <
typename PredType,
typename IterType>
2510 const PredType & p ) :
2527 template <
typename PredType,
typename IterType>
2530 const PredType & p ) :
2558 template <
typename PredType,
typename IterType>
2561 const PredType & p ) :
2578 template <
typename PredType,
typename IterType>
2581 const PredType & p ) :
2595 template <
typename T>
2599 const T * default_value)
2603 unsigned int n_more_integers = (
sizeof(T)-1)/
sizeof(
dof_id_type);
2606 std::memcpy(int_data.data(), default_value,
sizeof(T));
2609 for (
unsigned int i=0; i != n_more_integers; ++i)
2619 template <
typename T>
2623 const std::vector<T> * default_values)
2625 libmesh_assert(!default_values || default_values->size() == names.size());
2627 std::vector<unsigned int> returnval(names.size());
2633 this->add_elem_datum<T>(names[i],
false,
2635 (*default_values)[i] :
nullptr);
2644 template <
typename T>
2648 const T * default_value)
2652 unsigned int n_more_integers = (
sizeof(T)-1)/
sizeof(
dof_id_type);
2655 std::memcpy(int_data.data(), default_value,
sizeof(T));
2658 for (
unsigned int i=0; i != n_more_integers; ++i)
2668 template <
typename T>
2672 const std::vector<T> * default_values)
2674 libmesh_assert(!default_values || default_values->size() == names.size());
2676 std::vector<unsigned int> returnval(names.size());
2682 this->add_node_datum<T>(names[i],
false,
2684 (*default_values)[i] :
nullptr);
2696 #endif // LIBMESH_MESH_BASE_H std::string name(const ElemQuality q)
This function returns a string containing some name for q.
GhostingFunctorIterator ghosting_functors_begin() const
Beginning of range of ghosting functors.
The definition of the element_iterator struct.
bool operator==(const MeshBase &other_mesh) const
This tests for exactly-equal data in all the senses that a mathematician would care about (element co...
variant_filter_iterator< MeshBase::Predicate, Elem * > elem_filter_iter
The original iterator classes weren't properly const-safe; relying on their const-incorrectness is no...
std::set< subdomain_id_type > _mesh_subdomains
We cache the subdomain ids of the elements present in the mesh.
bool has_node_integer(std::string_view name) const
virtual void update_post_partitioning()
Recalculate any cached data (or invalidate any caches that are computed on the fly) after elements an...
std::vector< unsigned int > add_elem_integers(const std::vector< std::string > &names, bool allocate_data=true, const std::vector< dof_id_type > *default_values=nullptr)
Register integer data (of type dof_id_type) to be added to each element in the mesh, one string name for each new integer.
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...
bool operator!=(const MeshBase &other_mesh) const
const std::set< Order > & elem_default_orders() const
std::unique_ptr< ElemRange > _element_stored_range
A cached ElemRange for threaded mutation of all semilocal elements of this mesh.
virtual void reserve_nodes(const dof_id_type nn)=0
Reserves space for a known number of nodes.
ABSTRACT_ELEM_ITERATORS(,) ABSTRACT_ELEM_ITERATORS(active_
virtual bool subclass_locally_equals(const MeshBase &other_mesh) const =0
Shim to allow operator == (&) to behave like a virtual function without having to be one...
bool _allow_node_and_elem_unique_id_overlap
The Exodus reader (and potentially other readers in the future?) now supports setting Node and Elem u...
bool _skip_renumber_nodes_and_elements
If this is true then renumbering will be kept to a minimum.
Order
defines an enum for polynomial orders.
static constexpr processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
constraint_rows_type & get_constraint_rows()
Constraint rows accessors.
bool has_removed_remote_elements
virtual dof_id_type n_active_elem() const =0
A Node is like a Point, but with more information.
This abstract base class defines the interface by which library code and user code can report associa...
const MeshBase & interior_mesh() const
virtual void renumber_node(dof_id_type old_id, dof_id_type new_id)=0
Changes the id of node old_id, both by changing node(old_id)->id() and by moving node(old_id) in the ...
Real get_point_locator_close_to_point_tol() const
dof_id_type n_elem_on_proc(const processor_id_type proc) const
virtual unique_id_type parallel_max_unique_id() const =0
dof_id_type n_unpartitioned_nodes() const
void set_interior_mesh(MeshBase &int_mesh)
Sets the interior mesh.
variant_filter_iterator< MeshBase::Predicate, Node * > node_filter_iter
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
std::vector< std::string > _elem_integer_names
The array of names for integer data associated with each element in the mesh.
std::unique_ptr< PointLocatorBase > sub_point_locator() const
unsigned int n_node_integers() const
void remove_orphaned_nodes()
Removes any orphaned nodes, nodes not connected to any elements.
Original Authors: Corwin Joy * Michael Gradman cjoy@houston.rr.com * Michael.Gradman@caminus.com Caminus, Suite 1150, Two Allen Center, 1200 Smith Street, Houston, TX 77002 This class is an extension of variant_bidirectional_iterator to a filter_iterator similar to boost's.
virtual void read(const std::string &name, void *mesh_data=nullptr, bool skip_renumber_nodes_and_elements=false, bool skip_find_neighbors=false, bool skip_detect_interior_parents=false)=0
Interfaces for reading/writing a mesh to/from a file.
std::vector< dof_id_type > get_elemset_codes() const
Return a vector of all elemset codes defined on the mesh.
BoundaryInfo & get_boundary_info()
Writable information about boundary ids on the mesh.
virtual void all_second_order_range(const SimpleRange< element_iterator > &range, const bool full_ordered=true)=0
Converts a set of this Mesh's elements defined by range from FIRST order to SECOND order...
void allow_renumbering(bool allow)
If false is passed in then this mesh will no longer be renumbered when being prepared for use...
void add_ghosting_functor(std::shared_ptr< GhostingFunctor > ghosting_functor)
Adds a functor which can specify ghosting requirements for use on distributed meshes.
void detect_interior_parents()
Search the mesh for elements that have a neighboring element of dim+1 and set that element as the int...
Preparation()
Constructor.
void skip_partitioning(bool skip)
If true is passed in then nothing on this mesh will be (re)partitioned.
dof_id_type n_active_elem_on_proc(const processor_id_type proc) const
The definition of the const_element_iterator struct.
MeshBase * _interior_mesh
Defaulting to this, a pointer to the mesh used to generate boundary elements on this.
std::vector< std::pair< std::pair< const Elem *, unsigned int >, Real > > constraint_rows_mapped_type
We're using a class instead of a typedef to allow forward declarations and future flexibility...
subdomain_id_type n_local_subdomains() const
variant_filter_iterator< MeshBase::Predicate, const Elem *const, const Elem *const &, const Elem *const * > const_elem_filter_iter
void copy_cached_data(const MeshBase &other_mesh)
Helper class to copy cached data, to synchronize with a possibly unprepared other_mesh.
bool allow_detect_interior_parents() const
Predicates::multi_predicate Predicate
We need an empty, generic class to act as a predicate for this and derived mesh classes.
virtual void allgather()
Gathers all elements and nodes of the mesh onto every processor.
void set_spatial_dimension(unsigned char d)
Sets the "spatial dimension" of the Mesh.
void set_isnt_prepared()
Tells this we have done some operation where we should no longer consider ourself prepared...
std::map< dof_id_type, const MeshBase::elemset_type * > _elemset_codes
Map from "element set code" to list of set ids to which that element belongs (and vice-versa)...
bool operator==(const Preparation &other) const
Two Preparation objects are equivalent iff all the flags match, regardless of the true/false status o...
Preparation & operator=(bool set_all)
Set all flags to the "set_all" value.
virtual void find_neighbors(const bool reset_remote_elements=false, const bool reset_current_list=true, const bool assert_valid=true)=0
Locate element face (edge in 2D) neighbors.
std::vector< GhostingFunctor * > _ghosting_functors
The list of all GhostingFunctor objects to be used when distributing a DistributedMesh.
bool skip_noncritical_partitioning() const
unsigned int add_elem_integer(std::string name, bool allocate_data=true, dof_id_type default_value=DofObject::invalid_id)
Register an integer datum (of type dof_id_type) to be added to each element in the mesh...
void add_elemset_code(dof_id_type code, MeshBase::elemset_type id_set)
Tabulate a user-defined "code" for elements which belong to the element sets specified in id_set...
bool has_elem_integer(std::string_view name) const
bool get_count_lower_dim_elems_in_point_locator() const
Get the current value of _count_lower_dim_elems_in_point_locator.
void remove_ghosting_functor(GhostingFunctor &ghosting_functor)
Removes a functor which was previously added to the set of ghosting functors.
unsigned int n_elem_integers() const
This is the base class from which all geometric element types are derived.
dof_id_type n_local_nodes() const
virtual std::unique_ptr< Partitioner > & partitioner()
A partitioner to use at each partitioning.
constraint_rows_type _constraint_rows
virtual void gather_to_zero()
Gathers all elements and nodes of the mesh onto processor zero.
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.
void copy_constraint_rows(const MeshBase &other_mesh)
Copy the constraints from the other mesh to this mesh.
std::vector< unsigned int > add_node_integers(const std::vector< std::string > &names, bool allocate_data=true, const std::vector< dof_id_type > *default_values=nullptr)
Register integer data (of type dof_id_type) to be added to each node in the mesh. ...
virtual Elem & elem_ref(const dof_id_type i)
const_element_iterator(const IterType &d, const IterType &e, const PredType &p)
Templated forwarding ctor – forwards to appropriate variant_filter_iterator ctor.
bool _skip_noncritical_partitioning
If this is true then no partitioning should be done with the possible exception of orphaned nodes...
std::vector< unsigned int > add_node_data(const std::vector< std::string > &name, bool allocate_data=true, const std::vector< T > *default_values=nullptr)
Register data (of type T) to be added to each node in the mesh.
virtual void fix_broken_node_and_element_numbering()=0
There is no reason for a user to ever call this function.
unsigned char _spatial_dimension
The "spatial dimension" of the Mesh.
virtual void own_node(Node &)
Takes ownership of node n on this partition of a distributed mesh, by setting n.processor_id() to thi...
std::unique_ptr< BoundaryInfo > boundary_info
This class holds the boundary information.
The StoredRange class defines a contiguous, divisible set of objects.
GhostingFunctorIterator ghosting_functors_end() const
End of range of ghosting functors.
virtual void set_next_unique_id(unique_id_type id)=0
Sets the next available unique id to be used.
unique_id_type next_unique_id() const
bool _allow_remote_element_removal
If this is false then even on DistributedMesh remote elements will not be deleted during mesh prepara...
The libMesh namespace provides an interface to certain functionality in the library.
std::map< MeshBase::elemset_type, dof_id_type > _elemset_codes_inverse_map
virtual void all_first_order()=0
Converts a mesh with higher-order elements into a mesh with linear elements.
dof_id_type get_elemset_code(const MeshBase::elemset_type &id_set) const
void allow_detect_interior_parents(bool allow)
If false is passed then this mesh will no longer work to detect interior parents when being prepared ...
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
dof_id_type n_unpartitioned_elem() const
std::vector< std::string > _node_integer_names
The array of names for integer data associated with each node in the mesh.
bool has_cached_elem_data
virtual std::unique_ptr< MeshBase > clone() const =0
Virtual "copy constructor".
Preparation preparation() const
virtual Node & node_ref(const dof_id_type i)
void clear_stored_ranges()
Clears stored ranges, to indicate that the mesh has changed and they should be regenerated when next ...
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.
dof_id_type n_local_elem() const
MeshBase::elemset_type _all_elemset_ids
dof_id_type n_constraint_rows() const
const std::string & get_elem_integer_name(unsigned int i) const
void unset_has_cached_elem_data()
Tells this we have done some operation (e.g.
bool nodes_and_elements_equal(const MeshBase &other_mesh) const
Tests for equality of all elements and nodes in the mesh.
virtual MeshBase & assign(MeshBase &&other_mesh)=0
Shim to allow operator = (&&) to behave like a virtual function without having to be one...
uint8_t processor_id_type
This is the MeshBase class.
void unset_has_interior_parent_ptrs()
Tells this we have done some operation (e.g.
The Partitioner class provides a uniform interface for partitioning algorithms.
ElemMappingType default_mapping_type() const
Returns the default master space to physical space mapping basis functions to be used on newly added ...
subdomain_id_type get_id_by_name(std::string_view name) const
void get_elemsets(dof_id_type elemset_code, MeshBase::elemset_type &id_set_to_fill) const
Look up the element sets for a given elemset code and vice-versa.
virtual bool is_serial_on_zero() const
void change_elemset_code(dof_id_type old_code, dof_id_type new_code)
Replace elemset code "old_code" with "new_code".
virtual void all_complete_order_range(const SimpleRange< element_iterator > &range)=0
Converts a set of elements in this (conforming, non-refined) mesh into "complete" order elements...
virtual void set_distributed()
Asserts that not all elements and nodes of the mesh necessarily exist on the current processor...
node_iterator(const IterType &d, const IterType &e, const PredType &p)
Templated forwarding ctor – forwards to appropriate variant_filter_iterator ctor.
This class handles the numbering of degrees of freedom on a mesh.
Order supported_nodal_order() const
unique_id_type _next_unique_id
The next available unique id for assigning ids to DOF objects.
unsigned int _n_parts
The number of partitions the mesh has.
dof_id_type n_active_local_elem() const
unsigned int get_elem_integer_index(std::string_view name) 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 ...
processor_id_type n_processors() const
virtual bool is_serial() const
void add_disjoint_neighbor_boundary_pairs(const boundary_id_type b1, const boundary_id_type b2, const RealVectorValue &translation)
Register a pair of boundaries as disjoint neighbor boundary pairs.
unsigned char _default_mapping_data
The default mapping data (unused with Lagrange, used for nodal weight lookup index with rational base...
virtual void delete_elem(Elem *e)=0
Removes element e from the mesh.
void unset_has_neighbor_ptrs()
Tells this we have done some operation (e.g.
This is the MeshCommunication class.
const std::map< subdomain_id_type, std::string > & get_subdomain_name_map() const
static constexpr dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
bool has_removed_orphaned_nodes
const ElemRange & element_stored_range()
dof_id_type n_sub_elem() const
unsigned char default_mapping_data() const
Returns any default data value used by the master space to physical space mapping.
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
ElemMappingType _default_mapping_type
The default mapping type (typically Lagrange) between master and physical space to assign to newly ad...
virtual void update_parallel_id_counts()=0
Updates parallel caches so that methods like n_elem() accurately reflect changes on other processors...
PeriodicBoundaries * get_disjoint_neighbor_boundary_pairs()
void print_info(std::ostream &os=libMesh::out, const unsigned int verbosity=0, const bool global=true) const
Prints relevant information about the mesh.
std::unique_ptr< Partitioner > _partitioner
A partitioner to use at each prepare_for_use().
virtual const Node * query_node_ptr(const dof_id_type i) const =0
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 elem...
virtual dof_id_type max_elem_id() const =0
void clear_point_locator()
Releases the current PointLocator object.
variant_filter_iterator< MeshBase::Predicate, Elem *const, Elem *const &, Elem *const * > const_elem_filter_iter
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).
std::set< Order > _elem_default_orders
We cache the (default) order of the geometric elements present in the mesh.
bool allow_find_neighbors() const
The BoundaryInfo class contains information relevant to boundary conditions including storing faces...
bool _skip_find_neighbors
If this is true then we will skip find_neighbors in prepare_for_use.
virtual void delete_node(Node *n)=0
Removes the Node n from the mesh.
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.
const ConstElemRange & active_local_element_stored_range() const
unsigned int n_elemsets() const
Returns the number of unique elemset ids which have been added via add_elemset_code(), which is the size of the _all_elemset_ids set.
Order _supported_nodal_order
We cache the maximum nodal order supported by all the mesh's elements (the minimum supported_nodal_or...
std::set< unsigned char > _elem_dims
We cache the dimension of the elements present in the mesh.
void allow_node_and_elem_unique_id_overlap(bool allow)
If true is passed, then this mesh will no longer require unique_ids to be unique across the set of al...
unsigned int add_elem_datum(const std::string &name, bool allocate_data=true, const T *default_value=nullptr)
Register a datum (of type T) to be added to each element in the mesh.
unsigned int get_node_integer_index(std::string_view name) const
std::string & subdomain_name(subdomain_id_type id)
void unset_has_removed_remote_elements()
Tells this we have done some operation (e.g.
const std::set< unsigned char > & elem_dimensions() const
void allow_find_neighbors(bool allow)
If false is passed then this mesh will no longer work to find element neighbors when being prepared f...
void set_mesh_dimension(unsigned char d)
Resets the logical dimension of the mesh.
dof_id_type n_nodes_on_proc(const processor_id_type proc) const
variant_filter_iterator< MeshBase::Predicate, const Node *const, const Node *const &, const Node *const * > const_node_filter_iter
virtual dof_id_type parallel_n_nodes() const =0
std::string get_local_constraints(bool print_nonlocal=false) const
Gets a string reporting all mesh constraint rows local to this processor.
bool allow_node_and_elem_unique_id_overlap() const
void unset_is_partitioned()
Tells this we have done some operation creating unpartitioned elements.
std::map< subdomain_id_type, std::string > & set_subdomain_name_map()
bool allow_remote_element_removal() const
void size_node_extra_integers()
Size extra-integer arrays of all nodes in the mesh.
An object whose state is distributed along a set of processors.
virtual dof_id_type parallel_n_elem() const =0
virtual void clear()
Deletes all the element and node data that is currently stored.
variant_filter_iterator< MeshBase::Predicate, Node *const, Node *const &, Node *const * > const_node_filter_iter
Flags indicating in what ways a mesh has been prepared for use.
std::unique_ptr< PeriodicBoundaries > _disjoint_neighbor_boundary_pairs
The disjoint neighbor boundary id pairs.
friend std::ostream & operator<<(std::ostream &os, const MeshBase &m)
Equivalent to calling print_info() above, but now you can write: Mesh mesh; libMesh::out << mesh << s...
unsigned int add_node_datum(const std::string &name, bool allocate_data=true, const T *default_value=nullptr)
Register a datum (of type T) to be added to each node in the mesh.
const DofMap &dof_map LIBMESH_COMMA unsigned int var_num
virtual void write(const std::string &name) const =0
const std::set< subdomain_id_type > & get_mesh_subdomains() const
bool skip_partitioning() const
std::map< GhostingFunctor *, std::shared_ptr< GhostingFunctor > > _shared_functors
Hang on to references to any GhostingFunctor objects we were passed in shared_ptr form...
bool has_interior_parent_ptrs
void complete_preparation()
unsigned int n_partitions() const
virtual Node * add_node(Node *n)=0
Add Node n to the end of the vertex array.
virtual void clear_elems()=0
Deletes all the element data that is currently stored.
virtual const Elem * elem_ptr(const dof_id_type i) const =0
The definition of the node_iterator struct.
ElemMappingType
Enumeration of possible element master->physical mapping types.
const_node_iterator(const IterType &d, const IterType &e, const PredType &p)
Templated forwarding ctor – forwards to appropriate variant_filter_iterator ctor.
virtual Elem * insert_elem(Elem *e)=0
Insert elem e to the element array, preserving its id and replacing/deleting any existing element wit...
std::vector< dof_id_type > _node_integer_default_values
The array of default initialization values for integer data associated with each node in the mesh...
Preparation _preparation
Flags indicating in what ways this mesh has been prepared.
std::vector< unsigned int > add_elem_data(const std::vector< std::string > &names, bool allocate_data=true, const std::vector< T > *default_values=nullptr)
Register data (of type T) to be added to each element in the mesh.
unsigned int recalculate_n_partitions()
In a few (very rare) cases, the user may have manually tagged the elements with specific processor ID...
std::set< elemset_id_type > elemset_type
Typedef for the "set" container used to store elemset ids.
std::vector< dof_id_type > _elem_integer_default_values
The array of default initialization values for integer data associated with each element in the mesh...
subdomain_id_type n_subdomains() const
std::string get_info(const unsigned int verbosity=0, const bool global=true) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual bool contract()=0
Delete subactive (i.e.
virtual const Elem * query_elem_ptr(const dof_id_type i) const =0
virtual SimpleRange< element_iterator > active_local_subdomain_elements_ptr_range(subdomain_id_type sid)=0
bool _skip_detect_interior_parents
If this is true then we will skip detect_interior_parents in prepare_for_use.
virtual void renumber_elem(dof_id_type old_id, dof_id_type new_id)=0
Changes the id of element old_id, both by changing elem(old_id)->id() and by moving elem(old_id) in t...
void post_dofobject_moves(MeshBase &&other_mesh)
Moves any superclass data (e.g.
virtual void all_complete_order()
Calls the range-based version of this function with a range consisting of all elements in the mesh...
unsigned int spatial_dimension() const
element_iterator(const IterType &d, const IterType &e, const PredType &p)
std::map< const Node *, constraint_rows_mapped_type > constraint_rows_type
void print_constraint_rows(std::ostream &os=libMesh::out, bool print_nonlocal=false) const
Prints (from processor 0) all mesh constraint rows.
virtual bool is_replicated() const
virtual const Elem & elem_ref(const dof_id_type i) const
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...
The definition of the const_node_iterator struct.
MeshBase(const Parallel::Communicator &comm_in, unsigned char dim=1)
Constructor.
void all_second_order(const bool full_ordered=true)
Calls the range-based version of this function with a range consisting of all elements in the mesh...
dof_id_type n_active_sub_elem() const
Same as n_sub_elem(), but only counts active elements.
virtual ~MeshBase()
Destructor.
std::vector< GhostingFunctor * >::const_iterator GhostingFunctorIterator
Iterator type for ghosting functor ranges.
void set_elem_dimensions(std::set< unsigned char > elem_dims)
Most of the time you should not need to call this, as the element dimensions will be set automaticall...
unsigned int mesh_dimension() const
unsigned int level ElemType type std::set< subdomain_id_type > ss 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)=0
std::unique_ptr< GhostingFunctor > _default_ghosting
The default geometric GhostingFunctor, used to implement standard libMesh element ghosting behavior...
void change_elemset_id(elemset_id_type old_id, elemset_id_type new_id)
Replace elemset id "old_id" with "new_id".
void unset_has_boundary_id_sets()
Tells this we have done some operation which may have invalidated our cached boundary id sets...
unsigned int add_node_integer(std::string name, bool allocate_data=true, dof_id_type default_value=DofObject::invalid_id)
Register an integer datum (of type dof_id_type) to be added to each node in the mesh.
variant_filter_iterator< MeshBase::Predicate, Elem *const, Elem *const &, Elem *const *, const Elem *const, const Elem *const &, const Elem *const * > elem_filter_iter
virtual SimpleRange< element_iterator > active_subdomain_set_elements_ptr_range(std::set< subdomain_id_type > ss)=0
bool has_boundary_id_sets
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 elem...
void sync_subdomain_name_map()
libMesh often expects all processors to know about names of all subdomain ids, but distributed mesh g...
const std::string & get_node_integer_name(unsigned int i) const
virtual void libmesh_assert_valid_parallel_ids() const
Verify id and processor_id consistency of our elements and nodes containers.
std::unique_ptr< ConstElemRange > _const_active_local_element_stored_range
A cached ConstElemRange for threaded calculation on all local elements of this mesh.
virtual const Node & node_ref(const dof_id_type i) const
virtual const Point & point(const dof_id_type i) const =0
bool has_synched_id_counts
void unset_has_reinit_ghosting_functors()
Tells this we have done some operation (e.g.
bool _skip_all_partitioning
If this is true then no partitioning should be done.
const_node_iterator(const MeshBase::node_iterator &rhs)
The conversion-to-const ctor.
bool allow_renumbering() const
const constraint_rows_type & get_constraint_rows() const
virtual void delete_remote_elements()
When supported, deletes all nonlocal elements of the mesh except for "ghosts" which touch a local ele...
MeshBase & interior_mesh()
const_element_iterator(const MeshBase::element_iterator &rhs)
The conversion-to-const ctor.
virtual dof_id_type max_node_id() const =0
void remove_disjoint_boundary_pair(const boundary_id_type b1, const boundary_id_type b2)
void reinit_ghosting_functors()
Loops over ghosting functors and calls mesh_reinit()
virtual dof_id_type n_elem() const =0
virtual const Node * node_ptr(const dof_id_type i) const =0
processor_id_type processor_id() const
std::unique_ptr< PointLocatorBase > _point_locator
A PointLocator class for this mesh.
bool operator!=(const Preparation &other) const
virtual void redistribute()
Redistribute elements between processors.
Real _point_locator_close_to_point_tol
If nonzero, we will call PointLocatorBase::set_close_to_point_tol() on any PointLocators that we crea...
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...
GhostingFunctor & default_ghosting()
Default ghosting functor.
A Point defines a location in LIBMESH_DIM dimensional Real space.
virtual void reserve_elem(const dof_id_type ne)=0
Reserves space for a known number of elements.
bool has_reinit_ghosting_functors
bool locally_equals(const MeshBase &other_mesh) const
This behaves the same as operator==, but only for the local and ghosted aspects of the mesh; i...
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...
void unset_is_prepared()
Tells this we have done some operation where we should no longer consider ourself prepared...
unsigned int & set_n_partitions()
void ErrorVector unsigned int
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
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...
virtual dof_id_type n_nodes() const =0
void unset_has_synched_id_counts()
Tells this we have done some operation (e.g.
variant_filter_iterator< MeshBase::Predicate, Node *const, Node *const &, Node *const *, const Node *const, const Node *const &, const Node *const * > node_filter_iter
void size_elem_extra_integers()
Size extra-integer arrays of all elements in the mesh.
void add_ghosting_functor(GhostingFunctor &ghosting_functor)
Adds a functor which can specify ghosting requirements for use on distributed meshes.
MeshBase & operator=(const MeshBase &)=delete
Copy and move assignment are not allowed because MeshBase subclasses manually manage memory (Elems an...
void unset_has_removed_orphaned_nodes()
Tells this we have done some operation (e.g.
void set_point_locator_close_to_point_tol(Real val)
Set value used by PointLocatorBase::close_to_point_tol().