Auto-formatted

This commit is contained in:
jpekkila
2019-09-17 17:36:28 +03:00
parent af254257a2
commit 9b0be40b98
3 changed files with 40 additions and 43 deletions

View File

@@ -128,15 +128,11 @@ update_config(AcMeshInfo* config)
6.674e-8); // cm^3/(g*s^2) GGS definition //TODO define in a separate module
AcReal M_sun = AcReal(1.989e33); // g solar mass
config->real_params[AC_unit_mass] = (config->real_params[AC_unit_length] *
config->real_params[AC_unit_length] *
config->real_params[AC_unit_length]) *
config->real_params[AC_unit_density];
config->real_params[AC_M_sink] = config->real_params[AC_M_sink_Msun] * M_sun /
config->real_params[AC_unit_mass];
config->real_params[AC_M_sink_init] = config->real_params[AC_M_sink_Msun] * M_sun /

View File

@@ -409,12 +409,10 @@ run_renderer(void)
loadForcingParamsToDevice(forcing_params);
#endif
#if 1
const AcReal umax = acReduceVec(RTYPE_MAX, VTXBUF_UUX, VTXBUF_UUY, VTXBUF_UUZ);
const AcReal dt = host_timestep(umax, mesh_info);
acIntegrate(dt);
#else
ModelMesh* model_mesh = modelmesh_create(mesh->info);

View File

@@ -98,8 +98,9 @@ write_mesh_info(const AcMeshInfo* config)
fprintf(infotxt, "real AC_unit_mass %e \n", (double)config->real_params[AC_unit_mass]);
fprintf(infotxt, "real AC_unit_length %e \n", (double)config->real_params[AC_unit_length]);
//Here I'm still trying to copy the structure of the code above, and see if this will work for sink particle.
//I haven't fully undertand what these lines do but I'll read up on them soon. This is still yet experimental.
// Here I'm still trying to copy the structure of the code above, and see if this will work for
// sink particle. I haven't fully undertand what these lines do but I'll read up on them soon.
// This is still yet experimental.
// Sink particle
fprintf(infotxt, "real AC_sink_pos_x %e \n", (double)config->real_params[AC_sink_pos_x]);
fprintf(infotxt, "real AC_sink_pos_y %e \n", (double)config->real_params[AC_sink_pos_y]);
@@ -264,7 +265,8 @@ run_simulation(void)
// acUpdate_sink_particle() will do the similar trick to the device.
/* Step the simulation */
AcReal accreted_mass = 0.0; AcReal sink_mass = 0.0;
AcReal accreted_mass = 0.0;
AcReal sink_mass = 0.0;
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);
@@ -281,7 +283,8 @@ run_simulation(void)
int on_off_switch;
if (i < 1) {
on_off_switch = 0; // accretion is off till certain amount of steps.
} else {
}
else {
on_off_switch = 1;
}
acLoadDeviceConstant(AC_switch_accretion, on_off_switch);
@@ -298,7 +301,8 @@ run_simulation(void)
// NOTE: Might require embedding with acIntegrate(dt).
// This is the hardest part. Please see Lee et al. ApJ 783 (2014) for reference.
#else
accreted_mass = -1.0; sink_mass = -1.0;
accreted_mass = -1.0;
sink_mass = -1.0;
#endif
#if LFORCING
@@ -306,7 +310,6 @@ run_simulation(void)
loadForcingParamsToDevice(forcing_params);
#endif
acIntegrate(dt);
t_step += dt;