49 x.setSize(sz +
y.size());
81 template<
class Type,
class CombineOp>
89 if (result.
size() != tgtToSrcCellAddr_.size())
92 <<
"Supplied field size is not equal to target mesh size" <<
nl
93 <<
" source mesh = " << srcToTgtCellAddr_.size() <<
nl
94 <<
" target mesh = " << tgtToSrcCellAddr_.size() <<
nl
95 <<
" supplied field = " << result.
size()
101 if (singleMeshProc_ == -1)
110 const labelList& srcAddress = tgtToSrcCellAddr_[cellI];
111 const scalarList& srcWeight = tgtToSrcCellWght_[cellI];
113 if (srcAddress.
size())
115 result[cellI] *= (1.0 -
sum(srcWeight));
118 label srcI = srcAddress[i];
119 scalar
w = srcWeight[i];
120 cbop(result[cellI], cellI, work[srcI],
w);
129 const labelList& srcAddress = tgtToSrcCellAddr_[cellI];
130 const scalarList& srcWeight = tgtToSrcCellWght_[cellI];
132 if (srcAddress.
size())
134 result[cellI] *= (1.0 -
sum(srcWeight));
137 label srcI = srcAddress[i];
138 scalar
w = srcWeight[i];
139 cbop(result[cellI], cellI, srcField[srcI],
w);
147 template<
class Type,
class CombineOp>
152 const CombineOp& cop,
156 if (result.
size() != tgtToSrcCellAddr_.size())
159 <<
"Supplied field size is not equal to target mesh size" <<
nl
160 <<
" source mesh = " << srcToTgtCellAddr_.size() <<
nl
161 <<
" target mesh = " << tgtToSrcCellAddr_.size() <<
nl
162 <<
" supplied field = " << result.
size()
168 if (singleMeshProc_ == -1)
173 mapSrcToTgt(srcField, cop, result);
190 const labelList& srcAddress = tgtToSrcCellAddr_[cellI];
191 const scalarList& srcWeight = tgtToSrcCellWght_[cellI];
192 const pointList& srcVec = tgtToSrcCellVec_[cellI];
194 if (srcAddress.
size())
196 result[cellI] *= (1.0 -
sum(srcWeight));
199 label srcI = srcAddress[i];
200 scalar
w = srcWeight[i];
201 const vector& v = srcVec[i];
202 const Type srcVal = work[srcI]+(workGrad[srcI]&v);
203 cbop(result[cellI], cellI, srcVal,
w);
210 if (tgtToSrcCellVec_.empty())
213 mapSrcToTgt(srcField, cop, result);
219 const labelList& srcAddress = tgtToSrcCellAddr_[cellI];
220 const scalarList& srcWeight = tgtToSrcCellWght_[cellI];
221 const pointList& srcVec = tgtToSrcCellVec_[cellI];
223 if (srcAddress.
size())
226 result[cellI] *= (1.0 -
sum(srcWeight));
229 label srcI = srcAddress[i];
230 scalar
w = srcWeight[i];
231 const vector& v = srcVec[i];
232 const Type srcVal = srcField[srcI]+(srcGradField[srcI]&v);
233 cbop(result[cellI], cellI, srcVal,
w);
241 template<
class Type,
class CombineOp>
252 tgtToSrcCellAddr_.size(),
257 mapSrcToTgt(srcField, cop, tresult());
263 template<
class Type,
class CombineOp>
270 return mapSrcToTgt(tsrcField(), cop);
290 return mapSrcToTgt(tsrcField());
294 template<
class Type,
class CombineOp>
298 const CombineOp& cop,
302 if (result.
size() != srcToTgtCellAddr_.size())
305 <<
"Supplied field size is not equal to source mesh size" <<
nl
306 <<
" source mesh = " << srcToTgtCellAddr_.size() <<
nl
307 <<
" target mesh = " << tgtToSrcCellAddr_.size() <<
nl
308 <<
" supplied field = " << result.
size()
314 if (singleMeshProc_ == -1)
323 const labelList& tgtAddress = srcToTgtCellAddr_[cellI];
324 const scalarList& tgtWeight = srcToTgtCellWght_[cellI];
326 if (tgtAddress.
size())
328 result[cellI] *= (1.0 -
sum(tgtWeight));
331 label tgtI = tgtAddress[i];
332 scalar
w = tgtWeight[i];
333 cbop(result[cellI], cellI, work[tgtI],
w);
342 const labelList& tgtAddress = srcToTgtCellAddr_[cellI];
343 const scalarList& tgtWeight = srcToTgtCellWght_[cellI];
345 if (tgtAddress.
size())
347 result[cellI] *= (1.0 -
sum(tgtWeight));
350 label tgtI = tgtAddress[i];
351 scalar
w = tgtWeight[i];
352 cbop(result[cellI], cellI, tgtField[tgtI],
w);
360 template<
class Type,
class CombineOp>
365 const CombineOp& cop,
369 if (result.
size() != srcToTgtCellAddr_.size())
372 <<
"Supplied field size is not equal to source mesh size" <<
nl
373 <<
" source mesh = " << srcToTgtCellAddr_.size() <<
nl
374 <<
" target mesh = " << tgtToSrcCellAddr_.size() <<
nl
375 <<
" supplied field = " << result.
size()
381 if (singleMeshProc_ == -1)
386 mapTgtToSrc(tgtField, cop, result);
403 const labelList& tgtAddress = srcToTgtCellAddr_[cellI];
404 const scalarList& tgtWeight = srcToTgtCellWght_[cellI];
405 const pointList& tgtVec = srcToTgtCellVec_[cellI];
407 if (tgtAddress.
size())
409 result[cellI] *= (1.0 -
sum(tgtWeight));
412 label tgtI = tgtAddress[i];
413 scalar
w = tgtWeight[i];
414 const vector& v = tgtVec[i];
415 const Type tgtVal = work[tgtI]+(workGrad[tgtI]&v);
416 cbop(result[cellI], cellI, tgtVal,
w);
425 const labelList& tgtAddress = srcToTgtCellAddr_[cellI];
426 const scalarList& tgtWeight = srcToTgtCellWght_[cellI];
427 const pointList& tgtVec = srcToTgtCellVec_[cellI];
429 if (tgtAddress.
size())
431 result[cellI] *= (1.0 -
sum(tgtWeight));
434 label tgtI = tgtAddress[i];
435 scalar
w = tgtWeight[i];
436 const vector& v = tgtVec[i];
437 const Type tgtVal = tgtField[tgtI]+(tgtGradField[tgtI]&v);
438 cbop(result[cellI], cellI, tgtVal,
w);
446 template<
class Type,
class CombineOp>
457 srcToTgtCellAddr_.size(),
462 mapTgtToSrc(tgtField, cop, tresult());
468 template<
class Type,
class CombineOp>
475 return mapTgtToSrc(ttgtField(), cop);
499 template<
class Type,
class CombineOp>
503 const CombineOp& cop,
505 const bool secondOrder
525 template<
class Type,
class CombineOp>
546 template<
class Type,
class CombineOp>
550 const CombineOp& cop,
552 const bool secondOrder
555 mapInternalSrcToTgt(field, cop, result, secondOrder);
562 label srcPatchI = srcPatchID_[i];
563 label tgtPatchI = tgtPatchID_[i];
579 AMIList[i].singlePatchProc(),
581 AMIList[i].singlePatchProc() == -1
582 ? &AMIList[i].srcMap()
585 AMIList[i].tgtAddress(),
586 AMIList[i].tgtWeights()
598 mapAndOpSrcToTgt(AMIList[i], srcField, tgtField, cop);
601 forAll(cuttingPatches_, i)
603 label patchI = cuttingPatches_[i];
610 template<
class Type,
class CombineOp>
615 const CombineOp& cop,
616 const bool secondOrder
621 const fvMesh& tgtMesh =
static_cast<const fvMesh&
>(tgtRegion_);
624 const typename fieldType::GeometricBoundaryField& srcBfld =
634 label srcPatchI = srcPatchID_[i];
635 label tgtPatchI = tgtPatchID_[i];
637 if (!tgtPatchFields.
set(tgtPatchI))
657 forAll(tgtPatchFields, tgtPatchI)
659 if (!tgtPatchFields.
set(tgtPatchI))
682 type() +
":interpolate(" + field.name() +
")",
695 mapSrcToTgt(field, cop, tresult(), secondOrder);
701 template<
class Type,
class CombineOp>
706 const CombineOp& cop,
707 const bool secondOrder
710 return mapSrcToTgt(tfield(), cop, secondOrder);
719 const bool secondOrder
731 const bool secondOrder
738 template<
class Type,
class CombineOp>
742 const CombineOp& cop,
744 const bool secondOrder
764 template<
class Type,
class CombineOp>
785 template<
class Type,
class CombineOp>
789 const CombineOp& cop,
791 const bool secondOrder
794 mapInternalTgtToSrc(field, cop, result, secondOrder);
801 label srcPatchI = srcPatchID_[i];
802 label tgtPatchI = tgtPatchID_[i];
818 AMIList[i].singlePatchProc(),
820 AMIList[i].singlePatchProc() == -1
821 ? &AMIList[i].tgtMap()
824 AMIList[i].srcAddress(),
825 AMIList[i].srcWeights()
837 mapAndOpTgtToSrc(AMIList[i], srcField, tgtField, cop);
840 forAll(cuttingPatches_, i)
842 label patchI = cuttingPatches_[i];
849 template<
class Type,
class CombineOp>
854 const CombineOp& cop,
855 const bool secondOrder
860 const fvMesh& srcMesh =
static_cast<const fvMesh&
>(srcRegion_);
863 const typename fieldType::GeometricBoundaryField& tgtBfld =
873 label srcPatchI = srcPatchID_[i];
874 label tgtPatchI = tgtPatchID_[i];
876 if (!srcPatchFields.
set(tgtPatchI))
896 forAll(srcPatchFields, srcPatchI)
898 if (!srcPatchFields.
set(srcPatchI))
921 type() +
":interpolate(" + field.name() +
")",
934 mapTgtToSrc(field, cop, tresult(), secondOrder);
940 template<
class Type,
class CombineOp>
945 const CombineOp& cop,
946 const bool secondOrder
949 return mapTgtToSrc(tfield(), cop, secondOrder);
958 const bool secondOrder
970 const bool secondOrder