mesh_base.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute 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 // library configuration
21 #include "libmesh/libmesh_config.h"
22 
23 // C++ includes
24 #include <algorithm> // for std::min
25 #include <map> // for std::multimap
26 #include <sstream> // for std::ostringstream
27 
28 
29 // Local includes
30 #include "libmesh/boundary_info.h"
31 #include "libmesh/elem.h"
33 #include "libmesh/mesh_base.h"
35 #include "libmesh/mesh_tools.h"
36 #include "libmesh/parallel.h"
37 #include "libmesh/partitioner.h"
39 #include "libmesh/threads.h"
40 
41 #include LIBMESH_INCLUDE_UNORDERED_MAP
42 
43 namespace libMesh
44 {
45 
46 
47 
48 // ------------------------------------------------------------
49 // MeshBase class member functions
51  unsigned char d) :
52  ParallelObject (comm_in),
53  boundary_info (new BoundaryInfo(*this)),
54  _n_parts (1),
55  _is_prepared (false),
56  _point_locator (),
57  _count_lower_dim_elems_in_point_locator(true),
58  _partitioner (),
59 #ifdef LIBMESH_ENABLE_UNIQUE_ID
60  _next_unique_id(DofObject::invalid_unique_id),
61 #endif
62  _skip_partitioning(libMesh::on_command_line("--skip-partitioning")),
63  _skip_renumber_nodes_and_elements(false),
64  _allow_remote_element_removal(true),
65  _spatial_dimension(d),
66  _default_ghosting(new GhostPointNeighbors(*this))
67 {
68  _elem_dims.insert(d);
70  libmesh_assert_less_equal (LIBMESH_DIM, 3);
71  libmesh_assert_greater_equal (LIBMESH_DIM, d);
73 }
74 
75 
76 #ifndef LIBMESH_DISABLE_COMMWORLD
77 MeshBase::MeshBase (unsigned char d) :
79  boundary_info (new BoundaryInfo(*this)),
80  _n_parts (1),
81  _is_prepared (false),
82  _point_locator (),
83  _partitioner (),
84 #ifdef LIBMESH_ENABLE_UNIQUE_ID
85  _next_unique_id(DofObject::invalid_unique_id),
86 #endif
87  _skip_partitioning(libMesh::on_command_line("--skip-partitioning")),
92 {
93  libmesh_deprecated();
94  _elem_dims.insert(d);
96  libmesh_assert_less_equal (LIBMESH_DIM, 3);
97  libmesh_assert_greater_equal (LIBMESH_DIM, d);
99 }
100 #endif // !LIBMESH_DISABLE_COMMWORLD
101 
102 
103 
104 MeshBase::MeshBase (const MeshBase & other_mesh) :
105  ParallelObject (other_mesh),
106  boundary_info (new BoundaryInfo(*this)),
107  _n_parts (other_mesh._n_parts),
108  _is_prepared (other_mesh._is_prepared),
109  _point_locator (),
110  _partitioner (),
111 #ifdef LIBMESH_ENABLE_UNIQUE_ID
112  _next_unique_id(other_mesh._next_unique_id),
113 #endif
114  _skip_partitioning(libMesh::on_command_line("--skip-partitioning")),
117  _elem_dims(other_mesh._elem_dims),
121 {
122  // Make sure we don't accidentally delete the other mesh's default
123  // ghosting functor; we'll use our own if that's needed.
124  if (other_mesh._ghosting_functors.count(other_mesh._default_ghosting.get()))
125  {
126  _ghosting_functors.erase(other_mesh._default_ghosting.get());
128  }
129 
130  if (other_mesh._partitioner.get())
131  {
132  _partitioner = other_mesh._partitioner->clone();
133  }
134 }
135 
136 
137 
139 {
140  this->clear();
141 
142  libmesh_exceptionless_assert (!libMesh::closed());
143 }
144 
145 
146 
147 unsigned int MeshBase::mesh_dimension() const
148 {
149  if (!_elem_dims.empty())
150  return cast_int<unsigned int>(*_elem_dims.rbegin());
151  return 0;
152 }
153 
154 
155 
156 unsigned int MeshBase::spatial_dimension () const
157 {
158  return cast_int<unsigned int>(_spatial_dimension);
159 }
160 
161 
162 
163 void MeshBase::set_spatial_dimension(unsigned char d)
164 {
165  // The user can set the _spatial_dimension however they wish,
166  // libMesh will only *increase* the spatial dimension, however,
167  // never decrease it.
168  _spatial_dimension = d;
169 }
170 
171 
172 
173 void MeshBase::prepare_for_use (const bool skip_renumber_nodes_and_elements, const bool skip_find_neighbors)
174 {
175  LOG_SCOPE("prepare_for_use()", "MeshBase");
176 
177  parallel_object_only();
178 
179  libmesh_assert(this->comm().verify(this->is_serial()));
180 
181  // A distributed mesh may have processors with no elements (or
182  // processors with no elements of higher dimension, if we ever
183  // support mixed-dimension meshes), but we want consistent
184  // mesh_dimension anyways.
185  //
186  // cache_elem_dims() should get the elem_dimensions() and
187  // mesh_dimension() correct later, and we don't need it earlier.
188 
189 
190  // Renumber the nodes and elements so that they in contiguous
191  // blocks. By default, _skip_renumber_nodes_and_elements is false.
192  //
193  // We may currently change that by passing
194  // skip_renumber_nodes_and_elements==true to this function, but we
195  // should use the allow_renumbering() accessor instead.
196  //
197  // Instances where you if prepare_for_use() should not renumber the nodes
198  // and elements include reading in e.g. an xda/r or gmv file. In
199  // this case, the ordering of the nodes may depend on an accompanying
200  // solution, and the node ordering cannot be changed.
201 
202  if (skip_renumber_nodes_and_elements)
203  {
204  libmesh_deprecated();
205  this->allow_renumbering(false);
206  }
207 
208  // Mesh modification operations might not leave us with consistent
209  // id counts, but our partitioner might need that consistency.
212  else
214 
215  // Let all the elements find their neighbors
216  if (!skip_find_neighbors)
217  this->find_neighbors();
218 
219  // The user may have set boundary conditions. We require that the
220  // boundary conditions were set consistently. Because we examine
221  // neighbors when evaluating non-raw boundary condition IDs, this
222  // assert is only valid when our neighbor links are in place.
223 #ifdef DEBUG
225 #endif
226 
227  // Search the mesh for all the dimensions of the elements
228  // and cache them.
229  this->cache_elem_dims();
230 
231  // Search the mesh for elements that have a neighboring element
232  // of dim+1 and set that element as the interior parent
233  this->detect_interior_parents();
234 
235  // Fix up node unique ids in case mesh generation code didn't take
236  // exceptional care to do so.
237  // MeshCommunication().make_node_unique_ids_parallel_consistent(*this);
238 
239  // We're going to still require that mesh generation code gets
240  // element unique ids consistent.
241 #if defined(DEBUG) && defined(LIBMESH_ENABLE_UNIQUE_ID)
243 #endif
244 
245  // Reset our PointLocator. Any old locator is invalidated any time
246  // the elements in the underlying elements in the mesh have changed,
247  // so we clear it here.
248  this->clear_point_locator();
249 
250  // Allow our GhostingFunctor objects to reinit if necessary.
251  // Do this before partitioning and redistributing, and before
252  // deleting remote elements.
253  std::set<GhostingFunctor *>::iterator gf_it = this->ghosting_functors_begin();
254  const std::set<GhostingFunctor *>::iterator gf_end = this->ghosting_functors_end();
255  for (; gf_it != gf_end; ++gf_it)
256  {
257  GhostingFunctor * gf = *gf_it;
258  libmesh_assert(gf);
259  gf->mesh_reinit();
260  }
261 
262  // Partition the mesh.
263  this->partition();
264 
265  // If we're using DistributedMesh, we'll probably want it
266  // parallelized.
268  this->delete_remote_elements();
269 
272 
273  // The mesh is now prepared for use.
274  _is_prepared = true;
275 
276 #if defined(DEBUG) && defined(LIBMESH_ENABLE_UNIQUE_ID)
279 #endif
280 }
281 
282 
283 
285 {
286  // Reset the number of partitions
287  _n_parts = 1;
288 
289  // Reset the _is_prepared flag
290  _is_prepared = false;
291 
292  // Clear boundary information
293  this->get_boundary_info().clear();
294 
295  // Clear element dimensions
296  _elem_dims.clear();
297 
298  // Clear our point locator.
299  this->clear_point_locator();
300 }
301 
302 
303 
305 {
306  // We should only be trying to remove ghosting functors we actually
307  // have
308  libmesh_assert(_ghosting_functors.count(&ghosting_functor));
309  _ghosting_functors.erase(&ghosting_functor);
310 }
311 
312 
313 
314 void MeshBase::subdomain_ids (std::set<subdomain_id_type> & ids) const
315 {
316  // This requires an inspection on every processor
317  parallel_object_only();
318 
319  ids.clear();
320 
323 
324  for (; el!=end; ++el)
325  ids.insert((*el)->subdomain_id());
326 
327  // Some subdomains may only live on other processors
328  this->comm().set_union(ids);
329 }
330 
331 
332 
334 {
335  // This requires an inspection on every processor
336  parallel_object_only();
337 
338  std::set<subdomain_id_type> ids;
339 
340  this->subdomain_ids (ids);
341 
342  return cast_int<subdomain_id_type>(ids.size());
343 }
344 
345 
346 
347 
349 {
350  // We're either counting a processor's nodes or unpartitioned
351  // nodes
352  libmesh_assert (proc_id < this->n_processors() ||
354 
355  return static_cast<dof_id_type>(std::distance (this->pid_nodes_begin(proc_id),
356  this->pid_nodes_end (proc_id)));
357 }
358 
359 
360 
362 {
363  // We're either counting a processor's elements or unpartitioned
364  // elements
365  libmesh_assert (proc_id < this->n_processors() ||
367 
368  return static_cast<dof_id_type>(std::distance (this->pid_elements_begin(proc_id),
369  this->pid_elements_end (proc_id)));
370 }
371 
372 
373 
375 {
376  libmesh_assert_less (proc_id, this->n_processors());
377  return static_cast<dof_id_type>(std::distance (this->active_pid_elements_begin(proc_id),
378  this->active_pid_elements_end (proc_id)));
379 }
380 
381 
382 
384 {
385  dof_id_type ne=0;
386 
388  const const_element_iterator end = this->elements_end();
389 
390  for (; el!=end; ++el)
391  ne += (*el)->n_sub_elem();
392 
393  return ne;
394 }
395 
396 
397 
399 {
400  dof_id_type ne=0;
401 
404 
405  for (; el!=end; ++el)
406  ne += (*el)->n_sub_elem();
407 
408  return ne;
409 }
410 
411 
412 
413 std::string MeshBase::get_info() const
414 {
415  std::ostringstream oss;
416 
417  oss << " Mesh Information:" << '\n';
418 
419  if (!_elem_dims.empty())
420  {
421  oss << " elem_dimensions()={";
422  std::copy(_elem_dims.begin(),
423  --_elem_dims.end(), // --end() is valid if the set is non-empty
424  std::ostream_iterator<unsigned int>(oss, ", "));
425  oss << cast_int<unsigned int>(*_elem_dims.rbegin());
426  oss << "}\n";
427  }
428 
429  oss << " spatial_dimension()=" << this->spatial_dimension() << '\n'
430  << " n_nodes()=" << this->n_nodes() << '\n'
431  << " n_local_nodes()=" << this->n_local_nodes() << '\n'
432  << " n_elem()=" << this->n_elem() << '\n'
433  << " n_local_elem()=" << this->n_local_elem() << '\n'
434 #ifdef LIBMESH_ENABLE_AMR
435  << " n_active_elem()=" << this->n_active_elem() << '\n'
436 #endif
437  << " n_subdomains()=" << static_cast<std::size_t>(this->n_subdomains()) << '\n'
438  << " n_partitions()=" << static_cast<std::size_t>(this->n_partitions()) << '\n'
439  << " n_processors()=" << static_cast<std::size_t>(this->n_processors()) << '\n'
440  << " n_threads()=" << static_cast<std::size_t>(libMesh::n_threads()) << '\n'
441  << " processor_id()=" << static_cast<std::size_t>(this->processor_id()) << '\n';
442 
443  return oss.str();
444 }
445 
446 
447 void MeshBase::print_info(std::ostream & os) const
448 {
449  os << this->get_info()
450  << std::endl;
451 }
452 
453 
454 std::ostream & operator << (std::ostream & os, const MeshBase & m)
455 {
456  m.print_info(os);
457  return os;
458 }
459 
460 
461 void MeshBase::partition (const unsigned int n_parts)
462 {
463  // If we get here and we have unpartitioned elements, we need that
464  // fixed.
465  if (this->n_unpartitioned_elem() > 0)
466  {
467  libmesh_assert (partitioner().get());
468  libmesh_assert (this->is_serial());
469  partitioner()->partition (*this, n_parts);
470  }
471  // NULL partitioner means don't repartition
472  // Non-serial meshes may not be ready for repartitioning here.
473  else if (!skip_partitioning() && partitioner().get())
474  {
475  partitioner()->partition (*this, n_parts);
476  }
477  else
478  {
479  // Adaptive coarsening may have "orphaned" nodes on processors
480  // whose elements no longer share them. We need to check for
481  // and possibly fix that.
483 
484  // Make sure locally cached partition count
485  this->recalculate_n_partitions();
486 
487  // Make sure any other locally cached data is correct
488  this->update_post_partitioning();
489  }
490 }
491 
493 {
494  // This requires an inspection on every processor
495  parallel_object_only();
496 
499 
500  unsigned int max_proc_id=0;
501 
502  for (; el!=end; ++el)
503  max_proc_id = std::max(max_proc_id, static_cast<unsigned int>((*el)->processor_id()));
504 
505  // The number of partitions is one more than the max processor ID.
506  _n_parts = max_proc_id+1;
507 
508  this->comm().max(_n_parts);
509 
510  return _n_parts;
511 }
512 
513 
514 
516 {
517  libmesh_deprecated();
518 
519  if (_point_locator.get() == libmesh_nullptr)
520  {
521  // PointLocator construction may not be safe within threads
523 
524  _point_locator.reset (PointLocatorBase::build(TREE_ELEMENTS, *this).release());
525  }
526 
527  return *_point_locator;
528 }
529 
530 
532 {
533  // If there's no master point locator, then we need one.
534  if (_point_locator.get() == libmesh_nullptr)
535  {
536  // PointLocator construction may not be safe within threads
538 
539  // And it may require parallel communication
540  parallel_object_only();
541 
542  _point_locator.reset (PointLocatorBase::build(TREE_ELEMENTS, *this).release());
543  }
544 
545  // Otherwise there was a master point locator, and we can grab a
546  // sub-locator easily.
548 }
549 
550 
551 
553 {
555 }
556 
557 
558 
560 {
561  _count_lower_dim_elems_in_point_locator = count_lower_dim_elems;
562 }
563 
564 
565 
567 {
569 }
570 
571 
572 
574 {
575  return _block_id_to_name[id];
576 }
577 
578 const std::string & MeshBase::subdomain_name(subdomain_id_type id) const
579 {
580  // An empty string to return when no matching subdomain name is found
581  static const std::string empty;
582 
583  std::map<subdomain_id_type, std::string>::const_iterator iter = _block_id_to_name.find(id);
584  if (iter == _block_id_to_name.end())
585  return empty;
586  else
587  return iter->second;
588 }
589 
590 
591 
592 
594 {
595  // Linear search over the map values.
596  std::map<subdomain_id_type, std::string>::const_iterator
597  iter = _block_id_to_name.begin(),
598  end_iter = _block_id_to_name.end();
599 
600  for ( ; iter != end_iter; ++iter)
601  if (iter->second == name)
602  return iter->first;
603 
604  // If we made it here without returning, we don't have a subdomain
605  // with the requested name, so return Elem::invalid_subdomain_id.
607 }
608 
610 {
611  // This requires an inspection on every processor
612  parallel_object_only();
613 
614  // Need to clear _elem_dims first in case all elements of a
615  // particular dimension have been deleted.
616  _elem_dims.clear();
617 
620 
621  for (; el!=end; ++el)
622  _elem_dims.insert((*el)->dim());
623 
624  // Some different dimension elements may only live on other processors
625  this->comm().set_union(_elem_dims);
626 
627  // If the largest element dimension found is larger than the current
628  // _spatial_dimension, increase _spatial_dimension.
629  unsigned int max_dim = this->mesh_dimension();
630  if (max_dim > _spatial_dimension)
631  _spatial_dimension = cast_int<unsigned char>(max_dim);
632 
633  // _spatial_dimension may need to increase from 1->2 or 2->3 if the
634  // mesh is full of 1D elements but they are not x-aligned, or the
635  // mesh is full of 2D elements but they are not in the x-y plane.
636  // If the mesh is x-aligned or x-y planar, we will end up checking
637  // every node's coordinates and not breaking out of the loop
638  // early...
639  if (_spatial_dimension < 3)
640  {
641  const_node_iterator node_it = this->nodes_begin();
642  const_node_iterator node_end = this->nodes_end();
643  for (; node_it != node_end; ++node_it)
644  {
645  Node & node = **node_it;
646 
647 #if LIBMESH_DIM > 1
648  // Note: the exact floating point comparison is intentional,
649  // we don't want to get tripped up by tolerances.
650  if (node(1) != 0.)
651  {
652  _spatial_dimension = 2;
653 #if LIBMESH_DIM == 2
654  // If libmesh is compiled in 2D mode, this is the
655  // largest spatial dimension possible so we can break
656  // out.
657  break;
658 #endif
659  }
660 #endif
661 
662 #if LIBMESH_DIM > 2
663  if (node(2) != 0.)
664  {
665  // Spatial dimension can't get any higher than this, so
666  // we can break out.
667  _spatial_dimension = 3;
668  break;
669  }
670 #endif
671  }
672  }
673 }
674 
676 {
677  // This requires an inspection on every processor
678  parallel_object_only();
679 
680  // Check if the mesh contains mixed dimensions. If so, then set interior parents, otherwise return.
681  if (this->elem_dimensions().size() == 1)
682  return;
683 
684  //This map will be used to set interior parents
685  LIBMESH_BEST_UNORDERED_MAP<dof_id_type, std::vector<dof_id_type> > node_to_elem;
686 
689 
690  for (; el!=end; ++el)
691  {
692  const Elem * elem = *el;
693 
694  // Populating the node_to_elem map, same as MeshTools::build_nodes_to_elem_map
695  for (unsigned int n=0; n<elem->n_vertices(); n++)
696  {
697  libmesh_assert_less (elem->id(), this->max_elem_id());
698 
699  node_to_elem[elem->node_id(n)].push_back(elem->id());
700  }
701  }
702 
703  // Automatically set interior parents
704  el = this->elements_begin();
705  for (; el!=end; ++el)
706  {
707  Elem * element = *el;
708 
709  // Ignore an 3D element or an element that already has an interior parent
710  if (element->dim()>=LIBMESH_DIM || element->interior_parent())
711  continue;
712 
713  // Start by generating a SET of elements that are dim+1 to the current
714  // element at each vertex of the current element, thus ignoring interior nodes.
715  // If one of the SET of elements is empty, then we will not have an interior parent
716  // since an interior parent must be connected to all vertices of the current element
717  std::vector< std::set<dof_id_type> > neighbors( element->n_vertices() );
718 
719  bool found_interior_parents = false;
720 
721  for (dof_id_type n=0; n < element->n_vertices(); n++)
722  {
723  std::vector<dof_id_type> & element_ids = node_to_elem[element->node_id(n)];
724  for (std::vector<dof_id_type>::iterator e_it = element_ids.begin();
725  e_it != element_ids.end(); e_it++)
726  {
727  dof_id_type eid = *e_it;
728  if (this->elem_ref(eid).dim() == element->dim()+1)
729  neighbors[n].insert(eid);
730  }
731  if (neighbors[n].size()>0)
732  {
733  found_interior_parents = true;
734  }
735  else
736  {
737  // We have found an empty set, no reason to continue
738  // Ensure we set this flag to false before the break since it could have
739  // been set to true for previous vertex
740  found_interior_parents = false;
741  break;
742  }
743  }
744 
745  // If we have successfully generated a set of elements for each vertex, we will compare
746  // the set for vertex 0 will the sets for the vertices until we find a id that exists in
747  // all sets. If found, this is our an interior parent id. The interior parent id found
748  // will be the lowest element id if there is potential for multiple interior parents.
749  if (found_interior_parents)
750  {
751  std::set<dof_id_type> & neighbors_0 = neighbors[0];
752  for (std::set<dof_id_type>::iterator e_it = neighbors_0.begin();
753  e_it != neighbors_0.end(); e_it++)
754  {
755  found_interior_parents=false;
756  dof_id_type interior_parent_id = *e_it;
757  for (dof_id_type n=1; n < element->n_vertices(); n++)
758  {
759  if (neighbors[n].find(interior_parent_id)!=neighbors[n].end())
760  {
761  found_interior_parents=true;
762  }
763  else
764  {
765  found_interior_parents=false;
766  break;
767  }
768  }
769  if (found_interior_parents)
770  {
771  element->set_interior_parent(this->elem_ptr(interior_parent_id));
772  break;
773  }
774  }
775  }
776  }
777 }
778 
779 } // namespace libMesh
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
dof_id_type n_nodes_on_proc(const processor_id_type proc) const
Definition: mesh_base.C:348
dof_id_type n_active_sub_elem() const
Definition: mesh_base.C:398
bool closed()
Definition: libmesh.C:281
const BoundaryInfo & get_boundary_info() const
Definition: mesh_base.h:114
bool _skip_renumber_nodes_and_elements
Definition: mesh_base.h:1362
UniquePtr< PointLocatorBase > _point_locator
Definition: mesh_base.h:1329
A geometric point in (x,y,z) space associated with a DOF.
Definition: node.h:52
virtual dof_id_type n_active_elem() const =0
unsigned int n_threads()
Definition: libmesh_base.h:125
virtual bool is_serial() const
Definition: mesh_base.h:137
virtual node_iterator pid_nodes_end(processor_id_type proc_id)=0
UniquePtr< BoundaryInfo > boundary_info
Definition: mesh_base.h:1294
bool skip_partitioning() const
Definition: mesh_base.h:760
void detect_interior_parents()
Definition: mesh_base.C:675
dof_id_type n_local_nodes() const
Definition: mesh_base.h:269
static void set_node_processor_ids(MeshBase &mesh)
Definition: partitioner.C:431
unsigned int n_partitions() const
Definition: mesh_base.h:818
void set_spatial_dimension(unsigned char d)
Definition: mesh_base.C:163
dof_id_type n_unpartitioned_elem() const
Definition: mesh_base.h:375
processor_id_type n_processors() const
const Elem * interior_parent() const
Definition: elem.C:941
void remove_ghosting_functor(GhostingFunctor &ghosting_functor)
Definition: mesh_base.C:304
The base class for all geometric element types.
Definition: elem.h:86
uint8_t processor_id_type
Definition: id_types.h:99
const class libmesh_nullptr_t libmesh_nullptr
virtual const Elem * elem(const dof_id_type i) const
Definition: mesh_base.h:515
UniquePtr< Partitioner > _partitioner
Definition: mesh_base.h:1343
IterBase * end
unsigned char _spatial_dimension
Definition: mesh_base.h:1390
bool _allow_remote_element_removal
Definition: mesh_base.h:1370
std::string get_info() const
Definition: mesh_base.C:413
long double max(long double a, double b)
bool in_threads
Definition: threads.C:31
void set_interior_parent(Elem *p)
Definition: elem.C:993
Base class for Mesh.
Definition: mesh_base.h:67
libmesh_assert(j)
std::set< GhostingFunctor * >::const_iterator ghosting_functors_end() const
Definition: mesh_base.h:789
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
const PointLocatorBase & point_locator() const
Definition: mesh_base.C:515
virtual node_iterator nodes_begin()=0
virtual element_iterator elements_begin()=0
std::set< GhostingFunctor * > _ghosting_functors
Definition: mesh_base.h:1406
unique_id_type _next_unique_id
Definition: mesh_base.h:1349
unsigned int _n_parts
Definition: mesh_base.h:1315
virtual dof_id_type max_elem_id() const =0
static const subdomain_id_type invalid_subdomain_id
Definition: elem.h:213
virtual void find_neighbors(const bool reset_remote_elements=false, const bool reset_current_list=true)=0
dof_id_type n_elem_on_proc(const processor_id_type proc) const
Definition: mesh_base.C:361
void subdomain_ids(std::set< subdomain_id_type > &ids) const
Definition: mesh_base.C:314
static const processor_id_type invalid_processor_id
Definition: dof_object.h:345
virtual element_iterator active_local_elements_begin()=0
virtual element_iterator active_pid_elements_begin(processor_id_type proc_id)=0
virtual void update_parallel_id_counts()=0
virtual element_iterator elements_end()=0
void clear_point_locator()
Definition: mesh_base.C:552
Used by the Mesh to keep track of boundary nodes and elements.
Definition: boundary_info.h:56
void libmesh_assert_valid_boundary_ids(const MeshBase &mesh)
Definition: mesh_tools.C:1279
std::set< unsigned char > _elem_dims
Definition: mesh_base.h:1384
void prepare_for_use(const bool skip_renumber_nodes_and_elements=false, const bool skip_find_neighbors=false)
Definition: mesh_base.C:173
unsigned int spatial_dimension() const
Definition: mesh_base.C:156
std::string & subdomain_name(subdomain_id_type id)
Definition: mesh_base.C:573
const std::set< unsigned char > & elem_dimensions() const
Definition: mesh_base.h:203
subdomain_id_type get_id_by_name(const std::string &name) const
Definition: mesh_base.C:593
virtual void clear()
Definition: mesh_base.C:284
friend std::ostream & operator<<(std::ostream &os, const MeshBase &m)
Definition: mesh_base.C:454
static UniquePtr< PointLocatorBase > build(PointLocatorType t, const MeshBase &mesh, const PointLocatorBase *master=libmesh_nullptr)
virtual element_iterator active_elements_begin()=0
UniquePtr< GhostingFunctor > _default_ghosting
Definition: mesh_base.h:1397
virtual element_iterator pid_elements_begin(processor_id_type proc_id)=0
virtual element_iterator active_elements_end()=0
virtual const Elem & elem_ref(const dof_id_type i) const
Definition: mesh_base.h:483
Parallel::FakeCommunicator CommWorld
Definition: libmesh.C:208
unsigned int recalculate_n_partitions()
Definition: mesh_base.C:492
dof_id_type n_local_elem() const
Definition: mesh_base.h:369
std::set< GhostingFunctor * >::const_iterator ghosting_functors_begin() const
Definition: mesh_base.h:783
virtual node_iterator nodes_end()=0
virtual element_iterator active_pid_elements_end(processor_id_type proc_id)=0
bool verify(const T &r, const Communicator &comm=Communicator_World)
virtual UniquePtr< Partitioner > & partitioner()
Definition: mesh_base.h:109
bool get_count_lower_dim_elems_in_point_locator() const
Definition: mesh_base.C:566
bool on_command_line(const std::string &arg)
Definition: libmesh.C:921
const Parallel::Communicator & comm() const
unsigned int mesh_dimension() const
Definition: mesh_base.C:147
bool allow_renumbering() const
Definition: mesh_base.h:735
virtual unsigned int n_vertices() const =0
void set_count_lower_dim_elems_in_point_locator(bool count_lower_dim_elems)
Definition: mesh_base.C:559
MeshBase(const Parallel::Communicator &comm_in, unsigned char dim=1)
Definition: mesh_base.C:50
virtual unsigned int dim() const =0
virtual ~MeshBase()
Definition: mesh_base.C:138
virtual const Node & node(const dof_id_type i) const
Definition: mesh_base.h:436
bool initialized()
Definition: libmesh.C:274
dof_id_type n_sub_elem() const
Definition: mesh_base.C:383
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1689
virtual void delete_remote_elements()
Definition: mesh_base.h:179
void cache_elem_dims()
Definition: mesh_base.C:609
virtual void update_post_partitioning()
Definition: mesh_base.h:726
dof_id_type id() const
Definition: dof_object.h:624
void libmesh_assert_valid_unique_ids(const MeshBase &mesh)
Definition: mesh_tools.C:1482
subdomain_id_type n_subdomains() const
Definition: mesh_base.C:333
virtual dof_id_type n_nodes() const =0
virtual const Elem * elem_ptr(const dof_id_type i) const =0
virtual dof_id_type n_elem() const =0
virtual node_iterator pid_nodes_begin(processor_id_type proc_id)=0
virtual element_iterator active_local_elements_end()=0
bool _count_lower_dim_elems_in_point_locator
Definition: mesh_base.h:1335
void print_info(std::ostream &os=libMesh::out) const
Definition: mesh_base.C:447
UniquePtr< PointLocatorBase > sub_point_locator() const
Definition: mesh_base.C:531
std::map< subdomain_id_type, std::string > _block_id_to_name
Definition: mesh_base.h:1377
virtual void renumber_nodes_and_elements()=0
dof_id_type n_active_elem_on_proc(const processor_id_type proc) const
Definition: mesh_base.C:374
processor_id_type processor_id() const
uint8_t dof_id_type
Definition: id_types.h:64
void set_union(T &data, const unsigned int root_id) const
virtual element_iterator pid_elements_end(processor_id_type proc_id)=0