Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
solution_transfer.h
1 // ---------------------------------------------------------------------
2 // @f$Id: solution_transfer.h 30036 2013-07-18 16:55:32Z maier @f$
3 //
4 // Copyright (C) 2009 - 2013 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 #ifndef __deal2__distributed_solution_transfer_h
18 #define __deal2__distributed_solution_transfer_h
19 
20 #include <deal.II/base/config.h>
21 #include <deal.II/distributed/tria.h>
22 #include <deal.II/dofs/dof_handler.h>
23 
24 #include <vector>
25 
26 
27 DEAL_II_NAMESPACE_OPEN
28 
29 namespace parallel
30 {
31 
32  namespace distributed
33  {
104  template<int dim, typename VECTOR, class DH=DoFHandler<dim> >
106  {
107  public:
112  SolutionTransfer(const DH &dof);
117 
129  void prepare_for_coarsening_and_refinement (const std::vector<const VECTOR *> &all_in);
130 
136  void prepare_for_coarsening_and_refinement (const VECTOR &in);
137 
141  void interpolate (std::vector<VECTOR *> &all_out);
142 
156  void interpolate (VECTOR &out);
157 
158 
163  unsigned int get_data_size() const;
164 
165 
175  void prepare_serialization(const VECTOR &in);
176 
177 
182  void prepare_serialization(const std::vector<const VECTOR *> &all_in);
183 
184 
195  void deserialize(VECTOR &in);
196 
197 
202  void deserialize(std::vector<VECTOR *> &all_in);
203 
204  private:
211 
219  std::vector<const VECTOR *> input_vectors;
220 
228  unsigned int offset;
229 
239  void pack_callback(const typename Triangulation<dim,dim>::cell_iterator &cell,
240  const typename Triangulation<dim,dim>::CellStatus status,
241  void *data);
242 
252  void unpack_callback(const typename Triangulation<dim,dim>::cell_iterator &cell,
253  const typename Triangulation<dim,dim>::CellStatus status,
254  const void *data,
255  std::vector<VECTOR *> &all_out);
256 
257 
261  void register_data_attach(const std::size_t size);
262 
263  };
264 
265 
266  }
267 }
268 
269 
270 
271 DEAL_II_NAMESPACE_CLOSE
272 
273 #endif
std::vector< const VECTOR * > input_vectors
SmartPointer< const DH, SolutionTransfer< dim, VECTOR, DH > > dof_handler
void unpack_callback(const typename Triangulation< dim, dim >::cell_iterator &cell, const typename Triangulation< dim, dim >::CellStatus status, const void *data, std::vector< VECTOR * > &all_out)
void prepare_serialization(const VECTOR &in)
void pack_callback(const typename Triangulation< dim, dim >::cell_iterator &cell, const typename Triangulation< dim, dim >::CellStatus status, void *data)
void prepare_for_coarsening_and_refinement(const std::vector< const VECTOR * > &all_in)