Reference documentation for deal.II version 9.5.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// Copyright (C) 2016 - 2022 by the deal.II authors
4//
5// This file is part of the deal.II library.
6//
7// The deal.II library is free software; you can use it, redistribute
8// it, and/or modify it under the terms of the GNU Lesser General
9// Public License as published by the Free Software Foundation; either
10// version 2.1 of the License, or (at your option) any later version.
11// The full text of the license can be found in the file LICENSE.md at
12// the top level directory of deal.II.
13//
14// ---------------------------------------------------------------------
15
16#ifndef dealii_trilinos_linear_operator_h
17#define dealii_trilinos_linear_operator_h
18
19#include <deal.II/base/config.h>
20
21#ifdef DEAL_II_WITH_TRILINOS
22
25
27
28namespace TrilinosWrappers
29{
30 // Forward declarations:
31# ifndef DOXYGEN
32 class SparseMatrix;
33 class PreconditionBase;
35
36 namespace internal
37 {
38 namespace LinearOperatorImplementation
39 {
40 class TrilinosPayload;
41 }
42
43 namespace BlockLinearOperatorImplementation
44 {
45 template <typename PayloadBlockType>
46 class TrilinosBlockPayload;
47 }
48 } // namespace internal
49# endif
50
71 template <typename Range, typename Domain = Range, typename Matrix>
72 inline LinearOperator<
73 Range,
74 Domain,
77 const Matrix & matrix)
78 {
79 using OperatorExemplar = TrilinosWrappers::SparseMatrix;
80 using Payload =
82 return ::
83 linear_operator<Range, Domain, Payload, OperatorExemplar, Matrix>(
84 operator_exemplar, matrix);
85 }
86
87
101 template <typename Range, typename Domain = Range>
102 inline LinearOperator<
103 Range,
104 Domain,
107 {
108 using Matrix = TrilinosWrappers::SparseMatrix;
109 using Payload =
111 return ::linear_operator<Range, Domain, Payload, Matrix, Matrix>(
112 matrix, matrix);
113 }
114
115
130 template <typename Range, typename Domain, typename Matrix>
131 inline LinearOperator<
132 Range,
133 Domain,
136 const LinearOperator<
137 Range,
138 Domain,
140 & operator_exemplar,
141 const Matrix &matrix)
142 {
143 using Payload =
145 using OperatorExemplar = LinearOperator<Range, Domain, Payload>;
146 return ::
147 linear_operator<Range, Domain, Payload, OperatorExemplar, Matrix>(
148 operator_exemplar, matrix);
149 }
150
151
171 template <typename Range, typename Domain = Range>
172 inline BlockLinearOperator<
173 Range,
174 Domain,
175 TrilinosWrappers::internal::BlockLinearOperatorImplementation::
176 TrilinosBlockPayload<TrilinosWrappers::internal::
177 LinearOperatorImplementation::TrilinosPayload>>
179 {
180 using BlockMatrix = TrilinosWrappers::BlockSparseMatrix;
181 using PayloadBlockType =
183 using BlockPayload = TrilinosWrappers::internal::
184 BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
185 return ::block_operator<Range, Domain, BlockPayload, BlockMatrix>(
186 block_matrix);
187 }
188
189
204 template <std::size_t m,
205 std::size_t n,
206 typename Range,
207 typename Domain = Range>
208 inline BlockLinearOperator<
209 Range,
210 Domain,
211 TrilinosWrappers::internal::BlockLinearOperatorImplementation::
212 TrilinosBlockPayload<TrilinosWrappers::internal::
213 LinearOperatorImplementation::TrilinosPayload>>
215 const std::array<
216 std::array<
217 LinearOperator<typename Range::BlockType,
218 typename Domain::BlockType,
220 LinearOperatorImplementation::TrilinosPayload>,
221 n>,
222 m> &ops)
223 {
224 using PayloadBlockType =
226 using BlockPayload = TrilinosWrappers::internal::
227 BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
228 return ::block_operator<m, n, Range, Domain, BlockPayload>(ops);
229 }
230
231
248 template <typename Range, typename Domain = Range>
249 inline BlockLinearOperator<
250 Range,
251 Domain,
252 TrilinosWrappers::internal::BlockLinearOperatorImplementation::
253 TrilinosBlockPayload<TrilinosWrappers::internal::
254 LinearOperatorImplementation::TrilinosPayload>>
256 const TrilinosWrappers::BlockSparseMatrix &block_matrix)
257 {
258 using BlockMatrix = TrilinosWrappers::BlockSparseMatrix;
259 using PayloadBlockType =
261 using BlockPayload = TrilinosWrappers::internal::
262 BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
263 return ::
264 block_diagonal_operator<Range, Domain, BlockPayload, BlockMatrix>(
265 block_matrix);
266 }
267
268
283 template <std::size_t m, typename Range, typename Domain = Range>
284 inline BlockLinearOperator<
285 Range,
286 Domain,
287 TrilinosWrappers::internal::BlockLinearOperatorImplementation::
288 TrilinosBlockPayload<TrilinosWrappers::internal::
289 LinearOperatorImplementation::TrilinosPayload>>
291 const std::array<
292 LinearOperator<typename Range::BlockType,
293 typename Domain::BlockType,
295 TrilinosPayload>,
296 m> &ops)
297 {
298 using PayloadBlockType =
300 using BlockPayload = TrilinosWrappers::internal::
301 BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
302 return ::block_diagonal_operator<m, Range, Domain, BlockPayload>(ops);
303 }
304
307} // namespace TrilinosWrappers
308
310
311#endif // DEAL_II_WITH_TRILINOS
312#endif
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
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)