Provides a general interface to enable dynamic code compilation. More...
Public Member Functions | |
TypeName ("coded") | |
codedFunctionObject (const word &name, const Time &runTime, const dictionary &dict) | |
virtual | ~codedFunctionObject ()=default |
functionObject & | redirectFunctionObject () const |
virtual bool | execute () |
virtual bool | write () |
virtual bool | end () |
virtual bool | read (const dictionary &) |
![]() | |
timeFunctionObject (const word &name, const Time &runTime) | |
virtual | ~timeFunctionObject ()=default |
const Time & | time () const |
objectRegistry & | storedObjects () |
const objectRegistry & | storedObjects () const |
![]() | |
declareRunTimeSelectionTable (autoPtr, functionObject, dictionary,(const word &name, const Time &runTime, const dictionary &dict),(name, runTime, dict)) | |
functionObject (const word &name, const bool withNamePrefix=defaultUseNamePrefix) | |
autoPtr< functionObject > | clone () const |
virtual | ~functionObject ()=default |
virtual const word & | type () const =0 |
const word & | name () const noexcept |
bool | useNamePrefix () const noexcept |
bool | useNamePrefix (bool on) noexcept |
virtual bool | execute (const label subIndex) |
virtual bool | adjustTimeStep () |
virtual bool | filesModified () const |
virtual void | updateMesh (const mapPolyMesh &mpm) |
virtual void | movePoints (const polyMesh &mesh) |
![]() | |
ClassName ("codedBase") | |
codedBase ()=default | |
virtual | ~codedBase ()=default |
Static Public Attributes | |
static constexpr const char *const | codeTemplateC = "functionObjectTemplate.C" |
static constexpr const char *const | codeTemplateH = "functionObjectTemplate.H" |
![]() | |
static int | debug |
static bool | postProcess |
static bool | defaultUseNamePrefix |
static word | outputPrefix |
Protected Member Functions | |
virtual dlLibraryTable & | libs () const |
virtual string | description () const |
virtual void | clearRedirect () const |
virtual const dictionary & | codeContext () const |
virtual const dictionary & | codeDict () const |
virtual void | prepare (dynamicCode &, const dynamicCodeContext &) const |
codedFunctionObject (const codedFunctionObject &)=delete | |
void | operator= (const codedFunctionObject &)=delete |
![]() | |
void | clearOutputObjects (const wordList &objNames) |
timeFunctionObject (const timeFunctionObject &)=delete | |
void | operator= (const timeFunctionObject &)=delete |
![]() | |
word | scopedName (const word &name) const |
![]() | |
dynamicCodeContext & | codeContext () |
void | setCodeContext (const dictionary &dict) |
void | append (const std::string &str) |
void | updateLibrary (const word &name, const dynamicCodeContext &context) const |
void | updateLibrary (const word &name, const dictionary &dict) const |
void | updateLibrary (const word &name) const |
codedBase (const codedBase &)=delete | |
void | operator= (const codedBase &)=delete |
Protected Attributes | |
dictionary | dict_ |
word | name_ |
string | codeData_ |
string | codeRead_ |
string | codeExecute_ |
string | codeWrite_ |
string | codeEnd_ |
autoPtr< functionObject > | redirectFunctionObjectPtr_ |
![]() | |
const Time & | time_ |
Additional Inherited Members | |
![]() | |
static autoPtr< functionObject > | New (const word &name, const Time &runTime, const dictionary &dict) |
![]() | |
bool | log |
![]() | |
static void | writeCodeDict (Ostream &os, const dictionary &dict) |
static const dictionary & | codeDict (const objectRegistry &obr, const word &dictName="codeDict") |
Provides a general interface to enable dynamic code compilation.
codeInclude | : | include files |
codeOptions | : | compiler line: added to EXE_INC (Make/options) |
codeLibs | : | linker line: added to LIB_LIBS (Make/options) |
codeData | : | c++; local member data (default constructed) |
localCode | : | c++; local static functions |
codeRead | : | c++; upon functionObject::read() |
codeExecute | : | c++; upon functionObject::execute() |
codeWrite | : | c++; upon functionObject::write() |
codeEnd | : | c++; upon functionObject::end() |
codeContext | : | additional dictionary context for the code |
difference { type coded; libs (utilityFunctionObjects); // Name of on-the-fly generated functionObject name writeMagU; codeWrite #{ // Lookup U const volVectorField& U = mesh().lookupObject<volVectorField>("U"); // Write mag(U)().write(); #}; }
codeContext
entry.Definition at line 136 of file codedFunctionObject.H.
|
protecteddelete |
codedFunctionObject | ( | const word & | name, |
const Time & | runTime, | ||
const dictionary & | dict | ||
) |
Definition at line 128 of file codedFunctionObject.C.
References Foam::read().
|
virtualdefault |
|
protectedvirtual |
Implements codedBase.
Definition at line 50 of file codedFunctionObject.C.
References Time::libs(), and timeFunctionObject::time_.
|
protectedvirtual |
Implements codedBase.
Definition at line 56 of file codedFunctionObject.C.
References Foam::name().
|
protectedvirtual |
Implements codedBase.
Definition at line 62 of file codedFunctionObject.C.
|
protectedvirtual |
Definition at line 69 of file codedFunctionObject.C.
References dictionary::findDict(), keyType::LITERAL, and dictionary::null.
|
protectedvirtual |
Implements codedBase.
Definition at line 77 of file codedFunctionObject.C.
|
protectedvirtual |
Implements codedBase.
Definition at line 84 of file codedFunctionObject.C.
References dynamicCode::addCompileFile(), dynamicCode::addCopyFile(), DetailInfo, Foam::endl(), dynamicCodeContext::libs(), dynamicCodeContext::options(), dynamicCode::setFilterVariable(), dynamicCode::setMakeOptions(), and dynamicCodeContext::sha1().
|
protecteddelete |
TypeName | ( | "coded" | ) |
Foam::functionObject & redirectFunctionObject | ( | ) | const |
Definition at line 148 of file codedFunctionObject.C.
References dictionaryContent::dict(), functionObject::New(), Foam::nl, dictionary::set(), and WarningInFunction.
|
virtual |
Implements functionObject.
Definition at line 182 of file codedFunctionObject.C.
|
virtual |
Implements functionObject.
Definition at line 189 of file codedFunctionObject.C.
|
virtual |
Reimplemented from functionObject.
Definition at line 196 of file codedFunctionObject.C.
|
virtual |
Reimplemented from functionObject.
Definition at line 203 of file codedFunctionObject.C.
References codedBase::codeContext(), dict, Foam::endl(), IOWarningInFunction, Foam::nl, functionObject::read(), and codedBase::setCodeContext().
|
protected |
Definition at line 146 of file codedFunctionObject.H.
|
protected |
Definition at line 148 of file codedFunctionObject.H.
|
protected |
Definition at line 150 of file codedFunctionObject.H.
|
protected |
Definition at line 151 of file codedFunctionObject.H.
|
protected |
Definition at line 152 of file codedFunctionObject.H.
|
protected |
Definition at line 153 of file codedFunctionObject.H.
|
protected |
Definition at line 154 of file codedFunctionObject.H.
|
mutableprotected |
Definition at line 157 of file codedFunctionObject.H.
|
staticconstexpr |
Definition at line 194 of file codedFunctionObject.H.
|
staticconstexpr |
Definition at line 198 of file codedFunctionObject.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.