From: guido Date: Tue, 25 Feb 2003 13:36:57 +0000 (+0000) Subject: pseudo vmult_add added X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9046a7c6c6ea3f54b7e2299412122043551b15a4;p=dealii-svn.git pseudo vmult_add added git-svn-id: https://svn.dealii.org/trunk@7239 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/precondition_block.h b/deal.II/lac/include/lac/precondition_block.h index 8180dcacd3..6b93e66f32 100644 --- a/deal.II/lac/include/lac/precondition_block.h +++ b/deal.II/lac/include/lac/precondition_block.h @@ -425,6 +425,10 @@ class PreconditionBlockJacobi : public virtual Subscriptor, /** * Actual implementation of the * preconditioner. + * + * Depending on @p{adding}, the + * result of preconditioning is + * added to the destination vector. */ template void do_vmult (Vector&, @@ -443,7 +447,7 @@ class PreconditionBlockJacobi : public virtual Subscriptor, * arbitrarily. * * See @ref{PreconditionBlock} for requirements on the matrix. - * @author Ralf Hartmann, Guido Kanschat, 1999, 2000 + * @author Ralf Hartmann, Guido Kanschat, 1999, 2000, 2001, 2002, 2003 */ template class PreconditionBlockSOR : public virtual Subscriptor, @@ -501,6 +505,26 @@ class PreconditionBlockSOR : public virtual Subscriptor, template void vmult (Vector&, const Vector&) const; + /** + * Execute block SOR + * preconditioning. + * + * Warning: this function + * performs normal @p{vmult} + * without adding. The reason for + * its existence is that + * @ref{BlockMatrixArray} + * requires the adding version by + * default. On the other hand, + * adding requires an additional + * auxiliary vector, which is not + * desirable. + * + * @see{vmult}. + */ + template + void vmult_add (Vector&, const Vector&) const; + /** * Backward application of @ref{vmult}. * @@ -517,6 +541,20 @@ class PreconditionBlockSOR : public virtual Subscriptor, */ template void Tvmult (Vector&, const Vector&) const; + + private: + /** + * Actual implementation of the + * preconditioning algorithm. + * + * The parameter @p{adding} does + * not have any function, yet. + */ + template + void do_vmult (Vector&, + const Vector&, + const bool adding) const; + }; diff --git a/deal.II/lac/include/lac/precondition_block.templates.h b/deal.II/lac/include/lac/precondition_block.templates.h index 426734bb09..daa3e0ba55 100644 --- a/deal.II/lac/include/lac/precondition_block.templates.h +++ b/deal.II/lac/include/lac/precondition_block.templates.h @@ -387,8 +387,10 @@ void PreconditionBlockJacobi template template -void PreconditionBlockSOR::vmult (Vector &dst, - const Vector &src) const +void PreconditionBlockSOR::do_vmult ( + Vector &dst, + const Vector &src, + const bool) const { // introduce the following typedef // since in the use of exceptions, @@ -606,6 +608,26 @@ void PreconditionBlockSOR::Tvmult (Vector &d } } +template +template +void PreconditionBlockSOR +::vmult (Vector &dst, + const Vector &src) const +{ + do_vmult(dst, src, false); +} + + +template +template +void PreconditionBlockSOR +::vmult_add (Vector &dst, + const Vector &src) const +{ + do_vmult(dst, src, true); +} + + //----------------------------------------------------------------------//