LifeV
BCInterfaceFunctionParser< BcHandlerType, PhysicalSolverType > Class Template Reference

BCInterfaceFunctionParser - LifeV boundary condition function wrapper for BCInterface. More...

#include <BCInterfaceFunctionParser.hpp>

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

Public Member Functions

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)
 
- Public Member Functions inherited from BCInterfaceFunction< BcHandlerType, PhysicalSolverType >
 BCInterfaceFunction ()
 Empty Constructor. More...
 
virtual ~BCInterfaceFunction ()
 Destructor. More...
 

Protected Attributes

parserPtr_Type M_parser
 

Private Attributes

std::map< ID, IDM_mapID
 

Type definitions

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
 

Constructors & Destructor

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

Methods

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

Set Methods

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

Protected Methods

virtual void dataInterpolation ()
 dataInterpolation More...
 

Unimplemented Methods

 BCInterfaceFunctionParser (const BCInterfaceFunctionParser &function)
 
BCInterfaceFunctionParseroperator= (const BCInterfaceFunctionParser &function)
 

Private Methods

void setupParser (const dataPtr_Type &data)
 Setup the parser using the data container. More...
 
boundaryFunctionTime_Type functionSelectorTime ()
 Get the selected function of time. More...
 
boundaryFunctionTimeTimeStep_Type functionSelectorTimeTimeStep ()
 Get the selected function of time and time step. More...
 
boundaryFunctionTimeSpaceID_Type functionSelectorTimeSpaceID ()
 Get the selected function of time space and ID. More...
 

Additional Inherited Members

- 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
 

Detailed Description

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

BCInterfaceFunctionParser - LifeV boundary condition function wrapper for BCInterface.

Author
Cristiano Malossi

This class is an interface between the BCInterface and the Parser. It allows to construct LifeV function types for boundary conditions, using a function string loaded from a GetPot file.

DETAILS
By default the string separator is set to semicolon ";".

The function string has to be in this form:

function = '[u, v, w]'

where $ u=u(x,y,z,t) $, $ v=v(x,y,z,t) $, and $ w=w(x,y,z,t) $. They are separated by commas, as shown in the following example

function = '[x^2 + y^2, 0, 2*sin(2*pi*t)]'

It is possible to define constants separated by the string separator before the expression

function = 'a=5.67436; [x^2+y^2,0,a*sin(2*pi*t)^a]'

NOTE
In the boundary condition file, if you have three component with the same expression (the same function) you can both write:

function = '[0, 0, 0]'

or

function = 0

However the second way is more efficient during execution.

Definition at line 95 of file BCInterfaceFunctionParser.hpp.

Member Typedef Documentation

◆ bcHandler_Type

typedef BcHandlerType bcHandler_Type

Definition at line 102 of file BCInterfaceFunctionParser.hpp.

◆ physicalSolver_Type

typedef PhysicalSolverType physicalSolver_Type

Definition at line 103 of file BCInterfaceFunctionParser.hpp.

◆ function_Type

◆ boundaryFunctionTime_Type

◆ boundaryFunctionTimeTimeStep_Type

◆ boundaryFunctionTimeSpaceID_Type

◆ parser_Type

Definition at line 109 of file BCInterfaceFunctionParser.hpp.

◆ parserPtr_Type

typedef std::shared_ptr< parser_Type > parserPtr_Type

Definition at line 110 of file BCInterfaceFunctionParser.hpp.

◆ data_Type

◆ dataPtr_Type

◆ bcBase_Type

Constructor & Destructor Documentation

◆ BCInterfaceFunctionParser() [1/2]

Empty Constructor.

Definition at line 262 of file BCInterfaceFunctionParser.hpp.

+ Here is the caller graph for this function:

◆ ~BCInterfaceFunctionParser()

virtual ~BCInterfaceFunctionParser ( )
inlinevirtual

Destructor.

Definition at line 127 of file BCInterfaceFunctionParser.hpp.

◆ BCInterfaceFunctionParser() [2/2]

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

Member Function Documentation

◆ assignFunction() [1/15]

void assignFunction ( bcBase_Type base)
virtual

Assign the function to the base of the BCHandler.

Parameters
basebase of the boundary condition

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

◆ functionTime()

