From 14a533eab2138cb75b1225cd57004e6467e4f59d Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Mon, 17 Sep 2018 12:47:05 -0500 Subject: [PATCH] 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. --- source/lac/petsc_matrix_base.cc | 5 +++++ 1 file changed, 5 insertions(+) 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)); } -- 2.39.5