Go to the documentation of this file.
38 return this->patch_.boundaryMesh().mesh().time().
libs();
46 return "CodedField " + redirectName_;
53 redirectFunctionPtr_.reset(
nullptr);
80 :
dict.subDict(redirectName_)
89 return codeDict(dict_);
100 if (context.
code().empty())
103 <<
"No code section in input dictionary for patch "
104 << this->patch_.name()
105 <<
" name " << redirectName_
124 <<
"compile " << redirectName_ <<
" sha1: " << context.
sha1() <<
endl;
131 "-I$(LIB_SRC)/finiteVolume/lnInclude \\\n"
132 "-I$(LIB_SRC)/meshTools/lnInclude \\\n"
134 +
"\n\nLIB_LIBS = \\\n"
136 " -lfiniteVolume \\\n"
149 const word& redirectType,
150 const word& entryName,
152 const bool faceValues
158 redirectName_(
dict.getOrDefault<
word>(
"name", entryName))
160 this->codedBase::setCodeContext(dict_);
164 updateLibrary(redirectName_);
188 redirectName_(rhs.redirectName_)
198 if (!redirectFunctionPtr_)
206 coeffs.
set(
"type", redirectName_);
208 redirectFunctionPtr_.reset
225 contentPtr->
dict(this->codeContext());
230 << redirectName_ <<
" Did not derive from dictionaryContent"
234 return *redirectFunctionPtr_;
246 updateLibrary(redirectName_);
248 return redirectFunction().value(
x);
261 updateLibrary(redirectName_);
263 return redirectFunction().integrate(x1, x2);
274 if (redirectFunctionPtr_)
276 redirectFunctionPtr_->autoMap(mapper);
289 if (redirectFunctionPtr_)
291 redirectFunctionPtr_->rmap(pf1, addr);
306 dict_.writeEntry(this->
name(), os);
A table of dynamically loaded libraries.
A class for handling words, derived from Foam::string.
Tools for handling dynamic code compilation.
A class for managing temporary objects.
virtual dlLibraryTable & libs() const
Mutable access to the loaded dynamic libraries.
Encapsulation of dynamic code dictionaries.
virtual void rmap(const PatchFunction1< Type > &pf1, const labelList &addr)
Reverse map the given PatchFunction1 onto this PatchFunction1.
Base class for function objects and boundary conditions using dynamic code that provides methods for ...
Abstract base class to hold the Field mapping addressing and weights.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A class for handling character strings derived from std::string.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
A wrapper for dictionary content, without operators that could affect inheritance patterns.
virtual void autoMap(const FieldMapper &mapper)
Map (and resize as needed) from self given a mapping object.
dictionary & subDictOrAdd(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary for manipulation.
CodedField(const polyPatch &pp, const word &redirectType, const word &entryName, const dictionary &dict, const bool faceValues=true)
Construct from entry name and dictionary.
void addCopyFile(const fileName &name)
Add a file template name, which will be found and filtered.
const SHA1 & sha1() const noexcept
The SHA1 calculated from options, libs, include, code, etc.
void addCompileFile(const fileName &name)
Add a file template name, which will be found and filtered.
virtual tmp< Field< Type > > value(const scalar x) const
Return CodedField value.
A patch is a list of labels that address the faces in the global face list.
virtual void prepare(dynamicCode &, const dynamicCodeContext &) const
Adapt the context for the current object.
virtual const dictionary & codeContext() const
Additional 'codeContext' dictionary to pass through.
const string & libs() const noexcept
The code libs (LIB_LIBS)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
virtual tmp< Field< Type > > integrate(const scalar x1, const scalar x2) const
Integrate between two values.
void setFilterVariable(const word &key, const std::string &value)
Define a filter variable.
static dlLibraryTable & libs()
Table of global libraries.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void setFieldTemplates()
Define a filter variables TemplateType and FieldType.
virtual const dictionary & codeDict() const
virtual void clearRedirect() const
Clear redirected object(s)
void setMakeOptions(const std::string &content)
Define contents for Make/options.
const std::string patch
OpenFOAM patch number as a std::string.
bool remove(const word &keyword)
Remove an entry specified by keyword.
const dictionary & dict() const noexcept
Read-access to the content.
virtual void writeData(Ostream &os) const
Write in dictionary format.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
const string & code() const noexcept
The code.
virtual string description() const
Description (type + name) for the output.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
PatchFunction1 with the code supplied by an on-the-fly compiled C++ expression.
#define WarningInFunction
Report a warning using Foam::Warning.
const string & options() const noexcept
The code options (Make/options)