From c29092defe521e2093f83efdfb653253baada809 Mon Sep 17 00:00:00 2001 From: Daniel Garcia-Sanchez Date: Tue, 14 Apr 2020 19:13:51 +0200 Subject: [PATCH] Add Tvmult to PETSc PreconditionerBase --- include/deal.II/lac/petsc_precondition.h | 6 ++++++ source/lac/petsc_precondition.cc | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/deal.II/lac/petsc_precondition.h b/include/deal.II/lac/petsc_precondition.h index fef5eaaddd..adfe27d5c6 100644 --- a/include/deal.II/lac/petsc_precondition.h +++ b/include/deal.II/lac/petsc_precondition.h @@ -80,6 +80,12 @@ namespace PETScWrappers void vmult(VectorBase &dst, const VectorBase &src) const; + /** + * Apply the transpose preconditioner once to the given src vector. + */ + void + Tvmult(VectorBase &dst, const VectorBase &src) const; + /** * Give access to the underlying PETSc object. diff --git a/source/lac/petsc_precondition.cc b/source/lac/petsc_precondition.cc index d29c011385..cd770ed656 100644 --- a/source/lac/petsc_precondition.cc +++ b/source/lac/petsc_precondition.cc @@ -72,6 +72,16 @@ namespace PETScWrappers } + void + PreconditionerBase::Tvmult(VectorBase &dst, const VectorBase &src) const + { + AssertThrow(pc != nullptr, StandardExceptions::ExcInvalidState()); + + const PetscErrorCode ierr = PCApplyTranspose(pc, src, dst); + AssertThrow(ierr == 0, ExcPETScError(ierr)); + } + + void PreconditionerBase::create_pc() { -- 2.39.5