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\}}\)
error_predictor.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2019 - 2020 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_distributed_error_predictor_h
17 #define dealii_distributed_error_predictor_h
18 
19 #include <deal.II/base/config.h>
20 
22 
23 #include <boost/range/iterator_range.hpp>
24 
25 #include <vector>
26 
27 
29 
30 
31 // forward declarations
32 #ifndef DOXYGEN
33 template <typename Number>
34 class Vector;
35 
36 namespace parallel
37 {
38  namespace distributed
39  {
40  template <int dim, int spacedim>
41  class Triangulation;
42  }
43 } // namespace parallel
44 
45 namespace hp
46 {
47  template <int dim, int spacedim>
48  class DoFHandler;
49 }
50 #endif
51 
52 
53 namespace parallel
54 {
55  namespace distributed
56  {
126  template <int dim, int spacedim = dim>
128  {
129  public:
139 
151  void
152  prepare_for_coarsening_and_refinement(
153  const std::vector<const Vector<float> *> &all_in,
154  const double gamma_p = std::sqrt(0.4),
155  const double gamma_h = 2.,
156  const double gamma_n = 1.);
157 
162  void
163  prepare_for_coarsening_and_refinement(
164  const Vector<float> &in,
165  const double gamma_p = std::sqrt(0.4),
166  const double gamma_h = 2.,
167  const double gamma_n = 1.);
168 
176  void
177  unpack(std::vector<Vector<float> *> &all_out);
178 
188  void
189  unpack(Vector<float> &out);
190 
191  private:
198 
203  std::vector<const Vector<float> *> error_indicators;
204 
209  unsigned int handle;
210 
214  double gamma_p, gamma_h, gamma_n;
215 
221  std::vector<char>
222  pack_callback(
223  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
224  const typename Triangulation<dim, spacedim>::CellStatus status);
225 
231  void
232  unpack_callback(
233  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
234  const typename Triangulation<dim, spacedim>::CellStatus status,
235  const boost::iterator_range<std::vector<char>::const_iterator>
236  & data_range,
237  std::vector<Vector<float> *> &all_out);
238 
239 
245  void
246  register_data_attach();
247  };
248  } // namespace distributed
249 } // namespace parallel
250 
251 
253 
254 #endif
SmartPointer< const hp::DoFHandler< dim, spacedim >, ErrorPredictor< dim, spacedim > > dof_handler
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
std::vector< const Vector< float > * > error_indicators
Definition: hp.h:117
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
T unpack(const std::vector< char > &buffer, const bool allow_compression=true)
Definition: utilities.h:1353