Commit 5ab8ca9a authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Corrected bug in Gadget-2 calculation of div_v

parent a28fec06
......@@ -93,8 +93,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_density(
dv[2] = pi->v[2] - pj->v[2];
const float dvdr = dv[0] * dx[0] + dv[1] * dx[1] + dv[2] * dx[2];
pi->div_v += faci * dvdr;
pj->div_v += facj * dvdr;
pi->div_v -= faci * dvdr;
pj->div_v -= facj * dvdr;
/* Compute dv cross r */
curlvr[0] = dv[1] * dx[2] - dv[2] * dx[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