deal.II version GIT relicensing-6960-g70e9c5b7be 2026-10-22 20:10:01+00:00
\(\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
invocation_context.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13
14#ifndef dealii_sundials_invocation_context_h
15#define dealii_sundials_invocation_context_h
16
17#include <deal.II/base/config.h>
18
19
20#ifdef DEAL_II_WITH_SUNDIALS
21
23
24# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
25# include <sundials/sundials_context.h>
27# endif
28
29# include <exception>
30# include <memory>
31# include <type_traits>
32
33#endif // DEAL_II_WITH_SUNDIALS
34
35
37
38#ifdef DEAL_II_WITH_SUNDIALS
39namespace SUNDIALS
40{
41 namespace internal
42 {
43# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
57 {
58 public:
62 SharedSUNContext() = default;
63
68 : context(context, [](std::remove_pointer_t<SUNContext> *c) {
69 SUNContext ctx = c;
70 const int status = SUNContext_Free(&ctx);
71 (void)status;
72 AssertNothrow(status == 0, ExcMessage("SUNContext_Free() failed."));
73 })
74 {}
75
79 operator SUNContext() const
80 {
81 return context.get();
82 }
83
84 private:
85 std::shared_ptr<std::remove_pointer_t<SUNContext>> context;
86 };
87# endif
88
97 {
98 std::exception_ptr &pending_exception;
99# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
101# endif
102 };
103 } // namespace internal
104} // namespace SUNDIALS
105
106#endif // DEAL_II_WITH_SUNDIALS
107
109
110#endif
std::shared_ptr< std::remove_pointer_t< SUNContext > > context
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define AssertNothrow(cond, exc)
static ::ExceptionBase & ExcMessage(std::string arg1)
STL namespace.