Re: 2LPT initial condition

From: Volker Springel <vspringel_at_MPA-Garching.MPG.DE>
Date: Sat, 9 Apr 2022 19:10:44 +0200

Hi Yuchan,

Yes, the option SECOND_ORDER_LPT_ICS for Adrian's special IC code was only working if the input files were in the old file-format 1. For HDF5 input files (generating this format is probably a new feature in Adrian's code), LptScalingfactor wasn't extraced as an attribute from the header. I have changed this now with this commit:

Just for clarification, SECOND_ORDER_LPT_ICS is only needed for Adrian's IC code (which also can create zoom-ICs). If you generate ICs with Gadget4's built-in IC generator (which only works for homogeneous boxes), 2LPT can be generated with the NGENIC_2LPT option.


> On 30. Mar 2022, at 22:47, WANG, YUCHAN <> wrote:
> Dear Gadget users,
> I’m trying to run Gadget4 with 2LPT initial condition generated by Adrian’s code (by enabling the ‘SECOND_ORDER_LPT_ICS’ in the Config file).
> The input format is hdf5. The fac2 parameter used for the 2LPT calculation is stored in the header with name ‘LptScalingfactor’. It seems that it is not loaded in Gadget4.
> The output of Gadget4 gives:
> SECOND_ORDER_LPT_ICS: fac1=0.181381 fac2=0 fac3=0
> (while in the header fac2 is not 0).
> In the ./src/gravity/, the fac2 is defined as
> fac2 = All.LptScalingfactor;
> It seems that it is from the ‘All’ parameter – which consists of many global variables.
> Could someone please point me to the location where All is read in - can it read in parameters in the header? Or is there other way to correctly run Gadget4 with 2LPT ICs?
> Many thanks in advance!
> Best wishes
> Yuchan
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> with a subject of: unsubscribe gadget-list
> A web-archive of this mailing list is available here:
Received on 2022-04-09 19:10:45

This archive was generated by hypermail 2.3.0 : 2023-01-10 10:01:33 CET