Public Member Functions | |
MGSmootherRelaxation (VectorMemory< VECTOR > &mem, const unsigned int steps=1, const bool variable=false, const bool symmetric=false, const bool transpose=false) | |
template<class MGMATRIXOBJECT , class DATA > | |
void | initialize (const MGMATRIXOBJECT &matrices, const DATA &additional_data) |
template<class MGMATRIXOBJECT , class DATA > | |
void | initialize (const MGMATRIXOBJECT &matrices, const DATA &additional_data, const unsigned int block_row, const unsigned int block_col) |
void | clear () |
void | set_steps (const unsigned int) |
void | set_variable (const bool) |
void | set_symmetric (const bool) |
void | set_transpose (const bool) |
void | set_debug (const unsigned int level) |
virtual void | smooth (const unsigned int level, VECTOR &u, const VECTOR &rhs) const |
unsigned int | memory_consumption () const |
Public Attributes | |
MGLevelObject< RELAX > | smoothers |
Private Attributes | |
MGLevelObject< PointerMatrix < MATRIX, VECTOR > > | matrices |
unsigned int | steps |
bool | variable |
bool | symmetric |
bool | transpose |
unsigned int | debug |
VectorMemory< VECTOR > & | mem |
This class performs smoothing on each level. The operation can be controlled by several parameters. First, the relaxation parameter omega
is used in the underlying relaxation method. steps
is the number of relaxation steps on the finest level (on all levels if variable
is off). If variable
is true
, the number of smoothing steps is doubled on each coarser level. This results in a method having the complexity of the W-cycle, but saving grid transfers. This is the method proposed by Bramble at al.
The option symmetric
switches on alternating between the smoother and its transpose in each step as proposed by Bramble.
transpose
uses the transposed smoothing operation using Tvmult
instead of the regular vmult
of the relaxation scheme.
If you are using block matrices, the second initialize
function offers the possibility to extract a single block for smoothing. In this case, the multigrid method must be used only with the vector associated to that single block.
The library contains instantiation for SparseMatrix<.>
and Vector<.>
, where the template arguments are all combinations of float
and double
. Additional instantiations may be created by including the file mg_smoother.templates.h.
MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::MGSmootherRelaxation | ( | VectorMemory< VECTOR > & | mem, | |
const unsigned int | steps = 1 , |
|||
const bool | variable = false , |
|||
const bool | symmetric = false , |
|||
const bool | transpose = false | |||
) |
Constructor. Sets memory and smoothing parameters.
void MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::initialize | ( | const MGMATRIXOBJECT & | matrices, | |
const DATA & | additional_data | |||
) | [inline] |
Initialize for matrices. The parameter matrices
can be any object having functions get_minlevel()
and get_maxlevel()
as well as an operator[]
returning a reference to MATRIX
. This function stores pointers to the level matrices and initializes the smoothing operator for each level.
additional_data
is an object of type RELAX::AdditionalData
and is handed to the initialization function of the relaxation method.
void MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::initialize | ( | const MGMATRIXOBJECT & | matrices, | |
const DATA & | additional_data, | |||
const unsigned int | block_row, | |||
const unsigned int | block_col | |||
) | [inline] |
Initialize for single blocks of matrices. The parameter matrices
can be any object having functions get_minlevel()
and get_maxlevel()
as well as an operator[]
returning a reference to a block matrix where each block is of type MATRIX
. Of this block matrix, the block indicated by block_row
and block_col
is selected on each level. This function stores pointers to the level matrices and initializes the smoothing operator for each level.
additional_data
is an object of type RELAX::AdditionalData
and is handed to the initialization function of the relaxation method.
void MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::clear | ( | ) | [virtual] |
Empty all vectors.
Implements MGSmootherBase< VECTOR >.
void MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::set_steps | ( | const unsigned | int | ) |
Modify the number of smoothing steps on finest level.
void MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::set_variable | ( | const | bool | ) |
Switch on/off variable smoothing.
void MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::set_symmetric | ( | const | bool | ) |
Switch on/off symmetric smoothing.
void MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::set_transpose | ( | const | bool | ) |
Switch on/off transposed smoothing. The effect is overriden by set_symmetric().
void MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::set_debug | ( | const unsigned int | level | ) |
virtual void MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::smooth | ( | const unsigned int | level, | |
VECTOR & | u, | |||
const VECTOR & | rhs | |||
) | const [virtual] |
The actual smoothing method.
Implements MGSmootherBase< VECTOR >.
unsigned int MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::memory_consumption | ( | ) | const |
Memory used by this object.
MGLevelObject<RELAX> MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::smoothers |
Object containing relaxation methods.
MGLevelObject<PointerMatrix<MATRIX, VECTOR> > MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::matrices [private] |
Pointer to the matrices.
unsigned int MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::steps [private] |
Number of smoothing steps on the finest level. If no variable smoothing is chosen, this is the number of steps on all levels.
bool MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::variable [private] |
Variable smoothing: double the number of smoothing steps whenever going to the next coarser level
bool MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::symmetric [private] |
Symmetric smoothing: in the smoothing iteration, alternate between the relaxation method and its transpose.
bool MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::transpose [private] |
unsigned int MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::debug [private] |
Output debugging information to deallog if this is nonzero.
VectorMemory<VECTOR>& MGSmootherRelaxation< MATRIX, RELAX, VECTOR >::mem [private] |
Memory for auxiliary vectors.