Gizmo refactoring
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
tohydro_getters.h
andhydro_setters.h
to reduce the length ofhydro.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
struct
s 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
andfluid_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.
Merge request reports
Activity
added 1 commit
- 8c8486d2 - GIZMO refactoring, step 3: moved all common gradient stuff to shared folder.
added 1 commit
- e786b339 - Added an extrapolation function to gizmo gradient extrapolation to avoid too much code duplication.
added 1 commit
- 8489488b - Moved common parts of Gizmo slope limiters to top Gizmo folder.
added 1 commit
- fee2cb3b - Replaced separate Gizmo hydro_parameters files with a single shared one.
added 1 commit
- aec2b1ac - Removed duplicate hydro_io from Gizmo schemes.
added 1 commit
- b11d376f - Moved all the Gizmo getters and setters out of hydro.h.
added 5 commits
- bf76a8d6 - Started moving GIZMO duplicate hydro.h functions to shared hydro.h.
- ac54de6f - Move some more functionality from separate GIZMO hydro.hs to shared one.
- 35b9ecb9 - Eliminated last duplicate functions from Gizmo hydro.hs. Refactoring can now move to next stage.
- e66d4b89 - Streamlined names of hydro variables in GIZMO schemes. Removed almost all…
- acd3dfa1 - Removed GIZMO scheme specific hydro_g/setters.h and moved their contents to…
Toggle commit listadded 1 commit
- 08deb895 - Removed last remaining GIZMO_MFV_SPH ifdefs from hydro.h.
added 1 commit
- b01f2292 - Fixed Lloyd's iterations algorithm and put it in a separate file.
assigned to @matthieu
Just tried compiling with
./configure --with-hydro=gizmo-mfm --with-kernel=wendland-C2 --with-tbbmalloc --enable-debug --disable-parallel-hdf5 --enable-debugging-checks --with-riemann-solver=hllc
and gotIn file included from ././chemistry/none/chemistry.h:34, from ./chemistry.h:33, from ./black_holes/Default/black_holes_properties.h:22, from ./black_holes/Default/black_holes.h:25, from black_holes.h:27, from space.c:44: ././hydro/Gizmo/hydro.h: In function ‘hydro_kick_extra’: ././hydro/Gizmo/hydro.h:721:40: error: ‘struct <anonymous>’ has no member named ‘flux’ 721 | p->conserved.mass, p->conserved.flux.mass); | ^ ./error.h:75:49: note: in definition of macro ‘error’ 75 | __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__); \ | ^~~~~~~~~~~ ././hydro/Gizmo/hydro.h:728:42: error: ‘struct <anonymous>’ has no member named ‘flux’ 728 | p->conserved.energy, p->conserved.flux.energy); | ^ ./error.h:75:49: note: in definition of macro ‘error’ 75 | __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__); \ | ^~~~~~~~~~~