Reference documentation for deal.II version 8.4.2
dof_handler_policy.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2016 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 FiniteElement;
34 template <int, int> class DoFHandler;
35 
36 
37 namespace internal
38 {
39  namespace DoFHandler
40  {
41  struct NumberCache;
42 
47  namespace Policy
48  {
49  struct Implementation;
50 
56  template <int dim, int spacedim>
57  class PolicyBase
58  {
59  public:
63  virtual ~PolicyBase ();
64 
73  virtual
74  void
76  NumberCache &number_cache) const = 0;
77 
81  virtual
82  void
84  std::vector<NumberCache> &number_caches) const = 0;
85 
94  virtual
95  void
96  renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
97  ::DoFHandler<dim,spacedim> &dof_handler,
98  NumberCache &number_cache) const = 0;
99  };
100 
101 
106  template <int dim, int spacedim>
107  class Sequential : public PolicyBase<dim,spacedim>
108  {
109  public:
113  virtual
114  void
116  NumberCache &number_cache) const;
117 
121  virtual
122  void
124  std::vector<NumberCache> &number_caches) const;
125 
129  virtual
130  void
131  renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
132  ::DoFHandler<dim,spacedim> &dof_handler,
133  NumberCache &number_cache) const;
134  };
135 
140  template <int dim, int spacedim>
141  class ParallelShared : public Sequential<dim,spacedim>
142  {
143  public:
144 
153  virtual
154  void
156  NumberCache &number_cache) const;
157 
161  virtual
162  void
164  std::vector<NumberCache> &number_caches) const;
165 
175  virtual
176  void
177  renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
178  ::DoFHandler<dim,spacedim> &dof_handler,
179  NumberCache &number_cache) const;
180  private:
181 
182  };
183 
184 
189  template <int dim, int spacedim>
190  class ParallelDistributed : public PolicyBase<dim,spacedim>
191  {
192  public:
196  virtual
197  void
199  NumberCache &number_cache) const;
200 
204  virtual
205  void
207  std::vector<NumberCache> &number_caches) const;
208 
212  virtual
213  void
214  renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
215  ::DoFHandler<dim,spacedim> &dof_handler,
216  NumberCache &number_cache) const;
217  };
218  }
219  }
220 }
221 
222 
223 
224 DEAL_II_NAMESPACE_CLOSE
225 
226 /*---------------------------- dof_handler_policy.h ---------------------------*/
227 #endif
228 /*---------------------------- dof_handler_policy.h ---------------------------*/
virtual void distribute_mg_dofs(::DoFHandler< dim, spacedim > &dof_handler, std::vector< NumberCache > &number_caches) const =0
virtual void renumber_dofs(const std::vector< types::global_dof_index > &new_numbers, ::DoFHandler< dim, spacedim > &dof_handler, NumberCache &number_cache) const =0
virtual void distribute_dofs(::DoFHandler< dim, spacedim > &dof_handler, NumberCache &number_cache) const =0