85 void Foam::codedFunctionObject::prepare
88 const dynamicCodeContext& context
91 dynCode.setFilterVariable(
"typeName", codeName());
94 dynCode.addCompileFile(codeTemplateC(
"codedFunctionObject"));
97 dynCode.addCopyFile(codeTemplateH(
"codedFunctionObject"));
100 dynCode.setFilterVariable(
"verbose",
Foam::name(
bool(debug)));
104 Info<<
"compile " << codeName() <<
" sha1: " << context.sha1() <<
endl;
108 dynCode.setMakeOptions
111 "-I$(LIB_SRC)/finiteVolume/lnInclude \\\n"
112 "-I$(LIB_SRC)/meshTools/lnInclude \\\n"
114 +
"\n\nLIB_LIBS = \\\n"
116 +
" -lfiniteVolume \\\n"
117 +
" -lmeshTools \\\n"
123 void Foam::codedFunctionObject::clearRedirect()
const
125 redirectFunctionObjectPtr_.clear();
155 if (!redirectFunctionObjectPtr_.valid())
158 constructDict.set(
"type", codeName());
167 return redirectFunctionObjectPtr_();
174 return redirectFunctionObject().fields();
181 return redirectFunctionObject().execute();
188 return redirectFunctionObject().write();
195 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.
static const word null
An empty word.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
defineTypeNameAndDebug(combustionModel, 0)