Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolution of genetIC ICs compared to MUSIC ICs #116

Open
robmost opened this issue Jul 8, 2022 · 2 comments
Open

Resolution of genetIC ICs compared to MUSIC ICs #116

robmost opened this issue Jul 8, 2022 · 2 comments

Comments

@robmost
Copy link

robmost commented Jul 8, 2022

Hi,

I am trying to debug a zoom hydrodynamical run and for that, I want to test the genetIC ICs I generated against some resolution-equivalent MUSIC ICs. For simplicity, I only consider 1 zoom region and ignore the differences from white-noise fields seeds, as I only care about the location and the resolution of the runs.

  • In genetIC, the resolution of the zoom region is set by the size-ratio of the base grid and the zoom grid and the number of particles in that region. However, only the previously flagged particles in the base grid would be promoted to high-resolution particles. Let's consider the following setup:
# Specify the base-level grid. Basegrid 100 Mpc/h, 128^3
base_grid 100.0 128
gadget_particle_type 2

# Specify the zoom level. 
# First flag the base grid particles within a cube of 40 Mpc/h side length and centred in the middle of the box.
centre 50 50 50
select_cube 40
# Accomodate those particles within a zoom grid half the base grid size (100 Mpc/h / 2 = 50 Mpc/h) with 256^3 grid.
# The "effective" spatial resolution is the same as using 512^3 particles in a 100 Mpc/h box. 
zoom_grid 2 256
gadget_particle_type 1

autopad 8

centre_output
  • In MUSIC, the resolution of the zoom region is set by the refinement level of the zoom region and the extent of the zoom region in units of the base grid, such that (extent_zoom_region * 2^refinement_zoom_region) ^3 should be the number of particles in the zoom region. I tried generating the previous setup with the following parameters:
boxlength          = 100 #in Mpc/h
levelmin            = 7   #2^levelmin sets the coarse effective resolution, i.e. 2^7 = 128 cells/dimension
levelmin_TF      = 7
levelmax           = 9   #2^levelmax sets the fine effective resolution
padding             = 8
overlap              = 4
ref_center         = 0.5, 0.5, 0.5
ref_extent         = 0.4, 0.4, 0.4
force_equal_extent = yes
align_top          = no
baryons            = yes
use_2LPT        = yes
use_LLA          = yes
periodic_TF     = yes

While the spatial resolution matches...

genetIC:

Initialized a zoom region:
Subbox length         = 50 Mpc/h
n                     = 256
dx                    = 0.195312
Zoom factor           = 2
Num particles         = 140608
Low-left corner in parent grid = (31, 31, 31)
Low-left corner (h**-1 Mpc)    = 24.2188, 24.2188, 24.2188
Total particles       = 19954368

MUSIC:

 - Finest level :
                   extent =  40.2344 x 40.2344 x 40.2344 h-3 Mpc**3
                 mtotgrid =  5.62323e+15 h-1 M_o
            particle mass =  5.42147e+08 h-1 M_o
         baryon mass/cell =  1.0111e+08 h-1 M_o
                       dx =  0.195312 h-1 Mpc

...the location of the zoom region and the number of particles does not:

genetIC:

 Writing output; number dm particles=12172224, number gas particles=8998912
 Particles by gadget type:
 Particle type 0: 8998912 particles
 Particle type 1: 8998912 particles
 Particle type 2: 3173312 particles

MUSIC:

 - Gadget2 : writing 20000057 particles to file...
 -       type   0 :      8741816 [m=0.010111]
 -       type   1 :      8741816 [m=0.0542147]
 -       type   2 :      2516425 [m=0]

I think I am missing something fundamental in my setup but I cannot figure out how to get similar results. Would you mind elaborating on how is genetIC setting up the zoom region and how could I recreate as close as possible the same setup in MUSIC, if you happen to know how?

@apontzen
Copy link
Member

apontzen commented Jul 8, 2022

The difference in the particle number will be to do with the padding algorithm. In genetIC, autopad 8 is not at all the same thing as padding 8 in MUSIC (as far as I understand it anyway).

As to the size of the subgrids, MUSIC seems to have initialised one which is as close as possible to 40 Mpc/h across. GenetIC doesn't offer this option and only offers integer divisions of the original box length.

@robmost
Copy link
Author

robmost commented Jul 8, 2022

Thanks for the reply! Then I reckon I should probably constrain the MUSIC ICs so that they match as close as possible the spatial extent of the genetIC ICs.

While the exact number of particles will never match, how could I estimate the number of particles in genetIC? Is there a fornula?

In the previous genetIC setup, when I first flag the particles from the base grid using a 40 Mpc/h cube (in order to promote them to high resolution particles) and then set the zoom grid to half the box size and use 256^3 grid to accommodate those particles, am I splitting the previously flagged particles or is the mapper from grid to particles only invoked at the end of the setup?

The spatial resolution matches that of a 512^3 run on a 100 Mpc/h box but naturally the amount of particles is between that and a 256^3 run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants