78 void Foam::codedFunctionObject::prepare
81 const dynamicCodeContext& context
84 dynCode.setFilterVariable(
"typeName",
codeName());
93 dynCode.setFilterVariable(
"verbose",
Foam::name(
bool(debug)));
101 dynCode.setMakeOptions
104 "-I$(LIB_SRC)/finiteVolume/lnInclude \\\n"
105 "-I$(LIB_SRC)/meshTools/lnInclude \\\n"
107 +
"\n\nLIB_LIBS = \\\n"
109 +
" -lfiniteVolume \\\n"
110 +
" -lmeshTools \\\n"
116 void Foam::codedFunctionObject::updateLibrary(
const dictionary&
dict)
118 redirectFunctionObjectPtr_.clear();
122 dictionary constructDict(
dict);
123 constructDict.set(
"type", codeName());
160 if (!redirectFunctionObjectPtr_.valid())
166 return redirectFunctionObjectPtr_();
172 return redirectFunctionObject().fields();
178 return redirectFunctionObject().execute();
184 return redirectFunctionObject().write();
190 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.
word codeTemplateC(const word &baseTypeName) const
void read(const dictionary &dict)
Read the dictionary and update the code.
const word & codeName() const
Name of the dynamically generated CodedType.
word codeTemplateH(const word &baseTypeName) const
bool updateLibrary(const dictionary &dict) const
Update library from given updated dictionary as required.
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
Ostream & endl(Ostream &os)
Add newline and flush stream.
defineTypeNameAndDebug(combustionModel, 0)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.