35#ifndef pythonexpression_h
36#define pythonexpression_h
47#define _IFT_PythonExpression_Name "pythonexpression"
48#define _IFT_PythonExpression_f "f"
49#define _IFT_PythonExpression_dfdt "dfdt"
50#define _IFT_PythonExpression_d2fdt2 "d2fdt2"
51#define _IFT_PythonExpression_ffile "fpath"
52#define _IFT_PythonExpression_dfdtfile "dfdtpath"
53#define _IFT_PythonExpression_d2fdt2file "d2fdt2path"
79 PyObject *
getDict(
const std :: map< std :: string, FunctionArgument > &valDict);
106 void evaluate(
FloatArray &answer,
const std :: map< std :: string, FunctionArgument > &valDict,
GaussPoint *gp=
nullptr,
double param=0.)
override;
117 void readFile2String(
const std :: string &path, std :: string &content);
Function(int n, Domain *d)
double getScalar(PyObject *func, double time)
Helper function to run given function for given time.
void evaluate(FloatArray &answer, const std ::map< std ::string, FunctionArgument > &valDict, GaussPoint *gp=nullptr, double param=0.) override
std::string d2fdt2Expression
Expression for second time derivative or path to python script.
void initializeFrom(InputRecord &ir) override
const char * giveInputRecordName() const override
void giveInputRecord(DynamicInputRecord &ir) override
void evaluateAcceleration(FloatArray &answer, const std ::map< std ::string, FunctionArgument > &valDict)
double pyObj2double(PyObject *obj)
void evaluateVelocity(FloatArray &answer, const std ::map< std ::string, FunctionArgument > &valDict)
std::string dfdtExpression
Expression for first time derivative or path to python script.
PythonExpression(int n, Domain *d)
double evaluateAtTime(double t) override
PyObject * getDict(const std ::map< std ::string, FunctionArgument > &valDict)
Helper function to convert the std::map to a Python dictionary.
void getArray(FloatArray &answer, PyObject **func, const std ::map< std ::string, FunctionArgument > &valDict)
Helper function to run given function for given value dictionary.
const char * giveClassName() const override
double evaluateVelocityAtTime(double t) override
std::string fExpression
Expression for the function value or path to python script.
double evaluateAccelerationAtTime(double t) override
#define _IFT_PythonExpression_Name