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
 
bool HyrecCplApproximation (double *, double *) const override
 
void ApplyInitialConditions (const BaseSpecies::PerturbLayout &layout, double *y, const PerturbIcContext &ctx) override
 
void SetBackgroundModule (const BackgroundModule *bgm) override
 
void SetOmegaAxionForTest (double omega_axion)
 
- Public Member Functions inherited from FluidSpecies
std::unique_ptr< BaseSpecies::PerturbLayoutCreatePerturbLayout () const override
 
double GetOmega0 () const override
 
void SetBackgroundModule (const BackgroundModule *bgm) override
 
void RegisterBackgroundIndices (int &index_bg) override
 
void RegisterIntegrationIndices (int &index_bi) override
 
void SetBackgroundInitialConditions (const BackgroundICContext &ctx) override
 
void ComputeBackground (double a, const double *pvecback_B, double *pvecback) override
 
void BackgroundDerivs (double tau, const double *y, double *dy, const 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 &layout, double tau, const double *y, double *dy, const perturb_parameters_and_workspace &ppaw) const override
 
void FillSources (const BaseSpecies::PerturbLayout &layout, const double *y, const double *dy, PerturbSourceContext &ctx) const override
 
void ApplyInitialConditions (const BaseSpecies::PerturbLayout &layout, double *y, const PerturbIcContext &ctx) override
 
void PerturbSynchronousToNewtonian (const BaseSpecies::PerturbLayout &layout, double *y, const PerturbIcContext &ctx) override
 
void CopyPerturbationsAcrossSwitch (const BaseSpecies::PerturbLayout &old_layout, const BaseSpecies::PerturbLayout &new_layout, const double *old_y, double *new_y, const PerturbSwitchContext &ctx) const override
 
StressEnergyContribution StressEnergy (const BaseSpecies::PerturbLayout &layout, 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, 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 std::optional< double > GetParam (const std::string &) const
 
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
 
virtual void ProcessBackgroundTable (const double *, int, int, const double *)
 
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 WriteTensorOutputColumnTitles (std::string &) const
 
virtual void ContributeTensorGwSource (const PerturbLayout &, double, const double *, perturb_workspace *) const
 
virtual double RhoDotOverRho (const double *pvecback, double a_prime_over_a) const
 
virtual void MarkUsedInSources (const PerturbLayout &, const perturb_workspace *, int *) 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 double TensorMasslessRelativisticRho (const double *) const
 
virtual void CheckUltraRelativisticAtIc (const double *, double) const
 
virtual bool IsUltraRelativisticAtIc (const double *, double) const
 
virtual void WarnIfTooHeavyForHalofit (double) 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
 

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. Just remember that so far, HyRec explicitely assumes that w(a)= w0 + wa (1-a/a0); but Recfast does not assume anything

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.

◆ HyrecCplApproximation()

bool AxionEDEFluid::HyrecCplApproximation ( double *  w0,
double *  wa 
) const
inlineoverridevirtual

HyRec reconstructs its internal dark-energy density from a CPL (w0, wa) pair (hyrec/history.c:83). Fill (w0, wa) with this fluid's best CPL representation and return true, or return false when no CPL pair can represent the density history (the caller must then refuse to run HyRec). Base fluid: tangent at a = 1, w0 = w(1), wa = -dw/da(1) — exactly the historical behavior.

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.

◆ 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: