(9)

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_tgetPointDoublePar (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.
 

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

Constructor & Destructor Documentation

◆ IPF()

IPF ( const string &  file)

Constructor that gives the data file name.

It reads parameters in IPF Format from this file.

Member Function Documentation

◆ get() [1/5]

void get ( const string &  label,
Vect< real_t > &  a 
)

Read an array of real values, corresponding to a given label.

Parameters
[in]labelLabel that identifies the array (read from input file).
[in]aVector that contain the array. The vector is properly resized before filling.
Remarks
If this label is not found an error message is displayed.

◆ get() [2/5]

void get ( const string &  label,
int &  a 
)

Return integer parameter corresponding to a given label.

Parameters
[in]labelLabel that identifies the integer number (read from input file).
[out]aReturned 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

◆ get() [3/5]

void get ( const string &  label,
real_t a 
)

Return real parameter corresponding to a given label.

Parameters
[in]labelLabel that identifies the real (real_t) number (read from input file).
[out]aReturned 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

◆ get() [4/5]

void get ( const string &  label,
complex_t a 
)

Return complex parameter corresponding to a given label.

Parameters
[in]labelLabel that identifies the complex number (read from input file).
[out]aReturned value. If this label is not found an error message is displayed and program stops.

◆ get() [5/5]

void get ( const string &  label,
string &  a 
)

Return string parameter corresponding to a given label.

Parameters
[in]labelLabel that identifies the atring (read from input file).
[out]aReturned 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

◆ getAuxFile()

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

◆ getBC()

int getBC ( ) const

Return parameter read using keyword BC.

This parameter can be used to set a boundary condition flag.

◆ getBCFile()

string getBCFile ( ) const

Return parameter read using keyword BCFile.

This parameter can be used to read a boundary condition file name.

◆ getBF()

int getBF ( ) const

Return parameter read using keyword BF.

This parameter can be used to set a body force flag.

◆ getBFFile()

string getBFFile ( ) const

Return parameter read using keyword BFFile.

This parameter can be used to read a body force file name.

◆ getComplex() [1/2]

complex_t getComplex ( const string &  label)

Return parameter corresponding to a given label, when its value is a complex number.

Parameters
[in]labelLabel that identifies the complex number (read from input file) If this label is not found an error message is displayed and program stops

◆ getComplex() [2/2]

complex_t getComplex ( const string &  label,
complex_t  def 
)

Return parameter corresponding to a given label, when its value is a complex number.

Case where a default value is provided

Parameters
[in]labelLabel that identifies the complex number (read from input file)
[in]defDefault value: Value to assign if the sought parameter is not found

◆ getComplexPar()

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

◆ getData()

int getData ( ) const

Return parameter read using keyword Data.

This parameter can be used to set a various data flag.

◆ getDouble() [1/2]

real_t getDouble ( const string &  label)

Return parameter corresponding to a given label, when its value is a real_t.

Parameters
[in]labelLabel that identifies the real number (read from input file). If this label is not found an error message is displayed and program stops.

◆ getDouble() [2/2]

real_t getDouble ( const string &  label,
real_t  def 
)

Return parameter corresponding to a given label, when its value is a real_t.

Case where a default value is provided

Parameters
[in]labelLabel that identifies the real number (read from input file)
[in]defDefault value: Value to assign if the sought parameter is not found

◆ getDoublePar()

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

◆ getInit()

int getInit ( ) const

Return parameter read using keyword Init.

This parameter can be used to set an initial data flag.

◆ getInitFile()

string getInitFile ( ) const

Return parameter read using keyword InitFile.

This parameter can be used to read an initial data file name.

◆ getInteger() [1/2]

int getInteger ( const string &  label)

Return parameter corresponding to a given label, when its value is an integer.

Parameters
[in]labelLabel that identifies the integer number (read from input file) If this label is not found an error message is displayed and program stops

◆ getInteger() [2/2]

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

Parameters
[in]labelLabel that identifies the integer number (read from input file).
[in]defDefault value: Value to assign if the sought parameter is not found

◆ getIntPar()

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

◆ getMaxTime()

real_t getMaxTime ( ) const

Return parameter read using keyword MaxTime.

This parameter can be used to read a maximum time value.

◆ getMeshFile()

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

◆ getNbIter()

size_t getNbIter ( ) const

Return parameter read using keyword NbIter.

This parameter can be used to read a number of iterations.

◆ getNbSteps()

size_t getNbSteps ( ) const

Return parameter read using keyword NbSteps.

This parameter can be used to read a number of time steps.

◆ getOutput()

int getOutput ( ) const

Return parameter read using keyword Output.

This parameter can be used to control output behavior in a program.

◆ getPlot()

int getPlot ( ) const

Return parameter read using keyword Plot.

This parameter can be used to control result saving for plotting in a program.

◆ getPlotFile()

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

◆ getPointDoublePar()

Point<real_t> getPointDoublePar ( size_t  n = 1) const

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

◆ getPrescriptionFile()

string getPrescriptionFile ( int  i = 1) const

Return parameter read using keyword DataFile.

This parameter can be used to read a Prescription file.

◆ getProject()

string getProject ( ) const

Return parameter read using keyword Project.

This parameter can be used to read a project's name.

◆ getRestartFile()

string getRestartFile ( ) const

Return parameter read using keyword RestartFile.

This parameter can be used to read a restart file name.

◆ getSave()

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).

◆ getSaveFile()

string getSaveFile ( ) const

Return parameter read using keyword SaveFile.

This parameter can be used to read a save file name.

◆ getSF()

int getSF ( ) const

Return parameter read using keyword SF.

This parameter can be used to set a surface force flag.

◆ getSFFile()

string getSFFile ( ) const

Return parameter read using keyword SFFile.

This parameter can be used to read a source force file name.

◆ getString() [1/2]

string getString ( const string &  label)

Return parameter corresponding to a given label, when its value is a string.

Parameters
[in]labelLabel that identifies the string (read from input file) If this label is not found an error message is displayed and program stops

◆ getString() [2/2]

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

Parameters
[in]labelLabel that identifies the string (read from input file)
[in]defDefault value: Value to assign if the sought parameter is not found

◆ getStringPar()

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

◆ getTimeStep()

real_t getTimeStep ( ) const

Return parameter read using keyword TimeStep.

This parameter can be used to read a time step value.

◆ getTolerance()

real_t getTolerance ( ) const

Return parameter read using keyword Tolerance.

This parameter can be used to read a tolerance value to control convergence.