From e2dbceed57852eb5c9d99f5aa9789901edf673f1 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Sun, 12 Sep 2021 22:36:59 +0200 Subject: [PATCH] Add new variant of TrilinosWrappers::linear_operator() --- .../deal.II/lac/trilinos_linear_operator.h | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/include/deal.II/lac/trilinos_linear_operator.h b/include/deal.II/lac/trilinos_linear_operator.h index 4515a8ee02..61b34c3e6e 100644 --- a/include/deal.II/lac/trilinos_linear_operator.h +++ b/include/deal.II/lac/trilinos_linear_operator.h @@ -113,6 +113,42 @@ namespace TrilinosWrappers } + /** + * @relatesalso LinearOperator + * + * A function that encapsulates generic @p matrix objects, based on an + * @p operator_exemplar, that act on a compatible Vector type into a + * LinearOperator. + * + * This function is the equivalent of the dealii::linear_operator, but + * ensures full compatibility with Trilinos operations by preselecting the + * appropriate template parameters. + * + * + * @ingroup TrilinosWrappers + */ + template + inline LinearOperator< + Range, + Domain, + TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload> + linear_operator( + const LinearOperator< + Range, + Domain, + TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload> + & operator_exemplar, + const Matrix &matrix) + { + using Payload = + TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload; + using OperatorExemplar = LinearOperator; + return dealii:: + linear_operator( + operator_exemplar, matrix); + } + + //@} /** * @name Creation of a BlockLinearOperator -- 2.39.5