diff --git a/src/densities.cc b/src/densities.cc index ec09459..05ac825 100644 --- a/src/densities.cc +++ b/src/densities.cc @@ -331,11 +331,11 @@ void GenerateDensityHierarchy(config_file &cf, const cosmology::calculator* cc, unsigned levelmin = cf.get_value_safe("setup", "levelmin_TF", levelminPoisson); unsigned levelmax = cf.get_value("setup", "levelmax"); - unsigned margin = cf.get_value_safe("setup", "convolution_margin", 8); + unsigned margin = cf.get_value_safe("setup", "convolution_margin", 4); bool fix = cf.get_value_safe("setup","fix_mode_amplitude",false); bool flip = cf.get_value_safe("setup","flip_mode_amplitude",false); - bool fourier_splicing = true; //cf.get_value_safe("setup","fourier_splicing",true); + bool fourier_splicing = cf.get_value_safe("setup","fourier_splicing",true); if( fix && levelmin != levelmax ){ music::wlog.Print("You have chosen mode fixing for a zoom. This is not well tested,\n please proceed at your own risk..."); @@ -521,12 +521,11 @@ void normalize_levelmin_density(grid_hierarchy &delta) } -void coarsen_density(const refinement_hierarchy &rh, GridHierarchy &u, bool kspace) +void coarsen_density(const refinement_hierarchy &rh, GridHierarchy &u, bool bfourier_coarsening ) { const unsigned levelmin_TF = u.levelmin(); - const bool benforce_coarse = !kspace; - if (kspace) + if (bfourier_coarsening) { for (int i = levelmin_TF; i >= (int)rh.levelmin(); --i) fft_coarsen(*(u.get_grid(i)), *(u.get_grid(i - 1))); @@ -547,7 +546,7 @@ void coarsen_density(const refinement_hierarchy &rh, GridHierarchy &u, b rh.size(i, 0), rh.size(i, 1), rh.size(i, 2), benforce_coarse); } } - if( !benforce_coarse ){ + if( !fourier_coarsening ){ normalize_levelmin_density( u ); } } diff --git a/src/densities.hh b/src/densities.hh index e6b52ae..0c0700a 100644 --- a/src/densities.hh +++ b/src/densities.hh @@ -27,6 +27,6 @@ void GenerateDensityUnigrid(config_file &cf, const cosmology::calculator*, tf_ty void normalize_density(grid_hierarchy &delta); -void coarsen_density(const refinement_hierarchy &rh, GridHierarchy &u, bool kspace); +void coarsen_density(const refinement_hierarchy &rh, GridHierarchy &u, bool bfourier_coarsening ); #endif diff --git a/src/main.cc b/src/main.cc index fcb0dbe..16dbf79 100644 --- a/src/main.cc +++ b/src/main.cc @@ -589,6 +589,7 @@ int main(int argc, const char *argv[]) poisson_plugin *the_poisson_solver = the_poisson_plugin_creator->create(cf); // .. this parameter needs to be read after the random module is initialised as it will be overwritten by it + // .. e.g. PANPHASIA wants false, while MUSIC RNG wants true const bool use_fourier_coarsening = cf.get_value_safe("setup", "fourier_splicing", true); //--------------------------------------------------------------------------------- diff --git a/src/mesh.hh b/src/mesh.hh index 11f52f6..7518a0f 100644 --- a/src/mesh.hh +++ b/src/mesh.hh @@ -1317,7 +1317,7 @@ public: preserve_dims_ = cf_.get_value_safe("setup", "preserve_dims", false); equal_extent_ = cf_.get_value_safe("setup", "force_equal_extent", false); blocking_factor_ = cf.get_value_safe("setup", "blocking_factor", 0); - margin_ = cf.get_value_safe("setup", "convolution_margin", 32); + margin_ = cf.get_value_safe("setup", "convolution_margin", 4); bool bnoshift = cf_.get_value_safe("setup", "no_shift", false); bool force_shift = cf_.get_value_safe("setup", "force_shift", false);