NeoFOAM
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 NeoFOAM::Field< ValueType > &field, N_Vector &vector) |
Converts NeoFOAM Field data to SUNDIALS N_Vector format. | |
template<typename ValueType > | |
void | fieldToSunNVector (const NeoFOAM::Field< ValueType > &field, N_Vector &vector) |
Dispatcher for field to N_Vector conversion based on executor type. | |
template<typename SKVectorType , typename ValueType > | |
void | sunNVectorToFieldImpl (const N_Vector &vector, NeoFOAM::Field< ValueType > &field) |
Converts SUNDIALS N_Vector data back to NeoFOAM Field format. | |
template<typename ValueType > | |
void | sunNVectorToField (const N_Vector &vector, NeoFOAM::Field< ValueType > &field) |
Dispatcher for N_Vector to field conversion based on executor type. | |
template<typename SolutionFieldType > | |
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 NeoFOAM::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 191 of file sundials.hpp.
void NeoFOAM::sundials::fieldToSunNVector | ( | const NeoFOAM::Field< ValueType > & | field, |
N_Vector & | vector | ||
) |
Dispatcher for field to N_Vector conversion based on executor type.
ValueType | The field data type |
field | Source NeoFOAM field |
vector | Target SUNDIALS N_Vector |
Runtime | error for unsupported executors |
Definition at line 102 of file sundials.hpp.
void NeoFOAM::sundials::fieldToSunNVectorImpl | ( | const NeoFOAM::Field< ValueType > & | field, |
N_Vector & | vector | ||
) |
Converts NeoFOAM Field data to SUNDIALS N_Vector format.
SKVectorType | The SUNDIALS Kokkos vector type |
ValueType | The field data type |
field | Source NeoFOAM field |
vector | Target SUNDIALS N_Vector |
Definition at line 86 of file sundials.hpp.
ARKODE_ERKTableID NeoFOAM::sundials::stringToERKTable | ( | const std::string & | key | ) |
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 NeoFOAM::sundials::sunNVectorToField | ( | const N_Vector & | vector, |
NeoFOAM::Field< 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 NeoFOAM field |
Definition at line 152 of file sundials.hpp.
void NeoFOAM::sundials::sunNVectorToFieldImpl | ( | const N_Vector & | vector, |
NeoFOAM::Field< ValueType > & | field | ||
) |
Converts SUNDIALS N_Vector data back to NeoFOAM Field format.
SKVectorType | The SUNDIALS Kokkos vector type |
ValueType | The field data type |
vector | Source SUNDIALS N_Vector |
field | Target NeoFOAM field |
Definition at line 136 of file sundials.hpp.
auto NeoFOAM::sundials::SUN_ARK_DELETER |
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.
auto NeoFOAM::sundials::SUN_CONTEXT_DELETER |
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.