Skip to content

Commit

Permalink
NewRadX: assert intp are interior points
Browse files Browse the repository at this point in the history
  • Loading branch information
lwJi committed Jul 24, 2024
1 parent 88a0629 commit e325187
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions NewRadX/src/newradx.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ void NewRadX_Apply(const cGH *restrict const cctkGH,
grid.nghostzones[2] * p.NI[2]};
vect<int, dim> intp = p.I - displacement;

assert(intp[0] >= grid.nghostzones[0]);
assert(intp[1] >= grid.nghostzones[1]);
assert(intp[2] >= grid.nghostzones[2]);
assert(intp[0] <= grid.lsh[0] - grid.nghostzones[0] - 1);
assert(intp[1] <= grid.lsh[1] - grid.nghostzones[1] - 1);
assert(intp[2] <= grid.lsh[2] - grid.nghostzones[2] - 1);

// coordinates at p.I-displacement
const CCTK_REAL xint = p.x - displacement[0] * p.DX[0];
const CCTK_REAL yint = p.y - displacement[1] * p.DX[1];
Expand Down

0 comments on commit e325187

Please sign in to comment.