This PR fixes the GRAFIC-specific issue raised in #69, and implements an additional test to catch this behaviour.
Several things worth mentioning for documentation:
The centering with Grafic is not as accurate as when using e.g. tipsy/gadget. This is because it works at the grid level, and therefore any offset is implemented in pixel units. The final target region is therefore centered plus or minus one coarse pixel (which can be physically large for very coarse grids used in the tests).
Hi,
This PR fixes the GRAFIC-specific issue raised in #69, and implements an additional test to catch this behaviour.
Several things worth mentioning for documentation:
The centering with Grafic is not as accurate as when using e.g. tipsy/gadget. This is because it works at the grid level, and therefore any offset is implemented in pixel units. The final target region is therefore centered plus or minus one coarse pixel (which can be physically large for very coarse grids used in the tests).
I was worried that the new
OffsetGenerator
would apply the centering offset a second time, after the grid hierarchy has already been centered. However, this line ensures it does not: https://github.com/ucl-cosmoparticles/genetIC/blob/a9eea2cce6ce0be6eebe67a37f073cb9df9fee57/genetIC/src/io/grafic.hpp#L177Comments welcome Martin