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) |
Return parameter corresponding to a given label, when its value is a string. More... | |
string | getString (const string &label, string def) |
Return parameter corresponding to a given label, when its value is a string. More... | |
int | getInteger (const string &label) |
Return parameter corresponding to a given label, when its value is an integer. More... | |
int | getInteger (const string &label, int def) |
Return parameter corresponding to a given label, when its value is an integer. More... | |
real_t | getDouble (const string &label) |
Return parameter corresponding to a given label, when its value is a real_t. More... | |
real_t | getDouble (const string &label, real_t def) |
Return parameter corresponding to a given label, when its value is a real_t. More... | |
complex_t | getComplex (const string &label) |
Return parameter corresponding to a given label, when its value is a complex number. More... | |
complex_t | getComplex (const string &label, complex_t def) |
Return parameter corresponding to a given label, when its value is a complex number. More... | |
void | get (const string &label, Vect< real_t > &a) |
Read an array of real values, corresponding to a given label. More... | |
void | get (const string &label, int &a) |
Return integer parameter corresponding to a given label. More... | |
void | get (const string &label, real_t &a) |
Return real parameter corresponding to a given label. More... | |
void | get (const string &label, complex_t &a) |
Return complex parameter corresponding to a given label. More... | |
void | get (const string &label, string &a) |
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. | |
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
IPF | ( | const string & | file | ) |
Constructor that gives the data file name.
It reads parameters in IPF Format from this file.
Read an array of real values, corresponding to a given label.
[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. |
void get | ( | const string & | label, |
int & | a | ||
) |
Return integer parameter corresponding to a given label.
[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 | ||
) |
Return real parameter corresponding to a given label.
[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 | ||
) |
Return complex parameter corresponding to a given label.
[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 | ||
) |
Return string parameter corresponding to a given label.
[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 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
int getBC | ( | ) | const |
Return parameter read using keyword BC.
This parameter can be used to set a boundary condition flag.
string getBCFile | ( | ) | const |
Return parameter read using keyword BCFile.
This parameter can be used to read a boundary condition file name.
int getBF | ( | ) | const |
Return parameter read using keyword BF.
This parameter can be used to set a body force flag.
string getBFFile | ( | ) | const |
Return parameter read using keyword BFFile.
This parameter can be used to read a body force file name.
complex_t getComplex | ( | const string & | label | ) |
Return parameter corresponding to a given label, when its value is a complex number.
[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
[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 |
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
int getData | ( | ) | const |
Return parameter read using keyword Data.
This parameter can be used to set a various data flag.
real_t getDouble | ( | const string & | label | ) |
Return parameter corresponding to a given label, when its value is a real_t.
[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
[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 |
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
int getInit | ( | ) | const |
Return parameter read using keyword Init.
This parameter can be used to set an initial data flag.
string getInitFile | ( | ) | const |
Return parameter read using keyword InitFile.
This parameter can be used to read an initial data file name.
int getInteger | ( | const string & | label | ) |
Return parameter corresponding to a given label, when its value is an integer.
[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 | ||
) |
Return parameter corresponding to a given label, when its value is an integer.
Case where a default value is provided
[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 |
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
real_t getMaxTime | ( | ) | const |
Return parameter read using keyword MaxTime.
This parameter can be used to read a maximum time value.
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
size_t getNbIter | ( | ) | const |
Return parameter read using keyword NbIter.
This parameter can be used to read a number of iterations.
size_t getNbSteps | ( | ) | const |
Return parameter read using keyword NbSteps.
This parameter can be used to read a number of time steps.
int getOutput | ( | ) | const |
Return parameter read using keyword Output.
This parameter can be used to control output behavior in a program.
int getPlot | ( | ) | const |
Return parameter read using keyword Plot.
This parameter can be used to control result saving for plotting in a program.
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
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
string getPrescriptionFile | ( | int | i = 1 | ) | const |
Return parameter read using keyword DataFile.
This parameter can be used to read a Prescription file.
string getProject | ( | ) | const |
Return parameter read using keyword Project.
This parameter can be used to read a project's name.
string getRestartFile | ( | ) | const |
Return parameter read using keyword RestartFile.
This parameter can be used to read a restart file name.
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).
string getSaveFile | ( | ) | const |
Return parameter read using keyword SaveFile.
This parameter can be used to read a save file name.
int getSF | ( | ) | const |
Return parameter read using keyword SF.
This parameter can be used to set a surface force flag.
string getSFFile | ( | ) | const |
Return parameter read using keyword SFFile.
This parameter can be used to read a source force file name.
string getString | ( | const string & | label | ) |
Return parameter corresponding to a given label, when its value is a string.
[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 | ||
) |
Return parameter corresponding to a given label, when its value is a string.
Case where a default value is provided
[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 |
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 getTimeStep | ( | ) | const |
Return parameter read using keyword TimeStep.
This parameter can be used to read a time step value.
real_t getTolerance | ( | ) | const |
Return parameter read using keyword Tolerance.
This parameter can be used to read a tolerance value to control convergence.