pynbody / genetIC

The GM initial conditions generator
GNU General Public License v3.0
21 stars 8 forks source link

AM modifications + ellipsis selection #80

Closed cphyc closed 3 years ago

cphyc commented 3 years ago

This adds notably

cphyc commented 3 years ago

I am quite confused by the failing tests, and weirdly the tests do not run locally (I get a segfault, including with master).

cphyc commented 3 years ago

@apontzen I realized that this PR is including quite a significant change in the way velocities are computed under the Zeldovich approximation.

The current version of master relies on the ik operator in Fourier space to compute the potential gradient (and hence the velocities). As of 21121769a49cae621c42d91514b846ca222a2d8c, the code is using instead a fourth-order finite-difference scheme. On my machine, this leads to significant differences in the velocities and positions.

For example for the velocity displacement test, I get these differences for the positions image and for the velocities image

The issue is that the angular momentum computation is only consistent with the output if the Zel'dovich velocities are computed like the AM one, i.e. using the finite-difference scheme.