From cf12b80ad6dd74e6ecb6ad4a1f7d8055a0dab935 Mon Sep 17 00:00:00 2001 From: kronbichler Date: Sun, 28 Sep 2008 19:42:14 +0000 Subject: [PATCH] When generating an empty matrix, call FillComplete() in case that empty matrix is requested somewhere. git-svn-id: https://svn.dealii.org/trunk@17033 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/source/trilinos_sparse_matrix.cc | 28 +++++++++++--------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/deal.II/lac/source/trilinos_sparse_matrix.cc b/deal.II/lac/source/trilinos_sparse_matrix.cc index eeabeb3c0d..3cebd986a2 100755 --- a/deal.II/lac/source/trilinos_sparse_matrix.cc +++ b/deal.II/lac/source/trilinos_sparse_matrix.cc @@ -88,7 +88,9 @@ namespace TrilinosWrappers compressed (true), matrix (std::auto_ptr (new Epetra_FECrsMatrix(View, row_map, 0))) - {} + { + matrix->FillComplete(); + } SparseMatrix::SparseMatrix (const Epetra_Map &InputMap, const unsigned int n_max_entries_per_row) @@ -288,7 +290,7 @@ namespace TrilinosWrappers // In the end, the matrix needs to // be compressed in order to be // really ready. - compress(); + compress(); } @@ -407,6 +409,8 @@ namespace TrilinosWrappers matrix = std::auto_ptr (new Epetra_FECrsMatrix(View, row_map, 0)); + matrix->FillComplete(); + compressed = true; } @@ -884,15 +888,15 @@ namespace TrilinosWrappers const VectorBase &src) const { Assert (&src != &dst, ExcSourceEqualsDestination()); - - Assert (col_map.SameAs(src.vector->Map()) == true, - ExcMessage ("Column map of matrix does not fit with vector map!")); - Assert (row_map.SameAs(dst.vector->Map()) == true, - ExcMessage ("Row map of matrix does not fit with vector map!")); if (matrix->Filled() == false) matrix->FillComplete(col_map, row_map, true); + Assert (src.vector->Map().SameAs(matrix->DomainMap()) == true, + ExcMessage ("Column map of matrix does not fit with vector map!")); + Assert (dst.vector->Map().SameAs(matrix->RangeMap()) == true, + ExcMessage ("Row map of matrix does not fit with vector map!")); + const int ierr = matrix->Multiply (false, *(src.vector), *(dst.vector)); AssertThrow (ierr == 0, ExcTrilinosError(ierr)); } @@ -905,14 +909,14 @@ namespace TrilinosWrappers { Assert (&src != &dst, ExcSourceEqualsDestination()); - Assert (row_map.SameAs(src.vector->Map()) == true, - ExcMessage ("Row map of matrix does not fit with vector map!")); - Assert (col_map.SameAs(dst.vector->Map()) == true, - ExcMessage ("Column map of matrix does not fit with vector map!")); - if (matrix->Filled() == false) matrix->FillComplete(col_map, row_map, true); + Assert (src.vector->Map().SameAs(matrix->DomainMap()) == true, + ExcMessage ("Column map of matrix does not fit with vector map!")); + Assert (dst.vector->Map().SameAs(matrix->RangeMap()) == true, + ExcMessage ("Row map of matrix does not fit with vector map!")); + const int ierr = matrix->Multiply (true, *(src.vector), *(dst.vector)); AssertThrow (ierr == 0, ExcTrilinosError(ierr)); } -- 2.39.5