]> https://gitweb.dealii.org/ - dealii.git/commitdiff
I introduced an error in the copy_from function that appeared only when running with...
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 5 Mar 2009 16:00:57 +0000 (16:00 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 5 Mar 2009 16:00:57 +0000 (16:00 +0000)
git-svn-id: https://svn.dealii.org/trunk@18456 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/source/trilinos_sparse_matrix.cc

index 3773d939a26e63eb76d8db9ba9c710b8ed0c2528..9ef30e4069de00a230454e59eb47f7d95a4021c7 100755 (executable)
@@ -253,8 +253,16 @@ namespace TrilinosWrappers
   {
     row_map = m.row_map;
     col_map = m.col_map;
-    matrix = std::auto_ptr<Epetra_FECrsMatrix>
-      (new Epetra_FECrsMatrix(*m.matrix));
+                                  // check whether we need to update the
+                                  // communicator or can just copy the
+                                  // data: in case we have the same
+                                  // distribution, we can just copy the
+                                  // data.
+    if (local_range() == m.local_range())
+      *matrix = *m.matrix;
+    else
+      matrix = std::auto_ptr<Epetra_FECrsMatrix>
+       (new Epetra_FECrsMatrix(*m.matrix));
     compress();
     return *this;
   }

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.