Working ICs with ramses
This commit is contained in:
parent
8f582707da
commit
a82688b0b1
3 changed files with 41 additions and 19 deletions
|
@ -71,7 +71,7 @@ def run_generation(input_borg, a_borg, a_ic, cosmo, supersample=1, do_lpt2=True)
|
|||
# Compute LPT scaling coefficient
|
||||
D1 = cgrowth.D(a_ic)
|
||||
D1_0 = D1/cgrowth.D(a_borg)
|
||||
velmul = cgrowth.compute_velmul(a_ic)*D1_0
|
||||
velmul = cgrowth.compute_velmul(a_ic)
|
||||
|
||||
D2 = -3./7 * D1_0**2
|
||||
|
||||
|
@ -87,6 +87,8 @@ def run_generation(input_borg, a_borg, a_ic, cosmo, supersample=1, do_lpt2=True)
|
|||
# Generate vel
|
||||
vel.append((psi*velmul).astype(np.float32))
|
||||
|
||||
print("velmul=%lg" % (cosmo['h']*velmul))
|
||||
|
||||
density = np.fft.irfftn(density_hat*D1_0)*(N/L)**3
|
||||
|
||||
return posx,vel,density,N,L,a_ic
|
||||
|
@ -97,7 +99,7 @@ def write_icfiles(*generated_ic, **cosmo):
|
|||
|
||||
ct.simpleWriteGadget("borg.gad", posx, velocities=vel, boxsize=L, Hubble=cosmo['h'], Omega_M=cosmo['omega_M_0'], time=a_ic)
|
||||
for i,c in enumerate(['x','y','z']):
|
||||
ct.writeGrafic("ic_velc%s" % c, vel[i].reshape((N,N,N)), L, a_ic, **cosmo)
|
||||
ct.writeGrafic("ic_velc%s" % c, vel[i].reshape((N,N,N)).transpose(), L, a_ic, **cosmo)
|
||||
|
||||
ct.writeGrafic("ic_deltab", density, L, a_ic, **cosmo)
|
||||
ct.writeWhitePhase("white.dat", density)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue