]> https://gitweb.dealii.org/ - dealii.git/commitdiff
try to get the arpack test a bit more stable
authorMatthias Maier <tamiko@kyomu.43-1.org>
Wed, 17 Dec 2014 00:58:28 +0000 (01:58 +0100)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Wed, 17 Dec 2014 07:52:53 +0000 (08:52 +0100)
Well, it turns out that depending on arpack version and CPU the result for
the first 5 eigenvalues differs. Try to make this a bit more stable by
computing 8 eigenvalues and only print the first 5.

tests/arpack/step-36_ar.cc
tests/arpack/step-36_ar.output

index 1b429a8cddd2280fe8d0a476220613ba46cfbc5b..f84ebdc4325ab7c6d0e73c450acf74d599d53d2f 100644 (file)
@@ -114,8 +114,7 @@ namespace Step36
     stiffness_matrix.reinit (sparsity_pattern);
     mass_matrix.reinit (sparsity_pattern);
 
-    eigenfunctions
-    .resize (5);
+    eigenfunctions.resize (8);
     for (unsigned int i=0; i<eigenfunctions.size (); ++i)
       eigenfunctions[i].reinit (dof_handler.n_dofs ());
 
@@ -281,7 +280,7 @@ namespace Step36
 
     std::sort(eigenvalues.begin(), eigenvalues.end(), my_compare);
 
-    for (unsigned int i=0; i<eigenvalues.size(); ++i)
+    for (unsigned int i = 0; i < 5 && i < eigenvalues.size(); ++i)
       deallog << "      Eigenvalue " << i
               << " : " << eigenvalues[i]
               << std::endl;
@@ -301,14 +300,10 @@ int main (int argc, char **argv)
       deallog.depth_console(0);
       deallog.threshold_double(1.e-10);
 
+      deallog.depth_console (0);
 
-      Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
-      {
-        deallog.depth_console (0);
-
-        EigenvalueProblem<2> problem ("");
-        problem.run ();
-      }
+      EigenvalueProblem<2> problem ("");
+      problem.run ();
     }
 
   catch (std::exception &exc)
index 25856436f7c5ba36f30c26523216742c0c2c7ad4..684685d6fb534cd8caf352708b56fe1e8ab93b42 100644 (file)
@@ -1,6 +1,6 @@
 
 DEAL::      Eigenvalue 0 : (4.93877,0.00000)
 DEAL::      Eigenvalue 1 : (12.3707,0.00000)
-DEAL::      Eigenvalue 2 : (19.8027,0.00000)
-DEAL::      Eigenvalue 3 : (24.8370,0.00000)
+DEAL::      Eigenvalue 2 : (12.3707,0.00000)
+DEAL::      Eigenvalue 3 : (19.8027,0.00000)
 DEAL::      Eigenvalue 4 : (24.8370,0.00000)

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.