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 int > | sizes |
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 |
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.
virtual MGTransferPrebuilt< VECTOR >::~MGTransferPrebuilt | ( | ) | [virtual] |
Destructor.
void MGTransferPrebuilt< VECTOR >::build_matrices | ( | const MGDoFHandler< dim, spacedim > & | mg_dof | ) | [inline] |
Actually build the prolongation matrices for each level.
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.
Implements MGTransferBase< 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.
Implements MGTransferBase< VECTOR >.
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
.
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.
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.
unsigned int MGTransferPrebuilt< VECTOR >::memory_consumption | ( | ) | const |
Memory used by this object.
std::vector<unsigned int> MGTransferPrebuilt< VECTOR >::sizes [private] |
Sizes of the multi-level vectors.
std::vector<std_cxx1x::shared_ptr<SparsityPattern> > MGTransferPrebuilt< VECTOR >::prolongation_sparsities [private] |
Sparsity patterns for transfer matrices.
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.
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.