Commit 4e917ae0 authored by Bert Vandenbroucke's avatar Bert Vandenbroucke
Browse files

Fixed tests when running GIZMO_SPH (in 3D).

parent d20b6ca6
......@@ -91,7 +91,10 @@ struct part *make_particles(size_t count, double *offset, double spacing,
p->h = h;
p->id = ++(*partId);
#if !defined(GIZMO_SPH)
p->mass = 1.0f;
#endif
/* Place rest of particles around the test particle
* with random position within a unit sphere. */
......@@ -110,7 +113,9 @@ struct part *make_particles(size_t count, double *offset, double spacing,
p->h = h;
p->id = ++(*partId);
#if !defined(GIZMO_SPH)
p->mass = 1.0f;
#endif
}
return particles;
}
......@@ -120,6 +125,7 @@ struct part *make_particles(size_t count, double *offset, double spacing,
*/
void prepare_force(struct part *parts, size_t count) {
#if !defined(GIZMO_SPH)
struct part *p;
for (size_t i = 0; i < count; ++i) {
p = &parts[i];
......@@ -130,6 +136,7 @@ void prepare_force(struct part *parts, size_t count) {
p->force.v_sig = 0.0f;
p->force.h_dt = 0.0f;
}
#endif
}
/**
......@@ -144,10 +151,19 @@ void dump_indv_particle_fields(char *fileName, struct part *p) {
"%13e %13e %13e %13e "
"%13e %13e %13e\n",
p->id, p->x[0], p->x[1], p->x[2], p->v[0], p->v[1], p->v[2],
p->a_hydro[0], p->a_hydro[1], p->a_hydro[2], p->rho,
p->density.rho_dh, p->density.wcount, p->density.wcount_dh,
p->force.h_dt, p->force.v_sig,
#if defined(MINIMAL_SPH)
p->a_hydro[0], p->a_hydro[1], p->a_hydro[2],
#if defined(GIZMO_SPH)
0., 0.,
#else
p->rho, p->density.rho_dh,
#endif
p->density.wcount, p->density.wcount_dh, p->force.h_dt,
#if defined(GIZMO_SPH)
0.,
#else
p->force.v_sig,
#endif
#if defined(MINIMAL_SPH) || defined(GIZMO_SPH)
0., 0., 0., 0.
#else
p->density.div_v, p->density.rot_v[0], p->density.rot_v[1],
......
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