]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add Tvmult to PETSc PreconditionerBase
authorDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Tue, 14 Apr 2020 17:13:51 +0000 (19:13 +0200)
committerDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Tue, 14 Apr 2020 17:13:51 +0000 (19:13 +0200)
include/deal.II/lac/petsc_precondition.h
source/lac/petsc_precondition.cc

index fef5eaadddfdec6429f920b491e6f78a5685fc65..adfe27d5c60ed475332532fd0f73d66755fae9c0 100644 (file)
@@ -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.
index d29c011385aeeb8f3ab95a206c06b9e24081b725..cd770ed656844d8e32425db153783698782b0500 100644 (file)
@@ -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()
   {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.