Reference documentation for deal.II version 9.4.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\}}\)
cell_data_transfer.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2018 - 2021 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_cell_data_transfer_h
17 #define dealii_distributed_cell_data_transfer_h
18 
19 #include <deal.II/base/config.h>
20 
22 
24 
26 
27 #include <boost/range/iterator_range.hpp>
28 
29 #include <functional>
30 
31 
33 
34 namespace parallel
35 {
36  namespace distributed
37  {
126  template <int dim, int spacedim = dim, typename VectorType = Vector<double>>
128  {
129  private:
133  using value_type = typename VectorType::value_type;
134 
135  public:
153  & triangulation,
154  const bool transfer_variable_size_data = false,
155  const std::function<std::vector<value_type>(
156  const typename ::Triangulation<dim, spacedim>::cell_iterator
157  & parent,
158  const value_type parent_value)> refinement_strategy =
160  preserve<dim, spacedim, value_type>,
161  const std::function<value_type(
162  const typename ::Triangulation<dim, spacedim>::cell_iterator
163  & parent,
164  const std::vector<value_type> &children_values)> coarsening_strategy =
166  check_equality<dim, spacedim, value_type>);
167 
180  void
182 
186  void
188  const std::vector<const VectorType *> &all_in);
189 
200  void
201  prepare_for_serialization(const VectorType &in);
202 
206  void
207  prepare_for_serialization(const std::vector<const VectorType *> &all_in);
208 
213  void
214  unpack(VectorType &out);
215 
219  void
220  unpack(std::vector<VectorType *> &all_out);
221 
226  void
227  deserialize(VectorType &out);
228 
232  void
233  deserialize(std::vector<VectorType *> &all_out);
234 
235  private:
242 
247 
252  const std::function<std::vector<value_type>(
253  const typename Triangulation<dim, spacedim>::cell_iterator &parent,
254  const value_type parent_value)>
256 
261  const std::function<value_type(
262  const typename Triangulation<dim, spacedim>::cell_iterator &parent,
263  const std::vector<value_type> &children_values)>
265 
270  std::vector<const VectorType *> input_vectors;
271 
276  unsigned int handle;
277 
282  void
284 
290  std::vector<char>
293  const typename parallel::distributed::
295 
301  void
304  cell_iterator &cell,
306  CellStatus status,
307  const boost::iterator_range<std::vector<char>::const_iterator>
308  & data_range,
309  std::vector<VectorType *> &all_out);
310  };
311  } // namespace distributed
312 } // namespace parallel
313 
314 
316 
317 #endif /* dealii_distributed_cell_data_transfer_h */
void prepare_for_serialization(const VectorType &in)
std::vector< char > pack_callback(const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &cell, const typename parallel::distributed::Triangulation< dim, spacedim >::CellStatus status)
void prepare_for_serialization(const std::vector< const VectorType * > &all_in)
SmartPointer< const parallel::distributed::Triangulation< dim, spacedim >, CellDataTransfer< dim, spacedim, VectorType > > triangulation
const std::function< std::vector< value_type > const typename Triangulation< dim, spacedim >::cell_iterator &parent, const value_type parent_value)> refinement_strategy
void unpack(std::vector< VectorType * > &all_out)
void prepare_for_coarsening_and_refinement(const VectorType &in)
CellDataTransfer(const parallel::distributed::Triangulation< dim, spacedim > &triangulation, const bool transfer_variable_size_data=false, const std::function< std::vector< value_type >(const typename ::Triangulation< dim, spacedim >::cell_iterator &parent, const value_type parent_value)> refinement_strategy=&::AdaptationStrategies::Refinement::preserve< dim, spacedim, value_type >, const std::function< value_type(const typename ::Triangulation< dim, spacedim >::cell_iterator &parent, const std::vector< value_type > &children_values)> coarsening_strategy=&::AdaptationStrategies::Coarsening::check_equality< dim, spacedim, value_type >)
void deserialize(std::vector< VectorType * > &all_out)
void prepare_for_coarsening_and_refinement(const std::vector< const VectorType * > &all_in)
const std::function< value_type(const typename Triangulation< dim, spacedim >::cell_iterator &parent, const std::vector< value_type > &children_values)> coarsening_strategy
std::vector< const VectorType * > input_vectors
void unpack_callback(const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &cell, const typename parallel::distributed::Triangulation< dim, spacedim >::CellStatus status, const boost::iterator_range< std::vector< char >::const_iterator > &data_range, std::vector< VectorType * > &all_out)
typename VectorType::value_type value_type
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443