Skip to content
Snippets Groups Projects
Commit 4e917ae0 authored by Bert Vandenbroucke's avatar Bert Vandenbroucke
Browse files

Fixed tests when running GIZMO_SPH (in 3D).

parent d20b6ca6
No related branches found
No related tags found
1 merge request!315Repaired GIZMO_SPH after the time integration changes that had been made.
...@@ -91,7 +91,10 @@ struct part *make_particles(size_t count, double *offset, double spacing, ...@@ -91,7 +91,10 @@ struct part *make_particles(size_t count, double *offset, double spacing,
p->h = h; p->h = h;
p->id = ++(*partId); p->id = ++(*partId);
#if !defined(GIZMO_SPH)
p->mass = 1.0f; p->mass = 1.0f;
#endif
/* Place rest of particles around the test particle /* Place rest of particles around the test particle
* with random position within a unit sphere. */ * with random position within a unit sphere. */
...@@ -110,7 +113,9 @@ struct part *make_particles(size_t count, double *offset, double spacing, ...@@ -110,7 +113,9 @@ struct part *make_particles(size_t count, double *offset, double spacing,
p->h = h; p->h = h;
p->id = ++(*partId); p->id = ++(*partId);
#if !defined(GIZMO_SPH)
p->mass = 1.0f; p->mass = 1.0f;
#endif
} }
return particles; return particles;
} }
...@@ -120,6 +125,7 @@ struct part *make_particles(size_t count, double *offset, double spacing, ...@@ -120,6 +125,7 @@ struct part *make_particles(size_t count, double *offset, double spacing,
*/ */
void prepare_force(struct part *parts, size_t count) { void prepare_force(struct part *parts, size_t count) {
#if !defined(GIZMO_SPH)
struct part *p; struct part *p;
for (size_t i = 0; i < count; ++i) { for (size_t i = 0; i < count; ++i) {
p = &parts[i]; p = &parts[i];
...@@ -130,6 +136,7 @@ void prepare_force(struct part *parts, size_t count) { ...@@ -130,6 +136,7 @@ void prepare_force(struct part *parts, size_t count) {
p->force.v_sig = 0.0f; p->force.v_sig = 0.0f;
p->force.h_dt = 0.0f; p->force.h_dt = 0.0f;
} }
#endif
} }
/** /**
...@@ -144,10 +151,19 @@ void dump_indv_particle_fields(char *fileName, struct part *p) { ...@@ -144,10 +151,19 @@ void dump_indv_particle_fields(char *fileName, struct part *p) {
"%13e %13e %13e %13e " "%13e %13e %13e %13e "
"%13e %13e %13e\n", "%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->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->a_hydro[0], p->a_hydro[1], p->a_hydro[2],
p->density.rho_dh, p->density.wcount, p->density.wcount_dh, #if defined(GIZMO_SPH)
p->force.h_dt, p->force.v_sig, 0., 0.,
#if defined(MINIMAL_SPH) #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. 0., 0., 0., 0.
#else #else
p->density.div_v, p->density.rot_v[0], p->density.rot_v[1], p->density.div_v, p->density.rot_v[0], p->density.rot_v[1],
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment