44 <<
"Trying to construct an genericFaPatchField on patch "
45 << this->
patch().name()
46 <<
" of field " << this->internalField().name()
60 actualTypeName_(
dict.get<
word>(
"type")),
63 const label patchSize = this->size();
65 if (!
dict.found(
"value"))
68 <<
nl <<
" Cannot find 'value' entry"
69 <<
" on patch " << this->
patch().name()
70 <<
" of field " << this->internalField().name()
71 <<
" in file " << this->internalField().objectPath() <<
nl
72 <<
" which is required to set the"
73 " values of the generic patch field." <<
nl
74 <<
" (Actual type " << actualTypeName_ <<
')' <<
nl <<
nl
75 <<
" Please add the 'value' entry to the write function"
76 " of the user-defined boundary-condition" <<
nl
80 for (
const entry& dEntry : dict_)
82 const keyType& key = dEntry.keyword();
88 || !dEntry.isStream() || dEntry.stream().empty()
103 && firstToken.
wordToken() ==
"nonuniform"
106 token fieldToken(is);
121 <<
"\n token following 'nonuniform' "
123 <<
"\n on patch " << this->
patch().name()
125 << this->internalField().name()
127 << this->internalField().objectPath() <<
nl
147 if (fPtr->size() != patchSize)
150 <<
"\n size of field " << key
151 <<
" (" << fPtr->size() <<
')'
152 <<
" is not the same size as the patch ("
154 <<
"\n on patch " << this->
patch().name()
156 << this->internalField().name()
158 << this->internalField().objectPath() <<
nl
162 scalarFields_.insert(key, fPtr);
180 if (fPtr->size() != patchSize)
183 <<
"\n size of field " << key
184 <<
" (" << fPtr->size() <<
')'
185 <<
" is not the same size as the patch ("
187 <<
"\n on patch " << this->
patch().name()
189 << this->internalField().name()
191 << this->internalField().objectPath() <<
nl
195 vectorFields_.insert(key, fPtr);
213 if (fPtr->size() != patchSize)
216 <<
"\n size of field " << key
217 <<
" (" << fPtr->size() <<
')'
218 <<
" is not the same size as the patch ("
220 <<
"\n on patch " << this->
patch().name()
222 << this->internalField().name()
224 << this->internalField().objectPath() <<
nl
228 sphTensorFields_.insert(key, fPtr);
246 if (fPtr->size() != patchSize)
249 <<
"\n size of field " << key
250 <<
" (" << fPtr->size() <<
')'
251 <<
" is not the same size as the patch ("
253 <<
"\n on patch " << this->
patch().name()
255 << this->internalField().name()
257 << this->internalField().objectPath() <<
nl
261 symmTensorFields_.insert(key, fPtr);
279 if (fPtr->size() != patchSize)
282 <<
"\n size of field " << key
283 <<
" (" << fPtr->size() <<
')'
284 <<
" is not the same size as the patch ("
286 <<
"\n on patch " << this->
patch().name()
288 << this->internalField().name()
290 << this->internalField().objectPath() <<
nl
294 tensorFields_.insert(key, fPtr);
301 <<
"\n on patch " << this->
patch().name()
303 << this->internalField().name()
305 << this->internalField().objectPath() <<
nl
315 token fieldToken(is);
336 if (l.size() == vector::nComponents)
338 vector vs(l[0], l[1], l[2]);
350 else if (l.size() == sphericalTensor::nComponents)
354 sphTensorFields_.insert
364 else if (l.size() == symmTensor::nComponents)
366 symmTensor vs(l[0], l[1], l[2], l[3], l[4], l[5]);
368 symmTensorFields_.insert
378 else if (l.size() == tensor::nComponents)
400 <<
"\n unrecognised native type " << l
401 <<
"\n on patch " << this->
patch().name()
403 << this->internalField().name()
405 << this->internalField().objectPath() <<
nl
424 actualTypeName_(ptf.actualTypeName_),
447 sphTensorFields_.insert
456 symmTensorFields_.insert
481 actualTypeName_(ptf.actualTypeName_),
483 scalarFields_(ptf.scalarFields_),
484 vectorFields_(ptf.vectorFields_),
485 sphTensorFields_(ptf.sphTensorFields_),
486 symmTensorFields_(ptf.symmTensorFields_),
487 tensorFields_(ptf.tensorFields_)
499 actualTypeName_(ptf.actualTypeName_),
501 scalarFields_(ptf.scalarFields_),
502 vectorFields_(ptf.vectorFields_),
503 sphTensorFields_(ptf.sphTensorFields_),
504 symmTensorFields_(ptf.symmTensorFields_),
505 tensorFields_(ptf.tensorFields_)
556 refCast<const genericFaPatchField<Type>>(ptf);
560 const auto iter2 = dptf.scalarFields_.cfind(iter.key());
564 (*iter)->rmap(*iter2(), addr);
570 const auto iter2 = dptf.vectorFields_.cfind(iter.key());
574 (*iter)->rmap(*iter2(), addr);
580 const auto iter2 = dptf.sphTensorFields_.cfind(iter.key());
584 (*iter)->rmap(*iter2(), addr);
590 const auto iter2 = dptf.symmTensorFields_.cfind(iter.key());
594 (*iter)->rmap(*iter2(), addr);
600 const auto iter2 = dptf.tensorFields_.find(iter.key());
604 (*iter)->rmap(*iter2(), addr);
618 <<
"cannot be called for a genericFaPatchField"
619 " (actual type " << actualTypeName_ <<
")"
620 <<
"\n on patch " << this->
patch().name()
621 <<
" of field " << this->internalField().name()
622 <<
" in file " << this->internalField().objectPath()
623 <<
"\n You are probably trying to solve for a field with a "
624 "generic boundary condition."
639 <<
"cannot be called for a genericFaPatchField"
640 " (actual type " << actualTypeName_ <<
")"
641 <<
"\n on patch " << this->
patch().name()
642 <<
" of field " << this->internalField().name()
643 <<
" in file " << this->internalField().objectPath()
644 <<
"\n You are probably trying to solve for a field with a "
645 "generic boundary condition."
657 <<
"cannot be called for a genericFaPatchField"
658 " (actual type " << actualTypeName_ <<
")"
659 <<
"\n on patch " << this->
patch().name()
660 <<
" of field " << this->internalField().name()
661 <<
" in file " << this->internalField().objectPath()
662 <<
"\n You are probably trying to solve for a field with a "
663 "generic boundary condition."
674 <<
"cannot be called for a genericFaPatchField"
675 " (actual type " << actualTypeName_ <<
")"
676 <<
"\n on patch " << this->
patch().name()
677 <<
" of field " << this->internalField().name()
678 <<
" in file " << this->internalField().objectPath()
679 <<
"\n You are probably trying to solve for a field with a "
680 "generic boundary condition."
690 return actualTypeName_;
699 for (
const entry& dEntry : dict_)
701 const keyType& key = dEntry.keyword();
703 if (key ==
"type" || key ==
"value")
711 && dEntry.stream().size()
712 && dEntry.stream()[0].isWord()
713 && dEntry.stream()[0].wordToken() ==
"nonuniform"
716 if (scalarFields_.found(key))
718 scalarFields_.cfind(key)()->writeEntry(key, os);
720 else if (vectorFields_.found(key))
722 vectorFields_.cfind(key)()->writeEntry(key, os);
724 else if (sphTensorFields_.found(key))
726 sphTensorFields_.cfind(key)()->writeEntry(key, os);
728 else if (symmTensorFields_.found(key))
730 symmTensorFields_.cfind(key)()->writeEntry(key, os);
732 else if (tensorFields_.found(key))
734 tensorFields_.cfind(key)()->writeEntry(key, os);
743 this->writeEntry(
"value", os);