From: Jean-Paul Pelteret Date: Sun, 12 Sep 2021 20:36:59 +0000 (+0200) Subject: Add new variant of TrilinosWrappers::linear_operator() X-Git-Tag: v9.4.0-rc1~984^2~4 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2dbceed57852eb5c9d99f5aa9789901edf673f1;p=dealii.git Add new variant of TrilinosWrappers::linear_operator() --- 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