Correlation function crashes on thin box dimensions
If the correlation function analysis modifier is added, if the simulation box is thinner in a dimension than the default FFT grid of 3, Ovito crashes. The GDB output is below. Probably it would work if bin sizes of 0 are rounded up to 1. I will kludge around a bit and see if I can make it act appropriately. In the meantime one could check for nZ == 0 and show an error/warning.
gdb output:
Starting program: /usr/local/bin/ovito
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffdf606700 (LWP 25003)]
qt5ct: using qt5ct plugin
[New Thread 0x7fffc7e22700 (LWP 25008)]
qt5ct: D-Bus global menu: no
[New Thread 0x7fffc7568700 (LWP 25009)]
[New Thread 0x7fffbef20700 (LWP 25010)]
[New Thread 0x7fffbe71f700 (LWP 25011)]
[New Thread 0x7fffbcc04700 (LWP 25012)]
[New Thread 0x7fffabfff700 (LWP 25013)]
[Thread 0x7fffbcc04700 (LWP 25012) exited]
Thread 8 "Thread (pooled)" received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0x7fffabfff700 (LWP 25013)]
0x00007fffde0dc67a in Ovito::StdObj::SimulationCell::modulo (k=0, n=0) at /home/stefan/projects/ovito/src/plugins/stdobj/simcell/SimulationCell.h:169
169 return ((k %= n) < 0) ? k+n : k;
(gdb) bt
#0 0x00007fffde0dc67a in Ovito::StdObj::SimulationCell::modulo (k=0, n=0) at /home/stefan/projects/ovito/src/plugins/stdobj/simcell/SimulationCell.h:169
#1 0x00007fffde0d4ebd in Ovito::Particles::CorrelationFunctionModifier::CorrelationAnalysisEngine::mapToSpatialGrid (this=0x5555557d9fa0, property=0x7fffa40058f0, propertyVectorComponent=0, reciprocalCellMatrix=..., nX=266, nY=266,
nZ=0, gridData=..., applyWindow=true) at /home/stefan/projects/ovito/src/plugins/correlation/CorrelationFunctionModifier.cpp:258
#2 0x00007fffde0d5869 in Ovito::Particles::CorrelationFunctionModifier::CorrelationAnalysisEngine::computeFftCorrelation (this=0x5555557d9fa0) at /home/stefan/projects/ovito/src/plugins/correlation/CorrelationFunctionModifier.cpp:357
#3 0x00007fffde0d8679 in Ovito::Particles::CorrelationFunctionModifier::CorrelationAnalysisEngine::perform (this=0x5555557d9fa0) at /home/stefan/projects/ovito/src/plugins/correlation/CorrelationFunctionModifier.cpp:749
#4 0x00007ffff7342990 in Ovito::AsynchronousTaskBase::run (this=0x5555557d9fa0) at /home/stefan/projects/ovito/src/core/utilities/concurrent/Task.cpp:48
#5 0x00007ffff554d9f1 in ?? () from /usr/lib/libQt5Core.so.5
#6 0x00007ffff5555b45 in ?? () from /usr/lib/libQt5Core.so.5
#7 0x00007ffff178f075 in start_thread () from /usr/lib/libpthread.so.0
#8 0x00007ffff489853f in clone () from /usr/lib/libc.so.6
Edited by Stefan Paquay