43 if (!
dict.found(
"value"))
48 ) <<
"\n Cannot find 'value' entry"
53 <<
" which is required to set the"
54 " values of the generic patch field." <<
nl
56 <<
"\n Please add the 'value' entry to the write function "
57 "of the user-defined boundary-condition\n"
63 if (iter().keyword() !=
"type" && iter().keyword() !=
"value")
68 && iter().stream().
size()
103 ) <<
"\n token following 'nonuniform' "
105 <<
"\n on patch " << this->
patch().
name()
128 if (fPtr->
size() != this->size())
133 ) <<
"\n size of field " << iter().keyword()
134 <<
" (" << fPtr->
size() <<
')'
135 <<
" is not the same size as the patch ("
136 << this->
size() <<
')'
137 <<
"\n on patch " << this->
patch().
name()
145 scalarFields_.insert(iter().keyword(), fPtr);
162 if (fPtr->
size() != this->size())
167 ) <<
"\n size of field " << iter().keyword()
168 <<
" (" << fPtr->
size() <<
')'
169 <<
" is not the same size as the patch ("
170 << this->
size() <<
')'
171 <<
"\n on patch " << this->
patch().
name()
179 vectorFields_.insert(iter().keyword(), fPtr);
199 if (fPtr->
size() != this->size())
204 ) <<
"\n size of field " << iter().keyword()
205 <<
" (" << fPtr->
size() <<
')'
206 <<
" is not the same size as the patch ("
207 << this->
size() <<
')'
208 <<
"\n on patch " << this->
patch().
name()
216 sphericalTensorFields_.insert(iter().keyword(), fPtr);
236 if (fPtr->
size() != this->size())
241 ) <<
"\n size of field " << iter().keyword()
242 <<
" (" << fPtr->
size() <<
')'
243 <<
" is not the same size as the patch ("
244 << this->
size() <<
')'
245 <<
"\n on patch " << this->
patch().
name()
253 symmTensorFields_.insert(iter().keyword(), fPtr);
270 if (fPtr->
size() != this->size())
275 ) <<
"\n size of field " << iter().keyword()
276 <<
" (" << fPtr->
size() <<
')'
277 <<
" is not the same size as the patch ("
278 << this->
size() <<
')'
279 <<
"\n on patch " << this->
patch().
name()
287 tensorFields_.insert(iter().keyword(), fPtr);
296 <<
"\n on patch " << this->
patch().
name()
310 token fieldToken(is);
333 vector vs(l[0], l[1], l[2]);
345 sphericalTensorFields_.insert
353 symmTensor vs(l[0], l[1], l[2], l[3], l[4], l[5]);
355 symmTensorFields_.insert
381 ) <<
"\n unrecognised native type " << l
382 <<
"\n on patch " << this->
patch().
name()
420 mapper(*iter()).ptr()
434 mapper(*iter()).ptr()
441 ptf.sphericalTensorFields_,
445 sphericalTensorFields_.insert
448 mapper(*iter()).ptr()
455 ptf.symmTensorFields_,
459 symmTensorFields_.insert
462 mapper(*iter()).ptr()
476 mapper(*iter()).ptr()
492 scalarFields_(ptf.scalarFields_),
493 vectorFields_(ptf.vectorFields_),
494 sphericalTensorFields_(ptf.sphericalTensorFields_),
495 symmTensorFields_(ptf.symmTensorFields_),
496 tensorFields_(ptf.tensorFields_)
512 refCast<const genericFvPatchField<Type>>(ptf);
522 dptf.scalarFields_.find(iter.key());
524 if (dptfIter != dptf.scalarFields_.end())
526 mapper(*iter(), *dptfIter());
538 dptf.vectorFields_.find(iter.key());
540 if (dptfIter != dptf.vectorFields_.end())
542 mapper(*iter(), *dptfIter());
549 sphericalTensorFields_,
554 dptf.sphericalTensorFields_.find(iter.key());
556 if (dptfIter != dptf.sphericalTensorFields_.end())
558 mapper(*iter(), *dptfIter());
570 dptf.symmTensorFields_.find(iter.key());
572 if (dptfIter != dptf.symmTensorFields_.end())
574 mapper(*iter(), *dptfIter());
586 dptf.tensorFields_.find(iter.key());
588 if (dptfIter != dptf.tensorFields_.end())
590 mapper(*iter(), *dptfIter());
605 refCast<const genericFvPatchField<Type>>(ptf);
615 dptf.scalarFields_.find(iter.key());
617 if (dptfIter != dptf.scalarFields_.end())
619 iter()->reset(*dptfIter());
631 dptf.vectorFields_.find(iter.key());
633 if (dptfIter != dptf.vectorFields_.end())
635 iter()->reset(*dptfIter());
642 sphericalTensorFields_,
647 dptf.sphericalTensorFields_.find(iter.key());
649 if (dptfIter != dptf.sphericalTensorFields_.end())
651 iter()->reset(*dptfIter());
663 dptf.symmTensorFields_.find(iter.key());
665 if (dptfIter != dptf.symmTensorFields_.end())
667 iter()->reset(*dptfIter());
679 dptf.tensorFields_.find(iter.key());
681 if (dptfIter != dptf.tensorFields_.end())
683 iter()->reset(*dptfIter());
697 <<
"cannot be called for a genericFvPatchField"
698 " (actual type " << actualTypeName() <<
")"
699 <<
"\n on patch " << this->patch().name()
700 <<
" of field " << this->internalField().name()
701 <<
" in file " << this->internalField().objectPath()
702 <<
"\n You are probably trying to solve for a field with a "
703 "generic boundary condition."
718 <<
"cannot be called for a genericFvPatchField"
719 " (actual type " << actualTypeName() <<
")"
720 <<
"\n on patch " << this->patch().name()
721 <<
" of field " << this->internalField().name()
722 <<
" in file " << this->internalField().objectPath()
723 <<
"\n You are probably trying to solve for a field with a "
724 "generic boundary condition."
736 <<
"cannot be called for a genericFvPatchField"
737 " (actual type " << actualTypeName() <<
")"
738 <<
"\n on patch " << this->patch().name()
739 <<
" of field " << this->internalField().name()
740 <<
" in file " << this->internalField().objectPath()
741 <<
"\n You are probably trying to solve for a field with a "
742 "generic boundary condition."
753 <<
"cannot be called for a genericFvPatchField"
754 " (actual type " << actualTypeName() <<
")"
755 <<
"\n on patch " << this->patch().name()
756 <<
" of field " << this->internalField().name()
757 <<
" in file " << this->internalField().objectPath()
758 <<
"\n You are probably trying to solve for a field with a "
759 "generic boundary condition."
773 if (iter().keyword() !=
"type" && iter().keyword() !=
"value")
778 && iter().stream().size()
779 && iter().stream()[0].isWord()
780 && iter().stream()[0].wordToken() ==
"nonuniform"
783 if (scalarFields_.found(iter().keyword()))
789 *scalarFields_.find(iter().keyword())()
792 else if (vectorFields_.found(iter().keyword()))
798 *vectorFields_.find(iter().keyword())()
801 else if (sphericalTensorFields_.found(iter().keyword()))
807 *sphericalTensorFields_.find(iter().keyword())()
810 else if (symmTensorFields_.found(iter().keyword()))
816 *symmTensorFields_.find(iter().keyword())()
819 else if (tensorFields_.found(iter().keyword()))
825 *tensorFields_.find(iter().keyword())()
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
#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...
static const char *const typeName
A HashTable specialisation for hashing pointers.
An STL-conforming const_iterator.
void putBack(const token &)
Put back token.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
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,...
Templated 3D SphericalTensor derived from VectorSpace adding construction from 1 component,...
static const direction nComponents
Number of components in this vector space.
This boundary condition is not designed to be evaluated; it is assumed that the value is assigned via...
A list of keyword definitions, which are a keyword followed by any number of values (e....
Foam::fvPatchFieldMapper.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
const DimensionedField< Type, volMesh > & internalField() const
Return dimensioned internal field reference.
virtual void reset(const fvPatchField< Type > &)
Reset the fvPatchField to the given fvPatchField.
virtual void map(const fvPatchField< Type > &, const fvPatchFieldMapper &)
Map the given fvPatchField onto this fvPatchField.
const fvPatch & patch() const
Return patch.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual const word & name() const
Return 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.
genericFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
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 void map(const fvPatchField< Type > &, const fvPatchFieldMapper &)
Map the given fvPatchField onto this fvPatchField.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
word actualTypeName() const
Return the actual type name.
A class for managing temporary objects.
A templated class for holding compound tokens.
A token holds items read from Istream.
compound & transferCompoundToken(const Istream &is)
bool isPunctuation() const
const compound & compoundToken() const
const word & wordToken() const
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
errorManip< error > abort(error &err)
To & dynamicCast(From &r)
Reference type cast template function,.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Field< sphericalTensor > sphericalTensorField
Specialisation of Field<T> for sphericalTensor.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
Field< tensor > tensorField
Specialisation of Field<T> for tensor.