Added missing functions to fix backwards compatibility with the version interfaced with Pencil Code
This commit is contained in:
@@ -66,8 +66,8 @@ AcResult acStore(AcMesh* host_mesh);
|
|||||||
* substep and the user is responsible for calling acBoundcondStep before reading the data. */
|
* substep and the user is responsible for calling acBoundcondStep before reading the data. */
|
||||||
AcResult acIntegrate(const AcReal dt);
|
AcResult acIntegrate(const AcReal dt);
|
||||||
|
|
||||||
/** Applies periodic boundary conditions for the Mesh distributed among the devices visible to the
|
/** Applies periodic boundary conditions for the Mesh distributed among the devices visible to
|
||||||
* caller*/
|
* the caller*/
|
||||||
AcResult acBoundcondStep(void);
|
AcResult acBoundcondStep(void);
|
||||||
|
|
||||||
/** Does a scalar reduction with the data stored in some vertex buffer */
|
/** Does a scalar reduction with the data stored in some vertex buffer */
|
||||||
@@ -81,6 +81,13 @@ AcReal acReduceVec(const ReductionType rtype, const VertexBufferHandle a,
|
|||||||
*/
|
*/
|
||||||
AcResult acStoreWithOffset(const int3 dst, const size_t num_vertices, AcMesh* host_mesh);
|
AcResult acStoreWithOffset(const int3 dst, const size_t num_vertices, AcMesh* host_mesh);
|
||||||
|
|
||||||
|
/** Will potentially be deprecated in later versions. Added only to fix backwards compatibility with
|
||||||
|
* PC for now.*/
|
||||||
|
AcResult acIntegrateStep(const int isubstep, const AcReal& dt);
|
||||||
|
AcResult acIntegrateStepWithOffset(const int isubstep, const AcReal dt, const int3 start,
|
||||||
|
const int3 end);
|
||||||
|
AcResult acSynchronize(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
// #include "astaroth_defines.h"
|
// #include "astaroth_defines.h"
|
||||||
#include "astaroth.h"
|
#include "astaroth.h"
|
||||||
|
|
||||||
|
#include "math_utils.h" // int3 + int3
|
||||||
|
|
||||||
#define AC_GEN_STR(X) #X
|
#define AC_GEN_STR(X) #X
|
||||||
const char* intparam_names[] = {AC_FOR_BUILTIN_INT_PARAM_TYPES(AC_GEN_STR) //
|
const char* intparam_names[] = {AC_FOR_BUILTIN_INT_PARAM_TYPES(AC_GEN_STR) //
|
||||||
AC_FOR_USER_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 const int num_nodes = 1;
|
||||||
static Node nodes[num_nodes];
|
static Node nodes[num_nodes];
|
||||||
|
static int3 grid_n;
|
||||||
|
|
||||||
AcResult
|
AcResult
|
||||||
acInit(const AcMeshInfo mesh_info)
|
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]);
|
return acNodeCreate(0, mesh_info, &nodes[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,6 +51,12 @@ acQuit(void)
|
|||||||
return acNodeDestroy(nodes[0]);
|
return acNodeDestroy(nodes[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AcResult
|
||||||
|
acSynchronize(void)
|
||||||
|
{
|
||||||
|
return acNodeSynchronizeStream(nodes[0], STREAM_ALL);
|
||||||
|
}
|
||||||
|
|
||||||
AcResult
|
AcResult
|
||||||
acSynchronizeStream(const Stream stream)
|
acSynchronizeStream(const Stream stream)
|
||||||
{
|
{
|
||||||
@@ -80,6 +91,20 @@ acIntegrate(const AcReal dt)
|
|||||||
return acNodeIntegrate(nodes[0], 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
|
AcResult
|
||||||
acBoundcondStep(void)
|
acBoundcondStep(void)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user