From: Lei Qiao Date: Sun, 13 Sep 2015 01:47:11 +0000 (-0500) Subject: Enable using wrapped trilinos preconditioner with unwrapped solver X-Git-Tag: v8.4.0-rc2~369^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b9b49971924e7e589043a5ba0fb98c10f0b9ee9;p=dealii.git Enable using wrapped trilinos preconditioner with unwrapped solver --- diff --git a/include/deal.II/lac/trilinos_precondition.h b/include/deal.II/lac/trilinos_precondition.h index 67b63c1071..d1d6025756 100644 --- a/include/deal.II/lac/trilinos_precondition.h +++ b/include/deal.II/lac/trilinos_precondition.h @@ -152,6 +152,14 @@ namespace TrilinosWrappers virtual void Tvmult (dealii::parallel::distributed::Vector &dst, const dealii::parallel::distributed::Vector &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 }