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

Also undo the dithering in the other gravity scheme's io

parent 4cad23b0
Branches
Tags
1 merge request!952Gravity dithering
......@@ -24,10 +24,11 @@
INLINE static void convert_gpart_pos(const struct engine* e,
const struct gpart* gp, double* ret) {
if (e->s->periodic) {
ret[0] = box_wrap(gp->x[0], 0.0, e->s->dim[0]);
ret[1] = box_wrap(gp->x[1], 0.0, e->s->dim[1]);
ret[2] = box_wrap(gp->x[2], 0.0, e->s->dim[2]);
const struct space* s = e->s;
if (s->periodic) {
ret[0] = box_wrap(gp->x[0] - s->pos_dithering[0], 0.0, s->dim[0]);
ret[1] = box_wrap(gp->x[1] - s->pos_dithering[1], 0.0, s->dim[1]);
ret[2] = box_wrap(gp->x[2] - s->pos_dithering[2], 0.0, s->dim[2]);
} else {
ret[0] = gp->x[0];
ret[1] = gp->x[1];
......
......@@ -23,11 +23,11 @@
INLINE static void convert_gpart_pos(const struct engine* e,
const struct gpart* gp, double* ret) {
if (e->s->periodic) {
ret[0] = box_wrap(gp->x[0], 0.0, e->s->dim[0]);
ret[1] = box_wrap(gp->x[1], 0.0, e->s->dim[1]);
ret[2] = box_wrap(gp->x[2], 0.0, e->s->dim[2]);
const struct space* s = e->s;
if (s->periodic) {
ret[0] = box_wrap(gp->x[0] - s->pos_dithering[0], 0.0, s->dim[0]);
ret[1] = box_wrap(gp->x[1] - s->pos_dithering[1], 0.0, s->dim[1]);
ret[2] = box_wrap(gp->x[2] - s->pos_dithering[2], 0.0, s->dim[2]);
} else {
ret[0] = gp->x[0];
ret[1] = gp->x[1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment