69 void Foam::codedFunctionObject::prepare
72 const dynamicCodeContext& context
75 dynCode.setFilterVariable(
"typeName", codeName());
78 dynCode.addCompileFile(codeTemplateC(
"codedFunctionObject"));
81 dynCode.addCopyFile(codeTemplateH(
"codedFunctionObject"));
86 dynCode.setFilterVariable(
"verbose",
"true");
87 Info<<
"compile " << codeName() <<
" sha1: "
88 << context.sha1() <<
endl;
92 dynCode.setMakeOptions
95 "-I$(LIB_SRC)/finiteVolume/lnInclude \\\n"
96 "-I$(LIB_SRC)/meshTools/lnInclude \\\n"
98 +
"\n\nLIB_LIBS = \\\n"
100 +
" -lfiniteVolume \\\n"
101 +
" -lmeshTools \\\n"
107 void Foam::codedFunctionObject::clearRedirect()
const
109 redirectFunctionObjectPtr_.clear();
139 if (!redirectFunctionObjectPtr_.valid())
142 constructDict.set(
"type", codeName());
151 return redirectFunctionObjectPtr_();
158 return redirectFunctionObject().fields();
165 return redirectFunctionObject().execute();
172 return redirectFunctionObject().write();
179 return redirectFunctionObject().end();
Macros for easy insertion into run-time selection tables.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Base class for function objects and boundary conditions using dynamic code.
Provides a general interface to enable dynamic code compilation.
virtual ~codedFunctionObject()
Destructor.
virtual wordList fields() const
Return the list of fields required.
codedFunctionObject(const word &name, const Time &time, const dictionary &dict)
Construct from Time and dictionary.
virtual bool execute()
Called at each ++ or += of the time-loop.
virtual bool write()
Called at each ++ or += of the time-loop.
virtual bool end()
Called when Time::run() determines that the time-loop exits.
virtual bool read(const dictionary &)
Read and set the function object if its data have changed.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Abstract base-class for Time/database functionObjects.
static autoPtr< functionObject > New(const word &name, const Time &, const dictionary &)
Select from dictionary, based on its "type" entry.
virtual bool read(const dictionary &)
Read and set the functionObject if its data have changed.
A class for handling words, derived from string.
Ostream & endl(Ostream &os)
Add newline and flush stream.
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)