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
125  (other_mesh._default_ghosting.get()))
126  {
127  _ghosting_functors.erase(other_mesh._default_ghosting.get());
129  }
130 
131  if(other_mesh._partitioner.get())
132  {
133  _partitioner = other_mesh._partitioner->clone();
134  }
135 }
136 
137 
138 
140 {
141  this->clear();
142 
143  libmesh_exceptionless_assert (!libMesh::closed());
144 }
145 
146 
147 
148 unsigned int MeshBase::mesh_dimension() const
149 {
150  if (!_elem_dims.empty())
151  return cast_int<unsigned int>(*_elem_dims.rbegin());
152  return 0;
153 }
154 
155 
156 
157 unsigned int MeshBase::spatial_dimension () const
158 {
159  return cast_int<unsigned int>(_spatial_dimension);
160 }
161 
162 
163 
164 void MeshBase::set_spatial_dimension(unsigned char d)
165 {
166  // The user can set the _spatial_dimension however they wish,
167  // libMesh will only *increase* the spatial dimension, however,
168  // never decrease it.
169  _spatial_dimension = d;
170 }
171 
172 
173 
174 void MeshBase::prepare_for_use (const bool skip_renumber_nodes_and_elements, const bool skip_find_neighbors)
175 {
176  parallel_object_only();
177 
178  libmesh_assert(this->comm().verify(this->is_serial()));
179 
180  // A distributed mesh may have processors with no elements (or
181  // processors with no elements of higher dimension, if we ever
182  // support mixed-dimension meshes), but we want consistent
183  // mesh_dimension anyways.
184  //
185  // cache_elem_dims() should get the elem_dimensions() and
186  // mesh_dimension() correct later, and we don't need it earlier.
187 
188 
189  // Renumber the nodes and elements so that they in contiguous
190  // blocks. By default, _skip_renumber_nodes_and_elements is false.
191  //
192  // We may currently change that by passing
193  // skip_renumber_nodes_and_elements==true to this function, but we
194  // should use the allow_renumbering() accessor instead.
195  //
196  // Instances where you if prepare_for_use() should not renumber the nodes
197  // and elements include reading in e.g. an xda/r or gmv file. In
198  // this case, the ordering of the nodes may depend on an accompanying
199  // solution, and the node ordering cannot be changed.
200 
201  if (skip_renumber_nodes_and_elements)
202  {
203  libmesh_deprecated();
204  this->allow_renumbering(false);
205  }
206 
207  // Mesh modification operations might not leave us with consistent
208  // id counts, but our partitioner might need that consistency.
211  else
213 
214  // Let all the elements find their neighbors
215  if(!skip_find_neighbors)
216  this->find_neighbors();
217 
218  // The user may have set boundary conditions. We require that the
219  // boundary conditions were set consistently. Because we examine
220  // neighbors when evaluating non-raw boundary condition IDs, this
221  // assert is only valid when our neighbor links are in place.
222 #ifdef DEBUG
224 #endif
225 
226  // Search the mesh for all the dimensions of the elements
227  // and cache them.
228  this->cache_elem_dims();
229 
230  // Search the mesh for elements that have a neighboring element
231  // of dim+1 and set that element as the interior parent
232  this->detect_interior_parents();
233 
234  // Fix up node unique ids in case mesh generation code didn't take
235  // exceptional care to do so.
236  // MeshCommunication().make_node_unique_ids_parallel_consistent(*this);
237 
238  // We're going to still require that mesh generation code gets
239  // element unique ids consistent.
240 #if defined(DEBUG) && defined(LIBMESH_ENABLE_UNIQUE_ID)
242 #endif
243 
244  // Reset our PointLocator. Any old locator is invalidated any time
245  // the elements in the underlying elements in the mesh have changed,
246  // so we clear it here.
247  this->clear_point_locator();
248 
249  // Allow our GhostingFunctor objects to reinit if necessary.
250  // Do this before partitioning and redistributing, and before
251  // deleting remote elements.
252  std::set<GhostingFunctor *>::iterator gf_it = this->ghosting_functors_begin();
253  const std::set<GhostingFunctor *>::iterator gf_end = this->ghosting_functors_end();
254  for (; gf_it != gf_end; ++gf_it)
255  {
256  GhostingFunctor *gf = *gf_it;
257  libmesh_assert(gf);
258  gf->mesh_reinit();
259  }
260 
261  // Partition the mesh.
262  this->partition();
263 
264  // If we're using DistributedMesh, we'll probably want it
265  // parallelized.
267  this->delete_remote_elements();
268 
271 
272  // The mesh is now prepared for use.
273  _is_prepared = true;
274 
275 #if defined(DEBUG) && defined(LIBMESH_ENABLE_UNIQUE_ID)
278 #endif
279 }
280 
281 
282 
284 {
285  // Reset the number of partitions
286  _n_parts = 1;
287 
288  // Reset the _is_prepared flag
289  _is_prepared = false;
290 
291  // Clear boundary information
292  this->get_boundary_info().clear();
293 
294  // Clear element dimensions
295  _elem_dims.clear();
296 
297  // Clear our point locator.
298  this->clear_point_locator();
299 }
300 
301 
302 
304 {
305  // We should only be trying to remove ghosting functors we actually
306  // have
307  libmesh_assert(_ghosting_functors.count(&ghosting_functor));
308  _ghosting_functors.erase(&ghosting_functor);
309 }
310 
311 
312 
313 void MeshBase::subdomain_ids (std::set<subdomain_id_type> & ids) const
314 {
315  // This requires an inspection on every processor
316  parallel_object_only();
317 
318  ids.clear();
319 
322 
323  for (; el!=end; ++el)
324  ids.insert((*el)->subdomain_id());
325 
326  // Some subdomains may only live on other processors
327  this->comm().set_union(ids);
328 }
329 
330 
331 
333 {
334  // This requires an inspection on every processor
335  parallel_object_only();
336 
337  std::set<subdomain_id_type> ids;
338 
339  this->subdomain_ids (ids);
340 
341  return cast_int<subdomain_id_type>(ids.size());
342 }
343 
344 
345 
346 
348 {
349  // We're either counting a processor's nodes or unpartitioned
350  // nodes
351  libmesh_assert (proc_id < this->n_processors() ||
353 
354  return static_cast<dof_id_type>(std::distance (this->pid_nodes_begin(proc_id),
355  this->pid_nodes_end (proc_id)));
356 }
357 
358 
359 
361 {
362  // We're either counting a processor's elements or unpartitioned
363  // elements
364  libmesh_assert (proc_id < this->n_processors() ||
366 
367  return static_cast<dof_id_type>(std::distance (this->pid_elements_begin(proc_id),
368  this->pid_elements_end (proc_id)));
369 }
370 
371 
372 
374 {
375  libmesh_assert_less (proc_id, this->n_processors());
376  return static_cast<dof_id_type>(std::distance (this->active_pid_elements_begin(proc_id),
377  this->active_pid_elements_end (proc_id)));
378 }
379 
380 
381 
383 {
384  dof_id_type ne=0;
385 
387  const const_element_iterator end = this->elements_end();
388 
389  for (; el!=end; ++el)
390  ne += (*el)->n_sub_elem();
391 
392  return ne;
393 }
394 
395 
396 
398 {
399  dof_id_type ne=0;
400 
403 
404  for (; el!=end; ++el)
405  ne += (*el)->n_sub_elem();
406 
407  return ne;
408 }
409 
410 
411 
412 std::string MeshBase::get_info() const
413 {
414  std::ostringstream oss;
415 
416  oss << " Mesh Information:" << '\n';
417 
418  if (!_elem_dims.empty())
419  {
420  oss << " elem_dimensions()={";
421  std::copy(_elem_dims.begin(),
422  --_elem_dims.end(), // --end() is valid if the set is non-empty
423  std::ostream_iterator<unsigned int>(oss, ", "));
424  oss << cast_int<unsigned int>(*_elem_dims.rbegin());
425  oss << "}\n";
426  }
427 
428  oss << " spatial_dimension()=" << this->spatial_dimension() << '\n'
429  << " n_nodes()=" << this->n_nodes() << '\n'
430  << " n_local_nodes()=" << this->n_local_nodes() << '\n'
431  << " n_elem()=" << this->n_elem() << '\n'
432  << " n_local_elem()=" << this->n_local_elem() << '\n'
433 #ifdef LIBMESH_ENABLE_AMR
434  << " n_active_elem()=" << this->n_active_elem() << '\n'
435 #endif
436  << " n_subdomains()=" << static_cast<std::size_t>(this->n_subdomains()) << '\n'
437  << " n_partitions()=" << static_cast<std::size_t>(this->n_partitions()) << '\n'
438  << " n_processors()=" << static_cast<std::size_t>(this->n_processors()) << '\n'
439  << " n_threads()=" << static_cast<std::size_t>(libMesh::n_threads()) << '\n'
440  << " processor_id()=" << static_cast<std::size_t>(this->processor_id()) << '\n';
441 
442  return oss.str();
443 }
444 
445 
446 void MeshBase::print_info(std::ostream & os) const
447 {
448  os << this->get_info()
449  << std::endl;
450 }
451 
452 
453 std::ostream & operator << (std::ostream & os, const MeshBase & m)
454 {
455  m.print_info(os);
456  return os;
457 }
458 
459 
460 void MeshBase::partition (const unsigned int n_parts)
461 {
462  // If we get here and we have unpartitioned elements, we need that
463  // fixed.
464  if (this->n_unpartitioned_elem() > 0)
465  {
466  libmesh_assert (partitioner().get());
467  libmesh_assert (this->is_serial());
468  partitioner()->partition (*this, n_parts);
469  }
470  // NULL partitioner means don't repartition
471  // Non-serial meshes may not be ready for repartitioning here.
472  else if(!skip_partitioning() &&
473  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:347
dof_id_type n_active_sub_elem() const
Definition: mesh_base.C:397
bool closed()
Definition: libmesh.C:279
const BoundaryInfo & get_boundary_info() const
Definition: mesh_base.h:111
bool _skip_renumber_nodes_and_elements
Definition: mesh_base.h:1323
UniquePtr< PointLocatorBase > _point_locator
Definition: mesh_base.h:1290
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:134
virtual node_iterator pid_nodes_end(processor_id_type proc_id)=0
UniquePtr< BoundaryInfo > boundary_info
Definition: mesh_base.h:1256
bool skip_partitioning() const
Definition: mesh_base.h:732
void detect_interior_parents()
Definition: mesh_base.C:675
dof_id_type n_local_nodes() const
Definition: mesh_base.h:245
static void set_node_processor_ids(MeshBase &mesh)
Definition: partitioner.C:431
unsigned int n_partitions() const
Definition: mesh_base.h:788
void set_spatial_dimension(unsigned char d)
Definition: mesh_base.C:164
dof_id_type n_unpartitioned_elem() const
Definition: mesh_base.h:345
processor_id_type n_processors() const
const Elem * interior_parent() const
Definition: elem.C:940
void remove_ghosting_functor(GhostingFunctor &ghosting_functor)
Definition: mesh_base.C:303
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:486
UniquePtr< Partitioner > _partitioner
Definition: mesh_base.h:1304
IterBase * end
unsigned char _spatial_dimension
Definition: mesh_base.h:1351
bool _allow_remote_element_removal
Definition: mesh_base.h:1331
std::string get_info() const
Definition: mesh_base.C:412
long double max(long double a, double b)
bool in_threads
Definition: threads.C:31
void set_interior_parent(Elem *p)
Definition: elem.C:992
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:761
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:1367
unique_id_type _next_unique_id
Definition: mesh_base.h:1310
unsigned int _n_parts
Definition: mesh_base.h:1276
virtual dof_id_type max_elem_id() const =0
static const subdomain_id_type invalid_subdomain_id
Definition: elem.h:215
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:360
void subdomain_ids(std::set< subdomain_id_type > &ids) const
Definition: mesh_base.C:313
static const processor_id_type invalid_processor_id
Definition: dof_object.h:346
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:1210
std::set< unsigned char > _elem_dims
Definition: mesh_base.h:1345
void prepare_for_use(const bool skip_renumber_nodes_and_elements=false, const bool skip_find_neighbors=false)
Definition: mesh_base.C:174
unsigned int spatial_dimension() const
Definition: mesh_base.C:157
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:184
subdomain_id_type get_id_by_name(const std::string &name) const
Definition: mesh_base.C:593
virtual void clear()
Definition: mesh_base.C:283
friend std::ostream & operator<<(std::ostream &os, const MeshBase &m)
Definition: mesh_base.C:453
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:1358
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:453
Parallel::FakeCommunicator CommWorld
Definition: libmesh.C:206
unsigned int recalculate_n_partitions()
Definition: mesh_base.C:492
dof_id_type n_local_elem() const
Definition: mesh_base.h:339
std::set< GhostingFunctor * >::const_iterator ghosting_functors_begin() const
Definition: mesh_base.h:755
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:106
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:914
const Parallel::Communicator & comm() const
unsigned int mesh_dimension() const
Definition: mesh_base.C:148
bool allow_renumbering() const
Definition: mesh_base.h:708
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:139
virtual const Node & node(const dof_id_type i) const
Definition: mesh_base.h:405
bool initialized()
Definition: libmesh.C:272
dof_id_type n_sub_elem() const
Definition: mesh_base.C:382
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1617
virtual void delete_remote_elements()
Definition: mesh_base.h:161
void cache_elem_dims()
Definition: mesh_base.C:609
virtual void update_post_partitioning()
Definition: mesh_base.h:699
dof_id_type id() const
Definition: dof_object.h:624
void libmesh_assert_valid_unique_ids(const MeshBase &mesh)
Definition: mesh_tools.C:1360
subdomain_id_type n_subdomains() const
Definition: mesh_base.C:332
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:1296
void print_info(std::ostream &os=libMesh::out) const
Definition: mesh_base.C:446
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:1338
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:373
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