Commit 2ab6071b authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Removed explicit references to p->rho_dh in the test27 and testPair unit tests...

Removed explicit references to p->rho_dh in the test27 and testPair unit tests as these might not exist in all hydro schemes.
parent a2d55984
......@@ -519,7 +519,8 @@ void engine_single_density(double *dim, long long int pid,
/* Dump the result. */
hydro_end_density(&p, 0);
message("part %lli (h=%e) has wcount=%e, rho=%e.", p.id, p.h, p.density.wcount, p.rho);
message("part %lli (h=%e) has wcount=%e, rho=%e.", p.id, p.h,
p.density.wcount, p.rho);
fflush(stdout);
}
......
......@@ -147,8 +147,6 @@ void clean_up(struct cell *ci) {
*/
void zero_particle_fields(struct cell *c) {
for (size_t pid = 0; pid < c->count; pid++) {
c->parts[pid].rho = 0.f;
c->parts[pid].rho_dh = 0.f;
hydro_init_part(&c->parts[pid]);
}
}
......@@ -187,7 +185,12 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
main_cell->parts[pid].x[1], main_cell->parts[pid].x[2],
main_cell->parts[pid].v[0], main_cell->parts[pid].v[1],
main_cell->parts[pid].v[2], main_cell->parts[pid].rho,
main_cell->parts[pid].rho_dh, main_cell->parts[pid].density.wcount,
#if defined(GIZMO_SPH)
0.f,
#else
main_cell->parts[pid].rho_dh,
#endif
main_cell->parts[pid].density.wcount,
main_cell->parts[pid].density.wcount_dh,
#if defined(GADGET2_SPH)
main_cell->parts[pid].density.div_v,
......@@ -223,7 +226,12 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
"%13e %13e %13e\n",
cj->parts[pjd].id, cj->parts[pjd].x[0], cj->parts[pjd].x[1],
cj->parts[pjd].x[2], cj->parts[pjd].v[0], cj->parts[pjd].v[1],
cj->parts[pjd].v[2], cj->parts[pjd].rho, cj->parts[pjd].rho_dh,
cj->parts[pjd].v[2], cj->parts[pjd].rho,
#if defined(GIZMO_SPH)
0.f,
#else
main_cell->parts[pjd].rho_dh,
#endif
cj->parts[pjd].density.wcount, cj->parts[pjd].density.wcount_dh,
#if defined(GADGET2_SPH)
cj->parts[pjd].density.div_v, cj->parts[pjd].density.rot_v[0],
......
......@@ -106,8 +106,6 @@ void clean_up(struct cell *ci) {
*/
void zero_particle_fields(struct cell *c) {
for (size_t pid = 0; pid < c->count; pid++) {
c->parts[pid].rho = 0.f;
c->parts[pid].rho_dh = 0.f;
hydro_init_part(&c->parts[pid]);
}
}
......@@ -133,9 +131,14 @@ void dump_particle_fields(char *fileName, struct cell *ci, struct cell *cj) {
"%13e %13e %13e\n",
ci->parts[pid].id, ci->parts[pid].x[0], ci->parts[pid].x[1],
ci->parts[pid].x[2], ci->parts[pid].v[0], ci->parts[pid].v[1],
ci->parts[pid].v[2], ci->parts[pid].rho, ci->parts[pid].rho_dh,
ci->parts[pid].v[2], ci->parts[pid].rho,
#if defined(GIZMO_SPH)
0.f,
#else
cj->parts[pid].rho_dh,
#endif
ci->parts[pid].density.wcount, ci->parts[pid].density.wcount_dh,
#ifdef GADGET2_SPH
#if defined(GADGET2_SPH) || defined(DEFAULT_SPH)
ci->parts[pid].density.div_v, ci->parts[pid].density.rot_v[0],
ci->parts[pid].density.rot_v[1], ci->parts[pid].density.rot_v[2]
#else
......@@ -152,9 +155,14 @@ void dump_particle_fields(char *fileName, struct cell *ci, struct cell *cj) {
"%13e %13e %13e\n",
cj->parts[pjd].id, cj->parts[pjd].x[0], cj->parts[pjd].x[1],
cj->parts[pjd].x[2], cj->parts[pjd].v[0], cj->parts[pjd].v[1],
cj->parts[pjd].v[2], cj->parts[pjd].rho, cj->parts[pjd].rho_dh,
cj->parts[pjd].v[2], cj->parts[pjd].rho,
#if defined(GIZMO_SPH)
0.f,
#else
cj->parts[pjd].rho_dh,
#endif
cj->parts[pjd].density.wcount, cj->parts[pjd].density.wcount_dh,
#ifdef GADGET2_SPH
#if defined(GADGET2_SPH) || defined(DEFAULT_SPH)
cj->parts[pjd].density.div_v, cj->parts[pjd].density.rot_v[0],
cj->parts[pjd].density.rot_v[1], cj->parts[pjd].density.rot_v[2]
#else
......
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