Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
dof_handler_policy.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_dof_handler_policy_h
17 # define dealii_dof_handler_policy_h
18 
19 
20 
21 # include <deal.II/base/config.h>
22 
23 # include <deal.II/base/exceptions.h>
24 # include <deal.II/base/template_constraints.h>
25 
26 # include <deal.II/dofs/dof_renumbering.h>
27 # include <deal.II/dofs/dof_tools.h>
28 
29 # include <map>
30 # include <set>
31 # include <vector>
32 
33 DEAL_II_NAMESPACE_OPEN
34 
35 template <int, int>
36 class DoFHandler;
37 
38 
39 namespace internal
40 {
41  namespace DoFHandlerImplementation
42  {
43  struct NumberCache;
44 
49  namespace Policy
50  {
51  struct Implementation;
52 
58  template <int dim, int spacedim>
59  class PolicyBase
60  {
61  public:
65  virtual ~PolicyBase() = default;
66 
75  virtual NumberCache
76  distribute_dofs() const = 0;
77 
83  virtual std::vector<NumberCache>
84  distribute_mg_dofs() const = 0;
85 
91  virtual NumberCache
93  const std::vector<types::global_dof_index> &new_numbers) const = 0;
94 
103  virtual NumberCache
105  const unsigned int level,
106  const std::vector<types::global_dof_index> &new_numbers) const = 0;
107  };
108 
109 
114  template <class DoFHandlerType>
115  class Sequential : public PolicyBase<DoFHandlerType::dimension,
116  DoFHandlerType::space_dimension>
117  {
118  public:
124  Sequential(DoFHandlerType &dof_handler);
125 
126  // documentation is inherited
127  virtual NumberCache
128  distribute_dofs() const override;
129 
130  // documentation is inherited
131  virtual std::vector<NumberCache>
132  distribute_mg_dofs() const override;
133 
134  // documentation is inherited
135  virtual NumberCache
136  renumber_dofs(const std::vector<types::global_dof_index> &new_numbers)
137  const override;
138 
139  // documentation is inherited
140  virtual NumberCache
141  renumber_mg_dofs(const unsigned int level,
142  const std::vector<types::global_dof_index>
143  &new_numbers) const override;
144 
145  protected:
150  };
151 
152 
153 
158  template <class DoFHandlerType>
159  class ParallelShared : public PolicyBase<DoFHandlerType::dimension,
160  DoFHandlerType::space_dimension>
161  {
162  public:
168  ParallelShared(DoFHandlerType &dof_handler);
169 
178  virtual NumberCache
179  distribute_dofs() const override;
180 
184  virtual std::vector<NumberCache>
185  distribute_mg_dofs() const override;
186 
196  virtual NumberCache
197  renumber_dofs(const std::vector<types::global_dof_index> &new_numbers)
198  const override;
199 
200  // documentation is inherited
201  virtual NumberCache
202  renumber_mg_dofs(const unsigned int level,
203  const std::vector<types::global_dof_index>
204  &new_numbers) const override;
205 
206  private:
211  };
212 
213 
218  template <class DoFHandlerType>
219  class ParallelDistributed
220  : public PolicyBase<DoFHandlerType::dimension,
221  DoFHandlerType::space_dimension>
222  {
223  public:
229  ParallelDistributed(DoFHandlerType &dof_handler);
230 
231  // documentation is inherited
232  virtual NumberCache
233  distribute_dofs() const override;
234 
235  // documentation is inherited
236  virtual std::vector<NumberCache>
237  distribute_mg_dofs() const override;
238 
239  // documentation is inherited
240  virtual NumberCache
241  renumber_dofs(const std::vector<types::global_dof_index> &new_numbers)
242  const override;
243 
244  // documentation is inherited
245  virtual NumberCache
246  renumber_mg_dofs(const unsigned int level,
247  const std::vector<types::global_dof_index>
248  &new_numbers) const override;
249 
250  private:
255  };
256  } // namespace Policy
257  } // namespace DoFHandlerImplementation
258 } // namespace internal
259 
260 
261 
262 DEAL_II_NAMESPACE_CLOSE
263 
264 #endif
265 /*-------------------------- dof_handler_policy.h -------------------------*/
virtual NumberCache renumber_mg_dofs(const unsigned int level, const std::vector< types::global_dof_index > &new_numbers) const override
virtual std::vector< NumberCache > distribute_mg_dofs() const =0
virtual NumberCache renumber_dofs(const std::vector< types::global_dof_index > &new_numbers) const =0
virtual std::vector< NumberCache > distribute_mg_dofs() const override
virtual std::vector< NumberCache > distribute_mg_dofs() const override
virtual std::vector< NumberCache > distribute_mg_dofs() const override
virtual NumberCache renumber_dofs(const std::vector< types::global_dof_index > &new_numbers) const override
virtual NumberCache renumber_dofs(const std::vector< types::global_dof_index > &new_numbers) const override
virtual NumberCache renumber_mg_dofs(const unsigned int level, const std::vector< types::global_dof_index > &new_numbers) const override
virtual NumberCache renumber_mg_dofs(const unsigned int level, const std::vector< types::global_dof_index > &new_numbers) const =0
virtual NumberCache renumber_mg_dofs(const unsigned int level, const std::vector< types::global_dof_index > &new_numbers) const override
virtual NumberCache renumber_dofs(const std::vector< types::global_dof_index > &new_numbers) const override