To read project parameters from a file in IPF format. More...
Public Member Functions | |
IPF () | |
Default constructor. | |
IPF (const string &file) | |
Constructor that gives the data file name. More... | |
IPF (const string &prog, const string &file) | |
Constructor that reads parameters in file file and prints header information for the calling program prog . It reads parameters in IPF Format from this file. | |
~IPF () | |
Destructor. | |
real_t | getDisplay () |
Display acquired parameters. | |
int | getVerbose () |
Return parameter read using keyword Verbose. | |
int | getOutput () const |
Return parameter read using keyword Output. More... | |
int | getSave () const |
Return parameter read using keyword Save. More... | |
int | getPlot () const |
Return parameter read using keyword Plot. More... | |
int | getBC () const |
Return parameter read using keyword BC. More... | |
int | getBF () const |
Return parameter read using keyword BF. More... | |
int | getSF () const |
Return parameter read using keyword SF. More... | |
int | getInit () const |
Return parameter read using keyword Init. More... | |
int | getData () const |
Return parameter read using keyword Data. More... | |
size_t | getNbSteps () const |
Return parameter read using keyword NbSteps. More... | |
size_t | getNbIter () const |
Return parameter read using keyword NbIter. More... | |
real_t | getTimeStep () const |
Return parameter read using keyword TimeStep. More... | |
real_t | getMaxTime () const |
Return parameter read using keyword MaxTime. More... | |
real_t | getTolerance () const |
Return parameter read using keyword Tolerance. More... | |
int | getIntPar (size_t n=1) const |
Return n -th parameter read using keyword IntPar More... | |
string | getStringPar (size_t n=1) const |
Return n-th parameter read using keyword StringPar. More... | |
real_t | getDoublePar (size_t n=1) const |
Return n -th parameter read using keyword DoublePar. More... | |
Point< real_t > | getPointDoublePar (size_t n=1) const |
Return n -th parameter read using keyword PointDoublePar. More... | |
complex_t | getComplexPar (size_t n=1) const |
Return n -th parameter read using keyword StringPar. More... | |
string | getString (const string &label) const |
Return parameter corresponding to a given label, when its value is a string. More... | |
string | getString (const string &label, string def) const |
Return parameter corresponding to a given label, when its value is a string. More... | |
int | getInteger (const string &label) const |
Return parameter corresponding to a given label, when its value is an integer. More... | |
int | getInteger (const string &label, int def) const |
Return parameter corresponding to a given label, when its value is an integer. More... | |
real_t | getDouble (const string &label) const |
Return parameter corresponding to a given label, when its value is a real_t. More... | |
real_t | getDouble (const string &label, real_t def) const |
Return parameter corresponding to a given label, when its value is a real_t. More... | |
complex_t | getComplex (const string &label) const |
Return parameter corresponding to a given label, when its value is a complex number. More... | |
complex_t | getComplex (const string &label, complex_t def) const |
Return parameter corresponding to a given label, when its value is a complex number. More... | |
int | contains (const string &label) const |
check if the project file contains a given parameter More... | |
void | get (const string &label, Vect< real_t > &a) const |
Read an array of real values, corresponding to a given label. More... | |
real_t | getArraySize (const string &label, size_t j) const |
Return an array entry for a given label. More... | |
void | get (const string &label, int &a) const |
Return integer parameter corresponding to a given label. More... | |
void | get (const string &label, real_t &a) const |
Return real parameter corresponding to a given label. More... | |
void | get (const string &label, complex_t &a) const |
Return complex parameter corresponding to a given label. More... | |
void | get (const string &label, string &a) const |
Return string parameter corresponding to a given label. More... | |
string | getProject () const |
Return parameter read using keyword Project. More... | |
string | getDomainFile () const |
Return pameter using keyword Mesh. | |
string | getMeshFile (size_t i=1) const |
Return i -th parameter read using keyword mesh_file. More... | |
string | getInitFile () const |
Return parameter read using keyword InitFile. More... | |
string | getRestartFile () const |
Return parameter read using keyword RestartFile. More... | |
string | getBCFile () const |
Return parameter read using keyword BCFile. More... | |
string | getBFFile () const |
Return parameter read using keyword BFFile. More... | |
string | getSFFile () const |
Return parameter read using keyword SFFile. More... | |
string | getSaveFile () const |
Return parameter read using keyword SaveFile. More... | |
string | getPlotFile (int i=1) const |
Return i -th parameter read using keyword PlotFile. More... | |
string | getPrescriptionFile (int i=1) const |
Return parameter read using keyword DataFile. More... | |
string | getAuxFile (size_t i=1) const |
Return i -th parameter read using keyword Auxfile. More... | |
string | getDensity () const |
Return expression (to be parsed, function of x , y , z , t ) for density function. | |
string | getElectricConductivity () const |
Return expression (to be parsed, function of x , y , z , t ) for electric conductivity. | |
string | getElectricPermittivity () const |
Return expression (to be parsed, function of x , y , z , t ) for electric permittivity. | |
string | getMagneticPermeability () const |
Return expression (to be parsed, function of x , y , z , t ) for magnetic permeability. | |
string | getPoissonRatio () const |
Return expression (to be parsed, function of x , y , z , t ) for Poisson ratio. | |
string | getThermalConductivity () const |
Return expression (to be parsed, function of x , y , z , t ) for thermal conductivity. | |
string | getRhoCp () const |
Return expression (to be parsed, function of x , y , z , t ) for density * specific heat. | |
string | getViscosity () const |
Return expression (to be parsed, function of x , y , z , t ) for viscosity. | |
string | getYoungModulus () const |
Return expression (to be parsed, function of x , y , z , t ) for Young's modulus. | |
Detailed Description
To read project parameters from a file in IPF format.
This class can be used to acquire various parameters from a parameter file of IPF (Input Project File). The declaration of an instance of this class avoids reading data in your main program. The acquired parameters are retrieved through information members of the class. Note that all the parameters have default values
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Constructor & Destructor Documentation
IPF | ( | const string & | file | ) |
Constructor that gives the data file name.
It reads parameters in IPF Format from this file.
Member Function Documentation
int getOutput | ( | ) | const |
Return parameter read using keyword Output.
This parameter can be used to control output behavior in a program.
int getSave | ( | ) | const |
Return parameter read using keyword Save.
This parameter can be used to control result saving in a program (e.g. for a restarting purpose).
int getPlot | ( | ) | const |
Return parameter read using keyword Plot.
This parameter can be used to control result saving for plotting in a program.
int getBC | ( | ) | const |
Return parameter read using keyword BC.
This parameter can be used to set a boundary condition flag.
int getBF | ( | ) | const |
Return parameter read using keyword BF.
This parameter can be used to set a body force flag.
int getSF | ( | ) | const |
Return parameter read using keyword SF.
This parameter can be used to set a surface force flag.
int getInit | ( | ) | const |
Return parameter read using keyword Init.
This parameter can be used to set an initial data flag.
int getData | ( | ) | const |
Return parameter read using keyword Data.
This parameter can be used to set a various data flag.
size_t getNbSteps | ( | ) | const |
Return parameter read using keyword NbSteps.
This parameter can be used to read a number of time steps.
size_t getNbIter | ( | ) | const |
Return parameter read using keyword NbIter.
This parameter can be used to read a number of iterations.
real_t getTimeStep | ( | ) | const |
Return parameter read using keyword TimeStep.
This parameter can be used to read a time step value.
real_t getMaxTime | ( | ) | const |
Return parameter read using keyword MaxTime.
This parameter can be used to read a maximum time value.
real_t getTolerance | ( | ) | const |
Return parameter read using keyword Tolerance.
This parameter can be used to read a tolerance value to control convergence.
int getIntPar | ( | size_t | n = 1 | ) | const |
Return n
-th parameter read using keyword IntPar
Here we have at most 20 integer extra parameters that can be used for any purpose. Default value for n
is 1
string getStringPar | ( | size_t | n = 1 | ) | const |
Return n-th parameter read using keyword StringPar.
Here we have at most 20 integer extra parameters that can be used for any purpose. Default value for n
is 1
real_t getDoublePar | ( | size_t | n = 1 | ) | const |
Return n
-th parameter read using keyword DoublePar.
Here we have at most 20 integer extra parameters that can be used for any purpose. Default value for n
is 1
Return n
-th parameter read using keyword PointDoublePar.
Here we have at most 20 integer extra parameters that can be used for any purpose. Default value for n
is 1
complex_t getComplexPar | ( | size_t | n = 1 | ) | const |
Return n
-th parameter read using keyword StringPar.
Here we have at most 20 integer extra parameters that can be used for any purpose. Default value for n
is 1
string getString | ( | const string & | label | ) | const |
Return parameter corresponding to a given label, when its value is a string.
- Parameters
-
[in] label Label that identifies the string (read from input file) If this label is not found an error message is displayed and program stops
string getString | ( | const string & | label, |
string | def | ||
) | const |
Return parameter corresponding to a given label, when its value is a string.
Case where a default value is provided
- Parameters
-
[in] label Label that identifies the string (read from input file) [in] def Default value: Value to assign if the sought parameter is not found
int getInteger | ( | const string & | label | ) | const |
Return parameter corresponding to a given label, when its value is an integer.
- Parameters
-
[in] label Label that identifies the integer number (read from input file) If this label is not found an error message is displayed and program stops
int getInteger | ( | const string & | label, |
int | def | ||
) | const |
Return parameter corresponding to a given label, when its value is an integer.
Case where a default value is provided
- Parameters
-
[in] label Label that identifies the integer number (read from input file). [in] def Default value: Value to assign if the sought parameter is not found
real_t getDouble | ( | const string & | label | ) | const |
Return parameter corresponding to a given label, when its value is a real_t.
- Parameters
-
[in] label Label that identifies the real number (read from input file). If this label is not found an error message is displayed and program stops.
Return parameter corresponding to a given label, when its value is a real_t.
Case where a default value is provided
- Parameters
-
[in] label Label that identifies the real number (read from input file) [in] def Default value: Value to assign if the sought parameter is not found
complex_t getComplex | ( | const string & | label | ) | const |
Return parameter corresponding to a given label, when its value is a complex number.
- Parameters
-
[in] label Label that identifies the complex number (read from input file) If this label is not found an error message is displayed and program stops
Return parameter corresponding to a given label, when its value is a complex number.
Case where a default value is provided
- Parameters
-
[in] label Label that identifies the complex number (read from input file) [in] def Default value: Value to assign if the sought parameter is not found
int contains | ( | const string & | label | ) | const |
check if the project file contains a given parameter
- Parameters
-
[in] label Label that identifies the label to seek in file
- Returns
0
if the parameter is not found,n
if the parameter is found, wheren
is the parameter index in the parameter list
Read an array of real values, corresponding to a given label.
- Parameters
-
[in] label Label that identifies the array (read from input file). [in] a Vector that contain the array. The vector is properly resized before filling.
- Remarks
- If this label is not found an error message is displayed.
real_t getArraySize | ( | const string & | label, |
size_t | j | ||
) | const |
Return an array entry for a given label.
- Parameters
-
[in] label Label that identifies the array (read from input file). [in] j Index of entry in the array (Starting from 1)
- Remarks
- If this label is not found an error message is displayed and program stops.
void get | ( | const string & | label, |
int & | a | ||
) | const |
Return integer parameter corresponding to a given label.
- Parameters
-
[in] label Label that identifies the integer number (read from input file). [out] a Returned value. If this label is not found an error message is displayed and program stops. Note: This member function can be used instead of getInteger
void get | ( | const string & | label, |
real_t & | a | ||
) | const |
Return real parameter corresponding to a given label.
- Parameters
-
[in] label Label that identifies the real (real_t) number (read from input file). [out] a Returned value. If this label is not found an error message is displayed and program stops. Note: This member function can be used instead of getReal_T
void get | ( | const string & | label, |
complex_t & | a | ||
) | const |
Return complex parameter corresponding to a given label.
- Parameters
-
[in] label Label that identifies the complex number (read from input file). [out] a Returned value. If this label is not found an error message is displayed and program stops.
void get | ( | const string & | label, |
string & | a | ||
) | const |
Return string parameter corresponding to a given label.
- Parameters
-
[in] label Label that identifies the atring (read from input file). [out] a Returned value. Note: This member function can be used instead of getString If this label is not found an error message is displayed and program stops. Note: This member function can be used instead of getString
string getProject | ( | ) | const |
Return parameter read using keyword Project.
This parameter can be used to read a project's name.
string getMeshFile | ( | size_t | i = 1 | ) | const |
Return i
-th parameter read using keyword mesh_file.
Here we have at most 10 integer extra parameters that can be used for any purpose. Default value for i
is 1
string getInitFile | ( | ) | const |
Return parameter read using keyword InitFile.
This parameter can be used to read an initial data file name.
string getRestartFile | ( | ) | const |
Return parameter read using keyword RestartFile.
This parameter can be used to read a restart file name.
string getBCFile | ( | ) | const |
Return parameter read using keyword BCFile.
This parameter can be used to read a boundary condition file name.
string getBFFile | ( | ) | const |
Return parameter read using keyword BFFile.
This parameter can be used to read a body force file name.
string getSFFile | ( | ) | const |
Return parameter read using keyword SFFile.
This parameter can be used to read a source force file name.
string getSaveFile | ( | ) | const |
Return parameter read using keyword SaveFile.
This parameter can be used to read a save file name.
string getPlotFile | ( | int | i = 1 | ) | const |
Return i
-th parameter read using keyword PlotFile.
Here we have at most 10 integer extra parameters that can be used for plot file names. Default value for i
is 1
string getPrescriptionFile | ( | int | i = 1 | ) | const |
Return parameter read using keyword DataFile.
This parameter can be used to read a Prescription file.
string getAuxFile | ( | size_t | i = 1 | ) | const |
Return i
-th parameter read using keyword Auxfile.
Here we have at most 10 integer extra parameters that can be used for any auxiliary file names. Default value for i
is 1