Public Member Functions | Static Public Member Functions | Private Attributes

MGTransferPrebuilt< VECTOR > Class Template Reference
[Multilevel support]

Inheritance diagram for MGTransferPrebuilt< VECTOR >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 MGTransferPrebuilt ()
 MGTransferPrebuilt (const ConstraintMatrix &constraints, const MGConstrainedDoFs &mg_constrained_dofs)
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
void set_component_to_block_map (const std::vector< unsigned int > &map)
std::size_t memory_consumption () const

Static Public Member Functions

::ExceptionBaseExcNoProlongation ()
::ExceptionBaseExcMatricesNotBuilt ()

Private Attributes

std::vector< unsigned int > sizes
std::vector
< std_cxx1x::shared_ptr
< SparsityPattern > > 
prolongation_sparsities
std::vector
< std_cxx1x::shared_ptr
< SparseMatrix< double > > > 
prolongation_matrices
std::vector< std::vector
< std::pair< unsigned int,
unsigned int > > > 
copy_indices
std::vector< unsigned int > component_to_block_map
std::vector< std::vector< bool > > interface_dofs
SmartPointer< const
ConstraintMatrix,
MGTransferPrebuilt< VECTOR > > 
constraints
SmartPointer< const
MGConstrainedDoFs,
MGTransferPrebuilt< VECTOR > > 
mg_constrained_dofs

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

Definition at line 64 of file mg_transfer.h.


Constructor & Destructor Documentation

template<class VECTOR>
MGTransferPrebuilt< VECTOR >::MGTransferPrebuilt (  )

Constructor without constraint matrices. Use this constructor only with discontinuous finite elements or with no local refinement.

template<class VECTOR>
MGTransferPrebuilt< VECTOR >::MGTransferPrebuilt ( const ConstraintMatrix constraints,
const MGConstrainedDoFs mg_constrained_dofs 
)

Constructor with constraint matrices as well as mg_constrained_dofs.

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 )

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

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

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

Add a multi-level vector to a normal vector.

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

template<class VECTOR>
void MGTransferPrebuilt< VECTOR >::set_component_to_block_map ( const std::vector< unsigned int > &  map )

If this object operates on BlockVector objects, we need to describe how the individual vector components are mapped to the blocks of a vector. For example, for a Stokes system, we have dim+1 vector components for velocity and pressure, but we may want to use block vectors with only two blocks for all velocities in one block, and the pressure variables in the other.

By default, if this function is not called, block vectors have as many blocks as the finite element has vector components. However, this can be changed by calling this function with an array that describes how vector components are to be grouped into blocks. The meaning of the argument is the same as the one given to the DoFTools::count_dofs_per_component function.

template<class VECTOR>
::ExceptionBase& MGTransferPrebuilt< VECTOR >::ExcNoProlongation (  ) [static]

Finite element does not provide prolongation matrices.

template<class VECTOR>
::ExceptionBase& MGTransferPrebuilt< VECTOR >::ExcMatricesNotBuilt (  ) [static]

Call build_matrices function first.

template<class VECTOR>
std::size_t 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.

Definition at line 199 of file mg_transfer.h.

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

Sparsity patterns for transfer matrices.

Definition at line 205 of file mg_transfer.h.

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.

Definition at line 215 of file mg_transfer.h.

template<class VECTOR>
std::vector<std::vector<std::pair<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.

Definition at line 224 of file mg_transfer.h.

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

The vector that stores what has been given to the set_component_to_block_map() function.

Definition at line 232 of file mg_transfer.h.

template<class VECTOR>
std::vector<std::vector<bool> > MGTransferPrebuilt< VECTOR >::interface_dofs [private]

Degrees of freedom on the refinement edge excluding those on the boundary.

Definition at line 239 of file mg_transfer.h.

template<class VECTOR>
SmartPointer<const ConstraintMatrix, MGTransferPrebuilt<VECTOR> > MGTransferPrebuilt< VECTOR >::constraints [private]

The constraints of the global system.

Definition at line 244 of file mg_transfer.h.

template<class VECTOR>
SmartPointer<const MGConstrainedDoFs, MGTransferPrebuilt<VECTOR> > MGTransferPrebuilt< VECTOR >::mg_constrained_dofs [private]

The mg_constrained_dofs of the level systems.

Definition at line 250 of file mg_transfer.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Fri Feb 3 2012 06:04:09 by doxygen 1.7.2