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
include
deal.II
sundials
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
22
# include <
deal.II/base/exceptions.h
>
23
24
# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
25
# include <sundials/sundials_context.h>
26
# include <
sundials/sundials_types.h
>
27
# endif
28
29
# include <exception>
30
# include <memory>
31
# include <type_traits>
32
33
#endif
// DEAL_II_WITH_SUNDIALS
34
35
36
DEAL_II_NAMESPACE_OPEN
37
38
#ifdef DEAL_II_WITH_SUNDIALS
39
namespace
SUNDIALS
40
{
41
namespace
internal
42
{
43
# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
56
class
SharedSUNContext
57
{
58
public
:
62
SharedSUNContext
() =
default
;
63
67
explicit
SharedSUNContext
(
SUNContext
context
)
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
96
struct
InvocationContext
97
{
98
std::exception_ptr &
pending_exception
;
99
# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
100
SharedSUNContext
arkode_ctx
;
101
# endif
102
};
103
}
// namespace internal
104
}
// namespace SUNDIALS
105
106
#endif
// DEAL_II_WITH_SUNDIALS
107
108
DEAL_II_NAMESPACE_CLOSE
109
110
#endif
SUNContext
SUNDIALS::internal::SharedSUNContext
Definition
invocation_context.h:57
SUNDIALS::internal::SharedSUNContext::context
std::shared_ptr< std::remove_pointer_t< SUNContext > > context
Definition
invocation_context.h:85
SUNDIALS::internal::SharedSUNContext::SharedSUNContext
SharedSUNContext()=default
SUNDIALS::internal::SharedSUNContext::SharedSUNContext
SharedSUNContext(SUNContext context)
Definition
invocation_context.h:67
config.h
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition
config.h:38
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition
config.h:39
AssertNothrow
#define AssertNothrow(cond, exc)
Definition
exception_macros.h:600
StandardExceptions::ExcMessage
static ::ExceptionBase & ExcMessage(std::string arg1)
exceptions.h
SUNDIALS
Definition
arkode.h:63
internal
Definition
aligned_vector.h:756
std
STL namespace.
SUNDIALS::internal::InvocationContext
Definition
invocation_context.h:97
SUNDIALS::internal::InvocationContext::arkode_ctx
SharedSUNContext arkode_ctx
Definition
invocation_context.h:100
SUNDIALS::internal::InvocationContext::pending_exception
std::exception_ptr & pending_exception
Definition
invocation_context.h:98
sundials_types.h
Generated by
1.9.8