stay consistent

This commit is contained in:
Martin Diehl 2022-11-29 22:01:14 +01:00
parent 8ba9bb02c7
commit 18ad14708f
1 changed files with 4 additions and 4 deletions

View File

@ -75,8 +75,8 @@ def curl(size: _FloatSequence,
e[0, 2, 1] = e[2, 1, 0] = e[1, 0, 2] = -1.0
f_fourier = _np.fft.rfftn(f,axes=(0,1,2))
curl_ = (_np.einsum('slm,ijkl,ijkm ->ijks', e,k_s,f_fourier)*2.0j*_np.pi if n == 3 else # vector, 3 -> 3
_np.einsum('slm,ijkl,ijknm->ijksn',e,k_s,f_fourier)*2.0j*_np.pi) # tensor, 3x3 -> 3x3
curl_ = (_np.einsum('slm,ijkl,ijkm ->ijks' if n == 3 else
'slm,ijkl,ijknm->ijksn',e,k_s,f_fourier)*2.0j*_np.pi) # vector 3->3, tensor 3x3->3x3
return _np.fft.irfftn(curl_,axes=(0,1,2),s=f.shape[:3])