From 116c36fe8ad71105554debbfd21e9daa2abd14ee Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <matthieu.schaller@durham.ac.uk> Date: Wed, 20 Jul 2016 11:13:20 +0100 Subject: [PATCH] Fixed the tests --- src/hydro/Default/hydro.h | 6 +++--- src/units.c | 1 - tests/test27cells.c | 12 ++++++++++-- tests/testSPHStep.c | 4 ---- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/hydro/Default/hydro.h b/src/hydro/Default/hydro.h index 850ac68352..ee693d6099 100644 --- a/src/hydro/Default/hydro.h +++ b/src/hydro/Default/hydro.h @@ -142,9 +142,9 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force( /* Pre-compute some stuff for the balsara switch. */ 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] + - p->density.rot_v[1] * p->density.rot_v[1] + - p->density.rot_v[2] * p->density.rot_v[2]) / - p->rho * ih4; + p->density.rot_v[1] * p->density.rot_v[1] + + p->density.rot_v[2] * p->density.rot_v[2]) / + p->rho * ih4; /* Compute this particle's sound speed. */ const float u = p->u; diff --git a/src/units.c b/src/units.c index 68acfe3d9e..8fa4abfc61 100644 --- a/src/units.c +++ b/src/units.c @@ -41,7 +41,6 @@ #include "const.h" #include "error.h" - /** * @brief Initialises the UnitSystem structure with CGS system * diff --git a/tests/test27cells.c b/tests/test27cells.c index b3bfdd18bd..6f5de58d39 100644 --- a/tests/test27cells.c +++ b/tests/test27cells.c @@ -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].rho_dh, main_cell->parts[pid].density.wcount, 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].density.rot_v[1], 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 0., 0., 0., 0. #endif @@ -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].v[2], cj->parts[pjd].rho, cj->parts[pjd].rho_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].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 0., 0., 0., 0. #endif diff --git a/tests/testSPHStep.c b/tests/testSPHStep.c index 4fa3f0d202..bca40fedb7 100644 --- a/tests/testSPHStep.c +++ b/tests/testSPHStep.c @@ -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 */ int main() { -#ifndef DEFAULT_SPH return 0; -#else int i, j, k, offset[3]; struct part *p; @@ -199,6 +197,4 @@ int main() { free(ci->xparts); return 0; - -#endif } -- GitLab