46 const GeometricField<Type, fvPatchField, volMesh>& vf,
54 PtrList<fvPatchField<Type>> patchFields(
patchMap.size());
56 forAll(patchFields, patchi)
66 new emptyFvPatchField<Type>
68 sMesh.boundary()[patchi],
80 calculatedFvPatchField<Type>::typeName,
81 sMesh.boundary()[patchi],
88 auto tresult = tmp<GeometricField<Type, fvPatchField, volMesh>>
::New
93 sMesh.time().timeName(),
100 Field<Type>(vf.primitiveField(),
cellMap),
103 auto& result = tresult.ref();
104 result.oriented() = vf.oriented();
110 auto& bf = result.boundaryFieldRef();
114 const label basePatchId =
patchMap[patchi];
116 if (basePatchId != -1)
119 const fvPatch& subPatch = sMesh.boundary()[patchi];
120 const fvPatch& basePatch = vf.mesh().boundary()[basePatchId];
121 const label baseStart = basePatch.start();
122 const label baseSize = basePatch.size();
124 labelList directAddressing(subPatch.size());
126 forAll(directAddressing, i)
128 const label baseFacei =
faceMap[subPatch.start()+i];
130 if (baseFacei >= baseStart && baseFacei < baseStart+baseSize)
132 directAddressing[i] = baseFacei-baseStart;
138 directAddressing[i] = -1;
147 vf.boundaryField()[basePatchId],
150 directFvPatchFieldMapper(directAddressing)
167 const GeometricField<Type, fvPatchField, volMesh>& vf
188 const GeometricField<Type, fvsPatchField, surfaceMesh>& vf,
196 PtrList<fvsPatchField<Type>> patchFields(patchMap.size());
198 forAll(patchFields, patchi)
203 if (patchMap[patchi] == -1)
208 new emptyFvsPatchField<Type>
210 sMesh.boundary()[patchi],
222 calculatedFvsPatchField<Type>::typeName,
223 sMesh.boundary()[patchi],
231 auto tresult = tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
::New
236 sMesh.time().timeName(),
246 SubList<label>(
faceMap, sMesh.nInternalFaces())
250 auto& result = tresult.ref();
251 result.oriented() = vf.oriented();
257 auto& bf = result.boundaryFieldRef();
261 if (patchMap[patchi] != -1)
264 const fvPatch& subPatch = sMesh.boundary()[patchi];
265 const fvPatch& basePatch = vf.mesh().boundary()[patchMap[patchi]];
266 const label baseStart = basePatch.start();
267 const label baseSize = basePatch.size();
269 labelList directAddressing(subPatch.size());
271 forAll(directAddressing, i)
273 label baseFacei =
faceMap[subPatch.start()+i];
275 if (baseFacei >= baseStart && baseFacei < baseStart+baseSize)
277 directAddressing[i] = baseFacei-baseStart;
284 directAddressing[i] = -1;
293 vf.boundaryField()[patchMap[patchi]],
296 directFvPatchFieldMapper(directAddressing)
303 fvsPatchField<Type>& pfld = bf[patchi];
304 const labelUList& fc = bf[patchi].patch().faceCells();
305 const labelList& own = vf.mesh().faceOwner();
309 label baseFacei =
faceMap[subPatch.start()+i];
310 if (baseFacei < vf.primitiveField().size())
312 Type val = vf.internalField()[baseFacei];
314 if (cellMap[fc[i]] == own[baseFacei] || !vf.oriented()())
320 pfld[i] = flipOp()(val);
327 label patchi = vf.mesh().boundaryMesh().whichPatch
331 const fvPatch& otherPatch = vf.mesh().boundary()[patchi];
332 label patchFacei = otherPatch.patch().whichFace(baseFacei);
333 pfld[i] = vf.boundaryField()[patchi][patchFacei];
350 const GeometricField<Type, fvsPatchField, surfaceMesh>& sf
371 const GeometricField<Type, pointPatchField, pointMesh>& vf,
372 const pointMesh& sMesh,
378 PtrList<pointPatchField<Type>> patchFields(patchMap.size());
380 forAll(patchFields, patchi)
385 if (patchMap[patchi] == -1)
390 new emptyPointPatchField<Type>
392 sMesh.boundary()[patchi],
404 calculatedPointPatchField<Type>::typeName,
405 sMesh.boundary()[patchi],
413 auto tresult = tmp<GeometricField<Type, pointPatchField, pointMesh>>
::New
418 sMesh.time().timeName(),
425 Field<Type>(vf.primitiveField(), pointMap),
428 auto& result = tresult.ref();
429 result.oriented() = vf.oriented();
435 auto& bf = result.boundaryFieldRef();
442 if (patchMap[patchi] != -1)
445 const pointPatch& basePatch =
446 vf.mesh().boundary()[patchMap[patchi]];
448 const labelList& meshPoints = basePatch.meshPoints();
451 Map<label> meshPointMap(2*meshPoints.size());
452 forAll(meshPoints, localI)
454 meshPointMap.insert(meshPoints[localI], localI);
458 const pointPatch& subPatch = sMesh.boundary()[patchi];
459 const labelList& subMeshPoints = subPatch.meshPoints();
462 labelList directAddressing(subPatch.size(), -1);
464 forAll(subMeshPoints, localI)
467 label meshPointi = pointMap[subMeshPoints[localI]];
469 const auto iter = meshPointMap.cfind(meshPointi);
473 directAddressing[localI] = *iter;
482 vf.boundaryField()[patchMap[patchi]],
485 directPointPatchFieldMapper(directAddressing)
502 const GeometricField<Type, pointPatchField, pointMesh>& sf
522 const DimensionedField<Type, volMesh>& df,
527 auto tresult = tmp<DimensionedField<Type, volMesh>>
::New
532 sMesh.time().timeName(),
539 Field<Type>(df, cellMap)
541 tresult.ref().oriented() = df.oriented();
554 const DimensionedField<Type, volMesh>& df