public:
/**
- * Parameters for block
- * relaxation methods.
+ * Parameters for block relaxation methods.
*/
class AdditionalData : public Subscriptor
{
const bool same_diagonal = false);
/**
- * @deprecated Since the
- * BlockList is now a data
- * member of this class, it
- * is not recommended anymore
- * to generate it independently.
+ * @deprecated Since the BlockList is now a data member of this
+ * class, it is not recommended anymore to generate it
+ * independently.
*
* Constructor.
*/
/**
- * The mapping from indices
- * to blocks.
+ * The mapping from indices to blocks.
*/
SparsityPattern block_list;
bool invert_diagonal;
/**
- * Assume all diagonal blocks
- * are equal to save memory.
+ * Assume all diagonal blocks are equal to save memory.
*/
bool same_diagonal;
/**
- * Choose the inversion
- * method for the blocks.
+ * Choose the inversion method for the blocks.
*/
typename PreconditionBlockBase<inverse_type>::Inversion inversion;
/**
- * The if #inversion is SVD,
- * the threshold below which
- * a singular value will be
- * considered zero and thus
- * not inverted. This
- * parameter is used in the
- * call to LAPACKFullMatrix::compute_inverse_svd().
+ * The if #inversion is SVD, the threshold below which a singular
+ * value will be considered zero and thus not inverted. This
+ * parameter is used in the call to
+ * LAPACKFullMatrix::compute_inverse_svd().
*/
double threshold;
/**
- * The order in which blocks
- * should be traversed. This
- * vector can initiate
- * several modes of
- * execution:
+ * The order in which blocks should be traversed. This vector can
+ * initiate several modes of execution:
*
* <ol>
- * <li>If the length of the
- * vector is zero, then the
- * relaxation method will be
- * executed from first to
- * last block.
- * <li> If the length is one,
- * then the inner vector must
- * have the same size as
- * the number of blocks. The
- * relaxation method is
- * applied in the order given
- * in this vector.
- * <li> If the outer vector
- * has length greater one,
- * then the relaxation method
- * is applied several times,
- * each time in the order
- * given by the inner vector
- * of the corresponding
- * index. This mode can for
- * instance be used for ADI
- * methods and similar
- * direction sweeps.
+ *
+ * <li>If the length of the vector is zero, then the relaxation
+ * method will be executed from first to last block.</li>
+ *
+ * <li> If the length is one, then the inner vector must have the
+ * same size as the number of blocks. The relaxation method is
+ * applied in the order given in this vector.</li>
+ *
+ * <li> If the outer vector has length greater one, then the
+ * relaxation method is applied several times, each time in the
+ * order given by the inner vector of the corresponding
+ * index. This mode can for instance be used for ADI methods and
+ * similar direction sweeps.</li>
+ *
* </ol>
*/
std::vector<std::vector<unsigned int> > order;
+ /**
+ * Return the memory allocated in this object.
+ */
+ std::size_t memory_consumption() const;
};
/**
- * Initialize matrix and block
- * size. We store the matrix and
- * the block size in the
- * preconditioner object. In a
- * second step, the inverses of
- * the diagonal blocks may be
- * computed.
+ * Initialize matrix and block size. We store the matrix and the
+ * block size in the preconditioner object. In a second step, the
+ * inverses of the diagonal blocks may be computed.
*
- * Additionally, a relaxation
- * parameter for derived classes
- * may be provided.
+ * Additionally, a relaxation parameter for derived classes may be
+ * provided.
*/
void initialize (const MATRIX &A,
const AdditionalData ¶meters);
/**
- * Deletes the inverse diagonal
- * block matrices if existent,
- * sets the blocksize to 0, hence
- * leaves the class in the state
- * that it had directly after
- * calling the constructor.
+ * Deletes the inverse diagonal block matrices if existent, sets the
+ * blocksize to 0, hence leaves the class in the state that it had
+ * directly after calling the constructor.
*/
void clear();
bool empty () const;
/**
- * Read-only access to entries.
- * This function is only possible
- * if the inverse diagonal blocks
- * are stored.
+ * Read-only access to entries. This function is only possible if
+ * the inverse diagonal blocks are stored.
*/
value_type el(unsigned int i,
unsigned int j) const;
/**
- * Stores the inverse of the
- * diagonal blocks in
- * @p inverse. This costs some
- * additional memory - for DG
- * methods about 1/3 (for double
- * inverses) or 1/6 (for float
- * inverses) of that used for the
- * matrix - but it makes the
- * preconditioning much faster.
+ * Stores the inverse of the diagonal blocks in @p inverse. This
+ * costs some additional memory - for DG methods about 1/3 (for
+ * double inverses) or 1/6 (for float inverses) of that used for the
+ * matrix - but it makes the preconditioning much faster.
*
- * It is not allowed to call this
- * function twice (will produce
- * an error) before a call of
- * <tt>clear(...)</tt> because at the
- * second time there already
- * exist the inverse matrices.
+ * It is not allowed to call this function twice (will produce an
+ * error) before a call of <tt>clear(...)</tt> because at the second
+ * time there already exist the inverse matrices.
*
- * After this function is called,
- * the lock on the matrix given
- * through the @p use_matrix
- * function is released, i.e. you
- * may overwrite of delete it.
- * You may want to do this in
- * case you use this matrix to
- * precondition another matrix.
+ * After this function is called, the lock on the matrix given
+ * through the @p use_matrix function is released, i.e. you may
+ * overwrite of delete it. You may want to do this in case you use
+ * this matrix to precondition another matrix.
*/
void invert_diagblocks();
protected:
/**
- * Perform one block relaxation
- * step.
+ * Perform one block relaxation step.
*
- * Depending on the arguments @p
- * dst and @p pref, this performs
- * an SOR step (both reference
- * the same vector) of a Jacobi
- * step (both are different
- * vectors). For the Jacobi step,
- * the calling function must copy
- * @p dst to @p pref after this.
+ * Depending on the arguments @p dst and @p pref, this performs an
+ * SOR step (both reference the same vector) of a Jacobi step (both
+ * are different vectors). For the Jacobi step, the calling function
+ * must copy @p dst to @p pref after this.
*/
template <typename number2>
void do_step (
const Vector<number2> &src,
const bool backward) const;
/**
- * Pointer to the matrix. Make
- * sure that the matrix exists as
- * long as this class needs it,
- * i.e. until calling
- * @p invert_diagblocks, or (if
- * the inverse matrices should
- * not be stored) until the last
- * call of the preconditoining
- * @p vmult function of the
- * derived classes.
+ * Pointer to the matrix. Make sure that the matrix exists as long
+ * as this class needs it, i.e. until calling @p invert_diagblocks,
+ * or (if the inverse matrices should not be stored) until the last
+ * call of the preconditoining @p vmult function of the derived
+ * classes.
*/
SmartPointer<const MATRIX,RelaxationBlock<MATRIX,inverse_type> > A;
/**
- * Block Jacobi (additive Schwarz) method with possibly overlapping blocks.
+ * Block Jacobi (additive Schwarz) method with possibly overlapping
+ * blocks.
*
* This class implements the step() and Tstep() functions expected by
- * SolverRelaxation and MGSmootherRelaxation. They perform an
- * additive Schwarz method on the blocks provided in the
- * BlockList of AdditionalData. Differing from PreconditionBlockJacobi,
- * these blocks may be of varying size, non-contiguous, and
- * overlapping. On the other hand, this class does not implement the
- * preconditioner interface expected by Solver objects.
+ * SolverRelaxation and MGSmootherRelaxation. They perform an additive
+ * Schwarz method on the blocks provided in the BlockList of
+ * AdditionalData. Differing from PreconditionBlockJacobi, these
+ * blocks may be of varying size, non-contiguous, and overlapping. On
+ * the other hand, this class does not implement the preconditioner
+ * interface expected by Solver objects.
*
* @ingroup Preconditioners
* @author Guido Kanschat
using RelaxationBlock<MATRIX, inverse_type>::inverse_svd;
using PreconditionBlockBase<inverse_type>::log_statistics;
/**
- * Perform one step of the Jacobi
- * iteration.
+ * Perform one step of the Jacobi iteration.
*/
template <typename number2>
void step (Vector<number2> &dst, const Vector<number2> &rhs) const;
/**
- * Perform one step of the
- * Jacobi iteration.
+ * Perform one step of the Jacobi iteration.
*/
template <typename number2>
void Tstep (Vector<number2> &dst, const Vector<number2> &rhs) const;
+
+ /**
+ * Return the memory allocated in this object.
+ */
+ std::size_t memory_consumption() const;
};
using RelaxationBlock<MATRIX, inverse_type>::inverse_svd;
using PreconditionBlockBase<inverse_type>::log_statistics;
/**
- * Perform one step of the SOR
- * iteration.
+ * Perform one step of the SOR iteration.
*/
template <typename number2>
void step (Vector<number2> &dst, const Vector<number2> &rhs) const;
/**
- * Perform one step of the
- * transposed SOR iteration.
+ * Perform one step of the transposed SOR iteration.
*/
template <typename number2>
void Tstep (Vector<number2> &dst, const Vector<number2> &rhs) const;
using typename RelaxationBlock<MATRIX,inverse_type>::AdditionalData;
/**
- * Make initialization function
- * publicly available.
+ * Make initialization function publicly available.
*/
using RelaxationBlock<MATRIX, inverse_type>::initialize;
using RelaxationBlock<MATRIX, inverse_type>::inverse_svd;
using PreconditionBlockBase<inverse_type>::log_statistics;
/**
- * Perform one step of the SOR
- * iteration.
+ * Perform one step of the SOR iteration.
*/
template <typename number2>
void step (Vector<number2> &dst, const Vector<number2> &rhs) const;
/**
- * Perform one step of the
- * transposed SOR iteration.
+ * Perform one step of the transposed SOR iteration.
*/
template <typename number2>
void Tstep (Vector<number2> &dst, const Vector<number2> &rhs) const;