Reference documentation for deal.II version Git 7026f387cc 2019-10-15 14:19:01 -0400
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
number_cache.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2018 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_number_cache_h
17 #define dealii_number_cache_h
18 
19 #include <deal.II/base/config.h>
20 
21 #include <deal.II/base/index_set.h>
22 #include <deal.II/base/mpi.h>
23 
24 #include <vector>
25 
26 
27 DEAL_II_NAMESPACE_OPEN
28 
29 namespace internal
30 {
31  namespace DoFHandlerImplementation
32  {
37  struct NumberCache
38  {
42  NumberCache();
43 
48  NumberCache(const NumberCache &) = default;
49 
54  NumberCache(NumberCache &&) = default;
55 
66 
67 
81  NumberCache(const std::vector<IndexSet> &locally_owned_dofs_per_processor,
82  const unsigned int my_rank);
83 
88  NumberCache &
89  operator=(const NumberCache &) = default;
90 
95  NumberCache &
96  operator=(NumberCache &&) = default;
97 
102  std::size_t
103  memory_consumption() const;
104 
108  void
109  clear();
110 
118  std::vector<types::global_dof_index>
120  const MPI_Comm mpi_communicator) const;
121 
129  std::vector<IndexSet>
131  const MPI_Comm mpi_communicator) const;
132 
138 
148 
159 
169  std::vector<types::global_dof_index> n_locally_owned_dofs_per_processor;
170 
180  std::vector<IndexSet> locally_owned_dofs_per_processor;
181 
186  template <class Archive>
187  void
188  serialize(Archive &ar, const unsigned int version);
189  };
190 
191 
192  template <class Archive>
193  void
194  NumberCache::serialize(Archive &ar, const unsigned int /*version*/)
195  {
197  ar & locally_owned_dofs;
200  }
201 
202  } // namespace DoFHandlerImplementation
203 } // namespace internal
204 
205 
206 DEAL_II_NAMESPACE_CLOSE
207 
208 #endif // dealii_dof_iterator_selector_h
NumberCache & operator=(const NumberCache &)=default
std::vector< types::global_dof_index > get_n_locally_owned_dofs_per_processor(const MPI_Comm mpi_communicator) const
Definition: number_cache.cc:87
std::vector< types::global_dof_index > n_locally_owned_dofs_per_processor
Definition: number_cache.h:169
void serialize(Archive &ar, const unsigned int version)
Definition: number_cache.h:194
std::vector< IndexSet > get_locally_owned_dofs_per_processor(const MPI_Comm mpi_communicator) const
unsigned int global_dof_index
Definition: types.h:89
std::vector< IndexSet > locally_owned_dofs_per_processor
Definition: number_cache.h:180