Reference documentation for deal.II version Git a73d35cdfe 2020-05-28 10:34:58 +0200
\(\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 
240  MPI_Comm mpi_communicator,
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
std::vector< std::vector< types::subdomain_id > > true_level_subdomain_ids_of_cells
Definition: shared_tria.h:385
virtual bool is_multilevel_hierarchy_constructed() const override
Definition: shared_tria.cc:74
std::vector< Point< spacedim > > vertices
Definition: tria.h:3845
const std::vector< types::subdomain_id > & get_true_subdomain_ids_of_cells() const
Definition: shared_tria.cc:333
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
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:110
void load(Archive &ar, const unsigned int version)
virtual ~Triangulation() override=default
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:362
unsigned int level
Definition: grid_out.cc:4355
virtual void update_number_cache()
Definition: tria_base.cc:146
std::vector< types::subdomain_id > true_subdomain_ids_of_cells
Definition: shared_tria.h:374
typename ::Triangulation< dim, spacedim >::active_cell_iterator active_cell_iterator
Definition: shared_tria.h:108
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:361
void load(Archive &ar, const unsigned int version)
Definition: shared_tria.h:391
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