-
Notifications
You must be signed in to change notification settings - Fork 0
Code5:background.c
based on https://lesgourg.github.io/class-tour/Tokyo2014/lecture8_background.pdf and the documentation in the module itself.
First of all, a reminder about units. CLASS uses the following convention:
-
c = 1
. - The Planck Mass,
M_P = 1/\sqrt{8\piG} = 1
. - All quantities are in some power of Mpc.
- The energy densities and pressures are scaled by
1/(3*M_P^2) = 1/3
; e.g.rho_CLASS = *rho_physical
. ThenH^2 = \sum_i rho_i - K/a^2
Important remark: in hi_class, for the time being, modified gravity models have K = 0.
Let's start saying that background.c
has a detailed description at the
beginning which will be, mainly, what will be written here. A piece of it are
the following lines describing what this module is for:
* Deals with the cosmological background evolution.
* This module has two purposes:
*
* - at the beginning, to initialize the background, i.e. to integrate
* the background equations, and store all background quantities
* as a function of conformal time inside an interpolation table.
*
* - to provide routines which allow other modules to evaluate any
* background quantity for a given value of the conformal time (by
* interpolating within the interpolation table), or to find the
* correspondance between redhsift and conformal time.
In addition, each function have some documentation lines before them explaining what they are for and how to use them.
Recall that all stored values are saved in the background
structre, ba
(see Code 1: Philosophy and
structure)
and that, along the code, and specially from others modules, we will access
its contents through a pointer called, pba
.
It is important to remark that all equation in this module are written in a model independent way. To do so, we realize that background evolution have different kind of parameters that can be grouped in the following three blocks:
- Parameters
{A}
are those which can be directly expressed as a function of some variables in{B}
. - Parameters
{B}
are those which need to be integrated over time. - Parameters
{C}
also need to be integrated over time but are not used in{A}
.
Some examples are:
-
LCDM:
{A} = {ρ_i, p_i, H, ...}
{B} = {a}
{C} = {t, r_s , D}
-
Quintessence:
{A} = {ρ_i, p_i, H, ..., V_φ, ρ_φ, p_φ}
{B} = {a, φ, φ_0}
-
Internal functions:
-
background_functions()
returns all background quantities{A}
as a function of quantities{B}
. -
background_solve()
integrates{B}
and{C}
w.r.t. conformal time, requiring several calls tobackground_functions()
. As we said, the results are stored in thebackground
structure. -
There are several others used by them which we will not detail here. Some special remark is deserved by the hi_class specific functions:
-
background_gravity_functions()
fills the Horndeski part ofbackground_functions()
. New models are implemented here. -
background_gravity_parameters()
prints information about the specific modified gravity model used when./class
is run.
-
-
Background output is prepared by:
-
background_output_titles()
which give the appropiate format. The column titles are defined here. -
background_output_data()
which fills the formatted data table to be used byoutput.c
.
-
-
-
Intermodule functions:
-
background_init()
initializes the module and computes the background variables fillingba
. -
background_at_tau()
returns the background quantities at a specific conformal time interpolating between the computed values. In addition, it accepts three modes:-
short_info
: return only geometric quantities likea, H, H'
. -
normal_info
: return quantities strictly needed at each step in the integration of perturbations. -
long_info
: return also rarely useful quantities. Each mode return a growing piece of the interpolation vector: first elemens are forshort_info
, next ones contribute fornormal_info
and the full vector is forlong_info
.
-
-
background_tau_of_z()
returns the conformal time at given redshift. -
background_free()
frees the used structures.
-
In background.c
there are two kind of dynamical indices:
-
Those for variables in the table (
{A}
,{B}
,{C}
) declared ininclude/background.h
inside thebackground
structure to ensure others modules can used them. For example,ba.index_bg_a
andba.bg_size
. -
Those for the ODE
dy[i] = f(y[j])
, i.e. for variables{B}
,{C}
. They are declared ininclude/background.h
but outside thebackground
structure. They cannot be accessed outsidebackground.c
. For example,index_bi_a
orindex_bi_M_pl_smg
.
Home
Installation
Basic usage
classy: the python wrapper
Introducing new models
The code:
- Code 1: Philosophy and structure
- Code 2: Indexing
- Code 3: Errors
- Code 4: input.c
- Code 5: background.c
- Code 6: thermodynamics.c
- Code 7: perturbations.c
- Code 8: primordial.c
- Code 10: output.c
- Other modules
- classy: classy.pyx and classy.pxd
Examples: