00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __IPF_H
00034 #define __IPF_H
00035
00036 #include <iostream>
00037 #include <iomanip>
00038 #include <string>
00039 #include <complex>
00040
00041 #include "OFELI_Config.h"
00042 #include "banner.h"
00043 #include "FFI.h"
00044
00045
00046 using std::string;
00047 using std::complex;
00048
00049 namespace OFELI {
00050
00055 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00056 struct ErrorInIPF {
00057 void Message(const char *file, size_t line, int code, int p1=0);
00058 };
00059 #endif
00060
00078 class IPF {
00079
00080 public:
00081
00082 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00083 struct mat_prop {
00084 string _density, _electric_cond, _electric_perm, _magnetic_perm;
00085 string _poisson, _thermal_cond, _rho_cp, _visc, _young;
00086 };
00087 #endif
00088
00091 IPF(const string &file);
00092
00097 IPF(const string &prog, const string &file);
00098
00100 ~IPF();
00101
00103 double getDisplay();
00104
00106 int getVerbose() const { return _verbose; }
00107
00110 int getOutput() const { return _output; }
00111
00114 int getSave() const { return _save; }
00115
00118 int getPlot() const { return _plot; }
00119
00122 int getBC() const { return _bc; }
00123
00126 int getBF() const { return _bf; }
00127
00130 int getSF() const { return _sf; }
00131
00134 int getInit() const { return _ini; }
00135
00138 int getData() const { return _data; }
00139
00142 size_t getNbSteps() const { return _nb_steps; }
00143
00146 size_t getNbIter() const { return _nb_iter; }
00147
00150 double getTimeStep() const { return _time_step; }
00151
00154 double getMaxTime() const { return _max_time; }
00155
00158 double getTolerance() const { return _tolerance; }
00159
00163 int getIntPar(size_t n=1) const { return _int_par[n-1]; }
00164
00168 string getStringPar(size_t n=1) const { return _string_par[n-1]; }
00169
00173 double getDoublePar(size_t n=1) const { return _real_par[n-1]; }
00174
00178 Point<double> getPointDoublePar(size_t n=1) const { return _point_double_par[n-1]; }
00179
00183
00184
00188 complex_t getComplexPar(size_t n=1) const { return _complex_par[n-1]; }
00189
00192 string getProject() const { return _project; }
00193
00197 string getMeshFile(size_t i=1) const { return _mesh_file[i-1]; }
00198
00201 string getInitFile() const { return _init_file; }
00202
00205 string getRestartFile() const { return _restart_file; }
00206
00209 string getBCFile() const { return _bc_file; }
00210
00213 string getBFFile() const { return _bf_file; }
00214
00217 string getSFFile() const { return _sf_file; }
00218
00221 string getSaveFile() const { return _save_file; }
00222
00226 string getPlotFile(int i=1) const { return _plot_file[i-1]; }
00227
00230 string getDataFile() const { return _data_file; }
00231
00234 string getPrescriptionFile() const { return _data_file; }
00235
00239 string getAuxFile(size_t i=1) const { return _aux_file[i-1]; }
00240
00242 string getDensity() const { return _mp._density; }
00243
00245 string getElectricConductivity() const { return _mp._electric_cond; }
00246
00248 string getElectricPermittivity() const { return _mp._electric_perm; }
00249
00251 string getMagneticPermeability() const { return _mp._magnetic_perm; }
00252
00254 string getPoissonRatio() const { return _mp._poisson; }
00255
00257 string getThermalConductivity() const { return _mp._thermal_cond; }
00258
00260 string getRhoCp() const { return _mp._rho_cp; }
00261
00263 string getViscosity() const { return _mp._visc; }
00264
00266 string getYoungModulus() const { return _mp._young; }
00267
00268 friend class XMLParser;
00269
00270 private:
00271
00272 bool _xml;
00273 valarray<string> _kw;
00274 FFI *_ffi;
00275 int _bc, _sf, _bf, _ini, _data;
00276 size_t _nb_par, _nb_steps, _nb_iter;
00277 int _verbose, _save, _plot, _output;
00278 size_t _nb_aux_file, _nb_mesh_file, _nb_plot_files, _nb_complex_par, _nb_string_par;
00279 double _tolerance, _time_step, _max_time;
00280 string _file, _project, _init_file, _restart_file, _data_file;
00281 string _bc_file, _bf_file, _sf_file, _save_file;
00282 size_t _nb_mat, _nb_int_par, _nb_real_par, _nb_point_double_par;
00283 size_t _nmat[MAX_NB_MATERIALS];
00284 int _int_par[MAX_NB_PAR];
00285
00286
00287 string _string_par[MAX_NB_PAR];
00288 double _real_par[MAX_NB_PAR];
00289 Point<double> _point_double_par[MAX_NB_PAR];
00290 complex<double> _complex_par[MAX_NB_PAR];
00291
00292
00293
00294
00295 string _mat[MAX_NB_MATERIALS], _mesh_file[MAX_NB_PAR], _aux_file[MAX_NB_PAR], _plot_file[MAX_NB_PAR];
00296 mat_prop _mp;
00297 void init();
00298 void get(const string &prog);
00299 void init_kw();
00300 ErrorInIPF _e;
00301 };
00302
00303 }
00304
00305 #endif