|
CLASSpp Manual
Cosmology reference and developer manual
|
#include <modified_gravity.h>
Inheritance diagram for ModifiedGravity:Public Member Functions | |
| virtual void | CloseFriedmann (double a, double K, const double *pvecback_B, double *pvecback, double &rho_tot, double &p_tot, double &rho_r, double &rho_m) const =0 |
| virtual double | HPrime (double k, const double *y, const perturb_workspace *ppw) const =0 |
| virtual double | EtaPrime (double k, const double *y, const perturb_workspace *ppw) const =0 |
| virtual double | HPrimePrime (double k, const double *y, const perturb_workspace *ppw) const =0 |
| virtual double | AlphaPrime (double k, const double *y, const perturb_workspace *ppw) const =0 |
A species that modifies gravity itself: the one place CLASS otherwise assumes General Relativity.
GR is assumed in exactly two places: the Friedmann equations in BackgroundModule::background_functions, and the scalar Einstein equations in PerturbationsModule::perturb_einstein. A species that changes them (the Jordan-frame scalar of a scalar-tensor theory, say) implements this interface next to BaseSpecies. Each module resolves the role once, as it resolves the PPF fluid, and calls these hooks exactly where it would otherwise use GR. With no such species the modules run their GR lines unchanged. At most one species may modify gravity.
Design: docs/superpowers/specs/2026-09-24-scalar-tensor-gravity-design.md
|
pure virtual |
Close the Friedmann equations. Called in background_functions after every species has computed its background, with the running totals of all of them; the modified-gravity species itself has contributed nothing yet.
On return the species' own density and pressure are the effective ones that make GR's expressions exact, H = sqrt(rho_tot - K/a^2) and H' = -3/2 (rho_tot + p_tot) a + K/a, and they have been added to rho_tot and p_tot. rho_r and rho_m, the radiation- and matter-like parts of rho_tot, are updated to match.
Implemented in ScalarTensorSpecies.
|
pure virtual |
h' from the 00 (energy) constraint.
Implemented in ScalarTensorSpecies.
|
pure virtual |
eta' from the 0i (momentum) constraint.
Implemented in ScalarTensorSpecies.
|
pure virtual |
h'' from the trace of the ij equation.
Implemented in ScalarTensorSpecies.
|
pure virtual |
alpha' from the traceless part of the ij equation.
Implemented in ScalarTensorSpecies.