9 #define _N_FILEROOT_ 100
13 #define class_read_double(name,destination) \
15 double param_temp; int flag_temp; \
16 class_call(parser_read_double(pfc,name,¶m_temp,&flag_temp,errmsg), \
19 if (flag_temp == _TRUE_){ \
20 destination = param_temp; \
25 #define class_read_int(name,destination) \
27 int int_temp,flag_temp; \
28 class_call(parser_read_int(pfc,name,&int_temp,&flag_temp,errmsg), \
31 if (flag_temp == _TRUE_){ \
32 destination = int_temp; \
36 #define class_read_string(name,destination) \
38 char string_temp[_ARGUMENT_LENGTH_MAX_]; int flag_temp; \
39 class_call(parser_read_string(pfc,name,&string_temp,&flag_temp,errmsg), \
42 if (flag_temp == _TRUE_){ \
43 strcpy(destination,string_temp); \
47 #define class_read_flag(name,destination) \
49 char string_temp[_ARGUMENT_LENGTH_MAX_]; int flag_temp; \
50 class_call(parser_read_string(pfc,name,&string_temp,&flag_temp,errmsg), \
53 if (flag_temp == _TRUE_){ \
54 if (string_begins_with(string_temp,'y') \
55 || string_begins_with(string_temp,'Y') ){ \
56 destination = _TRUE_; \
58 else if (string_begins_with(string_temp,'n') \
59 || string_begins_with(string_temp,'N') ){ \
60 destination = _FALSE_; \
63 class_stop(errmsg,"incomprehensible input '%s' for the field '%s'.", \
69 #define class_read_flag_or_deprecated(name,oldname,destination) \
71 char string_temp[_ARGUMENT_LENGTH_MAX_]; int flag_temp; \
72 class_call(parser_read_string(pfc,name,&string_temp,&flag_temp,errmsg), \
76 if (flag_temp == _FALSE_){ \
77 class_call(parser_read_string(pfc,oldname,&string_temp,&flag_temp,errmsg),\
82 if (flag_temp == _TRUE_){ \
83 if (string_begins_with(string_temp,'y') \
84 || string_begins_with(string_temp,'Y') ){ \
85 destination = _TRUE_; \
87 else if (string_begins_with(string_temp,'n') \
88 || string_begins_with(string_temp,'N') ){ \
89 destination = _FALSE_; \
92 class_stop(errmsg,"incomprehensible input '%s' for the field '%s'.", \
98 #define class_read_double_one_of_two(name1,name2,destination) \
100 int flag_temp1,flag_temp2; \
101 double param_temp1,param_temp2; \
102 class_call(parser_read_double(pfc,name1,¶m_temp1,&flag_temp1,errmsg), \
105 class_call(parser_read_double(pfc,name2,¶m_temp2,&flag_temp2,errmsg), \
108 class_test((flag_temp1 == _TRUE_) && (flag_temp2 == _TRUE_), \
110 "You can only enter one of '%s' or '%s'.", \
112 if (flag_temp1 == _TRUE_){ \
113 destination = param_temp1; \
115 if (flag_temp2 == _TRUE_){ \
116 destination = param_temp2; \
120 #define class_at_least_two_of_three(a,b,c) \
121 (((a) == _TRUE_) && ((b) == _TRUE_)) || \
122 (((a) == _TRUE_) && ((c) == _TRUE_)) || \
123 (((b) == _TRUE_) && ((c) == _TRUE_))
125 #define class_none_of_three(a,b,c) \
126 ((a) == _FALSE_) && ((b) == _FALSE_) && ((c) == _FALSE_)
128 #define class_read_list_of_doubles_or_default(name,destination,val_default,siz) \
130 int flag_temp,entries_read_temp; \
131 class_call(parser_read_list_of_doubles(pfc,name, \
132 &entries_read_temp, \
138 if (flag_temp == _TRUE_){ \
139 class_test(entries_read_temp != siz, errmsg, \
140 "Number of entries of '%s' (%d) does not match expected number (%d).", \
141 name, entries_read_temp, siz); \
143 class_alloc(destination,siz*sizeof(double),errmsg); \
144 for (n=0; n<siz; n++){destination[n] = val_default;} \
148 #define class_read_list_of_integers_or_default(name,destination,val_default,siz)\
150 int flag_temp,entries_read_temp; \
151 class_call(parser_read_list_of_integers(pfc,name, \
152 &entries_read_temp, \
158 if (flag_temp == _TRUE_){ \
159 class_test(entries_read_temp != siz, errmsg, \
160 "Number of entries of '%s' (%d) does not match expected number (%d).", \
161 name, entries_read_temp, siz); \
163 class_alloc(destination,siz*sizeof(int),errmsg); \
164 for (n=0; n<siz; n++){destination[n] = val_default;} \
168 #define class_read_list_of_doubles(name,destination,siz) \
170 int flag_temp,entries_read_temp; \
171 class_call(parser_read_list_of_doubles(pfc,name, \
172 &entries_read_temp, \
178 class_test(flag_temp == _FALSE_, errmsg, \
179 "Entry '%s' is required but not found!", name) \
180 class_test(entries_read_temp != siz, errmsg, \
181 "Number of entries of '%s' (%d) does not match expected number (%d).", \
182 name,entries_read_temp, siz); \
185 #define class_read_list_of_integers(name,destination,siz) \
187 int flag_temp,entries_read_temp; \
188 class_call(parser_read_list_of_integers(pfc,name, \
189 &entries_read_temp, \
195 class_test(flag_temp == _FALSE_, errmsg, \
196 "Entry '%s' is required but not found!", name) \
197 class_test(entries_read_temp != siz, errmsg, \
198 "Number of entries of '%s' (%d) does not match expected number (%d).", \
199 name,entries_read_temp, siz); \
206 enum target_names {theta_s, Omega_dcdmdr, omega_dcdmdr, Omega_scf, Omega_ini_dcdm, omega_ini_dcdm, sigma8};
208 #define _NUM_TARGETS_ 6
210 enum computation_stage {cs_background, cs_thermodynamics, cs_perturbations, cs_primordial, cs_nonlinear, cs_transfer, cs_spectra};
217 int * unknown_parameters_index;
218 struct file_content fc;
220 double * target_value;
222 enum computation_stage required_computation_stage;
255 struct file_content * fc,
259 struct file_content** ppfc_input,
260 struct file_content* pfc_setroot,
310 ErrorMsg error_message);
315 ErrorMsg error_message),
324 ErrorMsg error_message);
332 int unknown_parameters_size,
470 int class_version(
char * version);
Definition: background.h:48
Definition: distortions.h:35
Definition: harmonic.h:17
Definition: perturbations.h:98
Definition: primordial.h:79
Definition: thermodynamics.h:59
Definition: transfer.h:76