37 #ifndef BCInterfaceFunctionParser_H 38 #define BCInterfaceFunctionParser_H 1
41 #include <lifev/core/util/Parser.hpp> 44 #include <lifev/bc_interface/core/function/BCInterfaceFunction.hpp> 94 template<
typename BcHandlerType,
typename PhysicalSolverType >
252 template<
typename BcHandlerType,
typename PhysicalSolverType >
261 template<
typename BcHandlerType,
typename PhysicalSolverType >
268 #ifdef HAVE_LIFEV_DEBUG 269 debugStream ( 5021 ) <<
"BCInterfaceFunction::BCInterfaceFunction()" <<
"\n";
277 template<
typename BcHandlerType,
typename PhysicalSolverType >
282 #ifdef HAVE_LIFEV_DEBUG 283 debugStream ( 5021 ) <<
"BCInterfaceFunction::functionTime: " <<
"\n";
284 debugStream ( 5021 ) <<
" t: " << t <<
"\n";
287 M_parser->setVariable (
"t", t );
289 this->dataInterpolation();
291 #ifdef HAVE_LIFEV_DEBUG 292 debugStream ( 5021 ) <<
" evaluate( 0 ) : " << M_parser->evaluate ( 0 ) <<
"\n";
295 return M_parser->evaluate ( 0 );
298 template<
typename BcHandlerType,
typename PhysicalSolverType >
303 #ifdef HAVE_LIFEV_DEBUG 304 debugStream ( 5021 ) <<
"BCInterfaceFunction::functionTime: " <<
"\n";
305 debugStream ( 5021 ) <<
" t: " << t <<
"\n";
306 debugStream ( 5021 ) <<
" timeStep: " << timeStep <<
"\n";
309 M_parser->setVariable (
"t", t );
310 M_parser->setVariable (
"timeStep", timeStep );
312 this->dataInterpolation();
314 #ifdef HAVE_LIFEV_DEBUG 315 debugStream ( 5021 ) <<
" evaluate( 0 ) : " << M_parser->evaluate ( 0 ) <<
"\n";
318 return M_parser->evaluate ( 0 );
321 template<
typename BcHandlerType,
typename PhysicalSolverType >
326 #ifdef HAVE_LIFEV_DEBUG 327 debugStream ( 5021 ) <<
"BCInterfaceFunction::functionTimeSpace: " <<
"\n";
328 debugStream ( 5021 ) <<
" x: " << x <<
"\n";
329 debugStream ( 5021 ) <<
" y: " << y <<
"\n";
330 debugStream ( 5021 ) <<
" z: " << z <<
"\n";
331 debugStream ( 5021 ) <<
" t: " << t <<
"\n";
334 M_parser->setVariable (
"t", t );
335 M_parser->setVariable (
"x", x );
336 M_parser->setVariable (
"y", y );
337 M_parser->setVariable (
"z", z );
339 this->dataInterpolation();
341 #ifdef HAVE_LIFEV_DEBUG 342 debugStream ( 5021 ) <<
" evaluate( 0 ) : " << M_parser->evaluate ( 0 ) <<
"\n";
345 return M_parser->evaluate ( 0 );
348 template<
typename BcHandlerType,
typename PhysicalSolverType >
353 #ifdef HAVE_LIFEV_DEBUG 354 debugStream ( 5021 ) <<
"BCInterfaceFunction::functionTimeSpaceID: " <<
"\n";
355 debugStream ( 5021 ) <<
" x: " << x <<
"\n";
356 debugStream ( 5021 ) <<
" y: " << y <<
"\n";
357 debugStream ( 5021 ) <<
" z: " << z <<
"\n";
358 debugStream ( 5021 ) <<
" t: " << t <<
"\n";
359 debugStream ( 5021 ) <<
" id: " << id <<
"\n";
362 M_parser->setVariable (
"t", t );
363 M_parser->setVariable (
"x", x );
364 M_parser->setVariable (
"y", y );
365 M_parser->setVariable (
"z", z );
367 this->dataInterpolation();
369 #ifdef HAVE_LIFEV_DEBUG 370 debugStream ( 5021 ) <<
" evaluate(" << M_mapID[id] <<
") : " << M_parser->evaluate ( M_mapID[id] ) <<
"\n";
373 return M_parser->evaluate ( M_mapID[id] );
379 template<
typename BcHandlerType,
typename PhysicalSolverType >
384 #ifdef HAVE_LIFEV_DEBUG 385 debugStream ( 5022 ) <<
"BCInterfaceFunction::setParser" <<
"\n";
390 M_parser->setString ( data->baseString() );
394 M_parser.reset (
new parser_Type ( data->baseString() ) );
398 template<
typename BcHandlerType,
typename PhysicalSolverType >
402 return std::bind ( &BCInterfaceFunctionParser< BcHandlerType, PhysicalSolverType >::functionTime,
this, std::placeholders::_1 );
405 template<
typename BcHandlerType,
typename PhysicalSolverType >
409 return std::bind ( &BCInterfaceFunctionParser< BcHandlerType, PhysicalSolverType >::functionTimeTimeStep,
this, std::placeholders::_1, std::placeholders::_2 );
412 template<
typename BcHandlerType,
typename PhysicalSolverType >
416 if ( M_parser->countSubstring (
"," ) )
418 return std::bind ( &BCInterfaceFunctionParser< BcHandlerType, PhysicalSolverType >::functionTimeSpaceID,
this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5 );
422 return std::bind ( &BCInterfaceFunctionParser< BcHandlerType, PhysicalSolverType >::functionTimeSpace,
this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5 );
Real functionTimeSpace(const Real &t, const Real &x, const Real &y, const Real &z, const ID &)
Function of time and space.
BcHandlerType bcHandler_Type
virtual void setData(const dataPtr_Type &data)
Set data for boundary conditions.
Real functionTime(const Real &t)
Function of time.
function_Type::boundaryFunctionTimeTimeStep_Type boundaryFunctionTimeTimeStep_Type
void setupParser(const dataPtr_Type &data)
Setup the parser using the data container.
PhysicalSolverType physicalSolver_Type
void updateInverseJacobian(const UInt &iQuadPt)
function_Type::bcBase_Type bcBase_Type
BCInterfaceFunctionParser< BcHandlerType, PhysicalSolverType > * createBCInterfaceFunctionParser()
Factory create function.
std::shared_ptr< parser_Type > parserPtr_Type
Parser - A string parser for algebraic expressions.
Real functionTimeSpaceID(const Real &t, const Real &x, const Real &y, const Real &z, const ID &id)
Function of time and space with ID.
boundaryFunctionTimeSpaceID_Type functionSelectorTimeSpaceID()
Get the selected function of time space and ID.
boundaryFunctionTimeTimeStep_Type functionSelectorTimeTimeStep()
Get the selected function of time and time step.
BCInterfaceFunctionParser - LifeV boundary condition function wrapper for BCInterface.
virtual void dataInterpolation()
dataInterpolation
boundaryFunctionTime_Type functionSelectorTime()
Get the selected function of time.
BCInterfaceFunction< bcHandler_Type, physicalSolver_Type > function_Type
virtual ~BCInterfaceFunctionParser()
Destructor.
double Real
Generic real data.
BCInterfaceFunctionParser(const BCInterfaceFunctionParser &function)
BCInterfaceFunctionParser & operator=(const BCInterfaceFunctionParser &function)
Real functionTimeTimeStep(const Real &t, const Real &timeStep)
Function of time and time step.
function_Type::data_Type data_Type
function_Type::boundaryFunctionTime_Type boundaryFunctionTime_Type
function_Type::dataPtr_Type dataPtr_Type
BCInterfaceFunction - Base class for BCInterface boundary functions.
void assignFunction(bcBase_Type &base)
Assign the function to the base of the BCHandler.
std::map< ID, ID > M_mapID
BCInterfaceFunctionParser()
Empty Constructor.
function_Type::boundaryFunctionTimeSpaceID_Type boundaryFunctionTimeSpaceID_Type