CLASSpp Manual
Cosmology reference and developer manual
Loading...
Searching...
No Matches
AxionEDEFluid Class Reference

#include <axion_ede_fluid.h>

+ Inheritance diagram for AxionEDEFluid:

Public Member Functions

void ComputeWFld (double a, double *w_fld, double *dw_over_da_fld, double *integral_fld) const override
 
double Cs2 (double k2, double a) const override
 
bool ReachesPhantomDivide () const override
 
void ApplyInitialConditions (const BaseSpecies::PerturbLayout &base, double *y, const PerturbIcContext &ctx) override
 
void SetBackgroundModule (const BackgroundModule *bgm) override
 
std::optional< double > GetParam (const std::string &name) const override
 
void SetOmegaAxionForTest (double omega_axion)
 
- Public Member Functions inherited from FluidSpecies
bool SupportsExplicitPerturbationEvolver () const override
 
std::unique_ptr< BaseSpecies::PerturbLayout > CreatePerturbLayout () const override
 
double GetOmega0 () const override
 
void SetBackgroundModule (const BackgroundModule *bgm) override
 
void RegisterBackgroundIndices (int &index_bg) override
 
void ComputeBackground (double a, const double *pvecback_B, double *pvecback) override
 
double Rho (const double *pvecback) const override
 
double P (const double *pvecback) const override
 
double PPrime (double a, double H, const double *pvecback_B, const double *pvecback) const override
 
void WriteBackgroundColumnTitles (BackgroundColumnWriter &w) const override
 
void WriteBackgroundData (const double *pvecback, BackgroundColumnWriter &w) const override
 
double W (const double *pvecback) const
 
void RegisterTransferSourceIndices (int &index_tp, const SourceRequestContext &ctx) override
 
void PerturbDerivs (const BaseSpecies::PerturbLayout &base, double tau, const double *y, double *dy, const perturb_parameters_and_workspace &ppaw) const override
 
void FillSources (const BaseSpecies::PerturbLayout &base, const double *y, const double *dy, PerturbSourceContext &ctx) const override
 
void ApplyInitialConditions (const BaseSpecies::PerturbLayout &base, double *y, const PerturbIcContext &ctx) override
 
void PerturbSynchronousToNewtonian (const BaseSpecies::PerturbLayout &base, double *y, const PerturbIcContext &ctx) override
 
void CopyPerturbationsAcrossSwitch (const BaseSpecies::PerturbLayout &old_base, const BaseSpecies::PerturbLayout &new_base, const double *old_y, double *new_y, const PerturbSwitchContext &ctx) const override
 
StressEnergyContribution StressEnergy (const BaseSpecies::PerturbLayout &base, const perturb_vector *pv, const double *y, const double *pvecback, const perturb_workspace *ppw) const override
 
void WriteOutputColumns (PerturbColumnWriter &writer, const PerturbationsModule &mod, file_format fmt, TransferColumnSection section=TransferColumnSection::all) const override
 
void PrintVariables (PerturbColumnWriter &writer, const BaseSpecies::PerturbLayout *base, double tau, const double *y, const PerturbationsModule &mod, const perturb_workspace *ppw) const override
 
- Public Member Functions inherited from BaseSpecies
virtual void SetThermodynamicsModule (const ThermodynamicsModule *)
 
virtual void SetPerturbs (const perturbs *)
 
virtual void RegisterIntegrationIndices (int &index_bi)
 
virtual void SetBackgroundInitialConditions (const BackgroundICContext &ctx)
 
virtual void BackgroundDerivs (double tau, const double *y, double *dy, const double *pvecback)
 
virtual void BackgroundDerivsDiagonal (double tau, const double *y, double *diag, const double *pvecback)
 
virtual void FinalizeBackground (double a, double H, const double *pvecback_B, double *pvecback)
 
virtual bool IsFreestreaming () const
 
virtual double FreestreamingRho (const double *pvecback) const
 
bool IsPresent () const
 
int bg_rho_index () const
 
virtual void ProcessBackgroundTable (const double *, int, int, const double *)
 
virtual void PerturbDerivsDiagonal (const PerturbLayout &, double, const double *, double *, const perturb_parameters_and_workspace &) const
 
virtual void PerturbVectorDerivs (const PerturbLayout &, double, const double *, double *, const perturb_parameters_and_workspace &) const
 
virtual void PerturbTensorDerivs (const PerturbLayout &, double, const double *, double *, const perturb_parameters_and_workspace &) const
 
virtual void ApplyTensorInitialConditions (const PerturbLayout &, double *, double, const double *) const
 
