KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
List of all members
Kratos::BasicGenericFunctionUtility Class Reference

This function allows to call a function method of type f(x, y, z, t) implemented in python style. More...

#include <function_parser_utility.h>

Inheritance diagram for Kratos::BasicGenericFunctionUtility:
Collaboration diagram for Kratos::BasicGenericFunctionUtility:

Public Member Functions

Life Cycle
 BasicGenericFunctionUtility (const std::string &rFunctionBody)
 Default constructor. More...
 
 BasicGenericFunctionUtility (BasicGenericFunctionUtility const &rOther)
 Copy constructor. More...
 
virtual ~BasicGenericFunctionUtility ()
 Destructor. More...
 
Operations
Pointer Clone ()
 This method clones the current function instance. More...
 
virtual bool UseLocalSystem ()
 This method returns if it depends on space. More...
 
bool DependsOnSpace ()
 This method returns if it depends on space. More...
 
std::string FunctionBody ()
 This method returns the function body. More...
 
virtual double RotateAndCallFunction (const double x, const double y, const double z, const double t, const double X=0.0, const double Y=0.0, const double Z=0.0)
 This method rotates and calls the evaluation function. More...
 
double CallFunction (const double x, const double y, const double z, const double t, const double X=0.0, const double Y=0.0, const double Z=0.0)
 This calls the evaluation function. More...
 

Protected Member Functions

Protected Operations
void InitializeParser ()
 This method initializes the parser classes. More...
 

Protected Attributes

Member Variables
array_1d< double, 7 > mValues = ZeroVector(7)
 
std::vector< te_expr * > mpTinyExpr = std::vector<te_expr*>(1, nullptr)
 The variables values considered on the function. More...
 
std::string mFunctionBody
 The function parser. More...
 
bool mDependsOnSpace = true
 The function body. More...
 

Type definitions

typedef std::size_t IndexType
 The index type definition. More...
 
 KRATOS_CLASS_POINTER_DEFINITION (BasicGenericFunctionUtility)
 Counted pointer of BasicGenericFunctionUtility. More...
 

Detailed Description

This function allows to call a function method of type f(x, y, z, t) implemented in python style.

The functions can be constructed by providing a python-defined method of the type

The object is then insantiated as aux_function = BasicGenericFunctionUtility(aux_object_cpp_callback(self.function_string))

Optionally one can specify a rotation matrix and an origin so that the function can be defined in a rotated system of coordinates

Author
Riccardo Rossi
Vicente Mataix Ferrandiz

Member Typedef Documentation

◆ IndexType

The index type definition.

Constructor & Destructor Documentation

◆ BasicGenericFunctionUtility() [1/2]

Kratos::BasicGenericFunctionUtility::BasicGenericFunctionUtility ( const std::string &  rFunctionBody)

Default constructor.

Parameters
rFunctionBodyThe string defining the function

◆ BasicGenericFunctionUtility() [2/2]

Kratos::BasicGenericFunctionUtility::BasicGenericFunctionUtility ( BasicGenericFunctionUtility const &  rOther)

Copy constructor.

◆ ~BasicGenericFunctionUtility()

Kratos::BasicGenericFunctionUtility::~BasicGenericFunctionUtility ( )
virtual

Destructor.

Member Function Documentation

◆ CallFunction()

double Kratos::BasicGenericFunctionUtility::CallFunction ( const double  x,
const double  y,
const double  z,
const double  t,
const double  X = 0.0,
const double  Y = 0.0,
const double  Z = 0.0 
)

This calls the evaluation function.

Parameters
xThe x coordinate
yThe y coordinate
zThe z coordinate
tThe time variable
XThe initial x coordinate
YThe initial y coordinate
ZThe initial z coordinate

◆ Clone()

Pointer Kratos::BasicGenericFunctionUtility::Clone ( )
inline

This method clones the current function instance.

Returns
A clone of the current class

◆ DependsOnSpace()

bool Kratos::BasicGenericFunctionUtility::DependsOnSpace ( )
inline

This method returns if it depends on space.

Returns
True if it depends on space, false otherwise

◆ FunctionBody()

std::string Kratos::BasicGenericFunctionUtility::FunctionBody ( )

This method returns the function body.

Returns
The function body

◆ InitializeParser()

void Kratos::BasicGenericFunctionUtility::InitializeParser ( )
protected

This method initializes the parser classes.

◆ KRATOS_CLASS_POINTER_DEFINITION()

Kratos::BasicGenericFunctionUtility::KRATOS_CLASS_POINTER_DEFINITION ( BasicGenericFunctionUtility  )

Counted pointer of BasicGenericFunctionUtility.

◆ RotateAndCallFunction()

double Kratos::BasicGenericFunctionUtility::RotateAndCallFunction ( const double  x,
const double  y,
const double  z,
const double  t,
const double  X = 0.0,
const double  Y = 0.0,
const double  Z = 0.0 
)
virtual

This method rotates and calls the evaluation function.

Parameters
xThe x coordinate
yThe y coordinate
zThe z coordinate
tThe time variable
XThe initial x coordinate
YThe initial y coordinate
ZThe initial z coordinate

Reimplemented in Kratos::GenericFunctionUtility.

◆ UseLocalSystem()

virtual bool Kratos::BasicGenericFunctionUtility::UseLocalSystem ( )
inlinevirtual

This method returns if it depends on space.

Returns
True if it uses the local system, false otherwise

Reimplemented in Kratos::GenericFunctionUtility.

Member Data Documentation

◆ mDependsOnSpace

bool Kratos::BasicGenericFunctionUtility::mDependsOnSpace = true
protected

The function body.

◆ mFunctionBody

std::string Kratos::BasicGenericFunctionUtility::mFunctionBody
protected

The function parser.

◆ mpTinyExpr

std::vector<te_expr*> Kratos::BasicGenericFunctionUtility::mpTinyExpr = std::vector<te_expr*>(1, nullptr)
protected

The variables values considered on the function.

◆ mValues

array_1d<double, 7> Kratos::BasicGenericFunctionUtility::mValues = ZeroVector(7)
protected

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