LifeV
BCInterfaceFunctionParserFile< BcHandlerType, PhysicalSolverType > Class Template Reference

BCInterfaceFunctionParserFile - LifeV boundary condition function file wrapper for BCInterface. More...

#include <BCInterfaceFunctionParserFile.hpp>

+ Inheritance diagram for BCInterfaceFunctionParserFile< BcHandlerType, PhysicalSolverType >:
+ Collaboration diagram for BCInterfaceFunctionParserFile< BcHandlerType, PhysicalSolverType >:

Private Attributes

std::vector< std::string > M_variables
 
bool M_loop
 
std::map< std::string, std::vector< Real > > M_data
 
std::vector< Real >::iterator M_dataIterator
 

Type definitions

typedef BcHandlerType bcHandler_Type
 
typedef PhysicalSolverType physicalSolver_Type
 
typedef BCInterfaceFunction< bcHandler_Type, physicalSolver_Typefunction_Type
 
typedef BCInterfaceFunctionParser< bcHandler_Type, physicalSolver_TypefunctionParser_Type
 
typedef function_Type::data_Type data_Type
 
typedef function_Type::dataPtr_Type dataPtr_Type
 

Constructors & Destructor

 BCInterfaceFunctionParserFile ()
 Empty Constructor. More...
 
virtual ~BCInterfaceFunctionParserFile ()
 Destructor. More...
 

Set Methods

virtual void setData (const dataPtr_Type &data)
 Set data for boundary conditions. More...
 

Unimplemented Methods

 BCInterfaceFunctionParserFile (const BCInterfaceFunctionParserFile &function)
 
BCInterfaceFunctionParserFileoperator= (const BCInterfaceFunctionParserFile &function)
 

Private methods

void dataInterpolation ()
 Linear interpolation (extrapolation) between two values of the data. More...
 

Additional Inherited Members

- Public Types inherited from BCInterfaceFunctionParser< BcHandlerType, PhysicalSolverType >
typedef BcHandlerType bcHandler_Type
 
typedef PhysicalSolverType physicalSolver_Type
 
typedef BCInterfaceFunction< bcHandler_Type, physicalSolver_Typefunction_Type
 
typedef function_Type::boundaryFunctionTime_Type boundaryFunctionTime_Type
 
typedef function_Type::boundaryFunctionTimeTimeStep_Type boundaryFunctionTimeTimeStep_Type
 
typedef function_Type::boundaryFunctionTimeSpaceID_Type boundaryFunctionTimeSpaceID_Type
 
typedef Parser parser_Type
 
typedef std::shared_ptr< parser_TypeparserPtr_Type
 
typedef function_Type::data_Type data_Type
 
typedef function_Type::dataPtr_Type dataPtr_Type
 
typedef function_Type::bcBase_Type bcBase_Type
 
- Public Types inherited from BCInterfaceFunction< BcHandlerType, PhysicalSolverType >
typedef BcHandlerType bcHandler_Type
 
typedef PhysicalSolverType physicalSolver_Type
 
typedef bcHandler_Type::bcFunction_Type bcBase_Type
 
typedef BCInterfaceData data_Type
 
typedef std::shared_ptr< data_TypedataPtr_Type
 
typedef std::function< Real(const Real &) > boundaryFunctionTime_Type
 
typedef std::function< Real(const Real &, const Real &) > boundaryFunctionTimeTimeStep_Type
 
typedef std::function< Real(const Real &, const Real &, const Real &, const Real &, const ID &) > boundaryFunctionTimeSpaceID_Type
 
- Public Member Functions inherited from BCInterfaceFunctionParser< BcHandlerType, PhysicalSolverType >
template<>
void assignFunction (bcBase_Type &base)
 Assign the function to the base of the BCHandler. More...
 
template<>
void setData (const std::shared_ptr< BCInterfaceData > &data)
 
template<>
void assignFunction (bcBase_Type &base)
 Assign the function to the base of the BCHandler. More...
 
template<>
void setData (const std::shared_ptr< BCInterfaceData > &data)
 
