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::GenericFunctionUtility Class Reference

GenericFunctionUtility. More...

#include <function_parser_utility.h>

Inheritance diagram for Kratos::GenericFunctionUtility:
Collaboration diagram for Kratos::GenericFunctionUtility:

Public Member Functions

Life Cycle
 GenericFunctionUtility (const std::string &rFunctionBody, Parameters LocalSystem=Parameters{})
 Default constructor. More...
 
 GenericFunctionUtility (GenericFunctionUtility const &rOther)
 Copy constructor. More...
 
 ~GenericFunctionUtility () override
 Destructor. More...
 
Operations
Pointer Clone ()
 This method clones the current function instance. More...
 
bool UseLocalSystem () override
 This method returns if it depends on space. More...
 
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) override
 This method rotates and calls the evaluation function. More...
 
- Public Member Functions inherited from Kratos::BasicGenericFunctionUtility
 BasicGenericFunctionUtility (const std::string &rFunctionBody)
 Default constructor. More...
 
 BasicGenericFunctionUtility (BasicGenericFunctionUtility const &rOther)
 Copy constructor. More...
 
virtual ~BasicGenericFunctionUtility ()
 Destructor. More...
 
Pointer Clone ()
 This method clones the current function instance. More...
 
bool DependsOnSpace ()
 This method returns if it depends on space. More...
 
std::string FunctionBody ()
 This method returns the function body. 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...
 
 KRATOS_CLASS_POINTER_DEFINITION (BasicGenericFunctionUtility)
 Counted pointer of BasicGenericFunctionUtility. More...
 

Type definitions

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

Additional Inherited Members

- Public Types inherited from Kratos::BasicGenericFunctionUtility
typedef std::size_t IndexType
 The index type definition. More...
 
- Protected Member Functions inherited from Kratos::BasicGenericFunctionUtility
void InitializeParser ()
 This method initializes the parser classes. More...
 
- Protected Attributes inherited from Kratos::BasicGenericFunctionUtility
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...
 

Detailed Description

GenericFunctionUtility.

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

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

The object is then insantiated as aux_function = GenericFunctionUtility(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

◆ GenericFunctionUtility() [1/2]

Kratos::GenericFunctionUtility::GenericFunctionUtility ( const std::string &  rFunctionBody,
Parameters  LocalSystem = Parameters{} 
)

Default constructor.

Parameters
rFunctionBodyThe string defining the function
LocalSystemThe parameters defining the local system

◆ GenericFunctionUtility() [2/2]

Kratos::GenericFunctionUtility::GenericFunctionUtility ( GenericFunctionUtility const &  rOther)

Copy constructor.

◆ ~GenericFunctionUtility()

Kratos::GenericFunctionUtility::~GenericFunctionUtility ( )
inlineoverride

Destructor.

Member Function Documentation

◆ Clone()

Pointer Kratos::GenericFunctionUtility::Clone ( )
inline

This method clones the current function instance.

Returns
A clone of the current class

◆ KRATOS_CLASS_POINTER_DEFINITION()

Kratos::GenericFunctionUtility::KRATOS_CLASS_POINTER_DEFINITION ( GenericFunctionUtility  )

Counted pointer of GenericFunctionUtility.

◆ RotateAndCallFunction()

double Kratos::GenericFunctionUtility::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 
)
overridevirtual

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 from Kratos::BasicGenericFunctionUtility.

◆ UseLocalSystem()

bool Kratos::GenericFunctionUtility::UseLocalSystem ( )
inlineoverridevirtual

This method returns if it depends on space.

Returns
True if it uses the local system, false otherwise

Reimplemented from Kratos::BasicGenericFunctionUtility.


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