MP-Gadget
5.0.1.dev1-76bc7d4726-dirty
|
#include "omega_nu_single.h"
#include <math.h>
#include <gsl/gsl_integration.h>
#include <gsl/gsl_errno.h>
#include <string.h>
#include "physconst.h"
#include "utils/mymalloc.h"
#include "utils/endrun.h"
Go to the source code of this file.
Macros | |
#define | HBAR 6.582119e-16 /*hbar in units of eV s*/ |
#define | STEFAN_BOLTZMANN 5.670373e-5 |
#define | NRHOTAB 200 |
#define | FLOAT_ACC 1e-6 |
#define | GSL_VAL 200 |
#define | NU_SW 100 |
Functions | |
void | init_omega_nu (_omega_nu *omnu, const double MNu[], const double a0, const double HubbleParam, const double tcmb0) |
double | get_omega_nu (const _omega_nu *const omnu, const double a) |
double | get_omega_nu_nopart (const _omega_nu *const omnu, const double a) |
double | get_omegag (const _omega_nu *const omnu, const double a) |
double | rho_nu_int (double q, void *params) |
double | get_rho_nu_conversion () |
void | rho_nu_init (_rho_nu_single *const rho_nu_tab, double a0, const double mnu, const double kBtnu) |
static double | non_rel_rho_nu (const double a, const double kT, const double amnu, const double kTamnu2) |
static double | rel_rho_nu (const double a, const double kT) |
double | rho_nu (const _rho_nu_single *rho_nu_tab, const double a, const double kT) |
double | fermi_dirac_kernel (double x, void *params) |
double | nufrac_low (const double qc) |
void | init_hybrid_nu (_hybrid_nu *const hybnu, const double mnu[], const double vcrit, const double light, const double nu_crit_time, const double kBtnu) |
double | particle_nu_fraction (const _hybrid_nu *const hybnu, const double a, const int i) |
double | omega_nu_single (const _omega_nu *const omnu, const double a, int i) |
#define FLOAT_ACC 1e-6 |
Floating point accuracy
Definition at line 16 of file omega_nu_single.c.
#define GSL_VAL 200 |
Number of bins in integrations
Definition at line 18 of file omega_nu_single.c.
#define HBAR 6.582119e-16 /*hbar in units of eV s*/ |
Definition at line 11 of file omega_nu_single.c.
#define NRHOTAB 200 |
Definition at line 14 of file omega_nu_single.c.
#define NU_SW 100 |
Value of kT/aM_nu on which to switch from the analytic expansion to the numerical integration
Definition at line 87 of file omega_nu_single.c.
#define STEFAN_BOLTZMANN 5.670373e-5 |
Definition at line 12 of file omega_nu_single.c.
double fermi_dirac_kernel | ( | double | x, |
void * | params | ||
) |
Definition at line 212 of file omega_nu_single.c.
Referenced by nufrac_low().
double get_omega_nu | ( | const _omega_nu *const | omnu, |
const double | a | ||
) |
Return the total matter density in neutrinos at scale factor a.
Definition at line 57 of file omega_nu_single.c.
References _omega_nu::kBtnu, _omega_nu::nu_degeneracies, NUSPECIES, rho_nu(), _omega_nu::rhocrit, and _omega_nu::RhoNuTab.
Referenced by check_units(), compute_mass(), delta_nu_from_power(), delta_tot_first_init(), get_long_range_timestep_dloga(), get_omega_nu_nopart(), growth(), hubble_function(), init_cosmology(), init_neutrinos_lra(), init_transfer_table(), main(), parse_transfer(), test_get_omega_nu(), and update_delta_tot().
double get_omega_nu_nopart | ( | const _omega_nu *const | omnu, |
const double | a | ||
) |
Return the total matter density in neutrinos at scale factor a , excluding active particles.
Definition at line 71 of file omega_nu_single.c.
References get_omega_nu(), _omega_nu::hybnu, and particle_nu_fraction().
Referenced by check_omega(), delta_nu_from_power(), delta_tot_first_init(), get_delta_nu_combined(), potential_transfer(), test_hybrid_neutrinos(), and update_delta_tot().
double get_omegag | ( | const _omega_nu *const | omnu, |
const double | a | ||
) |
Return the photon matter density at scale factor a
Definition at line 79 of file omega_nu_single.c.
References LIGHTCGS, _omega_nu::rhocrit, STEFAN_BOLTZMANN, and _omega_nu::tcmb0.
Referenced by test_get_omegag().
double get_rho_nu_conversion | ( | ) |
Definition at line 102 of file omega_nu_single.c.
References HBAR, and LIGHTCGS.
Referenced by do_exact_rho_nu_integration(), non_rel_rho_nu(), rel_rho_nu(), and rho_nu_init().
void init_hybrid_nu | ( | _hybrid_nu *const | hybnu, |
const double | mnu[], | ||
const double | vcrit, | ||
const double | light, | ||
const double | nu_crit_time, | ||
const double | kBtnu | ||
) |
Set up parameters for the hybrid neutrinos
hybnu | initialised structure |
mnu | array of neutrino masses in eV |
vcrit | Critical velocity above which to treat neutrinos with particles. Note this is unperturbed velocity TODAY To get velocity at redshift z, multiply by (1+z) |
light | speed of light in internal units |
nu_crit_time | critical time to make neutrino particles live |
kBtnu | Boltzmann constant times neutrino temperature. Dimensionful factor. |
Definition at line 235 of file omega_nu_single.c.
References _hybrid_nu::enabled, _hybrid_nu::nu_crit_time, nufrac_low(), _hybrid_nu::nufrac_low, NUSPECIES, and _hybrid_nu::vcrit.
Referenced by init_cosmology(), and test_hybrid_neutrinos().
void init_omega_nu | ( | _omega_nu *const | omnu, |
const double | MNu[], | ||
const double | a0, | ||
const double | HubbleParam, | ||
const double | tcmb0 | ||
) |
Initialise the neutrino structure, do the time integration and allocate memory for the subclass rho_nu_single
omnu | structure to initialise |
MNu | array of neutrino masses in eV. Three entries. |
a0 | initial scale factor. |
HubbleParam | Hubble parameter h0, eg, 0.7. |
tcmb0 | Redshift zero CMB temperature. |
Definition at line 20 of file omega_nu_single.c.
References BOLEVK, _hybrid_nu::enabled, FLOAT_ACC, GRAVITY, HUBBLE, _omega_nu::hybnu, _omega_nu::kBtnu, _rho_nu_single::loga, _omega_nu::nu_degeneracies, NUSPECIES, rho_nu_init(), _omega_nu::rhocrit, _omega_nu::RhoNuTab, _omega_nu::tcmb0, and TNUCMB.
Referenced by init_cosmology(), test_allocate_delta_tot_table(), test_get_omega_nu(), test_get_omegag(), test_hybrid_neutrinos(), test_omega_nu_init_degenerate(), test_omega_nu_init_nondeg(), test_omega_nu_single(), and test_omega_nu_single_exact().
|
inlinestatic |
Definition at line 165 of file omega_nu_single.c.
References get_rho_nu_conversion().
Referenced by rho_nu().
double nufrac_low | ( | const double | qc | ) |
Integrate the fermi-dirac kernel between 0 and qc to find the fraction of neutrinos that are particles
Definition at line 219 of file omega_nu_single.c.
References fermi_dirac_kernel().
Referenced by init_hybrid_nu(), Jfrac_high(), test_hybrid_neutrinos(), and test_nufrac_low().
double omega_nu_single | ( | const _omega_nu *const | rho_nu_tab, |
const double | a, | ||
const int | i | ||
) |
Return the matter density in a single neutrino species
rho_nu_tab | structure containing pre-computed matter density values. |
i | index of neutrino species we want |
a | scale factor desired |
Definition at line 267 of file omega_nu_single.c.
References _omega_nu::hybnu, _omega_nu::kBtnu, _omega_nu::nu_degeneracies, particle_nu_fraction(), rho_nu(), _omega_nu::rhocrit, and _omega_nu::RhoNuTab.
Referenced by get_delta_nu_combined(), parse_transfer(), test_get_omega_nu(), test_hybrid_neutrinos(), test_omega_nu_single(), and test_omega_nu_single_exact().
double particle_nu_fraction | ( | const _hybrid_nu *const | hybnu, |
const double | a, | ||
int | i | ||
) |
Get fraction of neutrinos currently followed by particles.
hybnu | Structure with hybrid neutrino parameters. |
i | index of neutrino species to use. |
a | redshift of interest. |
Definition at line 251 of file omega_nu_single.c.
References _hybrid_nu::enabled, _hybrid_nu::nu_crit_time, and _hybrid_nu::nufrac_low.
Referenced by delta_nu_from_power(), delta_tot_first_init(), get_delta_nu(), get_delta_tot(), get_omega_nu_nopart(), gravpm_force(), omega_nu_single(), test_hybrid_neutrinos(), and update_delta_tot().
|
inlinestatic |
Definition at line 173 of file omega_nu_single.c.
References get_rho_nu_conversion().
Referenced by rho_nu().
double rho_nu | ( | const _rho_nu_single * | rho_nu_tab, |
const double | a, | ||
const double | kT | ||
) |
Computes the neutrino density for a single neutrino species at a given redshift, either by looking up in a table, or a simple calculation in the limits, or by direct integration.
rho_nu_tab | Pre-computed table of values |
a | Redshift desired. |
kT | Boltzmann constant times neutrino temperature. Dimensionful factor. |
Definition at line 180 of file omega_nu_single.c.
References _rho_nu_single::acc, _rho_nu_single::interp, _rho_nu_single::loga, _rho_nu_single::mnu, non_rel_rho_nu(), NU_SW, rel_rho_nu(), and _rho_nu_single::rhonu.
Referenced by get_omega_nu(), and omega_nu_single().
void rho_nu_init | ( | _rho_nu_single * | rho_nu_tab, |
double | a0, | ||
const double | mnu, | ||
const double | kBtnu | ||
) |
Initialise the tables for matter density in a single neutrino species, by doing numerical integration.
rho_nu_tab | Structure to initialise |
a0 | First scale factor in rho_nu_tab. Do not try and evaluate rho_nu at higher redshift! |
mnu | neutrino mass to compute neutrino matter density for in eV |
kBtnu | Boltzmann constant times neutrino temperature. Dimensionful factor. |
Definition at line 119 of file omega_nu_single.c.
References _rho_nu_single::acc, endrun(), get_rho_nu_conversion(), GSL_VAL, _rho_nu_single::interp, _rho_nu_single::loga, _rho_nu_single::mnu, mymalloc, NRHOTAB, NU_SW, rho_nu_int(), and _rho_nu_single::rhonu.
Referenced by init_omega_nu(), and test_rho_nu_init().
double rho_nu_int | ( | double | q, |
void * | params | ||
) |
Definition at line 91 of file omega_nu_single.c.
Referenced by do_exact_rho_nu_integration(), and rho_nu_init().