Go to the documentation of this file.
38 void Foam::expressions::patchExprFieldBase::readExpressions
40 const dictionary&
dict,
41 enum expectedTypes expectedType,
54 string exprValue, exprGrad, exprFrac;
55 bool evalValue =
false, evalGrad =
false, evalFrac =
false;
57 if (expectedTypes::VALUE_TYPE == expectedType)
60 evalValue =
dict.readEntry(
"valueExpr", exprValue);
62 else if (expectedTypes::GRADIENT_TYPE == expectedType)
65 evalGrad =
dict.readEntry(
"gradientExpr", exprGrad);
70 evalValue =
dict.readIfPresent(
"valueExpr", exprValue);
71 evalGrad =
dict.readIfPresent(
"gradientExpr", exprGrad);
73 if (!evalValue && !evalGrad)
76 <<
"Entries 'valueExpr' and 'gradientExpr' "
77 "(mixed-conditon) not found in dictionary "
86 Info<<
"Mixed with no valueExpr" <<
nl;
90 Info<<
"Mixed with no gradientExpr" <<
nl;
99 if (evalValue && evalGrad &&
dict.readIfPresent(
"fractionExpr", exprFrac))
103 if (exprFrac ==
"0" || exprFrac ==
"1")
108 else if (!exprFrac.empty())
113 exprFrac =
"toPoint(" + exprFrac +
")";
141 evalOnConstruct_(false),
155 debug_(
dict.getOrDefault(
"debug",
false)),
156 evalOnConstruct_(
dict.getOrDefault(
"evalOnConstruct",
false)),
161 readExpressions(
dict, expectedType, wantPointData);
173 if (!valueExpr_.empty())
177 if (!gradExpr_.empty())
181 if (!fracExpr_.empty())
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
bool debug_
Add debugging.
expectedTypes
Enumeration of expected expressions.
void inplaceTrim(std::string &s)
Trim leading and trailing whitespace inplace.
expressions::exprString gradExpr_
patchExprFieldBase()
Default construct.
messageStream Info
Information stream (uses stdout - output is on the master only)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
expressions::exprString fracExpr_
errorManipArg< error, int > exit(error &err, const int errNo=1)
void write(Ostream &os) const
Write.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
expressions::exprString valueExpr_