Skip to content

Commit 8b21730

Browse files
committed
NewRadX: assert intp are interior points
1 parent 88a0629 commit 8b21730

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

NewRadX/src/newradx.cxx

+7
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@ void NewRadX_Apply(const cGH *restrict const cctkGH,
169169
grid.nghostzones[2] * p.NI[2]};
170170
vect<int, dim> intp = p.I - displacement;
171171

172+
assert(intp[0] >= grid.nghostzones[0]);
173+
assert(intp[1] >= grid.nghostzones[1]);
174+
assert(intp[2] >= grid.nghostzones[2]);
175+
assert(intp[0] <= grid.lsh[0] - grid.nghostzones[0]);
176+
assert(intp[1] <= grid.lsh[1] - grid.nghostzones[1]);
177+
assert(intp[2] <= grid.lsh[2] - grid.nghostzones[2]);
178+
172179
// coordinates at p.I-displacement
173180
const CCTK_REAL xint = p.x - displacement[0] * p.DX[0];
174181
const CCTK_REAL yint = p.y - displacement[1] * p.DX[1];

0 commit comments

Comments
 (0)