41#include <boost/python/raw_function.hpp>
61 Equation &equation = py::extract<Equation &>(args[0]);
64 std::map<std::string, NekDouble> constants;
67 py::list keys = kwargs.keys();
68 for (
int i = 0; i < py::len(keys); ++i)
70 py::object arg = kwargs[keys[i]];
73 constants[py::extract<std::string>(keys[i])] =
74 py::extract<NekDouble>(arg);
95 std::shared_ptr<Interpreter> evaluator, std::string expr, std::string vlist)
97 return std::make_shared<Equation>(evaluator, expr, vlist);
109 return equation->Evaluate();
127 return equation->Evaluate(x, y,
z, t);
146 equation->Evaluate(x, y,
z, tmp);
169 equation->Evaluate(x, y,
z, t, tmp);
192 equation->Evaluate(x, y,
z, t, tmp);
198 py::class_<Equation, std::shared_ptr<Equation>, boost::noncopyable>(
199 "Equation", py::no_init)
209 .def(
"SetParameter", &Equation::SetParameter)
211 .def(
"GetExpression", &Equation::GetExpression)
212 .def(
"GetVlist", &Equation::GetVlist)
214 .def(
"GetTime", &Equation::GetTime);
py::object Equation_SetConstants(py::tuple args, py::dict kwargs)
Wrapper for Equation::SetConstants.
std::shared_ptr< Equation > ConstructEquation(std::shared_ptr< Interpreter > evaluator, std::string expr, std::string vlist)
Construct an equation object from an expression string expr and a list of variables vlist.
Array< OneD, NekDouble > Equation_Evaluate5(std::shared_ptr< Equation > equation, const Array< OneD, const NekDouble > &x, const Array< OneD, const NekDouble > &y, const Array< OneD, const NekDouble > &z, const Array< OneD, const NekDouble > &t)
Wrapper for Equation::Evaluate (overloaded for Array parameters + Array time).
NekDouble Equation_Evaluate2(std::shared_ptr< Equation > equation, const NekDouble x, const NekDouble y=0, const NekDouble z=0, const NekDouble t=0)
Wrapper for Equation::Evaluate (overloaded for constant parameters).
NekDouble Equation_Evaluate1(std::shared_ptr< Equation > equation)
Wrapper for Equation::Evaluate (overloaded for no parameters).
Array< OneD, NekDouble > Equation_Evaluate4(std::shared_ptr< Equation > equation, const Array< OneD, const NekDouble > &x, const Array< OneD, const NekDouble > &y, const Array< OneD, const NekDouble > &z, const NekDouble t)
Wrapper for Equation::Evaluate (overloaded for Array parameters + constant time).
Array< OneD, NekDouble > Equation_Evaluate3(std::shared_ptr< Equation > equation, const Array< OneD, const NekDouble > &x, const Array< OneD, const NekDouble > &y, const Array< OneD, const NekDouble > &z)
Wrapper for Equation::Evaluate (overloaded for Array parameters).
void SetConstants(const std::map< std::string, NekDouble > &constants)
std::vector< double > z(NPUPPER)