diff --git a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C index 46a94682153976691a407e957b3a11c4e77fc05c..c24519989e25352ba6bb1d4eb7db8f50106a5036 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C +++ b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,7 +70,7 @@ void Foam::cyclicACMIPolyPatch::resetAMI initPatchFaceAreas(); - // reset patch face areas based on original patch for AMI calculation + // Reset patch face areas based on original patch for AMI calculation vectorField::subField Sf = faceAreas(); vectorField::subField noSf = nonOverlapPatch.faceAreas(); @@ -80,7 +80,7 @@ void Foam::cyclicACMIPolyPatch::resetAMI noSf[faceI] = faceAreas0_[faceI]; } - // calculate the AMI using partial face-area-weighted + // Calculate the AMI using partial face-area-weighted cyclicAMIPolyPatch::resetAMI ( AMIPatchToPatchInterpolation::imPartialFaceAreaWeight @@ -100,7 +100,7 @@ void Foam::cyclicACMIPolyPatch::resetAMI setNeighbourFaceAreas(); - // set the updated flag + // Set the updated flag updated_ = true; } } @@ -114,20 +114,29 @@ void Foam::cyclicACMIPolyPatch::setNeighbourFaceAreas() const const vectorField& faceAreas0 = cp.faceAreas0(); - vectorField::subField Sf = cp.faceAreas(); - vectorField::subField noSf = pp.faceAreas(); + if (tgtMask_.size() == cp.size()) + { + vectorField::subField Sf = cp.faceAreas(); + vectorField::subField noSf = pp.faceAreas(); - forAll(Sf, faceI) + forAll(Sf, faceI) + { + Sf[faceI] = tgtMask_[faceI]*faceAreas0[faceI]; + noSf[faceI] = (1.0 - tgtMask_[faceI])*faceAreas0[faceI]; + } + } + else { - Sf[faceI] = tgtMask_[faceI]*faceAreas0[faceI]; - noSf[faceI] = (1.0 - tgtMask_[faceI])*faceAreas0[faceI]; + WarningIn("cyclicAMIPolyPatch::setNeighbourFaceAreas() const") + << "Target mask size differs to that of the neighbour patch\n" + << " May occur when decomposing." << endl; } } void Foam::cyclicACMIPolyPatch::initGeometry(PstreamBuffers& pBufs) { - // initialise the AMI so that base geometry (e.g. cell volumes) are + // Initialise the AMI so that base geometry (e.g. cell volumes) are // correctly evaluated resetAMI();