43 <<
"Trying to construct an genericFvsPatchField on patch "
44 << this->
patch().name()
45 <<
" of field " << this->internalField().name()
59 actualTypeName_(
dict.get<
word>(
"type")),
62 const label patchSize = this->size();
64 if (!
dict.found(
"value"))
67 <<
nl <<
" Cannot find 'value' entry"
68 <<
" on patch " << this->
patch().name()
69 <<
" of field " << this->internalField().name()
70 <<
" in file " << this->internalField().objectPath() <<
nl
71 <<
" which is required to set the"
72 " values of the generic patch field." <<
nl
73 <<
" (Actual type " << actualTypeName_ <<
')' <<
nl <<
nl
74 <<
" Please add the 'value' entry to the write function"
75 " of the user-defined boundary-condition" <<
nl
79 for (
const entry& dEntry : dict_)
81 const keyType& key = dEntry.keyword();
87 || !dEntry.isStream() || dEntry.stream().empty()
102 && firstToken.
wordToken() ==
"nonuniform"
105 token fieldToken(is);
120 <<
"\n token following 'nonuniform' "
122 <<
"\n on patch " << this->
patch().name()
124 << this->internalField().name()
126 << this->internalField().objectPath() <<
nl
146 if (fPtr->size() != patchSize)
149 <<
"\n size of field " << key
150 <<
" (" << fPtr->size() <<
')'
151 <<
" is not the same size as the patch ("
153 <<
"\n on patch " << this->
patch().name()
155 << this->internalField().name()
157 << this->internalField().objectPath() <<
nl
161 scalarFields_.insert(key, fPtr);
179 if (fPtr->size() != patchSize)
182 <<
"\n size of field " << key
183 <<
" (" << fPtr->size() <<
')'
184 <<
" is not the same size as the patch ("
186 <<
"\n on patch " << this->
patch().name()
188 << this->internalField().name()
190 << this->internalField().objectPath() <<
nl
194 vectorFields_.insert(key, fPtr);
212 if (fPtr->size() != patchSize)
215 <<
"\n size of field " << key
216 <<
" (" << fPtr->size() <<
')'
217 <<
" is not the same size as the patch ("
219 <<
"\n on patch " << this->
patch().name()
221 << this->internalField().name()
223 << this->internalField().objectPath() <<
nl
227 sphTensorFields_.insert(key, fPtr);
245 if (fPtr->size() != patchSize)
248 <<
"\n size of field " << key
249 <<
" (" << fPtr->size() <<
')'
250 <<
" is not the same size as the patch ("
252 <<
"\n on patch " << this->
patch().name()
254 << this->internalField().name()
256 << this->internalField().objectPath() <<
nl
260 symmTensorFields_.insert(key, fPtr);
278 if (fPtr->size() != patchSize)
281 <<
"\n size of field " << key
282 <<
" (" << fPtr->size() <<
')'
283 <<
" is not the same size as the patch ("
285 <<
"\n on patch " << this->
patch().name()
287 << this->internalField().name()
289 << this->internalField().objectPath() <<
nl
293 tensorFields_.insert(key, fPtr);
300 <<
"\n on patch " << this->
patch().name()
302 << this->internalField().name()
304 << this->internalField().objectPath() <<
nl
314 token fieldToken(is);
335 if (l.size() == vector::nComponents)
337 vector vs(l[0], l[1], l[2]);
349 else if (l.size() == sphericalTensor::nComponents)
353 sphTensorFields_.insert
363 else if (l.size() == symmTensor::nComponents)
365 symmTensor vs(l[0], l[1], l[2], l[3], l[4], l[5]);
367 symmTensorFields_.insert
377 else if (l.size() == tensor::nComponents)
399 <<
"\n unrecognised native type " << l
400 <<
"\n on patch " << this->
patch().name()
402 << this->internalField().name()
404 << this->internalField().objectPath() <<
nl
423 actualTypeName_(ptf.actualTypeName_),
446 sphTensorFields_.insert
455 symmTensorFields_.insert
480 actualTypeName_(ptf.actualTypeName_),
482 scalarFields_(ptf.scalarFields_),
483 vectorFields_(ptf.vectorFields_),
484 sphTensorFields_(ptf.sphTensorFields_),
485 symmTensorFields_(ptf.symmTensorFields_),
486 tensorFields_(ptf.tensorFields_)
498 actualTypeName_(ptf.actualTypeName_),
500 scalarFields_(ptf.scalarFields_),
501 vectorFields_(ptf.vectorFields_),
502 sphTensorFields_(ptf.sphTensorFields_),
503 symmTensorFields_(ptf.symmTensorFields_),
504 tensorFields_(ptf.tensorFields_)
555 refCast<const genericFvsPatchField<Type>>(ptf);
559 const auto iter2 = dptf.scalarFields_.cfind(iter.key());
563 (*iter)->rmap(*iter2(), addr);
569 const auto iter2 = dptf.vectorFields_.find(iter.key());
573 (*iter)->rmap(*iter2(), addr);
579 const auto iter2 = dptf.sphTensorFields_.find(iter.key());
583 (*iter)->rmap(*iter2(), addr);
589 const auto iter2 = dptf.symmTensorFields_.find(iter.key());
593 (*iter)->rmap(*iter2(), addr);
599 const auto iter2 = dptf.tensorFields_.find(iter.key());
603 (*iter)->rmap(*iter2(), addr);
617 <<
"cannot be called for a genericFvsPatchField"
618 " (actual type " << actualTypeName_ <<
")"
619 <<
"\n on patch " << this->
patch().name()
620 <<
" of field " << this->internalField().name()
621 <<
" in file " << this->internalField().objectPath()
622 <<
"\n You are probably trying to solve for a field with a "
623 "generic boundary condition."
638 <<
"cannot be called for a genericFvsPatchField"
639 " (actual type " << actualTypeName_ <<
")"
640 <<
"\n on patch " << this->
patch().name()
641 <<
" of field " << this->internalField().name()
642 <<
" in file " << this->internalField().objectPath()
643 <<
"\n You are probably trying to solve for a field with a "
644 "generic boundary condition."
656 <<
"cannot be called for a genericFvsPatchField"
657 " (actual type " << actualTypeName_ <<
")"
658 <<
"\n on patch " << this->
patch().name()
659 <<
" of field " << this->internalField().name()
660 <<
" in file " << this->internalField().objectPath()
661 <<
"\n You are probably trying to solve for a field with a "
662 "generic boundary condition."
673 <<
"cannot be called for a genericFvsPatchField"
674 " (actual type " << actualTypeName_ <<
")"
675 <<
"\n on patch " << this->
patch().name()
676 <<
" of field " << this->internalField().name()
677 <<
" in file " << this->internalField().objectPath()
678 <<
"\n You are probably trying to solve for a field with a "
679 "generic boundary condition."
689 return actualTypeName_;
698 for (
const entry& dEntry : dict_)
700 const keyType& key = dEntry.keyword();
702 if (key ==
"type" || key ==
"value")
710 && dEntry.stream().size()
711 && dEntry.stream()[0].isWord()
712 && dEntry.stream()[0].wordToken() ==
"nonuniform"
715 if (scalarFields_.found(key))
717 scalarFields_.cfind(key)()->writeEntry(key, os);
719 else if (vectorFields_.found(key))
721 vectorFields_.cfind(key)()->writeEntry(key, os);
723 else if (sphTensorFields_.found(key))
725 sphTensorFields_.cfind(key)()->writeEntry(key, os);
727 else if (symmTensorFields_.found(key))
729 symmTensorFields_.cfind(key)()->writeEntry(key, os);
731 else if (tensorFields_.found(key))
733 tensorFields_.cfind(key)()->writeEntry(key, os);
742 this->writeEntry(
"value", os);