diff --git a/acc/mhd_solver/stencil_definition.sdh b/acc/mhd_solver/stencil_definition.sdh index 5527534..39a9e10 100644 --- a/acc/mhd_solver/stencil_definition.sdh +++ b/acc/mhd_solver/stencil_definition.sdh @@ -1,9 +1,9 @@ #define LDENSITY (1) #define LHYDRO (1) -#define LMAGNETIC (1) -#define LENTROPY (1) +#define LMAGNETIC (0) +#define LENTROPY (0) #define LTEMPERATURE (0) -#define LFORCING (1) +#define LFORCING (0) #define LUPWD (1) #define LSINK (1) diff --git a/acc/mhd_solver/stencil_process.sps b/acc/mhd_solver/stencil_process.sps index 1e388fa..1cd336b 100644 --- a/acc/mhd_solver/stencil_process.sps +++ b/acc/mhd_solver/stencil_process.sps @@ -456,8 +456,8 @@ out ScalarField out_tt(VTXBUF_TEMPERATURE); #endif #if LSINK -in Scalar accretion = VTXBUF_ACCRETION; -out Scalar out_accretion = VTXBUF_ACCRETION; +in ScalarField accretion(VTXBUF_ACCRETION); +out ScalarField out_accretion(VTXBUF_ACCRETION); #endif Kernel void @@ -471,13 +471,13 @@ solve() #endif #if LENTROPY - out_uu = rk3(out_uu, uu, momentum(uu, lnrho, ss, aa), dt); + out_uu = rk3(out_uu, uu, momentum(globalVertexIdx, uu, lnrho, ss, aa, dt), dt); out_ss = rk3(out_ss, ss, entropy(ss, uu, lnrho, aa), dt); #elif LTEMPERATURE - out_uu = rk3(out_uu, uu, momentum(uu, lnrho, tt), dt); + out_uu = rk3(out_uu, uu, momentum(globalVertexIdx, uu, lnrho, tt, dt), dt); out_tt = rk3(out_tt, tt, heat_transfer(uu, lnrho, tt), dt); #else - out_uu = rk3(out_uu, uu, momentum(uu, lnrho), dt); + out_uu = rk3(out_uu, uu, momentum(globalVertexIdx, uu, lnrho, dt), dt); #endif #if LFORCING diff --git a/src/standalone/model/model_rk3.cc b/src/standalone/model/model_rk3.cc index 5fab4b4..0680daa 100644 --- a/src/standalone/model/model_rk3.cc +++ b/src/standalone/model/model_rk3.cc @@ -34,10 +34,10 @@ // Standalone flags #define LDENSITY (1) #define LHYDRO (1) -#define LMAGNETIC (1) -#define LENTROPY (1) +#define LMAGNETIC (0) +#define LENTROPY (0) #define LTEMPERATURE (0) -#define LFORCING (1) +#define LFORCING (0) #define LUPWD (1) #define AC_THERMAL_CONDUCTIVITY (AcReal(0.001)) // TODO: make an actual config parameter diff --git a/src/standalone/renderer.cc b/src/standalone/renderer.cc index a9608ea..11fd693 100644 --- a/src/standalone/renderer.cc +++ b/src/standalone/renderer.cc @@ -41,6 +41,10 @@ #include "src/core/math_utils.h" #include "timer_hires.h" +//NEED TO BE DEFINED HERE. IS NOT NOTICED BY compile_acc call. +#define LFORCING (0) +#define LSINK (1) + // Window SDL_Renderer* renderer = NULL; static SDL_Window* window = NULL; diff --git a/src/standalone/simulation.cc b/src/standalone/simulation.cc index b65fd17..375772b 100644 --- a/src/standalone/simulation.cc +++ b/src/standalone/simulation.cc @@ -40,6 +40,10 @@ #include #include +//NEED TO BE DEFINED HERE. IS NOT NOTICED BY compile_acc call. +#define LFORCING (0) +#define LSINK (1) + // Write all setting info into a separate ascii file. This is done to guarantee // that we have the data specifi information in the thing, even though in // principle these things are in the astaroth.conf. @@ -254,9 +258,7 @@ 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 + 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); @@ -265,7 +267,7 @@ run_simulation(void) const AcReal sum_mass = acReduceScal(RTYPE_SUM, VTXBUF_ACCRETION); accreted_mass = accreted_mass + sum_mass; - AcReal sink_mass = 0.0; + sink_mass = 0.0; sink_mass = mesh_info.real_params[AC_M_sink_init] + accreted_mass; acLoadDeviceConstant(AC_M_sink, sink_mass); vertex_buffer_set(VTXBUF_ACCRETION, 0.0, mesh);