Go to the documentation of this file.
39 namespace functionEntries
55 primitiveEntryIstream,
66 const dictionary& parentDict,
71 <<
"Using #calc at line " << is.lineNumber()
72 <<
" in file " << parentDict.name() <<
endl;
76 "functionEntries::calcEntry::evaluate(..)",
84 dictionary codeSubDict;
85 codeSubDict.add(
"code",
"os << (" +
s +
");");
86 dictionary codeDict(parentDict, codeSubDict);
89 OStringStream os(is.format());
92 (*function)(os, parentDict);
109 entry.read(parentDict, result);
122 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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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,...
addNamedToMemberFunctionSelectionTable(functionEntry, calcEntry, execute, dictionaryIstream, calc)
Input from string buffer, using a ISstream.
bool read(Istream &is)
Read dictionary from Istream.
A functionEntry causes entries to be added/manipulated on the specified dictionary given an input str...
string evaluate(const std::string &s, size_t pos=0, size_t len=std::string::npos)
static bool execute(const dictionary &parentDict, primitiveEntry &entry, Istream &is)
Execute in a primitiveEntry context.