Reference documentation for deal.II version 9.6.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
trilinos_linear_operator.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2017 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_trilinos_linear_operator_h
16#define dealii_trilinos_linear_operator_h
17
18#include <deal.II/base/config.h>
19
20#ifdef DEAL_II_WITH_TRILINOS
21
24
26
27namespace TrilinosWrappers
28{
29 // Forward declarations:
30# ifndef DOXYGEN
31 class SparseMatrix;
32 class PreconditionBase;
34
35 namespace internal
36 {
37 namespace LinearOperatorImplementation
38 {
39 class TrilinosPayload;
40 }
41
42 namespace BlockLinearOperatorImplementation
43 {
44 template <typename PayloadBlockType>
45 class TrilinosBlockPayload;
46 }
47 } // namespace internal
48# endif
49
70 template <typename Range, typename Domain = Range, typename Matrix>
71 inline LinearOperator<
72 Range,
73 Domain,
76 const Matrix &matrix)
77 {
78 using OperatorExemplar = TrilinosWrappers::SparseMatrix;
79 using Payload =
81 return ::
82 linear_operator<Range, Domain, Payload, OperatorExemplar, Matrix>(
83 operator_exemplar, matrix);
84 }
85
86
100 template <typename Range, typename Domain = Range>
101 inline LinearOperator<
102 Range,
103 Domain,
106 {
107 using Matrix = TrilinosWrappers::SparseMatrix;
108 using Payload =
110 return ::linear_operator<Range, Domain, Payload, Matrix, Matrix>(
111 matrix, matrix);
112 }
113
114
129 template <typename Range, typename Domain, typename Matrix>
130 inline LinearOperator<
131 Range,
132 Domain,
135 const LinearOperator<
136 Range,
137 Domain,
139 &operator_exemplar,
140 const Matrix &matrix)
141 {
142 using Payload =
144 using OperatorExemplar = LinearOperator<Range, Domain, Payload>;
145 return ::
146 linear_operator<Range, Domain, Payload, OperatorExemplar, Matrix>(
147 operator_exemplar, matrix);
148 }
149
150
170 template <typename Range, typename Domain = Range>
171 inline BlockLinearOperator<
172 Range,
173 Domain,
174 TrilinosWrappers::internal::BlockLinearOperatorImplementation::
175 TrilinosBlockPayload<TrilinosWrappers::internal::
176 LinearOperatorImplementation::TrilinosPayload>>
178 {
179 using BlockMatrix = TrilinosWrappers::BlockSparseMatrix;
180 using PayloadBlockType =
182 using BlockPayload = TrilinosWrappers::internal::
183 BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
184 return ::block_operator<Range, Domain, BlockPayload, BlockMatrix>(
185 block_matrix);
186 }
187
188
203 template <std::size_t m,
204 std::size_t n,
205 typename Range,
206 typename Domain = Range>
207 inline BlockLinearOperator<
208 Range,
209 Domain,
210 TrilinosWrappers::internal::BlockLinearOperatorImplementation::
211 TrilinosBlockPayload<TrilinosWrappers::internal::
212 LinearOperatorImplementation::TrilinosPayload>>
214 const std::array<
215 std::array<
216 LinearOperator<typename Range::BlockType,
217 typename Domain::BlockType,
219 LinearOperatorImplementation::TrilinosPayload>,
220 n>,
221 m> &ops)
222 {
223 using PayloadBlockType =
225 using BlockPayload = TrilinosWrappers::internal::
226 BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
227 return ::block_operator<m, n, Range, Domain, BlockPayload>(ops);
228 }
229
230
247 template <typename Range, typename Domain = Range>
248 inline BlockLinearOperator<
249 Range,
250 Domain,
251 TrilinosWrappers::internal::BlockLinearOperatorImplementation::
252 TrilinosBlockPayload<TrilinosWrappers::internal::
253 LinearOperatorImplementation::TrilinosPayload>>
255 const TrilinosWrappers::BlockSparseMatrix &block_matrix)
256 {
257 using BlockMatrix = TrilinosWrappers::BlockSparseMatrix;
258 using PayloadBlockType =
260 using BlockPayload = TrilinosWrappers::internal::
261 BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
262 return ::
263 block_diagonal_operator<Range, Domain, BlockPayload, BlockMatrix>(
264 block_matrix);
265 }
266
267
282 template <std::size_t m, typename Range, typename Domain = Range>
283 inline BlockLinearOperator<
284 Range,
285 Domain,
286 TrilinosWrappers::internal::BlockLinearOperatorImplementation::
287 TrilinosBlockPayload<TrilinosWrappers::internal::
288 LinearOperatorImplementation::TrilinosPayload>>
290 const std::array<
291 LinearOperator<typename Range::BlockType,
292 typename Domain::BlockType,
294 TrilinosPayload>,
295 m> &ops)
296 {
297 using PayloadBlockType =
299 using BlockPayload = TrilinosWrappers::internal::
300 BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
301 return ::block_diagonal_operator<m, Range, Domain, BlockPayload>(ops);
302 }
303
306} // namespace TrilinosWrappers
307
309
310#endif // DEAL_II_WITH_TRILINOS
311#endif
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:503
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:504
BlockLinearOperator< Range, Domain, TrilinosWrappers::internal::BlockLinearOperatorImplementation::TrilinosBlockPayload< TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload > > block_operator(const TrilinosWrappers::BlockSparseMatrix &block_matrix)
BlockLinearOperator< Range, Domain, TrilinosWrappers::internal::BlockLinearOperatorImplementation::TrilinosBlockPayload< TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload > > block_operator(const std::array< std::array< LinearOperator< typename Range::BlockType, typename Domain::BlockType, TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload >, n >, m > &ops)
LinearOperator< Range, Domain, TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload > linear_operator(const LinearOperator< Range, Domain, TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload > &operator_exemplar, const Matrix &matrix)
LinearOperator< Range, Domain, TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload > linear_operator(const TrilinosWrappers::SparseMatrix &matrix)
BlockLinearOperator< Range, Domain, TrilinosWrappers::internal::BlockLinearOperatorImplementation::TrilinosBlockPayload< TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload > > block_diagonal_operator(const TrilinosWrappers::BlockSparseMatrix &block_matrix)
BlockLinearOperator< Range, Domain, TrilinosWrappers::internal::BlockLinearOperatorImplementation::TrilinosBlockPayload< TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload > > block_diagonal_operator(const std::array< LinearOperator< typename Range::BlockType, typename Domain::BlockType, TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload >, m > &ops)
LinearOperator< Range, Domain, TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload > linear_operator(const TrilinosWrappers::SparseMatrix &operator_exemplar, const Matrix &matrix)