From f8ca4fefd35e49e7ce64942a9d279344423d85c0 Mon Sep 17 00:00:00 2001 From: Henry <Henry> Date: Wed, 25 Feb 2015 20:51:37 +0000 Subject: [PATCH] cyclicACMIPolyPatch: Hacked to avoid sigSegv during decomposition Resolves bug report http://www.openfoam.org/mantisbt/view.php?id=1450 --- .../cyclicACMIPolyPatch/cyclicACMIPolyPatch.C | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C index 46a94682153..c24519989e2 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(); -- GitLab