CLASSpp Manual
Cosmology reference and developer manual
Loading...
Searching...
No Matches
cosmology.h
1#ifndef COSMOLOGY_H
2#define COSMOLOGY_H
3
4#include <memory>
5
6#include "bessel_table_cache.h"
7#include "input_module.h"
8
9class Cosmology {
10 public:
13 Cosmology(FileContent& fc, std::shared_ptr<BesselTableCache> bessel_cache = nullptr)
14 : input_module_ptr_(InputModulePtr(new InputModule(fc))),
15 bessel_cache_(bessel_cache ? std::move(bessel_cache)
16 : std::make_shared<BesselTableCache>()) {
17 InputModule::RejectUnreadParameters(fc);
18 }
19 Cosmology(std::unique_ptr<InputModule> input_module)
20 : input_module_ptr_(std::move(input_module)),
21 bessel_cache_(std::make_shared<BesselTableCache>()) {}
22
23 InputModulePtr& GetInputModule();
24 BackgroundModulePtr& GetBackgroundModule();
25 ThermodynamicsModulePtr& GetThermodynamicsModule();
26 PerturbationsModulePtr& GetPerturbationsModule();
27 PrimordialModulePtr& GetPrimordialModule();
28 NonlinearModulePtr& GetNonlinearModule();
29 TransferModulePtr& GetTransferModule();
30 SpectraModulePtr& GetSpectraModule();
31 LensingModulePtr& GetLensingModule();
32
33 private:
34 bool shot_ = false; // GetInputModule runs DoShooting once, on first use
35 InputModulePtr input_module_ptr_;
36 BackgroundModulePtr background_module_ptr_;
37 ThermodynamicsModulePtr thermodynamics_module_ptr_;
38 PerturbationsModulePtr perturbations_module_ptr_;
39 PrimordialModulePtr primordial_module_ptr_;
40 NonlinearModulePtr nonlinear_module_ptr_;
41 TransferModulePtr transfer_module_ptr_;
42 SpectraModulePtr spectra_module_ptr_;
43 LensingModulePtr lensing_module_ptr_;
44 std::shared_ptr<BesselTableCache> bessel_cache_;
45};
46#endif //COSMOLOGY_H
Definition bessel_table_cache.h:26
Definition parser.h:23