Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
dof_handler_policy.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2019 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>
25 
27 # include <deal.II/dofs/dof_tools.h>
28 
29 # include <map>
30 # include <set>
31 # include <vector>
32 
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 
265 
266 #endif
267 /*-------------------------- dof_handler_policy.h -------------------------*/
internal::DoFHandlerImplementation::Policy::Sequential::dof_handler
SmartPointer< DoFHandlerType > dof_handler
Definition: dof_handler_policy.h:151
internal::DoFHandlerImplementation::Policy::ParallelDistributed::distribute_dofs
virtual NumberCache distribute_dofs() const override
Definition: dof_handler_policy.cc:4415
internal::DoFHandlerImplementation::Policy::ParallelDistributed::ParallelDistributed
ParallelDistributed(DoFHandlerType &dof_handler)
Definition: dof_handler_policy.cc:4406
internal::DoFHandlerImplementation::Policy::PolicyBase::~PolicyBase
virtual ~PolicyBase()=default
internal::DoFHandlerImplementation::Policy::ParallelShared::renumber_dofs
virtual NumberCache renumber_dofs(const std::vector< types::global_dof_index > &new_numbers) const override
Definition: dof_handler_policy.cc:3641
internal::DoFHandlerImplementation::Policy::ParallelShared::distribute_dofs
virtual NumberCache distribute_dofs() const override
Definition: dof_handler_policy.cc:3287
internal::DoFHandlerImplementation::Policy::PolicyBase::distribute_dofs
virtual NumberCache distribute_dofs() const =0
internal::DoFHandlerImplementation::Policy::Sequential::distribute_dofs
virtual NumberCache distribute_dofs() const override
Definition: dof_handler_policy.cc:3049
internal::DoFHandlerImplementation::Policy::ParallelDistributed::renumber_mg_dofs
virtual NumberCache renumber_mg_dofs(const unsigned int level, const std::vector< types::global_dof_index > &new_numbers) const override
Definition: dof_handler_policy.cc:5146
internal::DoFHandlerImplementation::Policy::ParallelDistributed
Definition: dof_handler_policy.h:221
internal::DoFHandlerImplementation::Policy::ParallelDistributed::distribute_mg_dofs
virtual std::vector< NumberCache > distribute_mg_dofs() const override
Definition: dof_handler_policy.cc:4652
internal::DoFHandlerImplementation::Policy::Sequential::Sequential
Sequential(DoFHandlerType &dof_handler)
Definition: dof_handler_policy.cc:3041
internal::DoFHandlerImplementation::Policy::PolicyBase::renumber_mg_dofs
virtual NumberCache renumber_mg_dofs(const unsigned int level, const std::vector< types::global_dof_index > &new_numbers) const =0
DoFHandler
Definition: dof_handler.h:205
level
unsigned int level
Definition: grid_out.cc:4355
dof_renumbering.h
internal::DoFHandlerImplementation::NumberCache
Definition: number_cache.h:37
internal::DoFHandlerImplementation::Policy::ParallelShared::distribute_mg_dofs
virtual std::vector< NumberCache > distribute_mg_dofs() const override
Definition: dof_handler_policy.cc:3450
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
internal::DoFHandlerImplementation::Policy::PolicyBase
Definition: dof_handler_policy.h:61
exceptions.h
internal::DoFHandlerImplementation::Policy::Sequential::renumber_dofs
virtual NumberCache renumber_dofs(const std::vector< types::global_dof_index > &new_numbers) const override
Definition: dof_handler_policy.cc:3105
internal::DoFHandlerImplementation::Policy::ParallelDistributed::renumber_dofs
virtual NumberCache renumber_dofs(const std::vector< types::global_dof_index > &new_numbers) const override
Definition: dof_handler_policy.cc:4884
SmartPointer< DoFHandlerType >
internal::DoFHandlerImplementation::Policy::Sequential::renumber_mg_dofs
virtual NumberCache renumber_mg_dofs(const unsigned int level, const std::vector< types::global_dof_index > &new_numbers) const override
Definition: dof_handler_policy.cc:3129
dof_tools.h
internal::DoFHandlerImplementation::Policy::ParallelShared::ParallelShared
ParallelShared(DoFHandlerType &dof_handler)
Definition: dof_handler_policy.cc:3145
internal::DoFHandlerImplementation::Policy::Sequential
Definition: dof_handler_policy.h:117
internal::DoFHandlerImplementation::Policy::Implementation
Definition: dof_handler_policy.cc:218
template_constraints.h
config.h
internal::DoFHandlerImplementation::Policy::ParallelShared::renumber_mg_dofs
virtual NumberCache renumber_mg_dofs(const unsigned int level, const std::vector< types::global_dof_index > &new_numbers) const override
Definition: dof_handler_policy.cc:3810
internal
Definition: aligned_vector.h:369
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
internal::DoFHandlerImplementation::Policy::ParallelShared
Definition: dof_handler_policy.h:161
internal::DoFHandlerImplementation::Policy::PolicyBase::distribute_mg_dofs
virtual std::vector< NumberCache > distribute_mg_dofs() const =0
internal::DoFHandlerImplementation::Policy::ParallelShared::dof_handler
SmartPointer< DoFHandlerType > dof_handler
Definition: dof_handler_policy.h:212
internal::DoFHandlerImplementation::Policy::ParallelDistributed::dof_handler
SmartPointer< DoFHandlerType > dof_handler
Definition: dof_handler_policy.h:256
internal::DoFHandlerImplementation::Policy::PolicyBase::renumber_dofs
virtual NumberCache renumber_dofs(const std::vector< types::global_dof_index > &new_numbers) const =0
internal::DoFHandlerImplementation::Policy::Sequential::distribute_mg_dofs
virtual std::vector< NumberCache > distribute_mg_dofs() const override
Definition: dof_handler_policy.cc:3068