Reference documentation for deal.II version 9.0.0
tria_base.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2008 - 2017 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 at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_distributed_tria_base_h
17 #define dealii_distributed_tria_base_h
18 
19 
20 #include <deal.II/base/config.h>
21 #include <deal.II/base/subscriptor.h>
22 #include <deal.II/base/smartpointer.h>
23 #include <deal.II/base/template_constraints.h>
24 #include <deal.II/base/mpi.h>
25 #include <deal.II/grid/tria.h>
26 
27 #include <functional>
28 #include <tuple>
29 #include <set>
30 #include <vector>
31 #include <list>
32 #include <utility>
33 
34 
35 DEAL_II_NAMESPACE_OPEN
36 
37 namespace parallel
38 {
44  template <int dim, int spacedim = dim>
45  class Triangulation : public ::Triangulation<dim,spacedim>
46  {
47  public:
48 
53  const typename ::Triangulation<dim,spacedim>::MeshSmoothing smooth_grid = (::Triangulation<dim,spacedim>::none),
54  const bool check_for_distorted_cells = false);
55 
59  virtual ~Triangulation ();
60 
64  virtual MPI_Comm get_communicator () const;
65 
69  virtual void copy_triangulation (const ::Triangulation<dim, spacedim> &old_tria);
70 
77  const std::vector<unsigned int> &
79 
80 
99  unsigned int n_locally_owned_active_cells () const;
100 
107 
111  virtual std::size_t memory_consumption () const;
112 
113 
121  virtual unsigned int n_global_levels () const;
122 
130 
139  const std::set<types::subdomain_id> &
140  ghost_owners () const;
141 
151  const std::set<types::subdomain_id> &
152  level_ghost_owners () const;
153 
158  virtual std::map<unsigned int, std::set<::types::subdomain_id> >
160 
161  protected:
168 
174 
179 
184  struct NumberCache
185  {
190  std::vector<unsigned int> n_locally_owned_active_cells;
201  unsigned int n_global_levels;
206  std::set<types::subdomain_id> ghost_owners;
211  std::set<types::subdomain_id> level_ghost_owners;
212 
213  NumberCache();
214  };
215 
216  NumberCache number_cache;
217 
221  virtual void update_number_cache ();
222 
226  void fill_level_ghost_owners ();
227  };
228 
229 } // namespace parallel
230 
231 DEAL_II_NAMESPACE_CLOSE
232 
233 #endif
types::global_dof_index n_global_active_cells
Definition: tria_base.h:195
virtual std::map< unsigned int, std::set<::types::subdomain_id > > compute_vertices_with_ghost_neighbors() const
Definition: tria_base.cc:337
const std::vector< unsigned int > & n_locally_owned_active_cells_per_processor() const
Definition: tria_base.cc:139
types::subdomain_id my_subdomain
Definition: tria_base.h:173
std::set< types::subdomain_id > ghost_owners
Definition: tria_base.h:206
virtual void copy_triangulation(const ::Triangulation< dim, spacedim > &old_tria)
Definition: tria_base.cc:63
const std::set< types::subdomain_id > & ghost_owners() const
Definition: tria_base.cc:317
std::set< types::subdomain_id > level_ghost_owners
Definition: tria_base.h:211
std::vector< unsigned int > n_locally_owned_active_cells
Definition: tria_base.h:190
const bool check_for_distorted_cells
Definition: tria.h:3610
unsigned int global_dof_index
Definition: types.h:88
virtual void update_number_cache()
Definition: tria_base.cc:154
virtual MPI_Comm get_communicator() const
Definition: tria_base.cc:146
virtual types::global_dof_index n_global_active_cells() const
Definition: tria_base.cc:132
virtual std::size_t memory_consumption() const
Definition: tria_base.cc:88
unsigned int subdomain_id
Definition: types.h:42
virtual unsigned int n_global_levels() const
Definition: tria_base.cc:125
const std::set< types::subdomain_id > & level_ghost_owners() const
Definition: tria_base.cc:327
unsigned int n_locally_owned_active_cells() const
Definition: tria_base.cc:118
MeshSmoothing smooth_grid
Definition: tria.h:3325
Triangulation(MPI_Comm mpi_communicator, const typename ::Triangulation< dim, spacedim >::MeshSmoothing smooth_grid=(::Triangulation< dim, spacedim >::none), const bool check_for_distorted_cells=false)
Definition: tria_base.cc:42
types::subdomain_id locally_owned_subdomain() const
Definition: tria_base.cc:307
types::subdomain_id n_subdomains
Definition: tria_base.h:178