Forum Navigation
You need to log in to create posts and topics.

too high FFT grid_spacing

Is it possible to reduce the minimum grid_spacing for the spatial correlation function modifier? Using the graphical interface OVITO exceeds the RAM limit (on my home pc with 16 GB) and OVITO crashes, so I wrote a Python script to run on a cluster(only tested on home pc) with 64GB RAM per CPU (, attached). The system has a size of 170x170x170 with about 100.000 networkbeads in the hydrogel- system(nik_6.png). If I use a grid spacing smaller than 170/511 ~ 0.33268101761 a runtime error occurs:

Traceback (most recent call last):
File "/.../", line 14, in <module>
data = pipeline.compute()
File "/home/user/anaconda3/envs/ovito_environment/lib/python3.9/site-packages/ovito/pipeline/", line 187, in _Pipeline_compute
raise RuntimeError("Data pipeline failure: %s" % state.status.text)
RuntimeError: Data pipeline failure: Modifier 'Spatial correlation function' reported: FFT grid spacing is too fine for this simulation cell volume. The maximum number of FFT grid cells has been exceeded (512 x 512 x 512 = 134217728 cells, limit is 134217727).


The equilibrium distance for networkbeads is about 0.6 so I guess a much smaller grid spacing (than 0.3327) is needed. For comparison I added the real space rdf and correlation plots for a smaller system(25x25x25 with 1k networkbeads) with different grid_spacing (0.05 and 0.333).

Uploaded files:


Yes, the current version of Ovito limits the total number of FFT grid cells to a maximum of 2^27-1, see the source code. That's because the original code of Lars Pastewka was written using 32-bit array indices (and each grid cell stores a double-precision complex number). I later introduced the check as a safety measure to prevent possible number overflows.

I don't see an easy way for you to work around this hard-coded limit (other than changing the source code). I can only offer you to revise the code of the Spatial Correlation modifier myself to make it work for larger grid sizes, remove the check, and build a new version of Ovito. But this will take some time (at least several days).

If I do this, you will need a new version of the ovito Python pip package, to run on the cluster, right?


A larger grid size would be helpful, thank you. I use the Python Anaconda package but pip might work, too

By making small modifications to the code I was able to raise the limit on the number of FFT grid cells from 227 to 231. This should allow you to run the spatial correlation algorithm with a somewhat finer resolution. Completely eliminating the limit seems impossible at this time due to inherent limitations in the "kissfft" third-party library employed by OVITO.

I've uploaded a development version of the Anaconda package to our server. Since it uses a different Anaconda package name, please uninstall the "ovito" package first before installing the dev version to avoid filename conflicts:

conda remove ovito
conda install --strict-channel-priority -c -c conda-forge ovito-dev3.5.5

(Pay attention that one out of of these three package files gets installed: ovito-dev3.5.5-3.6.0-py37h9e5e97f_85.tar.bz2, ovito-dev3.5.5-3.6.0-py38h1e6884c_85.tar.bz2 , ovito-dev3.5.5-3.6.0-py39h821428a_85.tar.bz2)

Let me know if you run into any problems with the preview version. Once we publish the next stable release, you can switch back to the regular package "ovito".

New for our users in China: OVITO on WeChat 

Official OVITO WeChat channel operated by Foshan Diesi Technology Co., Ltd.