Real functionTime ( const Real t)
virtual

Function of time.

Parameters
ttime
Returns
boundary condition value

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

Definition at line 279 of file BCInterfaceFunctionParser.hpp.

◆ functionTimeTimeStep()

Real functionTimeTimeStep ( const Real t,
const Real timeStep 
)
virtual

Function of time and time step.

Parameters
ttime
timeSteptime step
Returns
boundary condition value

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

Definition at line 300 of file BCInterfaceFunctionParser.hpp.

◆ functionTimeSpace()

Real functionTimeSpace ( const Real t,
const Real x,
const Real y,
const Real z,
const ID  
)
virtual

Function of time and space.

Parameters
ttime
xx coordinate
yy coordinate
zz coordinate
idid of the boundary condition (not used)
Returns
boundary condition value

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

Definition at line 323 of file BCInterfaceFunctionParser.hpp.

◆ functionTimeSpaceID()

Real functionTimeSpaceID ( const Real t,
const Real x,
const Real y,
const Real z,
const ID id 
)
virtual

Function of time and space with ID.

Parameters
ttime
xx coordinate
yy coordinate
zz coordinate
idid of the boundary condition
Returns
boundary condition value

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

Definition at line 350 of file BCInterfaceFunctionParser.hpp.

◆ setData() [1/15]

◆ dataInterpolation()

virtual void dataInterpolation ( )
inlineprotectedvirtual

dataInterpolation

Reimplemented in BCInterfaceFunctionParserFile< BcHandlerType, PhysicalSolverType >.

Definition at line 198 of file BCInterfaceFunctionParser.hpp.

◆ operator=()

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

◆ setupParser()

void setupParser ( const dataPtr_Type data)
private

Setup the parser using the data container.

Parameters
databoundary condition data loaded from GetPot file

Definition at line 381 of file BCInterfaceFunctionParser.hpp.

◆ functionSelectorTime()

BCInterfaceFunctionParser< BcHandlerType, PhysicalSolverType >::boundaryFunctionTime_Type functionSelectorTime ( )
private

Get the selected function of time.

Returns
boundary function

Definition at line 400 of file BCInterfaceFunctionParser.hpp.

◆ functionSelectorTimeTimeStep()

BCInterfaceFunctionParser< BcHandlerType, PhysicalSolverType >::boundaryFunctionTimeTimeStep_Type functionSelectorTimeTimeStep ( )
private

Get the selected function of time and time step.

Returns
boundary function

Definition at line 407 of file BCInterfaceFunctionParser.hpp.

◆ functionSelectorTimeSpaceID()

BCInterfaceFunctionParser< BcHandlerType, PhysicalSolverType >::boundaryFunctionTimeSpaceID_Type functionSelectorTimeSpaceID ( )
private

Get the selected function of time space and ID.

Returns
boundary function

Definition at line 414 of file BCInterfaceFunctionParser.hpp.

◆ assignFunction() [2/15]

void assignFunction ( bcBase_Type base)
virtual

Assign the function to the base of the BCHandler.

Parameters
basebase of the boundary condition

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

Definition at line 48 of file BCInterfaceFunctionParser0D.cpp.

◆ setData() [2/15]

void setData ( const std::shared_ptr< BCInterfaceData > &  data)

Definition at line 58 of file BCInterfaceFunctionParser0D.cpp.

◆ assignFunction() [3/15]

void assignFunction ( bcBase_Type base)
virtual

Assign the function to the base of the BCHandler.

Parameters
basebase of the boundary condition

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

◆ setData() [3/15]

void setData ( const std::shared_ptr< BCInterfaceData > &  data)

◆ assignFunction() [4/15]

void assignFunction ( bcBase_Type base)
virtual

Assign the function to the base of the BCHandler.

Parameters
basebase of the boundary condition

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

Definition at line 48 of file BCInterfaceFunctionParser1D.cpp.

◆ setData() [4/15]

void setData ( const std::shared_ptr< BCInterfaceData > &  data)

Definition at line 58 of file BCInterfaceFunctionParser1D.cpp.

◆ assignFunction() [5/15]

void assignFunction ( bcBase_Type base)
virtual

Assign the function to the base of the BCHandler.

