mirror of
https://github.com/cosmo-sims/MUSIC.git
synced 2024-09-09 05:33:44 +02:00
Merge branch 'music20' of https://bitbucket.org/ohahn/music into music20
This commit is contained in:
commit
0544869468
5 changed files with 9 additions and 8 deletions
|
@ -184,6 +184,7 @@ public:
|
|||
transfer_function_->intialise();
|
||||
if( !transfer_function_->tf_isnormalised_ ){
|
||||
cosmo_param_.set("pnorm", this->compute_pnorm_from_sigma8()*Dplus_start_*Dplus_start_ );
|
||||
music::ilog << "Fixing PS normalisation from specified sigma8 = " << cosmo_param_["sigma_8"] << std::endl;
|
||||
}else{
|
||||
// WARNING: we do explicit back-scaling here, which is notably different from monofonIC
|
||||
cosmo_param_.set("pnorm", Dplus_start_*Dplus_start_/Dplus_target_/Dplus_target_);
|
||||
|
|
|
@ -328,7 +328,7 @@ void GenerateDensityHierarchy(config_file &cf, const cosmology::calculator* cc,
|
|||
unsigned levelmin = cf.get_value_safe<unsigned>("setup", "levelmin_TF", levelminPoisson);
|
||||
unsigned levelmax = cf.get_value<unsigned>("setup", "levelmax");
|
||||
|
||||
unsigned margin = cf.get_value_safe<unsigned>("setup", "convolution_margin", 8);
|
||||
unsigned margin = cf.get_value_safe<unsigned>("setup", "convolution_margin", 4);
|
||||
|
||||
bool fix = cf.get_value_safe<bool>("setup","fix_mode_amplitude",false);
|
||||
bool flip = cf.get_value_safe<bool>("setup","flip_mode_amplitude",false);
|
||||
|
@ -518,12 +518,11 @@ void normalize_levelmin_density(grid_hierarchy &delta)
|
|||
}
|
||||
|
||||
|
||||
void coarsen_density(const refinement_hierarchy &rh, GridHierarchy<real_t> &u, bool kspace)
|
||||
void coarsen_density(const refinement_hierarchy &rh, GridHierarchy<real_t> &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)));
|
||||
|
@ -541,10 +540,10 @@ void coarsen_density(const refinement_hierarchy &rh, GridHierarchy<real_t> &u, b
|
|||
|| rh.size(i, 0) != u.get_grid(i)->size(0) || rh.size(i, 1) != u.get_grid(i)->size(1) || rh.size(i, 2) != u.get_grid(i)->size(2))
|
||||
{
|
||||
u.cut_patch(i, rh.offset_abs(i, 0), rh.offset_abs(i, 1), rh.offset_abs(i, 2),
|
||||
rh.size(i, 0), rh.size(i, 1), rh.size(i, 2), benforce_coarse);
|
||||
rh.size(i, 0), rh.size(i, 1), rh.size(i, 2), !bfourier_coarsening );
|
||||
}
|
||||
}
|
||||
if( !benforce_coarse ){
|
||||
if( !bfourier_coarsening ){
|
||||
normalize_levelmin_density( u );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,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<real_t> &u, bool kspace);
|
||||
void coarsen_density(const refinement_hierarchy &rh, GridHierarchy<real_t> &u, bool bfourier_coarsening );
|
||||
|
||||
#endif
|
||||
|
|
|
@ -596,6 +596,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<bool>("setup", "fourier_splicing", true);
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
|
|
@ -1324,7 +1324,7 @@ public:
|
|||
preserve_dims_ = cf_.get_value_safe<bool>("setup", "preserve_dims", false);
|
||||
equal_extent_ = cf_.get_value_safe<bool>("setup", "force_equal_extent", false);
|
||||
blocking_factor_ = cf.get_value_safe<unsigned>("setup", "blocking_factor", 0);
|
||||
margin_ = cf.get_value_safe<int>("setup", "convolution_margin", 32);
|
||||
margin_ = cf.get_value_safe<int>("setup", "convolution_margin", 4);
|
||||
|
||||
bool bnoshift = cf_.get_value_safe<bool>("setup", "no_shift", false);
|
||||
bool force_shift = cf_.get_value_safe<bool>("setup", "force_shift", false);
|
||||
|
|
Loading…
Reference in a new issue