From: kronbichler Date: Thu, 5 Mar 2009 16:00:57 +0000 (+0000) Subject: I introduced an error in the copy_from function that appeared only when running with... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ae615e2b2f6de644e5c8e7e39c9e946297c6b79;p=dealii-svn.git I introduced an error in the copy_from function that appeared only when running with MPI. This is now fixed again. git-svn-id: https://svn.dealii.org/trunk@18456 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/source/trilinos_sparse_matrix.cc b/deal.II/lac/source/trilinos_sparse_matrix.cc index 3773d939a2..9ef30e4069 100755 --- a/deal.II/lac/source/trilinos_sparse_matrix.cc +++ b/deal.II/lac/source/trilinos_sparse_matrix.cc @@ -253,8 +253,16 @@ namespace TrilinosWrappers { row_map = m.row_map; col_map = m.col_map; - matrix = std::auto_ptr - (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 + (new Epetra_FECrsMatrix(*m.matrix)); compress(); return *this; }