Commit 60d097d2 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Make all tests work in MINIMAL_SPH, DEFAULT_SPH and GADGET2_SPH modes

parent bf45fac8
......@@ -56,6 +56,7 @@ tests/testSingle
tests/testTimeIntegration
tests/testSPHStep
tests/testKernel
tests/testInteractions
tests/testParser
tests/parser_output.yml
tests/test27cells.sh
......
......@@ -275,7 +275,7 @@ __attribute__((always_inline)) INLINE static float hydro_get_internal_energy(
__attribute__((always_inline)) INLINE static float hydro_get_pressure(
const struct part *restrict p, float dt) {
return p->force.POrho2 * p->rho * p->rho / p->rho_dh;
return p->force.P_over_rho2 * p->rho * p->rho / p->rho_dh;
}
/**
......
......@@ -81,8 +81,14 @@ void prepare_force(struct part *parts) {
for (size_t i = 0; i < VEC_SIZE + 1; ++i) {
p = &parts[i];
p->rho = i + 1;
#if defined(GADGET2_SPH)
p->force.balsara = i + 1;
p->force.P_over_rho2 = i + 1;
#elif defined(DEFAULT_SPH)
p->force.balsara = i + 1;
p->force.P_over_rho2 = i + 1;
#else
#endif
}
}
......@@ -108,7 +114,7 @@ void dump_indv_particle_fields(char *fileName, struct part *p) {
p->density.div_v, p->density.rot_v[0], p->density.rot_v[1],
p->density.rot_v[2], 0.
#else
0., 0., 0., 0., 0., 0., 0., 0., 0., 0.
0., 0., 0., 0., 0.
#endif
);
fclose(file);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment