Skip to content

Commit

Permalink
Changed sign on 2D particle ind vel
Browse files Browse the repository at this point in the history
  • Loading branch information
hjabird committed Jun 17, 2019
1 parent cfc6b87 commit c6e8e2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/P2D.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ CVTX_EXPORT bsv_V2f cvtx_P2D_S2S_vel(
bsv_V2f ret;
ret = P2D_vel_inner(self, mes_point, kernel,
1.f / fabsf(regularisation_radius));
return bsv_V2f_mult(ret, -1.f / (2.f * acosf(-1.f)));
return bsv_V2f_mult(ret, 1.f / (2.f * acosf(-1.f)));
}

CVTX_EXPORT bsv_V2f cvtx_P2D_M2S_vel(
Expand All @@ -88,7 +88,7 @@ CVTX_EXPORT bsv_V2f cvtx_P2D_M2S_vel(
ry += vel.x[1];
}
bsv_V2f ret = { (float)rx, (float)ry };
return bsv_V2f_mult(ret, -1.f / (2.f * acosf(-1.f)));
return bsv_V2f_mult(ret, 1.f / (2.f * acosf(-1.f)));
}


Expand Down
2 changes: 1 addition & 1 deletion src/nbody.cl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Definitions for the repeated body of kernels
/* Fill in g calc here */

"#define CVTX_P2D_VEL_END \\\n"
" cor = - g; /*1/2pi term is done by host. */ \\\n"
" cor = g; /*1/2pi term is done by host. */ \\\n"
" den = pown(radd, 2); \\\n"
" ret.x = rad.y * (cor * particle_vorts[pidx] / den); \\\n"
" ret.y = -rad.x * (cor * particle_vorts[pidx] / den); \\\n"
Expand Down

0 comments on commit c6e8e2f

Please # to comment.