]> https://gitweb.dealii.org/ - dealii.git/commitdiff
test for finite residual
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 23 Jul 2012 10:28:47 +0000 (10:28 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 23 Jul 2012 10:28:47 +0000 (10:28 +0000)
git-svn-id: https://svn.dealii.org/trunk@25720 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/householder.h

index 6dd6b64fda49ba7764d16e1599ddc4c0b8276df9..948f1b443ecb984610b18fe6e042e2772c0ca1c9 100644 (file)
@@ -163,7 +163,7 @@ Householder<number>::initialize(const FullMatrix<number2>& M)
     number2 s = (this->el(j,j) < 0) ? std::sqrt(sigma) : -std::sqrt(sigma);
                                      //
     number2 beta = std::sqrt(1./(sigma-s*this->el(j,j)));
-
+    
                                      // Make column j the Householder
                                      // vector, store first entry in
                                      // diagonal
@@ -233,6 +233,8 @@ Householder<number>::least_squares (Vector<number2>& dst,
   number2 sum = 0.;
   for (unsigned int i=n ; i<m ; ++i)
     sum += (*aux)(i) * (*aux)(i);
+  Assert(numbers::is_finite(sum), ExcNumberNotFinite());
+  
                                    // Compute solution
   this->backward(dst, *aux);
 
@@ -276,6 +278,8 @@ Householder<number>::least_squares (BlockVector<number2>& dst,
   number2 sum = 0.;
   for (unsigned int i=n ; i<m ; ++i)
     sum += (*aux)(i) * (*aux)(i);
+  Assert(numbers::is_finite(sum), ExcNumberNotFinite());
+  
                                    //backward works for
                                    //Vectors only, so copy
                                    //them before

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.