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
Classes | Public Member Functions | Protected Types | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
SUNDIALS::ARKodeStepper< VectorType > Class Template Referenceabstract

#include <deal.II/sundials/arkode_stepper.h>

Detailed Description

template<typename VectorType>
class SUNDIALS::ARKodeStepper< VectorType >

A base class for the implementation of ARKode stepper classes.

This class does not perform any actions during the time marching itself. It is responsible for setting up the internal data structures of the ARKODE via the ARKODE memory block. This setup is very much stepper specific, whereas the time advance itself is generalized in ARKODE. This separation of responsibilities is reflected in the current design that distributes the functionality between ARKode and ARKodeStepper accordingly.

Definition at line 81 of file arkode_stepper.h.

Inheritance diagram for SUNDIALS::ARKodeStepper< VectorType >:
[legend]

Classes

struct  CallbackContext
 

Public Member Functions

virtual ~ARKodeStepper ()=default
 
virtual void * get_arkode_memory () const =0
 

Protected Types

using ARKodeMemoryPtr = std::unique_ptr< void, void(*)(void *)>
 

Protected Member Functions

internal::InvocationContext invocation_context () const
 

Private Member Functions

void attach (std::exception_ptr &pending_exception, const internal::SharedSUNContext &context)
 
virtual void reinit (double t0, const VectorType &y0)=0
 
virtual void resize (double t0, const VectorType &y0, double hscale)=0
 

Private Attributes

std::exception_ptr * pending_exception_ptr = nullptr
 
internal::SharedSUNContext sundials_context
 

Friends

class ARKode< VectorType >
 

Member Typedef Documentation

◆ ARKodeMemoryPtr

template<typename VectorType >
using SUNDIALS::ARKodeStepper< VectorType >::ARKodeMemoryPtr = std::unique_ptr<void, void (*)(void *)>
protected

Alias for the memory management of the ARKODE memory block introduced to avoid repeating the long type. This smart pointer is created and destroyed by the corresponding stepper specific functions: for example, for ARKStep these are ARKStepCreate and ARKStepFree, respectively. The underlying object is supplied to the native ARKODE functions.

Definition at line 185 of file arkode_stepper.h.

Constructor & Destructor Documentation

◆ ~ARKodeStepper()

template<typename VectorType >
virtual SUNDIALS::ARKodeStepper< VectorType >::~ARKodeStepper ( )
virtualdefault

Destructor. Made virtual to allow this class to be used as an abstract base class.

Member Function Documentation

◆ get_arkode_memory()

template<typename VectorType >
virtual void * SUNDIALS::ARKodeStepper< VectorType >::get_arkode_memory ( ) const
pure virtual

Provides user access to the internally used ARKODE memory.

This functionality is intended for users who wish to query additional information directly from the ARKODE integrator, refer to the ARKODE manual for the various ARKStepGet... functions. The ARKStepSet... functions should not be called since this might lead to conflicts with various settings that are performed by this ARKodeStepper object.

Note
If custom settings of ARKODE functionality (that are not achievable via the interface of this class) are required, the function custom_setup() should be used.
Returns
pointer to the ARKODE memory block that can be passed to SUNDIALS functions

Implemented in SUNDIALS::ARKStepper< VectorType >, SUNDIALS::ARKStepper< Vector< double > >, SUNDIALS::ERKStepper< VectorType >, SUNDIALS::LSRKStepperSTS< VectorType >, and SUNDIALS::LSRKStepperSSP< VectorType >.

◆ attach()

template<typename VectorType >
void SUNDIALS::ARKodeStepper< VectorType >::attach ( std::exception_ptr &  pending_exception,
const internal::SharedSUNContext &  context 
)
inlineprivate

Bind the stepper to the ARKode object that drives it. This is called once by the constructor of ARKode. All objects the stepper creates for SUNDIALS use context, which the stepper keeps alive for as long as it lives, and callbacks store exceptions in pending_exception.

Note
A stepper can be attached to a single ARKode object only.

Definition at line 125 of file arkode_stepper.h.

◆ reinit()

template<typename VectorType >
virtual void SUNDIALS::ARKodeStepper< VectorType >::reinit ( double  t0,
const VectorType &  y0 
)
privatepure virtual

Rebuild the stepper at a given time instance and for a given state vector.

Parameters
t0Time instance that serves as starting time
y0Initial state vector whose layout is used for initialization of the internal ARKODE vectors

Implemented in SUNDIALS::ARKStepper< VectorType >, SUNDIALS::ERKStepper< VectorType >, SUNDIALS::LSRKStepperSTS< VectorType >, and SUNDIALS::LSRKStepperSSP< VectorType >.

◆ resize()

template<typename VectorType >
virtual void SUNDIALS::ARKodeStepper< VectorType >::resize ( double  t0,
const VectorType &  y0,
double  hscale 
)
privatepure virtual

Adapt the stepper to a state vector whose size or layout has changed (e.g. after mesh refinement) while keeping the time stepping history (step size, adaptivity state, counters) intact.

Parameters
t0Current time
y0Current state vector with the new size
hscaleFactor by which the upcoming step size is rescaled; values less or equal to zero are treated as one

Implemented in SUNDIALS::ARKStepper< VectorType >, SUNDIALS::ERKStepper< VectorType >, SUNDIALS::LSRKStepperSTS< VectorType >, and SUNDIALS::LSRKStepperSSP< VectorType >.

◆ invocation_context()

template<typename VectorType >
internal::InvocationContext SUNDIALS::ARKodeStepper< VectorType >::invocation_context ( ) const
inlineprotected

The context that the ARKode object, to which this stepper is attached. It is used to create SUNDIALS objects and to propagate exceptions across C boundaries (see invocation_context.h).

Definition at line 193 of file arkode_stepper.h.

Friends And Related Symbol Documentation

◆ ARKode< VectorType >

template<typename VectorType >
friend class ARKode< VectorType >
friend

Make ARKode class a friend such that the latter could access reinit() method.

Definition at line 1912 of file arkode_stepper.h.

Member Data Documentation

◆ pending_exception_ptr

template<typename VectorType >
std::exception_ptr* SUNDIALS::ARKodeStepper< VectorType >::pending_exception_ptr = nullptr
private

Exception pointer of the ARKode object this stepper is attached to.

Definition at line 211 of file arkode_stepper.h.

◆ sundials_context

template<typename VectorType >
internal::SharedSUNContext SUNDIALS::ARKodeStepper< VectorType >::sundials_context
private

Base class members are destroyed after those of derived classes, so the context outlives the ARKODE memory and everything else a derived stepper created with it.

Definition at line 219 of file arkode_stepper.h.


The documentation for this class was generated from the following file: