Skip to content

Gadget-2 particles memory footprint

Particles could be made a tiny bit leaner by doing the following:

  • Move div_v to the density sub-structure.
  • Replace curl_v in the force sub-structure by the Balsara term and compute it in the hydro_prepare_force() routine.
  • Move entropy_dt to the force sub-structure.
  • Move a_hydro and h_dt to the force sub-structure. Although that might have consequence on the other schemes.
  • Replace pressure with P_over_rho which then has to be computed in the hydro_predict_extra() routine.

That last one is not a space optimisation but a speed optimisation.

Doing this implies modifying critical part of the physics implementation as well as the corresponding unit tests.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information