N-BodyShop / changa

UIUC/PPL version of ChaNGa
http://hpcc.astro.washington.edu/tools/changa.html
GNU General Public License v2.0
44 stars 28 forks source link

Does the shape of the simulation box has to be a cube on periodic boundary conditions #17

Open hkayabilisim opened 6 years ago

hkayabilisim commented 6 years ago

Hi,

When I look at the source codes of Ewald implementation here: https://github.com/N-BodyShop/changa/blob/27cbc83121ada9a2c01d0869802c77f49bfd4000/Ewald.cpp#L123

I see that the simulation box is assumed to be a cube. Does it mean that I cannot use rectangular boxes with different sidelengths in the periodic boundary conditions?

Thanks Huseyin

trquinn commented 6 years ago

You are correct: with Ewald gravity, the periodic box is assumed to be a cube. Without Ewald, (say a non-self gravitating turbulent box) the period box does not have to be a cube.

I've never seen an implementation of a non-cubical Ewald, I would imagine that you would want the real space/k space transition parameter, alpha, to depend on direction in that case. A lot of care and testing would be needed.