mirror of
https://github.com/cosmo-sims/monofonIC.git
synced 2024-09-19 17:03:45 +02:00
added enforced normalisation of read white noise
This commit is contained in:
parent
ed9f30235c
commit
f2ba17cfcd
2 changed files with 18 additions and 5 deletions
|
@ -4,9 +4,9 @@ GridRes = 128
|
||||||
# length of the box in Mpc/h
|
# length of the box in Mpc/h
|
||||||
BoxLength = 250
|
BoxLength = 250
|
||||||
# starting redshift
|
# starting redshift
|
||||||
zstart = 129.0
|
zstart = 49.0
|
||||||
# order of the LPT to be used (1,2 or 3)
|
# order of the LPT to be used (1,2 or 3)
|
||||||
LPTorder = 1
|
LPTorder = 3
|
||||||
# also do baryon ICs?
|
# also do baryon ICs?
|
||||||
DoBaryons = no
|
DoBaryons = no
|
||||||
# do mode fixing à la Angulo&Pontzen
|
# do mode fixing à la Angulo&Pontzen
|
||||||
|
@ -15,11 +15,11 @@ DoFixing = no
|
||||||
ParticleLoad = sc
|
ParticleLoad = sc
|
||||||
# Add a possible constraint field here:
|
# Add a possible constraint field here:
|
||||||
ConstraintFieldFile = initial_conditions.h5
|
ConstraintFieldFile = initial_conditions.h5
|
||||||
ConstraintFieldName = ic
|
ConstraintFieldName = ic_white_noise
|
||||||
|
|
||||||
[cosmology]
|
[cosmology]
|
||||||
transfer = CLASS
|
transfer = CLASS
|
||||||
ztarget = 0.0
|
ztarget = 2.5
|
||||||
# transfer = eisenstein
|
# transfer = eisenstein
|
||||||
# transfer = file_CAMB
|
# transfer = file_CAMB
|
||||||
# transfer_file = wmap5_transfer_out_z0.dat
|
# transfer_file = wmap5_transfer_out_z0.dat
|
||||||
|
|
|
@ -384,7 +384,20 @@ void Grid_FFT<data_t,bdistributed>::Read_from_HDF5(const std::string Filename, c
|
||||||
}
|
}
|
||||||
sum1 /= Data.size();
|
sum1 /= Data.size();
|
||||||
sum2 /= Data.size();
|
sum2 /= Data.size();
|
||||||
csoca::ilog << "Constraint field has <W>=" << sum1 << ", <W^2>-<W>^2=" << std::sqrt(sum2-sum1*sum1) << std::endl;
|
auto stdw = std::sqrt(sum2-sum1*sum1);
|
||||||
|
csoca::ilog << "Constraint field has <W>=" << sum1 << ", <W^2>-<W>^2=" << stdw << std::endl;
|
||||||
|
|
||||||
|
#pragma omp parallel for reduction(+:sum1,sum2)
|
||||||
|
for (size_t i = 0; i < size(0); ++i)
|
||||||
|
{
|
||||||
|
for (size_t j = 0; j < size(1); ++j)
|
||||||
|
{
|
||||||
|
for (size_t k = 0; k < size(2); ++k)
|
||||||
|
{
|
||||||
|
this->relem(i,j,k) /= stdw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename data_t,bool bdistributed>
|
template <typename data_t,bool bdistributed>
|
||||||
|
|
Loading…
Reference in a new issue