Added missing functions to fix backwards compatibility with the version interfaced with Pencil Code
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
// #include "astaroth_defines.h"
|
||||
#include "astaroth.h"
|
||||
|
||||
#include "math_utils.h" // int3 + int3
|
||||
|
||||
#define AC_GEN_STR(X) #X
|
||||
const char* intparam_names[] = {AC_FOR_BUILTIN_INT_PARAM_TYPES(AC_GEN_STR) //
|
||||
AC_FOR_USER_INT_PARAM_TYPES(AC_GEN_STR)};
|
||||
@@ -33,10 +35,13 @@ const char* vtxbuf_names[] = {AC_FOR_VTXBUF_HANDLES(AC_GEN_STR)};
|
||||
|
||||
static const int num_nodes = 1;
|
||||
static Node nodes[num_nodes];
|
||||
static int3 grid_n;
|
||||
|
||||
AcResult
|
||||
acInit(const AcMeshInfo mesh_info)
|
||||
{
|
||||
grid_n = (int3){mesh_info.int_params[AC_nx], mesh_info.int_params[AC_ny],
|
||||
mesh_info.int_params[AC_nz]};
|
||||
return acNodeCreate(0, mesh_info, &nodes[0]);
|
||||
}
|
||||
|
||||
@@ -46,6 +51,12 @@ acQuit(void)
|
||||
return acNodeDestroy(nodes[0]);
|
||||
}
|
||||
|
||||
AcResult
|
||||
acSynchronize(void)
|
||||
{
|
||||
return acNodeSynchronizeStream(nodes[0], STREAM_ALL);
|
||||
}
|
||||
|
||||
AcResult
|
||||
acSynchronizeStream(const Stream stream)
|
||||
{
|
||||
@@ -80,6 +91,20 @@ acIntegrate(const AcReal dt)
|
||||
return acNodeIntegrate(nodes[0], dt);
|
||||
}
|
||||
|
||||
AcResult
|
||||
acIntegrateStep(const int& isubstep, const AcReal dt)
|
||||
{
|
||||
const int3 start = (int3){NGHOST, NGHOST, NGHOST};
|
||||
const int3 end = start + grid_n;
|
||||
return acNodeIntegrateSubstep(nodes[0], STREAM_DEFAULT, isubstep, start, end, dt);
|
||||
}
|
||||
|
||||
AcResult
|
||||
acIntegrateStepWithOffset(const int isubstep, const AcReal dt, const int3 start, const int3 end)
|
||||
{
|
||||
return acNodeIntegrateSubstep(nodes[0], STREAM_DEFAULT, isubstep, start, end, dt);
|
||||
}
|
||||
|
||||
AcResult
|
||||
acBoundcondStep(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user