Go to the documentation of this file.
49ScalarFunction :: ScalarFunction()
54ScalarFunction :: ScalarFunction(
double val)
61ScalarFunction :: ScalarFunction(std :: string &val)
68ScalarFunction :: ScalarFunction(
int val)
75ScalarFunction :: ~ScalarFunction() { }
79ScalarFunction :: setValue(
double val)
87ScalarFunction :: setSimpleExpression(std :: string &val)
95ScalarFunction :: setReference(
int val)
103ScalarFunction :: eval(
const std :: map< std :: string, FunctionArgument >valDict,
Domain *d,
GaussPoint *gp,
double param)
const
108 std :: ostringstream buff;
112 for (
const auto &named_arg : valDict ) {
114 if ( arg.
type == FunctionArgument :: FAT_double ) {
115 buff << named_arg.first <<
"=" << arg.
val0 <<
";";
116 }
else if ( arg.
type == FunctionArgument :: FAT_FloatArray ) {
118 buff << named_arg.first << i <<
"=" << arg.
val1.
at(i) <<
";";
120 }
else if ( arg.
type == FunctionArgument :: FAT_int ) {
121 buff << named_arg.first <<
"=" << arg.
val2 <<
";";
122 }
else if ( arg.
type == FunctionArgument :: FAT_IntArray ) {
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() );
149ScalarFunction :: eval(
double time,
Domain *d)
const
154 std :: map< std :: string, FunctionArgument >valDict;
155 valDict.insert( std :: make_pair(
"t", time) );
156 return this->
eval(valDict, d);
161ScalarFunction :: isDefined()
const
171 if ( s.
dvType == ScalarFunction :: DV_ValueType ) {
173 }
else if ( s.
dvType == ScalarFunction :: DV_SimpleExpressionType ) {
174 out <<
'$' << s.
eValue <<
'$';
Function * giveFunction(int n)
Index giveSize() const
Returns the size of receiver.
FunctionArgumentType type
Determines which of the types the instance points towards.
virtual double evaluate(TimeStep *tStep, ValueModeType mode)
double eval(const char *string, int &err)
enum oofem::ScalarFunction::@044127242061323210226146117116105310173173316037 dvType
Enum value determining the dataValue type.
double dValue
Constant, double value.
void setSimpleExpression(std ::string &val)
int fReference
Reference to external function.
@ DV_FunctionReferenceType
@ DV_SimpleExpressionType
double eval(const std ::map< std ::string, FunctionArgument >valDict, Domain *d, GaussPoint *gp=NULL, double param=0.) const
void setReference(int val)
void setValue(double val)
std::string eValue
Simple expression (evaluated by internal parser).
std::ostream & operator<<(std ::ostream &out, const Dictionary &r)
This page is part of the
OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak
Bořek Patzák
Project e-mail:
oofem@fsv.cvut.cz
Generated at for OOFEM by
doxygen
1.15.0 written by Dimitri van Heesch,
© 1997-2011