Skip to content

Commit

Permalink
Allowed the smoothing scale of the density grid to explicitly be a fr…
Browse files Browse the repository at this point in the history
…ee parameter in ANAL_PARAMS.H
  • Loading branch information
Andrei Mesinger committed Oct 5, 2016
1 parent 156cd3c commit c43c112
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Parameter_files/ANAL_PARAMS.H
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
/*
If set to 1, the ZA density field is additionally smoothed (asside from the implicit
boxcar smoothing performed when re-binning the ICs from DIM to HII_DIM) with a Gaussian
filter of width 0.2*BOX_LEN/HII_DIM. The implicit boxcar smoothing in perturb_field.c
filter of width R_smooth_density*BOX_LEN/HII_DIM. The implicit boxcar smoothing in perturb_field.c
bins the density field on scale DIM/HII_DIM, similar to what Lagrangian codes do
when constructing Eulerian grids. In other words, the density field, \delta,
is quantized into (DIM/HII_DIM)^3 values. If your usage requires smooth density fields,
Expand All @@ -73,6 +73,7 @@
New in v1.1
*/
#define SMOOTH_EVOLVED_DENSITY_FIELD (int) (1)
#define R_smooth_density (float) (0.2)

/*
Use second-order Lagrangian perturbation theory (2LPT).
Expand Down
2 changes: 1 addition & 1 deletion Programs/perturb_field.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ int main (int argc, char ** argv){

//smooth the field
if (!EVOLVE_DENSITY_LINEARLY && SMOOTH_EVOLVED_DENSITY_FIELD){
HII_filter(updated, 2, 0.2*BOX_LEN/(float)HII_DIM);
HII_filter(updated, 2, R_smooth_density*BOX_LEN/(float)HII_DIM);
}

// save a copy of the k-space density field
Expand Down

0 comments on commit c43c112

Please sign in to comment.