My Project
Parameters.h
1 
10 #ifndef LOAD_CONSTANCE_H // continue if have not load this file yet
11 #define LOAD_CONSTANCE_H
12 
13 #include <string>
14 #include <vector>
15 #include <map>
16 #include "../Matrix/Matrix.h"
17 #include "../VariousFunctions/variousConstants.h"
18 #include "../Logging/Output.h"
19 #include <sstream>
20 
21 using namespace std;
22 
26 public:
27  string DxxType;
28  string DxxName;
29 
30  string waveType;
31  string waveName;
32 
33  string filetype;
34  string filename;
35 
36  double time_start;
37  double time_end;
38 
39  bool useScale;
40  double DxxKp;
41 
42  string loadOrCalculate;
43 
44  string numberDensity;
45  double MLT_averaging;
46 
47  double multiplicator;
48 
49  string Omega_mType;
50  double Omega_m;
51  double d_omega;
52  double omega_uc;
53  double omega_lc;
54 
55  double eta1, eta2, eta3;
56 
57  double Bw;
58  bool BwFromLambda;
59  int nint;
60  double mirror_point_coeff;
61  double lam_min;
62  double lam_max;
63 
64  double nu;
65  double s; // 1 corresponds to R mode
66  double f;
67 
68  //double cfm;
69  string particle;
70 
71  // global
72  double L, EMeV, Alpha;
73 
74  bool Load_dxx_parameters(string filename);
75 
76 };
77 
80 //typedef std::vector<DxxParameters> List_of_AllDxxParameters;
81 
85 struct Parameters_structure {
86  // General parameters Days
87  int outputLvl;
88  double nDays;
89  double timeStep;
90  int totalIterationsNumber;
91  bool useRadialDiffusion;
92  bool useAlphaDiffusion;
93  bool useEnergyDiffusion;
94  bool useEnergyAlphaMixedTerms;
95  string DLLType;
97  Matrix1D<double> Kp;
98  string useKp;
99  double constKp;
100  string fileKp;
101  Matrix1D<double> Bf;
102  string useBf;
103  double constBf;
104  string fileBf;
105  Matrix1D<double> Lpp;
106  string useLpp;
107  double constLpp;
108  string fileLpp;
109  string usetau, usetauLpp;
110  Matrix1D<double> tau;
111  Matrix1D<double> tauLpp;
112 
113  bool outputModelMatrix;
114  bool NoNegative;
115 
116  bool useLossCone;
117 
120  struct General_Output_parameters {
121  double timeStep;
122  int iterStep;
123  string logFileName;
124  string folderName;
125  string fileName1D;
126  } general_Output_parameters;
127 
128  string
129  radialDiffusionGrid_type,
130  localDiffusionsGrid_type;
131 
132  string radialDiffusionGrid_filename;
133  string localDiffusionsGrid_filename;
134 
137  struct GridElement {
139  string name;
141  int size;
143  bool useLogScale;
144  double min;
145  double max;
146 
147  }
148  radialDiffusionGrid_L, radialDiffusionGrid_pc, radialDiffusionGrid_alpha, radialDiffusionGrid_epc,
149  localDiffusionsGrid_L, localDiffusionsGrid_pc, localDiffusionsGrid_alpha, localDiffusionsGrid_epc;
150 
151 
154  struct BoundaryCondition {
156  string type;
158  double value;
160  string filename;
161 
162  }
163  L_LowerBoundaryCondition,
164  L_UpperBoundaryCondition,
165  pc_LowerBoundaryCondition,
166  pc_UpperBoundaryCondition,
167  alpha_LowerBoundaryCondition,
168  alpha_UpperBoundaryCondition;
169 
172  struct PSD {
175  string initial_PSD_Type;
176  string initial_PSD_fileName;
177  double initial_PSD_tauSteadyState;
178 
180  string usetauLpp_SteadyState;
181  double initial_PSD_tauLppSteadyState;
182 
184 
185  double initial_PSD_Kp0;
186  double initial_PSD_some_constant_value;
187  string initial_PSD_J_L7_function;
188  double initial_PSD_outer_psd;
189  double initial_PSD_inner_psd;
190 
193  string output_PSD_folderName;
194  string output_PSD_fileName4D;
195  double output_PSD_timeStep;
196 
198  string approximationMethod;
200  string solutionMethod;
201 
202  struct GMRES_parameters_structure {
203 
204  int SOL_maxiter;
205  int SOL_i_max;
206  double SOL_max_iter_err;
207  string preconditioner_type;
208  bool use_normalization;
209  } GMRES_parameters;
210 
211  } psdRadialDiffusion,
212  psdLocalDiffusions;
213 
217  struct SL_structure {
218  bool SL_L_top;
219  string SL_L_top_filename;
220  bool SL_E_min;
221  string SL_E_min_filename;
222  } SL;
223 
226  struct Interpolation {
228  string type;
230  string useLog;
231 
233  double linearSplineCoef;
234 
236  double maxSecondDerivative;
237  } interpolation;
238 
239 
240  // diffusion coefficients
241  // List_of_AllDxxParameters AllDxxParameters; ///< List of diffusion coefficients parameters.
242  vector<DxxParameters_structure> DxxParametersList;
243 
244 
245  bool Load_parameters(string filename);
246 };
247 
248 
249 void StrToVal(string input, double &place);
250 void StrToVal(string input, int &place);
251 void StrToVal(string input, string &place);
252 void StrToVal(string input, bool &place);
253 
254 void load_1d(Matrix1D<double> &var, string filename, double dt, int var_size = 0);
255 
256 bool str2bool(string str);
257 string bool2str(bool b);
258 
259 #endif
Array of values of coordinate axes.
Definition: Grid.h:28
General namespace.
int outputLvl
verbose level defined in namespase Output
Definition: Output.cpp:21
Struct that holds various parameters to be used for Dxx.
Definition: Parameters.h:27
Main parameters structure that holds smaller structures for individual parameters.
Definition: Parameters.h:87
Phase Space Density class.
Definition: PSD.h:48
Holds upper and lower boundary conditions.
Definition: BoundaryConditions.h:26