37 const Foam::word Foam::codedMixedFvPatchField<Type>::codeTemplateC
38 =
"mixedFvPatchFieldTemplate.C";
41 const Foam::word Foam::codedMixedFvPatchField<Type>::codeTemplateH
42 =
"mixedFvPatchFieldTemplate.H";
53 word fieldType(pTraits<Type>::typeName);
56 dynCode.setFilterVariable(
"TemplateType", fieldType);
59 fieldType[0] = toupper(fieldType[0]);
60 dynCode.setFilterVariable(
"FieldType", fieldType +
"Field");
69 const objectRegistry& obr = this->db();
71 if (obr.foundObject<IOdictionary>(
"codeDict"))
73 return obr.lookupObject<IOdictionary>(
"codeDict");
84 this->db().time().
system(),
86 IOobject::MUST_READ_IF_MODIFIED,
98 return const_cast<dlLibraryTable&
>(this->db().time().libs());
105 dynamicCode& dynCode,
106 const dynamicCodeContext& context
110 dynCode.setFilterVariable(
"typeName", name_);
114 setFieldTemplates(dynCode);
117 dynCode.addCompileFile(codeTemplateC);
120 dynCode.addCopyFile(codeTemplateH);
129 dynCode.setMakeOptions
132 "-I$(LIB_SRC)/finiteVolume/lnInclude \\\n" 134 +
"\n\nLIB_LIBS = \\\n" 136 +
" -lfiniteVolume \\\n" 151 : this->
dict().subDict(name_)
161 + this->patch().name()
163 + this->internalField().name();
171 redirectPatchFieldPtr_.
clear();
186 redirectPatchFieldPtr_()
203 redirectPatchFieldPtr_()
220 dict.
found(
"redirectType")
221 ? dict.
lookup(
"redirectType")
224 redirectPatchFieldPtr_()
226 updateLibrary(name_);
240 redirectPatchFieldPtr_()
255 redirectPatchFieldPtr_()
265 if (!redirectPatchFieldPtr_.valid())
279 dict.set(
"type", name_);
281 redirectPatchFieldPtr_.set
288 this->internalField(),
294 return redirectPatchFieldPtr_();
307 updateLibrary(name_);
315 this->refGrad() = fvp.
refGrad();
329 updateLibrary(name_);
347 << token::END_STATEMENT <<
nl;
349 if (dict_.found(
"codeInclude"))
352 << token::HASH << token::BEGIN_BLOCK;
354 os.
writeQuoted(
string(dict_[
"codeInclude"]),
false)
355 << token::HASH << token::END_BLOCK
356 << token::END_STATEMENT <<
nl;
359 if (dict_.found(
"localCode"))
362 << token::HASH << token::BEGIN_BLOCK;
365 << token::HASH << token::END_BLOCK
366 << token::END_STATEMENT <<
nl;
369 if (dict_.found(
"code"))
372 << token::HASH << token::BEGIN_BLOCK;
375 << token::HASH << token::END_BLOCK
376 << token::END_STATEMENT <<
nl;
379 if (dict_.found(
"codeOptions"))
382 << token::HASH << token::BEGIN_BLOCK;
384 os.
writeQuoted(
string(dict_[
"codeOptions"]),
false)
385 << token::HASH << token::END_BLOCK
386 << token::END_STATEMENT <<
nl;
389 if (dict_.found(
"codeLibs"))
392 << token::HASH << token::BEGIN_BLOCK;
395 << token::HASH << token::END_BLOCK
396 << token::END_STATEMENT <<
nl;
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
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.
This boundary condition provides a base class for 'mixed' type boundary conditions, i.e. conditions that mix fixed value and patch-normal gradient conditions.
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.
const mixedFvPatchField< Type > & redirectPatchField() const
Get reference to the underlying patchField.
virtual Field< Type > & refValue()
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from string.
virtual scalarField & valueFraction()
Foam::fvPatchFieldMapper.
Base class for function objects and boundary conditions using dynamic code.
A table of dynamically loaded libraries.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
codedMixedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
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.
virtual void write(Ostream &) const
Write.
Constructs on-the-fly a new boundary condition (derived from mixedFvPatchField) which is then used to...
Input from memory buffer stream.
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 updateCoeffs()
Update the coefficients associated with the patch field.
A class for handling character strings derived from std::string.
Output to memory buffer stream.
virtual Field< Type > & refGrad()
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.