include/deal.II/distributed/solution_transfer.h

00001 //---------------------------------------------------------------------------
00002 //    @f$Id: solution_transfer.h 25345 2012-03-31 08:37:04Z bangerth @f$
00003 //
00004 //    Copyright (C) 2009, 2010, 2012 by the deal.II authors
00005 //
00006 //    This file is subject to QPL and may not be  distributed
00007 //    without copyright and license information. Please refer
00008 //    to the file deal.II/doc/license.html for the  text  and
00009 //    further information on this license.
00010 //
00011 //---------------------------------------------------------------------------
00012 #ifndef __deal2__distributed_solution_transfer_h
00013 #define __deal2__distributed_solution_transfer_h
00014 
00015 #include <deal.II/base/config.h>
00016 #include <deal.II/distributed/tria.h>
00017 #include <deal.II/dofs/dof_handler.h>
00018 
00019 #include <vector>
00020 
00021 
00022 DEAL_II_NAMESPACE_OPEN
00023 
00024 namespace parallel
00025 {
00026 
00027   namespace distributed
00028   {
00099     template<int dim, typename VECTOR, class DH=DoFHandler<dim> >
00100     class SolutionTransfer
00101     {
00102       public:
00107         SolutionTransfer(const DH &dof);
00111         ~SolutionTransfer();
00112 
00124         void prepare_for_coarsening_and_refinement (const std::vector<const VECTOR*> &all_in);
00125 
00131         void prepare_for_coarsening_and_refinement (const VECTOR &in);
00132 
00136         void interpolate (std::vector<VECTOR*> &all_out);
00137 
00151         void interpolate (VECTOR &out);
00152 
00153 
00158         unsigned int get_data_size() const;
00159 
00160 
00170         void prepare_serialization(const VECTOR &in);
00171 
00172 
00177         void prepare_serialization(const std::vector<const VECTOR*> &all_in);
00178 
00179 
00190         void deserialize(VECTOR &in);
00191 
00192 
00197         void deserialize(std::vector<VECTOR*> &all_in);
00198 
00199       private:
00205         SmartPointer<const DH,SolutionTransfer<dim,VECTOR,DH> > dof_handler;
00206 
00214         std::vector<const VECTOR*> input_vectors;
00215 
00223         unsigned int offset;
00224 
00234         void pack_callback(const typename Triangulation<dim,dim>::cell_iterator &cell,
00235                            const typename Triangulation<dim,dim>::CellStatus status,
00236                            void* data);
00237 
00247         void unpack_callback(const typename Triangulation<dim,dim>::cell_iterator &cell,
00248                              const typename Triangulation<dim,dim>::CellStatus status,
00249                              const void* data,
00250                              std::vector<VECTOR*> &all_out);
00251 
00252 
00256         void register_data_attach(const std::size_t size);
00257 
00258     };
00259 
00260 
00261   }
00262 }
00263 
00264 
00265 
00266 DEAL_II_NAMESPACE_CLOSE
00267 
00268 #endif
00269 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Tue May 22 2012 12:06:06 by doxygen 1.7.3