Reference documentation for deal.II version GIT 6823c776d5 2023-12-04 20:20:02+00:00
\(\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 - 2023 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_stub.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 
187  template <class Archive>
188  void
189  serialize(Archive &ar, const unsigned int version);
190  };
191 
192 
193  template <class Archive>
194  void
195  NumberCache::serialize(Archive &ar, const unsigned int /*version*/)
196  {
198  ar &locally_owned_dofs;
201  }
202 
203  } // namespace DoFHandlerImplementation
204 } // namespace internal
205 
206 
208 
209 #endif // dealii_dof_iterator_selector_h
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:477
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:478
unsigned int global_dof_index
Definition: types.h:82
std::vector< types::global_dof_index > n_locally_owned_dofs_per_processor
Definition: number_cache.h:169
std::vector< IndexSet > locally_owned_dofs_per_processor
Definition: number_cache.h:180
std::vector< IndexSet > get_locally_owned_dofs_per_processor(const MPI_Comm mpi_communicator) const
NumberCache & operator=(NumberCache &&)=default
NumberCache(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:86
NumberCache & operator=(const NumberCache &)=default
void serialize(Archive &ar, const unsigned int version)
Definition: number_cache.h:195