Reference documentation for deal.II version 9.2.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\}}\)
trilinos_linear_operator.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2016 - 2019 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 
28 namespace TrilinosWrappers
29 {
30  // Forward declarations:
31 # ifndef DOXYGEN
32  class SparseMatrix;
33  class PreconditionBase;
34  class BlockSparseMatrix;
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 
72  template <typename Range, typename Domain = Range, typename Matrix>
73  inline LinearOperator<
74  Range,
75  Domain,
78  const Matrix & matrix)
79  {
80  using OperatorExemplar = TrilinosWrappers::SparseMatrix;
81  using Payload =
83  return ::
84  linear_operator<Range, Domain, Payload, OperatorExemplar, Matrix>(
85  operator_exemplar, matrix);
86  }
87 
88 
103  template <typename Range, typename Domain = Range>
104  inline LinearOperator<
105  Range,
106  Domain,
109  {
110  using Matrix = TrilinosWrappers::SparseMatrix;
111  using Payload =
113  return ::linear_operator<Range, Domain, Payload, Matrix, Matrix>(
114  matrix, matrix);
115  }
116 
117 
119 
123 
124 
138  template <typename Range, typename Domain = Range>
139  inline BlockLinearOperator<
140  Range,
141  Domain,
142  TrilinosWrappers::internal::BlockLinearOperatorImplementation::
143  TrilinosBlockPayload<TrilinosWrappers::internal::
144  LinearOperatorImplementation::TrilinosPayload>>
146  {
147  using BlockMatrix = TrilinosWrappers::BlockSparseMatrix;
148  using PayloadBlockType =
150  using BlockPayload = TrilinosWrappers::internal::
151  BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
152  return ::block_operator<Range, Domain, BlockPayload, BlockMatrix>(
153  block_matrix);
154  }
155 
156 
172  template <std::size_t m,
173  std::size_t n,
174  typename Range,
175  typename Domain = Range>
176  inline BlockLinearOperator<
177  Range,
178  Domain,
179  TrilinosWrappers::internal::BlockLinearOperatorImplementation::
180  TrilinosBlockPayload<TrilinosWrappers::internal::
181  LinearOperatorImplementation::TrilinosPayload>>
183  const std::array<
184  std::array<
185  LinearOperator<typename Range::BlockType,
186  typename Domain::BlockType,
188  LinearOperatorImplementation::TrilinosPayload>,
189  n>,
190  m> &ops)
191  {
192  using PayloadBlockType =
194  using BlockPayload = TrilinosWrappers::internal::
195  BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
196  return ::block_operator<m, n, Range, Domain, BlockPayload>(ops);
197  }
198 
199 
217  template <typename Range, typename Domain = Range>
218  inline BlockLinearOperator<
219  Range,
220  Domain,
221  TrilinosWrappers::internal::BlockLinearOperatorImplementation::
222  TrilinosBlockPayload<TrilinosWrappers::internal::
223  LinearOperatorImplementation::TrilinosPayload>>
225  const TrilinosWrappers::BlockSparseMatrix &block_matrix)
226  {
227  using BlockMatrix = TrilinosWrappers::BlockSparseMatrix;
228  using PayloadBlockType =
230  using BlockPayload = TrilinosWrappers::internal::
231  BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
232  return ::
233  block_diagonal_operator<Range, Domain, BlockPayload, BlockMatrix>(
234  block_matrix);
235  }
236 
237 
253  template <std::size_t m, typename Range, typename Domain = Range>
254  inline BlockLinearOperator<
255  Range,
256  Domain,
257  TrilinosWrappers::internal::BlockLinearOperatorImplementation::
258  TrilinosBlockPayload<TrilinosWrappers::internal::
259  LinearOperatorImplementation::TrilinosPayload>>
261  const std::array<
262  LinearOperator<typename Range::BlockType,
263  typename Domain::BlockType,
265  TrilinosPayload>,
266  m> &ops)
267  {
268  using PayloadBlockType =
270  using BlockPayload = TrilinosWrappers::internal::
271  BlockLinearOperatorImplementation::TrilinosBlockPayload<PayloadBlockType>;
272  return ::block_diagonal_operator<m, Range, Domain, BlockPayload>(ops);
273  }
274 
276 
277 } // namespace TrilinosWrappers
278 
280 
281 #endif // DEAL_II_WITH_TRILINOS
282 #endif
TrilinosWrappers::block_operator
BlockLinearOperator< Range, Domain, TrilinosWrappers::internal::BlockLinearOperatorImplementation::TrilinosBlockPayload< TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload > > block_operator(const TrilinosWrappers::BlockSparseMatrix &block_matrix)
Definition: trilinos_linear_operator.h:145
TrilinosWrappers::SparseMatrix
Definition: trilinos_sparse_matrix.h:515
TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload
Definition: trilinos_sparse_matrix.h:2016
BlockLinearOperator
Definition: block_linear_operator.h:202
SparseMatrix
Definition: sparse_matrix.h:497
linear_operator.h
TrilinosWrappers
Definition: types.h:161
TrilinosWrappers::internal::LinearOperatorImplementation
Definition: trilinos_sparse_matrix.h:1994
TrilinosWrappers::block_diagonal_operator
BlockLinearOperator< Range, Domain, TrilinosWrappers::internal::BlockLinearOperatorImplementation::TrilinosBlockPayload< TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload > > block_diagonal_operator(const TrilinosWrappers::BlockSparseMatrix &block_matrix)
Definition: trilinos_linear_operator.h:224
TrilinosWrappers::linear_operator
LinearOperator< Range, Domain, TrilinosWrappers::internal::LinearOperatorImplementation::TrilinosPayload > linear_operator(const TrilinosWrappers::SparseMatrix &operator_exemplar, const Matrix &matrix)
Definition: trilinos_linear_operator.h:77
block_linear_operator.h
LinearAlgebraDealII::BlockSparseMatrix
BlockSparseMatrix< double > BlockSparseMatrix
Definition: generic_linear_algebra.h:58
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
LAPACKSupport::matrix
@ matrix
Contents is actually a matrix.
Definition: lapack_support.h:60
LinearAlgebraDealII::SparseMatrix
SparseMatrix< double > SparseMatrix
Definition: generic_linear_algebra.h:53
TrilinosWrappers::BlockSparseMatrix
Definition: trilinos_block_sparse_matrix.h:72
config.h
internal
Definition: aligned_vector.h:369
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
TrilinosWrappers::internal
Definition: trilinos_block_sparse_matrix.h:564
LinearOperator
Definition: linear_operator.h:169
BlockSparseMatrix
Definition: block_sparse_matrix.h:50