Skip to content

Commit

Permalink
Added new concentration model of Dutton14
Browse files Browse the repository at this point in the history
  • Loading branch information
cdplagos committed Aug 28, 2018
1 parent 6e4c380 commit 0d2dde2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
8 changes: 7 additions & 1 deletion include/dark_matter_halos.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,14 @@ class DarkMatterHaloParameters {
COLE00
};

enum ConcentrationModel{
DUFFY08 = 0,
DUTTON14
};

DarkMatterProfile haloprofile = NFW;
SizeModel sizemodel = MO98;
ConcentrationModel concentrationmodel = DUFFY08;
bool random_lambda = false;

};
Expand Down Expand Up @@ -157,4 +163,4 @@ DarkMatterHalosPtr make_dark_matter_halos(const DarkMatterHaloParameters &dmh_pa
} // namespace shark


#endif /* INCLUDE_DARK_MATTER_HALOS_H_ */
#endif /* INCLUDE_DARK_MATTER_HALOS_H_ */
30 changes: 27 additions & 3 deletions src/dark_matter_halos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ DarkMatterHaloParameters::DarkMatterHaloParameters(const Options &options)
options.load("dark_matter_halo.halo_profile", haloprofile);
options.load("dark_matter_halo.size_model", sizemodel);
options.load("dark_matter_halo.lambda_random", random_lambda);
options.load("dark_matter_halo.concentration_model", concentrationmodel);

}

Expand Down Expand Up @@ -77,6 +78,22 @@ Options::get<DarkMatterHaloParameters::SizeModel>(const std::string &name, const
throw invalid_option(os.str());
}

template <>
DarkMatterHaloParameters::ConcentrationModel
Options::get<DarkMatterHaloParameters::ConcentrationModel>(const std::string &name, const std::string &value) const {
auto lvalue = lower(value);
if (lvalue == "duffy08") {
return DarkMatterHaloParameters::DUFFY08;
}
else if (lvalue == "dutton14") {
return DarkMatterHaloParameters::DUTTON14;
}
std::ostringstream os;
os << name << " option value invalid: " << value << ". Supported values are Duffy08 and Dutton14";
throw invalid_option(os.str());
}


DarkMatterHalos::DarkMatterHalos(const DarkMatterHaloParameters &params, const CosmologyPtr &cosmology, SimulationParameters &sim_params) :
params(params),
cosmology(cosmology),
Expand Down Expand Up @@ -360,9 +377,16 @@ double DarkMatterHalos::v2bulge (double x, double m, double c, double r){

double DarkMatterHalos::nfw_concentration(double mvir, double z){

// From Duffy et al. (2008). Full sample from z=0-2 for Virial masses.

return 7.85 * std::pow(1.0+z, -0.71) * std::pow(mvir/2.0e12,-0.081);
if(params.concentrationmodel == DarkMatterHaloParameters::DUFFY08){
// From Duffy et al. (2008). Full sample from z=0-2 for Virial masses.
return 7.85 * std::pow(1.0+z, -0.71) * std::pow(mvir/2.0e12,-0.081);
}
else if(params.concentrationmodel == DarkMatterHaloParameters::DUTTON14){
//From Dutton & Maccio (2014) for virial masses.
double b = -0.097 + 0.024 * z;
double a = 0.537 + (1.025 - 0.537) * std::exp(-0.718 * std::pow(z,1.08));
return std::pow(10.0, a + b * std::log10(mvir/1e12));
}

}

Expand Down

0 comments on commit 0d2dde2

Please sign in to comment.