Reference documentation for deal.II version 8.4.2
shared_tria.h
1 // ---------------------------------------------------------------------
2 // @f$Id: tria.h 32739 2014-04-08 16:39:47Z denis.davydov @f$
3 //
4 // Copyright (C) 2008 - 2016 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 #ifndef dealii__distributed__shared_tria_h
18 #define dealii__distributed__shared_tria_h
19 
20 
21 #include <deal.II/base/config.h>
22 #include <deal.II/base/subscriptor.h>
23 #include <deal.II/base/smartpointer.h>
24 #include <deal.II/base/template_constraints.h>
25 #include <deal.II/grid/tria.h>
26 
27 #include <deal.II/distributed/tria_base.h>
28 
29 #include <deal.II/base/std_cxx1x/function.h>
30 #include <deal.II/base/std_cxx1x/tuple.h>
31 
32 #include <set>
33 #include <vector>
34 #include <list>
35 #include <utility>
36 
37 #ifdef DEAL_II_WITH_MPI
38 # include <mpi.h>
39 #endif
40 
41 
42 DEAL_II_NAMESPACE_OPEN
43 
44 template <int, int> class Triangulation;
45 
46 
47 namespace parallel
48 {
49 
50 #ifdef DEAL_II_WITH_MPI
51 
52 
53  namespace shared
54  {
55 
70  template <int dim, int spacedim = dim>
71  class Triangulation : public ::parallel::Triangulation<dim,spacedim>
72  {
73  public:
74  typedef typename ::Triangulation<dim,spacedim>::active_cell_iterator active_cell_iterator;
75  typedef typename ::Triangulation<dim,spacedim>::cell_iterator cell_iterator;
76 
87  const typename ::Triangulation<dim,spacedim>::MeshSmoothing =
89  const bool allow_artificial_cells = false);
90 
94  virtual ~Triangulation ();
95 
104  virtual void execute_coarsening_and_refinement ();
105 
112  virtual void create_triangulation (const std::vector< Point< spacedim > > &vertices,
113  const std::vector< CellData< dim > > &cells,
114  const SubCellData &subcelldata);
115 
124  const std::vector<types::subdomain_id> &get_true_subdomain_ids_of_cells() const;
125 
130  bool with_artificial_cells() const;
131 
132  private:
137 
142  void partition();
143 
155  std::vector<types::subdomain_id> true_subdomain_ids_of_cells;
156  };
157  }
158 #else
159 
160  namespace shared
161  {
162 
173  template <int dim, int spacedim = dim>
174  class Triangulation : public ::parallel::Triangulation<dim,spacedim>
175  {
176  public:
177 
181  const std::vector<types::subdomain_id> &get_true_subdomain_ids_of_cells() const;
182 
186  bool with_artificial_cells() const;
187  private:
191  Triangulation ();
192 
196  std::vector<types::subdomain_id> true_subdomain_ids_of_cells;
197  };
198  }
199 
200 
201 #endif
202 }
203 
204 DEAL_II_NAMESPACE_CLOSE
205 
206 #endif
virtual void execute_coarsening_and_refinement()
Definition: shared_tria.cc:121
const std::vector< types::subdomain_id > & get_true_subdomain_ids_of_cells() const
Definition: shared_tria.cc:108
Triangulation(MPI_Comm mpi_communicator, const typename ::Triangulation< dim, spacedim >::MeshSmoothing=(::Triangulation< dim, spacedim >::none), const bool allow_artificial_cells=false)
Definition: shared_tria.cc:48
std::vector< Point< spacedim > > vertices
Definition: tria.h:3296
virtual void create_triangulation(const std::vector< Point< spacedim > > &vertices, const std::vector< CellData< dim > > &cells, const SubCellData &subcelldata)
Definition: shared_tria.cc:130
std::vector< types::subdomain_id > true_subdomain_ids_of_cells
Definition: shared_tria.h:155