Reference documentation for deal.II version 9.1.1
\(\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 
23 #include <vector>
24 
25 
26 DEAL_II_NAMESPACE_OPEN
27 
28 namespace internal
29 {
30  namespace DoFHandlerImplementation
31  {
36  struct NumberCache
37  {
41  NumberCache();
42 
47  NumberCache(const NumberCache &) = default;
48 
53  NumberCache(NumberCache &&) = default;
54 
65 
66 
80  NumberCache(const std::vector<IndexSet> &locally_owned_dofs_per_processor,
81  const unsigned int my_rank);
82 
87  NumberCache &
88  operator=(const NumberCache &) = default;
89 
94  NumberCache &
95  operator=(NumberCache &&) = default;
96 
101  std::size_t
102  memory_consumption() const;
103 
107  void
108  clear();
109 
115 
125 
136 
146  std::vector<types::global_dof_index> n_locally_owned_dofs_per_processor;
147 
157  std::vector<IndexSet> locally_owned_dofs_per_processor;
158 
163  template <class Archive>
164  void
165  serialize(Archive &ar, const unsigned int version);
166  };
167 
168 
169  template <class Archive>
170  void
171  NumberCache::serialize(Archive &ar, const unsigned int /*version*/)
172  {
174  ar & locally_owned_dofs;
177  }
178 
179  } // namespace DoFHandlerImplementation
180 } // namespace internal
181 
182 
183 DEAL_II_NAMESPACE_CLOSE
184 
185 #endif // dealii_dof_iterator_selector_h
NumberCache & operator=(const NumberCache &)=default
std::vector< types::global_dof_index > n_locally_owned_dofs_per_processor
Definition: number_cache.h:146
void serialize(Archive &ar, const unsigned int version)
Definition: number_cache.h:171
unsigned int global_dof_index
Definition: types.h:89
std::vector< IndexSet > locally_owned_dofs_per_processor
Definition: number_cache.h:157