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"
50class PeriodicBoundary;
51class PeriodicBoundaries;
62template <
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
606#ifdef LIBMESH_ENABLE_UNIQUE_ID
662#ifdef LIBMESH_ENABLE_UNIQUE_ID
991 const bool reset_current_list =
true,
992 const bool assert_valid =
true) = 0;
1016#ifdef LIBMESH_ENABLE_AMR
1043 bool allocate_data =
true,
1060 std::vector<unsigned int>
add_elem_integers(
const std::vector<std::string> & names,
1061 bool allocate_data =
true,
1062 const std::vector<dof_id_type> * default_values =
nullptr);
1117 template <
typename T>
1119 bool allocate_data =
true,
1120 const T * default_value =
nullptr);
1142 template <
typename T>
1143 std::vector<unsigned int>
add_elem_data(
const std::vector<std::string> & names,
1144 bool allocate_data =
true,
1145 const std::vector<T> * default_values =
nullptr);
1165 bool allocate_data =
true,
1182 std::vector<unsigned int>
add_node_integers(
const std::vector<std::string> & names,
1183 bool allocate_data =
true,
1184 const std::vector<dof_id_type> * default_values =
nullptr);
1239 template <
typename T>
1241 bool allocate_data =
true,
1242 const T * default_value =
nullptr);
1264 template <
typename T>
1265 std::vector<unsigned int>
add_node_data(
const std::vector<std::string> & name,
1266 bool allocate_data =
true,
1267 const std::vector<T> * default_values =
nullptr);
1300#ifdef LIBMESH_ENABLE_DEPRECATED
1301 void prepare_for_use (
const bool skip_renumber_nodes_and_elements,
const bool skip_find_neighbors);
1318 virtual void partition (
const unsigned int n_parts);
1498 void subdomain_ids (std::set<subdomain_id_type> & ids,
const bool global =
true)
const;
1545 std::string
get_info (
const unsigned int verbosity = 0,
const bool global =
true)
const;
1553 void print_info (std::ostream & os=
libMesh::out,
const unsigned int verbosity = 0,
const bool global =
true)
const;
1566 virtual void read (
const std::string & name,
1567 void * mesh_data=
nullptr,
1568 bool skip_renumber_nodes_and_elements=
false,
1569 bool skip_find_neighbors=
false,
1570 bool skip_detect_interior_parents=
false) = 0;
1571 virtual void write (
const std::string & name)
const = 0;
1619 const bool full_ordered =
true) = 0;
1700#ifdef LIBMESH_ENABLE_DEPRECATED
1724 const std::string & name,
1725 bool synchronous =
false);
1738#define ABSTRACT_ELEM_ITERATORS(TYPE, ARGDECL) \
1739 virtual element_iterator TYPE##elements_begin(ARGDECL) = 0; \
1740 virtual element_iterator TYPE##elements_end(ARGDECL) = 0; \
1741 virtual const_element_iterator TYPE##elements_begin(ARGDECL) const = 0; \
1742 virtual const_element_iterator TYPE##elements_end(ARGDECL) const = 0; \
1743 virtual SimpleRange<element_iterator> TYPE##element_ptr_range(ARGDECL) = 0; \
1744 virtual SimpleRange<const_element_iterator> TYPE##element_ptr_range(ARGDECL) const = 0;
1746#define DECLARE_ELEM_ITERATORS(TYPE, ARGDECL, ARGS) \
1747 virtual element_iterator TYPE##elements_begin(ARGDECL) override final; \
1748 virtual element_iterator TYPE##elements_end(ARGDECL) override final; \
1749 virtual const_element_iterator TYPE##elements_begin(ARGDECL) const override final; \
1750 virtual const_element_iterator TYPE##elements_end(ARGDECL) const override final; \
1751 virtual SimpleRange<element_iterator> TYPE##element_ptr_range(ARGDECL) override final { return {TYPE##elements_begin(ARGS), TYPE##elements_end(ARGS)}; } \
1752 virtual SimpleRange<const_element_iterator> TYPE##element_ptr_range(ARGDECL) const override final { return {TYPE##elements_begin(ARGS), TYPE##elements_end(ARGS)}; }
1754#define ABSTRACT_NODE_ITERATORS(TYPE, ARGDECL) \
1755 virtual node_iterator TYPE##nodes_begin(ARGDECL) = 0; \
1756 virtual node_iterator TYPE##nodes_end(ARGDECL) = 0; \
1757 virtual const_node_iterator TYPE##nodes_begin(ARGDECL) const = 0; \
1758 virtual const_node_iterator TYPE##nodes_end(ARGDECL) const = 0; \
1759 virtual SimpleRange<node_iterator> TYPE##node_ptr_range(ARGDECL) = 0; \
1760 virtual SimpleRange<const_node_iterator> TYPE##node_ptr_range(ARGDECL) const = 0;
1762#define DECLARE_NODE_ITERATORS(TYPE, ARGDECL, ARGS) \
1763 virtual node_iterator TYPE##nodes_begin(ARGDECL) override final; \
1764 virtual node_iterator TYPE##nodes_end(ARGDECL) override final; \
1765 virtual const_node_iterator TYPE##nodes_begin(ARGDECL) const override final; \
1766 virtual const_node_iterator TYPE##nodes_end(ARGDECL) const override final; \
1767 virtual SimpleRange<node_iterator> TYPE##node_ptr_range(ARGDECL) override final { return {TYPE##nodes_begin(ARGS), TYPE##nodes_end(ARGS)}; } \
1768 virtual SimpleRange<const_node_iterator> TYPE##node_ptr_range(ARGDECL) const override final { return {TYPE##nodes_begin(ARGS), TYPE##nodes_end(ARGS)}; }
1770#define LIBMESH_COMMA ,
1851#ifdef LIBMESH_ENABLE_AMR
1877 ABSTRACT_NODE_ITERATORS(,)
1878 ABSTRACT_NODE_ITERATORS(active_,)
1879 ABSTRACT_NODE_ITERATORS(local_,)
1880 ABSTRACT_NODE_ITERATORS(bnd_,)
1889 ABSTRACT_NODE_ITERATORS(multi_evaluable_,
std::vector<const
DofMap *> dof_maps)
1975 template <
typename T>
1977 bool precondition_constraint_operator =
false);
1986 bool print_nonlocal=
false)
const;
1995#ifdef LIBMESH_ENABLE_DEPRECATED
2060#ifdef LIBMESH_ENABLE_PERIODIC
2089 explicit operator bool()
const;
2117#ifdef LIBMESH_ENABLE_PERIODIC
2215 mutable std::unique_ptr<ConstElemRange>
2241#ifdef LIBMESH_ENABLE_UNIQUE_ID
2407 std::pair<std::vector<unsigned int>, std::vector<unsigned int>>
2479#ifdef LIBMESH_ENABLE_DEPRECATED
2499 const Elem *
const &,
2504 const Elem *
const &,
2512 const Node *
const &,
2517 const Node *
const &,
2540 template <
typename PredType,
typename IterType>
2543 const PredType & p ) :
2560 template <
typename PredType,
typename IterType>
2563 const PredType & p ) :
2591 template <
typename PredType,
typename IterType>
2594 const PredType & p ) :
2611 template <
typename PredType,
typename IterType>
2614 const PredType & p ) :
2628template <
typename T>
2632 const T * default_value)
2636 unsigned int n_more_integers = (
sizeof(T)-1)/
sizeof(
dof_id_type);
2639 std::memcpy(int_data.data(), default_value,
sizeof(T));
2642 for (
unsigned int i=0; i != n_more_integers; ++i)
2652template <
typename T>
2656 const std::vector<T> * default_values)
2658 libmesh_assert(!default_values || default_values->size() == names.size());
2660 std::vector<unsigned int> returnval(names.size());
2666 this->add_elem_datum<T>(names[i],
false,
2668 (*default_values)[i] :
nullptr);
2677template <
typename T>
2681 const T * default_value)
2685 unsigned int n_more_integers = (
sizeof(T)-1)/
sizeof(
dof_id_type);
2688 std::memcpy(int_data.data(), default_value,
sizeof(T));
2691 for (
unsigned int i=0; i != n_more_integers; ++i)
2701template <
typename T>
2705 const std::vector<T> * default_values)
2707 libmesh_assert(!default_values || default_values->size() == names.size());
2709 std::vector<unsigned int> returnval(names.size());
2715 this->add_node_datum<T>(names[i],
false,
2717 (*default_values)[i] :
nullptr);
void ErrorVector unsigned int
The BoundaryInfo class contains information relevant to boundary conditions including storing faces,...
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 abstract base class defines the interface by which library code and user code can report associa...
This is the MeshBase class.
void set_subdomain_name(subdomain_id_type id, const std::string &name, bool synchronous=false)
Sets the name for the provided id.
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 ...
void set_isnt_prepared()
Tells this we have done some operation where we should no longer consider ourself prepared.
variant_filter_iterator< MeshBase::Predicate, Elem *const, Elem *const &, Elem *const *, const Elem *const, const Elem *const &, const Elem *const * > elem_filter_iter
virtual const Node & node_ref(const dof_id_type i) const
virtual const Point & point(const dof_id_type i) const =0
void unset_has_reinit_ghosting_functors()
Tells this we have done some operation (e.g.
virtual bool is_serial() const
void size_elem_extra_integers()
Size extra-integer arrays of all elements in the mesh.
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...
virtual dof_id_type parallel_n_elem() const =0
virtual bool contract()=0
Delete subactive (i.e.
unsigned int n_elem_integers() const
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
void set_spatial_dimension(unsigned char d)
Sets the "spatial dimension" of the Mesh.
virtual Elem & elem_ref(const dof_id_type i)
Preparation preparation() const
virtual std::unique_ptr< Partitioner > & partitioner()
A partitioner to use at each partitioning.
bool allow_renumbering() const
virtual const Node * node_ptr(const dof_id_type i) const =0
MeshBase::elemset_type _all_elemset_ids
unsigned int mesh_dimension() const
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...
variant_filter_iterator< MeshBase::Predicate, const Node *const, const Node *const &, const Node *const * > const_node_filter_iter
virtual Node * query_node_ptr(const dof_id_type i)=0
virtual dof_id_type n_elem() const =0
virtual void all_first_order()=0
Converts a mesh with higher-order elements into a mesh with linear elements.
virtual bool is_replicated() const
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.
void complete_preparation()
bool _skip_detect_interior_parents
If this is true then we will skip detect_interior_parents in prepare_for_use.
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...
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...
virtual void own_node(Node &)
Takes ownership of node n on this partition of a distributed mesh, by setting n.processor_id() to thi...
virtual Elem * insert_elem(Elem *e)=0
Insert elem e to the element array, preserving its id and replacing/deleting any existing element wit...
const std::set< unsigned char > & elem_dimensions() const
void print_constraint_rows(std::ostream &os=libMesh::out, bool print_nonlocal=false) const
Prints (from processor 0) all mesh constraint rows.
bool skip_partitioning() const
Order supported_nodal_order() const
Order _supported_nodal_order
We cache the maximum nodal order supported by all the mesh's elements (the minimum supported_nodal_or...
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 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,...
virtual Node * node_ptr(const dof_id_type i)=0
unsigned int recalculate_n_partitions()
In a few (very rare) cases, the user may have manually tagged the elements with specific processor ID...
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...
void set_point_locator_close_to_point_tol(Real val)
Set value used by PointLocatorBase::close_to_point_tol().
dof_id_type n_active_elem_on_proc(const processor_id_type proc) const
bool has_node_integer(std::string_view name) const
virtual SimpleRange< element_iterator > active_subdomain_set_elements_ptr_range(std::set< subdomain_id_type > ss)=0
bool allow_detect_interior_parents() 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...
unsigned int spatial_dimension() const
PeriodicBoundaries * get_disjoint_neighbor_boundary_pairs()
void change_elemset_id(elemset_id_type old_id, elemset_id_type new_id)
Replace elemset id "old_id" with "new_id".
unsigned int get_elem_integer_index(std::string_view name) const
void allow_renumbering(bool allow)
If false is passed in then this mesh will no longer be renumbered when being prepared for use.
const std::map< subdomain_id_type, std::string > & get_subdomain_name_map() const
subdomain_id_type n_local_subdomains() const
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.
virtual void delete_node(Node *n)=0
Removes the Node n from the mesh.
unsigned int get_node_integer_index(std::string_view name) const
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 allow_node_and_elem_unique_id_overlap() const
dof_id_type get_elemset_code(const MeshBase::elemset_type &id_set) const
void unset_has_neighbor_ptrs()
Tells this we have done some operation (e.g.
dof_id_type n_sub_elem() const
const ConstElemRange & active_local_element_stored_range() const
virtual void redistribute()
Redistribute elements between processors.
const ElemRange & element_stored_range()
const DofMap &dof_map LIBMESH_COMMA unsigned int var_num
std::unique_ptr< PeriodicBoundaries > _disjoint_neighbor_boundary_pairs
The disjoint neighbor boundary id pairs.
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.
unsigned char _spatial_dimension
The "spatial dimension" of the Mesh.
virtual ~MeshBase()
Destructor.
std::map< MeshBase::elemset_type, dof_id_type > _elemset_codes_inverse_map
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...
virtual void write(const std::string &name) const =0
dof_id_type n_active_sub_elem() const
Same as n_sub_elem(), but only counts active elements.
virtual SimpleRange< element_iterator > active_local_subdomain_elements_ptr_range(subdomain_id_type sid)=0
bool _allow_remote_element_removal
If this is false then even on DistributedMesh remote elements will not be deleted during mesh prepara...
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.
void change_elemset_code(dof_id_type old_code, dof_id_type new_code)
Replace elemset code "old_code" with "new_code".
void unset_has_boundary_id_sets()
Tells this we have done some operation which may have invalidated our cached boundary id sets.
virtual std::unique_ptr< MeshBase > clone() const =0
Virtual "copy constructor".
const std::string & get_node_integer_name(unsigned int i) const
std::vector< dof_id_type > get_elemset_codes() const
Return a vector of all elemset codes defined on the mesh.
virtual dof_id_type n_nodes() const =0
virtual void delete_elem(Elem *e)=0
Removes element e from the mesh.
ElemMappingType default_mapping_type() const
Returns the default master space to physical space mapping basis functions to be used on newly added ...
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.
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.
unique_id_type _next_unique_id
The next available unique id for assigning ids to DOF objects.
bool _skip_renumber_nodes_and_elements
If this is true then renumbering will be kept to a minimum.
virtual dof_id_type max_node_id() const =0
void remove_ghosting_functor(GhostingFunctor &ghosting_functor)
Removes a functor which was previously added to the set of ghosting functors.
virtual const Node * query_node_ptr(const dof_id_type i) const =0
std::vector< std::pair< std::pair< const Elem *, unsigned int >, Real > > constraint_rows_mapped_type
void set_mesh_dimension(unsigned char d)
Resets the logical dimension of 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.
GhostingFunctorIterator ghosting_functors_begin() const
Beginning of range of ghosting functors.
void unset_has_synched_subdomain_name_map()
Tells this we have done some operation which may have left the subdomain id to name map inconsistent ...
std::map< GhostingFunctor *, std::shared_ptr< GhostingFunctor > > _shared_functors
Hang on to references to any GhostingFunctor objects we were passed in shared_ptr form.
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.
std::set< subdomain_id_type > _mesh_subdomains
We cache the subdomain ids of the elements present in the mesh.
dof_id_type n_unpartitioned_elem() const
virtual void update_post_partitioning()
Recalculate any cached data (or invalidate any caches that are computed on the fly) after elements an...
bool get_count_lower_dim_elems_in_point_locator() const
Get the current value of _count_lower_dim_elems_in_point_locator.
std::unique_ptr< PointLocatorBase > _point_locator
A PointLocator class for this mesh.
virtual const Elem * elem_ptr(const dof_id_type i) const =0
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.
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 ...
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.
bool _skip_all_partitioning
If this is true then no partitioning should be done.
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,...
ABSTRACT_ELEM_ITERATORS(,) ABSTRACT_ELEM_ITERATORS(active_
std::vector< std::string > _elem_integer_names
The array of names for integer data associated with each element in the mesh.
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
void unset_has_synched_id_counts()
Tells this we have done some operation (e.g.
void unset_has_removed_orphaned_nodes()
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
const constraint_rows_type & get_constraint_rows() const
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.
void unset_is_partitioned()
Tells this we have done some operation creating unpartitioned elements.
void remove_orphaned_nodes()
Removes any orphaned nodes, nodes not connected to any elements.
Real get_point_locator_close_to_point_tol() const
variant_filter_iterator< MeshBase::Predicate, const Elem *const, const Elem *const &, const Elem *const * > const_elem_filter_iter
unsigned int n_partitions() const
virtual void set_next_unique_id(unique_id_type id)=0
Sets the next available unique id to be used.
virtual Node * add_node(Node *n)=0
Add Node n to the end of the vertex array.
bool has_elem_integer(std::string_view name) const
virtual Node * add_node(std::unique_ptr< Node > n)=0
Version of add_node() taking a std::unique_ptr by value.
dof_id_type n_local_elem() const
dof_id_type n_unpartitioned_nodes() const
virtual dof_id_type max_elem_id() const =0
void unset_has_interior_parent_ptrs()
Tells this we have done some operation (e.g.
const std::string & get_elem_integer_name(unsigned int i) const
bool _skip_noncritical_partitioning
If this is true then no partitioning should be done with the possible exception of orphaned nodes.
virtual void allgather()
Gathers all elements and nodes of the mesh onto every processor.
bool _skip_find_neighbors
If this is true then we will skip find_neighbors in prepare_for_use.
void unset_has_cached_elem_data()
Tells this we have done some operation (e.g.
dof_id_type n_elem_on_proc(const processor_id_type proc) const
virtual Elem * insert_elem(std::unique_ptr< Elem > e)=0
Version of insert_elem() taking a std::unique_ptr by value.
virtual void delete_remote_elements()
When supported, deletes all nonlocal elements of the mesh except for "ghosts" which touch a local ele...
MeshBase & operator=(const MeshBase &)=delete
Copy and move assignment are not allowed because MeshBase subclasses manually manage memory (Elems an...
ElemMappingType _default_mapping_type
The default mapping type (typically Lagrange) between master and physical space to assign to newly ad...
std::unique_ptr< BoundaryInfo > boundary_info
This class holds the boundary information.
std::set< Order > _elem_default_orders
We cache the (default) order of the geometric elements present in the mesh.
virtual void clear_elems()=0
Deletes all the element data that is currently stored.
const std::set< subdomain_id_type > & get_mesh_subdomains() const
bool skip_noncritical_partitioning() const
MeshBase * _interior_mesh
Defaulting to this, a pointer to the mesh used to generate boundary elements on this.
variant_filter_iterator< MeshBase::Predicate, Elem *const, Elem *const &, Elem *const * > const_elem_filter_iter
virtual void set_distributed()
Asserts that not all elements and nodes of the mesh necessarily exist on the current processor.
std::vector< GhostingFunctor * > _ghosting_functors
The list of all GhostingFunctor objects to be used when distributing a DistributedMesh.
virtual void clear()
Deletes all the element and node data that is currently stored.
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.
dof_id_type n_local_nodes() const
std::unique_ptr< ConstElemRange > _const_active_local_element_stored_range
A cached ConstElemRange for threaded calculation on all local elements of this mesh.
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.
const std::set< Order > & elem_default_orders() const
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 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.
constraint_rows_type _constraint_rows
virtual Elem * add_elem(std::unique_ptr< Elem > e)=0
Version of add_elem() taking a std::unique_ptr by value.
std::unique_ptr< Partitioner > _partitioner
A partitioner to use at each prepare_for_use().
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.
unsigned int n_elemsets() const
Returns the number of unique elemset ids which have been added via add_elemset_code(),...
constraint_rows_type & get_constraint_rows()
Constraint rows accessors.
GhostingFunctor & default_ghosting()
Default ghosting functor.
const MeshBase & interior_mesh() const
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...
std::unique_ptr< GhostingFunctor > _default_ghosting
The default geometric GhostingFunctor, used to implement standard libMesh element ghosting behavior.
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.
void unset_has_removed_remote_elements()
Tells this we have done some operation (e.g.
unsigned int n_node_integers() const
unsigned char _default_mapping_data
The default mapping data (unused with Lagrange, used for nodal weight lookup index with rational base...
virtual void fix_broken_node_and_element_numbering()=0
There is no reason for a user to ever call this function.
virtual const Elem * query_elem_ptr(const dof_id_type i) const =0
dof_id_type n_constraint_rows() const
virtual void all_complete_order()
Calls the range-based version of this function with a range consisting of all elements in the mesh.
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
BoundaryInfo & get_boundary_info()
Writable information about boundary ids on the mesh.
dof_id_type n_active_local_elem() const
bool allow_remote_element_removal() const
Real _point_locator_close_to_point_tol
If nonzero, we will call PointLocatorBase::set_close_to_point_tol() on any PointLocators that we crea...
void add_ghosting_functor(std::shared_ptr< GhostingFunctor > ghosting_functor)
Adds a functor which can specify ghosting requirements for use on distributed meshes.
dof_id_type n_nodes_on_proc(const processor_id_type proc) const
variant_filter_iterator< MeshBase::Predicate, Node * > node_filter_iter
virtual Elem * elem_ptr(const dof_id_type i)=0
std::string & subdomain_name(subdomain_id_type id)
bool allow_find_neighbors() const
virtual Elem * query_elem_ptr(const dof_id_type i)=0
void sync_subdomain_name_map()
libMesh often expects all processors to know about names of all subdomain ids, but distributed mesh g...
virtual const Elem & elem_ref(const dof_id_type i) const
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...
void size_node_extra_integers()
Size extra-integer arrays of all nodes in the mesh.
unsigned int _n_parts
The number of partitions the mesh has.
std::map< const Node *, constraint_rows_mapped_type > constraint_rows_type
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.
unsigned char default_mapping_data() const
Returns any default data value used by the master space to physical space mapping.
void remove_disjoint_boundary_pair(const boundary_id_type b1, const boundary_id_type b2)
bool operator!=(const MeshBase &other_mesh) const
void clear_point_locator()
Releases the current PointLocator object.
virtual void reserve_elem(const dof_id_type ne)=0
Reserves space for a known number of elements.
virtual void gather_to_zero()
Gathers all elements and nodes of the mesh onto processor zero.
GhostingFunctorIterator ghosting_functors_end() const
End of range of ghosting functors.
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?...
void add_ghosting_functor(GhostingFunctor &ghosting_functor)
Adds a functor which can specify ghosting requirements for use on distributed meshes.
void copy_constraint_rows(const MeshBase &other_mesh)
Copy the constraints from the other mesh to this mesh.
std::set< elemset_id_type > elemset_type
Typedef for the "set" container used to store elemset ids.
std::set< unsigned char > _elem_dims
We cache the dimension of the elements present in the mesh.
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,...
std::vector< GhostingFunctor * >::const_iterator GhostingFunctorIterator
Iterator type for ghosting functor ranges.
std::vector< std::string > _node_integer_names
The array of names for integer data associated with each node in the mesh.
std::unique_ptr< PointLocatorBase > sub_point_locator() const
virtual void libmesh_assert_valid_parallel_ids() const
Verify id and processor_id consistency of our elements and nodes containers.
MeshBase(MeshBase &&)=delete
Move-constructor - deleted because after a theoretical move-construction and then destruction of the ...
Predicates::multi_predicate Predicate
We need an empty, generic class to act as a predicate for this and derived mesh classes.
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 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.
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::map< subdomain_id_type, std::string > & set_subdomain_name_map()
unique_id_type next_unique_id() const
subdomain_id_type get_id_by_name(std::string_view name) const
void print_info(std::ostream &os=libMesh::out, const unsigned int verbosity=0, const bool global=true) const
Prints relevant information about the mesh.
virtual void update_parallel_id_counts()=0
Updates parallel caches so that methods like n_elem() accurately reflect changes on other processors.
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....
MeshBase & interior_mesh()
virtual dof_id_type n_active_elem() const =0
void reinit_ghosting_functors()
Loops over ghosting functors and calls mesh_reinit()
Preparation _preparation
Flags indicating in what ways this mesh has been prepared.
virtual MeshBase & assign(MeshBase &&other_mesh)=0
Shim to allow operator = (&&) to behave like a virtual function without having to be one.
void skip_partitioning(bool skip)
If true is passed in then nothing on this mesh will be (re)partitioned.
void set_interior_mesh(MeshBase &int_mesh)
Sets the interior mesh.
subdomain_id_type n_subdomains() const
virtual bool is_serial_on_zero() const
std::string get_info(const unsigned int verbosity=0, const bool global=true) const
std::string get_local_constraints(bool print_nonlocal=false) const
Gets a string reporting all mesh constraint rows local to this processor.
virtual Node & node_ref(const dof_id_type i)
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 ...
bool nodes_and_elements_equal(const MeshBase &other_mesh) const
Tests for equality of all elements and nodes in the mesh.
void copy_cached_data(const MeshBase &other_mesh)
Helper class to copy cached data, to synchronize with a possibly unprepared other_mesh.
virtual void reserve_nodes(const dof_id_type nn)=0
Reserves space for a known number of nodes.
void skip_noncritical_partitioning(bool skip)
If true is passed in then the elements on this mesh will no longer be (re)partitioned,...
void unset_is_prepared()
Tells this we have done some operation where we should no longer consider ourself prepared.
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.
void post_dofobject_moves(MeshBase &&other_mesh)
Moves any superclass data (e.g.
void detect_interior_parents()
Search the mesh for elements that have a neighboring element of dim+1 and set that element as the int...
unsigned int & set_n_partitions()
void clear_stored_ranges()
Clears stored ranges, to indicate that the mesh has changed and they should be regenerated when next ...
virtual dof_id_type parallel_n_nodes() const =0
variant_filter_iterator< MeshBase::Predicate, Node *const, Node *const &, Node *const * > const_node_filter_iter
virtual unique_id_type parallel_max_unique_id() const =0
std::unique_ptr< ElemRange > _element_stored_range
A cached ElemRange for threaded mutation of all semilocal elements of this mesh.
This is the MeshCommunication class.
A Node is like a Point, but with more information.
An object whose state is distributed along a set of processors.
processor_id_type processor_id() const
processor_id_type n_processors() const
The Partitioner class provides a uniform interface for partitioning algorithms.
We're using a class instead of a typedef to allow forward declarations and future flexibility.
A Point defines a location in LIBMESH_DIM dimensional Real space.
The SimpleRange templated class is intended to make it easy to construct ranges from pairs of iterato...
The StoredRange class defines a contiguous, divisible set of objects.
Original Authors: Corwin Joy * Michael Gradman cjoy@houston.rr.com * Michael.Gradman@caminus....
The libMesh namespace provides an interface to certain functionality in the library.
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
ElemType
Defines an enum for geometric element types.
ElemMappingType
Enumeration of possible element master->physical mapping types.
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
uint8_t processor_id_type
Flags indicating in what ways a mesh has been prepared for use.
bool has_reinit_ghosting_functors
bool has_cached_elem_data
bool operator!=(const Preparation &other) const
bool has_removed_orphaned_nodes
Preparation & operator=(bool set_all)
Set all flags to the "set_all" value.
Preparation()
Constructor.
bool operator==(const Preparation &other) const
Two Preparation objects are equivalent iff all the flags match, regardless of the true/false status o...
bool has_interior_parent_ptrs
bool has_removed_remote_elements
bool has_synched_id_counts
bool has_synched_subdomain_name_map
bool has_boundary_id_sets
The definition of the const_element_iterator struct.
const_element_iterator(const MeshBase::element_iterator &rhs)
The conversion-to-const ctor.
const_element_iterator(const IterType &d, const IterType &e, const PredType &p)
Templated forwarding ctor – forwards to appropriate variant_filter_iterator ctor.
The definition of the const_node_iterator struct.
const_node_iterator(const IterType &d, const IterType &e, const PredType &p)
Templated forwarding ctor – forwards to appropriate variant_filter_iterator ctor.
const_node_iterator(const MeshBase::node_iterator &rhs)
The conversion-to-const ctor.
The definition of the element_iterator struct.
element_iterator(const IterType &d, const IterType &e, const PredType &p)
The definition of the node_iterator struct.
node_iterator(const IterType &d, const IterType &e, const PredType &p)
Templated forwarding ctor – forwards to appropriate variant_filter_iterator ctor.