Corrections to the previous.
This commit is contained in:
@@ -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,21 +242,23 @@ 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;
|
||||||
printf("sink mass is: %e\n", sink_mass);
|
printf("sink mass is: %e \n", sink_mass);
|
||||||
printf("accreted mass is: %e\n", accreted_mass);
|
printf("accreted mass is: %e \n", accreted_mass);
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user