From 7ae615e2b2f6de644e5c8e7e39c9e946297c6b79 Mon Sep 17 00:00:00 2001 From: kronbichler Date: Thu, 5 Mar 2009 16:00:57 +0000 Subject: [PATCH] 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 --- deal.II/lac/source/trilinos_sparse_matrix.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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; } -- 2.39.5