Reference documentation for deal.II version 9.0.0
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 at
12 // the top level of the deal.II distribution.
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 #include <deal.II/base/exceptions.h>
23 #include <deal.II/base/template_constraints.h>
24 #include <deal.II/dofs/dof_tools.h>
25 #include <deal.II/dofs/dof_renumbering.h>
26 
27 #include <vector>
28 #include <map>
29 #include <set>
30 
31 DEAL_II_NAMESPACE_OPEN
32 
33 template <int, int> class DoFHandler;
34 
35 
36 namespace internal
37 {
38  namespace DoFHandlerImplementation
39  {
40  struct NumberCache;
41 
46  namespace Policy
47  {
48  struct Implementation;
49 
55  template <int dim, int spacedim>
56  class PolicyBase
57  {
58  public:
62  virtual ~PolicyBase () = default;
63 
72  virtual
73  NumberCache
74  distribute_dofs () const = 0;
75 
81  virtual
82  std::vector<NumberCache>
83  distribute_mg_dofs () const = 0;
84 
90  virtual
91  NumberCache
92  renumber_dofs (const std::vector<types::global_dof_index> &new_numbers) const = 0;
93 
102  virtual
103  NumberCache
104  renumber_mg_dofs (const unsigned int level,
105  const std::vector<types::global_dof_index> &new_numbers) const = 0;
106  };
107 
108 
113  template <class DoFHandlerType>
114  class Sequential : public PolicyBase<DoFHandlerType::dimension,DoFHandlerType::space_dimension>
115  {
116  public:
122  Sequential (DoFHandlerType &dof_handler);
123 
124  // documentation is inherited
125  virtual
127  distribute_dofs () const;
128 
129  // documentation is inherited
130  virtual
131  std::vector<NumberCache>
132  distribute_mg_dofs () const;
133 
134  // documentation is inherited
135  virtual
137  renumber_dofs (const std::vector<types::global_dof_index> &new_numbers) const;
138 
139  // documentation is inherited
140  virtual
142  renumber_mg_dofs (const unsigned int level,
143  const std::vector<types::global_dof_index> &new_numbers) const;
144 
145  protected:
150  };
151 
152 
153 
158  template <class DoFHandlerType>
159  class ParallelShared : public PolicyBase<DoFHandlerType::dimension,DoFHandlerType::space_dimension>
160  {
161  public:
167  ParallelShared (DoFHandlerType &dof_handler);
168 
177  virtual
179  distribute_dofs () const;
180 
184  virtual
185  std::vector<NumberCache>
186  distribute_mg_dofs () const;
187 
197  virtual
199  renumber_dofs (const std::vector<types::global_dof_index> &new_numbers) const;
200 
201  // documentation is inherited
202  virtual
204  renumber_mg_dofs (const unsigned int level,
205  const std::vector<types::global_dof_index> &new_numbers) const;
206 
207  private:
212  };
213 
214 
219  template <class DoFHandlerType>
220  class ParallelDistributed : public PolicyBase<DoFHandlerType::dimension,DoFHandlerType::space_dimension>
221  {
222  public:
228  ParallelDistributed (DoFHandlerType &dof_handler);
229 
230  // documentation is inherited
231  virtual
233  distribute_dofs () const;
234 
235  // documentation is inherited
236  virtual
237  std::vector<NumberCache>
238  distribute_mg_dofs () const;
239 
240  // documentation is inherited
241  virtual
243  renumber_dofs (const std::vector<types::global_dof_index> &new_numbers) const;
244 
245  // documentation is inherited
246  virtual
248  renumber_mg_dofs (const unsigned int level,
249  const std::vector<types::global_dof_index> &new_numbers) const;
250 
251  private:
256  };
257  }
258  }
259 }
260 
261 
262 
263 DEAL_II_NAMESPACE_CLOSE
264 
265 /*---------------------------- dof_handler_policy.h ---------------------------*/
266 #endif
267 /*---------------------------- dof_handler_policy.h ---------------------------*/
virtual NumberCache renumber_dofs(const std::vector< types::global_dof_index > &new_numbers) const
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
virtual NumberCache renumber_mg_dofs(const unsigned int level, const std::vector< types::global_dof_index > &new_numbers) const
virtual std::vector< NumberCache > distribute_mg_dofs() const
virtual NumberCache renumber_mg_dofs(const unsigned int level, const std::vector< types::global_dof_index > &new_numbers) const
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
virtual NumberCache renumber_dofs(const std::vector< types::global_dof_index > &new_numbers) const
virtual std::vector< NumberCache > distribute_mg_dofs() const
virtual NumberCache renumber_dofs(const std::vector< types::global_dof_index > &new_numbers) const