libMesh
mesh_base.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 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/auto_ptr.h" // deprecated
25 #include "libmesh/boundary_info.h"
26 #include "libmesh/dof_object.h" // for invalid_processor_id
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 #ifdef LIBMESH_FORWARD_DECLARE_ENUMS
35 namespace libMesh
36 {
37 enum ElemType : int;
38 }
39 #else
40 #include "libmesh/enum_elem_type.h"
41 #endif
42 
43 // C++ Includes
44 #include <cstddef>
45 #include <string>
46 #include <memory>
47 
48 namespace libMesh
49 {
50 
51 // forward declarations
52 class Elem;
53 class GhostingFunctor;
54 class Node;
55 class Point;
56 class Partitioner;
57 
58 template <class MT>
59 class MeshInput;
60 
61 
77 class MeshBase : public ParallelObject
78 {
79 public:
80 
86  MeshBase (const Parallel::Communicator & comm_in,
87  unsigned char dim=1);
88 
92  MeshBase (const MeshBase & other_mesh);
93 
98  MeshBase(MeshBase &&);
99 
110  MeshBase & operator= (const MeshBase &) = delete;
111  MeshBase & operator= (MeshBase &&) = delete;
112 
116  virtual std::unique_ptr<MeshBase> clone() const = 0;
117 
121  virtual ~MeshBase ();
122 
126  virtual std::unique_ptr<Partitioner> & partitioner() { return _partitioner; }
127 
131  const BoundaryInfo & get_boundary_info() const { return *boundary_info; }
132 
137 
145  virtual void clear ();
146 
151  bool is_prepared () const
152  { return _is_prepared; }
153 
158  virtual bool is_serial () const
159  { return true; }
160 
165  virtual bool is_serial_on_zero () const
166  { return true; }
167 
173  virtual void set_distributed ()
174  { libmesh_error(); }
175 
180  virtual bool is_replicated () const
181  { return true; }
182 
187  virtual void allgather () {}
188 
193  virtual void gather_to_zero() {}
194 
200  virtual void delete_remote_elements () {}
201 
208  unsigned int mesh_dimension () const;
209 
217  void set_mesh_dimension (unsigned char d)
218  { _elem_dims.clear(); _elem_dims.insert(d); }
219 
224  const std::set<unsigned char> & elem_dimensions() const
225  { return _elem_dims; }
226 
252  unsigned int spatial_dimension () const;
253 
258  void set_spatial_dimension(unsigned char d);
259 
269  virtual dof_id_type n_nodes () const = 0;
270 
280  virtual dof_id_type parallel_n_nodes () const = 0;
281 
285  dof_id_type n_nodes_on_proc (const processor_id_type proc) const;
286 
291  { return this->n_nodes_on_proc (this->processor_id()); }
292 
298 
303  virtual dof_id_type max_node_id () const = 0;
304 
305 #ifdef LIBMESH_ENABLE_UNIQUE_ID
306 
310 
315 #endif
316 
325  virtual void reserve_nodes (const dof_id_type nn) = 0;
326 
334  virtual dof_id_type n_elem () const = 0;
335 
343  virtual dof_id_type parallel_n_elem () const = 0;
344 
349  virtual dof_id_type max_elem_id () const = 0;
350 
355 #ifdef LIBMESH_ENABLE_UNIQUE_ID
356  virtual unique_id_type parallel_max_unique_id () const = 0;
357 #endif
358 
367  virtual void reserve_elem (const dof_id_type ne) = 0;
368 
373  virtual void update_parallel_id_counts () = 0;
374 
380  virtual dof_id_type n_active_elem () const = 0;
381 
385  dof_id_type n_elem_on_proc (const processor_id_type proc) const;
386 
391  { return this->n_elem_on_proc (this->processor_id()); }
392 
398 
403 
408  { return this->n_active_elem_on_proc (this->processor_id()); }
409 
419  dof_id_type n_sub_elem () const;
420 
425 
431  virtual const Point & point (const dof_id_type i) const = 0;
432 
438  virtual const Node & node_ref (const dof_id_type i) const {
439  return *this->node_ptr(i);
440  }
441 
446  virtual Node & node_ref (const dof_id_type i) {
447  return *this->node_ptr(i);
448  }
449 
457 #ifdef LIBMESH_ENABLE_DEPRECATED
458  virtual const Node & node (const dof_id_type i) const
459  {
460  libmesh_deprecated();
461  return *this->node_ptr(i);
462  }
463 #endif
464 
471 #ifdef LIBMESH_ENABLE_DEPRECATED
472  virtual Node & node (const dof_id_type i)
473  {
474  libmesh_deprecated();
475  return *this->node_ptr(i);
476  }
477 #endif
478 
483  virtual const Node * node_ptr (const dof_id_type i) const = 0;
484 
490  virtual Node * node_ptr (const dof_id_type i) = 0;
491 
496  virtual const Node * query_node_ptr (const dof_id_type i) const = 0;
497 
502  virtual Node * query_node_ptr (const dof_id_type i) = 0;
503 
508  virtual const Elem & elem_ref (const dof_id_type i) const {
509  return *this->elem_ptr(i);
510  }
511 
517  virtual Elem & elem_ref (const dof_id_type i) {
518  return *this->elem_ptr(i);
519  }
520 
525  virtual const Elem * elem_ptr (const dof_id_type i) const = 0;
526 
532  virtual Elem * elem_ptr (const dof_id_type i) = 0;
533 
540 #ifdef LIBMESH_ENABLE_DEPRECATED
541  virtual const Elem * elem (const dof_id_type i) const
542  {
543  libmesh_deprecated();
544  return this->elem_ptr(i);
545  }
546 #endif
547 
555 #ifdef LIBMESH_ENABLE_DEPRECATED
556  virtual Elem * elem (const dof_id_type i)
557  {
558  libmesh_deprecated();
559  return this->elem_ptr(i);
560  }
561 #endif
562 
567  virtual const Elem * query_elem_ptr (const dof_id_type i) const = 0;
568 
573  virtual Elem * query_elem_ptr (const dof_id_type i) = 0;
574 
581 #ifdef LIBMESH_ENABLE_DEPRECATED
582  virtual const Elem * query_elem (const dof_id_type i) const
583  {
584  libmesh_deprecated();
585  return this->query_elem_ptr(i);
586  }
587 #endif
588 
595 #ifdef LIBMESH_ENABLE_DEPRECATED
596  virtual Elem * query_elem (const dof_id_type i)
597  {
598  libmesh_deprecated();
599  return this->query_elem_ptr(i);
600  }
601 #endif
602 
613  virtual Node * add_point (const Point & p,
615  const processor_id_type proc_id =
617 
621  virtual Node * add_node (Node * n) = 0;
622 
630  virtual Node * insert_node(Node * n) = 0;
631 
635  virtual void delete_node (Node * n) = 0;
636 
643  virtual void own_node (Node &) {}
644 
650  virtual void renumber_node (dof_id_type old_id, dof_id_type new_id) = 0;
651 
661  virtual Elem * add_elem (Elem * e) = 0;
662 
670  virtual Elem * insert_elem (Elem * e) = 0;
671 
682  virtual void delete_elem (Elem * e) = 0;
683 
689  virtual void renumber_elem (dof_id_type old_id, dof_id_type new_id) = 0;
690 
703  virtual void find_neighbors (const bool reset_remote_elements = false,
704  const bool reset_current_list = true) = 0;
705 
711  virtual void renumber_nodes_and_elements () = 0;
712 
719  virtual void fix_broken_node_and_element_numbering () = 0;
720 
721 
722 #ifdef LIBMESH_ENABLE_AMR
723 
728  virtual bool contract () = 0;
729 #endif
730 
738  unsigned int add_elem_integer(const std::string & name);
739 
740  /*
741  * \returns The index number for the named extra element integer
742  * datum, which must have already been added.
743  */
744  unsigned int get_elem_integer_index(const std::string & name) const;
745 
746  /*
747  * \returns The name for the indexed extra element integer
748  * datum, which must have already been added.
749  */
750  const std::string & get_elem_integer_name(unsigned int i) const
751  { return _elem_integer_names[i]; }
752 
753  /*
754  * \returns The number of extra element integers for which space is
755  * being reserved on this mesh.
756  */
757  unsigned int n_elem_integers() const { return _elem_integer_names.size(); }
758 
766  unsigned int add_node_integer(const std::string & name);
767 
768  /*
769  * \returns The index number for the named extra node integer
770  * datum, which must have already been added.
771  */
772  unsigned int get_node_integer_index(const std::string & name) const;
773 
774  /*
775  * \returns The name for the indexed extra node integer
776  * datum, which must have already been added.
777  */
778  const std::string & get_node_integer_name(unsigned int i) const
779  { return _node_integer_names[i]; }
780 
781  /*
782  * \returns The number of extra node integers for which space is
783  * being reserved on this mesh.
784  */
785  unsigned int n_node_integers() const { return _node_integer_names.size(); }
786 
802  void prepare_for_use (const bool skip_renumber_nodes_and_elements=false, const bool skip_find_neighbors=false);
803 
807  virtual void partition (const unsigned int n_parts);
808 
809  void partition ()
810  { this->partition(this->n_processors()); }
811 
817  virtual void redistribute () {}
818 
823  virtual void update_post_partitioning () {}
824 
844 
853 
877 
880 
881 
893  void skip_partitioning(bool skip) { _skip_all_partitioning = skip; }
894 
895  bool skip_partitioning() const { return _skip_all_partitioning; }
896 
906  void add_ghosting_functor(GhostingFunctor & ghosting_functor)
907  { _ghosting_functors.insert(&ghosting_functor); }
908 
917  void add_ghosting_functor(std::shared_ptr<GhostingFunctor> ghosting_functor)
918  { _shared_functors[ghosting_functor.get()] = ghosting_functor;
919  this->add_ghosting_functor(*ghosting_functor); }
920 
925  void remove_ghosting_functor(GhostingFunctor & ghosting_functor);
926 
930  std::set<GhostingFunctor *>::const_iterator ghosting_functors_begin() const
931  { return _ghosting_functors.begin(); }
932 
936  std::set<GhostingFunctor *>::const_iterator ghosting_functors_end() const
937  { return _ghosting_functors.end(); }
938 
943 
951  void subdomain_ids (std::set<subdomain_id_type> & ids) const;
952 
961 
970  unsigned int n_partitions () const
971  { return _n_parts; }
972 
977  std::string get_info () const;
978 
982  void print_info (std::ostream & os=libMesh::out) const;
983 
989  friend std::ostream & operator << (std::ostream & os, const MeshBase & m);
990 
995  virtual void read (const std::string & name,
996  void * mesh_data=nullptr,
997  bool skip_renumber_nodes_and_elements=false,
998  bool skip_find_neighbors=false) = 0;
999  virtual void write (const std::string & name) = 0;
1000 
1007  virtual void all_first_order () = 0;
1008 
1020  virtual void all_second_order (const bool full_ordered=true) = 0;
1021 
1027 
1035  struct element_iterator;
1036  struct const_element_iterator;
1037 
1045  struct node_iterator;
1046  struct const_node_iterator;
1047 
1057  unsigned int recalculate_n_partitions();
1058 
1065 #ifdef LIBMESH_ENABLE_DEPRECATED
1066  const PointLocatorBase & point_locator () const;
1067 #endif
1068 
1076  std::unique_ptr<PointLocatorBase> sub_point_locator () const;
1077 
1089 
1093  void clear_point_locator ();
1094 
1100  void set_count_lower_dim_elems_in_point_locator(bool count_lower_dim_elems);
1101 
1106 
1114  virtual void libmesh_assert_valid_parallel_ids() const {}
1115 
1120  std::string & subdomain_name(subdomain_id_type id);
1121  const std::string & subdomain_name(subdomain_id_type id) const;
1122 
1127  subdomain_id_type get_id_by_name(const std::string & name) const;
1128 
1129  //
1130  // element_iterator accessors
1131  //
1132 
1136  virtual element_iterator elements_begin () = 0;
1137  virtual element_iterator elements_end () = 0;
1138  virtual const_element_iterator elements_begin () const = 0;
1139  virtual const_element_iterator elements_end () const = 0;
1142 
1146  virtual element_iterator ancestor_elements_begin () = 0;
1147  virtual element_iterator ancestor_elements_end () = 0;
1148  virtual const_element_iterator ancestor_elements_begin () const = 0;
1149  virtual const_element_iterator ancestor_elements_end () const = 0;
1150 
1154  virtual element_iterator subactive_elements_begin () = 0;
1155  virtual element_iterator subactive_elements_end () = 0;
1156  virtual const_element_iterator subactive_elements_begin () const = 0;
1157  virtual const_element_iterator subactive_elements_end () const = 0;
1158 
1162  virtual element_iterator semilocal_elements_begin () = 0;
1163  virtual element_iterator semilocal_elements_end () = 0;
1164  virtual const_element_iterator semilocal_elements_begin () const = 0;
1165  virtual const_element_iterator semilocal_elements_end () const = 0;
1166 
1170  virtual element_iterator facelocal_elements_begin () = 0;
1171  virtual element_iterator facelocal_elements_end () = 0;
1172  virtual const_element_iterator facelocal_elements_begin () const = 0;
1173  virtual const_element_iterator facelocal_elements_end () const = 0;
1174 
1178  virtual element_iterator level_elements_begin (unsigned int level) = 0;
1179  virtual element_iterator level_elements_end (unsigned int level) = 0;
1180  virtual const_element_iterator level_elements_begin (unsigned int level) const = 0;
1181  virtual const_element_iterator level_elements_end (unsigned int level) const = 0;
1182 
1186  virtual element_iterator pid_elements_begin (processor_id_type proc_id) = 0;
1187  virtual element_iterator pid_elements_end (processor_id_type proc_id) = 0;
1188  virtual const_element_iterator pid_elements_begin (processor_id_type proc_id) const = 0;
1189  virtual const_element_iterator pid_elements_end (processor_id_type proc_id) const = 0;
1190 
1194  virtual element_iterator type_elements_begin (ElemType type) = 0;
1195  virtual element_iterator type_elements_end (ElemType type) = 0;
1196  virtual const_element_iterator type_elements_begin (ElemType type) const = 0;
1197  virtual const_element_iterator type_elements_end (ElemType type) const = 0;
1198 
1202  virtual element_iterator unpartitioned_elements_begin () = 0;
1203  virtual element_iterator unpartitioned_elements_end () = 0;
1204  virtual const_element_iterator unpartitioned_elements_begin () const = 0;
1205  virtual const_element_iterator unpartitioned_elements_end () const = 0;
1206 
1210  virtual element_iterator active_unpartitioned_elements_begin () = 0;
1211  virtual element_iterator active_unpartitioned_elements_end () = 0;
1212  virtual const_element_iterator active_unpartitioned_elements_begin () const = 0;
1213  virtual const_element_iterator active_unpartitioned_elements_end () const = 0;
1214 
1219  virtual element_iterator ghost_elements_begin () = 0;
1220  virtual element_iterator ghost_elements_end () = 0;
1221  virtual const_element_iterator ghost_elements_begin () const = 0;
1222  virtual const_element_iterator ghost_elements_end () const = 0;
1223 
1229  virtual element_iterator
1230  evaluable_elements_begin (const DofMap & dof_map,
1231  unsigned int var_num = libMesh::invalid_uint) = 0;
1232 
1233  virtual element_iterator
1234  evaluable_elements_end (const DofMap & dof_map,
1235  unsigned int var_num = libMesh::invalid_uint) = 0;
1236 
1237  virtual const_element_iterator
1238  evaluable_elements_begin (const DofMap & dof_map,
1239  unsigned int var_num = libMesh::invalid_uint) const = 0;
1240 
1241  virtual const_element_iterator
1242  evaluable_elements_end (const DofMap & dof_map,
1243  unsigned int var_num = libMesh::invalid_uint) const = 0;
1244 
1245 #ifdef LIBMESH_ENABLE_AMR
1246 
1249  virtual element_iterator flagged_elements_begin (unsigned char rflag) = 0;
1250  virtual element_iterator flagged_elements_end (unsigned char rflag) = 0;
1251  virtual const_element_iterator flagged_elements_begin (unsigned char rflag) const = 0;
1252  virtual const_element_iterator flagged_elements_end (unsigned char rflag) const = 0;
1253 
1258  virtual element_iterator flagged_pid_elements_begin (unsigned char rflag,
1259  processor_id_type pid) = 0;
1260  virtual element_iterator flagged_pid_elements_end (unsigned char rflag,
1261  processor_id_type pid) = 0;
1262  virtual const_element_iterator flagged_pid_elements_begin (unsigned char rflag,
1263  processor_id_type pid) const = 0;
1264  virtual const_element_iterator flagged_pid_elements_end (unsigned char rflag,
1265  processor_id_type pid) const = 0;
1266 #endif
1267 
1273  virtual element_iterator active_elements_begin () = 0;
1274  virtual element_iterator active_elements_end () = 0;
1275  virtual const_element_iterator active_elements_begin () const = 0;
1276  virtual const_element_iterator active_elements_end () const = 0;
1279 
1280  virtual element_iterator local_elements_begin () = 0;
1281  virtual element_iterator local_elements_end () = 0;
1282  virtual const_element_iterator local_elements_begin () const = 0;
1283  virtual const_element_iterator local_elements_end () const = 0;
1284 
1285  virtual element_iterator active_semilocal_elements_begin () = 0;
1286  virtual element_iterator active_semilocal_elements_end () = 0;
1287  virtual const_element_iterator active_semilocal_elements_begin () const = 0;
1288  virtual const_element_iterator active_semilocal_elements_end () const = 0;
1289 
1290  virtual element_iterator active_type_elements_begin (ElemType type) = 0;
1291  virtual element_iterator active_type_elements_end (ElemType type) = 0;
1292  virtual const_element_iterator active_type_elements_begin (ElemType type) const = 0;
1293  virtual const_element_iterator active_type_elements_end (ElemType type) const = 0;
1294 
1295  virtual element_iterator active_pid_elements_begin (processor_id_type proc_id) = 0;
1296  virtual element_iterator active_pid_elements_end (processor_id_type proc_id) = 0;
1297  virtual const_element_iterator active_pid_elements_begin (processor_id_type proc_id) const = 0;
1298  virtual const_element_iterator active_pid_elements_end (processor_id_type proc_id) const = 0;
1299 
1300  virtual element_iterator active_subdomain_elements_begin (subdomain_id_type subdomain_id) = 0;
1301  virtual element_iterator active_subdomain_elements_end (subdomain_id_type subdomain_id) = 0;
1302  virtual const_element_iterator active_subdomain_elements_begin (subdomain_id_type subdomain_id) const = 0;
1303  virtual const_element_iterator active_subdomain_elements_end (subdomain_id_type subdomain_id) const = 0;
1306 
1307  virtual element_iterator active_subdomain_set_elements_begin (std::set<subdomain_id_type> ss) = 0;
1308  virtual element_iterator active_subdomain_set_elements_end (std::set<subdomain_id_type> ss) = 0;
1309  virtual const_element_iterator active_subdomain_set_elements_begin (std::set<subdomain_id_type> ss) const = 0;
1310  virtual const_element_iterator active_subdomain_set_elements_end (std::set<subdomain_id_type> ss) const = 0;
1311  virtual SimpleRange<element_iterator> active_subdomain_set_elements_ptr_range(std::set<subdomain_id_type> ss) = 0;
1312  virtual SimpleRange<const_element_iterator> active_subdomain_set_elements_ptr_range(std::set<subdomain_id_type> ss) const = 0;
1313 
1314  virtual element_iterator active_local_subdomain_elements_begin (subdomain_id_type subdomain_id) = 0;
1315  virtual element_iterator active_local_subdomain_elements_end (subdomain_id_type subdomain_id) = 0;
1316  virtual const_element_iterator active_local_subdomain_elements_begin (subdomain_id_type subdomain_id) const = 0;
1317  virtual const_element_iterator active_local_subdomain_elements_end (subdomain_id_type subdomain_id) const = 0;
1320 
1321  virtual element_iterator local_level_elements_begin (unsigned int level) = 0;
1322  virtual element_iterator local_level_elements_end (unsigned int level) = 0;
1323  virtual const_element_iterator local_level_elements_begin (unsigned int level) const = 0;
1324  virtual const_element_iterator local_level_elements_end (unsigned int level) const = 0;
1325 
1326  virtual element_iterator local_not_level_elements_begin (unsigned int level) = 0;
1327  virtual element_iterator local_not_level_elements_end (unsigned int level) = 0;
1328  virtual const_element_iterator local_not_level_elements_begin (unsigned int level) const = 0;
1329  virtual const_element_iterator local_not_level_elements_end (unsigned int level) const = 0;
1330 
1331  virtual element_iterator not_level_elements_begin (unsigned int level) = 0;
1332  virtual element_iterator not_level_elements_end (unsigned int level) = 0;
1333  virtual const_element_iterator not_level_elements_begin (unsigned int level) const = 0;
1334  virtual const_element_iterator not_level_elements_end (unsigned int level) const = 0;
1335 
1336  virtual element_iterator active_local_elements_begin () = 0;
1337  virtual element_iterator active_local_elements_end () = 0;
1338  virtual const_element_iterator active_local_elements_begin () const = 0;
1339  virtual const_element_iterator active_local_elements_end () const = 0;
1342 
1343  virtual element_iterator active_not_local_elements_begin () = 0;
1344  virtual element_iterator active_not_local_elements_end () = 0;
1345  virtual const_element_iterator active_not_local_elements_begin () const = 0;
1346  virtual const_element_iterator active_not_local_elements_end () const = 0;
1347 
1348  virtual element_iterator not_local_elements_begin () = 0;
1349  virtual element_iterator not_local_elements_end () = 0;
1350  virtual const_element_iterator not_local_elements_begin () const = 0;
1351  virtual const_element_iterator not_local_elements_end () const = 0;
1352 
1353  virtual element_iterator not_subactive_elements_begin () = 0;
1354  virtual element_iterator not_subactive_elements_end () = 0;
1355  virtual const_element_iterator not_subactive_elements_begin () const = 0;
1356  virtual const_element_iterator not_subactive_elements_end () const = 0;
1357 
1358  virtual element_iterator not_active_elements_begin () = 0;
1359  virtual element_iterator not_active_elements_end () = 0;
1360  virtual const_element_iterator not_active_elements_begin () const = 0;
1361  virtual const_element_iterator not_active_elements_end () const = 0;
1362 
1363  virtual element_iterator not_ancestor_elements_begin () = 0;
1364  virtual element_iterator not_ancestor_elements_end () = 0;
1365  virtual const_element_iterator not_ancestor_elements_begin () const = 0;
1366  virtual const_element_iterator not_ancestor_elements_end () const = 0;
1367 
1368  //
1369  // node_iterator accessors
1370  //
1371 
1375  virtual node_iterator nodes_begin () = 0;
1376  virtual node_iterator nodes_end () = 0;
1377  virtual const_node_iterator nodes_begin () const = 0;
1378  virtual const_node_iterator nodes_end () const = 0;
1381 
1385  virtual node_iterator active_nodes_begin () = 0;
1386  virtual node_iterator active_nodes_end () = 0;
1387  virtual const_node_iterator active_nodes_begin () const = 0;
1388  virtual const_node_iterator active_nodes_end () const = 0;
1389 
1393  virtual node_iterator local_nodes_begin () = 0;
1394  virtual node_iterator local_nodes_end () = 0;
1395  virtual const_node_iterator local_nodes_begin () const = 0;
1396  virtual const_node_iterator local_nodes_end () const = 0;
1399 
1403  virtual node_iterator pid_nodes_begin (processor_id_type proc_id) = 0;
1404  virtual node_iterator pid_nodes_end (processor_id_type proc_id) = 0;
1405  virtual const_node_iterator pid_nodes_begin (processor_id_type proc_id) const = 0;
1406  virtual const_node_iterator pid_nodes_end (processor_id_type proc_id) const = 0;
1407 
1411  virtual node_iterator bid_nodes_begin (boundary_id_type bndry_id) = 0;
1412  virtual node_iterator bid_nodes_end (boundary_id_type bndry_id) = 0;
1413  virtual const_node_iterator bid_nodes_begin (boundary_id_type bndry_id) const = 0;
1414  virtual const_node_iterator bid_nodes_end (boundary_id_type bndry_id) const = 0;
1415 
1419  virtual node_iterator bnd_nodes_begin () = 0;
1420  virtual node_iterator bnd_nodes_end () = 0;
1421  virtual const_node_iterator bnd_nodes_begin () const = 0;
1422  virtual const_node_iterator bnd_nodes_end () const = 0;
1423 
1429  virtual node_iterator
1430  evaluable_nodes_begin (const DofMap & dof_map,
1431  unsigned int var_num = libMesh::invalid_uint) = 0;
1432 
1433  virtual node_iterator
1434  evaluable_nodes_end (const DofMap & dof_map,
1435  unsigned int var_num = libMesh::invalid_uint) = 0;
1436 
1437  virtual const_node_iterator
1438  evaluable_nodes_begin (const DofMap & dof_map,
1439  unsigned int var_num = libMesh::invalid_uint) const = 0;
1440 
1441  virtual const_node_iterator
1442  evaluable_nodes_end (const DofMap & dof_map,
1443  unsigned int var_num = libMesh::invalid_uint) const = 0;
1444 
1448  std::map<subdomain_id_type, std::string> & set_subdomain_name_map ()
1449  { return _block_id_to_name; }
1450  const std::map<subdomain_id_type, std::string> & get_subdomain_name_map () const
1451  { return _block_id_to_name; }
1452 
1453 
1459  void cache_elem_dims();
1460 
1465  void detect_interior_parents();
1466 
1467 
1476  std::unique_ptr<BoundaryInfo> boundary_info;
1477 
1478 
1479 protected:
1480 
1484  unsigned int & set_n_partitions ()
1485  { return _n_parts; }
1486 
1497  unsigned int _n_parts;
1498 
1503 
1511  mutable std::unique_ptr<PointLocatorBase> _point_locator;
1512 
1518 
1525  std::unique_ptr<Partitioner> _partitioner;
1526 
1527 #ifdef LIBMESH_ENABLE_UNIQUE_ID
1528 
1532 #endif
1533 
1539 
1544 
1551 
1559 
1565  std::map<subdomain_id_type, std::string> _block_id_to_name;
1566 
1572  std::set<unsigned char> _elem_dims;
1573 
1578  unsigned char _spatial_dimension;
1579 
1584  std::vector<std::string> _elem_integer_names;
1585 
1590  std::vector<std::string> _node_integer_names;
1591 
1597  std::unique_ptr<GhostingFunctor> _default_ghosting;
1598 
1606  std::set<GhostingFunctor *> _ghosting_functors;
1607 
1612  std::map<GhostingFunctor *, std::shared_ptr<GhostingFunctor> > _shared_functors;
1613 
1619 
1624  friend class Partitioner;
1625 
1630  friend class MeshInput<MeshBase>;
1631 
1636  friend class BoundaryInfo;
1637 };
1638 
1639 
1640 
1641 
1642 
1643 
1644 
1645 
1646 
1647 
1648 
1652 struct
1653 MeshBase::element_iterator : variant_filter_iterator<MeshBase::Predicate, Elem *>
1654 {
1655  // Templated forwarding ctor -- forwards to appropriate variant_filter_iterator ctor
1656  template <typename PredType, typename IterType>
1657  element_iterator (const IterType & d,
1658  const IterType & e,
1659  const PredType & p ) :
1661 };
1662 
1663 
1664 
1665 
1670 struct
1672  Elem * const,
1673  Elem * const &,
1674  Elem * const *>
1675 {
1679  template <typename PredType, typename IterType>
1680  const_element_iterator (const IterType & d,
1681  const IterType & e,
1682  const PredType & p ) :
1683  variant_filter_iterator<MeshBase::Predicate, Elem * const, Elem * const &, Elem * const *>(d,e,p) {}
1684 
1692  variant_filter_iterator<Predicate, Elem * const, Elem * const &, Elem * const *>(rhs) {}
1693 };
1694 
1695 
1696 
1697 
1698 
1699 
1700 
1704 struct
1705 MeshBase::node_iterator : variant_filter_iterator<MeshBase::Predicate, Node *>
1706 {
1710  template <typename PredType, typename IterType>
1711  node_iterator (const IterType & d,
1712  const IterType & e,
1713  const PredType & p ) :
1715 };
1716 
1717 
1718 
1719 
1724 struct
1726  Node * const,
1727  Node * const &,
1728  Node * const *>
1729 {
1733  template <typename PredType, typename IterType>
1734  const_node_iterator (const IterType & d,
1735  const IterType & e,
1736  const PredType & p ) :
1737  variant_filter_iterator<MeshBase::Predicate, Node * const, Node * const &, Node * const *>(d,e,p) {}
1738 
1746  variant_filter_iterator<Predicate, Node * const, Node * const &, Node * const *>(rhs) {}
1747 };
1748 
1749 
1750 } // namespace libMesh
1751 
1752 #endif // LIBMESH_MESH_BASE_H
std::string name(const ElemQuality q)
The definition of the element_iterator struct.
Definition: mesh_base.h:1652
virtual element_iterator evaluable_elements_begin(const DofMap &dof_map, unsigned int var_num=libMesh::invalid_uint)=0
Iterate over elements in the Mesh where the solution (as distributed by the given DofMap) can be eval...
virtual node_iterator active_nodes_end()=0
virtual element_iterator ancestor_elements_begin()=0
Iterate over elements for which elem->ancestor() is true.
ElemType
Defines an enum for geometric element types.
virtual void redistribute()
Redistribute elements between processors.
Definition: mesh_base.h:817
The SimpleRange templated class is intended to make it easy to construct ranges from pairs of iterato...
Definition: simple_range.h:36
virtual element_iterator facelocal_elements_end()=0
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.
virtual element_iterator not_ancestor_elements_begin()=0
bool _skip_renumber_nodes_and_elements
If this is true then renumbering will be kept to a minimum.
Definition: mesh_base.h:1550
bool is_prepared() const
Definition: mesh_base.h:151
virtual const Elem * elem(const dof_id_type i) const
Definition: mesh_base.h:541
virtual dof_id_type n_active_elem() const =0
A Node is like a Point, but with more information.
Definition: node.h:52
Encapsulates the MPI_Comm object.
Definition: communicator.h:92
This abstract base class defines the interface by which library code and user code can report associa...
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 ...
virtual element_iterator not_level_elements_begin(unsigned int level)=0
variant_filter_iterator(const IterType &d, const IterType &e, const PredType &p)
Templated Constructor.
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
virtual element_iterator active_subdomain_set_elements_end(std::set< subdomain_id_type > ss)=0
dof_id_type n_unpartitioned_nodes() const
Definition: mesh_base.h:296
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
Definition: libmesh.h:245
virtual element_iterator not_local_elements_end()=0
unsigned int add_node_integer(const std::string &name)
Register an integer datum (of type dof_id_type) to be added to each node in the mesh.
virtual SimpleRange< node_iterator > local_node_ptr_range()=0
virtual node_iterator pid_nodes_end(processor_id_type proc_id)=0
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:1584
unsigned int n_node_integers() const
Definition: mesh_base.h:785
virtual element_iterator level_elements_begin(unsigned int level)=0
Iterate over elements of a given level.
BoundaryInfo & get_boundary_info()
Writable information about boundary ids on the mesh.
Definition: mesh_base.h:136
virtual node_iterator evaluable_nodes_end(const DofMap &dof_map, unsigned int var_num=libMesh::invalid_uint)=0
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:842
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:917
void detect_interior_parents()
Search the mesh for elements that have a neighboring element of dim+1 and set that element as the int...
virtual element_iterator local_level_elements_end(unsigned int level)=0
void skip_partitioning(bool skip)
If true is passed in then nothing on this mesh will be (re)partitioned.
Definition: mesh_base.h:893
dof_id_type n_active_elem_on_proc(const processor_id_type proc) const
virtual element_iterator active_semilocal_elements_end()=0
unsigned int add_elem_integer(const std::string &name)
Register an integer datum (of type dof_id_type) to be added to each element in the mesh...
The definition of the const_element_iterator struct.
Definition: mesh_base.h:1670
virtual element_iterator active_subdomain_elements_end(subdomain_id_type subdomain_id)=0
virtual element_iterator not_ancestor_elements_end()=0
virtual node_iterator bid_nodes_end(boundary_id_type bndry_id)=0
virtual element_iterator local_elements_begin()=0
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:1026
virtual void allgather()
Gathers all elements and nodes of the mesh onto every processor.
Definition: mesh_base.h:187
virtual element_iterator unpartitioned_elements_begin()=0
Iterate over unpartitioned elements in the Mesh.
void set_spatial_dimension(unsigned char d)
Sets the "spatial dimension" of the Mesh.
virtual void clear()
Deletes all the element and node data that is currently stored.
bool skip_noncritical_partitioning() const
Definition: mesh_base.h:878
virtual element_iterator not_subactive_elements_begin()=0
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
Definition: mesh_base.h:757
This is the base class from which all geometric element types are derived.
Definition: elem.h:101
virtual element_iterator ancestor_elements_end()=0
dof_id_type n_local_nodes() const
Definition: mesh_base.h:290
virtual std::unique_ptr< Partitioner > & partitioner()
A partitioner to use at each prepare_for_use()
Definition: mesh_base.h:126
virtual element_iterator flagged_elements_end(unsigned char rflag)=0
virtual void gather_to_zero()
Gathers all elements and nodes of the mesh onto processor zero.
Definition: mesh_base.h:193
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:875
std::string get_info() const
virtual Elem & elem_ref(const dof_id_type i)
Definition: mesh_base.h:517
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:1680
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:1538
virtual node_iterator bid_nodes_begin(boundary_id_type bndry_id)=0
Iterate over nodes for which BoundaryInfo::has_boundary_id(node, bndry_id) is true.
virtual void fix_broken_node_and_element_numbering()=0
There is no reason for a user to ever call this function.
virtual SimpleRange< element_iterator > active_element_ptr_range()=0
unsigned char _spatial_dimension
The "spatial dimension" of the Mesh.
Definition: mesh_base.h:1578
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:643
virtual element_iterator flagged_pid_elements_end(unsigned char rflag, processor_id_type pid)=0
std::unique_ptr< BoundaryInfo > boundary_info
This class holds the boundary information.
Definition: mesh_base.h:1476
virtual element_iterator subactive_elements_end()=0
virtual Elem * elem(const dof_id_type i)
Definition: mesh_base.h:556
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:1558
The libMesh namespace provides an interface to certain functionality in the library.
virtual void all_first_order()=0
Converts a mesh with higher-order elements into a mesh with linear elements.
virtual Elem * query_elem(const dof_id_type i)
Definition: mesh_base.h:596
std::string & subdomain_name(subdomain_id_type id)
virtual element_iterator not_active_elements_end()=0
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
Definition: mesh_base.h:131
dof_id_type n_unpartitioned_elem() const
Definition: mesh_base.h:396
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:1590
virtual element_iterator active_local_subdomain_elements_end(subdomain_id_type subdomain_id)=0
virtual std::unique_ptr< MeshBase > clone() const =0
Virtual "copy constructor".
virtual Node & node_ref(const dof_id_type i)
Definition: mesh_base.h:446
virtual element_iterator active_semilocal_elements_begin()=0
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:390
virtual element_iterator local_level_elements_begin(unsigned int level)=0
const std::string & get_elem_integer_name(unsigned int i) const
Definition: mesh_base.h:750
const PointLocatorBase & point_locator() const
uint8_t processor_id_type
Definition: id_types.h:104
This is the MeshBase class.
Definition: mesh_base.h:77
virtual SimpleRange< element_iterator > active_subdomain_elements_ptr_range(subdomain_id_type subdomain_id)=0
The Partitioner class provides a uniform interface for partitioning algorithms.
Definition: partitioner.h:50
virtual bool is_serial_on_zero() const
Definition: mesh_base.h:165
virtual void set_distributed()
Asserts that not all elements and nodes of the mesh necessarily exist on the current processor...
Definition: mesh_base.h:173
void subdomain_ids(std::set< subdomain_id_type > &ids) const
Constructs a list of all subdomain identifiers in the global mesh.
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:1711
virtual node_iterator nodes_begin()=0
Iterate over all the nodes in the Mesh.
virtual element_iterator elements_begin()=0
Iterate over all the elements in the Mesh.
virtual SimpleRange< element_iterator > active_local_element_ptr_range()=0
This class handles the numbering of degrees of freedom on a mesh.
Definition: dof_map.h:177
virtual element_iterator level_elements_end(unsigned int level)=0
std::set< GhostingFunctor * > _ghosting_functors
The list of all GhostingFunctor objects to be used when distributing a DistributedMesh.
Definition: mesh_base.h:1606
unique_id_type _next_unique_id
The next available unique id for assigning ids to DOF objects.
Definition: mesh_base.h:1531
virtual const Elem * query_elem(const dof_id_type i) const
Definition: mesh_base.h:582
virtual element_iterator facelocal_elements_begin()=0
Iterate over elements which are on or have a neighbor on the current processor.
unsigned int _n_parts
The number of partitions the mesh has.
Definition: mesh_base.h:1497
virtual element_iterator ghost_elements_end()=0
virtual element_iterator active_subdomain_elements_begin(subdomain_id_type subdomain_id)=0
virtual element_iterator active_subdomain_set_elements_begin(std::set< subdomain_id_type > ss)=0
virtual node_iterator evaluable_nodes_begin(const DofMap &dof_map, unsigned int var_num=libMesh::invalid_uint)=0
Iterate over nodes in the Mesh where the solution (as distributed by the given DofMap) can be evaluat...
dof_id_type n_active_local_elem() const
Definition: mesh_base.h:407
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:851
processor_id_type n_processors() const
virtual bool is_serial() const
Definition: mesh_base.h:158
virtual element_iterator active_local_subdomain_elements_begin(subdomain_id_type subdomain_id)=0
virtual void find_neighbors(const bool reset_remote_elements=false, const bool reset_current_list=true)=0
Locate element face (edge in 2D) neighbors.
virtual element_iterator not_subactive_elements_end()=0
virtual node_iterator active_nodes_begin()=0
Iterate over only the active nodes in the Mesh.
int8_t boundary_id_type
Definition: id_types.h:51
virtual void delete_elem(Elem *e)=0
Removes element e from the mesh.
virtual SimpleRange< element_iterator > element_ptr_range()=0
virtual element_iterator semilocal_elements_begin()=0
Iterate over elements for which elem->is_semilocal() is true for the current processor.
const std::map< subdomain_id_type, std::string > & get_subdomain_name_map() const
Definition: mesh_base.h:1450
virtual node_iterator local_nodes_end()=0
This class defines an abstract interface for Mesh input.
Definition: mesh_base.h:59
virtual void all_second_order(const bool full_ordered=true)=0
Converts a (conforming, non-refined) mesh with linear elements into a mesh with second-order elements...
static const 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:404
virtual element_iterator active_local_elements_begin()=0
dof_id_type n_sub_elem() const
virtual element_iterator active_pid_elements_begin(processor_id_type proc_id)=0
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
virtual element_iterator type_elements_end(ElemType type)=0
virtual void update_parallel_id_counts()=0
Updates parallel caches so that methods like n_elem() accurately reflect changes on other processors...
virtual element_iterator flagged_elements_begin(unsigned char rflag)=0
Iterate over all elements with a specified refinement flag.
virtual element_iterator elements_end()=0
std::unique_ptr< Partitioner > _partitioner
A partitioner to use at each prepare_for_use().
Definition: mesh_base.h:1525
virtual const Node * query_node_ptr(const dof_id_type i) const =0
virtual element_iterator not_active_elements_begin()=0
virtual SimpleRange< node_iterator > node_ptr_range()=0
virtual dof_id_type max_elem_id() const =0
void clear_point_locator()
Releases the current PointLocator object.
virtual Node * insert_node(Node *n)=0
Insert Node n into the Mesh at a location consistent with n->id(), allocating extra storage if necess...
The BoundaryInfo class contains information relevant to boundary conditions including storing faces...
Definition: boundary_info.h:57
virtual element_iterator local_elements_end()=0
virtual element_iterator active_unpartitioned_elements_end()=0
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:393
virtual void delete_node(Node *n)=0
Removes the Node n from the mesh.
std::set< unsigned char > _elem_dims
We cache the dimension of the elements present in the mesh.
Definition: mesh_base.h:1572
void prepare_for_use(const bool skip_renumber_nodes_and_elements=false, const bool skip_find_neighbors=false)
Prepare a newly ecreated (or read) mesh for use.
OStreamProxy out
const std::set< unsigned char > & elem_dimensions() const
Definition: mesh_base.h:224
This is the base class for point locators.
virtual void write(const std::string &name)=0
void set_mesh_dimension(unsigned char d)
Resets the logical dimension of the mesh.
Definition: mesh_base.h:217
dof_id_type n_nodes_on_proc(const processor_id_type proc) const
virtual dof_id_type parallel_n_nodes() const =0
std::map< subdomain_id_type, std::string > & set_subdomain_name_map()
Definition: mesh_base.h:1448
bool allow_remote_element_removal() const
Definition: mesh_base.h:852
virtual element_iterator not_level_elements_end(unsigned int level)=0
An object whose state is distributed along a set of processors.
unsigned int get_node_integer_index(const std::string &name) const
virtual dof_id_type parallel_n_elem() const =0
virtual node_iterator bnd_nodes_end()=0
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...
virtual element_iterator active_elements_begin()=0
Active, local, and negation forms of the element iterators described above.
virtual element_iterator flagged_pid_elements_begin(unsigned char rflag, processor_id_type pid)=0
Iterate over all elements with a specified refinement flag on a specified processor.
bool skip_partitioning() const
Definition: mesh_base.h:895
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:1612
virtual const Node & node(const dof_id_type i) const
Definition: mesh_base.h:458
unsigned int n_partitions() const
Definition: mesh_base.h:970
virtual Node * add_node(Node *n)=0
Add Node n to the end of the vertex array.
virtual element_iterator pid_elements_begin(processor_id_type proc_id)=0
Iterate over all elements with a specified processor id.
virtual element_iterator active_elements_end()=0
virtual const Elem * elem_ptr(const dof_id_type i) const =0
The definition of the node_iterator struct.
Definition: mesh_base.h:1704
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:1734
virtual Elem * insert_elem(Elem *e)=0
Insert elem e to the element array, preserving its id and replacing/deleting any existing element wit...
unsigned int get_elem_integer_index(const std::string &name) const
virtual node_iterator local_nodes_begin()=0
Iterate over local nodes (nodes whose processor_id() matches the current processor).
virtual element_iterator active_not_local_elements_end()=0
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.
Definition: mesh_base.h:930
subdomain_id_type n_subdomains() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual node_iterator nodes_end()=0
virtual element_iterator active_pid_elements_end(processor_id_type proc_id)=0
virtual bool contract()=0
Delete subactive (i.e.
virtual const Elem * query_elem_ptr(const dof_id_type i) const =0
virtual element_iterator active_unpartitioned_elements_begin()=0
Iterate over active unpartitioned elements in the Mesh.
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...
virtual element_iterator type_elements_begin(ElemType type)=0
Iterate over all elements with a specified geometric type.
unsigned int spatial_dimension() const
element_iterator(const IterType &d, const IterType &e, const PredType &p)
Definition: mesh_base.h:1657
virtual node_iterator bnd_nodes_begin()=0
Iterate over nodes for which BoundaryInfo::n_boundary_ids(node) > 0.
virtual element_iterator evaluable_elements_end(const DofMap &dof_map, unsigned int var_num=libMesh::invalid_uint)=0
virtual element_iterator semilocal_elements_end()=0
virtual bool is_replicated() const
Definition: mesh_base.h:180
bool _is_prepared
Flag indicating if the mesh has been prepared for use.
Definition: mesh_base.h:1502
virtual const Elem & elem_ref(const dof_id_type i) const
Definition: mesh_base.h:508
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.
Definition: mesh_base.h:1724
MeshBase(const Parallel::Communicator &comm_in, unsigned char dim=1)
Constructor.
dof_id_type n_active_sub_elem() const
Same as n_sub_elem(), but only counts active elements.
unsigned int mesh_dimension() const
std::unique_ptr< GhostingFunctor > _default_ghosting
The default geometric GhostingFunctor, used to implement standard libMesh element ghosting behavior...
Definition: mesh_base.h:1597
virtual SimpleRange< element_iterator > active_local_subdomain_elements_ptr_range(subdomain_id_type subdomain_id)=0
virtual element_iterator unpartitioned_elements_end()=0
virtual SimpleRange< element_iterator > active_subdomain_set_elements_ptr_range(std::set< subdomain_id_type > ss)=0
unique_id_type next_unique_id()
Definition: mesh_base.h:309
const std::string & get_node_integer_name(unsigned int i) const
Definition: mesh_base.h:778
virtual element_iterator active_not_local_elements_begin()=0
virtual void libmesh_assert_valid_parallel_ids() const
Verify id and processor_id consistency of our elements and nodes containers.
Definition: mesh_base.h:1114
virtual const Node & node_ref(const dof_id_type i) const
Definition: mesh_base.h:438
virtual const Point & point(const dof_id_type i) const =0
virtual Node & node(const dof_id_type i)
Definition: mesh_base.h:472
bool _skip_all_partitioning
If this is true then no partitioning should be done.
Definition: mesh_base.h:1543
const_node_iterator(const MeshBase::node_iterator &rhs)
The conversion-to-const ctor.
Definition: mesh_base.h:1745
bool allow_renumbering() const
Definition: mesh_base.h:843
void set_next_unique_id(unique_id_type id)
Sets the next unique id to be used.
Definition: mesh_base.h:314
virtual element_iterator not_local_elements_begin()=0
void cache_elem_dims()
Search the mesh and cache the different dimensions of the elements present in the mesh...
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:200
void print_info(std::ostream &os=libMesh::out) const
Prints relevant information about the mesh.
const_element_iterator(const MeshBase::element_iterator &rhs)
The conversion-to-const ctor.
Definition: mesh_base.h:1691
virtual void update_post_partitioning()
Recalculate any cached data after elements and nodes have been repartitioned.
Definition: mesh_base.h:823
virtual dof_id_type max_node_id() const =0
virtual dof_id_type n_elem() const =0
virtual const Node * node_ptr(const dof_id_type i) const =0
virtual element_iterator active_type_elements_end(ElemType type)=0
processor_id_type processor_id() const
std::unique_ptr< PointLocatorBase > _point_locator
A PointLocator class for this mesh.
Definition: mesh_base.h:1511
virtual element_iterator local_not_level_elements_end(unsigned int level)=0
virtual node_iterator pid_nodes_begin(processor_id_type proc_id)=0
Iterate over nodes with processor_id() == proc_id.
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:1618
virtual element_iterator active_local_elements_end()=0
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:1517
GhostingFunctor & default_ghosting()
Default ghosting functor.
Definition: mesh_base.h:942
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
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
virtual element_iterator ghost_elements_begin()=0
Iterate over "ghost" elements in the Mesh.
virtual ~MeshBase()
Destructor.
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:1565
unsigned int & set_n_partitions()
Definition: mesh_base.h:1484
virtual element_iterator subactive_elements_begin()=0
Iterate over elements for which elem->subactive() is true.
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
virtual element_iterator active_type_elements_begin(ElemType type)=0
subdomain_id_type get_id_by_name(const std::string &name) const
std::unique_ptr< PointLocatorBase > sub_point_locator() const
std::set< GhostingFunctor * >::const_iterator ghosting_functors_end() const
End of range of ghosting functors.
Definition: mesh_base.h:936
void add_ghosting_functor(GhostingFunctor &ghosting_functor)
Adds a functor which can specify ghosting requirements for use on distributed meshes.
Definition: mesh_base.h:906
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...
virtual element_iterator local_not_level_elements_begin(unsigned int level)=0
void set_point_locator_close_to_point_tol(Real val)
Set value used by PointLocatorBase::close_to_point_tol().
virtual element_iterator pid_elements_end(processor_id_type proc_id)=0