From: Daniel Garcia-Sanchez Date: Tue, 14 Apr 2020 17:13:51 +0000 (+0200) Subject: Add Tvmult to PETSc PreconditionerBase X-Git-Tag: v9.2.0-rc1~234^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c29092defe521e2093f83efdfb653253baada809;p=dealii.git Add Tvmult to PETSc PreconditionerBase --- 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() {