From 3b3941fd4c5fd557da53b931460919eb7ee98628 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Fri, 2 Oct 2009 08:23:28 +0000 Subject: [PATCH] Fix bug in PETSc initialization. git-svn-id: https://svn.dealii.org/trunk@19661 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/petsc_sparse_matrix.h | 16 ---------------- deal.II/lac/source/petsc_sparse_matrix.cc | 13 ++++++------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/deal.II/lac/include/lac/petsc_sparse_matrix.h b/deal.II/lac/include/lac/petsc_sparse_matrix.h index 7ecc3079e9..bbf00a6087 100644 --- a/deal.II/lac/include/lac/petsc_sparse_matrix.h +++ b/deal.II/lac/include/lac/petsc_sparse_matrix.h @@ -166,22 +166,6 @@ namespace PETScWrappers * significantly more efficient to * get memory allocation right from * the start. - * - * Despite the fact that it would - * seem to be an obvious win, setting - * the @p preset_nonzero_locations - * flag to @p true doesn't seem to - * accelerate program. Rather on the - * contrary, it seems to be able to - * slow down entire programs - * somewhat. This is suprising, since - * we can use efficient function - * calls into PETSc that allow to - * create multiple entries at once; - * nevertheless, given the fact that - * it is inefficient, the respective - * flag has a default value equal to - * @p false. */ template SparseMatrix (const SparsityType &sparsity_pattern, diff --git a/deal.II/lac/source/petsc_sparse_matrix.cc b/deal.II/lac/source/petsc_sparse_matrix.cc index 8295faf3ea..cf3535145c 100644 --- a/deal.II/lac/source/petsc_sparse_matrix.cc +++ b/deal.II/lac/source/petsc_sparse_matrix.cc @@ -261,19 +261,18 @@ namespace PETScWrappers &row_values[0], INSERT_VALUES); } compress (); - } - // In the end, tell the matrix that // it should not expect any new // entries. #if (PETSC_VERSION_MAJOR <= 2) - const int ierr = - MatSetOption (matrix, MAT_NO_NEW_NONZERO_LOCATIONS); + const int ierr = + MatSetOption (matrix, MAT_NO_NEW_NONZERO_LOCATIONS); #else - const int ierr = - MatSetOption (matrix, MAT_NEW_NONZERO_LOCATIONS, PETSC_FALSE); + const int ierr = + MatSetOption (matrix, MAT_NEW_NONZERO_LOCATIONS, PETSC_FALSE); #endif - AssertThrow (ierr == 0, ExcPETScError(ierr)); + AssertThrow (ierr == 0, ExcPETScError(ierr)); + } } -- 2.39.5