Reference documentation for deal.II version 9.2.0
\(\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\}}\)
number_cache.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2019 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 
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 
207 
208 #endif // dealii_dof_iterator_selector_h
IndexSet
Definition: index_set.h:74
MPI_Comm
internal::DoFHandlerImplementation::NumberCache::operator=
NumberCache & operator=(const NumberCache &)=default
internal::DoFHandlerImplementation::NumberCache::clear
void clear()
Definition: number_cache.cc:75
internal::DoFHandlerImplementation::NumberCache::locally_owned_dofs
IndexSet locally_owned_dofs
Definition: number_cache.h:158
internal::DoFHandlerImplementation::NumberCache
Definition: number_cache.h:37
mpi.h
index_set.h
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
internal::DoFHandlerImplementation::NumberCache::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: number_cache.h:194
internal::DoFHandlerImplementation::NumberCache::n_locally_owned_dofs
types::global_dof_index n_locally_owned_dofs
Definition: number_cache.h:147
internal::DoFHandlerImplementation::NumberCache::n_locally_owned_dofs_per_processor
std::vector< types::global_dof_index > n_locally_owned_dofs_per_processor
Definition: number_cache.h:169
internal::DoFHandlerImplementation::NumberCache::get_n_locally_owned_dofs_per_processor
std::vector< types::global_dof_index > get_n_locally_owned_dofs_per_processor(const MPI_Comm mpi_communicator) const
Definition: number_cache.cc:87
unsigned int
internal::DoFHandlerImplementation::NumberCache::n_global_dofs
types::global_dof_index n_global_dofs
Definition: number_cache.h:137
config.h
internal
Definition: aligned_vector.h:369
internal::DoFHandlerImplementation::NumberCache::get_locally_owned_dofs_per_processor
std::vector< IndexSet > get_locally_owned_dofs_per_processor(const MPI_Comm mpi_communicator) const
Definition: number_cache.cc:110
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
internal::DoFHandlerImplementation::NumberCache::locally_owned_dofs_per_processor
std::vector< IndexSet > locally_owned_dofs_per_processor
Definition: number_cache.h:180
internal::DoFHandlerImplementation::NumberCache::NumberCache
NumberCache()
Definition: number_cache.cc:30
internal::DoFHandlerImplementation::NumberCache::memory_consumption
std::size_t memory_consumption() const
Definition: number_cache.cc:133