]> https://gitweb.dealii.org/ - dealii.git/commitdiff
avoid using C++11 functions in arpack unit tests 1146/head
authorDenis Davydov <davydden@gmail.com>
Thu, 17 Sep 2015 21:09:42 +0000 (23:09 +0200)
committerDenis Davydov <davydden@gmail.com>
Thu, 17 Sep 2015 21:09:42 +0000 (23:09 +0200)
tests/arpack/step-36_ar.cc
tests/arpack/step-36_parpack.cc
tests/arpack/step-36_parpack_trilinos.cc

index 1811ba4f93ee2d5df09871a653d2c6237609d3f0..4713a48daea02217b7a52db1eb519dbf862a77eb 100644 (file)
@@ -228,7 +228,7 @@ namespace Step36
 
     // make sure that we have eigenvectors and they are mass-orthonormal:
     // a) (A*x_i-\lambda*B*x_i).L2() == 0
-    // b) x_i*B*y_i=\delta_{ij}
+    // b) x_j*B*x_i=\delta_{ij}
     {
       Vector<double> Ax(eigenfunctions[0]), Bx(eigenfunctions[0]);
       for (unsigned int i=0; i < eigenfunctions.size(); ++i)
@@ -237,12 +237,18 @@ namespace Step36
 
           for (unsigned int j=0; j < eigenfunctions.size(); j++)
             Assert( std::abs( eigenfunctions[j] * Bx - (i==j))< 1e-8,
-                    ExcMessage(std::to_string(eigenfunctions[j] * Bx)));
+                    ExcMessage("Eigenvectors " +
+                               Utilities::int_to_string(i) +
+                               " and " +
+                               Utilities::int_to_string(j) +
+                               " are not orthonormal!"));
 
           stiffness_matrix.vmult(Ax,eigenfunctions[i]);
           Ax.add(-1.0*std::real(eigenvalues[i]),Bx);
           Assert (Ax.l2_norm() < 1e-8,
-                  ExcMessage(std::to_string(Ax.l2_norm())));
+                  ExcMessage("Returned vector " +
+                             Utilities::int_to_string(i) +
+                             " is not an eigenvector!"));
         }
     }
     for (unsigned int i=0; i<eigenfunctions.size(); ++i)
index cb8ec9ab5970083f3a945a21771f542cc670a98b..7f45711e51468ad10e1caf3a2f849bae8ebd20d1 100644 (file)
@@ -298,7 +298,7 @@ void test ()
 
     // make sure that we have eigenvectors and they are mass-orthonormal:
     // a) (A*x_i-\lambda*B*x_i).L2() == 0
-    // b) x_i*B*y_i=\delta_{ij}
+    // b) x_j*B*x_i=\delta_{ij}
     {
       const double precision = 1e-7;
       PETScWrappers::MPI::Vector Ax(eigenfunctions[0]), Bx(eigenfunctions[0]);
@@ -308,7 +308,11 @@ void test ()
 
           for (unsigned int j=0; j < eigenfunctions.size(); j++)
             Assert( std::abs( eigenfunctions[j] * Bx - (i==j))< precision,
-                    ExcMessage(std::to_string(eigenfunctions[j] * Bx)));
+                    ExcMessage("Eigenvectors " +
+                               Utilities::int_to_string(i) +
+                               " and " +
+                               Utilities::int_to_string(j) +
+                               " are not orthonormal!"));
 
           stiffness_matrix.vmult(Ax,eigenfunctions[i]);
           Ax.add(-1.0*std::real(lambda[i]),Bx);
index 31396a8b28471a25dfb15b24df722b67a5e74227..b6a2592e35f2e58557616390bed05862514e17af 100644 (file)
@@ -292,7 +292,7 @@ void test ()
 
     // make sure that we have eigenvectors and they are mass-orthonormal:
     // a) (A*x_i-\lambda*B*x_i).L2() == 0
-    // b) x_i*B*y_i=\delta_{ij}
+    // b) x_j*B*x_i=\delta_{ij}
     {
       const double precision = 1e-7;
       TrilinosWrappers::MPI::Vector Ax(eigenfunctions[0]), Bx(eigenfunctions[0]);
@@ -302,12 +302,18 @@ void test ()
 
           for (unsigned int j=0; j < eigenfunctions.size(); j++)
             Assert( std::abs( eigenfunctions[j] * Bx - (i==j))< precision,
-                    ExcMessage(std::to_string(eigenfunctions[j] * Bx)));
+                    ExcMessage("Eigenvectors " +
+                               Utilities::int_to_string(i) +
+                               " and " +
+                               Utilities::int_to_string(j) +
+                               " are not orthonormal!"));
 
           stiffness_matrix.vmult(Ax,eigenfunctions[i]);
           Ax.add(-1.0*std::real(lambda[i]),Bx);
           Assert (Ax.l2_norm() < precision,
-                  ExcMessage(std::to_string(Ax.l2_norm())));
+                  ExcMessage("Returned vector " +
+                             Utilities::int_to_string(i) +
+                             " is not an eigenvector!"));
         }
     }
   }

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.