python3 compatible integer division and argument sequence in agreement with documentation

This commit is contained in:
Martin Diehl 2018-11-17 09:58:54 +01:00
parent 015e819d4c
commit e1a730e96b
3 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ def curlFFT(geomdim,field):
curl_fourier = np.einsum(einsums[n],e,k_s,field_fourier)*TWOPIIMG curl_fourier = np.einsum(einsums[n],e,k_s,field_fourier)*TWOPIIMG
return np.fft.irfftn(curl_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,n]) return np.fft.irfftn(curl_fourier,s=shapeFFT,axes=(0,1,2)).reshape([N,n])
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -45,7 +45,7 @@ def divFFT(geomdim,field):
div_fourier = np.einsum(einsums[n],k_s,field_fourier)*TWOPIIMG div_fourier = np.einsum(einsums[n],k_s,field_fourier)*TWOPIIMG
return np.fft.irfftn(div_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,n/3]) return np.fft.irfftn(div_fourier,s=shapeFFT,axes=(0,1,2)).reshape([N,n//3])
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -45,7 +45,7 @@ def gradFFT(geomdim,field):
k_s = np.concatenate((ki[:,:,:,None],kj[:,:,:,None],kk[:,:,:,None]),axis = 3).astype('c16') k_s = np.concatenate((ki[:,:,:,None],kj[:,:,:,None],kk[:,:,:,None]),axis = 3).astype('c16')
grad_fourier = np.einsum(einsums[n],field_fourier,k_s)*TWOPIIMG grad_fourier = np.einsum(einsums[n],field_fourier,k_s)*TWOPIIMG
return np.fft.irfftn(grad_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,3*n]) return np.fft.irfftn(grad_fourier,s=shapeFFT,axes=(0,1,2)).reshape([N,3*n])
# -------------------------------------------------------------------- # --------------------------------------------------------------------