]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix up a few tests.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 27 Mar 2013 11:44:16 +0000 (11:44 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 27 Mar 2013 11:44:16 +0000 (11:44 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29062 0785d39b-7218-0410-832d-ea1e28bc413d

tests/trilinos/65.cc
tests/trilinos/slowness_03.cc
tests/trilinos/slowness_04.cc
tests/trilinos/sparse_matrix_02.cc
tests/trilinos/sparse_matrix_04.cc

index 3c61d1b10979e37ccc97ac6d14ce3b053822ebc5..30ac8c08d3d9ad82ae3cd99329f2a23b9de8748d 100644 (file)
@@ -1,8 +1,8 @@
 //----------------------------  trilinos_65.cc  ---------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2008 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2008, 2013 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -15,7 +15,7 @@
 // This test used to fail after upgrading to petsc 2.2.1
 
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_vector.h>
 
@@ -26,8 +26,9 @@
 
 void test ()
 {
-  TrilinosWrappers::MPI::Vector 
-    v (Epetra_Map(100,0,Utilities::Trilinos::comm_world()));
+  TrilinosWrappers::MPI::Vector
+    v (Epetra_Map(TrilinosWrappers::types::int_type(100),0,
+                 Utilities::Trilinos::comm_world()));
   v(0) = 1;
   v = 0;
 
@@ -36,12 +37,12 @@ void test ()
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("65/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -62,10 +63,10 @@ int main (int argc,char **argv)
                << "Aborting!" << std::endl
                << "----------------------------------------------------"
                << std::endl;
-      
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
                << "----------------------------------------------------"
index 19fcbf64b6f491b6a0274154be0b216756f8741c..77a28ced2abd78ace1d759094ee8e0a68c593506 100644 (file)
@@ -1,8 +1,8 @@
 //----------------------------  trilinos_slowness_03.cc  ---------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
-//    Copyright (C) 2005 by the deal.II authors
+//    Copyright (C) 2005, 2013 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -19,7 +19,7 @@
 //
 // the tests build the 5-point stencil matrix for a uniform grid of size N*N
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/sparse_matrix.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
@@ -32,8 +32,9 @@ void test ()
 {
   const unsigned int N = 200;
 
-                                   // build the sparse matrix 
-  Epetra_Map map (static_cast<int>(N*N), 0, Utilities::Trilinos::comm_world());
+                                   // build the sparse matrix
+  Epetra_Map map (TrilinosWrappers::types::int_type(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++)
@@ -62,7 +63,7 @@ void test ()
           }
       }
   matrix.compress ();
-  
+
                                    // then do a single matrix-vector
                                    // multiplication with subsequent formation
                                    // of the matrix norm
@@ -71,13 +72,13 @@ void test ()
   for (unsigned int i=0; i<N*N; ++i)
     v1(i) = i;
   matrix.vmult (v2, v1);
-  
+
   deallog << v1*v2 << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("slowness_03/output");
   deallog.attach(logfile);
@@ -101,10 +102,10 @@ int main (int argc,char **argv)
                << "Aborting!" << std::endl
                << "----------------------------------------------------"
                << std::endl;
-      
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
                << "----------------------------------------------------"
index c1369bb4bda0c124588af1c40bec249a3eebd6c0..8dc2febce61a54bfeb04f9c41247f3e815f17cb2 100644 (file)
@@ -1,8 +1,8 @@
 //----------------------------  trilinos_slowness_03.cc  ---------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
-//    Copyright (C) 2005 by the deal.II authors
+//    Copyright (C) 2005, 2013 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -25,7 +25,7 @@
 // matrix in a consecutive fashion, but rather according to the order of
 // degrees of freedom in the sequence of cells that we traverse
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/sparse_matrix.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
@@ -52,23 +52,24 @@ void test ()
                                          // unused indices
         const unsigned int k = rand() % (N-i);
         permutation[i] = unused_indices[k];
-        
+
                                          // then swap this used element to the
                                          // end where we won't consider it any
                                          // more
         std::swap (unused_indices[k], unused_indices[N-i-1]);
-      }    
+      }
   }
-  
-                                   // build the sparse matrix 
-  Epetra_Map map (static_cast<int>(N*N), 0, Utilities::Trilinos::comm_world());
+
+                                   // build the sparse matrix
+  Epetra_Map map (TrilinosWrappers::types::int_type(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 i=permutation[i_];
         const unsigned int j=permutation[j_];
-        
+
         const unsigned int global = i*N+j;
         matrix.set(global, global, rand());
         if (j>0)
@@ -93,7 +94,7 @@ void test ()
           }
       }
   matrix.compress ();
-  
+
                                    // then do a single matrix-vector
                                    // multiplication with subsequent formation
                                    // of the matrix norm
@@ -102,13 +103,13 @@ void test ()
   for (unsigned int i=0; i<N*N; ++i)
     v1(i) = i;
   matrix.vmult (v2, v1);
-  
+
   deallog << v1*v2 << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("slowness_04/output");
   deallog.attach(logfile);
@@ -132,10 +133,10 @@ int main (int argc,char **argv)
                << "Aborting!" << std::endl
                << "----------------------------------------------------"
                << std::endl;
-      
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
                << "----------------------------------------------------"
index 269ce40575aa7ce2e858d36994524e8705b382e7..728a3b088cb526fffe6965697fc79baf7bbdedbe 100644 (file)
@@ -50,7 +50,10 @@ int main (int argc,char **argv)
   matrix.print_formatted (deallog.get_file_stream());
 
   // now copy everything into a Trilinos matrix
-  Epetra_Map map(5,5,0,Utilities::Trilinos::comm_world());
+  Epetra_Map map(TrilinosWrappers::types::int_type(5),
+                TrilinosWrappers::types::int_type(5),
+                0,
+                Utilities::Trilinos::comm_world());
   TrilinosWrappers::SparseMatrix tmatrix;
   tmatrix.reinit (map, map, matrix);
 
index 5c70babb2a4eb0a21c812e15a3d0f2cf86c50a53..2bb0f5d7d02efb3df8da3b9ca917dcd72e2b2428 100644 (file)
@@ -51,7 +51,9 @@ int main (int argc,char **argv)
 
   // now copy everything into a Trilinos matrix
   Epetra_Map map(TrilinosWrappers::types::int_type(5),
-                5,0,Utilities::Trilinos::comm_world());
+                TrilinosWrappers::types::int_type(5),
+                0,
+                Utilities::Trilinos::comm_world());
 
   TrilinosWrappers::SparseMatrix tmatrix;
   tmatrix.reinit (map, map, matrix, 0, false);

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.