libMesh
mesh_base.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2026 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_MESH_BASE_H
21 #define LIBMESH_MESH_BASE_H
22 
23 // Local Includes
24 #include "libmesh/dof_object.h" // for invalid_processor_id
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"
33 
34 // C++ Includes
35 #include <cstddef>
36 #include <string>
37 #include <memory>
38 
39 #include "libmesh/vector_value.h"
40 
41 namespace libMesh
42 {
43 // Forward declarations
44 class BoundaryInfo;
45 class Elem;
46 class GhostingFunctor;
47 class Node;
48 class Point;
49 class Partitioner;
50 class PeriodicBoundary;
51 class PeriodicBoundaries;
52 
53 template <typename T>
54 class SparseMatrix;
55 
56 enum ElemType : int;
57 enum ElemMappingType : unsigned char;
58 
59 template <class MT>
60 class MeshInput;
61 
62 template <typename iterator_type, typename object_type>
63 class StoredRange;
64 
80 class MeshBase : public ParallelObject
81 {
82 public:
83 
89  MeshBase (const Parallel::Communicator & comm_in,
90  unsigned char dim=1);
91 
95  MeshBase (const MeshBase & other_mesh);
96 
102  MeshBase(MeshBase &&) = delete;
103 
114  MeshBase & operator= (const MeshBase &) = delete;
115  MeshBase & operator= (MeshBase && other_mesh);
116 
121  virtual MeshBase & assign(MeshBase && other_mesh) = 0;
122 
136  bool operator== (const MeshBase & other_mesh) const;
137 
138  bool operator!= (const MeshBase & other_mesh) const
139  {
140  return !(*this == other_mesh);
141  }
142 
148  bool locally_equals (const MeshBase & other_mesh) const;
149 
155  virtual std::unique_ptr<MeshBase> clone() const = 0;
156 
160  virtual ~MeshBase ();
161 
165  virtual std::unique_ptr<Partitioner> & partitioner() { return _partitioner; }
166 
170  const BoundaryInfo & get_boundary_info() const { return *boundary_info; }
171 
176 
184  virtual void clear ();
185 
197  virtual void clear_elems () = 0;
198 
204  bool is_prepared () const;
205 
211  struct Preparation;
212 
214  { return _preparation; }
215 
216 #ifdef LIBMESH_ENABLE_DEPRECATED
217 
229  { libmesh_deprecated(); _preparation = false; }
230 #endif // LIBMESH_ENABLE_DEPRECATED
231 
237  void unset_is_prepared();
238 
247  { _preparation.is_partitioned = false; }
248 
259 
271  { _preparation.has_neighbor_ptrs = false; }
272 
283 
295 
309 
320 
332 
342 
347  virtual bool is_serial () const
348  { return true; }
349 
354  virtual bool is_serial_on_zero () const
355  { return true; }
356 
362  virtual void set_distributed ()
363  { libmesh_error(); }
364 
369  virtual bool is_replicated () const
370  { return true; }
371 
376  virtual void allgather () {}
377 
382  virtual void gather_to_zero() {}
383 
389  virtual void delete_remote_elements () {
391  }
392 
397 
404  unsigned int mesh_dimension () const;
405 
413  void set_mesh_dimension (unsigned char d)
414  { _elem_dims.clear(); _elem_dims.insert(d); }
415 
420  const std::set<unsigned char> & elem_dimensions() const
421  { return _elem_dims; }
422 
427  const std::set<Order> & elem_default_orders() const
428  { return _elem_default_orders; }
429 
436  { return _supported_nodal_order; }
437 
448  void set_elem_dimensions(std::set<unsigned char> elem_dims);
449 
456  typedef std::set<elemset_id_type> elemset_type;
457 
480 
486  unsigned int n_elemsets() const;
487 
494  void get_elemsets(dof_id_type elemset_code, MeshBase::elemset_type & id_set_to_fill) const;
496 
501  std::vector<dof_id_type> get_elemset_codes() const;
502 
509  void change_elemset_code(dof_id_type old_code, dof_id_type new_code);
510 
516 
543  unsigned int spatial_dimension () const;
544 
549  void set_spatial_dimension(unsigned char d);
550 
560  virtual dof_id_type n_nodes () const = 0;
561 
571  virtual dof_id_type parallel_n_nodes () const = 0;
572 
576  dof_id_type n_nodes_on_proc (const processor_id_type proc) const;
577 
582  { return this->n_nodes_on_proc (this->processor_id()); }
583 
589 
594  virtual dof_id_type max_node_id () const = 0;
595 
596 #ifdef LIBMESH_ENABLE_UNIQUE_ID
597 
601 
611  virtual void set_next_unique_id(unique_id_type id) = 0;
612 #endif
613 
622  virtual void reserve_nodes (const dof_id_type nn) = 0;
623 
631  virtual dof_id_type n_elem () const = 0;
632 
640  virtual dof_id_type parallel_n_elem () const = 0;
641 
646  virtual dof_id_type max_elem_id () const = 0;
647 
652 #ifdef LIBMESH_ENABLE_UNIQUE_ID
653  virtual unique_id_type parallel_max_unique_id () const = 0;
654 #endif
655 
664  virtual void reserve_elem (const dof_id_type ne) = 0;
665 
670  virtual void update_parallel_id_counts () = 0;
671 
677  virtual dof_id_type n_active_elem () const = 0;
678 
682  dof_id_type n_elem_on_proc (const processor_id_type proc) const;
683 
688  { return this->n_elem_on_proc (this->processor_id()); }
689 
695 
700 
705  { return this->n_active_elem_on_proc (this->processor_id()); }
706 
716  dof_id_type n_sub_elem () const;
717 
722 
728  virtual const Point & point (const dof_id_type i) const = 0;
729 
735  virtual const Node & node_ref (const dof_id_type i) const
736  {
737  return *this->node_ptr(i);
738  }
739 
744  virtual Node & node_ref (const dof_id_type i)
745  {
746  return *this->node_ptr(i);
747  }
748 
753  virtual const Node * node_ptr (const dof_id_type i) const = 0;
754 
760  virtual Node * node_ptr (const dof_id_type i) = 0;
761 
766  virtual const Node * query_node_ptr (const dof_id_type i) const = 0;
767 
772  virtual Node * query_node_ptr (const dof_id_type i) = 0;
773 
778  virtual const Elem & elem_ref (const dof_id_type i) const
779  {
780  return *this->elem_ptr(i);
781  }
782 
788  virtual Elem & elem_ref (const dof_id_type i)
789  {
790  return *this->elem_ptr(i);
791  }
792 
797  virtual const Elem * elem_ptr (const dof_id_type i) const = 0;
798 
804  virtual Elem * elem_ptr (const dof_id_type i) = 0;
805 
810  virtual const Elem * query_elem_ptr (const dof_id_type i) const = 0;
811 
816  virtual Elem * query_elem_ptr (const dof_id_type i) = 0;
817 
828  virtual Node * add_point (const Point & p,
830  const processor_id_type proc_id =
832 
836  virtual Node * add_node (Node * n) = 0;
837 
846  virtual Node * add_node (std::unique_ptr<Node> n) = 0;
847 
851  virtual void delete_node (Node * n) = 0;
852 
859  virtual void own_node (Node &) {}
860 
866  virtual void renumber_node (dof_id_type old_id, dof_id_type new_id) = 0;
867 
877  virtual Elem * add_elem (Elem * e) = 0;
878 
887  virtual Elem * add_elem (std::unique_ptr<Elem> e) = 0;
888 
896  virtual Elem * insert_elem (Elem * e) = 0;
897 
906  virtual Elem * insert_elem (std::unique_ptr<Elem> e) = 0;
907 
918  virtual void delete_elem (Elem * e) = 0;
919 
925  virtual void renumber_elem (dof_id_type old_id, dof_id_type new_id) = 0;
926 
932  {
933  return _default_mapping_type;
934  }
935 
941  {
942  _default_mapping_type = type;
943  }
944 
949  unsigned char default_mapping_data () const
950  {
951  return _default_mapping_data;
952  }
953 
958  void set_default_mapping_data (const unsigned char data)
959  {
960  _default_mapping_data = data;
961  }
962 
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;
983 
988  void remove_orphaned_nodes ();
989 
995  virtual void renumber_nodes_and_elements () = 0;
996 
1003  virtual void fix_broken_node_and_element_numbering () = 0;
1004 
1005 
1006 #ifdef LIBMESH_ENABLE_AMR
1007 
1012  virtual bool contract () = 0;
1013 #endif
1014 
1032  unsigned int add_elem_integer(std::string name,
1033  bool allocate_data = true,
1034  dof_id_type default_value = DofObject::invalid_id);
1035 
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);
1053 
1054  /*
1055  * \returns The index number for the named extra element integer
1056  * datum, which must have already been added.
1057  */
1058  unsigned int get_elem_integer_index(std::string_view name) const;
1059 
1060  /*
1061  * \returns Whether or not the mesh has an element integer with its name.
1062  */
1063  bool has_elem_integer(std::string_view name) const;
1064 
1065  /*
1066  * \returns The name for the indexed extra element integer
1067  * datum, which must have already been added.
1068  */
1069  const std::string & get_elem_integer_name(unsigned int i) const
1070  { return _elem_integer_names[i]; }
1071 
1072  /*
1073  * \returns The number of extra element integers for which space is
1074  * being reserved on this mesh.
1075  *
1076  * If non-integer data has been associated, each datum of type T
1077  * counts for sizeof(T)/sizeof(dof_id_type) times in the return
1078  * value.
1079  */
1080  unsigned int n_elem_integers() const { return _elem_integer_names.size(); }
1081 
1107  template <typename T>
1108  unsigned int add_elem_datum(const std::string & name,
1109  bool allocate_data = true,
1110  const T * default_value = nullptr);
1111 
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);
1136 
1154  unsigned int add_node_integer(std::string name,
1155  bool allocate_data = true,
1156  dof_id_type default_value = DofObject::invalid_id);
1157 
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);
1175 
1176  /*
1177  * \returns The index number for the named extra node integer
1178  * datum, which must have already been added.
1179  */
1180  unsigned int get_node_integer_index(std::string_view name) const;
1181 
1182  /*
1183  * \returns Whether or not the mesh has a node integer with its name.
1184  */
1185  bool has_node_integer(std::string_view name) const;
1186 
1187  /*
1188  * \returns The name for the indexed extra node integer
1189  * datum, which must have already been added.
1190  */
1191  const std::string & get_node_integer_name(unsigned int i) const
1192  { return _node_integer_names[i]; }
1193 
1194  /*
1195  * \returns The number of extra node integers for which space is
1196  * being reserved on this mesh.
1197  *
1198  * If non-integer data has been associated, each datum of type T
1199  * counts for sizeof(T)/sizeof(dof_id_type) times in the return
1200  * value.
1201  */
1202  unsigned int n_node_integers() const { return _node_integer_names.size(); }
1203 
1229  template <typename T>
1230  unsigned int add_node_datum(const std::string & name,
1231  bool allocate_data = true,
1232  const T * default_value = nullptr);
1233 
1254  template <typename T>
1255  std::vector<unsigned int> add_node_data(const std::vector<std::string> & name,
1256  bool allocate_data = true,
1257  const std::vector<T> * default_values = nullptr);
1258 
1290 #ifdef LIBMESH_ENABLE_DEPRECATED
1291  void prepare_for_use (const bool skip_renumber_nodes_and_elements, const bool skip_find_neighbors);
1292  void prepare_for_use (const bool skip_renumber_nodes_and_elements);
1293 #endif // LIBMESH_ENABLE_DEPRECATED
1294  void prepare_for_use ();
1295 
1296  /*
1297  * Prepare a newly created or modified mesh for use.
1298  *
1299  * Unlike \p prepare_for_use(), \p complete_preparation() performs
1300  * *only* those preparatory steps that have been marked as
1301  * necessary in the MeshBase::Preparation state.
1302  */
1303  void complete_preparation();
1304 
1308  virtual void partition (const unsigned int n_parts);
1309 
1310  void partition ()
1311  { this->partition(this->n_processors()); }
1312 
1319  virtual void redistribute ();
1320 
1326  virtual void update_post_partitioning ();
1327 
1347 
1352  void allow_find_neighbors(bool allow) { _skip_find_neighbors = !allow; }
1353  bool allow_find_neighbors() const { return !_skip_find_neighbors; }
1354 
1361 
1370 
1379 
1402  { _skip_noncritical_partitioning = skip; }
1403 
1406 
1407 
1419  void skip_partitioning(bool skip) { _skip_all_partitioning = skip; }
1420 
1422 
1432  void add_ghosting_functor(GhostingFunctor & ghosting_functor);
1433 
1442  void add_ghosting_functor(std::shared_ptr<GhostingFunctor> ghosting_functor)
1443  { _shared_functors[ghosting_functor.get()] = ghosting_functor;
1444  this->add_ghosting_functor(*ghosting_functor); }
1445 
1450  void remove_ghosting_functor(GhostingFunctor & ghosting_functor);
1451 
1457  typedef std::vector<GhostingFunctor *>::const_iterator GhostingFunctorIterator;
1458 
1463  { return _ghosting_functors.begin(); }
1464 
1469  { return _ghosting_functors.end(); }
1470 
1475 
1488  void subdomain_ids (std::set<subdomain_id_type> & ids, const bool global = true) const;
1489 
1498 
1507 
1516  unsigned int n_partitions () const
1517  { return _n_parts; }
1518 
1535  std::string get_info (const unsigned int verbosity = 0, const bool global = true) const;
1536 
1543  void print_info (std::ostream & os=libMesh::out, const unsigned int verbosity = 0, const bool global = true) const;
1544 
1550  friend std::ostream & operator << (std::ostream & os, const MeshBase & m);
1551 
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;
1562 
1569  virtual void all_first_order () = 0;
1570 
1576 
1584  struct element_iterator;
1585  struct const_element_iterator;
1586 
1594  struct node_iterator;
1595  struct const_node_iterator;
1596 
1608  virtual void all_second_order_range(const SimpleRange<element_iterator> & range,
1609  const bool full_ordered = true) = 0;
1610 
1615  void all_second_order (const bool full_ordered = true);
1616 
1624  virtual void all_complete_order_range(const SimpleRange<element_iterator> & range) = 0;
1625 
1630  virtual void all_complete_order ();
1631 
1641  unsigned int recalculate_n_partitions();
1642 
1650  std::unique_ptr<PointLocatorBase> sub_point_locator () const;
1651 
1663 
1667  void clear_point_locator ();
1668 
1674  void set_count_lower_dim_elems_in_point_locator(bool count_lower_dim_elems);
1675 
1680 
1688  virtual void libmesh_assert_valid_parallel_ids() const {}
1689 
1694  std::string & subdomain_name(subdomain_id_type id);
1695  const std::string & subdomain_name(subdomain_id_type id) const;
1696 
1701  subdomain_id_type get_id_by_name(std::string_view name) const;
1702 
1703  /*
1704  * We have many combinations of iterators that filter on various
1705  * characteristics; we use macros to make their abstract base class
1706  * and their subclass declarations more terse.
1707  */
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;
1715 
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)}; }
1723 
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;
1731 
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)}; }
1739 
1740 #define LIBMESH_COMMA ,
1741 
1742  /*
1743  * element_iterator accessors
1744  *
1745  * The basic elements_begin() and elements_end() iterators iterate
1746  * over all elements in a mesh, returning element pointers or const
1747  * element pointers when dereferenced (depending on whether the mesh
1748  * reference was const). range-for loops can be written using
1749  * element_ptr_range()
1750  *
1751  * Filtered versions of these iterators, which skip over all
1752  * elements not matching some predicate, are also available, by
1753  * adding a prefix to the methods above. E.g. local_ (in a form
1754  * like local_elements_begin() or local_element_ptr_range()) will
1755  * iterate only over elements whose processor_id() is the current
1756  * processor, or active_ will iterate only over active elements even
1757  * if the mesh is refined, or active_local_ will iterate over
1758  * elements that are both active and local. Negation forms such as
1759  * not_local_ also exist.
1760  *
1761  * For some iterator prefixes, such as type_, an argument is needed
1762  * for the filter; e.g. the ElemType to select for in that case.
1763  *
1764  * All valid prefixes and their corresponding arguments can be found
1765  * in the macro invocations below.
1766  */
1767  ABSTRACT_ELEM_ITERATORS(,) // elements_begin(), element_ptr_range(): all elements
1768  ABSTRACT_ELEM_ITERATORS(active_,) // Elem::active() == true
1769  ABSTRACT_ELEM_ITERATORS(ancestor_,) // Elem::ancestor() == true
1770  ABSTRACT_ELEM_ITERATORS(subactive_,) // Elem::subactive() == true
1771  ABSTRACT_ELEM_ITERATORS(local_,) // Elem::processor_id() == this processor
1772  ABSTRACT_ELEM_ITERATORS(unpartitioned_,) // Elem::processor_id() == invalid_processor_id
1773  ABSTRACT_ELEM_ITERATORS(facelocal_,) // is on or has a neighbor on this processor
1774  ABSTRACT_ELEM_ITERATORS(level_,unsigned int level) // Elem::level() == level
1775  ABSTRACT_ELEM_ITERATORS(pid_,processor_id_type pid) // Elem::processor_id() == pid
1776  ABSTRACT_ELEM_ITERATORS(type_,ElemType type) // Elem::type() == type
1777 
1778  ABSTRACT_ELEM_ITERATORS(active_subdomain_,subdomain_id_type sid) // active && Elem::subdomain_id() == sid
1779  ABSTRACT_ELEM_ITERATORS(active_subdomain_set_,std::set<subdomain_id_type> ss) // active && ss.contains(Elem::subdomain_id())
1780 
1781  // Iterators which use negations of filters described above
1782  ABSTRACT_ELEM_ITERATORS(not_active_,)
1783  ABSTRACT_ELEM_ITERATORS(not_ancestor_,)
1784  ABSTRACT_ELEM_ITERATORS(not_subactive_,)
1785  ABSTRACT_ELEM_ITERATORS(not_local_,)
1786  ABSTRACT_ELEM_ITERATORS(not_level_,unsigned int level)
1787 
1788  // Iterators which combine multiple of the filters described above
1789  ABSTRACT_ELEM_ITERATORS(active_local_,)
1790  ABSTRACT_ELEM_ITERATORS(active_not_local_,)
1791  ABSTRACT_ELEM_ITERATORS(active_unpartitioned_,)
1792  ABSTRACT_ELEM_ITERATORS(active_type_,ElemType type)
1794  ABSTRACT_ELEM_ITERATORS(local_level_,unsigned int level)
1795  ABSTRACT_ELEM_ITERATORS(local_not_level_,unsigned int level)
1796  ABSTRACT_ELEM_ITERATORS(active_local_subdomain_,subdomain_id_type sid)
1797  ABSTRACT_ELEM_ITERATORS(active_local_subdomain_set_,std::set<subdomain_id_type> ss)
1798 
1799  // Backwards compatibility
1800  virtual SimpleRange<element_iterator> active_subdomain_elements_ptr_range(subdomain_id_type sid) = 0;
1801  virtual SimpleRange<const_element_iterator> active_subdomain_elements_ptr_range(subdomain_id_type sid) const = 0;
1802  virtual SimpleRange<element_iterator> active_local_subdomain_elements_ptr_range(subdomain_id_type sid) = 0;
1803  virtual SimpleRange<const_element_iterator> active_local_subdomain_elements_ptr_range(subdomain_id_type sid) const = 0;
1804  virtual SimpleRange<element_iterator> active_subdomain_set_elements_ptr_range(std::set<subdomain_id_type> ss) = 0;
1805  virtual SimpleRange<const_element_iterator> active_subdomain_set_elements_ptr_range(std::set<subdomain_id_type> ss) const = 0;
1806 
1807  // Discouraged from use - these iterators use outdated
1808  // pre-GhostingFunctor definitions and should be renamed if not
1809  // deprecated
1810  ABSTRACT_ELEM_ITERATORS(semilocal_,) // active && Elem::is_semilocal()
1811  ABSTRACT_ELEM_ITERATORS(ghost_,) // active && Elem::is_semilocal() && not local discouraged
1812  ABSTRACT_ELEM_ITERATORS(active_semilocal_,)
1813 
1814  // solution can be evaluated, with the given DoF map, for the given
1815  // variable number, or for all variables by default
1816  ABSTRACT_ELEM_ITERATORS(evaluable_,const DofMap & dof_map LIBMESH_COMMA unsigned int var_num = libMesh::invalid_uint)
1817 
1818  // solution can be evaluated for all variables of all given DoF maps
1819  ABSTRACT_ELEM_ITERATORS(multi_evaluable_,std::vector<const DofMap *> dof_maps)
1820 
1821 #ifdef LIBMESH_ENABLE_AMR
1822  ABSTRACT_ELEM_ITERATORS(flagged_,unsigned char rflag) // Elem::refinement_flag() == rflag
1823 
1824  // Elem::refinement_flag() == rflag && Elem::processor_id() == pid
1825  ABSTRACT_ELEM_ITERATORS(flagged_pid_,unsigned char rflag LIBMESH_COMMA processor_id_type pid)
1826 #endif
1827 
1828  /*
1829  * node_iterator accessors
1830  *
1831  * The basic nodes_begin() and nodes_end() iterators iterate
1832  * over all nodes in a mesh, returning node pointers or const
1833  * node pointers when dereferenced (depending on whether the mesh
1834  * reference was const). range-for loops can be written using
1835  * node_ptr_range()
1836  *
1837  * Filtered versions of these iterators, which skip over all
1838  * nodes not matching some predicate, are also available, by
1839  * adding a prefix to the methods above. E.g. local_ (in a form
1840  * like local_nodes_begin() or local_node_ptr_range()) will
1841  * iterate only over nodes whose processor_id() is the current
1842  * processor.
1843  *
1844  * All valid prefixes and their corresponding arguments can be found
1845  * in the macro invocations below.
1846  */
1847  ABSTRACT_NODE_ITERATORS(,) // nodes_begin(), node_ptr_range(): all nodes
1848  ABSTRACT_NODE_ITERATORS(active_,) // Node::active() == true; i.e. Node::id() != invalid_id
1849  ABSTRACT_NODE_ITERATORS(local_,) // Node::processor_id() == this processor
1850  ABSTRACT_NODE_ITERATORS(bnd_,) // BoundaryInfo::n_boundary_ids(node) > 0
1851  ABSTRACT_NODE_ITERATORS(pid_,processor_id_type pid) // Node::processor_id() == pid
1852  ABSTRACT_NODE_ITERATORS(bid_,boundary_id_type bid) // BoundaryInfo::has_boundary_id(node, bid)
1853 
1854  // solution can be evaluated, with the given DoF map, for the given
1855  // variable number, or for all variables by default
1856  ABSTRACT_NODE_ITERATORS(evaluable_,const DofMap & dof_map LIBMESH_COMMA unsigned int var_num = libMesh::invalid_uint)
1857 
1858  // solution can be evaluated for all variables of all given DoF maps
1859  ABSTRACT_NODE_ITERATORS(multi_evaluable_,std::vector<const DofMap *> dof_maps)
1860 
1861  // Technically these define libMesh::MeshBase::*ElemRange, but since
1862  // those don't conflict with libMesh::*ElemRange they're as good as
1863  // a real forward declaration, which we can't do here.
1866 
1874  const ElemRange & element_stored_range();
1875 
1884 
1889  void clear_stored_ranges();
1890 
1895  { return _block_id_to_name; }
1896  const std::map<subdomain_id_type, std::string> & get_subdomain_name_map () const
1897  { return _block_id_to_name; }
1898 
1899  typedef std::vector<std::pair<std::pair<const Elem *, unsigned int>, Real>> constraint_rows_mapped_type;
1900  typedef std::map<const Node *, constraint_rows_mapped_type> constraint_rows_type;
1901 
1906  { return _constraint_rows; }
1907 
1909  { return _constraint_rows; }
1910 
1912 
1916  void copy_constraint_rows(const MeshBase & other_mesh);
1917 
1945  template <typename T>
1946  void copy_constraint_rows(const SparseMatrix<T> & constraint_operator,
1947  bool precondition_constraint_operator = false);
1948 
1955  void print_constraint_rows(std::ostream & os=libMesh::out,
1956  bool print_nonlocal=false) const;
1957 
1963  std::string get_local_constraints(bool print_nonlocal=false) const;
1964 
1965 #ifdef LIBMESH_ENABLE_DEPRECATED
1966 
1973  void cache_elem_dims();
1974 #endif // LIBMESH_ENABLE_DEPRECATED
1975 
1976  /*
1977  * Search the mesh and cache data for the elements
1978  * present in the mesh. This is done in prepare_for_use(), but can
1979  * be done manually by other classes after major mesh modifications.
1980  * Data cached includes:
1981  * - elem dimensions
1982  * - elem subdomains
1983  */
1984  void cache_elem_data();
1985 
1993  void sync_subdomain_name_map();
1994 
1999  void detect_interior_parents();
2000 
2008  const MeshBase & interior_mesh() const { return *_interior_mesh; }
2009 
2014 
2018  void set_interior_mesh(MeshBase & int_mesh) { _interior_mesh = &int_mesh; }
2019 
2025  const std::set<subdomain_id_type> & get_mesh_subdomains() const
2026  { libmesh_assert(this->is_prepared()); return _mesh_subdomains; }
2027 
2028 #ifdef LIBMESH_ENABLE_PERIODIC
2029 
2033  const boundary_id_type b2,
2034  const RealVectorValue & translation);
2035 
2037 
2039 
2041  const boundary_id_type b2);
2042 #endif
2043 
2048  {
2052  Preparation();
2053 
2057  explicit operator bool() const;
2058 
2062  Preparation & operator= (bool set_all);
2063 
2068  bool operator== (const Preparation & other) const;
2069  bool operator!= (const Preparation & other) const;
2070 
2080  };
2081 
2082 protected:
2083 
2084 #ifdef LIBMESH_ENABLE_PERIODIC
2085  std::unique_ptr<PeriodicBoundaries> _disjoint_neighbor_boundary_pairs;
2087 #endif
2088 
2098  std::unique_ptr<BoundaryInfo> boundary_info;
2099 
2108  void post_dofobject_moves(MeshBase && other_mesh);
2109 
2114  void copy_cached_data (const MeshBase & other_mesh);
2115 
2120  virtual bool subclass_locally_equals (const MeshBase & other_mesh) const = 0;
2121 
2126  bool nodes_and_elements_equal(const MeshBase & other_mesh) const;
2127 
2131  unsigned int & set_n_partitions ()
2132  { return _n_parts; }
2133 
2144  unsigned int _n_parts;
2145 
2151 
2157  unsigned char _default_mapping_data;
2158 
2163 
2172  mutable std::unique_ptr<ElemRange> _element_stored_range;
2173 
2182  mutable std::unique_ptr<ConstElemRange>
2184 
2192  mutable std::unique_ptr<PointLocatorBase> _point_locator;
2193 
2199 
2206  std::unique_ptr<Partitioner> _partitioner;
2207 
2208 #ifdef LIBMESH_ENABLE_UNIQUE_ID
2209 
2213 #endif
2214 
2220 
2226 
2231 
2238 
2243 
2248 
2256 
2269 
2275  std::map<subdomain_id_type, std::string> _block_id_to_name;
2276 
2282  std::set<unsigned char> _elem_dims;
2283 
2289  std::set<Order> _elem_default_orders;
2290 
2296 
2300  std::set<subdomain_id_type> _mesh_subdomains;
2301 
2324  std::map<dof_id_type, const MeshBase::elemset_type *> _elemset_codes;
2325  std::map<MeshBase::elemset_type, dof_id_type> _elemset_codes_inverse_map;
2327 
2332  unsigned char _spatial_dimension;
2333 
2338  std::vector<std::string> _elem_integer_names;
2339 
2344  std::vector<dof_id_type> _elem_integer_default_values;
2345 
2350  std::vector<std::string> _node_integer_names;
2351 
2356  std::vector<dof_id_type> _node_integer_default_values;
2357 
2361  void size_elem_extra_integers();
2362 
2366  void size_node_extra_integers();
2367 
2374  std::pair<std::vector<unsigned int>, std::vector<unsigned int>>
2375  merge_extra_integer_names(const MeshBase & other);
2376 
2382  std::unique_ptr<GhostingFunctor> _default_ghosting;
2383 
2391  std::vector<GhostingFunctor *> _ghosting_functors;
2392 
2397  std::map<GhostingFunctor *, std::shared_ptr<GhostingFunctor> > _shared_functors;
2398 
2399  // Keep track of any constraint equations that are inherent to the
2400  // mesh, such as FE nodes whose Rational Bernstein values need to be
2401  // constrained in terms of values on spline control nodes.
2402  //
2403  // _constraint_rows[constrained_node][i].first.first is an
2404  // element (e.g. a NodeElem for a spline control node),
2405  // _constraint_rows[constrained_node][i].first.second is the
2406  // local node id of that element which is a constraining node,
2407  // _constraint_rows[constrained_node][i].second is that node's
2408  // constraint coefficient.
2410 
2416 
2421  friend class Partitioner;
2422 
2427  friend class MeshInput<MeshBase>;
2428 
2433  friend class BoundaryInfo;
2434 
2439  friend class MeshCommunication;
2440 
2441 
2446 #ifdef LIBMESH_ENABLE_DEPRECATED
2448 
2450  Elem * const,
2451  Elem * const &,
2453 
2455 
2457  Node * const,
2458  Node * const &,
2460 #else
2462  Elem * const,
2463  Elem * const &,
2464  Elem * const *,
2465  const Elem * const,
2466  const Elem * const &,
2467  const Elem * const *> elem_filter_iter;
2468 
2470  const Elem * const,
2471  const Elem * const &,
2472  const Elem * const *> const_elem_filter_iter;
2473 
2475  Node * const,
2476  Node * const &,
2477  Node * const *,
2478  const Node * const,
2479  const Node * const &,
2480  const Node * const *> node_filter_iter;
2481 
2483  const Node * const,
2484  const Node * const &,
2485  const Node * const *> const_node_filter_iter;
2486 #endif // LIBMESH_ENABLE_DEPRECATED
2487 
2488 };
2489 
2490 
2491 
2492 
2493 
2494 
2495 
2496 
2497 
2498 
2499 
2503 struct
2505 {
2506  // Templated forwarding ctor -- forwards to appropriate variant_filter_iterator ctor
2507  template <typename PredType, typename IterType>
2508  element_iterator (const IterType & d,
2509  const IterType & e,
2510  const PredType & p ) :
2511  elem_filter_iter(d,e,p) {}
2512 };
2513 
2514 
2515 
2516 
2521 struct
2523 {
2527  template <typename PredType, typename IterType>
2528  const_element_iterator (const IterType & d,
2529  const IterType & e,
2530  const PredType & p ) :
2531  const_elem_filter_iter(d,e,p) {}
2532 
2540  const_elem_filter_iter(rhs) {}
2541 };
2542 
2543 
2544 
2545 
2546 
2547 
2548 
2552 struct
2554 {
2558  template <typename PredType, typename IterType>
2559  node_iterator (const IterType & d,
2560  const IterType & e,
2561  const PredType & p ) :
2562  node_filter_iter(d,e,p) {}
2563 };
2564 
2565 
2566 
2567 
2572 struct
2574 {
2578  template <typename PredType, typename IterType>
2579  const_node_iterator (const IterType & d,
2580  const IterType & e,
2581  const PredType & p ) :
2582  const_node_filter_iter(d,e,p) {}
2583 
2591  const_node_filter_iter(rhs) {}
2592 };
2593 
2594 
2595 template <typename T>
2596 inline
2597 unsigned int MeshBase::add_elem_datum(const std::string & name,
2598  bool allocate_data,
2599  const T * default_value)
2600 {
2601  const std::size_t old_size = _elem_integer_names.size();
2602 
2603  unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
2604  std::vector<dof_id_type> int_data(n_more_integers+1, DofObject::invalid_id);
2605  if (default_value)
2606  std::memcpy(int_data.data(), default_value, sizeof(T));
2607 
2608  unsigned int start_idx = this->add_elem_integer(name, false, int_data[0]);
2609  for (unsigned int i=0; i != n_more_integers; ++i)
2610  this->add_elem_integer(name+"__"+std::to_string(i), false, int_data[i+1]);
2611 
2612  if (allocate_data && old_size != _elem_integer_names.size())
2613  this->size_elem_extra_integers();
2614 
2615  return start_idx;
2616 }
2617 
2618 
2619 template <typename T>
2620 inline
2621 std::vector<unsigned int> MeshBase::add_elem_data(const std::vector<std::string> & names,
2622  bool allocate_data,
2623  const std::vector<T> * default_values)
2624 {
2625  libmesh_assert(!default_values || default_values->size() == names.size());
2626 
2627  std::vector<unsigned int> returnval(names.size());
2628 
2629  const std::size_t old_size = _elem_integer_names.size();
2630 
2631  for (auto i : index_range(names))
2632  returnval[i] =
2633  this->add_elem_datum<T>(names[i], false,
2634  default_values ?
2635  (*default_values)[i] : nullptr);
2636 
2637  if (allocate_data && old_size != _elem_integer_names.size())
2638  this->size_elem_extra_integers();
2639 
2640  return returnval;
2641 }
2642 
2643 
2644 template <typename T>
2645 inline
2646 unsigned int MeshBase::add_node_datum(const std::string & name,
2647  bool allocate_data,
2648  const T * default_value)
2649 {
2650  const std::size_t old_size = _node_integer_names.size();
2651 
2652  unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
2653  std::vector<dof_id_type> int_data(n_more_integers+1, DofObject::invalid_id);
2654  if (default_value)
2655  std::memcpy(int_data.data(), default_value, sizeof(T));
2656 
2657  unsigned int start_idx = this->add_node_integer(name, false, int_data[0]);
2658  for (unsigned int i=0; i != n_more_integers; ++i)
2659  this->add_node_integer(name+"__"+std::to_string(i), false, int_data[i+1]);
2660 
2661  if (allocate_data && old_size != _node_integer_names.size())
2662  this->size_node_extra_integers();
2663 
2664  return start_idx;
2665 }
2666 
2667 
2668 template <typename T>
2669 inline
2670 std::vector<unsigned int> MeshBase::add_node_data(const std::vector<std::string> & names,
2671  bool allocate_data,
2672  const std::vector<T> * default_values)
2673 {
2674  libmesh_assert(!default_values || default_values->size() == names.size());
2675 
2676  std::vector<unsigned int> returnval(names.size());
2677 
2678  const std::size_t old_size = _node_integer_names.size();
2679 
2680  for (auto i : index_range(names))
2681  returnval[i] =
2682  this->add_node_datum<T>(names[i], false,
2683  default_values ?
2684  (*default_values)[i] : nullptr);
2685 
2686  if (allocate_data && old_size != _node_integer_names.size())
2687  this->size_node_extra_integers();
2688 
2689  return returnval;
2690 }
2691 
2692 
2693 
2694 } // namespace libMesh
2695 
2696 #endif // LIBMESH_MESH_BASE_H
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
GhostingFunctorIterator ghosting_functors_begin() const
Beginning of range of ghosting functors.
Definition: mesh_base.h:1462
The definition of the element_iterator struct.
Definition: mesh_base.h:2503
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...
Definition: mesh_base.C:271
variant_filter_iterator< MeshBase::Predicate, Elem * > elem_filter_iter
The original iterator classes weren&#39;t properly const-safe; relying on their const-incorrectness is no...
Definition: mesh_base.h:2447
std::set< subdomain_id_type > _mesh_subdomains
We cache the subdomain ids of the elements present in the mesh.
Definition: mesh_base.h:2300
bool has_node_integer(std::string_view name) const
Definition: mesh_base.C:790
virtual void update_post_partitioning()
Recalculate any cached data (or invalidate any caches that are computed on the fly) after elements an...
Definition: mesh_base.C:1173
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.
Definition: mesh_base.C:646
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...
Definition: simple_range.h:36
bool operator!=(const MeshBase &other_mesh) const
Definition: mesh_base.h:138
const std::set< Order > & elem_default_orders() const
Definition: mesh_base.h:427
std::unique_ptr< ElemRange > _element_stored_range
A cached ElemRange for threaded mutation of all semilocal elements of this mesh.
Definition: mesh_base.h:2172
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...
Definition: mesh_base.h:2268
bool _skip_renumber_nodes_and_elements
If this is true then renumbering will be kept to a minimum.
Definition: mesh_base.h:2237
bool is_prepared() const
Definition: mesh_base.C:1057
Order
defines an enum for polynomial orders.
Definition: enum_order.h:40
static constexpr processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
Definition: dof_object.h:484
constraint_rows_type & get_constraint_rows()
Constraint rows accessors.
Definition: mesh_base.h:1905
virtual dof_id_type n_active_elem() const =0
A Node is like a Point, but with more information.
Definition: node.h:52
This abstract base class defines the interface by which library code and user code can report associa...
const MeshBase & interior_mesh() const
Definition: mesh_base.h:2008
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
Definition: mesh_base.C:2314
dof_id_type n_elem_on_proc(const processor_id_type proc) const
Definition: mesh_base.C:1222
virtual unique_id_type parallel_max_unique_id() const =0
dof_id_type n_unpartitioned_nodes() const
Definition: mesh_base.h:587
void set_interior_mesh(MeshBase &int_mesh)
Sets the interior mesh.
Definition: mesh_base.h:2018
variant_filter_iterator< MeshBase::Predicate, Node * > node_filter_iter
Definition: mesh_base.h:2454
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:303
std::vector< std::string > _elem_integer_names
The array of names for integer data associated with each element in the mesh.
Definition: mesh_base.h:2338
std::unique_ptr< PointLocatorBase > sub_point_locator() const
Definition: mesh_base.C:1826
unsigned int n_node_integers() const
Definition: mesh_base.h:1202
void remove_orphaned_nodes()
Removes any orphaned nodes, nodes not connected to any elements.
Definition: mesh_base.C:801
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&#39;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.
Definition: mesh_base.C:503
BoundaryInfo & get_boundary_info()
Writable information about boundary ids on the mesh.
Definition: mesh_base.h:175
virtual void all_second_order_range(const SimpleRange< element_iterator > &range, const bool full_ordered=true)=0
Converts a set of this Mesh&#39;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...
Definition: mesh_base.h:1345
void add_ghosting_functor(std::shared_ptr< GhostingFunctor > ghosting_functor)
Adds a functor which can specify ghosting requirements for use on distributed meshes.
Definition: mesh_base.h:1442
void detect_interior_parents()
Search the mesh for elements that have a neighboring element of dim+1 and set that element as the int...
Definition: mesh_base.C:2049
void skip_partitioning(bool skip)
If true is passed in then nothing on this mesh will be (re)partitioned.
Definition: mesh_base.h:1419
dof_id_type n_active_elem_on_proc(const processor_id_type proc) const
Definition: mesh_base.C:1235
The definition of the const_element_iterator struct.
Definition: mesh_base.h:2521
unsigned int dim
MeshBase * _interior_mesh
Defaulting to this, a pointer to the mesh used to generate boundary elements on this.
Definition: mesh_base.h:2219
std::vector< std::pair< std::pair< const Elem *, unsigned int >, Real > > constraint_rows_mapped_type
Definition: mesh_base.h:1899
We&#39;re using a class instead of a typedef to allow forward declarations and future flexibility...
subdomain_id_type n_local_subdomains() const
Definition: mesh_base.C:1197
variant_filter_iterator< MeshBase::Predicate, const Elem *const, const Elem *const &, const Elem *const * > const_elem_filter_iter
Definition: mesh_base.h:2472
void copy_cached_data(const MeshBase &other_mesh)
Helper class to copy cached data, to synchronize with a possibly unprepared other_mesh.
Definition: mesh_base.C:2391
bool allow_detect_interior_parents() const
Definition: mesh_base.h:1360
Predicates::multi_predicate Predicate
We need an empty, generic class to act as a predicate for this and derived mesh classes.
Definition: mesh_base.h:1575
virtual void allgather()
Gathers all elements and nodes of the mesh onto every processor.
Definition: mesh_base.h:376
void set_spatial_dimension(unsigned char d)
Sets the "spatial dimension" of the Mesh.
Definition: mesh_base.C:613
void set_isnt_prepared()
Tells this we have done some operation where we should no longer consider ourself prepared...
Definition: mesh_base.h:228
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)...
Definition: mesh_base.h:2324
bool operator==(const Preparation &other) const
Two Preparation objects are equivalent iff all the flags match, regardless of the true/false status o...
Definition: mesh_base.C:2845
Preparation & operator=(bool set_all)
Set all flags to the "set_all" value.
Definition: mesh_base.C:2829
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.
Definition: mesh_base.h:2391
bool skip_noncritical_partitioning() const
Definition: mesh_base.h:1404
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...
Definition: mesh_base.C:623
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...
Definition: mesh_base.C:456
bool has_elem_integer(std::string_view name) const
Definition: mesh_base.C:701
bool get_count_lower_dim_elems_in_point_locator() const
Get the current value of _count_lower_dim_elems_in_point_locator.
Definition: mesh_base.C:1873
void remove_ghosting_functor(GhostingFunctor &ghosting_functor)
Removes a functor which was previously added to the set of ghosting functors.
Definition: mesh_base.C:1093
unsigned int n_elem_integers() const
Definition: mesh_base.h:1080
This is the base class from which all geometric element types are derived.
Definition: elem.h:94
dof_id_type n_local_nodes() const
Definition: mesh_base.h:581
virtual std::unique_ptr< Partitioner > & partitioner()
A partitioner to use at each partitioning.
Definition: mesh_base.h:165
constraint_rows_type _constraint_rows
Definition: mesh_base.h:2409
virtual void gather_to_zero()
Gathers all elements and nodes of the mesh onto processor zero.
Definition: mesh_base.h:382
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.
Definition: mesh_base.h:1401
void copy_constraint_rows(const MeshBase &other_mesh)
Copy the constraints from the other mesh to this mesh.
Definition: mesh_base.C:2450
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. ...
Definition: mesh_base.C:735
virtual Elem & elem_ref(const dof_id_type i)
Definition: mesh_base.h:788
const_element_iterator(const IterType &d, const IterType &e, const PredType &p)
Templated forwarding ctor – forwards to appropriate variant_filter_iterator ctor.
Definition: mesh_base.h:2528
bool _skip_noncritical_partitioning
If this is true then no partitioning should be done with the possible exception of orphaned nodes...
Definition: mesh_base.h:2225
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.
Definition: mesh_base.h:2670
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.
Definition: mesh_base.h:2332
virtual void own_node(Node &)
Takes ownership of node n on this partition of a distributed mesh, by setting n.processor_id() to thi...
Definition: mesh_base.h:859
std::unique_ptr< BoundaryInfo > boundary_info
This class holds the boundary information.
Definition: mesh_base.h:2098
The StoredRange class defines a contiguous, divisible set of objects.
Definition: stored_range.h:54
GhostingFunctorIterator ghosting_functors_end() const
End of range of ghosting functors.
Definition: mesh_base.h:1468
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
Definition: mesh_base.h:600
bool _allow_remote_element_removal
If this is false then even on DistributedMesh remote elements will not be deleted during mesh prepara...
Definition: mesh_base.h:2255
The libMesh namespace provides an interface to certain functionality in the library.
std::map< MeshBase::elemset_type, dof_id_type > _elemset_codes_inverse_map
Definition: mesh_base.h:2325
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
Definition: mesh_base.C:497
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 ...
Definition: mesh_base.h:1359
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
Definition: mesh_base.h:170
dof_id_type n_unpartitioned_elem() const
Definition: mesh_base.h:693
std::vector< std::string > _node_integer_names
The array of names for integer data associated with each node in the mesh.
Definition: mesh_base.h:2350
virtual std::unique_ptr< MeshBase > clone() const =0
Virtual "copy constructor".
Preparation preparation() const
Definition: mesh_base.h:213
virtual Node & node_ref(const dof_id_type i)
Definition: mesh_base.h:744
void clear_stored_ranges()
Clears stored ranges, to indicate that the mesh has changed and they should be regenerated when next ...
Definition: mesh_base.C:1943
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
Definition: mesh_base.h:687
MeshBase::elemset_type _all_elemset_ids
Definition: mesh_base.h:2326
dof_id_type n_constraint_rows() const
Definition: mesh_base.C:2431
const std::string & get_elem_integer_name(unsigned int i) const
Definition: mesh_base.h:1069
void unset_has_cached_elem_data()
Tells this we have done some operation (e.g.
Definition: mesh_base.h:281
bool nodes_and_elements_equal(const MeshBase &other_mesh) const
Tests for equality of all elements and nodes in the mesh.
Definition: mesh_base.C:2401
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
Definition: id_types.h:104
This is the MeshBase class.
Definition: mesh_base.h:80
void unset_has_interior_parent_ptrs()
Tells this we have done some operation (e.g.
Definition: mesh_base.h:293
The Partitioner class provides a uniform interface for partitioning algorithms.
Definition: partitioner.h:51
ElemMappingType default_mapping_type() const
Returns the default master space to physical space mapping basis functions to be used on newly added ...
Definition: mesh_base.h:931
subdomain_id_type get_id_by_name(std::string_view name) const
Definition: mesh_base.C:1900
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.
Definition: mesh_base.C:487
virtual bool is_serial_on_zero() const
Definition: mesh_base.h:354
void change_elemset_code(dof_id_type old_code, dof_id_type new_code)
Replace elemset code "old_code" with "new_code".
Definition: mesh_base.C:512
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...
Definition: mesh_base.h:362
node_iterator(const IterType &d, const IterType &e, const PredType &p)
Templated forwarding ctor – forwards to appropriate variant_filter_iterator ctor.
Definition: mesh_base.h:2559
Generic sparse matrix.
Definition: vector_fe_ex5.C:46
This class handles the numbering of degrees of freedom on a mesh.
Definition: dof_map.h:179
Order supported_nodal_order() const
Definition: mesh_base.h:435
unique_id_type _next_unique_id
The next available unique id for assigning ids to DOF objects.
Definition: mesh_base.h:2212
unsigned int _n_parts
The number of partitions the mesh has.
Definition: mesh_base.h:2144
dof_id_type n_active_local_elem() const
Definition: mesh_base.h:704
unsigned int get_elem_integer_index(std::string_view name) const
Definition: mesh_base.C:689
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 ...
Definition: mesh_base.h:1368
processor_id_type n_processors() const
virtual bool is_serial() const
Definition: mesh_base.h:347
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.
Definition: mesh_base.C:2232
unsigned char _default_mapping_data
The default mapping data (unused with Lagrange, used for nodal weight lookup index with rational base...
Definition: mesh_base.h:2157
int8_t boundary_id_type
Definition: id_types.h:51
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.
Definition: mesh_base.h:270
This is the MeshCommunication class.
const std::map< subdomain_id_type, std::string > & get_subdomain_name_map() const
Definition: mesh_base.h:1896
static constexpr dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:473
This class defines an abstract interface for Mesh input.
Definition: mesh_base.h:60
const ElemRange & element_stored_range()
Definition: mesh_base.C:1913
dof_id_type n_sub_elem() const
Definition: mesh_base.C:1244
unsigned char default_mapping_data() const
Returns any default data value used by the master space to physical space mapping.
Definition: mesh_base.h:949
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...
Definition: mesh_base.h:2150
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()
Definition: mesh_base.C:2256
void print_info(std::ostream &os=libMesh::out, const unsigned int verbosity=0, const bool global=true) const
Prints relevant information about the mesh.
Definition: mesh_base.C:1748
void cache_elem_data()
Definition: mesh_base.C:1959
std::unique_ptr< Partitioner > _partitioner
A partitioner to use at each prepare_for_use().
Definition: mesh_base.h:2206
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...
Definition: mesh_base.h:940
virtual dof_id_type max_elem_id() const =0
void clear_point_locator()
Releases the current PointLocator object.
Definition: mesh_base.C:1859
variant_filter_iterator< MeshBase::Predicate, Elem *const, Elem *const &, Elem *const * > const_elem_filter_iter
Definition: mesh_base.h:2452
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).
Definition: mesh_base.C:1119
std::set< Order > _elem_default_orders
We cache the (default) order of the geometric elements present in the mesh.
Definition: mesh_base.h:2289
bool allow_find_neighbors() const
Definition: mesh_base.h:1353
The BoundaryInfo class contains information relevant to boundary conditions including storing faces...
Definition: boundary_info.h:57
libmesh_assert(ctx)
bool _skip_find_neighbors
If this is true then we will skip find_neighbors in prepare_for_use.
Definition: mesh_base.h:2242
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.
Definition: mesh_base.C:2345
const ConstElemRange & active_local_element_stored_range() const
Definition: mesh_base.C:1928
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.
Definition: mesh_base.C:482
Order _supported_nodal_order
We cache the maximum nodal order supported by all the mesh&#39;s elements (the minimum supported_nodal_or...
Definition: mesh_base.h:2295
std::set< unsigned char > _elem_dims
We cache the dimension of the elements present in the mesh.
Definition: mesh_base.h:2282
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...
Definition: mesh_base.h:1377
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.
Definition: mesh_base.h:2597
unsigned int get_node_integer_index(std::string_view name) const
Definition: mesh_base.C:778
std::string & subdomain_name(subdomain_id_type id)
Definition: mesh_base.C:1880
void unset_has_removed_remote_elements()
Tells this we have done some operation (e.g.
Definition: mesh_base.h:307
const std::set< unsigned char > & elem_dimensions() const
Definition: mesh_base.h:420
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...
Definition: mesh_base.h:1352
void set_mesh_dimension(unsigned char d)
Resets the logical dimension of the mesh.
Definition: mesh_base.h:413
dof_id_type n_nodes_on_proc(const processor_id_type proc) const
Definition: mesh_base.C:1209
variant_filter_iterator< MeshBase::Predicate, const Node *const, const Node *const &, const Node *const * > const_node_filter_iter
Definition: mesh_base.h:2485
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.
Definition: mesh_base.C:2771
bool allow_node_and_elem_unique_id_overlap() const
Definition: mesh_base.h:1378
void unset_is_partitioned()
Tells this we have done some operation creating unpartitioned elements.
Definition: mesh_base.h:246
std::map< subdomain_id_type, std::string > & set_subdomain_name_map()
Definition: mesh_base.h:1894
bool allow_remote_element_removal() const
Definition: mesh_base.h:1369
void size_node_extra_integers()
Size extra-integer arrays of all nodes in the mesh.
Definition: mesh_base.C:2336
An object whose state is distributed along a set of processors.
void prepare_for_use()
Definition: mesh_base.C:860
virtual dof_id_type parallel_n_elem() const =0
virtual void clear()
Deletes all the element and node data that is currently stored.
Definition: mesh_base.C:1029
variant_filter_iterator< MeshBase::Predicate, Node *const, Node *const &, Node *const * > const_node_filter_iter
Definition: mesh_base.h:2459
Flags indicating in what ways a mesh has been prepared for use.
Definition: mesh_base.h:2047
std::unique_ptr< PeriodicBoundaries > _disjoint_neighbor_boundary_pairs
The disjoint neighbor boundary id pairs.
Definition: mesh_base.h:2086
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...
Definition: mesh_base.C:1755
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.
Definition: mesh_base.h:2646
const DofMap &dof_map LIBMESH_COMMA unsigned int var_num
Definition: mesh_base.h:1816
virtual void write(const std::string &name) const =0
const std::set< subdomain_id_type > & get_mesh_subdomains() const
Definition: mesh_base.h:2025
bool skip_partitioning() const
Definition: mesh_base.h:1421
std::map< GhostingFunctor *, std::shared_ptr< GhostingFunctor > > _shared_functors
Hang on to references to any GhostingFunctor objects we were passed in shared_ptr form...
Definition: mesh_base.h:2397
void complete_preparation()
Definition: mesh_base.C:874
unsigned int n_partitions() const
Definition: mesh_base.h:1516
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.
Definition: mesh_base.h:2552
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.
Definition: mesh_base.h:2579
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...
Definition: mesh_base.h:2356
Preparation _preparation
Flags indicating in what ways this mesh has been prepared.
Definition: mesh_base.h:2162
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.
Definition: mesh_base.h:2621
unsigned int recalculate_n_partitions()
In a few (very rare) cases, the user may have manually tagged the elements with specific processor ID...
Definition: mesh_base.C:1806
std::set< elemset_id_type > elemset_type
Typedef for the "set" container used to store elemset ids.
Definition: mesh_base.h:456
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...
Definition: mesh_base.h:2344
subdomain_id_type n_subdomains() const
Definition: mesh_base.C:1183
std::string get_info(const unsigned int verbosity=0, const bool global=true) const
Definition: mesh_base.C:1268
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.
Definition: mesh_base.h:2247
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.
Definition: mesh_base.C:2356
virtual void all_complete_order()
Calls the range-based version of this function with a range consisting of all elements in the mesh...
Definition: mesh_base.C:1801
unsigned int spatial_dimension() const
Definition: mesh_base.C:606
element_iterator(const IterType &d, const IterType &e, const PredType &p)
Definition: mesh_base.h:2508
std::map< const Node *, constraint_rows_mapped_type > constraint_rows_type
Definition: mesh_base.h:1900
OStreamProxy out
void print_constraint_rows(std::ostream &os=libMesh::out, bool print_nonlocal=false) const
Prints (from processor 0) all mesh constraint rows.
Definition: mesh_base.C:2743
virtual bool is_replicated() const
Definition: mesh_base.h:369
virtual const Elem & elem_ref(const dof_id_type i) const
Definition: mesh_base.h:778
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...
Definition: mesh_base.C:1866
The definition of the const_node_iterator struct.
Definition: mesh_base.h:2572
MeshBase(const Parallel::Communicator &comm_in, unsigned char dim=1)
Constructor.
Definition: mesh_base.C:64
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...
Definition: mesh_base.C:1796
dof_id_type n_active_sub_elem() const
Same as n_sub_elem(), but only counts active elements.
Definition: mesh_base.C:1256
virtual ~MeshBase()
Destructor.
Definition: mesh_base.C:421
std::vector< GhostingFunctor * >::const_iterator GhostingFunctorIterator
Iterator type for ghosting functor ranges.
Definition: mesh_base.h:1457
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...
Definition: mesh_base.C:439
unsigned int mesh_dimension() const
Definition: mesh_base.C:430
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...
Definition: mesh_base.h:2382
void change_elemset_id(elemset_id_type old_id, elemset_id_type new_id)
Replace elemset id "old_id" with "new_id".
Definition: mesh_base.C:565
void unset_has_boundary_id_sets()
Tells this we have done some operation which may have invalidated our cached boundary id sets...
Definition: mesh_base.h:340
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.
Definition: mesh_base.C:712
variant_filter_iterator< MeshBase::Predicate, Elem *const, Elem *const &, Elem *const *, const Elem *const, const Elem *const &, const Elem *const * > elem_filter_iter
Definition: mesh_base.h:2467
virtual SimpleRange< element_iterator > active_subdomain_set_elements_ptr_range(std::set< subdomain_id_type > ss)=0
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...
Definition: mesh_base.h:958
void sync_subdomain_name_map()
libMesh often expects all processors to know about names of all subdomain ids, but distributed mesh g...
Definition: mesh_base.C:2040
const std::string & get_node_integer_name(unsigned int i) const
Definition: mesh_base.h:1191
virtual void libmesh_assert_valid_parallel_ids() const
Verify id and processor_id consistency of our elements and nodes containers.
Definition: mesh_base.h:1688
std::unique_ptr< ConstElemRange > _const_active_local_element_stored_range
A cached ConstElemRange for threaded calculation on all local elements of this mesh.
Definition: mesh_base.h:2183
virtual const Node & node_ref(const dof_id_type i) const
Definition: mesh_base.h:735
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.
Definition: mesh_base.h:330
bool _skip_all_partitioning
If this is true then no partitioning should be done.
Definition: mesh_base.h:2230
const_node_iterator(const MeshBase::node_iterator &rhs)
The conversion-to-const ctor.
Definition: mesh_base.h:2590
bool allow_renumbering() const
Definition: mesh_base.h:1346
const constraint_rows_type & get_constraint_rows() const
Definition: mesh_base.h:1908
void cache_elem_dims()
Definition: mesh_base.C:1951
virtual void delete_remote_elements()
When supported, deletes all nonlocal elements of the mesh except for "ghosts" which touch a local ele...
Definition: mesh_base.h:389
MeshBase & interior_mesh()
Definition: mesh_base.h:2013
const_element_iterator(const MeshBase::element_iterator &rhs)
The conversion-to-const ctor.
Definition: mesh_base.h:2539
virtual dof_id_type max_node_id() const =0
void remove_disjoint_boundary_pair(const boundary_id_type b1, const boundary_id_type b2)
Definition: mesh_base.C:2266
void reinit_ghosting_functors()
Loops over ghosting functors and calls mesh_reinit()
Definition: mesh_base.C:1018
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.
Definition: mesh_base.h:2192
bool operator!=(const Preparation &other) const
Definition: mesh_base.C:2870
virtual void redistribute()
Redistribute elements between processors.
Definition: mesh_base.C:1161
Real _point_locator_close_to_point_tol
If nonzero, we will call PointLocatorBase::set_close_to_point_tol() on any PointLocators that we crea...
Definition: mesh_base.h:2415
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...
Definition: mesh_base.h:2198
GhostingFunctor & default_ghosting()
Default ghosting functor.
Definition: mesh_base.h:1474
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
virtual void reserve_elem(const dof_id_type ne)=0
Reserves space for a known number of elements.
uint8_t unique_id_type
Definition: id_types.h:86
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...
Definition: mesh_base.C:281
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...
Definition: mesh_base.h:2275
void unset_is_prepared()
Tells this we have done some operation where we should no longer consider ourself prepared...
Definition: mesh_base.C:1063
unsigned int & set_n_partitions()
Definition: mesh_base.h:2131
void ErrorVector unsigned int
Definition: adjoints_ex3.C:360
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:153
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.
Definition: mesh_base.h:257
variant_filter_iterator< MeshBase::Predicate, Node *const, Node *const &, Node *const *, const Node *const, const Node *const &, const Node *const * > node_filter_iter
Definition: mesh_base.h:2480
void size_elem_extra_integers()
Size extra-integer arrays of all elements in the mesh.
Definition: mesh_base.C:2321
void add_ghosting_functor(GhostingFunctor &ghosting_functor)
Adds a functor which can specify ghosting requirements for use on distributed meshes.
Definition: mesh_base.C:1071
uint8_t dof_id_type
Definition: id_types.h:67
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.
Definition: mesh_base.h:318
void set_point_locator_close_to_point_tol(Real val)
Set value used by PointLocatorBase::close_to_point_tol().
Definition: mesh_base.C:2300