How lesgourg/class_public works
CLASS is a cosmological Boltzmann solver. Its principal workflow takes cosmological and precision parameters, computes the expansion and thermal history, evolves perturbations, and produces primordial, transfer, and observable spectra for output. The repository also includes nonlinear-spectrum prescriptions, spectral distortions, recombination and energy-injection implementations, a C++ engine, and a plotting utility. The README documents the solver and plotting capability; several connections among runtime stages are not visible in the sampled excerpts, so those links are marked unverified rather than asserted as source-confirmed calls.
Main entry points: thermodynamics.c Thermal history · fourier.c Fourier spectra · perturbations.c Perturbation evolution · class.c CLASS runner
Components 22
Inputs and orchestration
- Input parser
tools/parser.c - Parameter setup
source/input.c - CLASS runner
main/class.c
Cosmological evolution
- Background evolution
source/background.c - Thermal history
source/thermodynamics.c - Perturbation evolution
source/perturbations.c
Spectra and observables
- Primordial spectra
source/primordial.c - Transfer functions
source/transfer.c - Fourier spectra
source/fourier.c - Lensing
source/lensing.c
Physics extensions
- HyRec recombination
external/HyRec2020/history.c - RECFAST wrapper
external/RecfastCLASS/wrap_recfast.c - Energy injection
external/heating/injection.c - HMcode nonlinear
external/HMcode/hmcode.c - Halofit nonlinear
external/Halofit/halofit.c - Spectral distortions
source/distortions.c
Interfaces and output
- Results output
source/output.c - C++ engine
cpp/ClassEngine.cc - CLASS plotter
CPU.py
Other components
- Researcher
- Parameter files
- Output files
Connections 24
- Researcher → Parameter files: sets parameters
- Parameter files → Input parser: provides input
- Input parser → Parameter setup: parses values
source/input.c - Parameter setup → CLASS runner: configures run
- CLASS runner → Background evolution: runs solver
- Background evolution → Thermal history: feeds history
- Thermal history → HyRec recombination: uses recombination
- Thermal history → RECFAST wrapper: uses recombination
- Thermal history → Energy injection: uses injection
- Thermal history → Perturbation evolution: supplies history
- Background evolution → Perturbation evolution: supplies expansion
- Perturbation evolution → Primordial spectra: supplies perturbations
- Primordial spectra → Transfer functions: feeds spectra
- Transfer functions → Fourier spectra: feeds spectra
- Fourier spectra → HMcode nonlinear: provides linear spectra
external/HMcode/hmcode.c - Fourier spectra → Halofit nonlinear: provides linear spectra
external/Halofit/halofit.c - Fourier spectra → Lensing: feeds lensing
- Perturbation evolution → Spectral distortions: feeds distortions
- CLASS runner → Results output: writes results
- Researcher → C++ engine: requests calculations
- C++ engine → Lensing: queries spectra
cpp/ClassEngine.cc - Researcher → CLASS plotter: selects results
- Results output → Output files: writes files
- Output files → CLASS plotter: plots results