38 return this->
time().libs();
46 return "CodedFunction1 " + redirectName_;
53 redirectFunctionPtr_.reset(
nullptr);
80 :
dict.subDict(redirectName_)
100 if (context.
code().empty())
103 <<
"No code section in input dictionary for Function1 "
104 <<
" name " << redirectName_
123 <<
"compile " << redirectName_ <<
" sha1: " << context.
sha1() <<
endl;
130 "-I$(LIB_SRC)/meshTools/lnInclude \\\n"
132 +
"\n\nLIB_LIBS = \\\n"
145 const word& entryName,
153 redirectName_(
dict.getOrDefault<
word>(
"name", entryName))
172 redirectName_(
rhs.redirectName_)
180Foam::Function1Types::CodedFunction1<Type>::redirectFunction()
const
182 if (!redirectFunctionPtr_)
190 coeffs.
set(
"type", redirectName_);
192 redirectFunctionPtr_.reset
208 contentPtr->dict(this->codeContext());
213 << redirectName_ <<
" Did not derive from dictionaryContent"
217 return *redirectFunctionPtr_;
230 return redirectFunction().value(
x);
243 dict_.writeEntry(this->
name(), os);
Function1 with the code supplied by an on-the-fly compiled C++ expression.
CodedFunction1(const word &entryName, const dictionary &dict, const objectRegistry *obrPtr=nullptr)
Construct from entry name, dictionary and optional registry.
virtual const dictionary & codeContext() const
Additional 'codeContext' dictionary to pass through.
virtual const dictionary & codeDict(const dictionary &dict) const
virtual void prepare(dynamicCode &, const dynamicCodeContext &) const
Adapt the context for the current object.
virtual void writeData(Ostream &os) const
Write in dictionary format.
static constexpr const char *const codeTemplateC
Name of the C code template to be used.
virtual const dictionary & codeDict() const
virtual Type value(const scalar x) const
Return value at current time.
virtual void clearRedirect() const
Clear redirected object(s).
static constexpr const char *const codeTemplateH
Name of the H code template to be used.
virtual dlLibraryTable & libs() const
Mutable access to the loaded dynamic libraries.
virtual string description() const
Description (type + name) for the output.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Function1(const word &entryName, const objectRegistry *obrPtr=nullptr)
Construct from entry name.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
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.
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,...
dictionary & subDictOrAdd(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary for manipulation.
bool remove(const word &keyword)
Remove an entry specified by keyword.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
A table of dynamically loaded libraries.
Encapsulation of dynamic code dictionaries.
const string & code() const noexcept
The code.
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 setFieldTemplates()
Define a filter variables TemplateType and FieldType.
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.
const Time & time() const
Return the time database.
Registry of regIOobjects.
A class for handling character strings derived from std::string.
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).