virtual void WriteTensorOutputColumnTitles (std::string &) const
 
virtual void ContributeTensorGwSource (const PerturbLayout &, double, const double *, perturb_workspace *) const
 
virtual int ApproximationCount () const
 
virtual int ApproximationRegimeAt (int, double, const double *) const
 
int ApproximationRegime (const perturb_workspace *ppw, int which=0) const
 
int ApproximationRegimeBefore (const PerturbSwitchContext &ctx, int which=0) const
 
virtual bool SupportsNewtonianGauge () const
 
virtual bool SupportsIsocurvatureInitialConditions () const
 
virtual double RhoPrimeOverRho (const double *pvecback, double a_prime_over_a) const
 
virtual void MarkUsedInSources (const PerturbLayout &, const perturb_workspace *, int *) const
 
virtual double BackgroundDensityOverH0Sq (double a, double H0) const
 
virtual double GetRadiationOmega0 () const
 
virtual double DarkRadiationRhoToday (const double *) const
 
virtual double NeutrinoOmega0 () const
 
virtual double NeffContribution (double) const
 
virtual void PrintNeffInfo () const
 
virtual void PrintMassInfo () const
 
virtual void PrintBackgroundDetails (const double *, double) const
 
virtual double TensorMasslessRelativisticRho (const double *) const
 
virtual double DeviationFromRadiation (const double *) const
 
virtual std::vector< double > FreeStreamingWavenumbers () const
 
virtual void WarnIfNonlinearUnreliable (double) const
 
virtual std::optional< double > ChildOmega0 (const std::string &) const
 
virtual double BackgroundAIni (double a_proposed, double) const
 
bool ClustersAsMatterCached () const
 
virtual void FinalizeMatterClassification ()
 
virtual bool ClustersAsMatter () const
 
virtual bool IsColdMatterSpecies () const
 
virtual bool HasWarmMatter () const
 
virtual double NonClusteringOmega0 () const
 
virtual double ColdMatterRho (const double *pvecback) const
 
virtual double ColdMatterOmega0 () const
 
virtual bool HasNcdm () const
 
virtual double SourceSamplingRate (const double *) const
 
virtual int MaxMultipole (const precision *, bool) const
 
virtual bool PrefersExponentialPerturbationEvolver () const
 
virtual bool SupportsExponentialPerturbationEvolver () const
 

Static Public Member Functions

static double WFinal (double n)
 
static double Integral3OnePlusWOverA (double a, double a_c, double nu, double w_i, double w_f)
 
static double OmegaZeroFromOmegaAc (double omega_ac, double a_c, double nu, double w_i, double w_f)
 

Additional Inherited Members

- Public Types inherited from BaseSpecies
enum class  EnergyType
 
- Protected Member Functions inherited from BaseSpecies
void ApplyFluidLikeNewtonianShift (double *y, int idx_delta, int idx_theta, const double *pvecback, const PerturbIcContext &ctx) const
 

Detailed Description

Pheno-axion early-dark-energy fluid (AxiCLASS's ede_parametrization = pheno_axion; Poulin et al. 1806.10608, 1811.04083, 1905.12618). Background: sigmoid equation of state w(a) = w_i + (w_f - w_i)/(1 + (a_c/a)^r), r = 3(w_f - w_i)/nu, with a closed-form density integral. Perturbations: true-fluid delta/theta with the k- and a-dependent GDM effective sound speed cs2(k,a) = [2 a^2 (n-1) wbar^2 + k^2] / [2 a^2 (n+1) wbar^2 + k^2], wbar(a) = omega_axion * a^(-3(n-1)/(n+1)), where omega_axion is derived from (a_c, Omega_fld_ac, Theta_i, n) at SetBackgroundModule time (needs the full species budget for E(a_c)). PPF does not apply (w > -1 for all a > 0, and the GDM cs2 must enter the true fluid equations), so this class is always built as a non-PPF fluid.

Member Function Documentation

◆ WFinal()

double AxionEDEFluid::WFinal ( double  n)
static

w_f = (n-1)/(n+1).

◆ Integral3OnePlusWOverA()

double AxionEDEFluid::Integral3OnePlusWOverA ( double  a,
double  a_c,
double  nu,
double  w_i,
double  w_f 
)
static

int_a^1 da' 3(1+w(a'))/a' for the sigmoid w(a). Overflow-safe (log1p form).

◆ OmegaZeroFromOmegaAc()

