Gadget-2 particles memory footprint
Particles could be made a tiny bit leaner by doing the following:
- Move
div_v
to thedensity
sub-structure. - Replace
curl_v
in theforce
sub-structure by the Balsara term and compute it in thehydro_prepare_force()
routine. - Move
entropy_dt
to theforce
sub-structure. - Move
a_hydro
andh_dt
to the force sub-structure. Although that might have consequence on the other schemes. - Replace
pressure
withP_over_rho
which then has to be computed in thehydro_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.