cyclicACMIPolyPatch: Hacked to avoid sigSegv during decomposition

Resolves bug report http://www.openfoam.org/mantisbt/view.php?id=1450
This commit is contained in:
Henry
2015-02-25 20:51:37 +00:00
parent df0a3b95cc
commit f8ca4fefd3

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -70,7 +70,7 @@ void Foam::cyclicACMIPolyPatch::resetAMI
initPatchFaceAreas(); 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 Sf = faceAreas();
vectorField::subField noSf = nonOverlapPatch.faceAreas(); vectorField::subField noSf = nonOverlapPatch.faceAreas();
@ -80,7 +80,7 @@ void Foam::cyclicACMIPolyPatch::resetAMI
noSf[faceI] = faceAreas0_[faceI]; noSf[faceI] = faceAreas0_[faceI];
} }
// calculate the AMI using partial face-area-weighted // Calculate the AMI using partial face-area-weighted
cyclicAMIPolyPatch::resetAMI cyclicAMIPolyPatch::resetAMI
( (
AMIPatchToPatchInterpolation::imPartialFaceAreaWeight AMIPatchToPatchInterpolation::imPartialFaceAreaWeight
@ -100,7 +100,7 @@ void Foam::cyclicACMIPolyPatch::resetAMI
setNeighbourFaceAreas(); setNeighbourFaceAreas();
// set the updated flag // Set the updated flag
updated_ = true; updated_ = true;
} }
} }
@ -114,6 +114,8 @@ void Foam::cyclicACMIPolyPatch::setNeighbourFaceAreas() const
const vectorField& faceAreas0 = cp.faceAreas0(); const vectorField& faceAreas0 = cp.faceAreas0();
if (tgtMask_.size() == cp.size())
{
vectorField::subField Sf = cp.faceAreas(); vectorField::subField Sf = cp.faceAreas();
vectorField::subField noSf = pp.faceAreas(); vectorField::subField noSf = pp.faceAreas();
@ -123,11 +125,18 @@ void Foam::cyclicACMIPolyPatch::setNeighbourFaceAreas() const
noSf[faceI] = (1.0 - tgtMask_[faceI])*faceAreas0[faceI]; noSf[faceI] = (1.0 - tgtMask_[faceI])*faceAreas0[faceI];
} }
} }
else
{
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) 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 // correctly evaluated
resetAMI(); resetAMI();