Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
shared_tria.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2008 - 2020 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_distributed_shared_tria_h
17 #define dealii_distributed_shared_tria_h
18 
19 
20 #include <deal.II/base/config.h>
21 
25 
27 
28 #include <deal.II/grid/tria.h>
29 
30 #include <functional>
31 #include <list>
32 #include <set>
33 #include <tuple>
34 #include <utility>
35 #include <vector>
36 
37 #ifdef DEAL_II_WITH_MPI
38 # include <mpi.h>
39 #endif
40 
41 
43 
44 namespace parallel
45 {
46 #ifdef DEAL_II_WITH_MPI
47 
48 
49  namespace shared
50  {
102  template <int dim, int spacedim = dim>
104  : public ::parallel::TriangulationBase<dim, spacedim>
105  {
106  public:
107  using active_cell_iterator =
108  typename ::Triangulation<dim, spacedim>::active_cell_iterator;
109  using cell_iterator =
110  typename ::Triangulation<dim, spacedim>::cell_iterator;
111 
125  enum Settings
126  {
137 
142 
161 
166 
217 
227  };
228 
229 
241  const typename ::Triangulation<dim, spacedim>::MeshSmoothing =
243  const bool allow_artificial_cells = false,
245 
249  virtual ~Triangulation() override = default;
250 
254  virtual bool
255  is_multilevel_hierarchy_constructed() const override;
256 
265  virtual void
267 
274  virtual void
275  create_triangulation(const std::vector<Point<spacedim>> &vertices,
276  const std::vector<CellData<dim>> & cells,
277  const SubCellData &subcelldata) override;
278 
279  /*
280  * @copydoc Triangulation::create_triangulation()
281  *
282  * @note Not inmplemented yet.
283  */
284  virtual void
287  &construction_data) override;
288 
299  virtual void
301  const ::Triangulation<dim, spacedim> &other_tria) override;
302 
311  template <class Archive>
312  void
313  load(Archive &ar, const unsigned int version);
314 
323  const std::vector<types::subdomain_id> &
325 
334  const std::vector<types::subdomain_id> &
335  get_true_level_subdomain_ids_of_cells(const unsigned int level) const;
336 
341  bool
342  with_artificial_cells() const;
343 
344  private:
349 
354 
359  void
360  partition();
361 
374  std::vector<types::subdomain_id> true_subdomain_ids_of_cells;
375 
384  std::vector<std::vector<types::subdomain_id>>
386  };
387 
388  template <int dim, int spacedim>
389  template <class Archive>
390  void
391  Triangulation<dim, spacedim>::load(Archive &ar, const unsigned int version)
392  {
394  partition();
395  this->update_number_cache();
396  }
397  } // namespace shared
398 #else
399 
400  namespace shared
401  {
413  template <int dim, int spacedim = dim>
414  class Triangulation
415  : public ::parallel::TriangulationBase<dim, spacedim>
416  {
417  public:
422  Triangulation() = delete;
423 
427  virtual bool
428  is_multilevel_hierarchy_constructed() const override;
429 
433  const std::vector<types::subdomain_id> &
435 
439  const std::vector<types::subdomain_id> &
440  get_true_level_subdomain_ids_of_cells(const unsigned int level) const;
441 
445  bool
446  with_artificial_cells() const;
447 
448  private:
452  std::vector<types::subdomain_id> true_subdomain_ids_of_cells;
453 
457  std::vector<types::subdomain_id> true_level_subdomain_ids_of_cells;
458  };
459  } // namespace shared
460 
461 
462 #endif
463 } // namespace parallel
464 
466 
467 #endif
parallel::shared::Triangulation
Definition: shared_tria.h:103
parallel::TriangulationBase< dim, dim >::mpi_communicator
MPI_Comm mpi_communicator
Definition: tria_base.h:240
parallel::shared::Triangulation::copy_triangulation
virtual void copy_triangulation(const ::Triangulation< dim, spacedim > &other_tria) override
Definition: shared_tria.cc:407
Triangulation::load
void load(Archive &ar, const unsigned int version)
CellData
Definition: tria_description.h:67
parallel::shared::Triangulation::true_subdomain_ids_of_cells
std::vector< types::subdomain_id > true_subdomain_ids_of_cells
Definition: shared_tria.h:374
parallel::shared::Triangulation::create_triangulation
virtual void create_triangulation(const std::vector< Point< spacedim >> &vertices, const std::vector< CellData< dim >> &cells, const SubCellData &subcelldata) override
Definition: shared_tria.cc:368
tria.h
parallel::shared::Triangulation::cell_iterator
typename ::Triangulation< dim, spacedim >::cell_iterator cell_iterator
Definition: shared_tria.h:110
MPI_Comm
parallel::shared::Triangulation::construct_multigrid_hierarchy
@ construct_multigrid_hierarchy
Definition: shared_tria.h:226
parallel::shared::Triangulation::partition_zorder
@ partition_zorder
Definition: shared_tria.h:160
SparsityTools::partition
void partition(const SparsityPattern &sparsity_pattern, const unsigned int n_partitions, std::vector< unsigned int > &partition_indices, const Partitioner partitioner=Partitioner::metis)
Definition: sparsity_tools.cc:400
level
unsigned int level
Definition: grid_out.cc:4355
parallel::shared::Triangulation::true_level_subdomain_ids_of_cells
std::vector< std::vector< types::subdomain_id > > true_level_subdomain_ids_of_cells
Definition: shared_tria.h:385
parallel::shared::Triangulation::Settings
Settings
Definition: shared_tria.h:125
parallel::shared::Triangulation::execute_coarsening_and_refinement
virtual void execute_coarsening_and_refinement() override
Definition: shared_tria.cc:357
mpi.h
parallel::shared::Triangulation::is_multilevel_hierarchy_constructed
virtual bool is_multilevel_hierarchy_constructed() const override
Definition: shared_tria.cc:74
subscriptor.h
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
smartpointer.h
parallel::shared::Triangulation::load
void load(Archive &ar, const unsigned int version)
Definition: shared_tria.h:391
parallel::shared::Triangulation::get_true_level_subdomain_ids_of_cells
const std::vector< types::subdomain_id > & get_true_level_subdomain_ids_of_cells(const unsigned int level) const
Definition: shared_tria.cc:342
parallel::shared::Triangulation::partition_custom_signal
@ partition_custom_signal
Definition: shared_tria.h:216
parallel::shared::Triangulation::partition_metis
@ partition_metis
Definition: shared_tria.h:141
Triangulation::vertices
std::vector< Point< spacedim > > vertices
Definition: tria.h:3848
Point< spacedim >
parallel::TriangulationBase
Definition: tria_base.h:78
template_constraints.h
config.h
parallel::shared::Triangulation::get_true_subdomain_ids_of_cells
const std::vector< types::subdomain_id > & get_true_subdomain_ids_of_cells() const
Definition: shared_tria.cc:333
TriangulationDescription::Description
Definition: tria_description.h:347
SubCellData
Definition: tria_description.h:199
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
parallel::shared::Triangulation::Triangulation
Triangulation(MPI_Comm mpi_communicator, const typename ::Triangulation< dim, spacedim >::MeshSmoothing=(::Triangulation< dim, spacedim >::none), const bool allow_artificial_cells=false, const Settings settings=partition_auto)
Definition: shared_tria.cc:39
parallel::shared::Triangulation::allow_artificial_cells
const bool allow_artificial_cells
Definition: shared_tria.h:353
parallel::shared::Triangulation::settings
const Settings settings
Definition: shared_tria.h:348
parallel::shared::Triangulation::partition_zoltan
@ partition_zoltan
Definition: shared_tria.h:165
parallel::shared::Triangulation::partition
void partition()
Definition: shared_tria.cc:83
parallel::shared::Triangulation::~Triangulation
virtual ~Triangulation() override=default
parallel
Definition: distributed.h:416
parallel::shared::Triangulation::with_artificial_cells
bool with_artificial_cells() const
Definition: shared_tria.cc:324
tria_base.h
parallel::shared::Triangulation::partition_auto
@ partition_auto
Definition: shared_tria.h:136
parallel::shared::Triangulation::active_cell_iterator
typename ::Triangulation< dim, spacedim >::active_cell_iterator active_cell_iterator
Definition: shared_tria.h:108