|
| bool | HasNcdm () const override |
| |
| double | KappaStoredToBare () const |
| |
| void | SetBackgroundModule (const BackgroundModule *bgm) override |
| |
| void | BackgroundDerivs (double tau, const double *y, double *dy, const double *pvecback) override |
| |
| void | BackgroundDerivsDiagonal (double tau, const double *y, double *diag, const double *pvecback) override |
| |
| void | ApplyKernelBackgroundDerivs (double a, const double *y, double *dy, double a_prime_over_a=0.) |
| |
| void | WriteBackgroundColumnTitles (BackgroundColumnWriter &w) const override |
| |
| void | WriteBackgroundData (const double *pvecback, BackgroundColumnWriter &w) const override |
| |
| void | AddCouplingDerivs (double tau, const double *y, double *dy, const perturb_parameters_and_workspace &ppaw) const override |
| |
| void | ApplyKernelPerturbDerivs (double a, int l_max_col, const double *pvecback, const NCDMBaseSpecies::PerturbLayout &p_lay, const NCDMBaseSpecies::PerturbLayout &f_lay, const NCDMBaseSpecies::PerturbLayout &b_lay, const double *y, double *dy, Scratch &scratch, double k=0.) const |
| |
| void | ApplyKernelPerturbDiagonal (double a, int l_max_col, const double *pvecback, const NCDMBaseSpecies::PerturbLayout &p_lay, const NCDMBaseSpecies::PerturbLayout &f_lay, const NCDMBaseSpecies::PerturbLayout &b_lay, double *diag, Scratch &scratch) const |
| |
| void | PerturbDerivsDiagonal (const BaseSpecies::PerturbLayout &layout, double tau, const double *y, double *diag, const perturb_parameters_and_workspace &ppaw) const override |
| |
| void | ProcessBackgroundTable (const double *background_table, int n_rows, int row_stride, const double *z_table) override |
| |
| void | set_reduced_moments (int n) |
| |
| bool | reduced () const |
| |
| void | set_table_max_dlna (double dlna) |
| |
| bool | tabulated () const |
| |
| void | PrintVariables (PerturbColumnWriter &writer, const BaseSpecies::PerturbLayout *base, double tau, const double *y, const PerturbationsModule &mod, const perturb_workspace *ppw) const override |
| |
| const std::vector< double > & | KernelDfBgH (const Scratch &scratch) const |
| |
| DecayTransitionKernel::Moments | ConservationMoments (double a, const double *dy) const |
| |
| double | ClampedEnergyResidual () const |
| |
| double | SplitEnergyResidual () const |
| |
| double | SplitEnergyResidualPert (const Scratch &scratch) const |
| |
| double | ClampedEnergyResidualPert (const Scratch &scratch) const |
| |
| double | GetOmega0 () const override |
| |
| std::unique_ptr< BaseSpecies::PerturbLayout > | CreatePerturbLayout () const override |
| |
| void | ApplyInitialConditions (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 | 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 | WriteOutputColumns (PerturbColumnWriter &writer, const PerturbationsModule &mod, file_format fmt, TransferColumnSection section=TransferColumnSection::all) const 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 |
| |
| void | RegisterBackgroundIndices (int &index_bg) override |
| |
| void | RegisterIntegrationIndices (int &index_bi) override |
| |
| void | RegisterTransferSourceIndices (int &index_tp, const SourceRequestContext &ctx) override |
| |
| void | AppendBudgetLines (const double *pvecback_today, double rho_crit, std::vector< BudgetLine > &out) const |
| |
| bool | SupportsExplicitPerturbationEvolver () const override |
| |
| int | MaxMultipole (const precision *ppr, bool tensors) const override |
| |
| bool | PrefersExponentialPerturbationEvolver () const override |
| |
| bool | SupportsExponentialPerturbationEvolver () const override |
| |
| double | GetRadiationOmega0 () const override |
| |
| double | DarkRadiationRhoToday (const double *pvecback_integration) const override |
| |
| double | NeutrinoOmega0 () const override |
| |
| double | NeffContribution (double z) const override |
| |
| void | PrintNeffInfo () const override |
| |
| void | PrintMassInfo () const override |
| |
| void | PrintBackgroundDetails (const double *pvecback_today, double rho_crit_today) const override |
| |
| double | TensorMasslessRelativisticRho (const double *pvecback) const override |
| |
| double | DeviationFromRadiation (const double *pvecback) const override |
| |
| void | WarnIfNonlinearUnreliable (double m_ev_threshold) const override |
| |
| std::vector< double > | FreeStreamingWavenumbers () const override |
| |
| std::optional< double > | ChildOmega0 (const std::string &name) const override |
| |
| double | BackgroundAIni (double a_proposed, double tol) const override |
| |
| void | SetThermodynamicsModule (const ThermodynamicsModule *thm) override |
| |
| void | SetPerturbs (const perturbs *ppt) override |
| |
| void | SetBackgroundInitialConditions (const BackgroundICContext &ctx) override |
| |
| void | ComputeBackground (double a, const double *pvecback_B, double *pvecback) override |
| |
| void | FinalizeBackground (double a, double H, 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 |
| |
| double | FreestreamingRho (const double *pvecback) const override |
| |
| bool | ClustersAsMatter () const override |
| |
| bool | IsColdMatterSpecies () const override |
| |
| bool | HasWarmMatter () const override |
| |
| double | NonClusteringOmega0 () const override |
| |
| double | ColdMatterRho (const double *pvecback) const override |
| |
| double | ColdMatterOmega0 () const override |
| |
| void | FinalizeMatterClassification () override |
| |
| virtual std::optional< double > | GetParam (const std::string &) const |
| |
| virtual bool | IsFreestreaming () const |
| |
| bool | IsPresent () const |
| |
| int | bg_rho_index () 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 |
| |
| bool | ClustersAsMatterCached () const |
| |
| virtual double | SourceSamplingRate (const double *) const |
| |
DNCDMInvSpecies: the ν_H ↔ ν_l + φ composite (arXiv:2011.01502; design §5). Owns a collision-owned parent DNCDMSpecies (ν_H), a fermion DrPsdSpecies (ν_l), a boson DrPsdSpecies (φ), and DecayTransitionKernels that derive all three background derivatives (and the per-ℓ collision operator) from ONE discrete transition network each, so number/energy conservation and detailed balance hold on the grid to machine precision. TWO kernel instances, one per daughter-grid resolution: the background network on the daughters' fine grid, the perturbation network on their coarse dr_bg_refine-subsample. Only the BACKGROUND kernel is a member; the perturbation ones live per-k in Scratch (thread safety). Both read the daughters' background occupations at FULL resolution; only the deposit/hierarchy grid is coarsened (DecayTransitionKernel's ctor doc says why that distinction is not optional).
All three species carry the unnormalized F = δf as their perturbation variable (#386). The parent used to carry the normalized Ψ_H, which divides by an f̄_H that decays without bound and made high-Γ runs unintegrable.
The parent keeps ownership of its PSD (grid, ComputeMomenta, perturbation hierarchy); the composite only supplies its background RHS by writing the kernel source into the parent's f-slots in BackgroundDerivs — the same seam DCDM_WDM_Species uses. With inverse decays OFF the factory builds DNCDM_DR_Species instead, so the decay-only path is untouched.
Children order (the child_layouts contract, #358): kParent=0, kFermion=1, kBoson=2. Synchronous gauge only; no tensors, no fluid approximation for the coupled trio (all guarded at Create). The parent must be a single momentum grid (q_size == q_size_bg), also guarded at Create.
| constexpr double DNCDMInvSpecies::kTableMaxDlnaDefault = 7e-3 |
|
staticconstexpr |
dr_table_max_dlna: largest ln-a step the tabulated operator may be interpolated across. The table owns this; it is NOT back_integration_stepsize, which is what the row spacing used to be and which this species neither owns nor can see.
⚠ THE DEFAULT IS VALIDATED ONLY TO Gamma = 1e9. It is a fixed spacing while the requirement grows with Gamma, so above that it must be set explicitly. Left at the default it does not fail, it degrades: measured C_2^TT against the Gamma-independent 1.481e-10, m = 0.3, six-moment Galerkin –
Gamma 1e9 1e9.5 1e10 1e10.5 1e11 1e11.5 1e12
err -0.1% -0.7% -2.4% -7.9% -30.1% +506% +4e10%
and the run reports nothing, because the identities the kernel asserts are number identities that a mis-interpolated operator still satisfies.
WHY THIS IS AN INPUT AND NOT A LAW IN THE CODE. Deriving it from Gamma internally would be one line, and it is deliberately not done: this model has several knobs whose requirement grows with Gamma (dr_N_q and the daughter grid above all), a cell costs hundreds of core-hours, and a caller who has not been made to think about one of them has not been made to think about the others either. An explicit key also gives the convergence test a handle – halve it and the pair brackets the answer – which a hidden law does not have. Set it from the campaign's own sizing rule, the way dr_N_q already is.
THE MEASURED REQUIREMENT. The operator is interpolated linearly, so its error is O(h^2) in the realised spacing h = dlna_row / n_sub:
err(Gamma, m, n_sub) = A(m) (Gamma/1e11)^1.10 / n_sub^2,
A(0.30 eV) = 0.295, A(0.06 eV) = 0.868
fitted to the n_sub = 1 ladder above and validated against an independent sweep in n_sub at fixed Gamma, which it reproduces to ~30% wherever the error is small enough for the h^2 law to hold at all (0.083% predicted / 0.1% observed at Gamma = 3.16e10, n_sub = 10; 0.295% / 0.3% at 1e11, n_sub = 10; 0.074% / 0.1% at 1e11, n_sub = 20). Since the sub-division drives the realised spacing to this key, the error is err = A(m) (Gamma/1e11)^1.10 (h/h_ref)^2 and a target error eps wants
dr_table_max_dlna = h_ref * sqrt(eps / (A(m) (Gamma/1e11)^1.10)), h_ref = 7.0e-3
⚠ h_ref is the spacing the fit was CALIBRATED at – the realised spacing when n_sub came out 1 on a 7e-3 background grid – and NOT back_integration_stepsize. They are the same number today, and that is a coincidence of this campaign rather than a coupling: the requirement is a property of how fast the operator varies in ln a, so halving back_integration_stepsize should leave this key alone and halve n_sub instead. That decoupling is the reason the key exists; do not put the background's own stepsize back into the sizing rule.
Equivalently n_sub ~ Gamma^0.55, NOT the Gamma^0.60 an earlier estimate quoted – that one read its index off a point already in the runaway, where O(h^2) does not apply. A(m) is two masses and one interpolation, so treat it as calibrated on [0.06, 0.3] eV and nowhere else.
7e-3 is where the answer is converged at LOW Gamma, not merely where it stops moving: at Gamma = 1e6, m = 0.3 the C_2^TT it gives agrees with a 32x finer grid to 7e-5 relative. The cell that needs even that is the fastest-varying one, Gamma = 1e9 / m = 0.06, which reads max|phi| = 101 against 0.4734 correct when the table simply inherits the 0.07 default and 0.4734 once it sub-divides to this.