108 std :: ostringstream buff;
112 for (
const auto &named_arg : valDict ) {
115 buff << named_arg.first <<
"=" << arg.
val0 <<
";";
118 buff << named_arg.first << i <<
"=" << arg.
val1.
at(i) <<
";";
121 buff << named_arg.first <<
"=" << arg.
val2 <<
";";
124 buff << named_arg.first << i <<
"=" << arg.
val3.
at(i) <<
";";
131 double value = p.
eval(buff.str().c_str(), err);
133 OOFEM_ERROR(
"parser syntax error (expr=\"%s\")", buff.str().c_str() );
154 std :: map< std :: string, FunctionArgument >valDict;
155 valDict.insert( std :: make_pair(
"t", time) );
156 return this->
eval(valDict, d);
174 out <<
'$' << s.
eValue <<
'$';
double dValue
Constant, double value.
double eval(const std::map< std::string, FunctionArgument >valDict, Domain *d, GaussPoint *gp=NULL, double param=0.) const
Evaluates the receiver.
double & at(int i)
Coefficient access function.
std::string eValue
Simple expression (evaluated by internal parser)
bool isDefined() const
True if receiver is defined.
double evaluate(TimeStep *tStep, ValueModeType mode)
Returns the value of load time function at given time.
int & at(int i)
Coefficient access function.
void setValue(double val)
Sets receiver to be a constant scalar function defined by given value.
friend std::ostream & operator<<(std::ostream &out, const ScalarFunction &s)
Wrapper for values of varying types.
void setReference(int val)
Sets receiver to be a scalar function defined using external function.
ScalarFunction()
Creates empty constant scalar function.
void setSimpleExpression(std::string &val)
Sets receiver to be a scalar funtion defined by given simple expression.
Function * giveFunction(int n)
Service for accessing particular domain load time function.
int fReference
Reference to external function.
FunctionArgumentType type
Determines which of the types the instance points towards.
Class representing vector of real numbers.
Implementation of Scalar function.
enum oofem::ScalarFunction::@1 dvType
Enum value determining the dataValue type.
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
Class representing integration point in finite element program.
Class for evaluating mathematical expressions in strings.
double eval(const char *string, int &err)