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