Integrates in time, using Sundials, a PDE expression using the Runge-Kutta method.
More...
template<typename SolutionFieldType>
class NeoFOAM::timeIntegration::RungeKutta< SolutionFieldType >
Integrates in time, using Sundials, a PDE expression using the Runge-Kutta method.
- Template Parameters
-
SolutionFieldType | The Solution field type, should be a volume or surface field. |
Implements explicit Runge-Kutta time integration using the Sundials library. The class manages Sundials vectors and memory through RAII principles, handling the conversion between internal field representations and Sundials' N_Vector format. Supports various (at present explicit) Runge-Kutta methods which can be specified through the dictionary configuration. The main interface for a solve is through the solve
function.
- Note
- Useful Sundials documentation below, currently we have implemented only an explicit Runge-Kutta interface, this simplifies things considerably as compared to some of the examples: Initialization (and order thereof): https://sundials.readthedocs.io/en/latest/arkode/Usage/Skeleton.html Sundials-Kokkos: https://sundials.readthedocs.io/en/latest/nvectors/NVector_links.html#the-nvector-kokkos-module Sundials Contexts (scroll to bottom eg, they don't like copying): https://sundials.readthedocs.io/en/latest/sundials/SUNContext_link.html#c.SUNContext_Create
- Warning
- For developers:
- This class uses Sundials-Kokkos vectors for computation, which are immediately wrapped as Sundials N_Vectors. After initialization, only interact with the N_Vector interface as per Sundials guidelines.
- The Sundials context is supposed to only be created and freed once in a program, making copying less desirable, see above. However we need to copy, so the context is placed in a shared_ptr to prevent early freeing. Please read the documentation about multiple, concurrent solves (you must not do them). You have been warned.
Definition at line 52 of file rungeKutta.hpp.