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

#include <ppf_fluid.h>

+ Inheritance diagram for PpfFluid:

Public Member Functions

std::unique_ptr< BaseSpecies::PerturbLayout > CreatePerturbLayout () const 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 &layout, const double *y, const double *dy, PerturbSourceContext &ctx) const override
 
void PrintVariables (PerturbColumnWriter &writer, const BaseSpecies::PerturbLayout *base, double tau, const double *y, const PerturbationsModule &mod, const perturb_workspace *ppw) const 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
 
void ComputePpf (double k, double a, double a_prime_over_a, const precision *ppr, const double *y, perturb_workspace *ppw) const
 
- Public Member Functions inherited from FluidSpecies
bool SupportsExplicitPerturbationEvolver () 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
 
virtual void ComputeWFld (double a, double *w_fld, double *dw_over_da_fld, double *integral_fld) const
 
virtual double Cs2 (double, double) const
 
virtual bool ReachesPhantomDivide () const
 
void RegisterTransferSourceIndices (int &index_tp, const SourceRequestContext &ctx) 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
 
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
 
- 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 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
 

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

PPF (Parametrised Post-Friedmann) dark-energy fluid. Same background as FluidSpecies; the perturbations use the Gamma closure (Hu 0808.3125) instead of delta/theta. At most one PPF fluid may exist (PPF is defined relative to the whole universe).

Member Function Documentation

◆ CreatePerturbLayout()

std::unique_ptr< BaseSpecies::PerturbLayout > PpfFluid::CreatePerturbLayout ( ) const
inlineoverridevirtual

Produce a fresh layout for this species. Called once per pv during perturb_vector_init, before Register*PerturbationIndices. Default: empty base PerturbLayout (suitable for species with no perturbation slots, or as a placeholder during migration).

Reimplemented from FluidSpecies.

◆ PerturbDerivs()

void PpfFluid::PerturbDerivs ( const BaseSpecies::PerturbLayout &  layout,
double  tau,
const double *  y,
double *  dy,
const perturb_parameters_and_workspace &  ppaw 
) const
overridevirtual

Contribute to dy for the scalar perturbation ODE at conformal time tau. The PerturbScalarContext inside ppaw->ppw has pre-computed metric terms, cross-species state (delta_g, theta_g, theta_b, ...), and approximation flags. The layout is this species' PerturbLayout slot (ppw->pv->species_layouts[i]); composites receive their own layout and pass nested sub-layouts to children.

Reimplemented from FluidSpecies.

◆ FillSources()

void PpfFluid::FillSources ( const BaseSpecies::PerturbLayout &  ,
const double *  ,
const double *  ,
PerturbSourceContext &   
) const
overridevirtual

Write per-k, per-tau source values for this species into the source table. Called in perturb_sources() after metric/temperature sources are set. Use ctx.p_mod->SetSourceValue(ctx.index_md, ctx.index_ic, ctx.p_mod->index_tp_XXX_, ctx.index_tau, ctx.index_k, value). All addressing (index_md, index_ic, index_k, index_tau) is in ctx. Default: no-op.

Reimplemented from FluidSpecies.

◆ PrintVariables()

void PpfFluid::PrintVariables ( PerturbColumnWriter &  ,
const BaseSpecies::PerturbLayout *  ,
double  ,
const double *  ,
const PerturbationsModule &  ,
const perturb_workspace *   
) const
overridevirtual

Append this species' time-evolution variables to writer. Called from perturb_prepare_k_output (title mode, tau=0/y=nullptr/ppw=nullptr) and perturb_print_variables (data mode). Guard computation behind: if (!writer.IsTitleMode()) { ... compute ... } Use writer.Add(title, computed_value, active).

layout is NULL in title mode (there is no perturb_vector yet) and is the species' own sub-layout otherwise — passed in rather than resolved from collection_index_ so that CompositeSpecies can chain this to children, which are not registered in the collection and have no valid collection_index_.

Reimplemented from FluidSpecies.

◆ CopyPerturbationsAcrossSwitch()

void PpfFluid::CopyPerturbationsAcrossSwitch ( const BaseSpecies::PerturbLayout &  ,
const BaseSpecies::PerturbLayout &  ,
const double *  ,
double *  ,
const PerturbSwitchContext &   
) const
overridevirtual

Copy perturbation state from one layout to another across an approximation switch. Called when the perturbation vector is reallocated (e.g., NCDM FA collapse from full Boltzmann hierarchy to fluid variables delta/theta/shear). Default: no-op. Most species have no approximation switches.

Reimplemented from FluidSpecies.

◆ ComputePpf()

void PpfFluid::ComputePpf ( double  k,
double  a,
double  a_prime_over_a,
const precision *  ppr,
const double *  y,
perturb_workspace *  ppw 
) const

The equation is too stiff for Runge-Kutta when c_gamma_k_H_square is large. Use the asymptotic solution Gamma=Gamma'=0 in that case.

We must now check the stiffenss criterion again and set Gamma_prime_fld accordingly.

Now construct the pressure perturbation, see 1903.xxxxx.

Construct energy density and pressure for DE (_fld) and the rest (_t). Also compute derivatives.

Compute background quantities X,Y,Z and their derivatives.

Construct theta_t and its derivative from the Euler equation

Analytic derivative of the equation for ppw->rho_plus_p_theta_fld above.

We can finally compute the pressure perturbation using the Euler equation for theta_fld


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