Reference documentation for deal.II version Git 840703ecf3 2019-10-14 17:15:20 -0400
\(\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 // Forward declaration
36 # ifndef DOXYGEN
37 template <int, int>
38 class DoFHandler;
39 # endif
40 
41 namespace internal
42 {
43  namespace DoFHandlerImplementation
44  {
45  struct NumberCache;
46 
51  namespace Policy
52  {
53  struct Implementation;
54 
60  template <int dim, int spacedim>
61  class PolicyBase
62  {
63  public:
67  virtual ~PolicyBase() = default;
68 
77  virtual NumberCache
78  distribute_dofs() const = 0;
79 
85  virtual std::vector<NumberCache>
86  distribute_mg_dofs() const = 0;
87 
93  virtual NumberCache
95  const std::vector<types::global_dof_index> &new_numbers) const = 0;
96 
105  virtual NumberCache
107  const unsigned int level,
108  const std::vector<types::global_dof_index> &new_numbers) const = 0;
109  };
110 
111 
116  template <class DoFHandlerType>
117  class Sequential : public PolicyBase<DoFHandlerType::dimension,
118  DoFHandlerType::space_dimension>
119  {
120  public:
126  Sequential(DoFHandlerType &dof_handler);
127 
128  // documentation is inherited
129  virtual NumberCache
130  distribute_dofs() const override;
131 
132  // documentation is inherited
133  virtual std::vector<NumberCache>
134  distribute_mg_dofs() const override;
135 
136  // documentation is inherited
137  virtual NumberCache
138  renumber_dofs(const std::vector<types::global_dof_index> &new_numbers)
139  const override;
140 
141  // documentation is inherited
142  virtual NumberCache
143  renumber_mg_dofs(const unsigned int level,
144  const std::vector<types::global_dof_index>
145  &new_numbers) const override;
146 
147  protected:
152  };
153 
154 
155 
160  template <class DoFHandlerType>
161  class ParallelShared : public PolicyBase<DoFHandlerType::dimension,
162  DoFHandlerType::space_dimension>
163  {
164  public:
170  ParallelShared(DoFHandlerType &dof_handler);
171 
180  virtual NumberCache
181  distribute_dofs() const override;
182 
186  virtual std::vector<NumberCache>
187  distribute_mg_dofs() const override;
188 
198  virtual NumberCache
199  renumber_dofs(const std::vector<types::global_dof_index> &new_numbers)
200  const override;
201 
202  // documentation is inherited
203  virtual NumberCache
204  renumber_mg_dofs(const unsigned int level,
205  const std::vector<types::global_dof_index>
206  &new_numbers) const override;
207 
208  private:
213  };
214 
215 
220  template <class DoFHandlerType>
222  : public PolicyBase<DoFHandlerType::dimension,
223  DoFHandlerType::space_dimension>
224  {
225  public:
231  ParallelDistributed(DoFHandlerType &dof_handler);
232 
233  // documentation is inherited
234  virtual NumberCache
235  distribute_dofs() const override;
236 
237  // documentation is inherited
238  virtual std::vector<NumberCache>
239  distribute_mg_dofs() const override;
240 
241  // documentation is inherited
242  virtual NumberCache
243  renumber_dofs(const std::vector<types::global_dof_index> &new_numbers)
244  const override;
245 
246  // documentation is inherited
247  virtual NumberCache
248  renumber_mg_dofs(const unsigned int level,
249  const std::vector<types::global_dof_index>
250  &new_numbers) const override;
251 
252  private:
257  };
258  } // namespace Policy
259  } // namespace DoFHandlerImplementation
260 } // namespace internal
261 
262 
263 
264 DEAL_II_NAMESPACE_CLOSE
265 
266 #endif
267 /*-------------------------- dof_handler_policy.h -------------------------*/
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 NumberCache renumber_mg_dofs(const unsigned int level, const std::vector< types::global_dof_index > &new_numbers) const =0