]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Updated the Trilinos tests so that most of them are working now. Need to check some...
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 7 Nov 2008 12:30:37 +0000 (12:30 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 7 Nov 2008 12:30:37 +0000 (12:30 +0000)
git-svn-id: https://svn.dealii.org/trunk@17510 0785d39b-7218-0410-832d-ea1e28bc413d

65 files changed:
tests/trilinos/02.cc
tests/trilinos/03.cc
tests/trilinos/03a.cc
tests/trilinos/03b.cc
tests/trilinos/09.cc
tests/trilinos/10.cc
tests/trilinos/12.cc
tests/trilinos/13.cc
tests/trilinos/14.cc
tests/trilinos/15.cc
tests/trilinos/16.cc
tests/trilinos/20.cc
tests/trilinos/21.cc
tests/trilinos/29.cc
tests/trilinos/30.cc
tests/trilinos/52.cc
tests/trilinos/53.cc
tests/trilinos/54.cc
tests/trilinos/55.cc
tests/trilinos/56.cc
tests/trilinos/62.cc
tests/trilinos/63.cc
tests/trilinos/64.cc
tests/trilinos/65.cc
tests/trilinos/66.cc
tests/trilinos/67.cc
tests/trilinos/68.cc
tests/trilinos/69.cc
tests/trilinos/70.cc
tests/trilinos/block_vector_iterator_01.cc
tests/trilinos/block_vector_iterator_02.cc
tests/trilinos/deal_solver_01.cc
tests/trilinos/deal_solver_02.cc
tests/trilinos/deal_solver_03.cc
tests/trilinos/deal_solver_05.cc
tests/trilinos/parallel_sparse_matrix_01.cc
tests/trilinos/slowness_01.cc
tests/trilinos/slowness_02.cc
tests/trilinos/slowness_03.cc
tests/trilinos/slowness_04.cc
tests/trilinos/solver_01.cc [deleted file]
tests/trilinos/solver_01/cmp/generic [deleted file]
tests/trilinos/solver_02.cc [deleted file]
tests/trilinos/solver_02/cmp/generic [deleted file]
tests/trilinos/solver_03.cc
tests/trilinos/solver_04.cc [deleted file]
tests/trilinos/solver_04/cmp/generic [deleted file]
tests/trilinos/solver_05.cc
tests/trilinos/solver_06.cc
tests/trilinos/solver_07.cc
tests/trilinos/solver_08.cc
tests/trilinos/solver_09.cc [deleted file]
tests/trilinos/solver_09/cmp/generic [deleted file]
tests/trilinos/solver_09/cmp/i386-apple-darwin8.10.1+gcc4.0 [deleted file]
tests/trilinos/solver_09/cmp/powerpc-apple-darwin8.10.0+gcc4.0 [deleted file]
tests/trilinos/solver_09/cmp/x86_64-unknown-linux-gnu+gcc3.3 [deleted file]
tests/trilinos/solver_09/cmp/x86_64-unknown-linux-gnu+gcc4.1 [deleted file]
tests/trilinos/solver_10.cc [deleted file]
tests/trilinos/solver_10/cmp/generic [deleted file]
tests/trilinos/solver_11.cc [deleted file]
tests/trilinos/solver_11/cmp/generic [deleted file]
tests/trilinos/solver_11/cmp/i386-apple-darwin8.10.1+gcc4.0 [deleted file]
tests/trilinos/solver_11/cmp/powerpc-apple-darwin8.10.0+gcc4.0 [deleted file]
tests/trilinos/solver_11/cmp/x86_64-unknown-linux-gnu+gcc3.3 [deleted file]
tests/trilinos/solver_11/cmp/x86_64-unknown-linux-gnu+gcc4.1 [deleted file]

index 504c39b2a5231bd9fd61e69108a7bdd0e9b93705..b6bf4bcdca1e49bfafd666e0f8dd577a7951f670 100644 (file)
 void test (TrilinosWrappers::SparseMatrix &m)
 {
                                    // first set a few entries
+  for (unsigned int i=0; i<m.m(); ++i)
+    for (unsigned int j=0; j<m.m(); ++j)
+      if ((i+2*j+1) % 3 == 0)
+        m.set (i,j, 0.);
+
+                                   // then add values to these entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
index 21e7a224c189ba44d2992bed2d9540cc20e17cd3..6e1bba1e85a5c93e2753ade37b24e413330e932e 100644 (file)
 void test (TrilinosWrappers::SparseMatrix &m)
 {
                                    // first set a few entries
+  for (unsigned int i=0; i<m.m(); ++i)
+    for (unsigned int j=0; j<m.m(); ++j)
+      if ((i+2*j+1) % 3 == 0)
+        m.set (i,j, 0.);
+
+  m.compress();
+
+                                   // then add/set values into these entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
index c87845486755aa889805f8f6c7e765a0dd9c2ad6..afb38179c355fb88ade65ce91e07918e0587018e 100644 (file)
@@ -33,8 +33,6 @@ void test (TrilinosWrappers::SparseMatrix &m)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
-
-  m.compress();
   
                                    // then add the same elements again
   for (unsigned int i=0; i<m.m(); ++i)
index baa62d34df735e21f60a2ca59380b8c83d9e4b19..7f71ba9bbda1ff73bb03697f7b3d423c7c116eed 100644 (file)
@@ -38,6 +38,9 @@ void test (TrilinosWrappers::SparseMatrix &m)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.add (i,j, i*j*.5+.5);
+
+  m.compress();
+
                                    // and overwrite everything again
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
@@ -56,7 +59,6 @@ void test (TrilinosWrappers::SparseMatrix &m)
         }
       else
         {
-          Assert (m(i,j) == 0, ExcInternalError());
           Assert (m.el(i,j) == 0, ExcInternalError());
         }
 
index 985ed7df15627b57761bd8b5cb5e6af281ab0e0d..e6e487b2d1b6ec7b9e9779f0f2dced8a155a7eaf 100644 (file)
@@ -45,7 +45,6 @@ void test (TrilinosWrappers::SparseMatrix &m)
         }
       else
         {
-          Assert (m(i,j) == 0, ExcInternalError());
           Assert (m.el(i,j) == 0, ExcInternalError());
         }
 
index 7e6cba76f1b15a7cb1459c27d72d18622a2f4dde..2215f5eff16a81aeda8521186e9a68cee0303bea 100644 (file)
@@ -45,7 +45,6 @@ void test (TrilinosWrappers::SparseMatrix &m)
         }
       else
         {
-          Assert (m(i,j) == 0, ExcInternalError());
           Assert (m.el(i,j) == 0, ExcInternalError());
         }
 
index a931c891e68ff03cfe7283d17869f5318274a53e..8d642386403a083e22b3a5f20221ba363b429ab6 100644 (file)
@@ -39,9 +39,9 @@ void test (TrilinosWrappers::Vector &v)
                                    // check that they are ok, and this time
                                    // all of them
   for (unsigned int i=0; i<v.size(); ++i)
