Skip to content

Gravity breaks on empty cells

Version : 0.5.0 Revision: v0.5.0-252-g393039c1-dirty, Branch: gravity_testing, Date: 2017-04-10 18:44:13 +0100

Config. options: '--disable-vec --enable-debug=yes --enable-debugging-checks'

Compiler: ICC, Version: 15.0.20150407 CFLAGS : '-g -O0 -debug inline-debug-info -O3 -ansi_alias -xAVX -no-vec -no-simd -w2 -Wunused-variable -Werror'

Generate ICs with: python makeIC_DM.py 'n_p' 'boxsize'.

where the first argument is the number of particles and the second argument is the box size. This generates n_p particles of mass 1 with x/y/z coordinates/velocities uniformly distributed between 0 and 1, in a box of size 'boxsize'. This means that if you set boxsize to be larger than 1 you end up with empty cells.

If you run: python makeIC_DM.py 100000 2. ../swift -G -e -t 16 self_gravity_test.yml

Then you will get a floating point exception before the first time step. The problem seems to arise in the 'gravity_P2M' function. If this acts on an empty cell then it does a '0/0' when calculating the centre of mass. This will run without the -e flag but the coordinates/velocities/accelerations in the snapshots will have NaN values.

If you run: python makeIC_DM.py 100000 1. ../swift -G -e -t 16 self_gravity_test.yml

Here we have no empty cells at the start. It will run for some time before returning a floating point exception, which seems to be the acceleration of some particle.

We can also run this without the -e flag and again this results in the snapshots being full of NaN values.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information