Some fixups

This commit is contained in:
Guilhem Lavaux 2019-11-11 10:32:40 +01:00
parent 1bd685e9c5
commit 71691956cc
6 changed files with 24 additions and 10 deletions

View file

@ -509,19 +509,17 @@ cdef void INTERNAL_project_cic_with_mass_periodic(DTYPE_t[:,:,:] g,
cdef int b1[3]
for i in range(x.shape[0]):
for j in range(3):
a[j] = (x[i,j]+shifter)*delta_Box
b[j] = int(floor(a[j]))
b1[j] = b[j]+1
while b1[j] < 0:
b1[j] += Ngrid
while b1[j] >= Ngrid:
b1[j] -= Ngrid
b1[j] = (b[j]+1) % Ngrid
a[j] -= b[j]
c[j] = 1-a[j]
b[j] %= Ngrid
m0 = mass[i]
g[b[0],b[1],b[2]] += c[0]*c[1]*c[2]*m0
g[b1[0],b[1],b[2]] += a[0]*c[1]*c[2]*m0