Skip to content

Gizmo refactoring

Bert Vandenbroucke requested to merge gizmo_refactoring into master

Refactoring of the GIZMO schemes that should eliminate code duplication between the different flavours. The idea is to have one folder, hydro/Gizmo that contains all of the functionality that is shared between flavours, and two subfolders, hydro/Gizmo/MFV and hydro/Gizmo/MFM, that implement flavour specific stuff.

While refactoring the code, a few additional changes were made:

  • getters and setters were moved from hydro.h to hydro_getters.h and hydro_setters.h to reduce the length of hydro.h.
  • A new file, hydro_lloyd.h was created that contains the hacks required to run GizmoMFV in Lloyd's algorithm mode, where it will reduce the Poisson noise in a particle distribution by recursively moving particles to the centroid of their meshless cell.
  • some structs in the MFV hydro part were removed to make sure both Gizmo schemes uses the same variable names for most quantities
  • for the same reason, a union was created that allows the particle/fluid velocity to be accessed using both v and fluid_v in Gizmo MFM
  • some of the gradient and slope limiter code was simplified by moving operations to dedicated functions

The code still passes all the tests I tried, so in principle these changes have not changed any of the functionality.

Edited by Bert Vandenbroucke

Merge request reports