NeoN
WIP Prototype of a modern OpenFOAM core
|
Namespaces | |
namespace | detail |
Classes | |
class | SKVector |
Unified interface for SUNDIALS Kokkos vector management. More... | |
class | SKVectorDefault |
Default executor SUNDIALS Kokkos vector wrapper. More... | |
class | SKVectorHostDefault |
Host default executor SUNDIALS Kokkos vector wrapper. More... | |
class | SKVectorSerial |
Serial executor SUNDIALS Kokkos vector wrapper. More... | |
Functions | |
ARKODE_ERKTableID | stringToERKTable (const std::string &key) |
Maps dictionary keywords to SUNDIALS RKButcher tableau identifiers. | |
template<typename SKVectorType , typename ValueType > | |
void | fieldToSunNVectorImpl (const NeoN::Vector< ValueType > &field, N_Vector &vector) |
Converts NeoN Vector data to SUNDIALS N_Vector format. | |
template<typename ValueType > | |
void | fieldToSunNVector (const NeoN::Vector< ValueType > &field, N_Vector &vector) |
Dispatcher for field to N_Vector conversion based on executor type. | |
template<typename SKVectorType , typename ValueType > | |
void | sunNVectorToVectorImpl (const N_Vector &vector, NeoN::Vector< ValueType > &field) |
Converts SUNDIALS N_Vector data back to NeoN Vector format. | |
template<typename ValueType > | |
void | sunNVectorToVector (const N_Vector &vector, NeoN::Vector< ValueType > &field) |
Dispatcher for N_Vector to field conversion based on executor type. | |
template<typename SolutionVectorType > | |
int | explicitRKSolve (sunrealtype t, N_Vector y, N_Vector ydot, void *userData) |
Performs a single explicit Runge-Kutta stage evaluation. | |
Variables | |
auto | SUN_CONTEXT_DELETER |
Custom deleter for SUNContext shared pointers. | |
auto | SUN_ARK_DELETER |
Custom deleter for explicit type RK solvers (ERK, ARK, etc) for the unique pointers. | |
int NeoN::sundials::explicitRKSolve | ( | sunrealtype | t, |
N_Vector | y, | ||
N_Vector | ydot, | ||
void * | userData | ||
) |
Performs a single explicit Runge-Kutta stage evaluation.
t | Current time value |
y | Current solution vector |
ydot | Output RHS vector |
userData | Pointer to Expression object |
This is our implementation of the RHS of explicit spacial integration, to be integrated in time. In our case user_data is a unique_ptr to an expression. In this function a 'working source' vector is created and parsed to the explicitOperation, which should contain the field variable at the start of the time step. Currently 'multi-stage RK' is not supported until y can be copied to this field.
Definition at line 192 of file sundials.hpp.
void NeoN::sundials::fieldToSunNVector | ( | const NeoN::Vector< ValueType > & | field, |
N_Vector & | vector | ||
) |
Dispatcher for field to N_Vector conversion based on executor type.
ValueType | The field data type |
field | Source NeoN field |
vector | Target SUNDIALS N_Vector |
Runtime | error for unsupported executors |
Definition at line 103 of file sundials.hpp.
void NeoN::sundials::fieldToSunNVectorImpl | ( | const NeoN::Vector< ValueType > & | field, |
N_Vector & | vector | ||
) |
Converts NeoN Vector data to SUNDIALS N_Vector format.
SKVectorType | The SUNDIALS Kokkos vector type |
ValueType | The field data type |
field | Source NeoN field |
vector | Target SUNDIALS N_Vector |
Definition at line 86 of file sundials.hpp.
|
inline |
Maps dictionary keywords to SUNDIALS RKButcher tableau identifiers.
key | The name of the explicit Runge-Kutta method. |
Runtime | error for unsupported methods. |
Definition at line 57 of file sundials.hpp.
void NeoN::sundials::sunNVectorToVector | ( | const N_Vector & | vector, |
NeoN::Vector< ValueType > & | field | ||
) |
Dispatcher for N_Vector to field conversion based on executor type.
ValueType | The field data type |
vector | Source SUNDIALS N_Vector |
field | Target NeoN field |
Definition at line 153 of file sundials.hpp.
void NeoN::sundials::sunNVectorToVectorImpl | ( | const N_Vector & | vector, |
NeoN::Vector< ValueType > & | field | ||
) |
Converts SUNDIALS N_Vector data back to NeoN Vector format.
SKVectorType | The SUNDIALS Kokkos vector type |
ValueType | The field data type |
vector | Source SUNDIALS N_Vector |
field | Target NeoN field |
Definition at line 137 of file sundials.hpp.
|
inline |
Custom deleter for explicit type RK solvers (ERK, ARK, etc) for the unique pointers.
ark | Pointer to the ark memory to be freed, can be nullptr. |
Safely frees the ark memory.
Definition at line 42 of file sundials.hpp.
|
inline |
Custom deleter for SUNContext shared pointers.
ctx | Pointer to the SUNContext to be freed, can be nullptr. |
Safely frees the context if it's the last reference.
Definition at line 29 of file sundials.hpp.