36 #ifndef NEKTAR_LIBUTILITIES_INTERPRETER_INTERPRETER_H
37 #define NEKTAR_LIBUTILITIES_INTERPRETER_INTERPRETER_H
46 namespace LibUtilities
129 std::map<std::string, NekDouble>
const& constants);
167 std::map<std::string, NekDouble>
const& params);
222 const std::string& vlist,
const std::string& expr);
262 std::vector<NekDouble> point);
314 const int expression_id,
322 std::unique_ptr<ExpressionEvaluator>
m_impl;
#define LIB_UTILITIES_EXPORT
Concrete implementation of the interface defined in Interpreter.
Interpreter class for the evaluation of mathematical expressions.
NekDouble GetTime() const
Returns the total walltime spent in evaluation procedures in seconds.
void AddConstants(std::map< std::string, NekDouble > const &constants)
Set constants to be evaluated.
Interpreter()
Default constructor.
std::unique_ptr< ExpressionEvaluator > m_impl
Concrete implementation of the above API calls.
Interpreter & operator=(Interpreter &&)
Default assignment operator.
void Evaluate(const int expression_id, const std::vector< Array< OneD, const NekDouble > > &points, Array< OneD, NekDouble > &result)
Evaluate a function which depends on zero or more variables.
NekDouble GetConstant(std::string const &name)
Return the value of a constant.
int AddConstant(std::string const &name, NekDouble value)
Set constants to be evaluated.
NekDouble EvaluateAtPoint(const int id, std::vector< NekDouble > point)
Evaluate a function which depends on zero or more variables.
int DefineFunction(const std::string &vlist, const std::string &expr)
Defines a function for the purposes of evaluation.
~Interpreter()
Default destructor.
void SetParameters(std::map< std::string, NekDouble > const ¶ms)
Set parameter values.
void SetParameter(std::string const &name, NekDouble value)
Set parameter values.
NekDouble Evaluate(const int id)
Evaluate a function which depends only on constants and/or parameters.
NekDouble GetParameter(std::string const &name)
Get the value of a parameter.
void SetRandomSeed(unsigned int seed=123u)
Sets the random seed for the pseudorandom number generator.
std::shared_ptr< Interpreter > InterpreterSharedPtr
The above copyright notice and this permission notice shall be included.