37 const Foam::wordList Foam::codedMixedFvPatchField<Type>::codeKeys_ =
38 {
"code",
"codeInclude",
"localCode"};
44 const Foam::word Foam::codedMixedFvPatchField<Type>::codeTemplateC =
45 "mixedFvPatchFieldTemplate.C";
48 const Foam::word Foam::codedMixedFvPatchField<Type>::codeTemplateH =
49 "mixedFvPatchFieldTemplate.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())
293 dict.set(
"type", name_);
295 redirectPatchFieldPtr_.set
302 this->internalField(),
308 return redirectPatchFieldPtr_();
321 updateLibrary(name_);
329 this->refGrad() = fvp.
refGrad();
343 updateLibrary(name_);
361 << token::END_STATEMENT <<
nl;
363 if (dict_.found(
"codeInclude"))
366 << token::HASH << token::BEGIN_BLOCK;
368 os.
writeQuoted(
string(dict_[
"codeInclude"]),
false)
369 << token::HASH << token::END_BLOCK
370 << token::END_STATEMENT <<
nl;
373 if (dict_.found(
"localCode"))
376 << token::HASH << token::BEGIN_BLOCK;
379 << token::HASH << token::END_BLOCK
380 << token::END_STATEMENT <<
nl;
383 if (dict_.found(
"code"))
386 << token::HASH << token::BEGIN_BLOCK;
389 << token::HASH << token::END_BLOCK
390 << token::END_STATEMENT <<
nl;
393 if (dict_.found(
"codeOptions"))
396 << token::HASH << token::BEGIN_BLOCK;
398 os.
writeQuoted(
string(dict_[
"codeOptions"]),
false)
399 << token::HASH << token::END_BLOCK
400 << token::END_STATEMENT <<
nl;
403 if (dict_.found(
"codeLibs"))
406 << token::HASH << token::BEGIN_BLOCK;
409 << token::HASH << token::END_BLOCK
410 << 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.