From: bangerth Date: Thu, 21 Feb 2013 20:03:54 +0000 (+0000) Subject: The implementation of Tvmult was complete garbage. Fix it. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fc9dc74709c1fbdbfaa99931ba2a09844391384;p=dealii-svn.git The implementation of Tvmult was complete garbage. Fix it. git-svn-id: https://svn.dealii.org/trunk@28515 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-20/step-20.cc b/deal.II/examples/step-20/step-20.cc index 66f0937a26..bbe7752348 100644 --- a/deal.II/examples/step-20/step-20.cc +++ b/deal.II/examples/step-20/step-20.cc @@ -2,7 +2,7 @@ /* $Id$ */ /* */ -/* Copyright (C) 2005-2008, 2010-2012 by the deal.II authors */ +/* Copyright (C) 2005-2008, 2010-2013 by the deal.II authors */ /* */ /* This file is subject to QPL and may not be distributed */ /* without copyright and license information. Please refer */ @@ -615,11 +615,13 @@ namespace Step20 // represents. As a consequence, in the code below, we also // implement a Tvmult function here that represents the // product of the transpose matrix with a vector. It is easy to see - // how this needs to be implemented here. (Note, however, that even - // though we implement this function here, there will in fact not be - // any need for it as long as we use SolverCG as the solver since - // that solver does not ever call the function that provides this - // operation.) + // how this needs to be implemented here: since the matrix is + // symmetric, we can as well call vmult wherever the + // product with the transpose matrix is required. (Note, however, + // that even though we implement this function here, there will in + // fact not be any need for it as long as we use SolverCG as the + // solver since that solver does not ever call the function that + // provides this operation.) class ApproximateSchurComplement : public Subscriptor { public: @@ -657,9 +659,7 @@ namespace Step20 void ApproximateSchurComplement::Tvmult (Vector &dst, const Vector &src) const { - system_matrix->block(1,0).Tvmult (dst, tmp2); - system_matrix->block(0,0).precondition_Jacobi (tmp2, tmp1); - system_matrix->block(0,1).Tvmult (tmp1, src); + vmult (dst, src); }