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" 44 class GhostingFunctor;
135 return !(*
this == other_mesh);
150 virtual std::unique_ptr<MeshBase>
clone()
const = 0;
179 virtual void clear ();
457 #ifdef LIBMESH_ENABLE_UNIQUE_ID 513 #ifdef LIBMESH_ENABLE_UNIQUE_ID 709 #ifdef LIBMESH_ENABLE_DEPRECATED 856 virtual void find_neighbors (
const bool reset_remote_elements =
false,
857 const bool reset_current_list =
true) = 0;
881 #ifdef LIBMESH_ENABLE_AMR 908 bool allocate_data =
true,
925 std::vector<unsigned int>
add_elem_integers(
const std::vector<std::string> & names,
926 bool allocate_data =
true,
927 const std::vector<dof_id_type> * default_values =
nullptr);
982 template <
typename T>
984 bool allocate_data =
true,
985 const T * default_value =
nullptr);
1007 template <
typename T>
1008 std::vector<unsigned int>
add_elem_data(
const std::vector<std::string> & names,
1009 bool allocate_data =
true,
1010 const std::vector<T> * default_values =
nullptr);
1030 bool allocate_data =
true,
1047 std::vector<unsigned int>
add_node_integers(
const std::vector<std::string> & names,
1048 bool allocate_data =
true,
1049 const std::vector<dof_id_type> * default_values =
nullptr);
1104 template <
typename T>
1106 bool allocate_data =
true,
1107 const T * default_value =
nullptr);
1129 template <
typename T>
1131 bool allocate_data =
true,
1132 const std::vector<T> * default_values =
nullptr);
1151 #ifdef LIBMESH_ENABLE_DEPRECATED 1152 void prepare_for_use (
const bool skip_renumber_nodes_and_elements,
const bool skip_find_neighbors);
1154 #endif // LIBMESH_ENABLE_DEPRECATED 1160 virtual void partition (
const unsigned int n_parts);
1317 void subdomain_ids (std::set<subdomain_id_type> & ids,
const bool global =
true)
const;
1364 std::string
get_info (
const unsigned int verbosity = 0,
const bool global =
true)
const;
1372 void print_info (std::ostream & os=
libMesh::out,
const unsigned int verbosity = 0,
const bool global =
true)
const;
1385 virtual void read (
const std::string &
name,
1386 void * mesh_data=
nullptr,
1387 bool skip_renumber_nodes_and_elements=
false,
1388 bool skip_find_neighbors=
false) = 0;
1389 virtual void write (
const std::string &
name)
const = 0;
1437 const bool full_ordered =
true) = 0;
1536 #define ABSTRACT_ELEM_ITERATORS(TYPE, ARGDECL) \ 1537 virtual element_iterator TYPE##elements_begin(ARGDECL) = 0; \ 1538 virtual element_iterator TYPE##elements_end(ARGDECL) = 0; \ 1539 virtual const_element_iterator TYPE##elements_begin(ARGDECL) const = 0; \ 1540 virtual const_element_iterator TYPE##elements_end(ARGDECL) const = 0; \ 1541 virtual SimpleRange<element_iterator> TYPE##element_ptr_range(ARGDECL) = 0; \ 1542 virtual SimpleRange<const_element_iterator> TYPE##element_ptr_range(ARGDECL) const = 0; 1544 #define DECLARE_ELEM_ITERATORS(TYPE, ARGDECL, ARGS) \ 1545 virtual element_iterator TYPE##elements_begin(ARGDECL) override final; \ 1546 virtual element_iterator TYPE##elements_end(ARGDECL) override final; \ 1547 virtual const_element_iterator TYPE##elements_begin(ARGDECL) const override final; \ 1548 virtual const_element_iterator TYPE##elements_end(ARGDECL) const override final; \ 1549 virtual SimpleRange<element_iterator> TYPE##element_ptr_range(ARGDECL) override final { return {TYPE##elements_begin(ARGS), TYPE##elements_end(ARGS)}; } \ 1550 virtual SimpleRange<const_element_iterator> TYPE##element_ptr_range(ARGDECL) const override final { return {TYPE##elements_begin(ARGS), TYPE##elements_end(ARGS)}; } 1552 #define ABSTRACT_NODE_ITERATORS(TYPE, ARGDECL) \ 1553 virtual node_iterator TYPE##nodes_begin(ARGDECL) = 0; \ 1554 virtual node_iterator TYPE##nodes_end(ARGDECL) = 0; \ 1555 virtual const_node_iterator TYPE##nodes_begin(ARGDECL) const = 0; \ 1556 virtual const_node_iterator TYPE##nodes_end(ARGDECL) const = 0; \ 1557 virtual SimpleRange<node_iterator> TYPE##node_ptr_range(ARGDECL) = 0; \ 1558 virtual SimpleRange<const_node_iterator> TYPE##node_ptr_range(ARGDECL) const = 0; 1560 #define DECLARE_NODE_ITERATORS(TYPE, ARGDECL, ARGS) \ 1561 virtual node_iterator TYPE##nodes_begin(ARGDECL) override final; \ 1562 virtual node_iterator TYPE##nodes_end(ARGDECL) override final; \ 1563 virtual const_node_iterator TYPE##nodes_begin(ARGDECL) const override final; \ 1564 virtual const_node_iterator TYPE##nodes_end(ARGDECL) const override final; \ 1565 virtual SimpleRange<node_iterator> TYPE##node_ptr_range(ARGDECL) override final { return {TYPE##nodes_begin(ARGS), TYPE##nodes_end(ARGS)}; } \ 1566 virtual SimpleRange<const_node_iterator> TYPE##node_ptr_range(ARGDECL) const override final { return {TYPE##nodes_begin(ARGS), TYPE##nodes_end(ARGS)}; } 1568 #define LIBMESH_COMMA , 1649 #ifdef LIBMESH_ENABLE_AMR 1675 ABSTRACT_NODE_ITERATORS(,)
1676 ABSTRACT_NODE_ITERATORS(active_,)
1677 ABSTRACT_NODE_ITERATORS(local_,)
1678 ABSTRACT_NODE_ITERATORS(bnd_,)
1687 ABSTRACT_NODE_ITERATORS(multi_evaluable_,
std::vector<const
DofMap *> dof_maps)
1743 template <
typename T>
1745 bool precondition_constraint_operator =
false);
1754 bool print_nonlocal=
false)
const;
1763 #ifdef LIBMESH_ENABLE_DEPRECATED 1772 #endif // LIBMESH_ENABLE_DEPRECATED 1827 #ifndef LIBMESH_ENABLE_DEPRECATED 1921 #ifdef LIBMESH_ENABLE_UNIQUE_ID 2069 std::pair<std::vector<unsigned int>, std::vector<unsigned int>>
2141 #ifdef LIBMESH_ENABLE_DEPRECATED 2161 const Elem *
const &,
2166 const Elem *
const &,
2174 const Node *
const &,
2179 const Node *
const &,
2181 #endif // LIBMESH_ENABLE_DEPRECATED 2202 template <
typename PredType,
typename IterType>
2205 const PredType & p ) :
2222 template <
typename PredType,
typename IterType>
2225 const PredType & p ) :
2253 template <
typename PredType,
typename IterType>
2256 const PredType & p ) :
2273 template <
typename PredType,
typename IterType>
2276 const PredType & p ) :
2290 template <
typename T>
2294 const T * default_value)
2298 unsigned int n_more_integers = (
sizeof(T)-1)/
sizeof(
dof_id_type);
2301 std::memcpy(int_data.data(), default_value,
sizeof(T));
2304 for (
unsigned int i=0; i != n_more_integers; ++i)
2314 template <
typename T>
2318 const std::vector<T> * default_values)
2320 libmesh_assert(!default_values || default_values->size() == names.size());
2322 std::vector<unsigned int> returnval(names.size());
2328 this->add_elem_datum<T>(names[i],
false,
2330 (*default_values)[i] :
nullptr);
2339 template <
typename T>
2343 const T * default_value)
2347 unsigned int n_more_integers = (
sizeof(T)-1)/
sizeof(
dof_id_type);
2350 std::memcpy(int_data.data(), default_value,
sizeof(T));
2353 for (
unsigned int i=0; i != n_more_integers; ++i)
2363 template <
typename T>
2367 const std::vector<T> * default_values)
2369 libmesh_assert(!default_values || default_values->size() == names.size());
2371 std::vector<unsigned int> returnval(names.size());
2377 this->add_node_datum<T>(names[i],
false,
2379 (*default_values)[i] :
nullptr);
2391 #endif // LIBMESH_MESH_BASE_H std::string name(const ElemQuality q)
This function returns a string containing some name for q.
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
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
virtual void read(const std::string &name, void *mesh_data=nullptr, bool skip_renumber_nodes_and_elements=false, bool skip_find_neighbors=false)=0
Interfaces for reading/writing a mesh to/from a file.
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 _skip_renumber_nodes_and_elements
If this is true then renumbering will be kept to a minimum.
Order
defines an enum for polynomial orders.
constraint_rows_type & get_constraint_rows()
Constraint rows accessors.
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
[email protected] *
[email protected] 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.
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...
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
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.
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 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 prepare_for_use()
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.
virtual void set_next_unique_id(unique_id_type id)=0
Sets the next available unique id to be used.
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
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.
virtual std::unique_ptr< MeshBase > clone() const =0
Virtual "copy constructor".
virtual Node & node_ref(const dof_id_type i)
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
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.
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.
std::set< GhostingFunctor * > _ghosting_functors
The list of all GhostingFunctor objects to be used when distributing a DistributedMesh.
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
virtual void find_neighbors(const bool reset_remote_elements=false, const bool reset_current_list=true)=0
Locate element face (edge in 2D) neighbors.
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.
This is the MeshCommunication class.
const std::map< subdomain_id_type, std::string > & get_subdomain_name_map() const
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
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...
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
virtual Node * insert_node(Node *n)=0
This method is deprecated.
The BoundaryInfo class contains information relevant to boundary conditions including storing faces...
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
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.
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.
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)
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_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
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...
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...
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< GhostingFunctor * >::const_iterator ghosting_functors_begin() const
Beginning of range of ghosting functors.
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
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
bool _is_prepared
Flag indicating if the mesh has been prepared for use.
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.
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".
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
unique_id_type next_unique_id()
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...
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.
virtual const Node & node_ref(const dof_id_type i) const
virtual const Point & point(const dof_id_type i) const =0
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 void update_post_partitioning()
Recalculate any cached data after elements and nodes have been repartitioned.
virtual dof_id_type max_node_id() const =0
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.
const DofMap &dof_map LIBMESH_COMMA unsigned int std::string & set_subdomain_name_map()
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 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...
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
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.
std::set< GhostingFunctor * >::const_iterator ghosting_functors_end() const
End of range of ghosting functors.
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 set_point_locator_close_to_point_tol(Real val)
Set value used by PointLocatorBase::close_to_point_tol().