]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify step() in PreconditionChebyshev. 4494/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sat, 10 Jun 2017 10:25:11 +0000 (12:25 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sat, 10 Jun 2017 10:25:28 +0000 (12:25 +0200)
include/deal.II/lac/precondition.h

index 723078a450901128fd0622bfb95a0eecf56f7c5a..4b39bb9ec947157e9f15677dff20c4e0ce14e278 100644 (file)
@@ -2221,15 +2221,9 @@ PreconditionChebyshev<MatrixType,VectorType,PreconditionerType>
   if (is_initialized == false)
     estimate_eigenvalues(src);
 
-  if (!dst.all_zero())
-    {
-      matrix_ptr->vmult (update2, dst);
-      internal::PreconditionChebyshev::vector_updates
-      (src, *data.preconditioner, false, 0., 1./theta, update1, update2, update3, dst);
-    }
-  else
-    internal::PreconditionChebyshev::vector_updates
-    (src, *data.preconditioner, true, 0., 1./theta, update1, update2, update3, dst);
+  matrix_ptr->vmult (update2, dst);
+  internal::PreconditionChebyshev::vector_updates
+  (src, *data.preconditioner, false, 0., 1./theta, update1, update2, update3, dst);
 
   do_chebyshev_loop(dst, src);
 }
@@ -2247,15 +2241,9 @@ PreconditionChebyshev<MatrixType,VectorType,PreconditionerType>
   if (is_initialized == false)
     estimate_eigenvalues(src);
 
-  if (!dst.all_zero())
-    {
-      matrix_ptr->Tvmult (update2, dst);
-      internal::PreconditionChebyshev::vector_updates
-      (src, *data.preconditioner, false, 0., 1./theta, update1, update2, update3, dst);
-    }
-  else
-    internal::PreconditionChebyshev::vector_updates
-    (src, *data.preconditioner, true, 0., 1./theta, update1, update2, update3, dst);
+  matrix_ptr->Tvmult (update2, dst);
+  internal::PreconditionChebyshev::vector_updates
+  (src, *data.preconditioner, false, 0., 1./theta, update1, update2, update3, dst);
 
   do_transpose_chebyshev_loop(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.