37 const Foam::wordList Foam::codedFixedValueFvPatchField<Type>::codeKeys_ =
38 {
"code",
"codeInclude",
"localCode"};
44 const Foam::word Foam::codedFixedValueFvPatchField<Type>::codeTemplateC =
45 "fixedValueFvPatchFieldTemplate.C";
48 const Foam::word Foam::codedFixedValueFvPatchField<Type>::codeTemplateH =
49 "fixedValueFvPatchFieldTemplate.H";
60 word fieldType(pTraits<Type>::typeName);
63 dynCode.setFilterVariable(
"TemplateType", fieldType);
66 fieldType[0] = toupper(fieldType[0]);
67 dynCode.setFilterVariable(
"FieldType", fieldType +
"Field");
76 const objectRegistry& obr = this->db();
78 if (obr.foundObject<IOdictionary>(
"codeDict"))
80 return obr.lookupObject<IOdictionary>(
"codeDict");
91 this->db().time().
system(),
93 IOobject::MUST_READ_IF_MODIFIED,
105 return const_cast<dlLibraryTable&
>(this->db().time().libs());
112 dynamicCode& dynCode,
113 const dynamicCodeContext& context
117 dynCode.setFilterVariable(
"typeName", name_);
121 setFieldTemplates(dynCode);
124 dynCode.addCompileFile(codeTemplateC);
127 dynCode.addCopyFile(codeTemplateH);
136 dynCode.setMakeOptions
139 "-I$(LIB_SRC)/finiteVolume/lnInclude \\\n" 141 +
"\n\nLIB_LIBS = \\\n" 143 +
" -lfiniteVolume \\\n" 158 : this->
dict().subDict(name_)
175 + this->patch().name()
177 + this->internalField().name();
185 redirectPatchFieldPtr_.
clear();
200 redirectPatchFieldPtr_()
217 redirectPatchFieldPtr_()
234 dict.
found(
"redirectType")
235 ? dict.
lookup(
"redirectType")
238 redirectPatchFieldPtr_()
240 updateLibrary(name_);
254 redirectPatchFieldPtr_()
269 redirectPatchFieldPtr_()
279 if (!redirectPatchFieldPtr_.valid())
290 redirectPatchFieldPtr_.set
295 this->internalField(),
300 return redirectPatchFieldPtr_();
313 updateLibrary(name_);
333 updateLibrary(name_);
348 << token::END_STATEMENT <<
nl;
350 if (dict_.found(
"codeInclude"))
353 << token::HASH << token::BEGIN_BLOCK;
355 os.
writeQuoted(
string(dict_[
"codeInclude"]),
false)
356 << token::HASH << token::END_BLOCK
357 << token::END_STATEMENT <<
nl;
360 if (dict_.found(
"localCode"))
363 << token::HASH << token::BEGIN_BLOCK;
366 << token::HASH << token::END_BLOCK
367 << token::END_STATEMENT <<
nl;
370 if (dict_.found(
"code"))
373 << token::HASH << token::BEGIN_BLOCK;
376 << token::HASH << token::END_BLOCK
377 << token::END_STATEMENT <<
nl;
380 if (dict_.found(
"codeOptions"))
383 << token::HASH << token::BEGIN_BLOCK;
385 os.
writeQuoted(
string(dict_[
"codeOptions"]),
false)
386 << token::HASH << token::END_BLOCK
387 << token::END_STATEMENT <<
nl;
390 if (dict_.found(
"codeLibs"))
393 << token::HASH << token::BEGIN_BLOCK;
396 << token::HASH << token::END_BLOCK
397 << token::END_STATEMENT <<
nl;
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
commsTypes
Types of communications.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Macros for easy insertion into run-time selection tables.
virtual Ostream & writeQuoted(const std::string &, const bool quoted=true)=0
Write std::string surrounded by quotes.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field, sets Updated to false.
void clear()
Clear the list, i.e. set size to zero.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
A class for handling words, derived from string.
Foam::fvPatchFieldMapper.
Base class for function objects and boundary conditions using dynamic code.
A table of dynamically loaded libraries.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Constructs on-the-fly a new boundary condition (derived from fixedValueFvPatchField) which is then us...
Input from memory buffer stream.
codedFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
string str() const
Return the string.
virtual void write(Ostream &) const
Write.
A class for handling character strings derived from std::string.
Output to memory buffer stream.
int system(const std::string &command)
Execute the specified command.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const fvPatchField< Type > & redirectPatchField() const
Get reference to the underlying patch.