double AxionEDEFluid::OmegaZeroFromOmegaAc ( double  omega_ac,
double  a_c,
double  nu,
double  w_i,
double  w_f 
)
static

Omega0_fld from Omega_fld_ac = rho_fld(a_c)/rho_crit0 (and inverse).

◆ ComputeWFld()

void AxionEDEFluid::ComputeWFld ( double  a,
double *  w_fld,
double *  dw_over_da_fld,
double *  integral_fld 
) const
overridevirtual

Fluid equation-of-state evaluation. Owns w_fld(a), dw_fld/da(a), and the analytic integral used by background initial conditions. Implementation moved here from BackgroundModule::background_w_fld because this is pure fluid physics.

  • first, define the function w(a)
  • then, give the corresponding analytic derivative dw/da (used by perturbation equations; we could compute it numerically, but with a loss of precision; as long as there is a simple analytic expression of the derivative of the previous function, let's use it!
  • finally, give the analytic solution of the following integral: $ \int_{a}^{a0} da 3(1+w_{fld})/a $. This is used in only one place, in the initial conditions for the background, and with a=a_ini. If your w(a) does not lead to a simple analytic solution of this integral, no worry: instead of writing something here, the best would then be to leave it equal to zero, and then in background_initial_conditions() you should implement a numerical calculation of this integral only for a=a_ini, using for instance Romberg integration. It should be fast, simple, and accurate enough.

note: of course you can generalise these formulas to anything, defining new parameters pba->w..._fld. Neither recombination code constrains the form: both read the true background.

Reimplemented from FluidSpecies.

◆ Cs2()

double AxionEDEFluid::Cs2 ( double  ,
double   
) const
overridevirtual

Effective sound speed in the fluid rest frame, cs2(k^2, a). The base fluid uses the constant input cs2_fld; AxionEDEFluid overrides with the k- and a-dependent GDM formula. Takes k^2 to avoid a sqrt in PerturbDerivs.

Reimplemented from FluidSpecies.

◆ ReachesPhantomDivide()

bool AxionEDEFluid::ReachesPhantomDivide ( ) const
inlineoverridevirtual

True iff w(a) reaches or crosses -1 between the infinite past and today, which would make the true-fluid delta/theta equations divide by 1+w. The base fluid answers with the historical endpoint test (w at a=0 and a=1, product of (1+w) factors <= 0 — this includes exact contact at -1, which for CLP-style w(a) does reach the divide). AxionEDEFluid overrides: its sigmoid satisfies w > -1 strictly for every a > 0, so the a=0 asymptote at exactly -1 is not a crossing.

Reimplemented from FluidSpecies.

◆ ApplyInitialConditions()

void AxionEDEFluid::ApplyInitialConditions ( const BaseSpecies::PerturbLayout &  ,
double *  ,
const PerturbIcContext &   
)
overridevirtual

Write synchronous-gauge initial conditions for this species into y[]. y[] == ppw->pv->y. The module pre-computes ctx.delta_g_ic, ctx.delta_ur, etc. Guard each IC type: if (ctx.index_ic == ctx.p_mod->index_ic_ad_) { ... } Newtonian gauge transformation is handled by the module after this loop. Default: no-op.

Reimplemented from BaseSpecies.

◆ SetBackgroundModule()

void AxionEDEFluid::SetBackgroundModule ( const BackgroundModule *  )
overridevirtual

Called by BackgroundModule after construction to provide access to its indices (index_bg_a_, index_bg_H_, etc.) and background state. Species that need it override this; default is no-op.

Reimplemented from BaseSpecies.

◆ GetParam()

std::optional< double > AxionEDEFluid::GetParam ( const std::string &  name) const
overridevirtual

Derived diagnostics, reached from the Python wrapper as "Fluid.<name>" (BackgroundModule::GetSpeciesParam): the input transition scale "a_c" and exponent "n_axion", and the scales DeriveAxionScales reconstructs from them – "m_fld" (axion mass in units of H0), "alpha_fld" (decay constant, reduced-Planck units) and "omega_axion" (oscillation frequency today, 1/Mpc; the quantity the GDM sound speed is built from). The peak EDE fraction and its location are NOT here: they follow from the background table alone and every species answers them generically ("Fluid.f_peak", "Fluid.a_peak", "Fluid.z_peak").

Reimplemented from BaseSpecies.

◆ SetOmegaAxionForTest()

void AxionEDEFluid::SetOmegaAxionForTest ( double  omega_axion)
inline

Unit-test hook: Cs2 needs omega_axion_, normally derived in SetBackgroundModule.


The documentation for this class was generated from the following files: