65 return "functionObject " +
name();
113 <<
"compile " << name_ <<
" sha1: " << context.
sha1() <<
endl;
120 "-I$(LIB_SRC)/finiteVolume/lnInclude \\\n"
121 "-I$(LIB_SRC)/meshTools/lnInclude \\\n"
123 +
"\n\nLIB_LIBS = \\\n"
125 " -lfiniteVolume \\\n"
157 if (!redirectFunctionObjectPtr_)
160 constructDict.set(
"type", name_);
176 contentPtr->dict(this->codeContext());
181 << name_ <<
" Did not derive from dictionaryContent"
185 return *redirectFunctionObjectPtr_;
216 dict.readCompat<
word>(
"name", {{
"redirectType", 1706}}, name_);
222 nKeywords += ctx.readIfPresent(
"codeData", codeData_);
223 nKeywords += ctx.readIfPresent(
"codeRead", codeRead_);
224 nKeywords += ctx.readIfPresent(
"codeExecute", codeExecute_);
225 nKeywords += ctx.readIfPresent(
"codeWrite", codeWrite_);
226 nKeywords += ctx.readIfPresent(
"codeEnd", codeEnd_);
231 <<
"No critical \"code\" prefixed keywords found." <<
nl
232 <<
"Please check the code documentation for more details." <<
nl
236 updateLibrary(name_);
237 return redirectFunctionObject().read(
dict);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
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 that provides methods for ...
void updateLibrary(const word &name, const dynamicCodeContext &context) const
Update library as required, using the given context.
codedBase(const codedBase &)=delete
No copy construct.
void setCodeContext(const dictionary &dict)
Set code context from a dictionary.
dynamicCodeContext & codeContext()
Access to the dynamic code context.
A wrapper for dictionary content, without operators that could affect inheritance patterns.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
A table of dynamically loaded libraries.
Encapsulation of dynamic code dictionaries.
const string & libs() const noexcept
The code libs (LIB_LIBS).
const SHA1 & sha1() const noexcept
The SHA1 calculated from options, libs, include, code, etc.
const string & options() const noexcept
The code options (Make/options).
Tools for handling dynamic code compilation.
void addCopyFile(const fileName &name)
Add a file template name, which will be found and filtered.
void setFilterVariable(const word &key, const std::string &value)
Define a filter variable.
void addCompileFile(const fileName &name)
Add a file template name, which will be found and filtered.
void setMakeOptions(const std::string &content)
Define contents for Make/options.
Abstract base-class for Time/database function objects.
const word & name() const noexcept
Return the name of this functionObject.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
static autoPtr< functionObject > New(const word &name, const Time &runTime, const dictionary &dict)
Select from dictionary, based on its "type" entry.
Provides a general interface to enable dynamic code compilation.
virtual const dictionary & codeContext() const
Additional 'codeContext' dictionary to pass through.
virtual void prepare(dynamicCode &, const dynamicCodeContext &) const
Adapt the context for the current object.
autoPtr< functionObject > redirectFunctionObjectPtr_
Underlying functionObject.
functionObject & redirectFunctionObject() const
Dynamically compiled functionObject.
dictionary dict_
Input dictionary.
codedFunctionObject(const codedFunctionObject &)=delete
No copy construct.
static constexpr const char *const codeTemplateC
Name of the C code template to be used.
virtual const dictionary & codeDict() const
The code dictionary.
virtual void clearRedirect() const
Clear redirected object(s).
static constexpr const char *const codeTemplateH
Name of the H code template to be used.
virtual bool execute()
Called at each ++ or += of the time-loop.
virtual bool write()
Called at each ++ or += of the time-loop.
virtual dlLibraryTable & libs() const
Mutable access to the loaded dynamic libraries.
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.
virtual string description() const
Description (type + name) for the output.
Virtual base class for function objects with a reference to Time.
const Time & time_
Reference to the time database.
timeFunctionObject(const timeFunctionObject &)=delete
No copy construct.
A class for handling character strings derived from std::string.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
#define WarningInFunction
Report a warning using Foam::Warning.
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
constexpr char nl
The newline '\n' character (0x0a).