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