]> https://gitweb.dealii.org/ - dealii.git/commitdiff
sort output of arpack/step-36_ar
authorMatthias Maier <tamiko@kyomu.43-1.org>
Tue, 16 Dec 2014 01:44:37 +0000 (02:44 +0100)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Tue, 16 Dec 2014 07:51:35 +0000 (08:51 +0100)
tests/arpack/step-36_ar.cc
tests/arpack/step-36_ar.output

index 416330c2f89ddf2d0ec47cf3c616fd2b2a7bd8f8..1b429a8cddd2280fe8d0a476220613ba46cfbc5b 100644 (file)
@@ -51,6 +51,7 @@
 
 #include <fstream>
 #include <iostream>
+#include <algorithm>
 
 namespace Step36
 {
@@ -264,6 +265,10 @@ namespace Step36
   }
 
 
+  bool my_compare(std::complex<double> a, std::complex<double> b)
+  {
+    return a.real() < b.real();
+  }
 
   template <int dim>
   void EigenvalueProblem<dim>::run ()
@@ -274,6 +279,8 @@ namespace Step36
 
     const std::pair<unsigned int, double> res = solve ();
 
+    std::sort(eigenvalues.begin(), eigenvalues.end(), my_compare);
+
     for (unsigned int i=0; i<eigenvalues.size(); ++i)
       deallog << "      Eigenvalue " << i
               << " : " << eigenvalues[i]
index 6c321a987229d0992ad925e3c5161d06cde4f39e..25856436f7c5ba36f30c26523216742c0c2c7ad4 100644 (file)
@@ -1,5 +1,6 @@
+
 DEAL::      Eigenvalue 0 : (4.93877,0.00000)
-DEAL::      Eigenvalue 1 : (19.8027,0.00000)
-DEAL::      Eigenvalue 2 : (12.3707,0.00000)
-DEAL::      Eigenvalue 3 : (12.3707,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 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.