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 
28 public:
29  string DxxType;
30  string DxxName;
31 
32  string waveType;
33  string waveName;
34 
35  string filetype;
36  string filename;
37 
38  double time_start;
39  double time_end;
40 
41  bool useScale;
42  double DxxKp;
43 
44  string loadOrCalculate;
45 
46  string numberDensity;
47  double MLT_averaging;
48 
49  double multiplicator;
50 
51  string Omega_mType;
52  double Omega_m;
53  double d_omega;
54  double omega_uc;
55  double omega_lc;
56 
57  double Bw;
58  bool BwFromLambda;
59  int nint;
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 
88  // General parameters Days
89  int outputLvl;
90  double nDays;
91  double timeStep;
97  string DLLType;
100  string useKp;
101  double constKp;
102  string fileKp;
104  string useBf;
105  double constBf;
106  string fileBf;
108  string useLpp;
109  double constLpp;
110  string fileLpp;
111  string usetau, usetauLpp;
114 
116  bool NoNegative;
117 
118  bool useLossCone;
119 
124  double timeStep;
125  int iterStep;
126  string logFileName;
127  string folderName;
128  string fileName1D;
129  } general_Output_parameters;
130 
131  string
133  localDiffusionsGrid_type;
134 
137 
141  struct GridElement {
143  string name;
145  int size;
148  double min;
149  double max;
150 
151  }
152  radialDiffusionGrid_L, radialDiffusionGrid_pc, radialDiffusionGrid_alpha, radialDiffusionGrid_epc,
153  localDiffusionsGrid_L, localDiffusionsGrid_pc, localDiffusionsGrid_alpha, localDiffusionsGrid_epc;
154 
155 
161  string type;
163  double value;
165  string filename;
166 
167  }
168  L_LowerBoundaryCondition,
169  L_UpperBoundaryCondition,
170  pc_LowerBoundaryCondition,
171  pc_UpperBoundaryCondition,
172  alpha_LowerBoundaryCondition,
173  alpha_UpperBoundaryCondition;
174 
178  struct PSD {
184 
186  string usetauLpp_SteadyState;
188 
190 
196 
202 
207 
209 
210  int SOL_maxiter;
211  int SOL_i_max;
215  } GMRES_parameters;
216 
217  } psdRadialDiffusion,
218  psdLocalDiffusions;
219 
223  struct SL_structure {
224  //what are these?
225  bool SL_L_top;
226  string SL_L_top_filename;
227  bool SL_E_min;
228  string SL_E_min_filename;
229 
231  bool useLmp;
232  string fileLmp;
233  } SL;
234 
238  struct Interpolation {
240  string type;
242  string useLog;
243 
246 
249  } interpolation;
250 
251 
252  // diffusion coefficients
253  // List_of_AllDxxParameters AllDxxParameters; ///< List of diffusion coefficients parameters.
254  vector<DxxParameters_structure> DxxParametersList;
255 
256 
257  bool Load_parameters(string filename);
258 };
259 
260 
261 void StrToVal(string input, double &place);
262 void StrToVal(string input, int &place);
263 void StrToVal(string input, string &place);
264 void StrToVal(string input, bool &place);
265 
266 void load_1d(Matrix1D<double> &var, string filename, double dt, int var_size = 0);
267 
268 void load_2d(Matrix2D<double> &var, string filename, double dt, int var_size_x = 0, int var_size_y = 0);
269  // vectors of 2d values
270  typedef vector<double> T_double_vector;
271  typedef vector<T_double_vector> T_2d_double_vector;
272 
273 
274  // add value to the vector of 2d values
275  double& T_2d_double_vector_add(T_2d_double_vector &v, size_t x, size_t y);
276 
277 
278 bool str2bool(string str);
279 string bool2str(bool b);
280 #endif
Matrix1D< double > Kp
Kp array.
Definition: Parameters.h:99
bool useLmp
Magnitopause position flag.
Definition: Parameters.h:231
string preconditioner_type
maximum error, for iteration methods
Definition: Parameters.h:213
string folderName
output folder name.
Definition: Parameters.h:127
Interpolation parameters structure
Definition: Parameters.h:238
double constLpp
constant Lpp value (if it's constant).
Definition: Parameters.h:109
double min
min value.
Definition: Parameters.h:148
double initial_PSD_inner_psd
Inner PSD boundary value for steady state, default 0.
Definition: Parameters.h:195
Matrix1D< double > Lpp
Lpp array.
Definition: Parameters.h:107
string filetype
Type of the file (w/wo grid etc)
Definition: Parameters.h:35
bool useScale
Flag, use scaling if equal to true.
Definition: Parameters.h:41
Matrix1D< double > Bf
Boundary flux array.
Definition: Parameters.h:103
string output_PSD_fileName4D
File name for psd output.
Definition: Parameters.h:200
string Omega_mType
Omega_m type. Check StrToVal(string input, Omega_mTypes &place) for known values. ...
Definition: Parameters.h:51
bool useAlphaDiffusion
Using diffusions flags.
Definition: Parameters.h:94
double initial_PSD_Kp0
Kp for steady state?
Definition: Parameters.h:191
string particle
Type of particles, produced wave? Ions or electrons. Check StrToVal(string input, ParticleTypes &plac...
Definition: Parameters.h:69
string fileLpp
Lpp file name.
Definition: Parameters.h:110
Matrix1D< double > tauLpp
Lifetime inside of the plasmasphere.
Definition: Parameters.h:113
double lam_min
Minimum latitude.
Definition: Parameters.h:61
General namespace.
string filename
File name to load boundary conditions from.
Definition: Parameters.h:165
double initial_PSD_tauSteadyState
Tau for steady state, if we are calculation initial values as steady state solytion.
Definition: Parameters.h:183
Matrix1D< double > tau
Lifetime out of the plasmasphere.
Definition: Parameters.h:112
string logFileName
log-file name.
Definition: Parameters.h:126
string initial_PSD_Type
Tells us where to get initial PSD values. Check StrToVal(string input, InitialPSDTypes &place) for kn...
Definition: Parameters.h:181
Struct that holds various parameters to be used for Dxx.
Definition: Parameters.h:27
string useKp
Flag, using Kp index. constant - use constant value, file - read from file.
Definition: Parameters.h:100
double d_omega
d_omega value.
Definition: Parameters.h:53
double time_start
Time, when diffusion coefficient starts.
Definition: Parameters.h:38
bool useLogScale
Flag, use logarithmic scale.
Definition: Parameters.h:147
string loadOrCalculate
Load diffusion coefficient or calculate flag.
Definition: Parameters.h:44
Boundary conditions parameters structure.
Definition: Parameters.h:159
string type
Interpolation type: spline, linear etc.
Definition: Parameters.h:240
string radialDiffusionGrid_filename
filename, if grid load from file
Definition: Parameters.h:135
double MLT_averaging
MLT averaging part of the orbit.
Definition: Parameters.h:47
Matrix2D< double > Lmp
Magnitopause position Lmp (time, alpha)
Definition: Parameters.h:230
int nint
Number of points in integral.
Definition: Parameters.h:59
double maxSecondDerivative
Definition: Parameters.h:248
string filename
File name for loading or saving diffusion coefficients array.
Definition: Parameters.h:36
int iterStep
Number of iterations between outputs.
Definition: Parameters.h:125
string approximationMethod
Approximation method. Check StrToVal(string input, ApproximationMethods &place) for known values...
Definition: Parameters.h:204
string numberDensity
Number density model. Check StrToVal(string input, NumberDencities &place) for known values...
Definition: Parameters.h:46
double mirror_point_coeff
Coefficient for mirror point (like 0.999, cause we can not integrate all the way to mirror point) ...
Definition: Parameters.h:60
Grid element parameters structure.
Definition: Parameters.h:141
double linearSplineCoef
Definition: Parameters.h:245
string DxxType
Dxx type. Check StrToVal(string input, DiffusionCoefficientTypes &place) for known values...
Definition: Parameters.h:29
string type
Type. Check StrToVal(string input, BoundaryConditionTypes &place) for known values.
Definition: Parameters.h:161
Main parameters structure that holds smaller structures for individual parameters.
Definition: Parameters.h:87
double output_PSD_timeStep
Time step for psd output.
Definition: Parameters.h:201
double Bw
Bw value.
Definition: Parameters.h:57
bool useEnergyDiffusion
Using diffusions flags.
Definition: Parameters.h:95
bool useEnergyAlphaMixedTerms
Definition: Parameters.h:96
int totalIterationsNumber
Total number of iterations.
Definition: Parameters.h:92
double nDays
Simulation total time, days.
Definition: Parameters.h:90
double initial_PSD_some_constant_value
Some psd value. Used as initial PSD value everywhere if initial_PSD_Type = IPSDT_CONSTANT or as minim...
Definition: Parameters.h:192
bool NoNegative
Artificially no negative PSD.
Definition: Parameters.h:116
string name
Grid element name. Optional.
Definition: Parameters.h:143
double value
Value (if it is constant value on the boundary).
Definition: Parameters.h:163
double initial_PSD_tauLppSteadyState
Tau for steady state, if we are calculation initial values as steady state solytion.
Definition: Parameters.h:187
double DxxKp
Kp value associated with parameters (for Kp-scaling)
Definition: Parameters.h:42
string waveName
Wave name.
Definition: Parameters.h:33
string radialDiffusionGrid_type
Local diffusions grid type.
Definition: Parameters.h:132
string fileKp
Kp file name.
Definition: Parameters.h:102
double SOL_max_iter_err
For GMRES - number of iterations before restart.
Definition: Parameters.h:212
double constKp
constant Kp value (if it's constant).
Definition: Parameters.h:101
double timeStep
Time step for output.
Definition: Parameters.h:124
bool outputModelMatrix
Output model matrix.
Definition: Parameters.h:115
double multiplicator
Dxx is multiplied to this number after all other operations. Useful for fast Dxx modifications.
Definition: Parameters.h:49
General program output parameters structure.
Definition: Parameters.h:123
bool use_normalization
Type of preconditioner to yse.
Definition: Parameters.h:214
double timeStep
Time step, hours.
Definition: Parameters.h:91
string initial_PSD_fileName
File name, if we need to load initial values from file.
Definition: Parameters.h:182
string output_PSD_folderName
Folder name for psd output.
Definition: Parameters.h:199
vector< DxxParameters_structure > DxxParametersList
List of diffusion coefficients parameters.
Definition: Parameters.h:254
bool BwFromLambda
Bw lambda dependance flag.
Definition: Parameters.h:58
string useLog
Flag, if we should interpolate logarithm of the values.
Definition: Parameters.h:242
string fileBf
Bf file name.
Definition: Parameters.h:106
string localDiffusionsGrid_filename
filename, if grid load from file
Definition: Parameters.h:136
string waveType
Wave type (chorus, hiss etc). Check StrToVal(string input, WaveTypes &place) for known values...
Definition: Parameters.h:32
string fileName1D
1d-output file name.
Definition: Parameters.h:128
string solutionMethod
Solution method. Check StrToVal(string input, SolutionMethods &place) for known values.
Definition: Parameters.h:206
double Omega_m
Omega_m value.
Definition: Parameters.h:52
string initial_PSD_J_L7_function
Name of the function for flux at L=7. Can be 'J_L7' or 'J_L7_corrected'.
Definition: Parameters.h:193
double constBf
constant Bf value (if it's constant).
Definition: Parameters.h:105
double max
max value.
Definition: Parameters.h:149
double initial_PSD_outer_psd
Outer PSD boundary value for steady state, default 1.
Definition: Parameters.h:194
double lam_max
Maximum latitude.
Definition: Parameters.h:62
double omega_lc
omega lower cutoff
Definition: Parameters.h:55
double time_end
Time, when diffusion coefficient ends.
Definition: Parameters.h:39
string DxxName
Dxx name.
Definition: Parameters.h:30
PSD parameters structure.
Definition: Parameters.h:178
double omega_uc
omega upper cutoff
Definition: Parameters.h:54
int size
Grid size.
Definition: Parameters.h:145
string useLpp
Flag, using plasma pause location dependences if equal true.
Definition: Parameters.h:108
string useBf
Flag, using boundary flux dependences if equal true.
Definition: Parameters.h:104
int SOL_i_max
Maximum number of steps, for iteration methods.
Definition: Parameters.h:211
bool useRadialDiffusion
Using diffusions flags.
Definition: Parameters.h:93
int outputLvl
Detalization level of screen output.
Definition: Parameters.h:89
Sources and losses parameters structure.
Definition: Parameters.h:223
string fileLmp
Magnitopause position file name.
Definition: Parameters.h:232