template<>
void assignFunction (bcBase_Type &base)
 Assign the function to the base of the BCHandler. More...
 
template<>
void setData (const std::shared_ptr< BCInterfaceData > &data)
 
template<>
void assignFunction (bcBase_Type &base)
 Assign the function to the base of the BCHandler. More...
 
template<>
void setData (const std::shared_ptr< BCInterfaceData > &data)
 
template<>
void assignFunction (bcBase_Type &base)
 Assign the function to the base of the BCHandler. More...
 
template<>
void setData (const std::shared_ptr< BCInterfaceData > &data)
 
template<>
void assignFunction (bcBase_Type &base)
 Assign the function to the base of the BCHandler. More...
 
template<>
void setData (const std::shared_ptr< BCInterfaceData > &data)
 
template<>
void assignFunction (bcBase_Type &base)
 Assign the function to the base of the BCHandler. More...
 
template<>
void assignFunction (bcBase_Type &base)
 Assign the function to the base of the BCHandler. More...
 
template<>
void setData (const std::shared_ptr< BCInterfaceData > &data)
 
template<>
void setData (const std::shared_ptr< BCInterfaceData > &data)
 
template<>
void assignFunction (bcBase_Type &base)
 Assign the function to the base of the BCHandler. More...
 
template<>
void assignFunction (bcBase_Type &base)
 Assign the function to the base of the BCHandler. More...
 
template<>
void setData (const std::shared_ptr< BCInterfaceData > &data)
 
template<>
void setData (const std::shared_ptr< BCInterfaceData > &data)
 
template<>
void assignFunction (bcBase_Type &base)
 Assign the function to the base of the BCHandler. More...
 
template<>
void setData (const std::shared_ptr< BCInterfaceData > &data)
 
template<>
void assignFunction (bcBase_Type &base)
 Assign the function to the base of the BCHandler. More...
 
template<>
void setData (const std::shared_ptr< BCInterfaceData > &data)
 
template<>
void assignFunction (bcBase_Type &base)
 Assign the function to the base of the BCHandler. More...
 
template<>
void setData (const std::shared_ptr< BCInterfaceData > &data)
 
template<>
void assignFunction (bcBase_Type &base)
 Assign the function to the base of the BCHandler. More...
 
template<>
void setData (const std::shared_ptr< BCInterfaceData > &data)
 
 BCInterfaceFunctionParser ()
 Empty Constructor. More...
 
virtual ~BCInterfaceFunctionParser ()
 Destructor. More...
 
void assignFunction (bcBase_Type &base)
 Assign the function to the base of the BCHandler. More...
 
Real functionTime (const Real &t)
 Function of time. More...
 
Real functionTimeTimeStep (const Real &t, const Real &timeStep)
 Function of time and time step. More...
 
Real functionTimeSpace (const Real &t, const Real &x, const Real &y, const Real &z, const ID &)
 Function of time and space. More...
 
Real functionTimeSpaceID (const Real &t, const Real &x, const Real &y, const Real &z, const ID &id)
 Function of time and space with ID. More...
 
- Public Member Functions inherited from BCInterfaceFunction< BcHandlerType, PhysicalSolverType >
 BCInterfaceFunction ()
 Empty Constructor. More...
 
virtual ~BCInterfaceFunction ()
 Destructor. More...
 
- Protected Member Functions inherited from BCInterfaceFunctionParser< BcHandlerType, PhysicalSolverType >
- Protected Attributes inherited from BCInterfaceFunctionParser< BcHandlerType, PhysicalSolverType >
parserPtr_Type M_parser
 

Detailed Description

template<typename BcHandlerType, typename PhysicalSolverType>
class LifeV::BCInterfaceFunctionParserFile< BcHandlerType, PhysicalSolverType >

BCInterfaceFunctionParserFile - LifeV boundary condition function file wrapper for BCInterface.

Author
Cristiano Malossi

This class is an interface between the BCInterface and the Parser. It allows to construct LifeV functions type for boundary conditions, using a GetPot file containing a function string and a table of discrete data (for example a discrete flow rate or pressure as a function of the time).

