]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
The implementation of Tvmult was complete garbage. Fix it.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 21 Feb 2013 20:03:54 +0000 (20:03 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 21 Feb 2013 20:03:54 +0000 (20:03 +0000)
git-svn-id: https://svn.dealii.org/trunk@28515 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-20/step-20.cc

index 66f0937a267de76bf08638a8875dda4174f4d2ed..bbe775234810bd8949196c254629e595d9aefdaa 100644 (file)
@@ -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 <tt>Tvmult</tt> 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 <code>vmult</code> 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<double>       &dst,
                                            const Vector<double> &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);
   }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.