This commit is contained in:
Guilhem Lavaux 2015-02-26 10:38:39 +01:00
commit ae4187809e
4 changed files with 35 additions and 13 deletions

View file

@ -186,6 +186,11 @@ void CICFilter::putParticles(CICParticles *particles, uint32_t N)
for (long p = tUsedMin[t]; p < tUsedMax[t]; p++)
densityGrid[p] += threadedDensity[t][p];
}
for (int t = 0; t < threadUsed; t++)
{
delete[] threadedDensity;
}
}
void CICFilter::getDensityField(CICType*& field, uint32_t& res)

View file

@ -90,7 +90,8 @@ static double powC(double q, double alpha_c)
static double T_tilde_0(double q, double alpha_c, double beta_c)
{
double a = log(M_E + 1.8 * beta_c * q);
static const double c_E = 2.718282; //M_E;
double a = log(c_E + 1.8 * beta_c * q);
return a / ( a + powC(q, alpha_c) * q * q);
}
@ -125,7 +126,7 @@ void CosmoPower::updateHuWigglesConsts()
{
double f_b = OMEGA_B / OMEGA_0;
double f_c = OMEGA_C / OMEGA_0;
double k_silk = 1.6 * pow(OMEGA_B * h * h, 0.52) * pow(OmegaEff, 0.73) * (1 + pow(10.4 * OmegaEff, -0.95));
double z_eq = 2.50e4 * OmegaEff * pow(Theta_27, -4);
//double s = 44.5 * log(9.83 / OmegaEff) / (sqrt(1 + 10 * pow(OMEGA_B * h * h, 0.75)));
@ -133,7 +134,7 @@ void CosmoPower::updateHuWigglesConsts()
double b1_zd = 0.313 * pow(OmegaEff, -0.419) * (1 + 0.607 * pow(OmegaEff, 0.674));
double b2_zd = 0.238 * pow(OmegaEff, 0.223);
double z_d = 1291 * pow(OmegaEff, 0.251) / (1 + 0.659 * pow(OmegaEff, 0.828)) * (1 + b1_zd * pow(OmegaEff, b2_zd));
double z_d = 1291 * pow(OmegaEff, 0.251) / (1 + 0.659 * pow(OmegaEff, 0.828)) * (1 + b1_zd * pow(OMEGA_B*h*h, b2_zd));
double R_d = 31.5 * OMEGA_B * h * h * pow(Theta_27, -4) * 1e3 / z_d;
double Req = 31.5 * OMEGA_B * h * h * pow(Theta_27, -4) * 1e3 / z_eq;
@ -183,7 +184,10 @@ double CosmoPower::powerHuWiggles(double k)
double q = k / (13.41 * k_eq);
double T_c = f * T_tilde_0(q, 1, beta_c) + (1 - f) * T_tilde_0(q, alpha_c, beta_c);
double T_b = (T_tilde_0(q, 1, 1) / (1 + pow(k * s / 5.2, 2)) + alpha_b / (1 + pow(beta_b / (k * s), 3)) * exp(-pow(k/k_silk, 1.4))) * j_0(k * s_tilde);
double T_b = (
T_tilde_0(q, 1, 1) / (1 + pow(xx / 5.2, 2)) +
alpha_b / (1 + pow(beta_b / xx, 3)) * exp(-pow(k/k_silk, 1.4))
) * j_0(k * s_tilde);
double T_k = OMEGA_B/OMEGA_0 * T_b + OMEGA_C/OMEGA_0 * T_c;
@ -286,7 +290,7 @@ void CosmoPower::normalize(double k_min, double k_max)
ofstream ff("PP_k.txt");
for (int i = 0; i < 100; i++)
{
double k = pow(10.0, 4.0*i/100.-2);
double k = pow(10.0, 8.0*i/100.-4);
ff << k << " " << power(k) << endl;
}
@ -376,5 +380,5 @@ void CosmoPower::setFunction(CosmoFunction f)
void CosmoPower::setNormalization(double A_K)
{
normPower = A_K/power(0.002);
normPower = A_K;///power(0.002);
}