![]() |
deal.II version GIT relicensing-6842-g793a97d2aa 2026-10-02 14:00:01+00:00
|
#include <deal.II/sundials/arkode_stepper.h>
The class provides a wrapper to ERKStep time-stepping module.
ERKStep solves ODE initial value problems (IVPs) in \(R^N\) using explicit Runge-Kutta methods. These problems should be posed as
\[ \dot y = f(t, y), \qquad y(t_0) = y_0. \]
Here, \(t\) is the independent variable (e.g. time), \(y \in R^N\) are the dependent variables, and \(\dot y\) denotes \(dy/dt\).
ERKStep is intended for non-stiff problems. For stiff or multi-rate problems consider using ARKStepper instead.
ERKStep allows orders of accuracy \(q = \{2, 3, 4, 5, 6, 8\}\), with embeddings of orders \(p = \{1, 2, 3, 4, 5, 7\}\). These default to the Heun-Euler-2-1-2, Bogacki-Shampine-4-2-3, Zonneveld-5-3-4, Cash-Karp-6-4-5, Verner-8-5-6 and Fehlberg-13-7-8 methods, respectively.
The user has to provide the implementation of the following std::function:
Any other custom settings of the ERKStep object can be specified in
To provide a simple example, consider the harmonic oscillator problem:
\[ \begin{split} u'' & = -k^2 u \\ u (0) & = 0 \\ u'(0) & = k \end{split} \]
We write it in terms of a first order ode:
\[ \begin{matrix} y_0' & = y_1 \\ y_1' & = - k^2 y_0 \end{matrix} \]
A minimal implementation is given by the following code snippet:
Definition at line 1145 of file arkode_stepper.h.
Classes | |
| class | AdditionalData |
Public Member Functions | |
| ERKStepper (const AdditionalData &data=AdditionalData()) | |
| void * | get_arkode_memory () const override |
Public Attributes | |
| std::function< void(const double t, const VectorType &y, VectorType &explicit_f)> | explicit_function |
| std::function< void(void *arkode_mem)> | custom_setup |
Private Types | |
| using | CallbackContext = typename ARKodeStepper< VectorType >::template CallbackContext< ERKStepper< VectorType > > |
| using | ARKodeMemoryPtr = typename ARKodeStepper< VectorType >::ARKodeMemoryPtr |
Private Member Functions | |
| void | reinit (double t0, const VectorType &y0, internal::InvocationContext inv_ctx) override |
Private Attributes | |
| AdditionalData | data |
| ARKodeMemoryPtr | arkode_mem |
| CallbackContext | callback_ctx |
|
private |
Definition at line 1264 of file arkode_stepper.h.
|
private |
Definition at line 1267 of file arkode_stepper.h.
| SUNDIALS::ERKStepper< VectorType >::ERKStepper | ( | const AdditionalData & | data = AdditionalData() | ) |
Constructor, with class parameters set by the AdditionalData object.
| data | ERKStep configuration data |
|
overridevirtual |
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.
Implements SUNDIALS::ARKodeStepper< VectorType >.
|
overrideprivatevirtual |
Rebuild the stepper at a given time instance and for a given state vector. Required by the ARKodeStepper interface.
| t0 | Time instance that serves as starting time |
| y0 | Initial state vector whose layout is used for initialization of the internal ARKODE vectors |
| inv_ctx | Invocation context that provides access to the SUNContext object and the exception pointer managed by the caller |
Implements SUNDIALS::ARKodeStepper< VectorType >.
| std::function< void(const double t, const VectorType &y, VectorType &explicit_f)> SUNDIALS::ERKStepper< VectorType >::explicit_function |
A function object that users must supply and that is intended to compute the IVP right hand side. Sets \(explicit\_f = f(t, y)\).
Definition at line 1234 of file arkode_stepper.h.
| std::function<void(void *arkode_mem)> SUNDIALS::ERKStepper< VectorType >::custom_setup |
A function object that users may supply and which is intended to perform custom settings on the supplied arkode_mem object. Refer to the SUNDIALS documentation for valid options.
For instance, the following code selects a specific built-in Butcher table for the ERK method:
| arkode_mem | pointer to the ARKODE memory block which can be used for custom calls to ERKStepSet... methods. |
Definition at line 1261 of file arkode_stepper.h.
|
private |
ERKStepper configuration data.
Definition at line 1287 of file arkode_stepper.h.
|
private |
ARKODE memory object.
Definition at line 1292 of file arkode_stepper.h.
|
private |
ERKStepper callback context.
Definition at line 1297 of file arkode_stepper.h.