Go to the documentation of this file.
39 namespace functionEntries
55 primitiveEntryIstream,
66 const dictionary& parentDict,
71 <<
"Using #calc - line "
72 << is.lineNumber() <<
" in file "
73 << parentDict.relativeName() <<
nl;
77 "functionEntries::calcEntry::evaluate(..)",
85 dictionary codeSubDict;
86 codeSubDict.add(
"code",
"os << (" +
s +
");");
87 dictionary codeDict(parentDict, codeSubDict);
90 OStringStream
os(is.format());
93 (*function)(
os, parentDict);
110 entry.read(parentDict, result);
123 parentDict.
read(result);
A keyword and a list of tokens is an 'entry'.
A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read,...
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Uses dynamic compilation to provide calculating functionality for entering dictionary entries.
A class for handling character strings derived from std::string.
static streamingFunctionType getFunction(const dictionary &parentDict, const dictionary &codeDict)
Construct, compile, load and return streaming function.
void(* streamingFunctionType)(Ostream &, const dictionary &)
Interpreter function type.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
static void checkSecurity(const char *title, const dictionary &)
Check security for creating dynamic code.
Macros for easy insertion into member function selection tables.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
addNamedToMemberFunctionSelectionTable(functionEntry, calcEntry, execute, dictionaryIstream, calc)
Input from string buffer, using a ISstream. Always UNCOMPRESSED.
bool read(Istream &is)
Read dictionary from Istream. Discards the header.
A functionEntry causes entries to be added/manipulated on the specified dictionary given an input str...
string evaluate(label fieldWidth, const std::string &s, size_t pos=0, size_t len=std::string::npos)
String evaluation with specified (positive, non-zero) field width.
static bool execute(const dictionary &parentDict, primitiveEntry &entry, Istream &is)
Execute in a primitiveEntry context.