43 if (components.
size() != Type::nComponents)
54 typeFields.insert(keyword,
new Field<Type>(size, t));
90 if (dict_.
found(
"value"))
101 Info<<
"\n Cannot find 'value' entry"
104 <<
" for generic patch field with actual type "
107 <<
" Extrapolating the internal field to the patch."
115 if (iter().keyword() !=
"type" && iter().keyword() !=
"value")
120 && iter().stream().
size()
126 token firstToken(is);
131 && firstToken.
wordToken() ==
"nonuniform"
134 token fieldToken(is);
153 <<
"\n token following 'nonuniform' "
155 <<
"\n on patch " << this->
patch().
name()
164 #define ReadTypeField(Type, nullArg) \
167 fieldToken.compoundToken().type() \
168 == token::Compound<List<Type>>::typeName \
171 Field<Type>* fPtr = new Field<Type>; \
174 dynamicCast<token::Compound<List<Type>>> \
176 fieldToken.transferCompoundToken(is) \
180 if (fPtr->size() != this->size()) \
182 FatalIOErrorInFunction(dict) \
183 << "\n size of field " \
184 << iter().keyword() \
185 << " (" << fPtr->size() << ')' \
186 << " is not the same size as the patch (" \
187 << this->size() << ')' \
189 << this->patch().name() \
191 << this->internalField().name() \
193 << this->internalField().objectPath() \
194 << exit(FatalIOError); \
197 Type##Fields_.insert(iter().keyword(), fPtr); \
207 <<
"\n on patch " << this->
patch().
name()
221 token fieldToken(is);
241 #define InsertUniformTypeField(Type, nullArg) \
242 || insertUniformTypeField \
252 <<
"\n unrecognised native type " << l
253 <<
"\n on patch " << this->
patch().
name()
260 #undef InsertUniformTypeField
281 valuePresent_(ptf.valuePresent_)
283 #define MapTypeFields(Type, nullArg) \
284 forAllConstIter(HashPtrTable<Field<Type>>, ptf.Type##Fields_, iter) \
286 Type##Fields_.insert \
289 mapper(*iter()).ptr() \
307 valuePresent_(ptf.valuePresent_)
309 , Type##Fields_(ptf.Type##Fields_)
327 refCast<const genericFvPatchField<Type>>(ptf);
329 #define MapTypeFields(Type, nullArg) \
330 forAllIter(HashPtrTable<Field<Type>>, Type##Fields_, iter) \
332 HashPtrTable<Field<Type>>::const_iterator dptfIter = \
333 dptf.Type##Fields_.find(iter.key()); \
335 if (dptfIter != dptf.Type##Fields_.end()) \
337 mapper(*iter(), *dptfIter()); \
354 refCast<const genericFvPatchField<Type>>(ptf);
356 #define ResetTypeFields(Type, nullArg) \
357 forAllIter(HashPtrTable<Field<Type>>, Type##Fields_, iter) \
359 HashPtrTable<Field<Type>>::const_iterator dptfIter = \
360 dptf.Type##Fields_.find(iter.key()); \
362 if (dptfIter != dptf.Type##Fields_.end()) \
364 iter()->reset(*dptfIter()); \
368 #undef ResetTypeFields
380 <<
"cannot be called for a genericFvPatchField"
381 " (actual type " << actualTypeName() <<
")"
382 <<
"\n on patch " << this->patch().name()
383 <<
" of field " << this->internalField().name()
384 <<
" in file " << this->internalField().objectPath()
385 <<
"\n You are probably trying to solve for a field with a "
386 "generic boundary condition."
401 <<
"cannot be called for a genericFvPatchField"
402 " (actual type " << actualTypeName() <<
")"
403 <<
"\n on patch " << this->patch().name()
404 <<
" of field " << this->internalField().name()
405 <<
" in file " << this->internalField().objectPath()
406 <<
"\n You are probably trying to solve for a field with a "
407 "generic boundary condition."
419 <<
"cannot be called for a genericFvPatchField"
420 " (actual type " << actualTypeName() <<
")"
421 <<
"\n on patch " << this->patch().name()
422 <<
" of field " << this->internalField().name()
423 <<
" in file " << this->internalField().objectPath()
424 <<
"\n You are probably trying to solve for a field with a "
425 "generic boundary condition."
436 <<
"cannot be called for a genericFvPatchField"
437 " (actual type " << actualTypeName() <<
")"
438 <<
"\n on patch " << this->patch().name()
439 <<
" of field " << this->internalField().name()
440 <<
" in file " << this->internalField().objectPath()
441 <<
"\n You are probably trying to solve for a field with a "
442 "generic boundary condition."
456 if (iter().keyword() !=
"type")
461 && iter().stream().size()
462 && iter().stream()[0].isWord()
463 && iter().stream()[0].wordToken() ==
"nonuniform"
466 #define WriteTypeFieldEntry(Type, nullArg) \
467 else if (Type##Fields_.found(iter().keyword())) \
473 *Type##Fields_.find(iter().keyword())() \
477 #undef WriteTypeFieldEntry
489 if (iter().keyword() !=
"type" && iter().keyword() !=
"value")
494 && iter().stream().size()
495 && iter().stream()[0].isWord()
496 && iter().stream()[0].wordToken() ==
"nonuniform"
499 #define WriteTypeFieldEntry(Type, nullArg) \
500 else if (Type##Fields_.found(iter().keyword())) \
506 *Type##Fields_.find(iter().keyword())() \
510 #undef WriteTypeFieldEntry
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const dimensionSet & dimensions() const
Return dimensions.
Pre-declare SubField and related Field type.
A HashTable specialisation for hashing pointers.
void putBack(const token &)
Put back token.
label size() const
Return the number of elements in the UList.
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
This boundary condition is not designed to be evaluated; it is assumed that the value is assigned via...
virtual void map(const fvPatchField< Type > &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Abstract base class for field mapping.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch as patch field.
virtual void operator=(const UList< Type > &)
virtual void reset(const fvPatchField< Type > &)
Reset the fvPatchField to the given fvPatchField.
const DimensionedField< Type, fvMesh > & internalField() const
Return dimensioned internal field reference.
const fvPatch & patch() const
Return patch.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual const word & name() const
Return name.
Base class for generic field types. Facilitates down-casting so that the actual type can be queried.
const word & actualTypeName() const
Return the actual type name.
This boundary condition provides a generic version of the calculated condition, useful as a fallback ...
virtual void write(Ostream &) const
Write.
tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual void reset(const fvPatchField< Type > &)
Reset the fvPatchField to the given fvPatchField.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
virtual void map(const fvPatchField< Type > &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
genericFvPatchField(const fvPatch &, const DimensionedField< Type, fvMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
A class for managing temporary objects.
A token holds items read from Istream.
bool isPunctuation() const
const compound & compoundToken() const
const word & wordToken() const
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WriteTypeFieldEntry(Type, nullArg)
#define ResetTypeFields(Type, nullArg)
#define CopyTypeFields(Type, nullArg)
#define MapTypeFields(Type, nullArg)
#define ReadTypeField(Type, nullArg)
#define InsertUniformTypeField(Type, nullArg)
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
FOR_ALL_FIELD_TYPES(makeDimensionedPointFieldFunctions)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
bool insertUniformTypeField(const scalarList &components, const word &keyword, const label size, HashPtrTable< Field< Type >> &typeFields)
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)