gandalfcode / gandalf

GANDALF (Graphical Astrophysics code for N-body Dynamics And Lagrangian Fluids)
GNU General Public License v2.0
46 stars 12 forks source link

Boxes and open boundaries #117

Open giovanni-rosotti opened 7 years ago

giovanni-rosotti commented 7 years ago

Currently when using open boundaries the simbox (and probably also the MPI domain boxes) might contain a finite number as min/max, depending on what was passed in as parameter. This could lead to horrible problems like particles being outside the simbox, or (with MPI) particles that don't belong to any domain. On the other hand, some other boxes we use in the code (e.g. the ones in the tree) should not go all the way up to infinity.

The robust way of doing this is NOT just to initialise min/max with big numbers, but making sure that BoxOverlap (and related functions, like ParticleInBox) checks if the box is open or not. We could use overloading so that we have a function that works on DomainBoxes and one on Boxes. But we also need to double check the code and make sure that where we are using these functions we are doing the right thing.

giovanni-rosotti commented 7 years ago

Part of this has been solved in #121 (mpi domain boxes are now guaranteed to extend all the way up to the simbox). But functions like ParticleInBox and BoxOverlap are still not aware of the nature of the boxes they are working on.