Commit 116c36fe authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Fixed the tests

parent 7966efd2
...@@ -142,9 +142,9 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force( ...@@ -142,9 +142,9 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force(
/* Pre-compute some stuff for the balsara switch. */ /* Pre-compute some stuff for the balsara switch. */
const float normDiv_v = fabs(p->density.div_v / p->rho * ih4); const float normDiv_v = fabs(p->density.div_v / p->rho * ih4);
const float normRot_v = sqrtf(p->density.rot_v[0] * p->density.rot_v[0] + const float normRot_v = sqrtf(p->density.rot_v[0] * p->density.rot_v[0] +
p->density.rot_v[1] * p->density.rot_v[1] + p->density.rot_v[1] * p->density.rot_v[1] +
p->density.rot_v[2] * p->density.rot_v[2]) / p->density.rot_v[2] * p->density.rot_v[2]) /
p->rho * ih4; p->rho * ih4;
/* Compute this particle's sound speed. */ /* Compute this particle's sound speed. */
const float u = p->u; const float u = p->u;
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include "const.h" #include "const.h"
#include "error.h" #include "error.h"
/** /**
* @brief Initialises the UnitSystem structure with CGS system * @brief Initialises the UnitSystem structure with CGS system
* *
......
...@@ -183,10 +183,15 @@ void dump_particle_fields(char *fileName, struct cell *main_cell, ...@@ -183,10 +183,15 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
main_cell->parts[pid].v[2], main_cell->parts[pid].rho, main_cell->parts[pid].v[2], main_cell->parts[pid].rho,
main_cell->parts[pid].rho_dh, main_cell->parts[pid].density.wcount, main_cell->parts[pid].rho_dh, main_cell->parts[pid].density.wcount,
main_cell->parts[pid].density.wcount_dh, main_cell->parts[pid].density.wcount_dh,
#ifdef GADGET2_SPH #if defined(GADGET2_SPH)
main_cell->parts[pid].div_v, main_cell->parts[pid].density.rot_v[0], main_cell->parts[pid].div_v, main_cell->parts[pid].density.rot_v[0],
main_cell->parts[pid].density.rot_v[1], main_cell->parts[pid].density.rot_v[1],
main_cell->parts[pid].density.rot_v[2] main_cell->parts[pid].density.rot_v[2]
#elif defined(DEFAULT_SPH)
main_cell->parts[pid].density.div_v,
main_cell->parts[pid].density.rot_v[0],
main_cell->parts[pid].density.rot_v[1],
main_cell->parts[pid].density.rot_v[2]
#else #else
0., 0., 0., 0. 0., 0., 0., 0.
#endif #endif
...@@ -213,9 +218,12 @@ void dump_particle_fields(char *fileName, struct cell *main_cell, ...@@ -213,9 +218,12 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
cj->parts[pjd].x[2], cj->parts[pjd].v[0], cj->parts[pjd].v[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, cj->parts[pjd].rho_dh,
cj->parts[pjd].density.wcount, cj->parts[pjd].density.wcount_dh, cj->parts[pjd].density.wcount, cj->parts[pjd].density.wcount_dh,
#ifdef GADGET2_SPH #if defined(GADGET2_SPH)
cj->parts[pjd].div_v, cj->parts[pjd].density.rot_v[0], cj->parts[pjd].div_v, cj->parts[pjd].density.rot_v[0],
cj->parts[pjd].density.rot_v[1], cj->parts[pjd].density.rot_v[2] cj->parts[pjd].density.rot_v[1], cj->parts[pjd].density.rot_v[2]
#elif 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 #else
0., 0., 0., 0. 0., 0., 0., 0.
#endif #endif
......
...@@ -96,9 +96,7 @@ void runner_dopair2_force(struct runner *r, struct cell *ci, struct cell *cj); ...@@ -96,9 +96,7 @@ void runner_dopair2_force(struct runner *r, struct cell *ci, struct cell *cj);
/* Run a full time step integration for one cell */ /* Run a full time step integration for one cell */
int main() { int main() {
#ifndef DEFAULT_SPH
return 0; return 0;
#else
int i, j, k, offset[3]; int i, j, k, offset[3];
struct part *p; struct part *p;
...@@ -199,6 +197,4 @@ int main() { ...@@ -199,6 +197,4 @@ int main() {
free(ci->xparts); free(ci->xparts);
return 0; return 0;
#endif
} }
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