Corrections to the previous.

This commit is contained in:
Miikka Vaisala
2019-08-13 14:03:36 +08:00
parent 870eb32bb3
commit d79dd428e7

View File

@@ -195,7 +195,7 @@ run_simulation(void)
// TODO: This need to be possible to define in astaroth.conf // TODO: This need to be possible to define in astaroth.conf
acmesh_init_to(INIT_TYPE_GAUSSIAN_RADIAL_EXPL, mesh); acmesh_init_to(INIT_TYPE_GAUSSIAN_RADIAL_EXPL, mesh);
#if LACCRETION #if LSINK
vertex_buffer_set(VTXBUF_ACCRETION, 0.0, mesh); vertex_buffer_set(VTXBUF_ACCRETION, 0.0, mesh);
#endif #endif
@@ -242,12 +242,14 @@ run_simulation(void)
// acUpdate_sink_particle() will do the similar trick to the device. // acUpdate_sink_particle() will do the similar trick to the device.
/* Step the simulation */ /* Step the simulation */
#if LSINK
AcReal accreted_mass = 0.0; AcReal accreted_mass = 0.0;
#endif
for (int i = 1; i < max_steps; ++i) { for (int i = 1; i < max_steps; ++i) {
const AcReal umax = acReduceVec(RTYPE_MAX, VTXBUF_UUX, VTXBUF_UUY, VTXBUF_UUZ); const AcReal umax = acReduceVec(RTYPE_MAX, VTXBUF_UUX, VTXBUF_UUY, VTXBUF_UUZ);
const AcReal dt = host_timestep(umax, mesh_info); const AcReal dt = host_timestep(umax, mesh_info);
#if LACCRETION #if LSINK
const AcReal sum_mass = acReduceScal(RTYPE_MAX, VTXBUF_ACCRETION); const AcReal sum_mass = acReduceScal(RTYPE_MAX, VTXBUF_ACCRETION);
accreted_mass = accreted_mass + sum_mass; accreted_mass = accreted_mass + sum_mass;
AcReal sink_mass = AC_M_sink_init + accreted_mass; AcReal sink_mass = AC_M_sink_init + accreted_mass;
@@ -256,7 +258,7 @@ run_simulation(void)
acLoadDeviceConstant(AC_M_sink, sink_mass); acLoadDeviceConstant(AC_M_sink, sink_mass);
#endif #endif
#if LFORCING #if LSINK
const ForcingParams forcing_params = generateForcingParams(mesh_info); const ForcingParams forcing_params = generateForcingParams(mesh_info);
loadForcingParamsToDevice(forcing_params); loadForcingParamsToDevice(forcing_params);
#endif #endif