Parameters
basebase of the boundary condition

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

◆ setData() [5/15]

void setData ( const std::shared_ptr< BCInterfaceData > &  data)

◆ assignFunction() [6/15]

void assignFunction ( bcBase_Type base)
virtual

Assign the function to the base of the BCHandler.

Parameters
basebase of the boundary condition

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

Definition at line 48 of file BCInterfaceFunctionParserEmpty3D.cpp.

◆ setData() [6/15]

void setData ( const std::shared_ptr< BCInterfaceData > &  data)

Definition at line 58 of file BCInterfaceFunctionParserEmpty3D.cpp.

◆ assignFunction() [7/15]

void assignFunction ( bcBase_Type base)
virtual

Assign the function to the base of the BCHandler.

Parameters
basebase of the boundary condition

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

◆ setData() [7/15]

void setData ( const std::shared_ptr< BCInterfaceData > &  data)

◆ assignFunction() [8/15]

void assignFunction ( bcBase_Type base)
virtual

Assign the function to the base of the BCHandler.

Parameters
basebase of the boundary condition

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

Definition at line 48 of file BCInterfaceFunctionParserFluid3D.cpp.

◆ assignFunction() [9/15]

void assignFunction ( bcBase_Type base)
virtual

Assign the function to the base of the BCHandler.

Parameters
basebase of the boundary condition

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

Definition at line 55 of file BCInterfaceFunctionParserFluid3D.cpp.

◆ setData() [8/15]

void setData ( const std::shared_ptr< BCInterfaceData > &  data)

Definition at line 65 of file BCInterfaceFunctionParserFluid3D.cpp.

◆ setData() [9/15]

void setData ( const std::shared_ptr< BCInterfaceData > &  data)

Definition at line 120 of file BCInterfaceFunctionParserFluid3D.cpp.

◆ assignFunction() [10/15]

void assignFunction ( bcBase_Type base)
virtual

Assign the function to the base of the BCHandler.

Parameters
basebase of the boundary condition

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

◆ assignFunction() [11/15]

void assignFunction ( bcBase_Type base)
virtual

Assign the function to the base of the BCHandler.

Parameters
basebase of the boundary condition

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

◆ setData() [10/15]

void setData ( const std::shared_ptr< BCInterfaceData > &  data)

◆ setData() [11/15]

void setData ( const std::shared_ptr< BCInterfaceData > &  data)

◆ assignFunction() [12/15]

void assignFunction ( bcBase_Type base)
virtual

Assign the function to the base of the BCHandler.

Parameters
basebase of the boundary condition

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

Definition at line 48 of file BCInterfaceFunctionParserFSI3D.cpp.

◆ setData() [12/15]

void setData ( const std::shared_ptr< BCInterfaceData > &  data)

Definition at line 58 of file BCInterfaceFunctionParserFSI3D.cpp.

◆ assignFunction() [13/15]

void assignFunction ( bcBase_Type base)
virtual

Assign the function to the base of the BCHandler.

Parameters
basebase of the boundary condition

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

◆ setData() [13/15]

void setData ( const std::shared_ptr< BCInterfaceData > &  data)

◆ assignFunction() [14/15]

void assignFunction ( bcBase_Type base)
virtual

Assign the function to the base of the BCHandler.

Parameters
basebase of the boundary condition

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

Definition at line 48 of file BCInterfaceFunctionParserSolid3D.cpp.

◆ setData() [14/15]

void setData ( const std::shared_ptr< BCInterfaceData > &  data)

Definition at line 58 of file BCInterfaceFunctionParserSolid3D.cpp.

◆ assignFunction() [15/15]

void assignFunction ( bcBase_Type base)
virtual

Assign the function to the base of the BCHandler.

Parameters
basebase of the boundary condition

Implements BCInterfaceFunction< BcHandlerType, PhysicalSolverType >.

◆ setData() [15/15]

void setData ( const std::shared_ptr< BCInterfaceData > &  data)

Field Documentation

◆ M_parser

parserPtr_Type M_parser
protected

Definition at line 202 of file BCInterfaceFunctionParser.hpp.

◆ M_mapID

std::map< ID, ID > M_mapID
private

Definition at line 244 of file BCInterfaceFunctionParser.hpp.


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