Reference documentation for deal.II version 9.3.3
\(\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\}}\)
trilinos_linear_operator.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2016 - 2020 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#if defined(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
55
56
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
117
121
122
135 template <typename Range, typename Domain = Range>
136 inline BlockLinearOperator<
137 Range,
138 Domain,
139 TrilinosWrappers::internal::BlockLinearOperatorImplementation::
140 TrilinosBlockPayload<TrilinosWrappers::internal::
141 LinearOperatorImplementation::TrilinosPayload>>
143 {
144 using BlockMatrix = TrilinosWrappers::BlockSparseMatrix;
145 using PayloadBlockType =
147 using BlockPayload = TrilinosWrappers::internal::
148 BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
149 return ::block_operator<Range, Domain, BlockPayload, BlockMatrix>(
150 block_matrix);
151 }
152
153
168 template <std::size_t m,
169 std::size_t n,
170 typename Range,
171 typename Domain = Range>
172 inline BlockLinearOperator<
173 Range,
174 Domain,
175 TrilinosWrappers::internal::BlockLinearOperatorImplementation::
176 TrilinosBlockPayload<TrilinosWrappers::internal::
177 LinearOperatorImplementation::TrilinosPayload>>
179 const std::array<
180 std::array<
181 LinearOperator<typename Range::BlockType,
182 typename Domain::BlockType,
184 LinearOperatorImplementation::TrilinosPayload>,
185 n>,
186 m> &ops)
187 {
188 using PayloadBlockType =
190 using BlockPayload = TrilinosWrappers::internal::
191 BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
192 return ::block_operator<m, n, Range, Domain, BlockPayload>(ops);
193 }
194
195
212 template <typename Range, typename Domain = Range>
213 inline BlockLinearOperator<
214 Range,
215 Domain,
216 TrilinosWrappers::internal::BlockLinearOperatorImplementation::
217 TrilinosBlockPayload<TrilinosWrappers::internal::
218 LinearOperatorImplementation::TrilinosPayload>>
220 const TrilinosWrappers::BlockSparseMatrix &block_matrix)
221 {
222 using BlockMatrix = TrilinosWrappers::BlockSparseMatrix;
223 using PayloadBlockType =
225 using BlockPayload = TrilinosWrappers::internal::
226 BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
227 return ::
228 block_diagonal_operator<Range, Domain, BlockPayload, BlockMatrix>(
229 block_matrix);
230 }
231
232
247 template <std::size_t m, 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 std::array<
256 LinearOperator<typename Range::BlockType,
257 typename Domain::BlockType,
259 TrilinosPayload>,
260 m> &ops)
261 {
262 using PayloadBlockType =
264 using BlockPayload = TrilinosWrappers::internal::
265 BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
266 return ::block_diagonal_operator<m, Range, Domain, BlockPayload>(ops);
267 }
268
270
271} // namespace TrilinosWrappers
272
274
275#endif // DEAL_II_WITH_TRILINOS
276#endif
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:402
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:403
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 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)
@ matrix
Contents is actually a matrix.
BlockSparseMatrix< double > BlockSparseMatrix
SparseMatrix< double > SparseMatrix