See BCInterfaceFunctionParser class for more details.

DETAILS
The constructor of the class takes a string contains the GetPot file name. The GetPot file has the following structure:

  • function: contains the expression of the function (as described in the BCInterfaceFunctionParser class).
  • variables: contains the list of variables and coefficients present in the function. The first one is the variable and should be sorted in a growing order, while all the others are coefficients.
  • data: contains the discrete list of variable and related coefficients. It must have n columns, where n is the number of variables (and coefficients).
  • scale: Contains n optional coefficients (default = 1), which multiply each column in the data table.
  • loop: Useful for periodic simulation: at the end of the list, it restarts using the first value instead of extrapolating the last two.

NOTE
During the execution, if the value of the variable (usually the time) is not present in the 'data' table, the class linearly interpolates the value between the two closest values. Moreover, if the value of the variable is higher than anyone present in the 'data' table, the class linearly extrapolates the value using the last two values in the table.

EXAMPLE OF DATA FILE
function = '(0,0,q)'
loop = false
variables = 't q'
scale = '1 1'
data = '0.000000000 1.00
0.333333333 2.00
0.666666666 3.00
1.000000000 4.00'

Definition at line 87 of file BCInterfaceFunctionParserFile.hpp.

Member Typedef Documentation

◆ bcHandler_Type

typedef BcHandlerType bcHandler_Type

Definition at line 94 of file BCInterfaceFunctionParserFile.hpp.

◆ physicalSolver_Type

typedef PhysicalSolverType physicalSolver_Type

Definition at line 95 of file BCInterfaceFunctionParserFile.hpp.

◆ function_Type

◆ functionParser_Type

◆ data_Type

◆ dataPtr_Type

Constructor & Destructor Documentation

◆ BCInterfaceFunctionParserFile() [1/2]

Empty Constructor.

Definition at line 169 of file BCInterfaceFunctionParserFile.hpp.

+ Here is the caller graph for this function:

◆ ~BCInterfaceFunctionParserFile()

virtual ~BCInterfaceFunctionParserFile ( )
inlinevirtual

Destructor.

Definition at line 113 of file BCInterfaceFunctionParserFile.hpp.

◆ BCInterfaceFunctionParserFile() [2/2]

BCInterfaceFunctionParserFile ( const BCInterfaceFunctionParserFile< BcHandlerType, PhysicalSolverType > &  function)
private

Member Function Documentation

◆ setData()

void setData ( const dataPtr_Type data)
inlinevirtual

Set data for boundary conditions.

Parameters
databoundary condition data loaded from GetPot file

Reimplemented from BCInterfaceFunctionParser< BcHandlerType, PhysicalSolverType >.

Reimplemented in BCInterfaceFunctionParserFileSolver< BcHandlerType, PhysicalSolverType >.

Definition at line 191 of file BCInterfaceFunctionParserFile.hpp.

◆ operator=()

BCInterfaceFunctionParserFile& operator= ( const BCInterfaceFunctionParserFile< BcHandlerType, PhysicalSolverType > &  function)
private

◆ dataInterpolation()

void dataInterpolation ( )
inlineprivatevirtual

Linear interpolation (extrapolation) between two values of the data.

Reimplemented from BCInterfaceFunctionParser< BcHandlerType, PhysicalSolverType >.

Definition at line 311 of file BCInterfaceFunctionParserFile.hpp.

Field Documentation

◆ M_variables

std::vector< std::string > M_variables
private

Definition at line 149 of file BCInterfaceFunctionParserFile.hpp.

◆ M_loop

bool M_loop
private

Definition at line 150 of file BCInterfaceFunctionParserFile.hpp.

◆ M_data

std::map< std::string, std::vector< Real > > M_data
private

Definition at line 151 of file BCInterfaceFunctionParserFile.hpp.

◆ M_dataIterator

std::vector< Real >::iterator M_dataIterator
private

Definition at line 152 of file BCInterfaceFunctionParserFile.hpp.


The documentation for this class was generated from the following file: