diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.H b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.H index 68c432e97a..b2f0f4eb92 100644 --- a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.H +++ b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.H @@ -339,6 +339,39 @@ public: } + //- Wrapper around map/interpolate data distribution with supplied op + template + void distribute(List& lst, const BinaryOp& bop) const + { + switch (mode_) + { + case NEARESTPATCHFACEAMI: + { + lst = AMI().interpolateToSource + ( + Field(lst.xfer()), + bop + ); + break; + } + default: + { + map().distribute + ( + Pstream::defaultCommsType, + map().schedule(), + map().constructSize(), + map().subMap(), + map().constructMap(), + lst, + bop, + pTraits::zero + ); + } + } + } + + //- Wrapper around map/interpolate data distribution template void reverseDistribute(List& lst) const @@ -359,6 +392,40 @@ public: } + //- Wrapper around map/interpolate data distribution with supplied op + template + void reverseDistribute(List& lst, const BinaryOp& bop) const + { + switch (mode_) + { + case NEARESTPATCHFACEAMI: + { + lst = AMI().interpolateToTarget + ( + Field(lst.xfer()), + bop + ); + break; + } + default: + { + label cSize = patch_.size(); + map().distribute + ( + Pstream::defaultCommsType, + map().schedule(), + cSize, + map().constructMap(), + map().subMap(), + lst, + bop, + pTraits::zero + ); + } + } + } + + //- Return reference to the parallel distribution map const mapDistribute& map() const {