Skip to content
Snippets Groups Projects
Commit d908d35f authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Remove wrong factors in prepare_force() for DEFAULT_SPH

parent 16c4113f
Branches
Tags
No related merge requests found
...@@ -56,8 +56,8 @@ ...@@ -56,8 +56,8 @@
/* SPH variant to use */ /* SPH variant to use */
//#define MINIMAL_SPH //#define MINIMAL_SPH
#define GADGET2_SPH //#define GADGET2_SPH
//#define DEFAULT_SPH #define DEFAULT_SPH
/* Gravity properties */ /* Gravity properties */
#define EXTERNAL_POTENTIAL_POINTMASS #define EXTERNAL_POTENTIAL_POINTMASS
......
...@@ -136,15 +136,12 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force( ...@@ -136,15 +136,12 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force(
/* Some smoothing length multiples. */ /* Some smoothing length multiples. */
const float h = p->h; const float h = p->h;
const float ih = 1.0f / h; const float ih = 1.0f / h;
const float ih2 = ih * ih;
const float ih4 = ih2 * ih2;
/* 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);
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;
/* Compute this particle's sound speed. */ /* Compute this particle's sound speed. */
const float u = p->u; const float u = p->u;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment