Reference documentation for deal.II version Git fe553f7db3 2020-12-03 08:11:48 +0100
\(\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  {
100  template <int dim, int spacedim = dim>
102  : public ::parallel::TriangulationBase<dim, spacedim>
103  {
104  public:
105  using active_cell_iterator =
106  typename ::Triangulation<dim, spacedim>::active_cell_iterator;
107  using cell_iterator =
108  typename ::Triangulation<dim, spacedim>::cell_iterator;
109 
123  enum Settings
124  {
135 
140 
159 
164 
215 
225  };
226 
227 
238  const MPI_Comm &mpi_communicator,
239  const typename ::Triangulation<dim, spacedim>::MeshSmoothing =
241  const bool allow_artificial_cells = false,
243 
247  virtual ~Triangulation() override = default;
248 
252  virtual bool
253  is_multilevel_hierarchy_constructed() const override;
254 
263  virtual void
265 
272  virtual void
273  create_triangulation(const std::vector<Point<spacedim>> &vertices,
274  const std::vector<CellData<dim>> & cells,
275  const SubCellData &subcelldata) override;
276 
282  virtual void
285  &construction_data) override;
286 
297  virtual void
299  const ::Triangulation<dim, spacedim> &other_tria) override;
300 
309  template <class Archive>
310  void
311  load(Archive &ar, const unsigned int version);
312 
321  const std::vector<types::subdomain_id> &
323 
332  const std::vector<types::subdomain_id> &
333  get_true_level_subdomain_ids_of_cells(const unsigned int level) const;
334 
339  bool
340  with_artificial_cells() const;
341 
342  private:
347 
352 
357  void
358  partition();
359 
372  std::vector<types::subdomain_id> true_subdomain_ids_of_cells;
373 
382  std::vector<std::vector<types::subdomain_id>>
384  };
385 
386  template <int dim, int spacedim>
387  template <class Archive>
388  void
389  Triangulation<dim, spacedim>::load(Archive &ar, const unsigned int version)
390  {
392  partition();
393  this->update_number_cache();
394  }
395  } // namespace shared
396 #else
397 
398  namespace shared
399  {
411  template <int dim, int spacedim = dim>
412  class Triangulation
413  : public ::parallel::TriangulationBase<dim, spacedim>
414  {
415  public:
420  Triangulation() = delete;
421 
425  virtual bool
426  is_multilevel_hierarchy_constructed() const override;
427 
431  const std::vector<types::subdomain_id> &
433 
437  const std::vector<types::subdomain_id> &
438  get_true_level_subdomain_ids_of_cells(const unsigned int level) const;
439 
443  bool
444  with_artificial_cells() const;
445 
446  private:
450  std::vector<types::subdomain_id> true_subdomain_ids_of_cells;
451 
455  std::vector<types::subdomain_id> true_level_subdomain_ids_of_cells;
456  };
457  } // namespace shared
458 
459 
460 #endif
461 } // namespace parallel
462 
464 
465 #endif
std::vector< std::vector< types::subdomain_id > > true_level_subdomain_ids_of_cells
Definition: shared_tria.h:383
virtual bool is_multilevel_hierarchy_constructed() const override
Definition: shared_tria.cc:74
std::vector< Point< spacedim > > vertices
Definition: tria.h:3938
const std::vector< types::subdomain_id > & get_true_subdomain_ids_of_cells() const
Definition: shared_tria.cc:333
virtual void execute_coarsening_and_refinement() override
Definition: shared_tria.cc:357
const std::vector< types::subdomain_id > & get_true_level_subdomain_ids_of_cells(const unsigned int level) const
Definition: shared_tria.cc:342
typename ::Triangulation< dim, spacedim >::cell_iterator cell_iterator
Definition: shared_tria.h:108
Triangulation(const 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
void load(Archive &ar, const unsigned int version)
virtual ~Triangulation() override=default
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:372
unsigned int level
Definition: grid_out.cc:4343
virtual void update_number_cache()
Definition: tria_base.cc:147
std::vector< types::subdomain_id > true_subdomain_ids_of_cells
Definition: shared_tria.h:372
typename ::Triangulation< dim, spacedim >::active_cell_iterator active_cell_iterator
Definition: shared_tria.h:106
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:371
void load(Archive &ar, const unsigned int version)
Definition: shared_tria.h:389
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
virtual void copy_triangulation(const ::Triangulation< dim, spacedim > &other_tria) override
Definition: shared_tria.cc:407