From c43c1120701d3feb5b11a1e2e0b0f61137c8e4b6 Mon Sep 17 00:00:00 2001 From: Andrei Mesinger Date: Wed, 5 Oct 2016 13:41:23 +0200 Subject: [PATCH] Allowed the smoothing scale of the density grid to explicitly be a free parameter in ANAL_PARAMS.H --- Parameter_files/ANAL_PARAMS.H | 3 ++- Programs/perturb_field.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Parameter_files/ANAL_PARAMS.H b/Parameter_files/ANAL_PARAMS.H index c232b84..c992b39 100644 --- a/Parameter_files/ANAL_PARAMS.H +++ b/Parameter_files/ANAL_PARAMS.H @@ -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, @@ -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). diff --git a/Programs/perturb_field.c b/Programs/perturb_field.c index c6c0d90..1f2fc45 100644 --- a/Programs/perturb_field.c +++ b/Programs/perturb_field.c @@ -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