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
sunlinsol_wrapper.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2021 - 2023 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
17#ifndef dealii_sundials_sunlinsol_wrapper_h
18#define dealii_sundials_sunlinsol_wrapper_h
19
20#include <deal.II/base/config.h>
21
22#ifdef DEAL_II_WITH_SUNDIALS
23
24# include <sundials/sundials_linearsolver.h>
25
26# include <exception>
27# include <functional>
28# include <memory>
29
31
32namespace SUNDIALS
33{
34# ifndef DOXYGEN
35 // forward declarations
36 namespace internal
37 {
38 template <typename VectorType>
39 struct LinearSolverContent;
40 }
41# endif
42
46 template <typename VectorType>
48 {
52 void
53 vmult(VectorType &dst, const VectorType &src) const;
54
55# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
64# else
72# endif
73
74 private:
78 void *A_data;
79
85
86# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
91# endif
92 };
93
94
95
101 template <typename VectorType>
103 {
111 void
112 vmult(VectorType &dst, const VectorType &src) const;
113
114# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
131 double tol);
132# else
146# endif
147
148 private:
152 void *P_data;
153
159
160# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
165# endif
166
171 double tol;
172 };
173
200 template <typename VectorType>
202 std::function<void(SundialsOperator<VectorType> & op,
204 VectorType & x,
205 const VectorType & b,
206 double tol)>;
207
208 namespace internal
209 {
216 template <typename VectorType>
218 {
219 public:
220 explicit LinearSolverWrapper(
222 std::exception_ptr & pending_exception
224 ,
225 SUNContext linsol_ctx
226# endif
227 );
228
230
234 operator SUNLinearSolver();
235
236 private:
238 std::unique_ptr<LinearSolverContent<VectorType>> content;
239 };
240 } // namespace internal
241} // namespace SUNDIALS
242
244
245#endif
246#endif
std::unique_ptr< LinearSolverContent< VectorType > > content
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:472
#define DEAL_II_SUNDIALS_VERSION_GTE(major, minor, patch)
Definition config.h:359
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
std::function< void(SundialsOperator< VectorType > &op, SundialsPreconditioner< VectorType > &prec, VectorType &x, const VectorType &b, double tol)> LinearSolveFunction
void vmult(VectorType &dst, const VectorType &src) const
void vmult(VectorType &dst, const VectorType &src) const