46 const GeometricField<Type, fvPatchField, volMesh>& vf,
51 const bool allowUnmapped
55 PtrList<fvPatchField<Type>> patchFields(
patchMap.size());
57 forAll(patchFields, patchi)
67 new emptyFvPatchField<Type>
69 sMesh.boundary()[patchi],
81 calculatedFvPatchField<Type>::typeName,
82 sMesh.boundary()[patchi],
89 auto tresult = tmp<GeometricField<Type, fvPatchField, volMesh>>
::New
94 sMesh.time().timeName(),
101 Field<Type>(vf.primitiveField(),
cellMap),
104 auto& result = tresult.ref();
105 result.oriented() = vf.oriented();
111 auto& bf = result.boundaryFieldRef();
115 const label basePatchId =
patchMap[patchi];
117 if (basePatchId != -1)
120 const fvPatch& subPatch = sMesh.boundary()[patchi];
121 const fvPatch& basePatch = vf.mesh().boundary()[basePatchId];
122 const label baseStart = basePatch.start();
123 const label baseSize = basePatch.size();
125 labelList directAddressing(subPatch.size());
127 forAll(directAddressing, i)
129 const label baseFacei =
faceMap[subPatch.start()+i];
131 if (baseFacei >= baseStart && baseFacei < baseStart+baseSize)
133 directAddressing[i] = baseFacei-baseStart;
139 directAddressing[i] = -1;
144 directFvPatchFieldMapper mapper(directAddressing);
148 const bool hasUnmapped = mapper.hasUnmapped();
151 mapper.hasUnmapped() =
false;
159 vf.boundaryField()[basePatchId],
166 if (allowUnmapped && hasUnmapped)
173 tmp<Field<Type>> tfld(bf[patchi].patchInternalField());
174 const Field<Type>&
fld = tfld();
176 Field<Type> value(bf[patchi]);
177 forAll(directAddressing, i)
179 if (directAddressing[i] == -1)
184 bf[patchi].fvPatchField<Type>::operator=(value);
200 const GeometricField<Type, fvPatchField, volMesh>& vf,
201 const bool allowUnmapped
223 const GeometricField<Type, fvsPatchField, surfaceMesh>& vf,
231 PtrList<fvsPatchField<Type>> patchFields(patchMap.size());
233 forAll(patchFields, patchi)
238 if (patchMap[patchi] == -1)
243 new emptyFvsPatchField<Type>
245 sMesh.boundary()[patchi],
257 calculatedFvsPatchField<Type>::typeName,
258 sMesh.boundary()[patchi],
266 auto tresult = tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
::New
271 sMesh.time().timeName(),
281 SubList<label>(
faceMap, sMesh.nInternalFaces())
285 auto& result = tresult.ref();
286 result.oriented() = vf.oriented();
292 auto& bf = result.boundaryFieldRef();
296 if (patchMap[patchi] != -1)
299 const fvPatch& subPatch = sMesh.boundary()[patchi];
300 const fvPatch& basePatch = vf.mesh().boundary()[patchMap[patchi]];
301 const label baseStart = basePatch.start();
302 const label baseSize = basePatch.size();
304 labelList directAddressing(subPatch.size());
306 forAll(directAddressing, i)
308 label baseFacei =
faceMap[subPatch.start()+i];
310 if (baseFacei >= baseStart && baseFacei < baseStart+baseSize)
312 directAddressing[i] = baseFacei-baseStart;
319 directAddressing[i] = -1;
328 vf.boundaryField()[patchMap[patchi]],
331 directFvPatchFieldMapper(directAddressing)
338 fvsPatchField<Type>& pfld = bf[patchi];
339 const labelUList& fc = bf[patchi].patch().faceCells();
340 const labelList& own = vf.mesh().faceOwner();
344 label baseFacei =
faceMap[subPatch.start()+i];
345 if (baseFacei < vf.primitiveField().size())
347 Type val = vf.internalField()[baseFacei];
349 if (cellMap[fc[i]] == own[baseFacei] || !vf.oriented()())
355 pfld[i] = flipOp()(val);
362 label patchi = vf.mesh().boundaryMesh().whichPatch
366 const fvPatch& otherPatch = vf.mesh().boundary()[patchi];
367 label patchFacei = otherPatch.patch().whichFace(baseFacei);
368 pfld[i] = vf.boundaryField()[patchi][patchFacei];
385 const GeometricField<Type, fvsPatchField, surfaceMesh>& sf,
386 const bool allowUnmapped
407 const GeometricField<Type, pointPatchField, pointMesh>& vf,
408 const pointMesh& sMesh,
414 PtrList<pointPatchField<Type>> patchFields(patchMap.size());
416 forAll(patchFields, patchi)
421 if (patchMap[patchi] == -1)
426 new emptyPointPatchField<Type>
428 sMesh.boundary()[patchi],
440 calculatedPointPatchField<Type>::typeName,
441 sMesh.boundary()[patchi],
449 auto tresult = tmp<GeometricField<Type, pointPatchField, pointMesh>>
::New
454 sMesh.time().timeName(),
461 Field<Type>(vf.primitiveField(), pointMap),
464 auto& result = tresult.ref();
465 result.oriented() = vf.oriented();
471 auto& bf = result.boundaryFieldRef();
478 if (patchMap[patchi] != -1)
481 const pointPatch& basePatch =
482 vf.mesh().boundary()[patchMap[patchi]];
484 const labelList& meshPoints = basePatch.meshPoints();
487 Map<label> meshPointMap(2*meshPoints.size());
488 forAll(meshPoints, localI)
490 meshPointMap.insert(meshPoints[localI], localI);
494 const pointPatch& subPatch = sMesh.boundary()[patchi];
495 const labelList& subMeshPoints = subPatch.meshPoints();
498 labelList directAddressing(subPatch.size(), -1);
500 forAll(subMeshPoints, localI)
503 label meshPointi = pointMap[subMeshPoints[localI]];
505 const auto iter = meshPointMap.cfind(meshPointi);
509 directAddressing[localI] = *iter;
518 vf.boundaryField()[patchMap[patchi]],
521 directPointPatchFieldMapper(directAddressing)
538 const GeometricField<Type, pointPatchField, pointMesh>& sf,
539 const bool allowUnmapped
559 const DimensionedField<Type, volMesh>& df,
564 auto tresult = tmp<DimensionedField<Type, volMesh>>
::New
569 sMesh.time().timeName(),
576 Field<Type>(df, cellMap)
578 tresult.ref().oriented() = df.oriented();
591 const DimensionedField<Type, volMesh>& df,
592 const bool allowUnmapped