00001
00010 #ifndef LOAD_CONSTANCE_H // continue if have not load this file yet
00011 #define LOAD_CONSTANCE_H
00012
00013 #include <string>
00014 #include <vector>
00015 #include <map>
00016 #include "../Matrix/Matrix.h"
00017 #include "../VariousFunctions/variousConstants.h"
00018 #include "../Logging/Output.h"
00019 #include <sstream>
00020
00021 using namespace std;
00022
00025 struct DiffusionCoefficientParamStructure {
00026 public:
00027 string DxxType;
00028 string DxxName;
00029
00030 string waveType;
00031 string waveName;
00032
00033 string filetype;
00034 string filename;
00035
00036 double time_start;
00037 double time_end;
00038
00039 bool useScale;
00040 double DxxKp;
00041
00042 string loadOrCalculate;
00043
00044 string numberDensity;
00045 double MLT_averaging;
00046
00047 double multiplicator;
00048
00049 string Omega_mType;
00050 double Omega_m;
00051 double d_omega;
00052 double omega_uc;
00053 double omega_lc;
00054
00055 double eta1, eta2, eta3;
00056
00057 double Bw;
00058 bool BwFromLambda;
00059 int nint;
00060 double lam_min;
00061 double lam_max;
00062
00063 double nu;
00064 double s;
00065 double f;
00066
00067
00068 string particle;
00069
00070
00071 double L, EMeV, Alpha;
00072
00073 bool Load_dxx_parameters(string filename);
00074
00075 };
00076
00079 typedef std::vector<DiffusionCoefficientParamStructure> DiffusionCoefficientParamStructureList;
00080
00084 struct ParamStructure {
00085
00086 int outputLvl;
00087 double nDays;
00088 double timeStep;
00089 int totalIterationsNumber;
00090 bool useRadialDifusion;
00091 bool useAlphaDifusion;
00092 bool useEnergyDifusion;
00093 bool useEnergyAlphaMixedTerms;
00094
00095 string DLLType;
00096 Matrix1D<double> Kp;
00097 string useKp;
00098 double constKp;
00099 string fileKp;
00100 Matrix1D<double> Bf;
00101 string useBf;
00102 double constBf;
00103 string fileBf;
00104 Matrix1D<double> Lpp;
00105 string useLpp;
00106 double constLpp;
00107 string fileLpp;
00108 Matrix1D<double> tau;
00109 Matrix1D<double> tauLpp;
00110
00111 bool outputModelMatrix;
00112 bool NoNegative;
00113
00116 struct General_Output_parameters {
00117 double timeStep;
00118 int iterStep;
00119 string logFileName;
00120 string folderName;
00121 string fileName1D;
00122 } general_Output_parameters;
00123
00124 string
00125 radialDiffusionGrid_type,
00126 localDiffusionsGrid_type;
00127
00128 string radialDiffusionGrid_filename;
00129 string localDiffusionsGrid_filename;
00130
00133 struct GridElement {
00135 string name;
00137 int size;
00139 bool useLogScale;
00140 double min;
00141 double max;
00142
00143 }
00144 radialDiffusionGrid_L, radialDiffusionGrid_pc, radialDiffusionGrid_alpha, radialDiffusionGrid_epc,
00145 localDiffusionsGrid_L, localDiffusionsGrid_pc, localDiffusionsGrid_alpha, localDiffusionsGrid_epc;
00146
00147
00150 struct BoundaryCondition {
00152 string type;
00154 double value;
00156 string filename;
00157
00158 }
00159 L_LowerBoundaryCondition,
00160 L_UpperBoundaryCondition,
00161 pc_LowerBoundaryCondition,
00162 pc_UpperBoundaryCondition,
00163 alpha_LowerBoundaryCondition,
00164 alpha_UpperBoundaryCondition;
00165
00168 struct PSD {
00171 string initial_PSD_Type;
00172 string initial_PSD_fileName;
00173 double initial_PSD_tauSteadyState;
00174 double initial_PSD_Kp0;
00175 double initial_PSD_some_constant_value;
00176 string initial_PSD_J_L7_function;
00177 double initial_PSD_outer_psd;
00178 double initial_PSD_inner_psd;
00179
00182 string output_PSD_folderName;
00183 string output_PSD_fileName4D;
00184 double output_PSD_timeStep;
00185
00187 string approximationMethod;
00189 string solutionMethod;
00190
00191 int SOL_maxiter;
00192 int SOL_i_max;
00193 double SOL_max_iter_err;
00194
00195 } psdRadialDiffusion,
00196 psdLocalDiffusions;
00197
00201 struct SL {
00202 bool SL_L_top;
00203 string SL_L_top_filename;
00204 bool SL_E_min;
00205 string SL_E_min_filename;
00206 } sourcesAndLosses;
00207
00210 struct Interpolation {
00212 string type;
00214 string useLog;
00215
00217 double linearSplineCoef;
00218
00220 double maxSecondDerivative;
00221 } interpolation;
00222
00223
00224
00225 DiffusionCoefficientParamStructureList DxxParamStructureList;
00226
00227 bool Load_parameters(string filename);
00228 };
00229
00230
00231 void StrToVal(string input, double &place);
00232 void StrToVal(string input, int &place);
00233 void StrToVal(string input, string &place);
00234 void StrToVal(string input, bool &place);
00235
00236 void load_1d(Matrix1D<double> &var, string filename, double dt, int var_size = 0);
00237
00238 bool str2bool(string str);
00239 string bool2str(bool b);
00240
00241 #endif