]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Enable using wrapped trilinos preconditioner with unwrapped solver 1590/head
authorLei Qiao <qiaol618@gmail.com>
Sun, 13 Sep 2015 01:47:11 +0000 (20:47 -0500)
committerLei Qiao <qiaol618@gmail.com>
Wed, 23 Sep 2015 19:02:01 +0000 (14:02 -0500)
include/deal.II/lac/trilinos_precondition.h

index 67b63c1071e0d925dbaaf85925a0c83c53873084..d1d60257563ed86d992e16ebec1c3393049389b1 100644 (file)
@@ -152,6 +152,14 @@ namespace TrilinosWrappers
     virtual void Tvmult (dealii::parallel::distributed::Vector<double>       &dst,
                          const dealii::parallel::distributed::Vector<double> &src) const;
 
+    /**
+     * Return a reference to the underlaying Trilinos Epetra_Operator.
+     * So you can use the preconditioner with unwrapped Trilinos solver.
+     *
+     * Calling this function from an uninitialized object will cause an exception.
+     */
+    Epetra_Operator &trilinos_operator() const;
+
     /**
      * Exception.
      */
@@ -1953,6 +1961,14 @@ namespace TrilinosWrappers
     preconditioner->SetUseTranspose(false);
   }
 
+  inline
+  Epetra_Operator &
+  PreconditionBase::trilinos_operator () const
+  {
+    AssertThrow (preconditioner, ExcMessage("Trying to dereference a null pointer."));
+    return (*preconditioner);
+  }
+
 #endif
 
 }

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.