|
CLASSpp Manual
Cosmology reference and developer manual
|
#include <dncdm_species.h>
Inheritance diagram for DNCDMSpecies:Public Member Functions | |
| bool | InitialAbundanceMode () const |
| void | BackfillOmega0FromToday (const double *pvecback_today, double H0, double h) |
| 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 *, const double *pvecback) const override |
| void | PerturbDerivs (const BaseSpecies::PerturbLayout &layout, double tau, const double *y, double *dy, const perturb_parameters_and_workspace &ppaw) const override |
| void | ApplyInitialConditions (const BaseSpecies::PerturbLayout &layout, double *y, const PerturbIcContext &ctx) override |
| StressEnergyContribution | StressEnergy (const BaseSpecies::PerturbLayout &layout, const perturb_vector *pv, const double *y, const double *pvecback, const perturb_workspace *ppw) const override |
| bool | IsFreestreaming () const override |
| void | WriteBackgroundColumnTitles (BackgroundColumnWriter &w) const override |
| void | WriteBackgroundData (const double *pvecback, BackgroundColumnWriter &w) const override |
| std::tuple< double, double, double > | RescaledPerturbations (const NCDMBaseSpecies::PerturbLayout &layout, double a, double k, const perturb_workspace *ppw) const |
Public Member Functions inherited from NCDMBaseSpecies | |
| std::unique_ptr< BaseSpecies::PerturbLayout > | CreatePerturbLayout () const override |
| double | GetOmega0 () const override |
| bool | ClustersAsMatter () const override |
| bool | IsColdMatterSpecies () const override |
| double | BackgroundAIni (double a_proposed, double tol) const override |
| void | PrintNeffInfo () const override |
| void | PrintMassInfo () const override |
| double | NeutrinoOmega0 () const override |
| double | NeffContribution (double z) const override |
| double | TensorMasslessRelativisticRho (const double *pvecback) const override |
| void | CheckUltraRelativisticAtIc (const double *pvecback, double tol) const override |
| bool | IsUltraRelativisticAtIc (const double *pvecback, double tol) const override |
| void | WarnIfTooHeavyForHalofit (double m_ev_threshold) const override |
| void | SetBackgroundModule (const BackgroundModule *bgm) override |
| void | SetPerturbs (const perturbs *ppt) override |
| void | RegisterTransferSourceIndices (int &index_tp, const SourceRequestContext &ctx) override |
| void | PerturbTensorDerivs (const BaseSpecies::PerturbLayout &layout, double tau, const double *y, double *dy, const perturb_parameters_and_workspace &ppaw) const override |
| void | ContributeTensorGwSource (const BaseSpecies::PerturbLayout &layout, double a, const double *y, perturb_workspace *ppw) const override |
| void | MarkUsedInSources (const BaseSpecies::PerturbLayout &layout, const perturb_workspace *ppw, int *used_in_sources) const 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 |
Public Member Functions inherited from BaseSpecies | |
| virtual void | SetThermodynamicsModule (const ThermodynamicsModule *) |
| virtual std::optional< double > | GetParam (const std::string &) const |
| virtual void | FinalizeBackground (double a, double H, const double *pvecback_B, double *pvecback) |
| 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 | WriteTensorOutputColumnTitles (std::string &) const |
| virtual void | WriteOutputColumns (PerturbColumnWriter &, const PerturbationsModule &, file_format, TransferColumnSection=TransferColumnSection::all) const |
| virtual void | PrintVariables (PerturbColumnWriter &, double, const double *, const PerturbationsModule &, const perturb_workspace *) const |
| virtual void | FillSources (const PerturbLayout &, const double *, const double *, PerturbSourceContext &) const |
| virtual double | RhoDotOverRho (const double *pvecback, double a_prime_over_a) const |
| virtual double | GetRadiationOmega0 () const |
| virtual double | DarkRadiationRhoToday (const double *) const |
| bool | ClustersAsMatterCached () const |
| virtual void | FinalizeMatterClassification () |
| virtual bool | HasWarmMatter () const |
Protected Member Functions | |
| double | GetDlnf0Dlnq (int iq, const double *pvecback) const override |
| double | GetW0ForGwSource (int iq, const double *pvecback) const override |
Protected Member Functions inherited from NCDMBaseSpecies | |
| virtual double | EvaluatePsdAnalytic (double q) const |
| virtual quadrature_method | DefaultQuadratureStrategy () const |
| virtual void | FillQuadratureParams (GBQuadParams &) const |
| void | BuildQuadratureAndMass (const NcdmSettings &settings) |
Protected Member Functions inherited from BaseSpecies | |
| void | ApplyFluidLikeNewtonianShift (double *y, int idx_delta, int idx_theta, const double *pvecback, const PerturbIcContext &ctx) const |
Additional Inherited Members | |
Public Types inherited from BaseSpecies | |
| enum class | EnergyType |
Decaying Non-Cold Dark Matter (DNCDM). Inherits NCDMBaseSpecies; owns per-species quadrature, distribution function, Gamma decay rate, and dq volume elements absorbed from DecayDRProperties.
|
inline |
True iff this flavor is normalized by initial abundance (Omega_ini/omega_ini/Neff_ini) — the mode that needs the Omega_dncdmdr fixed-point shoot for closure (vs combined mode, which shoots deg).
|
inline |
Backfill this species' today density fraction Omega0_ from its integrated density at a=1. In combined/initial modes the matter child is normalized via deg, never SetOmega0, so GetOmega0() stays 0 — which drops it from fnu (GetOmega0NcdmTot) and the budget-print neutrino line. BackgroundModule calls this post-integration. (SetOmega0 is protected; this public wrapper lets the module trigger the backfill.)
|
overridevirtual |
Claim consecutive slots in pvecback. Called once during background_indices(). Implementation must assign index_bg_rho_ (and any other needed indices) and increment index_bg accordingly.
Implements BaseSpecies.
|
overridevirtual |
Claim slots in the ODE integration vector y. Called during background_indices(). Default: no integrated variables (analytic species do not need this).
Reimplemented from BaseSpecies.
|
overridevirtual |
Set initial conditions for ODE-integrated background variables.
| ctx | Background initial-condition context (a_ini, rho_rad, and the integration vector to fill). |
Reimplemented from BaseSpecies.
|
overridevirtual |
Compute species background quantities at scale factor a. pvecback_B is the current ODE integration vector. Write density (and any other owned quantities) into pvecback.
Implements BaseSpecies.
|
overridevirtual |
Contribute to dy/dtau for species with ODE-integrated background variables. pvecback already contains all evaluated background quantities. Default: nothing (species with analytic rho(a) don't override this).
Reimplemented from BaseSpecies.
|
inlineoverridevirtual |
Energy density at current background state.
Implements BaseSpecies.
|
inlineoverridevirtual |
Pressure at current background state.
Implements BaseSpecies.
|
inlineoverridevirtual |
Post-Friedmann. This species' conformal-time pressure derivative p' (a' / a = a*H). pvecback_B is the ODE state (IN); pvecback is fully populated through H. Default 0 (matter / Lambda).
Reimplemented from BaseSpecies.
|
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.
Implements BaseSpecies.
|
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.
|
overridevirtual |
Fused override: one RescaledPerturbations call for delta/theta/shear; DeltaP uses its own independent loop (different weights), matching the individual methods' per-term expressions and operand order exactly.
Implements BaseSpecies.
|
inlineoverridevirtual |
True for species that are free-streaming and massless at IC time (deep radiation domination). Used to accumulate rho_nu / fracnu in perturbation IC setup. Static at construction time. Default: false.
Reimplemented from BaseSpecies.
|
overridevirtual |
Write this species' background column titles into writer. Called by BackgroundModule::background_output_titles(). Default: no-op (species with no background output need not override).
Reimplemented from BaseSpecies.
|
overridevirtual |
Write this species' background data values into writer. pvecback is the full background vector at the current time step. Called by BackgroundModule::background_output_data(). Default: no-op.
Reimplemented from BaseSpecies.
| std::tuple< double, double, double > DNCDMSpecies::RescaledPerturbations | ( | const NCDMBaseSpecies::PerturbLayout & | layout, |
| double | a, | ||
| double | k, | ||
| const perturb_workspace * | ppw | ||
| ) | const |
Returns rescaled (delta, theta, shear) for this decaying NCDM flavor. Rescaling subtracts a common lnN from every lnf to prevent exp(lnf) underflow near the precision floor; lnN cancels in the delta/theta/shear ratios, so this is mathematically equivalent to the unrescaled form but numerically stable.
| layout | this species' per-pv NCDM layout (provides index_per_q). |
| a | Scale factor at the current integration time. |
| k | Fourier wavenumber of the perturbation mode. |
| ppw | Perturbation workspace holding the current phase-space state. |
|
inlineoverrideprotectedvirtual |
Return d ln f_0 / d ln q for momentum bin iq. NCDMSpecies reads a static table; DNCDMSpecies reads pvecback. Used by PerturbTensorDerivs.
Implements NCDMBaseSpecies.
|
inlineoverrideprotectedvirtual |
Return the quadrature weight w_0[iq] for the GW source integral. NCDMBaseSpecies returns the static w_[iq]; DNCDMSpecies overrides.
Reimplemented from NCDMBaseSpecies.