VERB_code_2.3
Parameters.h
Go to the documentation of this file.
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 
65  double eta1, eta2, eta3;
68 
69  double nu;
70  double s;
71  double f;
72 
73  //double cfm;
74  string particle;
75 
77  double L, EMeV, Alpha;
80 
81  bool Load_dxx_parameters(string filename);
82 
83 };
84 
87 //typedef std::vector<DxxParameters> List_of_AllDxxParameters;
88 
95  // General parameters Days
96  int outputLvl;
97  double nDays;
98  double timeStep;
104  string DLLType;
107  string useKp;
108  double constKp;
109  string fileKp;
111  string useBf;
112  double constBf;
113  string fileBf;
115  string useLpp;
116  double constLpp;
117  string fileLpp;
118 
119  string usetau, usetauLpp;
124 
126  bool NoNegative;
127 
128  bool useLossCone;
129 
134  double timeStep;
135  int iterStep;
136  string logFileName;
137  string folderName;
138  string fileName1D;
139  } general_Output_parameters;
140 
141  string
143  localDiffusionsGrid_type;
144 
147 
151  struct GridElement {
153  string name;
155  int size;
158  double min;
159  double max;
160 
161  } //@{
163  radialDiffusionGrid_L, radialDiffusionGrid_pc, radialDiffusionGrid_alpha, radialDiffusionGrid_epc,
164  localDiffusionsGrid_L, localDiffusionsGrid_pc, localDiffusionsGrid_alpha, localDiffusionsGrid_epc;
166 
167 
173  string type;
175  double value;
177  string filename;
178 
179  }
180  L_LowerBoundaryCondition,
181  L_UpperBoundaryCondition,
182  pc_LowerBoundaryCondition,
183  pc_UpperBoundaryCondition,
184  alpha_LowerBoundaryCondition,
185  alpha_UpperBoundaryCondition;
186 
190  struct PSD {
196 
200 
202 
208 
214 
219 
224 
226  int SOL_i_max;
230  } GMRES_parameters;
231 
232  } psdRadialDiffusion,
233  psdLocalDiffusions;
234 
238  struct SL_structure {
240  bool SL_L_top;
242  bool SL_E_min;
244 
246  bool useLmp;
247  string fileLmp;
248  } SL;
249 
253  struct Interpolation {
255  string type;
257  string useLog;
258 
261 
264  } interpolation;
265 
266 
267  // diffusion coefficients
268  // List_of_AllDxxParameters AllDxxParameters; ///< List of diffusion coefficients parameters.
269  vector<DxxParameters_structure> DxxParametersList;
270 
271 
272  bool Load_parameters(string filename);
273 };
274 
275 
276 void StrToVal(string input, double &place);
277 void StrToVal(string input, int &place);
278 void StrToVal(string input, string &place);
279 void StrToVal(string input, bool &place);
280 
281 void load_1d(Matrix1D<double> &var, string filename, double dt, int var_size = 0);
282 
283 void load_2d(Matrix2D<double> &var, string filename, double dt, int var_size_x = 0, int var_size_y = 0);
284 // vectors of 2d values
285 typedef vector<double> T_double_vector;
286 typedef vector<T_double_vector> T_2d_double_vector;
287 
288 
289 // add value to the vector of 2d values
290 double& T_2d_double_vector_add(T_2d_double_vector &v, size_t x, size_t y);
291 
292 
293 bool str2bool(string str);
294 string bool2str(bool b);
295 #endif
bool useLmp
magnetopause position flag
Definition: Parameters.h:246
string preconditioner_type
Type of preconditioner to use.
Definition: Parameters.h:228
Matrix1D< double > Kp
Kp array.
Definition: Parameters.h:106
Interpolation parameters structure
Definition: Parameters.h:253
double constLpp
constant Lpp value (if it's constant).
Definition: Parameters.h:116
double initial_PSD_inner_psd
Inner PSD boundary value for steady state, default 0.
Definition: Parameters.h:207
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
string usetauLpp_SteadyState
Tau within plasmasphere for steady state.
Definition: Parameters.h:198
string output_PSD_fileName4D
File name for psd output.
Definition: Parameters.h:212
string Omega_mType
Omega_m type. Check StrToVal(string input, Omega_mTypes &place) for known values. ...
Definition: Parameters.h:51
bool useLossCone
specify whether using loss cone or not
Definition: Parameters.h:128
string SL_L_top_filename
filename for losses upper bound
Definition: Parameters.h:241
bool useAlphaDiffusion
Using diffusions flags.
Definition: Parameters.h:101
double initial_PSD_Kp0
Kp for steady state?
Definition: Parameters.h:203
string particle
Type of particles, produced wave? Ions or electrons. Check StrToVal(string input, ParticleTypes &plac...
Definition: Parameters.h:74
string fileLpp
Lpp file name.
Definition: Parameters.h:117
double lam_min
Minimum latitude.
Definition: Parameters.h:61
void StrToVal(string input, double &place)
Definition: Parameters.cpp:550
string filename
File name to load boundary conditions from.
Definition: Parameters.h:177
double initial_PSD_tauSteadyState
Tau for steady state, if we are calculation initial values as steady state solution.
Definition: Parameters.h:195
string bool2str(bool b)
Definition: Parameters.cpp:591
Matrix1D< double > Bf
Boundary flux array.
Definition: Parameters.h:110
double f
f_ratio
Definition: Parameters.h:71
string initial_PSD_Type
Tells us where to get initial PSD values. Check StrToVal(string input, InitialPSDTypes &place) for kn...
Definition: Parameters.h:193
int SOL_maxiter
Maximum number of steps, for iteration methods.
Definition: Parameters.h:225
Struct that holds various parameters to be used for Dxx.
Definition: Parameters.h:27
vector< T_double_vector > T_2d_double_vector
typedef vector of vector of doubles
Definition: Parameters.h:286
string useKp
Flag, using Kp index. constant - use constant value, file - read from file.
Definition: Parameters.h:107
double d_omega
d_omega value.
Definition: Parameters.h:53
double time_start
Time, when diffusion coefficient starts.
Definition: Parameters.h:38
bool SL_E_min
sources lower bound
Definition: Parameters.h:242
bool useLogScale
Flag, use logarithmic scale.
Definition: Parameters.h:157
string loadOrCalculate
Load diffusion coefficient or calculate flag.
Definition: Parameters.h:44
Boundary conditions parameters structure.
Definition: Parameters.h:171
string type
Interpolation type: spline, linear etc.
Definition: Parameters.h:255
string radialDiffusionGrid_filename
filename, if grid load from file
Definition: Parameters.h:145
double MLT_averaging
MLT averaging part of the orbit.
Definition: Parameters.h:47
Matrix2D< double > Lmp
magnetopause position Lmp (time, alpha)
Definition: Parameters.h:245
int nint
Number of points in integral.
Definition: Parameters.h:59
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:135
string SL_E_min_filename
filename for sources lower bound
Definition: Parameters.h:243
string approximationMethod
Approximation method. Check StrToVal(string input, ApproximationMethods &place) for known values...
Definition: Parameters.h:216
string numberDensity
Number density model. Check StrToVal(string input, NumberDensities &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
Matrix1D< double > Lpp
Lpp array.
Definition: Parameters.h:114
Grid element parameters structure.
Definition: Parameters.h:151
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:173
Main parameters structure that holds smaller structures for individual parameters.
Definition: Parameters.h:94
double output_PSD_timeStep
Time step for psd output.
Definition: Parameters.h:213
double Bw
Bw value.
Definition: Parameters.h:57
bool useEnergyDiffusion
Using diffusions flags.
Definition: Parameters.h:102
int totalIterationsNumber
Total number of iterations.
Definition: Parameters.h:99
double nDays
Simulation total time, days.
Definition: Parameters.h:97
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:204
bool NoNegative
Artificially no negative PSD.
Definition: Parameters.h:126
string name
Grid element name. Optional.
Definition: Parameters.h:153
double value
Value (if it is constant value on the boundary).
Definition: Parameters.h:175
double initial_PSD_tauLppSteadyState
Tau for steady state, if we are calculation initial values as steady state solution.
Definition: Parameters.h:199
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:142
string fileKp
Kp file name.
Definition: Parameters.h:109
double SOL_max_iter_err
maximum error, for iteration methods
Definition: Parameters.h:227
vector< double > T_double_vector
typedef vector of doubles
Definition: Parameters.h:285
double constKp
constant Kp value (if it's constant).
Definition: Parameters.h:108
double timeStep
Time step for output.
Definition: Parameters.h:134
bool outputModelMatrix
Output model matrix.
Definition: Parameters.h:125
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:133
bool use_normalization
To normalize (or not) matrix A from Ax=B system.
Definition: Parameters.h:229
double timeStep
Time step, hours.
Definition: Parameters.h:98
string initial_PSD_fileName
File name, if we need to load initial values from file.
Definition: Parameters.h:194
string output_PSD_folderName
Folder name for psd output.
Definition: Parameters.h:211
bool BwFromLambda
Bw lambda dependance flag.
Definition: Parameters.h:58
void load_2d(Matrix2D< double > &var, string filename, double dt, int var_size_x=0, int var_size_y=0)
Definition: Parameters.cpp:642
string useLog
Flag, if we should interpolate logarithm of the values.
Definition: Parameters.h:257
string fileBf
Bf file name.
Definition: Parameters.h:113
string localDiffusionsGrid_filename
filename, if grid load from file
Definition: Parameters.h:146
string waveType
Wave type (chorus, hiss etc). Check StrToVal(string input, WaveTypes &place) for known values...
Definition: Parameters.h:32
Matrix1D< double > tauLpp
Lifetime inside of the plasmasphere.
Definition: Parameters.h:123
void load_1d(Matrix1D< double > &var, string filename, double dt, int var_size=0)
Definition: Parameters.cpp:598
string fileName1D
1d-output file name.
Definition: Parameters.h:138
string solutionMethod
Solution method. Check StrToVal(string input, SolutionMethods &place) for known values.
Definition: Parameters.h:218
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:205
double & T_2d_double_vector_add(T_2d_double_vector &v, size_t x, size_t y)
Definition: Parameters.cpp:723
double constBf
constant Bf value (if it's constant).
Definition: Parameters.h:112
Matrix1D< double > tau
Lifetime out of the plasmasphere.
Definition: Parameters.h:122
double initial_PSD_outer_psd
Outer PSD boundary value for steady state, default 1.
Definition: Parameters.h:206
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
bool SL_L_top
SL parameters.
Definition: Parameters.h:240
PSD parameters structure.
Definition: Parameters.h:190
double omega_uc
omega upper cutoff
Definition: Parameters.h:54
string useLpp
Flag, using plasma pause location dependences if equal true.
Definition: Parameters.h:115
string useBf
Flag, using boundary flux dependences if equal true.
Definition: Parameters.h:111
int SOL_i_max
For GMRES - number of iterations before restart.
Definition: Parameters.h:226
bool useRadialDiffusion
Using diffusions flags.
Definition: Parameters.h:100
bool str2bool(string str)
Definition: Parameters.cpp:583
int outputLvl
Detalization level of screen output.
Definition: Parameters.h:96
Sources and losses parameters structure.
Definition: Parameters.h:238
string fileLmp
magnetopause position file name
Definition: Parameters.h:247
vector< DxxParameters_structure > DxxParametersList
List of diffusion coefficients parameters.
Definition: Parameters.h:269