]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Take over patches to the testsuite between 18958 and 18965 from mainline.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 24 Jun 2009 18:20:01 +0000 (18:20 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 24 Jun 2009 18:20:01 +0000 (18:20 +0000)
git-svn-id: https://svn.dealii.org/branches/releases/Branch-6-2@18971 0785d39b-7218-0410-832d-ea1e28bc413d

tests/petsc/49.cc
tests/petsc/50.cc
tests/trilinos/49.cc
tests/trilinos/49a.cc [new file with mode: 0644]
tests/trilinos/49a/cmp/generic [new file with mode: 0644]
tests/trilinos/50.cc

index 59f44ccf3060cc640e2e45ce90d1dd8b483cb5fe..f19a7bcf46ccf8a692f416112df4ba1aa77065a9 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2004, 2005 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2009 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -12,7 +12,7 @@
 //----------------------------  petsc_49.cc  ---------------------------
 
 
-// check PETScWrappers::operator = (Vector<PetscVector>)
+// check PETScWrappers::Vector::operator = (Vector<PetscVector>)
 
 #include "../tests.h"
 #include <lac/petsc_vector.h>
index 5f4f0876c9eb463aedc0461ce2a9053c5cda6b44..0ac13448616c64ac8202161b38950e10e67acf4e 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2004, 2005 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2009 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -12,7 +12,7 @@
 //----------------------------  petsc_50.cc  ---------------------------
 
 
-// check PETScWrappers::operator = (Vector<T>) with T!=PetscScalar
+// check PETScWrappers::Vector::operator = (Vector<T>) with T!=PetscScalar
 
 #include "../tests.h"
 #include <lac/petsc_vector.h>
index 7fda29f65f84ab02f2b2e20f6bae1e434e63cde2..eae3db3c7677859d6fc736e9f21c65ac3cc095e4 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2004, 2005, 2008 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2008, 2009 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -12,7 +12,7 @@
 //----------------------------  trilinos_49.cc  ---------------------------
 
 
-// check TrilinosWrappers::operator = (Vector<PetscVector>)
+// check TrilinosWrappers::Vector::operator = (dealii::Vector<TrilinosScalar>)
 
 #include "../tests.h" 
 #include <base/utilities.h>
@@ -25,7 +25,7 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-  Vector<TrilinosScalar> w (v.size());
+  dealii::Vector<TrilinosScalar> w (v.size());
 
   for (unsigned int i=0; i<w.size(); ++i)
     w(i) = i;
diff --git a/tests/trilinos/49a.cc b/tests/trilinos/49a.cc
new file mode 100644 (file)
index 0000000..0bd323e
--- /dev/null
@@ -0,0 +1,104 @@
+//----------------------------  trilinos_49.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2004, 2005, 2008, 2009 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_49.cc  ---------------------------
+
+
+// like 49, but do the test for
+//  TrilinosWrappers::BlockVector
+//         ::operator = (dealii::BlockVector<TrilinosScalar>)
+// with block vectors instead of plain vectors
+
+#include "../tests.h" 
+#include <base/utilities.h>
+#include <lac/trilinos_block_vector.h>
+#include <lac/block_vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (TrilinosWrappers::BlockVector &v)
+{
+  std::vector<unsigned int> sizes (2, 3);
+  dealii::BlockVector<TrilinosScalar> w (sizes);
+
+  for (unsigned int i=0; i<w.size(); ++i)
+    w(i) = i;
+  
+  v = w;
+
+  
+                                   // make sure we get the expected result
+  for (unsigned int i=0; i<v.size(); ++i)
+    {
+      Assert (w(i) == i, ExcInternalError());
+      Assert (v(i) == i, ExcInternalError());
+    }
+
+                                  // now also check the reverse assignment
+  w = 0;
+  w = v;
+  for (unsigned int i=0; i<v.size(); ++i)
+    {
+      Assert (w(i) == i, ExcInternalError());
+      Assert (v(i) == i, ExcInternalError());
+    }
+  
+  
+  deallog << "OK" << std::endl;
+}
+
+
+
+int main (int argc,char **argv) 
+{
+  std::ofstream logfile("49a/output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10); 
+
+  Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv);
+
+
+  try
+    {
+      {
+       std::vector<unsigned int> sizes (2, 3);
+        TrilinosWrappers::BlockVector v (sizes);
+        test (v);
+      }
+    }
+  catch (std::exception &exc)
+    {
+      std::cerr << std::endl << std::endl
+               << "----------------------------------------------------"
+               << std::endl;
+      std::cerr << "Exception on processing: " << std::endl
+               << exc.what() << std::endl
+               << "Aborting!" << std::endl
+               << "----------------------------------------------------"
+               << std::endl;
+      
+      return 1;
+    }
+  catch (...) 
+    {
+      std::cerr << std::endl << std::endl
+               << "----------------------------------------------------"
+               << std::endl;
+      std::cerr << "Unknown exception!" << std::endl
+               << "Aborting!" << std::endl
+               << "----------------------------------------------------"
+               << std::endl;
+      return 1;
+    };
+}
diff --git a/tests/trilinos/49a/cmp/generic b/tests/trilinos/49a/cmp/generic
new file mode 100644 (file)
index 0000000..0fd8fc1
--- /dev/null
@@ -0,0 +1,2 @@
+
+DEAL::OK
index 8179b0f25f3742b6c603ad5e7a1c6e85c97cbb3d..301144908f9c61c0941c7f9f168f4dcbe32c035f 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2004, 2005, 2008 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2008, 2009 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -12,7 +12,7 @@
 //----------------------------  trilinos_50.cc  ---------------------------
 
 
-// check TrilinosWrappers::operator = (Vector<T>) with T!=TrilinosScalar
+// check TrilinosWrappers::Vector::operator = (Vector<T>) with T!=TrilinosScalar
 
 #include "../tests.h" 
 #include <base/utilities.h>

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.