Public Member Functions | Private Member Functions | Private Attributes
parallel::distributed::SolutionTransfer< dim, VECTOR, DH > Class Template Reference

List of all members.

Public Member Functions

 SolutionTransfer (const DH &dof)
 ~SolutionTransfer ()
void prepare_for_coarsening_and_refinement (const std::vector< const VECTOR * > &all_in)
void prepare_for_coarsening_and_refinement (const VECTOR &in)
void interpolate (std::vector< VECTOR * > &all_out)
void interpolate (VECTOR &out)
unsigned int get_data_size () const

Private Member Functions

void pack_callback (const typename Triangulation< dim, dim >::cell_iterator &cell, const typename Triangulation< dim, dim >::CellStatus status, void *data)
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)

Private Attributes

SmartPointer< const DH,
SolutionTransfer< dim, VECTOR,
DH > > 
dof_handler
std::vector< const VECTOR * > input_vectors
unsigned int offset

Detailed Description

template<int dim, typename VECTOR, class DH = DoFHandler<dim>>
class parallel::distributed::SolutionTransfer< dim, VECTOR, DH >

Transfers a discrete FE function (like a solution vector) by interpolation while refining and/or coarsening a distributed grid and handles the necessary communication.

Usage

 * SolutionTransfer<dim, Vector<double> > soltrans(dof_handler);
 *                                     // flag some cells for refinement
 *                                     // and coarsening, e.g.
 * GridRefinement::refine_and_coarsen_fixed_fraction(
 *   *tria, error_indicators, 0.3, 0.05);
 *                                     // prepare the triangulation,
 * tria->prepare_coarsening_and_refinement();
 *                                     // prepare the SolutionTransfer object
 *                                     // for coarsening and refinement and give
 *                                     // the solution vector that we intend to
 *                                     // interpolate later,
 * soltrans.prepare_for_coarsening_and_refinement(solution);
 *                                     // actually execute the refinement,
 * tria->execute_coarsening_and_refinement ();
 *                                     // redistribute dofs,
 * dof_handler->distribute_dofs (fe);
 *                                     // and interpolate the solution
 * Vector<double> interpolate_solution(dof_handler->n_dofs());
 * soltrans.interpolate(solution, interpolated_solution);
 * 
Author:
Timo Heister, 2009

Constructor & Destructor Documentation

template<int dim, typename VECTOR , class DH = DoFHandler<dim>>
parallel::distributed::SolutionTransfer< dim, VECTOR, DH >::SolutionTransfer ( const DH &  dof)

Constructor, takes the current DoFHandler as argument.

template<int dim, typename VECTOR , class DH = DoFHandler<dim>>
parallel::distributed::SolutionTransfer< dim, VECTOR, DH >::~SolutionTransfer ( )

Destructor.


Member Function Documentation

template<int dim, typename VECTOR , class DH = DoFHandler<dim>>
void parallel::distributed::SolutionTransfer< dim, VECTOR, DH >::prepare_for_coarsening_and_refinement ( const std::vector< const VECTOR * > &  all_in)

Prepares the SolutionTransfer for coarsening and refinement. It stores the dof indices of each cell and stores the dof values of the vectors in all_in in each cell that'll be coarsened. all_in includes all vectors that are to be interpolated onto the new (refined and/or coarsenend) grid.

template<int dim, typename VECTOR , class DH = DoFHandler<dim>>
void parallel::distributed::SolutionTransfer< dim, VECTOR, DH >::prepare_for_coarsening_and_refinement ( const VECTOR &  in)

Same as previous function but for only one discrete function to be interpolated.

template<int dim, typename VECTOR , class DH = DoFHandler<dim>>
void parallel::distributed::SolutionTransfer< dim, VECTOR, DH >::interpolate ( std::vector< VECTOR * > &  all_out)
template<int dim, typename VECTOR , class DH = DoFHandler<dim>>
void parallel::distributed::SolutionTransfer< dim, VECTOR, DH >::interpolate ( VECTOR &  out)

Same as the previous function. It interpolates only one function. It assumes the vectors having the right sizes (i.e. in.size()==n_dofs_old, out.size()==n_dofs_refined)

Multiple calling of this function is NOT allowed. Interpolating several functions can be performed in one step by using interpolate (all_in, all_out)

template<int dim, typename VECTOR , class DH = DoFHandler<dim>>
unsigned int parallel::distributed::SolutionTransfer< dim, VECTOR, DH >::get_data_size ( ) const

return the size in bytes that need to be stored per cell.

template<int dim, typename VECTOR , class DH = DoFHandler<dim>>
void parallel::distributed::SolutionTransfer< dim, VECTOR, DH >::pack_callback ( const typename Triangulation< dim, dim >::cell_iterator &  cell,
const typename Triangulation< dim, dim >::CellStatus  status,
void *  data 
) [private]

A callback function used to pack the data on the current mesh into objects that can later be retrieved after refinement, coarsening and repartitioning.

template<int dim, typename VECTOR , class DH = DoFHandler<dim>>
void parallel::distributed::SolutionTransfer< dim, VECTOR, DH >::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 
) [private]

A callback function used to unpack the data on the current mesh that has been packed up previously on the mesh before refinement, coarsening and repartitioning.


Member Data Documentation

template<int dim, typename VECTOR , class DH = DoFHandler<dim>>
SmartPointer<const DH,SolutionTransfer<dim,VECTOR,DH> > parallel::distributed::SolutionTransfer< dim, VECTOR, DH >::dof_handler [private]

Pointer to the degree of freedom handler to work with.

template<int dim, typename VECTOR , class DH = DoFHandler<dim>>
std::vector<const VECTOR*> parallel::distributed::SolutionTransfer< dim, VECTOR, DH >::input_vectors [private]

A vector that stores pointers to all the vectors we are supposed to copy over from the old to the new mesh.

template<int dim, typename VECTOR , class DH = DoFHandler<dim>>
unsigned int parallel::distributed::SolutionTransfer< dim, VECTOR, DH >::offset [private]

The offset that the Triangulation has assigned to this object starting at which we are allowed to write.


The documentation for this class was generated from the following file:

deal.II documentation generated on Fri Aug 12 2011 15:01:09 by doxygen 1.7.4