From: Matthias Maier Date: Mon, 17 Sep 2018 17:47:05 +0000 (-0500) Subject: PETscWrappers: Bugfix: use MAT_INPLACE_MATRIX instead of MAT_REUSE_MATRIX X-Git-Tag: v9.1.0-rc1~697^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14a533eab2138cb75b1225cd57004e6467e4f59d;p=dealii.git PETscWrappers: Bugfix: use MAT_INPLACE_MATRIX instead of MAT_REUSE_MATRIX This fixes a bug with the transpose() function when used with PETSc 3.9 or newer. --- diff --git a/source/lac/petsc_matrix_base.cc b/source/lac/petsc_matrix_base.cc index 7ec261dfd4..9ad476e4fd 100644 --- a/source/lac/petsc_matrix_base.cc +++ b/source/lac/petsc_matrix_base.cc @@ -605,7 +605,12 @@ namespace PETScWrappers void MatrixBase::transpose() { +# if DEAL_II_PETSC_VERSION_LT(3, 8, 0) const PetscErrorCode ierr = MatTranspose(matrix, MAT_REUSE_MATRIX, &matrix); +# else + const PetscErrorCode ierr = + MatTranspose(matrix, MAT_INPLACE_MATRIX, &matrix); +# endif AssertThrow(ierr == 0, ExcPETScError(ierr)); }