-    Assert (((pattern[i] == true) && (v(i) == i)
+    Assert ((((pattern[i] == true) && (v(i) == i))
              ||
-             (pattern[i] == false) && (v(i) == 0)),
+             ((pattern[i] == false) && (v(i) == 0))),
              ExcInternalError());
 
   deallog << "OK" << std::endl;
index 692730b23e5db8254aec34355b2759c50dd85169..331919ec8ae2e7729402c80ad537746ec7c0bd28 100644 (file)
@@ -39,9 +39,9 @@ void test (TrilinosWrappers::Vector &v)
                                    // check that they are ok, and this time
                                    // all of them
   for (unsigned int i=0; i<v.size(); ++i)
-    Assert (((pattern[i] == true) && (v(i) == i)
+    Assert ((((pattern[i] == true) && (v(i) == i))
              ||
-             (pattern[i] == false) && (v(i) == 0)),
+             ((pattern[i] == false) && (v(i) == 0))),
              ExcInternalError());
 
   deallog << "OK" << std::endl;
index a1f3ffbb1f8c961873c805f911c5b7c049fedc4b..9a14866525a0dda83221414ce44c29c2e1897bf8 100644 (file)
@@ -45,9 +45,9 @@ void test (TrilinosWrappers::Vector &v)
                                    // check that they are ok, and this time
                                    // all of them
   for (unsigned int i=0; i<v.size(); ++i)
-    Assert (((pattern[i] == true) && (v(i) == i)
+    Assert ((((pattern[i] == true) && (v(i) == i))
              ||
-             (pattern[i] == false) && (v(i) == 0)),
+             ((pattern[i] == false) && (v(i) == 0))),
              ExcInternalError());
 
   deallog << "OK" << std::endl;
index 5565564b0b91e07a3ff8e236b147c360a673209e..e76910826d47b623be35ffe3eba21d60421172fb 100644 (file)
@@ -42,9 +42,9 @@ void test (TrilinosWrappers::Vector &v)
                                    // check that they are ok, and this time
                                    // all of them
   for (unsigned int i=0; i<v.size(); ++i)
-    Assert (((pattern[i] == true) && (v(i) == 2*i)
+    Assert ((((pattern[i] == true) && (v(i) == 2*i))
              ||
-             (pattern[i] == false) && (v(i) == 0)),
+             ((pattern[i] == false) && (v(i) == 0))),
              ExcInternalError());
 
   deallog << "OK" << std::endl;
index 211487fa510619d7e8cf61235caeac07271273bb..df430b72aed141fe717364eed24ec94adeb22aee 100644 (file)
@@ -44,9 +44,9 @@ void test (TrilinosWrappers::Vector &v)
                                    // check that they are ok, and this time
                                    // all of them
   for (unsigned int i=0; i<v.size(); ++i)
-    Assert (((pattern[i] == true) && (v(i) == i)
+    Assert ((((pattern[i] == true) && (v(i) == i))
              ||
-             (pattern[i] == false) && (v(i) == 0)),
+             ((pattern[i] == false) && (v(i) == 0))),
              ExcInternalError());
 
   deallog << "OK" << std::endl;
index b7d2e87103a1cce7ca68af1e82fdcc6c763f2bbc..2e6111f9174c474a85d93cd505bece5ec647159b 100644 (file)
@@ -40,9 +40,9 @@ void test (TrilinosWrappers::Vector &v)
 
                                    // check that the entries are ok
   for (unsigned int i=0; i<v.size(); ++i)
-    Assert (((pattern[i] == true) && (v(i) == i*5./4.)
+    Assert ((((pattern[i] == true) && (v(i) == i*5./4.))
              ||
-             (pattern[i] == false) && (v(i) == 0)),
+            ((pattern[i] == false) && (v(i) == 0))),
              ExcInternalError());
 
   deallog << "OK" << std::endl;
index 0fe7b8ab1bb55e2a2fa77c11e8831310632b3f2a..47c6e0ddfc4fac4b75f2c9b5dda0502150071948 100644 (file)
@@ -40,9 +40,9 @@ void test (TrilinosWrappers::Vector &v)
 
                                    // check that the entries are ok
   for (unsigned int i=0; i<v.size(); ++i)
-    Assert (((pattern[i] == true) && (v(i) == i*3./4.)
+    Assert ((((pattern[i] == true) && (v(i) == i*3./4.))
              ||
-             (pattern[i] == false) && (v(i) == 0)),
+             ((pattern[i] == false) && (v(i) == 0))),
              ExcInternalError());
 
   deallog << "OK" << std::endl;
index e74640cae44c3d8c877c3978057be5f1f8aad1fe..3057fd34bf2e802f214e13694f89658079cd3c02 100644 (file)
@@ -24,7 +24,7 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-  v.reinit (13, true);
+  v.reinit (13);
   
   Assert (v.size() == 13, ExcInternalError());
 
index 6a350b5019251b1dffc9bacb0554db636fb66015..3dcc45f0b17fe095695bd8fb7715516cda77f54d 100644 (file)
@@ -31,7 +31,7 @@ void test (TrilinosWrappers::Vector &v)
   v.compress ();
 
                                    // then resize with setting to zero
-  v.reinit (13, false);
+  v.reinit (13);
   
   Assert (v.size() == 13, ExcInternalError());
   Assert (v.l2_norm() == 0, ExcInternalError());
index 1abbf3f57c09cf6abfa4c7c93ad143e912d52a81..e5a5f63a93489af299788cb88ab9d2a9a57db2e0 100644 (file)
@@ -43,7 +43,6 @@ void test (TrilinosWrappers::SparseMatrix &m)
         }
       else
         {
-          Assert (m(i,j) == 0, ExcInternalError());
           Assert (m.el(i,j) == 0, ExcInternalError());
         }
 
index 08677580442415bb493dc683c55a8906383446ff..202fb3512099fbe93c63ba79d1035aaa03cc0e89 100644 (file)
@@ -41,9 +41,9 @@ void test (TrilinosWrappers::Vector &v)
                                    // check that they are ok, and this time
                                    // all of them
   for (unsigned int i=0; i<v.size(); ++i)
-    Assert (((pattern[i] == true) && (v(i) == 2*i)
+    Assert ((((pattern[i] == true) && (v(i) == 2*i))
              ||
-             (pattern[i] == false) && (v(i) == 0)),
+             ((pattern[i] == false) && (v(i) == 0))),
              ExcInternalError());
 
   deallog << "OK" << std::endl;
index 12d88e785e1fc79598d73d3b2579838a3228dd13..8420b351b1df5df724f0b02ffa76ba4321160aef 100644 (file)
@@ -41,9 +41,9 @@ void test (TrilinosWrappers::Vector &v)
                                    // check that they are ok, and this time
                                    // all of them
   for (unsigned int i=0; i<v.size(); ++i)
-    Assert (((pattern[i] == true) && (v(i) == i)
+    Assert ((((pattern[i] == true) && (v(i) == i))
              ||
-             (pattern[i] == false) && (v(i) == 0)),
+             ((pattern[i] == false) && (v(i) == 0))),
              ExcInternalError());
 
   deallog << "OK" << std::endl;
index bea5d6e9c07fecbe7747c52829051d337d9f3447..053a0885931debd42e8c7332dfcbe066459e82f1 100644 (file)
@@ -41,9 +41,9 @@ void test (TrilinosWrappers::Vector &v)
                                    // check that they are ok, and this time
                                    // all of them
   for (unsigned int i=0; i<v.size(); ++i)
-    Assert (((pattern[i] == true) && (v(i) == 2*i)
+    Assert ((((pattern[i] == true) && (v(i) == 2*i))
              ||
-             (pattern[i] == false) && (v(i) == 0)),
+             ((pattern[i] == false) && (v(i) == 0))),
              ExcInternalError());
 
   deallog << "OK" << std::endl;
index e93cab77af41a10bfeec824136a4c0d254f5d753..4b7ea92126870a55de7e236d3cb4001c995cf2a9 100644 (file)
@@ -41,9 +41,9 @@ void test (TrilinosWrappers::Vector &v)
                                    // check that they are ok, and this time
                                    // all of them
   for (unsigned int i=0; i<v.size(); ++i)
-    Assert (((pattern[i] == true) && (v(i) == i)
+    Assert ((((pattern[i] == true) && (v(i) == i))
              ||
-             (pattern[i] == false) && (v(i) == 0)),
+             ((pattern[i] == false) && (v(i) == 0))),
              ExcInternalError());
 
   deallog << "OK" << std::endl;
index 5946d73333a97f2771cee9382137318b370c2c43..be01a5a093051310e32f5e20f8ead984f580ba80 100644 (file)
@@ -12,7 +12,7 @@
 //----------------------------  trilinos_62.cc  ---------------------------
 
 
-// check TrilinosWrappers::MatrixBase::clear ()
+// check TrilinosWrappers::SparseMatrix::clear ()
 
 #include "../tests.h" 
 #include <base/utilities.h>
@@ -24,7 +24,7 @@
 #include <vector>
 
 
-void test (TrilinosWrappers::MatrixBase &m)
+void test (TrilinosWrappers::SparseMatrix &m)
 {
   Assert (m.m() != 0, ExcInternalError());
   Assert (m.n() != 0, ExcInternalError());
index 04db7ad9cb375d574513bd9e6d30400ff8d80cbe..e5201c53e2e4a64d5dfa1921031238e79dfe7ca1 100644 (file)
@@ -22,7 +22,7 @@
 #include <vector>
 
 
-void test (TrilinosWrappers::MatrixBase &m)
+void test (TrilinosWrappers::SparseMatrix &m)
 {
   Assert (m.m() == 100, ExcInternalError());
   Assert (m.n() == 100, ExcInternalError());
index 41c1f1f417a25a6f8cc36011b6bdc0673630b1ff..406d31e49f8becf749cb1e73fdb17a3500f24f05 100644 (file)
 //----------------------------  trilinos_64.cc  ---------------------------
 
 
-// This test should be run on multiple processors. note that this test also
-// started to fail with the upgrade to petsc 2.2.1 which required a fix in
-// TrilinosWrappers::MatrixBase::operator=
+// This test should be run on multiple processors.
 
 
 #include "../tests.h" 
 #include <base/utilities.h>
 #include <lac/trilinos_sparse_matrix.h>
-#include <lac/trilinos_sparse_matrix.h>
+#include <Epetra_Map.h>
+#include <Epetra_Comm.h>
 #include <lac/vector.h>
 
 #include <fstream>
@@ -31,7 +30,8 @@
 template<typename MatrixType>
 void test (MatrixType &m)
 {
-  m.add(0,0,1);  
+  m.set(0,0,1.);  
+  m.compress();
   m = 0;
   m.compress();
 
@@ -64,14 +64,12 @@ int main (int argc,char **argv)
 
                                         // check
                                         // TrilinosWrappers::SparseMatrix
-       MPI_Comm mpi_communicator (MPI_COMM_WORLD);     
-       int n_jobs=1;
-       MPI_Comm_size (mpi_communicator, &n_jobs);
-       const unsigned int n_mpi_processes=static_cast<unsigned int>(n_jobs);
-       Assert(n_dofs%n_mpi_processes==0, ExcInternalError());
-       const unsigned int n_local_dofs=n_dofs/n_mpi_processes;
-        TrilinosWrappers::SparseMatrix
-         v2 (mpi_communicator, n_dofs, n_dofs, n_local_dofs, n_local_dofs, 5);
+       const unsigned int n_jobs = 
+         Utilities::Trilinos::get_n_mpi_processes(Utilities::Trilinos::comm_world());
+       Assert(n_dofs%n_jobs==0, ExcInternalError());
+       const unsigned int n_local_dofs=n_dofs/n_jobs;
+       Epetra_Map map(n_dofs, n_local_dofs, Utilities::Trilinos::comm_world());
+        TrilinosWrappers::SparseMatrix v2 (map, 5);
         test (v2);
       }
     }
index 862c98050efe808da33ffda95a421222b073903c..05f3596ac52fffc17a6db2aa57f010ece396614f 100644 (file)
@@ -26,7 +26,8 @@
 
 void test ()
 {
-  TrilinosWrappers::MPI::Vector v(PETSC_COMM_WORLD, 100, 100);
+  TrilinosWrappers::MPI::Vector 
+    v (Epetra_Map(100,0,Utilities::Trilinos::comm_world()));
   v(0) = 1;
   v = 0;
 
index e90259a05640be4e47107e201d18eda7c919133d..7e723a8190a746e7d50bee2e12baaac872324fae 100644 (file)
@@ -24,7 +24,7 @@
 #include <vector>
 
 
-void test (TrilinosWrappers::MatrixBase &m)
+void test (TrilinosWrappers::SparseMatrix &m)
 {
   Assert (m.m() != 0, ExcInternalError());
   Assert (m.n() != 0, ExcInternalError());
@@ -38,7 +38,7 @@ void test (TrilinosWrappers::MatrixBase &m)
       if (i>=5)
         {
           const double s = rand();
-          m.add (i,i-5, s);
+          m.set (i,i-5, s);
           norm_sqr += s*s;
           ++nnz;
         }
@@ -46,13 +46,13 @@ void test (TrilinosWrappers::MatrixBase &m)
       if (i<N-5)
         {
           const double s = rand();
-          m.add (i,i+5, s);
+          m.set (i,i+5, s);
           norm_sqr += s*s;
           ++nnz;
         }
       
       const double s = rand();
-      m.add (i,i,s);
+      m.set (i,i,s);
       norm_sqr += s*s;
       ++nnz;
     }
index 13fce014cd96ea9b51cf60cd3c364e60cd10923b..a2a5f04765f4a37de9b6176e16f0ca70f4984456 100644 (file)
@@ -24,7 +24,7 @@
 #include <vector>
 
 
-void test (TrilinosWrappers::MatrixBase &m)
+void test (TrilinosWrappers::SparseMatrix &m)
 {
   Assert (m.m() != 0, ExcInternalError());
   Assert (m.n() != 0, ExcInternalError());
@@ -38,7 +38,7 @@ void test (TrilinosWrappers::MatrixBase &m)
       if (i>=5)
         {
           const double s = rand();
-          m.add (i,i-5, s);
+          m.set (i,i-5, s);
           norm_sqr += s*s;
           ++nnz;
         }
@@ -46,13 +46,13 @@ void test (TrilinosWrappers::MatrixBase &m)
       if (i<N-5)
         {
           const double s = rand();
-          m.add (i,i+5, s);
+          m.set (i,i+5, s);
           norm_sqr += s*s;
           ++nnz;
         }
       
       const double s = rand();
-      m.add (i,i,s);
+      m.set (i,i,s);
       norm_sqr += s*s;
       ++nnz;
     }
index 0f37d9809690602f367dab3e0f1b743bbe943126..7ddf621419c4ec3163cb57c32c355a7dc3afb038 100644 (file)
@@ -24,7 +24,7 @@
 #include <vector>
 
 
-void test (TrilinosWrappers::MatrixBase &m)
+void test (TrilinosWrappers::SparseMatrix &m)
 {
   Assert (m.m() != 0, ExcInternalError());
   Assert (m.n() != 0, ExcInternalError());
@@ -38,7 +38,7 @@ void test (TrilinosWrappers::MatrixBase &m)
       if (i>=5)
         {
           const double s = rand();
-          m.add (i,i-5, s);
+          m.set (i,i-5, s);
           norm_sqr += s*s;
           ++nnz;
         }
@@ -46,13 +46,13 @@ void test (TrilinosWrappers::MatrixBase &m)
       if (i<N-5)
         {
           const double s = rand();
-          m.add (i,i+5, s);
+          m.set (i,i+5, s);
           norm_sqr += s*s;
           ++nnz;
         }
       
       const double s = rand();
-      m.add (i,i,s);
+      m.set (i,i,s);
       norm_sqr += s*s;
       ++nnz;
     }
index 8fb6a26755bb930351344bdd0183aeb79c6fb98a..654714e00a0f3fff10e3c02603dec3e7941f46b6 100644 (file)
@@ -24,7 +24,7 @@
 #include <vector>
 
 
-void test (TrilinosWrappers::MatrixBase &m)
+void test (TrilinosWrappers::SparseMatrix &m)
 {
   Assert (m.m() != 0, ExcInternalError());
   Assert (m.n() != 0, ExcInternalError());
@@ -38,7 +38,7 @@ void test (TrilinosWrappers::MatrixBase &m)
       if (i>=5)
         {
           const double s = rand();
-          m.add (i,i-5, s);
+          m.set (i,i-5, s);
           norm_sqr += s*s;
           ++nnz;
         }
@@ -46,13 +46,13 @@ void test (TrilinosWrappers::MatrixBase &m)
       if (i<N-5)
         {
           const double s = rand();
-          m.add (i,i+5, s);
+          m.set (i,i+5, s);
           norm_sqr += s*s;
           ++nnz;
         }
       
       const double s = rand();
-      m.add (i,i,s);
+      m.set (i,i,s);
       norm_sqr += s*s;
       ++nnz;
     }
index 8e503d06a517a8d32a0d0d3f2267108b048a6d83..fd4923b5754e63157cd78a06cbe2d2ae4896998e 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <fstream>
 
-int main () 
+int main (int argc, char** argv
 {
   std::ofstream logfile("70/output");
   deallog.attach(logfile);
index 2e4018f033c11fc9aca1007ab623ad64628b518f..3fc9662b151cdc3665de352cc7e25a5a966d73af 100644 (file)
 
 void test ()
 {
-  TrilinosWrappers::BlockVector v(2,1);
+  TrilinosWrappers::BlockVector v(2);
+  for (unsigned int i=0; i<v.n_blocks(); ++i)
+    v.block(i).reinit(1);
+  v.collect_sizes();
+
   v(0) = 1;
   v(1) = 2;
 
index 6fce3e14713c7385e3c5fd4cf932fba9023305b9..5179f5f4dbb847d5f4f862fb54a1a0ff871a935b 100644 (file)
 
 void test ()
 {
-  TrilinosWrappers::BlockVector v(2,1);
+  TrilinosWrappers::BlockVector v(2);
+  for (unsigned int i=0; i<v.n_blocks(); ++i)
+    v.block(i).reinit(1);
+  v.collect_sizes();
+
   v(0) = 1;
   v(1) = 2;
 
index 5b97fd080999278aa797eab282d2a951f5969e76..be6d09e594a3d0b1f78b7658ead5af87ab9ad6e1 100644 (file)
@@ -70,7 +70,7 @@ int main(int argc, char **argv)
 
 
   {
-    SolverControl control(100, 1.e-3);
+    SolverControl control(200, 1.e-3);
 
     const unsigned int size = 32;
     unsigned int dim = (size-1)*(size-1);
@@ -90,7 +90,7 @@ int main(int argc, char **argv)
     u.compress ();
 
     GrowingVectorMemory<TrilinosWrappers::Vector> mem;
-    SolverCG<TrilinosWrappers::Vector> solver(control,mem);
+    SolverCG<TrilinosWrappers::Vector> solver(control, mem);
     PreconditionIdentity preconditioner;
     check_solve (solver, A,u,f, preconditioner);
   }
index 327d5e1cf07de44d59f2ffdbc0a0953db50085b6..71dd9153ca15657fa10b44355014e356f04b2e48 100644 (file)
@@ -72,7 +72,7 @@ int main(int argc, char **argv)
 
   
   {
-    SolverControl control(100, 1.e-3);
+    SolverControl control(200, 1.e-3);
 
     const unsigned int size = 32;
     unsigned int dim = (size-1)*(size-1);
index e9a3fe4f6f058d5bd8893c0d74a71ea68e362c13..af4958ebf191e60c49d799fdc1d75ec7ab367173 100644 (file)
@@ -72,7 +72,7 @@ int main(int argc, char **argv)
 
   
   {
-    SolverControl control(100, 1.e-3);
+    SolverControl control(2000, 1.e-3);
 
     const unsigned int size = 32;
     unsigned int dim = (size-1)*(size-1);
index 8c8c0b5359461767e6986c7aa7462251f61b2c43..89667e2c5eb14258d8ce8514ae9f7d9446487659 100644 (file)
@@ -70,7 +70,7 @@ int main(int argc, char **argv)
 
   
   {
-    SolverControl control(100, 1.e-3);
+    SolverControl control(200, 1.e-3);
 
     const unsigned int size = 32;
     unsigned int dim = (size-1)*(size-1);
index 0b80cc8cf231a8bfc3fe59038a2a769aeeff45fe..60919c0e62f2ae8820b12052806f5717ecf141e1 100644 (file)
 #include <cstdlib>
 
 
-unsigned int
-get_n_mpi_processes ()
-{
-  int n_jobs;
-  MPI_Comm_size (MPI_COMM_WORLD, &n_jobs);
-    
-  return n_jobs;
-}
-
-
-
-unsigned int
-get_this_mpi_process ()
-{
-  int rank;
-  MPI_Comm_rank (MPI_COMM_WORLD, &rank);
-    
-  return rank;
-}
-
-
 void test ()
 {
                                    // create a parallel matrix where the first
                                    // process has 10 rows, the second one 20,
                                    // the third one 30, and so on
   unsigned int N = 0;
-  std::vector<unsigned int> local_rows_per_process (get_n_mpi_processes());
-  std::vector<unsigned int> start_row (get_n_mpi_processes());
-  for (unsigned int i=0; i<get_n_mpi_processes(); ++i)
+  std::vector<unsigned int> local_rows_per_process 
+    (Utilities::Trilinos::get_n_mpi_processes(Utilities::Trilinos::comm_world()));
+  std::vector<unsigned int> start_row 
+    (Utilities::Trilinos::get_n_mpi_processes(Utilities::Trilinos::comm_world()));
+  for (unsigned int i=0; 
+       i<Utilities::Trilinos::get_n_mpi_processes(Utilities::Trilinos::comm_world()); 
+       ++i)
     {
       N += (i+1)*10;
       local_rows_per_process[i] = (i+1)*10;
@@ -96,11 +79,13 @@ void test ()
   
                                    // now create a matrix with this sparsity
                                    // pattern
-  TrilinosWrappers::SparseMatrix m;
-  m.reinit (MPI_COMM_WORLD, csp, local_rows_per_process,
-            local_rows_per_process, get_this_mpi_process());
+  Epetra_Map map (-1, local_rows_per_process[Utilities::Trilinos::get_this_mpi_process
+                                            (Utilities::Trilinos::comm_world())], 
+                 0, Utilities::Trilinos::comm_world());
 
-                                   // no write into the exact same matrix
+  TrilinosWrappers::SparseMatrix m;
+  m.reinit (map, csp);
+                                   // now write into the exact same matrix
                                    // entries as have been created by the
                                    // sparsity pattern above
   for (unsigned int i=0; i<N; ++i)
index 496e98e2db5f1fad7766d1ffb60a9ec637467cce..50186835f245514cfb05858ec13b2b8511e53cc0 100644 (file)
@@ -13,8 +13,8 @@
 
 
 // this is part of a whole suite of tests that checks the relative speed of
-// using PETSc for sparse matrices as compared to the speed of our own
-// library. the tests therefore may not all actually use PETSc, but they are
+// using Trilinos for sparse matrices as compared to the speed of our own
+// library. the tests therefore may not all actually use Trilinos, but they are
 // meant to compare it
 //
 // the tests build the 5-point stencil matrix for a uniform grid of size N*N
@@ -111,6 +111,8 @@ int main (int argc,char **argv)
   deallog.attach(logfile);
   deallog.depth_console(0);
 
+  Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv);
+
   try
     {
       {
@@ -141,4 +143,5 @@ int main (int argc,char **argv)
                << std::endl;
       return 1;
     };
+  return 0;
 }
index 9156f13e71268107619f4ad94aebb6939225076a..c2c02f9be5d0a6957efc0c56a4e7d1dbfd1cdd26 100644 (file)
@@ -38,26 +38,26 @@ void test ()
     for(unsigned int j=0; j<N; j++)
       {
         const unsigned int global = i*N+j;
-        matrix.add(global, global, 4);
+        matrix.set(global, global, 4);
         if (j>0)
           {
-            matrix.add(global-1, global, -1);
-            matrix.add(global, global-1, -1);
+            matrix.set(global-1, global, -1);
+            matrix.set(global, global-1, -1);
           }
         if (j<N-1)
           {
-            matrix.add(global+1, global, -1);
-            matrix.add(global, global+1, -1);
+            matrix.set(global+1, global, -1);
+            matrix.set(global, global+1, -1);
           }
         if (i>0)
           {
-            matrix.add(global-N, global, -1);
-            matrix.add(global, global-N, -1);
+            matrix.set(global-N, global, -1);
+            matrix.set(global, global-N, -1);
           }
         if (i<N-1)
           {
-            matrix.add(global+N, global, -1);
-            matrix.add(global, global+N, -1);
+            matrix.set(global+N, global, -1);
+            matrix.set(global, global+N, -1);
           }
       }
   matrix.compress ();
@@ -82,6 +82,8 @@ int main (int argc,char **argv)
   deallog.attach(logfile);
   deallog.depth_console(0);
 
+  Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv);
+
   try
     {
       {
@@ -112,4 +114,5 @@ int main (int argc,char **argv)
                << std::endl;
       return 1;
     };
+  return 0;
 }
index 9a1cdf49341c571ba6aefb81593ded6996aeaa92..6fbbc4f81844206244d3e29a1c047e2b8f883ed1 100644 (file)
@@ -33,34 +33,32 @@ void test ()
   const unsigned int N = 200;
 
                                    // build the sparse matrix 
-  TrilinosWrappers::SparseMatrix matrix (PETSC_COMM_WORLD,
-                                           N*N, N*N,
-                                           N*N, N*N,
-                                           5);
+  Epetra_Map map (N*N, 0, Utilities::Trilinos::comm_world());
+  TrilinosWrappers::SparseMatrix matrix (map, 5);
   for(unsigned int i=0; i<N; i++)
     for(unsigned int j=0; j<N; j++)
       {
         const unsigned int global = i*N+j;
-        matrix.add(global, global, 4);
+        matrix.set(global, global, 4);
         if (j>0)
           {
-            matrix.add(global-1, global, -1);
-            matrix.add(global, global-1, -1);
+            matrix.set(global-1, global, -1);
+            matrix.set(global, global-1, -1);
           }
         if (j<N-1)
           {
-            matrix.add(global+1, global, -1);
-            matrix.add(global, global+1, -1);
+            matrix.set(global+1, global, -1);
+            matrix.set(global, global+1, -1);
           }
         if (i>0)
           {
-            matrix.add(global-N, global, -1);
-            matrix.add(global, global-N, -1);
+            matrix.set(global-N, global, -1);
+            matrix.set(global, global-N, -1);
           }
         if (i<N-1)
           {
-            matrix.add(global+N, global, -1);
-            matrix.add(global, global+N, -1);
+            matrix.set(global+N, global, -1);
+            matrix.set(global, global+N, -1);
           }
       }
   matrix.compress ();
@@ -68,8 +66,8 @@ void test ()
                                    // then do a single matrix-vector
                                    // multiplication with subsequent formation
                                    // of the matrix norm
-  TrilinosWrappers::MPI::Vector v1(PETSC_COMM_WORLD, N*N, N*N);
-  TrilinosWrappers::MPI::Vector v2(PETSC_COMM_WORLD, N*N, N*N);
+  TrilinosWrappers::MPI::Vector v1(map);
+  TrilinosWrappers::MPI::Vector v2(map);
   for (unsigned int i=0; i<N*N; ++i)
     v1(i) = i;
   matrix.vmult (v2, v1);
@@ -85,6 +83,8 @@ int main (int argc,char **argv)
   deallog.attach(logfile);
   deallog.depth_console(0);
 
+  Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv);
+
   try
     {
       {
@@ -115,4 +115,6 @@ int main (int argc,char **argv)
                << std::endl;
       return 1;
     };
+
+  return 0;
 }
index 135cbc4b5dbb8278279c1bb4357b1b3939565d5e..2fcaa79b05cdbccf6da9e960b0a3e92cf10cf47b 100644 (file)
@@ -61,10 +61,8 @@ void test ()
   }
   
                                    // build the sparse matrix 
-  TrilinosWrappers::SparseMatrix matrix (PETSC_COMM_WORLD,
-                                           N*N, N*N,
-                                           N*N, N*N,
-                                           5);
+  Epetra_Map map (N*N, 0, Utilities::Trilinos::comm_world());
+  TrilinosWrappers::SparseMatrix matrix (map, 5);
   for(unsigned int i_=0; i_<N; i_++)
     for(unsigned int j_=0; j_<N; j_++)
       {
@@ -72,26 +70,26 @@ void test ()
         const unsigned int j=permutation[j_];
         
         const unsigned int global = i*N+j;
-        matrix.add(global, global, rand());
+        matrix.set(global, global, rand());
         if (j>0)
           {
-            matrix.add(global-1, global, rand());
-            matrix.add(global, global-1, rand());
+            matrix.set(global-1, global, rand());
+            matrix.set(global, global-1, rand());
           }
         if (j<N-1)
           {
-            matrix.add(global+1, global, rand());
-            matrix.add(global, global+1, rand());
+            matrix.set(global+1, global, rand());
+            matrix.set(global, global+1, rand());
           }
         if (i>0)
           {
-            matrix.add(global-N, global, rand());
-            matrix.add(global, global-N, rand());
+            matrix.set(global-N, global, rand());
+            matrix.set(global, global-N, rand());
           }
         if (i<N-1)
           {
-            matrix.add(global+N, global, rand());
-            matrix.add(global, global+N, rand());
+            matrix.set(global+N, global, rand());
+            matrix.set(global, global+N, rand());
           }
       }
   matrix.compress ();
@@ -99,8 +97,8 @@ void test ()
                                    // then do a single matrix-vector
                                    // multiplication with subsequent formation
                                    // of the matrix norm
-  TrilinosWrappers::MPI::Vector v1(PETSC_COMM_WORLD, N*N, N*N);
-  TrilinosWrappers::MPI::Vector v2(PETSC_COMM_WORLD, N*N, N*N);
+  TrilinosWrappers::MPI::Vector v1(map);
+  TrilinosWrappers::MPI::Vector v2(map);
   for (unsigned int i=0; i<N*N; ++i)
     v1(i) = i;
   matrix.vmult (v2, v1);
@@ -116,6 +114,8 @@ int main (int argc,char **argv)
   deallog.attach(logfile);
   deallog.depth_console(0);
 
+  Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv);
+
   try
     {
       {
@@ -146,4 +146,5 @@ int main (int argc,char **argv)
                << std::endl;
       return 1;
     };
+  return 0;
 }
diff --git a/tests/trilinos/solver_01.cc b/tests/trilinos/solver_01.cc
deleted file mode 100644 (file)
index ac6774a..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-//----------------------------  trilinos_solver_01.cc  ---------------------------
-//    $Id$
-//    Version: $Name$ 
-//
-//    Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
-//
-//----------------------------  trilinos_solver_01.cc  ---------------------------
-
-// test the Trilinos Richardson solver
-
-
-#include "../tests.h" 
-#include <base/utilities.h>
-#include "../lac/testmatrix.h"
-#include <cmath>
-#include <fstream>
-#include <iostream>
-#include <iomanip>
-#include <base/logstream.h>
-#include <lac/trilinos_sparse_matrix.h>
-#include <lac/trilinos_vector.h>
-#include <lac/trilinos_solver.h>
-#include <lac/trilinos_precondition.h>
-#include <lac/vector_memory.h>
-#include <typeinfo>
-
-template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
-void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
-{
-  deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
-  u = 0.;
-  f = 1.;
-  try 
-    {
-      solver.solve(A,u,f,P);
-    }
-  catch (std::exception& e)
-    {
-      deallog << e.what() << std::endl;
-                                       // it needs to be expected for the
-                                       // richardson solver that we end up
-                                       // here, so don't abort
-    }
-
-  deallog << "Solver stopped after " << solver.control().last_step()
-          << " iterations" << std::endl;
-}
-
-
-int main(int argc, char **argv)
-{
-  std::ofstream logfile("solver_01/output");
-  logfile.precision(4);
-  deallog.attach(logfile);
-  deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
-
-  Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv);
-
-  
-  {
-    SolverControl control(100, 1.e-3);
-
-    const unsigned int size = 32;
-    unsigned int dim = (size-1)*(size-1);
-
-    deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
-    FDMatrix testproblem(size, size);
-    TrilinosWrappers::SparseMatrix  A(dim, dim, 5);
-    testproblem.five_point(A);
-
-    TrilinosWrappers::Vector  f(dim);
-    TrilinosWrappers::Vector  u(dim);
-    f = 1.;
-    A.compress ();
-    f.compress ();
-    u.compress ();
-
-    TrilinosWrappers::SolverRichardson solver(control);
-    TrilinosWrappers::PreconditionJacobi preconditioner(A);
-    check_solve (solver, A,u,f, preconditioner);
-  }
-}
-
diff --git a/tests/trilinos/solver_01/cmp/generic b/tests/trilinos/solver_01/cmp/generic
deleted file mode 100644 (file)
index 208bfd4..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers16SolverRichardsonE
-DEAL::Starting value 7.750
-DEAL::Failure step 100 value 4.004
-DEAL::Iterative method reported convergence failure in step 100 with residual 4.00437
-DEAL::Solver stopped after 100 iterations
diff --git a/tests/trilinos/solver_02.cc b/tests/trilinos/solver_02.cc
deleted file mode 100644 (file)
index ec6cedc..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-//----------------------------  trilinos_solver_02.cc  ---------------------------
-//    $Id$
-//    Version: $Name$ 
-//
-//    Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
-//
-//----------------------------  trilinos_solver_02.cc  ---------------------------
-
-// test the Trilinos Chebychev solver
-
-
-#include "../tests.h" 
-#include <base/utilities.h>
-#include "../lac/testmatrix.h"
-#include <cmath>
-#include <fstream>
-#include <iostream>
-#include <iomanip>
-#include <base/logstream.h>
-#include <lac/trilinos_sparse_matrix.h>
-#include <lac/trilinos_vector.h>
-#include <lac/trilinos_solver.h>
-#include <lac/trilinos_precondition.h>
-#include <lac/vector_memory.h>
-#include <typeinfo>
-
-template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
-void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
-{
-  deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
-  u = 0.;
-  f = 1.;
-  try 
-    {
-      solver.solve(A,u,f,P);
-    }
-  catch (std::exception& e)
-    {
-      deallog << e.what() << std::endl;
-                                       // just like for Richardson: we end up
-                                       // here normally for this solver
-    }
-
-  deallog << "Solver stopped after " << solver.control().last_step()
-          << " iterations" << std::endl;
-}
-
-
-int main(int argc, char **argv)
-{
-  std::ofstream logfile("solver_02/output");
-  logfile.precision(4);
-  deallog.attach(logfile);
-  deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
-
-  Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv);
-
-
-  {  
-    SolverControl control(100, 1.e-3);
-
-    const unsigned int size = 32;
-    unsigned int dim = (size-1)*(size-1);
-
-    deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
-    FDMatrix testproblem(size, size);
-    TrilinosWrappers::SparseMatrix  A(dim, dim, 5);
-    testproblem.five_point(A);
-
-    TrilinosWrappers::Vector  f(dim);
-    TrilinosWrappers::Vector  u(dim);
-    f = 1.;
-    A.compress ();
-    f.compress ();
-    u.compress ();
-
-    TrilinosWrappers::SolverChebychev solver(control);
-    TrilinosWrappers::PreconditionJacobi preconditioner(A);
-    check_solve (solver, A,u,f, preconditioner);
-  }
-}
-
diff --git a/tests/trilinos/solver_02/cmp/generic b/tests/trilinos/solver_02/cmp/generic
deleted file mode 100644 (file)
index ec61667..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers15SolverChebychevE
-DEAL::Starting value 7.745
-DEAL::Failure step 100 value 3.885
-DEAL::Iterative method reported convergence failure in step 100 with residual 3.88526
-DEAL::Solver stopped after 100 iterations
index 5fa013f82ba1a741e2a371f09d47b08967484a7d..f10862d954bd6f081641680df87ae73e41bf05e2 100644 (file)
@@ -65,7 +65,7 @@ int main(int argc, char **argv)
 
 
   {  
-    SolverControl control(100, 1.e-3);
+    SolverControl control(200, 1.e-3);
 
     const unsigned int size = 32;
     unsigned int dim = (size-1)*(size-1);
@@ -85,7 +85,8 @@ int main(int argc, char **argv)
     u.compress ();
 
     TrilinosWrappers::SolverCG solver(control);
-    TrilinosWrappers::PreconditionJacobi preconditioner(A);
+    TrilinosWrappers::PreconditionJacobi preconditioner;
+    preconditioner.initialize(A);
     check_solve (solver, A,u,f, preconditioner);
   }
 }
diff --git a/tests/trilinos/solver_04.cc b/tests/trilinos/solver_04.cc
deleted file mode 100644 (file)
index aae751d..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-//----------------------------  trilinos_solver_04.cc  ---------------------------
-//    $Id$
-//    Version: $Name$ 
-//
-//    Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
-//
-//----------------------------  trilinos_solver_04.cc  ---------------------------
-
-// test the Trilinos BiCG solver
-
-
-#include "../tests.h" 
-#include <base/utilities.h>
-#include "../lac/testmatrix.h"
-#include <cmath>
-#include <fstream>
-#include <iostream>
-#include <iomanip>
-#include <base/logstream.h>
-#include <lac/trilinos_sparse_matrix.h>
-#include <lac/trilinos_vector.h>
-#include <lac/trilinos_solver.h>
-#include <lac/trilinos_precondition.h>
-#include <lac/vector_memory.h>
-#include <typeinfo>
-
-template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
-void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
-{
-  deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
-  u = 0.;
-  f = 1.;
-  try 
-    {
-      solver.solve(A,u,f,P);
-    }
-  catch (std::exception& e)
-    {
-      deallog << e.what() << std::endl;
-      abort ();
-    }
-
-  deallog << "Solver stopped after " << solver.control().last_step()
-          << " iterations" << std::endl;
-}
-
-
-int main(int argc, char **argv)
-{
-  std::ofstream logfile("solver_04/output");
-  logfile.precision(4);
-  deallog.attach(logfile);
-  deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
-
-  Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv);
-
-
-  {  
-    SolverControl control(100, 1.e-3);
-
-    const unsigned int size = 32;
-    unsigned int dim = (size-1)*(size-1);
-
-    deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
-    FDMatrix testproblem(size, size);
-    TrilinosWrappers::SparseMatrix  A(dim, dim, 5);
-    testproblem.five_point(A);
-
-    TrilinosWrappers::Vector  f(dim);
-    TrilinosWrappers::Vector  u(dim);
-    f = 1.;
-    A.compress ();
-    f.compress ();
-    u.compress ();
-
-    TrilinosWrappers::SolverBiCG solver(control);
-    TrilinosWrappers::PreconditionJacobi preconditioner(A);
-    check_solve (solver, A,u,f, preconditioner);
-  }
-}
-
diff --git a/tests/trilinos/solver_04/cmp/generic b/tests/trilinos/solver_04/cmp/generic
deleted file mode 100644 (file)
index d69ef94..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers10SolverBiCGE
-DEAL::Starting value 7.750
-DEAL::Convergence step 41 value 0.0006730
-DEAL::Solver stopped after 41 iterations
index d4d28b01d5f49509fa7f6fd210842137258bef75..75eb00c8f9f06dcb360fec1138786d65cea7239a 100644 (file)
@@ -65,7 +65,7 @@ int main(int argc, char **argv)
 
 
   {  
-    SolverControl control(100, 1.e-3);
+    SolverControl control(200, 1.e-3);
 
     const unsigned int size = 32;
     unsigned int dim = (size-1)*(size-1);
@@ -85,7 +85,8 @@ int main(int argc, char **argv)
     u.compress ();
 
     TrilinosWrappers::SolverGMRES solver(control);
-    TrilinosWrappers::PreconditionJacobi preconditioner(A);
+    TrilinosWrappers::PreconditionJacobi preconditioner;
+    preconditioner.initialize(A);
     check_solve (solver, A,u,f, preconditioner);
   }
 }
index 5fe5bcd4891da00c57c171e8281018cb87105419..ce79d0c2aec11e89a8ccdd255e5ce4728f8b480d 100644 (file)
@@ -85,7 +85,8 @@ int main(int argc, char **argv)
     u.compress ();
 
     TrilinosWrappers::SolverBicgstab solver(control);
-    TrilinosWrappers::PreconditionJacobi preconditioner(A);
+    TrilinosWrappers::PreconditionJacobi preconditioner;
+    preconditioner.initialize(A);
     check_solve (solver, A,u,f, preconditioner);
   }
 }
index 74f4362acf441c6e6ca3154884fc53ea0b24f4cc..679459cf1cdb59b4c05b9b883555597751c33bfc 100644 (file)
@@ -1,8 +1,8 @@
 //----------------------------  trilinos_solver_07.cc  ---------------------------
-//    $Id$
+//    $Id: solver_07.cc 17307 2008-10-23 01:52:20Z bangerth $
 //    Version: $Name$ 
 //
-//    Copyright (C) 2004, 2005, 2008 by the deal.II authors
+//    Copyright (C) 2004, 2005 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
 // test the Trilinos CGS solver
 
 
-#include "../tests.h" 
-#include <base/utilities.h>
+#include "../tests.h"
 #include "../lac/testmatrix.h"
 #include <cmath>
 #include <fstream>
 #include <iostream>
 #include <iomanip>
 #include <base/logstream.h>
+#include <base/utilities.h>
 #include <lac/trilinos_sparse_matrix.h>
 #include <lac/trilinos_vector.h>
 #include <lac/trilinos_solver.h>
@@ -59,13 +59,12 @@ int main(int argc, char **argv)
   logfile.precision(4);
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
-
-  Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv);
+  deallog.threshold_double(1.e-10);
 
+  Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv);
 
   {
-    SolverControl control(100, 1.e-3);
+    SolverControl control(200, 1.e-3);
 
     const unsigned int size = 32;
     unsigned int dim = (size-1)*(size-1);
@@ -85,8 +84,10 @@ int main(int argc, char **argv)
     u.compress ();
 
     TrilinosWrappers::SolverCGS solver(control);
-    TrilinosWrappers::PreconditionJacobi preconditioner(A);
+    TrilinosWrappers::PreconditionJacobi preconditioner;
+    preconditioner.initialize(A);
     check_solve (solver, A,u,f, preconditioner);
   }
+
 }
 
index 71f522757489f29073a6cb33ad1cca2981d9635e..0b672bf226db773a6015314051029efa70f3ba8c 100644 (file)
@@ -85,7 +85,8 @@ int main(int argc, char **argv)
     u.compress ();
 
     TrilinosWrappers::SolverTFQMR solver(control);
-    TrilinosWrappers::PreconditionJacobi preconditioner(A);
+    TrilinosWrappers::PreconditionJacobi preconditioner;
+    preconditioner.initialize(A);
     check_solve (solver, A,u,f, preconditioner);
   }
 }
diff --git a/tests/trilinos/solver_09.cc b/tests/trilinos/solver_09.cc
deleted file mode 100644 (file)
index 4e29951..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-//----------------------------  trilinos_solver_09.cc  ---------------------------
-//    $Id$
-//    Version: $Name$ 
-//
-//    Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
-//
-//----------------------------  trilinos_solver_09.cc  ---------------------------
-
-// test the Trilinos TCQMR solver
-//
-// note that this test fails on Trilinos 2.1.6 due to a bug in the TCQMR
-// implementation. this is reported and should be fixed soonish
-
-
-
-#include "../tests.h" 
-#include <base/utilities.h>
-#include "../lac/testmatrix.h"
-#include <cmath>
-#include <fstream>
-#include <iostream>
-#include <iomanip>
-#include <base/logstream.h>
-#include <lac/trilinos_sparse_matrix.h>
-#include <lac/trilinos_vector.h>
-#include <lac/trilinos_solver.h>
-#include <lac/trilinos_precondition.h>
-#include <lac/vector_memory.h>
-#include <typeinfo>
-
-template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
-void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
-{
-  deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
-  u = 0.;
-  f = 1.;
-  try 
-    {
-      solver.solve(A,u,f,P);
-    }
-  catch (std::exception& e)
-    {
-      deallog << e.what() << std::endl;
-      abort ();
-    }
-
-  deallog << "Solver stopped after " << solver.control().last_step()
-          << " iterations" << std::endl;
-}
-
-
-int main(int argc, char **argv)
-{
-  std::ofstream logfile("solver_09/output");
-  logfile.precision(4);
-  deallog.attach(logfile);
-  deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
-
-  Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv);
-
-  
-  {
-    SolverControl control(100, 1.e-3);
-
-    const unsigned int size = 32;
-    unsigned int dim = (size-1)*(size-1);
-
-    deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
-    FDMatrix testproblem(size, size);
-    TrilinosWrappers::SparseMatrix  A(dim, dim, 5);
-    testproblem.five_point(A);
-
-    TrilinosWrappers::Vector  f(dim);
-    TrilinosWrappers::Vector  u(dim);
-    f = 1.;
-    A.compress ();
-    f.compress ();
-    u.compress ();
-
-    TrilinosWrappers::SolverTCQMR solver(control);
-    TrilinosWrappers::PreconditionJacobi preconditioner(A);
-    check_solve (solver, A,u,f, preconditioner);
-  }
-}
-
diff --git a/tests/trilinos/solver_09/cmp/generic b/tests/trilinos/solver_09/cmp/generic
deleted file mode 100644 (file)
index c1e7ffb..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers11SolverTCQMRE
-DEAL::Starting value 7.750
-DEAL::Starting value 7.750
-DEAL::Convergence step 44 value 0.0007016
-DEAL::Solver stopped after 44 iterations
diff --git a/tests/trilinos/solver_09/cmp/i386-apple-darwin8.10.1+gcc4.0 b/tests/trilinos/solver_09/cmp/i386-apple-darwin8.10.1+gcc4.0
deleted file mode 100644 (file)
index c6b97de..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers11SolverTCQMRE
-DEAL::Starting value 7.750
-DEAL::Starting value 7.750
-DEAL::Convergence step 44 value 0.0007012
-DEAL::Solver stopped after 44 iterations
diff --git a/tests/trilinos/solver_09/cmp/powerpc-apple-darwin8.10.0+gcc4.0 b/tests/trilinos/solver_09/cmp/powerpc-apple-darwin8.10.0+gcc4.0
deleted file mode 100644 (file)
index 5757c5d..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers11SolverTCQMRE
-DEAL::Starting value 7.750
-DEAL::Starting value 7.750
-DEAL::Convergence step 44 value 0.0007011
-DEAL::Solver stopped after 44 iterations
diff --git a/tests/trilinos/solver_09/cmp/x86_64-unknown-linux-gnu+gcc3.3 b/tests/trilinos/solver_09/cmp/x86_64-unknown-linux-gnu+gcc3.3
deleted file mode 100644 (file)
index 34a2267..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers11SolverTCQMRE
-DEAL::Starting value 7.750
-DEAL::Starting value 7.750
-DEAL::Convergence step 44 value 0.0007008
-DEAL::Solver stopped after 44 iterations
diff --git a/tests/trilinos/solver_09/cmp/x86_64-unknown-linux-gnu+gcc4.1 b/tests/trilinos/solver_09/cmp/x86_64-unknown-linux-gnu+gcc4.1
deleted file mode 100644 (file)
index 7fad18a..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers11SolverTCQMRE
-DEAL::Starting value 7.750
-DEAL::Starting value 7.750
-DEAL::Convergence step 44 value 0.0007010
-DEAL::Solver stopped after 44 iterations
diff --git a/tests/trilinos/solver_10.cc b/tests/trilinos/solver_10.cc
deleted file mode 100644 (file)
index cb7a6ac..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-//----------------------------  trilinos_solver_10.cc  ---------------------------
-//    $Id$
-//    Version: $Name$ 
-//
-//    Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
-//
-//----------------------------  trilinos_solver_10.cc  ---------------------------
-
-// test the Trilinos CR solver
-
-
-#include "../tests.h" 
-#include <base/utilities.h>
-#include "../lac/testmatrix.h"
-#include <cmath>
-#include <fstream>
-#include <iostream>
-#include <iomanip>
-#include <base/logstream.h>
-#include <lac/trilinos_sparse_matrix.h>
-#include <lac/trilinos_vector.h>
-#include <lac/trilinos_solver.h>
-#include <lac/trilinos_precondition.h>
-#include <lac/vector_memory.h>
-#include <typeinfo>
-
-template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
-void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
-{
-  deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
-  u = 0.;
-  f = 1.;
-  try 
-    {
-      solver.solve(A,u,f,P);
-    }
-  catch (std::exception& e)
-    {
-      deallog << e.what() << std::endl;
-      abort ();
-    }
-
-  deallog << "Solver stopped after " << solver.control().last_step()
-          << " iterations" << std::endl;
-}
-
-
-int main(int argc, char **argv)
-{
-  std::ofstream logfile("solver_10/output");
-  logfile.precision(4);
-  deallog.attach(logfile);
-  deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
-
-  Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv);
-
-  
-  {
-    SolverControl control(100, 1.e-3);
-
-    const unsigned int size = 32;
-    unsigned int dim = (size-1)*(size-1);
-
-    deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
-    FDMatrix testproblem(size, size);
-    TrilinosWrappers::SparseMatrix  A(dim, dim, 5);
-    testproblem.five_point(A);
-
-    TrilinosWrappers::Vector  f(dim);
-    TrilinosWrappers::Vector  u(dim);
-    f = 1.;
-    A.compress ();
-    f.compress ();
-    u.compress ();
-
-    TrilinosWrappers::SolverCR solver(control);
-    TrilinosWrappers::PreconditionJacobi preconditioner(A);
-    check_solve (solver, A,u,f, preconditioner);
-  }
-}
-
diff --git a/tests/trilinos/solver_10/cmp/generic b/tests/trilinos/solver_10/cmp/generic
deleted file mode 100644 (file)
index 0c6333f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers8SolverCRE
-DEAL::Starting value 7.750
-DEAL::Convergence step 41 value 0.0005700
-DEAL::Solver stopped after 41 iterations
diff --git a/tests/trilinos/solver_11.cc b/tests/trilinos/solver_11.cc
deleted file mode 100644 (file)
index f68de16..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-//----------------------------  trilinos_solver_11.cc  ---------------------------
-//    $Id$
-//    Version: $Name$ 
-//
-//    Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
-//
-//----------------------------  trilinos_solver_11.cc  ---------------------------
-
-// test the Trilinos LSQR solver
-
-
-#include "../tests.h" 
-#include <base/utilities.h>
-#include "../lac/testmatrix.h"
-#include <cmath>
-#include <fstream>
-#include <iostream>
-#include <iomanip>
-#include <base/logstream.h>
-#include <lac/trilinos_sparse_matrix.h>
-#include <lac/trilinos_vector.h>
-#include <lac/trilinos_solver.h>
-#include <lac/trilinos_precondition.h>
-#include <lac/vector_memory.h>
-#include <typeinfo>
-
-template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
-void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
-{
-  deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
-  u = 0.;
-  f = 1.;
-  try 
-    {
-      solver.solve(A,u,f,P);
-    }
-  catch (std::exception& e)
-    {
-      deallog << e.what() << std::endl;
-                                       // just like for Richardson: expect to
-                                       // get here, don't abort the program
-    }
-
-  deallog << "Solver stopped after " << solver.control().last_step()
-          << " iterations" << std::endl;
-}
-
-
-int main(int argc, char **argv)
-{
-  std::ofstream logfile("solver_11/output");
-  logfile.precision(4);
-  deallog.attach(logfile);
-  deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
-
-  Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv);
-
-  
-  {
-    SolverControl control(100, 1.e-3);
-
-    const unsigned int size = 32;
-    unsigned int dim = (size-1)*(size-1);
-
-    deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
-    FDMatrix testproblem(size, size);
-    TrilinosWrappers::SparseMatrix  A(dim, dim, 5);
-    testproblem.five_point(A);
-
-    TrilinosWrappers::Vector  f(dim);
-    TrilinosWrappers::Vector  u(dim);
-    f = 1.;
-    A.compress ();
-    f.compress ();
-    u.compress ();
-
-    TrilinosWrappers::SolverLSQR solver(control);
-    TrilinosWrappers::PreconditionJacobi preconditioner(A);
-    check_solve (solver, A,u,f, preconditioner);
-  }
-}
-
diff --git a/tests/trilinos/solver_11/cmp/generic b/tests/trilinos/solver_11/cmp/generic
deleted file mode 100644 (file)
index 2a67dab..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers10SolverLSQRE
-DEAL::Starting value 31.00
-DEAL::Failure step 100 value 24.01
-DEAL::Iterative method reported convergence failure in step 100 with residual 24.0098
-DEAL::Solver stopped after 100 iterations
diff --git a/tests/trilinos/solver_11/cmp/i386-apple-darwin8.10.1+gcc4.0 b/tests/trilinos/solver_11/cmp/i386-apple-darwin8.10.1+gcc4.0
deleted file mode 100644 (file)
index ef72f8d..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers10SolverLSQRE
-DEAL::Starting value 31.00
-DEAL::Failure step 100 value 24.02
-DEAL::Iterative method reported convergence failure in step 100 with residual 24.0185
-DEAL::Solver stopped after 100 iterations
diff --git a/tests/trilinos/solver_11/cmp/powerpc-apple-darwin8.10.0+gcc4.0 b/tests/trilinos/solver_11/cmp/powerpc-apple-darwin8.10.0+gcc4.0
deleted file mode 100644 (file)
index a7a6ad6..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers10SolverLSQRE
-DEAL::Starting value 31.00
-DEAL::Failure step 100 value 24.02
-DEAL::Iterative method reported convergence failure in step 100 with residual 24.0199
-DEAL::Solver stopped after 100 iterations
diff --git a/tests/trilinos/solver_11/cmp/x86_64-unknown-linux-gnu+gcc3.3 b/tests/trilinos/solver_11/cmp/x86_64-unknown-linux-gnu+gcc3.3
deleted file mode 100644 (file)
index 3b0d986..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers10SolverLSQRE
-DEAL::Starting value 31.00
-DEAL::Failure step 100 value 24.02
-DEAL::Iterative method reported convergence failure in step 100 with residual 24.0219
-DEAL::Solver stopped after 100 iterations
diff --git a/tests/trilinos/solver_11/cmp/x86_64-unknown-linux-gnu+gcc4.1 b/tests/trilinos/solver_11/cmp/x86_64-unknown-linux-gnu+gcc4.1
deleted file mode 100644 (file)
index b4f6514..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii13PETScWrappers10SolverLSQRE
-DEAL::Starting value 31.00
-DEAL::Failure step 100 value 24.02
-DEAL::Iterative method reported convergence failure in step 100 with residual 24.0221
-DEAL::Solver stopped after 100 iterations

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.