CLASSpp Manual
Cosmology reference and developer manual
Loading...
Searching...
No Matches
input_module.h
Go to the documentation of this file.
1
3#ifndef __INPUT__
4#define __INPUT__
5
6#include <memory>
7#include <string>
8#include <vector>
9
10#include "../species/base_species.h"
11#include "../species/species_build_context.h"
12#include "../species/species_collection.h"
13#include "background.h"
14#include "common.h"
15#include "lensing.h"
16#include "nonlinear.h"
17#include "output.h"
18#include "parser.h"
19#include "perturbations.h"
20#include "primordial.h"
21#include "quadrature.h"
22#include "spectra.h"
23#include "thermodynamics.h"
24#include "transfer.h"
25
26class InputModule {
27 public:
28 InputModule(FileContent& fc);
29 static void file_content_from_arguments(int argc, char** argv, FileContent& fc);
30
34 static InputModulePtr DoShooting(InputModulePtr input_module);
35
36 FileContent& file_content_;
37 precision precision_;
38 background background_;
39 thermo thermodynamics_;
40 perturbs perturbations_;
41 transfers transfers_;
42 primordial primordial_;
43 spectra spectra_;
44 nonlinear nonlinear_;
45 lensing lensing_;
46 output output_;
48 SpeciesCollection all_species_;
52 SpeciesOmegaBudget omega_budget_;
56 CoupledClusterInputs coupled_inputs_;
57
58 private:
59 // Hook-based shooting (used by DoShooting). theta_s is identified by
60 // target_name == "100*theta_s" / unknown_param == "h"; all targets are scalar.
61 struct ShootingWorkspace {
62 explicit ShootingWorkspace(FileContent& fc_ref) : fc(fc_ref) {}
63 FileContent& fc;
64 std::vector<ShootingTarget> targets; // theta_s first (if present), then species in lex order
65 // Parallel to targets: the all_species_ key owning each target ("" for the module-level
66 // theta_s). Lets ShootingResidual route each slot to its species' ComputeShootingResidual
67 // with the authoritative target (so the species never re-derives it from the file content).
68 std::vector<std::string> target_species_keys;
69 };
70 static void ShootingResidual(double* x, int x_size, void* pworkspace, double* output);
71
72 void ConstructSpecies();
73
82 void ReadCoupledCluster();
83
84 void ReadContext(); // phase i: inputs needed to build species
85 void ReadDerived(); // phase iii: everything else + species-dependent reads
86 void WriteParameterFiles(); // read/unread parameter dump (runs after ReadDerived)
87 void input_read_precisions();
88};
89
90#endif
Definition parser.h:21
Definition species_collection.h:33
Definition lensing.h:15
Definition nonlinear.h:49
Definition output.h:24
Definition perturbations.h:100
Definition primordial.h:56
Definition spectra.h:15
Definition species_build_context.h:45
Definition species_build_context.h:30
Definition precision.h:63
Definition thermodynamics.h:59
Definition transfer.h:63