CLASSpp Manual
Cosmology reference and developer manual
Loading...
Searching...
No Matches
DNCDMInvSpecies::Scratch Struct Reference

#include <dncdm_inv_species.h>

+ Inheritance diagram for DNCDMInvSpecies::Scratch:

Data Fields

std::vector< double > dy_coll
 
std::vector< double > diag_H_pt
 
std::vector< double > FH_all
 
std::vector< double > red_m
 
std::vector< double > red_z
 

Detailed Description

Per-k working memory (BaseSpecies::PerturbScratch). Holds this composite's own perturbation kernel and the contiguous F/dF gather buffers.

The kernel is here, not shared, because DecayTransitionKernel is stateful by design: PrepareTransitions caches the whole transition geometry for one (a, f-bar) and ApplyPerturbationOperator advances a rolling per-node Legendre pair, which is what makes the caller's l-loop O(L) instead of O(L^2). All of that is per (k, tau). Two threads sharing one kernel corrupt each other's recurrence — observed as the strict-ascending-l contract firing with "expected l=3, got l=0", which is the assertion doing its job.

A kernel costs a few small vectors and one Gauss-Legendre setup to build, and it holds only non-owning GridViews into the species' grids, so one per k-mode is nothing next to a k-mode integration.

Field Documentation

◆ dy_coll

std::vector<double> DNCDMInvSpecies::Scratch::dy_coll

Collision-only dy, for the transport-rate diagnostic in PrintVariables. Sized lazily to pv->pt_size (the layout is not known at CreatePerturbScratch time) and used ONLY at k_output_values sampling points, never on the RHS.

◆ diag_H_pt

std::vector<double> DNCDMInvSpecies::Scratch::diag_H_pt

Per-bin Jacobian diagonals for the perturbation leg. Separate from the members BackgroundDerivsDiagonal uses: the background is single-threaded, the perturbations are not, and one k-mode must not see another's. Sized on the PERTURBATION grids, which is what kernel_pt's CollisionDiagonal writes.

◆ FH_all

std::vector<double> DNCDMInvSpecies::Scratch::FH_all

[bin][l] gather/scatter buffers for the all-l kernel sweep, l contiguous within a bin. Sized lazily on first use like dy_coll, because the multipole count is a layout property not known at CreatePerturbScratch time.

◆ red_m

std::vector<double> DNCDMInvSpecies::Scratch::red_m

Reduced-representation scratch: one moment vector and one grid-sized buffer for the reconstruct/project round trip. Per-workspace like everything else here — the k-loop is threaded and these are written on the RHS.

◆ red_z

std::vector<double> DNCDMInvSpecies::Scratch::red_z

Tabulated path: the S-vector the mat-vec reads and the one it writes.


The documentation for this struct was generated from the following file: