]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
document a bug
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 6 May 2013 02:43:18 +0000 (02:43 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 6 May 2013 02:43:18 +0000 (02:43 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@29461 0785d39b-7218-0410-832d-ea1e28bc413d

tests/petsc/sparse_matrix_02.cc [new file with mode: 0644]
tests/petsc/sparse_matrix_02/cmp/generic [new file with mode: 0644]

diff --git a/tests/petsc/sparse_matrix_02.cc b/tests/petsc/sparse_matrix_02.cc
new file mode 100644 (file)
index 0000000..da37b62
--- /dev/null
@@ -0,0 +1,100 @@
+//----------------------------  petsc_sparse_matrix_vector_01.cc  ---------------------------
+//    $Id: sparse_matrix_vector_01.cc 29164 2013-04-03 16:42:17Z heister $
+//    Version: $Name$ 
+//
+//    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
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//----------------------------  petsc_sparse_matrix_vector_01.cc  ---------------------------
+
+
+// document that SparseMatrix::operator= is broken
+
+#include "../tests.h"
+#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_sparse_matrix.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test ()
+{
+  PETScWrappers::SparseMatrix m(10,10,10);
+  for (unsigned int i=0; i<m.m(); ++i)
+    for (unsigned int j=0; j<m.m(); ++j)
+        m.set (i,j, i+2*j);
+
+
+  m.compress();
+  
+  {
+    
+  
+  PETScWrappers::SparseMatrix m2;
+
+  Mat mm=m;
+  Mat m2m=m2;
+  
+  deallog << &mm << " " << &m2m << std::endl;
+
+  m2 = m;
+  {
+
+    Mat mm=m;
+    Mat m2m=m2;
+  deallog << &mm << " " << &m2m << std::endl;
+      
+  }
+  
+  }
+  
+}
+
+
+int main (int argc, char **argv)
+{
+  std::ofstream logfile("sparse_matrix_02/output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  try
+    {
+      Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
+      {
+        test ();
+  
+       deallog << "OK" << std::endl;
+      }
+      
+    }
+  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/petsc/sparse_matrix_02/cmp/generic b/tests/petsc/sparse_matrix_02/cmp/generic
new file mode 100644 (file)
index 0000000..0fd8fc1
--- /dev/null
@@ -0,0 +1,2 @@
+
+DEAL::OK

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.