31 template<
class PatchFieldType,
class FieldType>
34 const PatchFieldType& field,
40 const polyPatch& pp = field.patch().patch();
42 if (!isA<mappedPatchBase>(pp))
45 str <<
"Field " << iF.
name() <<
" of type "
46 << field.
type() <<
" cannot apply to patch " << pp.
name()
47 <<
" because the patch is not of " << typeName <<
" type";
53 refCast<const mappedPatchBase>(pp).validateForField
63 template<
class PatchFieldType,
class FieldType>
66 const PatchFieldType& field,
72 const bool isNotRegion = !sameRegion() && (froms & from::sameRegion);
73 const bool isRegion = sameRegion() && (froms & from::differentRegion);
74 const bool isPatch = samePatch() && (froms & from::differentPatch);
78 if (isNotRegion || isRegion || isPatch)
80 str <<
"Field " << iF.
name() <<
" of type "
81 << field.
type() <<
" cannot apply to patch " << patch_.name()
82 <<
" because values are mapped from ";
87 str <<
"a different region";
91 str <<
"within the same region";
95 str <<
"the same patch";
98 if (isNotRegion || isRegion || isPatch)
111 if (sameUntransformedPatch())
116 if (nbrPatchIsMapped() && nbrMappedPatch().reMapNbr_)
119 treeNbrPatchFaceIndices_.clear();
120 patchToPatchIsValid_ =
false;
121 nbrMappedPatch().reMapNbr_ =
false;
126 if (treeMapPtr_.empty())
135 treeMapPtr_->distribute(tResult.
ref());
136 return transform_.transform().transform(tResult);
142 !patchToPatchIsValid_
143 && !(symmetric() && nbrMappedPatch().patchToPatchIsValid_)
150 transform_.transform().transform
153 ? patchToPatchPtr_->tgtToSrc(nbrFld)
154 : nbrMappedPatch().patchToPatchPtr_->srcToTgt(nbrFld)
174 if (sameUntransformedPatch())
179 if (nbrPatchIsMapped() && nbrMappedPatch().reMapNbr_)
182 treeNbrPatchFaceIndices_.clear();
183 patchToPatchIsValid_ =
false;
184 nbrMappedPatch().reMapNbr_ =
false;
189 if (treeMapPtr_.empty())
195 treeMapPtr_->reverseDistribute(treeNbrPatchFaceIndices_.size(), nbrFld);
197 tResult.
ref().rmap(nbrFld, treeNbrPatchFaceIndices_);
198 return transform_.transform().invTransform(tResult);
204 !patchToPatchIsValid_
205 && !(symmetric() && nbrMappedPatch().patchToPatchIsValid_)
212 transform_.transform().invTransform
215 ? patchToPatchPtr_->srcToTgt(
fld)
216 : nbrMappedPatch().patchToPatchPtr_->tgtToSrc(
fld)
Pre-declare SubField and related Field type.
void clear()
Clear the list, i.e. set size to zero.
virtual const fileName & name() const
Return the name of the stream.
Output to memory buffer stream.
string str() const
Return the string.
A list of keyword definitions, which are a keyword followed by any number of values (e....
fileType type(const bool checkVariants=true, const bool followLink=true) const
Return the file type: file, directory, undefined or.
tmp< Field< Type > > toNeighbour(const Field< Type > &fld) const
Map/interpolate patch field to the neighbour patch.
static void validateMapForField(const PatchFieldType &field, const FieldType &iF, const dictionary &context, const label froms=from::any)
Validate that the map exists and is appropriate for the given.
void validateForField(const PatchFieldType &field, const FieldType &iF, const dictionary &context, const label froms=from::any) const
Validate that the map is appropriate for the given.
tmp< Field< Type > > fromNeighbour(const Field< Type > &nbrFld) const
Map/interpolate the neighbour patch field to this patch.
const word & name() const
Return name.
A patch is a list of labels that address the faces in the global face list.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
string breakIntoIndentedLines(const string &str, const string::size_type nLength=80, const string::size_type nIndent=0)
Break a string up into indented lines.
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.