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  parallel_object_only();
176 
177  libmesh_assert(this->comm().verify(this->is_serial()));
178 
179  // A distributed mesh may have processors with no elements (or
180  // processors with no elements of higher dimension, if we ever
181  // support mixed-dimension meshes), but we want consistent
182  // mesh_dimension anyways.
183  //
184  // cache_elem_dims() should get the elem_dimensions() and
185  // mesh_dimension() correct later, and we don't need it earlier.
186 
187 
188  // Renumber the nodes and elements so that they in contiguous
189  // blocks. By default, _skip_renumber_nodes_and_elements is false.
190  //
191  // We may currently change that by passing
192  // skip_renumber_nodes_and_elements==true to this function, but we
193  // should use the allow_renumbering() accessor instead.
194  //
195  // Instances where you if prepare_for_use() should not renumber the nodes
196  // and elements include reading in e.g. an xda/r or gmv file. In
197  // this case, the ordering of the nodes may depend on an accompanying
198  // solution, and the node ordering cannot be changed.
199 
200  if (skip_renumber_nodes_and_elements)
201  {
202  libmesh_deprecated();
203  this->allow_renumbering(false);
204  }
205 
206  // Mesh modification operations might not leave us with consistent
207  // id counts, but our partitioner might need that consistency.
210  else
212 
213  // Let all the elements find their neighbors
214  if (!skip_find_neighbors)
215  this->find_neighbors();
216 
217  // The user may have set boundary conditions. We require that the
218  // boundary conditions were set consistently. Because we examine
219  // neighbors when evaluating non-raw boundary condition IDs, this
220  // assert is only valid when our neighbor links are in place.
221 #ifdef DEBUG
223 #endif
224 
225  // Search the mesh for all the dimensions of the elements
226  // and cache them.
227  this->cache_elem_dims();
228 
229  // Search the mesh for elements that have a neighboring element
230  // of dim+1 and set that element as the interior parent
231  this->detect_interior_parents();
232 
233  // Fix up node unique ids in case mesh generation code didn't take
234  // exceptional care to do so.
235  // MeshCommunication().make_node_unique_ids_parallel_consistent(*this);
236 
237  // We're going to still require that mesh generation code gets
238  // element unique ids consistent.
239 #if defined(DEBUG) && defined(LIBMESH_ENABLE_UNIQUE_ID)
241 #endif
242 
243  // Reset our PointLocator. Any old locator is invalidated any time
244  // the elements in the underlying elements in the mesh have changed,
245  // so we clear it here.
246  this->clear_point_locator();
247 
248  // Allow our GhostingFunctor objects to reinit if necessary.
249  // Do this before partitioning and redistributing, and before
250  // deleting remote elements.
251  std::set<GhostingFunctor *>::iterator gf_it = this->ghosting_functors_begin();
252  const std::set<GhostingFunctor *>::iterator gf_end = this->ghosting_functors_end();
253  for (; gf_it != gf_end; ++gf_it)
254  {
255  GhostingFunctor * gf = *gf_it;
256  libmesh_assert(gf);
257  gf->mesh_reinit();
258  }
259 
260  // Partition the mesh.
261  this->partition();
262 
263  // If we're using DistributedMesh, we'll probably want it
264  // parallelized.
266  this->delete_remote_elements();
267 
270 
271  // The mesh is now prepared for use.
272  _is_prepared = true;
273 
274 #if defined(DEBUG) && defined(LIBMESH_ENABLE_UNIQUE_ID)
277 #endif
278 }
279 
280 
281 
283 {
284  // Reset the number of partitions
285  _n_parts = 1;
286 
287  // Reset the _is_prepared flag
288  _is_prepared = false;
289 
290  // Clear boundary information
291  this->get_boundary_info().clear();
292 
293  // Clear element dimensions
294  _elem_dims.clear();
295 
296  // Clear our point locator.
297  this->clear_point_locator();
298 }
299 
300 
301 
303 {
304  // We should only be trying to remove ghosting functors we actually
305  // have
306  libmesh_assert(_ghosting_functors.count(&ghosting_functor));
307  _ghosting_functors.erase(&ghosting_functor);
308 }
309 
310 
311 
312 void MeshBase::subdomain_ids (std::set<subdomain_id_type> & ids) const
313 {
314  // This requires an inspection on every processor
315  parallel_object_only();
316 
317  ids.clear();
318 
321 
322  for (; el!=end; ++el)
323  ids.insert((*el)->subdomain_id());
324 
325  // Some subdomains may only live on other processors
326  this->comm().set_union(ids);
327 }
328 
329 
330 
332 {
333  // This requires an inspection on every processor
334  parallel_object_only();
335 
336  std::set<subdomain_id_type> ids;
337 
338  this->subdomain_ids (ids);
339 
340  return cast_int<subdomain_id_type>(ids.size());
341 }
342 
343 
344 
345 
347 {
348  // We're either counting a processor's nodes or unpartitioned
349  // nodes
350  libmesh_assert (proc_id < this->n_processors() ||
352 
353  return static_cast<dof_id_type>(std::distance (this->pid_nodes_begin(proc_id),
354  this->pid_nodes_end (proc_id)));
355 }
356 
357 
358 
360 {
361  // We're either counting a processor's elements or unpartitioned
362  // elements
363  libmesh_assert (proc_id < this->n_processors() ||
365 
366  return static_cast<dof_id_type>(std::distance (this->pid_elements_begin(proc_id),
367  this->pid_elements_end (proc_id)));
368 }
369 
370 
371 
373 {
374  libmesh_assert_less (proc_id, this->n_processors());
375  return static_cast<dof_id_type>(std::distance (this->active_pid_elements_begin(proc_id),
376  this->active_pid_elements_end (proc_id)));
377 }
378 
379 
380 
382 {
383  dof_id_type ne=0;
384 
386  const const_element_iterator end = this->elements_end();
387 
388  for (; el!=end; ++el)
389  ne += (*el)->n_sub_elem();
390 
391  return ne;
392 }
393 
394 
395 
397 {
398  dof_id_type ne=0;
399 
402 
403  for (; el!=end; ++el)
404  ne += (*el)->n_sub_elem();
405 
406  return ne;
407 }
408 
409 
410 
411 std::string MeshBase::get_info() const
412 {
413  std::ostringstream oss;
414 
415  oss << " Mesh Information:" << '\n';
416 
417  if (!_elem_dims.empty())
418  {
419  oss << " elem_dimensions()={";
420  std::copy(_elem_dims.begin(),
421  --_elem_dims.end(), // --end() is valid if the set is non-empty
422  std::ostream_iterator<unsigned int>(oss, ", "));
423  oss << cast_int<unsigned int>(*_elem_dims.rbegin());
424  oss << "}\n";
425  }
426 
427  oss << " spatial_dimension()=" << this->spatial_dimension() << '\n'
428  << " n_nodes()=" << this->n_nodes() << '\n'
429  << " n_local_nodes()=" << this->n_local_nodes() << '\n'
430  << " n_elem()=" << this->n_elem() << '\n'
431  << " n_local_elem()=" << this->n_local_elem() << '\n'
432 #ifdef LIBMESH_ENABLE_AMR
433  << " n_active_elem()=" << this->n_active_elem() << '\n'
434 #endif
435  << " n_subdomains()=" << static_cast<std::size_t>(this->n_subdomains()) << '\n'
436  << " n_partitions()=" << static_cast<std::size_t>(this->n_partitions()) << '\n'
437  << " n_processors()=" << static_cast<std::size_t>(this->n_processors()) << '\n'
438  << " n_threads()=" << static_cast<std::size_t>(libMesh::n_threads()) << '\n'
439  << " processor_id()=" << static_cast<std::size_t>(this->processor_id()) << '\n';
440 
441  return oss.str();
442 }
443 
444 
445 void MeshBase::print_info(std::ostream & os) const
446 {
447  os << this->get_info()
448  << std::endl;
449 }
450 
451 
452 std::ostream & operator << (std::ostream & os, const MeshBase & m)
453 {
454  m.print_info(os);
455  return os;
456 }
457 
458 
459 void MeshBase::partition (const unsigned int n_parts)
460 {
461  // If we get here and we have unpartitioned elements, we need that
462  // fixed.
463  if (this->n_unpartitioned_elem() > 0)
464  {
465  libmesh_assert (partitioner().get());
466  libmesh_assert (this->is_serial());
467  partitioner()->partition (*this, n_parts);
468  }
469  // NULL partitioner means don't repartition
470  // Non-serial meshes may not be ready for repartitioning here.
471  else if (!skip_partitioning() && partitioner().get())
472  {
473  partitioner()->partition (*this, n_parts);
474  }
475  else
476  {
477  // Adaptive coarsening may have "orphaned" nodes on processors
478  // whose elements no longer share them. We need to check for
479  // and possibly fix that.
481 
482  // Make sure locally cached partition count
483  this->recalculate_n_partitions();
484 
485  // Make sure any other locally cached data is correct
486  this->update_post_partitioning();
487  }
488 }
489 
491 {
492  // This requires an inspection on every processor
493  parallel_object_only();
494 
497 
498  unsigned int max_proc_id=0;
499 
500  for (; el!=end; ++el)
501  max_proc_id = std::max(max_proc_id, static_cast<unsigned int>((*el)->processor_id()));
502 
503  // The number of partitions is one more than the max processor ID.
504  _n_parts = max_proc_id+1;
505 
506  this->comm().max(_n_parts);
507 
508  return _n_parts;
509 }
510 
511 
512 
514 {
515  libmesh_deprecated();
516 
517  if (_point_locator.get() == libmesh_nullptr)
518  {
519  // PointLocator construction may not be safe within threads
521 
522  _point_locator.reset (PointLocatorBase::build(TREE_ELEMENTS, *this).release());
523  }
524 
525  return *_point_locator;
526 }
527 
528 
530 {
531  // If there's no master point locator, then we need one.
532  if (_point_locator.get() == libmesh_nullptr)
533  {
534  // PointLocator construction may not be safe within threads
536 
537  // And it may require parallel communication
538  parallel_object_only();
539 
540  _point_locator.reset (PointLocatorBase::build(TREE_ELEMENTS, *this).release());
541  }
542 
543  // Otherwise there was a master point locator, and we can grab a
544  // sub-locator easily.
546 }
547 
548 
549 
551 {
553 }
554 
555 
556 
558 {
559  _count_lower_dim_elems_in_point_locator = count_lower_dim_elems;
560 }
561 
562 
563 
565 {
567 }
568 
569 
570 
572 {
573  return _block_id_to_name[id];
574 }
575 
576 const std::string & MeshBase::subdomain_name(subdomain_id_type id) const
577 {
578  // An empty string to return when no matching subdomain name is found
579  static const std::string empty;
580 
581  std::map<subdomain_id_type, std::string>::const_iterator iter = _block_id_to_name.find(id);
582  if (iter == _block_id_to_name.end())
583  return empty;
584  else
585  return iter->second;
586 }
587 
588 
589 
590 
592 {
593  // Linear search over the map values.
594  std::map<subdomain_id_type, std::string>::const_iterator
595  iter = _block_id_to_name.begin(),
596  end_iter = _block_id_to_name.end();
597 
598  for ( ; iter != end_iter; ++iter)
599  if (iter->second == name)
600  return iter->first;
601 
602  // If we made it here without returning, we don't have a subdomain
603  // with the requested name, so return Elem::invalid_subdomain_id.
605 }
606 
608 {
609  // This requires an inspection on every processor
610  parallel_object_only();
611 
612  // Need to clear _elem_dims first in case all elements of a
613  // particular dimension have been deleted.
614  _elem_dims.clear();
615 
618 
619  for (; el!=end; ++el)
620  _elem_dims.insert((*el)->dim());
621 
622  // Some different dimension elements may only live on other processors
623  this->comm().set_union(_elem_dims);
624 
625  // If the largest element dimension found is larger than the current
626  // _spatial_dimension, increase _spatial_dimension.
627  unsigned int max_dim = this->mesh_dimension();
628  if (max_dim > _spatial_dimension)
629  _spatial_dimension = cast_int<unsigned char>(max_dim);
630 
631  // _spatial_dimension may need to increase from 1->2 or 2->3 if the
632  // mesh is full of 1D elements but they are not x-aligned, or the
633  // mesh is full of 2D elements but they are not in the x-y plane.
634  // If the mesh is x-aligned or x-y planar, we will end up checking
635  // every node's coordinates and not breaking out of the loop
636  // early...
637  if (_spatial_dimension < 3)
638  {
639  const_node_iterator node_it = this->nodes_begin();
640  const_node_iterator node_end = this->nodes_end();
641  for (; node_it != node_end; ++node_it)
642  {
643  Node & node = **node_it;
644 
645 #if LIBMESH_DIM > 1
646  // Note: the exact floating point comparison is intentional,
647  // we don't want to get tripped up by tolerances.
648  if (node(1) != 0.)
649  {
650  _spatial_dimension = 2;
651 #if LIBMESH_DIM == 2
652  // If libmesh is compiled in 2D mode, this is the
653  // largest spatial dimension possible so we can break
654  // out.
655  break;
656 #endif
657  }
658 #endif
659 
660 #if LIBMESH_DIM > 2
661  if (node(2) != 0.)
662  {
663  // Spatial dimension can't get any higher than this, so
664  // we can break out.
665  _spatial_dimension = 3;
666  break;
667  }
668 #endif
669  }
670  }
671 }
672 
674 {
675  // This requires an inspection on every processor
676  parallel_object_only();
677 
678  // Check if the mesh contains mixed dimensions. If so, then set interior parents, otherwise return.
679  if (this->elem_dimensions().size() == 1)
680  return;
681 
682  //This map will be used to set interior parents
683  LIBMESH_BEST_UNORDERED_MAP<dof_id_type, std::vector<dof_id_type> > node_to_elem;
684 
687 
688  for (; el!=end; ++el)
689  {
690  const Elem * elem = *el;
691 
692  // Populating the node_to_elem map, same as MeshTools::build_nodes_to_elem_map
693  for (unsigned int n=0; n<elem->n_vertices(); n++)
694  {
695  libmesh_assert_less (elem->id(), this->max_elem_id());
696 
697  node_to_elem[elem->node_id(n)].push_back(elem->id());
698  }
699  }
700 
701  // Automatically set interior parents
702  el = this->elements_begin();
703  for (; el!=end; ++el)
704  {
705  Elem * element = *el;
706 
707  // Ignore an 3D element or an element that already has an interior parent
708  if (element->dim()>=LIBMESH_DIM || element->interior_parent())
709  continue;
710 
711  // Start by generating a SET of elements that are dim+1 to the current
712  // element at each vertex of the current element, thus ignoring interior nodes.
713  // If one of the SET of elements is empty, then we will not have an interior parent
714  // since an interior parent must be connected to all vertices of the current element
715  std::vector< std::set<dof_id_type> > neighbors( element->n_vertices() );
716 
717  bool found_interior_parents = false;
718 
719  for (dof_id_type n=0; n < element->n_vertices(); n++)
720  {
721  std::vector<dof_id_type> & element_ids = node_to_elem[element->node_id(n)];
722  for (std::vector<dof_id_type>::iterator e_it = element_ids.begin();
723  e_it != element_ids.end(); e_it++)
724  {
725  dof_id_type eid = *e_it;
726  if (this->elem_ref(eid).dim() == element->dim()+1)
727  neighbors[n].insert(eid);
728  }
729  if (neighbors[n].size()>0)
730  {
731  found_interior_parents = true;
732  }
733  else
734  {
735  // We have found an empty set, no reason to continue
736  // Ensure we set this flag to false before the break since it could have
737  // been set to true for previous vertex
738  found_interior_parents = false;
739  break;
740  }
741  }
742 
743  // If we have successfully generated a set of elements for each vertex, we will compare
744  // the set for vertex 0 will the sets for the vertices until we find a id that exists in
745  // all sets. If found, this is our an interior parent id. The interior parent id found
746  // will be the lowest element id if there is potential for multiple interior parents.
747  if (found_interior_parents)
748  {
749  std::set<dof_id_type> & neighbors_0 = neighbors[0];
750  for (std::set<dof_id_type>::iterator e_it = neighbors_0.begin();
751  e_it != neighbors_0.end(); e_it++)
752  {
753  found_interior_parents=false;
754  dof_id_type interior_parent_id = *e_it;
755  for (dof_id_type n=1; n < element->n_vertices(); n++)
756  {
757  if (neighbors[n].find(interior_parent_id)!=neighbors[n].end())
758  {
759  found_interior_parents=true;
760  }
761  else
762  {
763  found_interior_parents=false;
764  break;
765  }
766  }
767  if (found_interior_parents)
768  {
769  element->set_interior_parent(this->elem_ptr(interior_parent_id));
770  break;
771  }
772  }
773  }
774  }
775 }
776 
777 } // 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:346
dof_id_type n_active_sub_elem() const
Definition: mesh_base.C:396
bool closed()
Definition: libmesh.C:279
const BoundaryInfo & get_boundary_info() const
Definition: mesh_base.h:114
bool _skip_renumber_nodes_and_elements
Definition: mesh_base.h:1355
UniquePtr< PointLocatorBase > _point_locator
Definition: mesh_base.h:1322
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:1287
bool skip_partitioning() const
Definition: mesh_base.h:753
void detect_interior_parents()
Definition: mesh_base.C:673
dof_id_type n_local_nodes() const
Definition: mesh_base.h:262
static void set_node_processor_ids(MeshBase &mesh)
Definition: partitioner.C:431
unsigned int n_partitions() const
Definition: mesh_base.h:811
void set_spatial_dimension(unsigned char d)
Definition: mesh_base.C:163
dof_id_type n_unpartitioned_elem() const
Definition: mesh_base.h:368
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:302
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:508
UniquePtr< Partitioner > _partitioner
Definition: mesh_base.h:1336
IterBase * end
unsigned char _spatial_dimension
Definition: mesh_base.h:1383
bool _allow_remote_element_removal
Definition: mesh_base.h:1363
std::string get_info() const
Definition: mesh_base.C:411
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:782
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
const PointLocatorBase & point_locator() const
Definition: mesh_base.C:513
virtual node_iterator nodes_begin()=0
virtual element_iterator elements_begin()=0
std::set< GhostingFunctor * > _ghosting_functors
Definition: mesh_base.h:1399
unique_id_type _next_unique_id
Definition: mesh_base.h:1342
unsigned int _n_parts
Definition: mesh_base.h:1308
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:359
void subdomain_ids(std::set< subdomain_id_type > &ids) const
Definition: mesh_base.C:312
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:550
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:1255
std::set< unsigned char > _elem_dims
Definition: mesh_base.h:1377
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:571
const std::set< unsigned char > & elem_dimensions() const
Definition: mesh_base.h:196
subdomain_id_type get_id_by_name(const std::string &name) const
Definition: mesh_base.C:591
virtual void clear()
Definition: mesh_base.C:282
friend std::ostream & operator<<(std::ostream &os, const MeshBase &m)
Definition: mesh_base.C:452
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:1390
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:476
Parallel::FakeCommunicator CommWorld
Definition: libmesh.C:206
unsigned int recalculate_n_partitions()
Definition: mesh_base.C:490
dof_id_type n_local_elem() const
Definition: mesh_base.h:362
std::set< GhostingFunctor * >::const_iterator ghosting_functors_begin() const
Definition: mesh_base.h:776
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:564
bool on_command_line(const std::string &arg)
Definition: libmesh.C:914
const Parallel::Communicator & comm() const
unsigned int mesh_dimension() const
Definition: mesh_base.C:147
bool allow_renumbering() const
Definition: mesh_base.h:728
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:557
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:429
bool initialized()
Definition: libmesh.C:272
dof_id_type n_sub_elem() const
Definition: mesh_base.C:381
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1683
virtual void delete_remote_elements()
Definition: mesh_base.h:172
void cache_elem_dims()
Definition: mesh_base.C:607
virtual void update_post_partitioning()
Definition: mesh_base.h:719
dof_id_type id() const
Definition: dof_object.h:624
void libmesh_assert_valid_unique_ids(const MeshBase &mesh)
Definition: mesh_tools.C:1405
subdomain_id_type n_subdomains() const
Definition: mesh_base.C:331
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:1328
void print_info(std::ostream &os=libMesh::out) const
Definition: mesh_base.C:445
UniquePtr< PointLocatorBase > sub_point_locator() const
Definition: mesh_base.C:529
std::map< subdomain_id_type, std::string > _block_id_to_name
Definition: mesh_base.h:1370
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:372
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