MGTransferPrebuilt< VECTOR > Class Template Reference
[Multilevel support]

Inheritance diagram for MGTransferPrebuilt< VECTOR >:

Inheritance graph
[legend]

List of all members.

Classes

class  ExcMatricesNotBuilt
class  ExcNoProlongation

Public Member Functions

virtual ~MGTransferPrebuilt ()
template<int dim, int spacedim>
void build_matrices (const MGDoFHandler< dim, spacedim > &mg_dof)
virtual void prolongate (const unsigned int to_level, VECTOR &dst, const VECTOR &src) const
virtual void restrict_and_add (const unsigned int from_level, VECTOR &dst, const VECTOR &src) const
template<int dim, class InVector , int spacedim>
void copy_to_mg (const MGDoFHandler< dim, spacedim > &mg_dof, MGLevelObject< VECTOR > &dst, const InVector &src) const
template<int dim, class OutVector , int spacedim>
void copy_from_mg (const MGDoFHandler< dim, spacedim > &mg_dof, OutVector &dst, const MGLevelObject< VECTOR > &src) const
template<int dim, class OutVector , int spacedim>
void copy_from_mg_add (const MGDoFHandler< dim, spacedim > &mg_dof, OutVector &dst, const MGLevelObject< VECTOR > &src) const
unsigned int memory_consumption () const

Private Attributes

std::vector< unsigned intsizes
std::vector
< std_cxx1x::shared_ptr
< SparsityPattern > > 
prolongation_sparsities
std::vector
< std_cxx1x::shared_ptr
< SparseMatrix< double > > > 
prolongation_matrices
std::vector< std::map
< unsigned int, unsigned int > > 
copy_indices


Detailed Description

template<class VECTOR>
class MGTransferPrebuilt< VECTOR >

Implementation of the MGTransferBase interface for which the transfer operations are prebuilt upon construction of the object of this class as matrices. This is the fast way, since it only needs to build the operation once by looping over all cells and storing the result in a matrix for each level, but requires additional memory.

See MGTransferBase to find out which of the transfer classes is best for your needs.

Author:
Wolfgang Bangerth, Guido Kanschat, 1999-2004

Constructor & Destructor Documentation

template<class VECTOR>
virtual MGTransferPrebuilt< VECTOR >::~MGTransferPrebuilt (  )  [virtual]

Destructor.


Member Function Documentation

template<class VECTOR>
template<int dim, int spacedim>
void MGTransferPrebuilt< VECTOR >::build_matrices ( const MGDoFHandler< dim, spacedim > &  mg_dof  )  [inline]

Actually build the prolongation matrices for each level.

template<class VECTOR>
virtual void MGTransferPrebuilt< VECTOR >::prolongate ( const unsigned int  to_level,
VECTOR &  dst,
const VECTOR &  src 
) const [virtual]

Prolongate a vector from level to_level-1 to level to_level. The previous content of dst is overwritten.

  • src is a vector with as many elements as there are degrees of freedom on the coarser level involved.
  • dst has as many elements as there are degrees of freedom on the finer level.

Implements MGTransferBase< VECTOR >.

template<class VECTOR>
virtual void MGTransferPrebuilt< VECTOR >::restrict_and_add ( const unsigned int  from_level,
VECTOR &  dst,
const VECTOR &  src 
) const [virtual]

Restrict a vector from level from_level to level from_level-1 and add this restriction to dst. If the region covered by cells on level from_level is smaller than that of level from_level-1 (local refinement), then some degrees of freedom in dst are active and will not be altered. For the other degress of freedom, the result of the restriction is added.

  • src is a vector with as many elements as there are degrees of freedom on the finer level
  • dst has as many elements as there are degrees of freedom on the coarser level.

Implements MGTransferBase< VECTOR >.

template<class VECTOR>
template<int dim, class InVector , int spacedim>
void MGTransferPrebuilt< VECTOR >::copy_to_mg ( const MGDoFHandler< dim, spacedim > &  mg_dof,
MGLevelObject< VECTOR > &  dst,
const InVector &  src 
) const [inline]

Transfer from a vector on the global grid to vectors defined on each of the levels separately, i.a. an MGVector.

template<class VECTOR>
template<int dim, class OutVector , int spacedim>
void MGTransferPrebuilt< VECTOR >::copy_from_mg ( const MGDoFHandler< dim, spacedim > &  mg_dof,
OutVector &  dst,
const MGLevelObject< VECTOR > &  src 
) const [inline]

Transfer from multi-level vector to normal vector.

Copies data from active portions of an MGVector into the respective positions of a Vector<number>. In order to keep the result consistent, constrained degrees of freedom are set to zero.

template<class VECTOR>
template<int dim, class OutVector , int spacedim>
void MGTransferPrebuilt< VECTOR >::copy_from_mg_add ( const MGDoFHandler< dim, spacedim > &  mg_dof,
OutVector &  dst,
const MGLevelObject< VECTOR > &  src 
) const [inline]

Add a multi-level vector to a normal vector.

Works as the previous function, but probably not for continuous elements.

template<class VECTOR>
unsigned int MGTransferPrebuilt< VECTOR >::memory_consumption (  )  const

Memory used by this object.


Member Data Documentation

template<class VECTOR>
std::vector<unsigned int> MGTransferPrebuilt< VECTOR >::sizes [private]

Sizes of the multi-level vectors.

template<class VECTOR>
std::vector<std_cxx1x::shared_ptr<SparsityPattern> > MGTransferPrebuilt< VECTOR >::prolongation_sparsities [private]

Sparsity patterns for transfer matrices.

template<class VECTOR>
std::vector<std_cxx1x::shared_ptr<SparseMatrix<double> > > MGTransferPrebuilt< VECTOR >::prolongation_matrices [private]

The actual prolongation matrix. column indices belong to the dof indices of the mother cell, i.e. the coarse level. while row indices belong to the child cell, i.e. the fine level.

template<class VECTOR>
std::vector<std::map<unsigned int, unsigned int> > MGTransferPrebuilt< VECTOR >::copy_indices [private]

Mapping for the copy_to/from_mg-functions. The data is first the global index, then the level index.


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

deal.II documentation generated on Sat Aug 15 16:52:10 2009 by doxygen 1.5.9