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
acmesh_init_to(INIT_TYPE_GAUSSIAN_RADIAL_EXPL, mesh);
#if LACCRETION
#if LSINK
vertex_buffer_set(VTXBUF_ACCRETION, 0.0, mesh);
#endif
@@ -242,21 +242,23 @@ run_simulation(void)
// acUpdate_sink_particle() will do the similar trick to the device.
/* Step the simulation */
#if LSINK
AcReal accreted_mass = 0.0;
#endif
for (int i = 1; i < max_steps; ++i) {
const AcReal umax = acReduceVec(RTYPE_MAX, VTXBUF_UUX, VTXBUF_UUY, VTXBUF_UUZ);
const AcReal dt = host_timestep(umax, mesh_info);
#if LACCRETION
#if LSINK
const AcReal sum_mass = acReduceScal(RTYPE_MAX, VTXBUF_ACCRETION);
accreted_mass = accreted_mass + sum_mass;
AcReal sink_mass = AC_M_sink_init + accreted_mass;
printf("sink mass is: %e\n", sink_mass);
printf("accreted mass is: %e\n", accreted_mass);
printf("sink mass is: %e \n", sink_mass);
printf("accreted mass is: %e \n", accreted_mass);
acLoadDeviceConstant(AC_M_sink, sink_mass);
#endif
#if LFORCING
#if LSINK
const ForcingParams forcing_params = generateForcingParams(mesh_info);
loadForcingParamsToDevice(forcing_params);
#endif