Reference documentation for deal.II version 9.0.0
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 at
12 // the top level of the deal.II distribution.
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 #include <deal.II/distributed/tria.h>
21 #include <deal.II/dofs/dof_handler.h>
22 
23 #include <vector>
24 
25 
26 DEAL_II_NAMESPACE_OPEN
27 
28 namespace parallel
29 {
30 
31  namespace distributed
32  {
125  template <int dim,
126  typename VectorType,
127  typename DoFHandlerType = DoFHandler<dim> >
129  {
130 #ifndef DEAL_II_MSVC
131  static_assert (dim == DoFHandlerType::dimension,
132  "The dimension explicitly provided as a template "
133  "argument, and the dimension of the DoFHandlerType "
134  "template argument must match.");
135 #endif
136  public:
145  SolutionTransfer(const DoFHandlerType &dof);
146 
150  ~SolutionTransfer() = default;
151 
159  void prepare_for_coarsening_and_refinement (const std::vector<const VectorType *> &all_in);
160 
165  void prepare_for_coarsening_and_refinement (const VectorType &in);
166 
174  void interpolate (std::vector<VectorType *> &all_out);
175 
185  void interpolate (VectorType &out);
186 
187 
191  unsigned int get_data_size() const;
192 
193 
200  void prepare_serialization(const VectorType &in);
201 
202 
206  void prepare_serialization(const std::vector<const VectorType *> &all_in);
207 
208 
215  void deserialize(VectorType &in);
216 
217 
221  void deserialize(std::vector<VectorType *> &all_in);
222 
223  private:
228 
233  std::vector<const VectorType *> input_vectors;
234 
239  unsigned int offset;
240 
247  const typename Triangulation<dim,DoFHandlerType::space_dimension>::CellStatus status,
248  void *data);
249 
256  const typename Triangulation<dim,DoFHandlerType::space_dimension>::CellStatus status,
257  const void *data,
258  std::vector<VectorType *> &all_out);
259 
260 
264  void register_data_attach(const std::size_t size);
265 
266  };
267 
268 
269  }
270 }
271 
272 
273 
274 DEAL_II_NAMESPACE_CLOSE
275 
276 #endif
void prepare_for_coarsening_and_refinement(const std::vector< const VectorType *> &all_in)
SolutionTransfer(const DoFHandlerType &dof)
void pack_callback(const typename Triangulation< dim, DoFHandlerType::space_dimension >::cell_iterator &cell, const typename Triangulation< dim, DoFHandlerType::space_dimension >::CellStatus status, void *data)
void interpolate(std::vector< VectorType *> &all_out)
SmartPointer< const DoFHandlerType, SolutionTransfer< dim, VectorType, DoFHandlerType > > dof_handler
void prepare_serialization(const VectorType &in)
std::vector< const VectorType * > input_vectors
void unpack_callback(const typename Triangulation< dim, DoFHandlerType::space_dimension >::cell_iterator &cell, const typename Triangulation< dim, DoFHandlerType::space_dimension >::CellStatus status, const void *data, std::vector< VectorType *> &all_out)
::Triangulation< dim, spacedim >::cell_iterator cell_iterator
Definition: tria.h:265