38void 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;
76 if (!evalValue && !evalGrad)
79 <<
"Entries 'valueExpr' and 'gradientExpr' "
80 "(mixed-conditon) not found in dictionary "
89 Info<<
"Mixed with no valueExpr" <<
nl;
93 Info<<
"Mixed with no gradientExpr" <<
nl;
106 if (exprFrac ==
"0" || exprFrac ==
"1")
111 else if (!exprFrac.empty())
116 exprFrac =
"toPoint(" + exprFrac +
")";
144 evalOnConstruct_(false),
158 debug_(
dict.getOrDefault(
"debug", false)),
159 evalOnConstruct_(
dict.getOrDefault(
"evalOnConstruct", false)),
164 readExpressions(
dict, expectedType, wantPointData);
172 os.writeEntryIfDifferent<
bool>(
"evalOnConstruct",
false, evalOnConstruct_);
177 valueExpr_.writeEntry(
"valueExpr",
os,
false);
178 gradExpr_.writeEntry(
"gradientExpr",
os,
false);
179 fracExpr_.writeEntry(
"fractionExpr",
os,
false);
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const fileName & name() const noexcept
The dictionary name.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
expressions::exprString fracExpr_
expressions::exprString gradExpr_
expectedTypes
Enumeration of expected expressions.
patchExprFieldBase()
Default construct.
expressions::exprString valueExpr_
bool debug_
Add debugging.
virtual bool write()
Write the output fields.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
void inplaceTrim(std::string &s)
Trim leading and trailing whitespace inplace.
messageStream Info
Information stream (stdout output on master, null elsewhere)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)