diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H index fc2b484cb0..7c94b9b138 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H @@ -251,27 +251,35 @@ public: { public: - template + template void operator() ( const vectorTensorTransform& vt, const bool forward, - List& fld + List& fld ) const { - if (forward) + const tensor T(forward ? vt.R() : vt.R().T()); + transformList(T, fld); + } + + template + void operator() + ( + const vectorTensorTransform& vt, + const bool forward, + List >& flds + ) const + { + forAll(flds, i) { - transformList(vt.R(), fld); - } - else - { - transformList(vt.R().T(), fld); + operator()(vt, forward, flds[i]); } } //- Transform patch-based field - template - void operator()(const coupledPolyPatch& cpp, UList& fld) const + template + void operator()(const coupledPolyPatch& cpp, UList& fld) const { if (!cpp.parallel()) { @@ -280,8 +288,8 @@ public: } //- Transform sparse field - template class Container> - void operator()(const coupledPolyPatch& cpp, Container& map) + template class Container> + void operator()(const coupledPolyPatch& cpp, Container& map) const { if (!cpp.parallel()) @@ -313,6 +321,18 @@ public: fld = vt.invTransformPosition(pfld); } } + void operator() + ( + const vectorTensorTransform& vt, + const bool forward, + List >& flds + ) const + { + forAll(flds, i) + { + operator()(vt, forward, flds[i]); + } + } //- Transform patch-based field void operator()(const coupledPolyPatch& cpp, pointField& fld) const {