Reference documentation for deal.II version 9.1.0-pre
solution_transfer.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2009 - 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.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_distributed_solution_transfer_h
17 #define dealii_distributed_solution_transfer_h
18 
19 #include <deal.II/base/config.h>
20 
21 #include <deal.II/distributed/tria.h>
22 
23 #include <deal.II/dofs/dof_handler.h>
24 
25 #include <vector>
26 
27 
28 DEAL_II_NAMESPACE_OPEN
29 
30 namespace parallel
31 {
32  namespace distributed
33  {
162  template <int dim,
163  typename VectorType,
164  typename DoFHandlerType = DoFHandler<dim>>
166  {
167 #ifndef DEAL_II_MSVC
168  static_assert(dim == DoFHandlerType::dimension,
169  "The dimension explicitly provided as a template "
170  "argument, and the dimension of the DoFHandlerType "
171  "template argument must match.");
172 #endif
173  public:
182  SolutionTransfer(const DoFHandlerType &dof);
183 
187  ~SolutionTransfer() = default;
188 
196  void
198  const std::vector<const VectorType *> &all_in);
199 
204  void
205  prepare_for_coarsening_and_refinement(const VectorType &in);
206 
214  void
215  interpolate(std::vector<VectorType *> &all_out);
216 
226  void
227  interpolate(VectorType &out);
228 
229 
236  void
237  prepare_serialization(const VectorType &in);
238 
239 
243  void
244  prepare_serialization(const std::vector<const VectorType *> &all_in);
245 
246 
253  void
254  deserialize(VectorType &in);
255 
256 
260  void
261  deserialize(std::vector<VectorType *> &all_in);
262 
263  private:
267  SmartPointer<const DoFHandlerType,
270 
275  std::vector<const VectorType *> input_vectors;
276 
281  unsigned int handle;
282 
288  std::vector<char>
291  cell_iterator &cell,
293  CellStatus status);
294 
300  void
303  cell_iterator &cell,
305  CellStatus status,
306  const boost::iterator_range<std::vector<char>::const_iterator>
307  & data_range,
308  std::vector<VectorType *> &all_out);
309 
310 
316  void
318  };
319 
320 
321  } // namespace distributed
322 } // namespace parallel
323 
324 
325 
326 DEAL_II_NAMESPACE_CLOSE
327 
328 #endif
std::vector< char > pack_callback(const typename Triangulation< dim, DoFHandlerType::space_dimension >::cell_iterator &cell, const typename Triangulation< dim, DoFHandlerType::space_dimension >::CellStatus status)
SolutionTransfer(const DoFHandlerType &dof)
void interpolate(std::vector< VectorType * > &all_out)
void unpack_callback(const typename Triangulation< dim, DoFHandlerType::space_dimension >::cell_iterator &cell, const typename Triangulation< dim, DoFHandlerType::space_dimension >::CellStatus status, const boost::iterator_range< std::vector< char >::const_iterator > &data_range, std::vector< VectorType * > &all_out)
void prepare_serialization(const VectorType &in)
void prepare_for_coarsening_and_refinement(const std::vector< const VectorType * > &all_in)
std::vector< const VectorType * > input_vectors
SmartPointer< const DoFHandlerType, SolutionTransfer< dim, VectorType, DoFHandlerType > > dof_handler