Skip to content
Snippets Groups Projects
Commit f8ca4fef authored by Henry's avatar Henry
Browse files

cyclicACMIPolyPatch: Hacked to avoid sigSegv during decomposition

parent df0a3b95
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -100,7 +100,7 @@ void Foam::cyclicACMIPolyPatch::resetAMI
setNeighbourFaceAreas(); setNeighbourFaceAreas();
// set the updated flag // Set the updated flag
updated_ = true; updated_ = true;
} }
} }
...@@ -114,20 +114,29 @@ void Foam::cyclicACMIPolyPatch::setNeighbourFaceAreas() const ...@@ -114,20 +114,29 @@ void Foam::cyclicACMIPolyPatch::setNeighbourFaceAreas() const
const vectorField& faceAreas0 = cp.faceAreas0(); const vectorField& faceAreas0 = cp.faceAreas0();
vectorField::subField Sf = cp.faceAreas(); if (tgtMask_.size() == cp.size())
vectorField::subField noSf = pp.faceAreas(); {
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]; WarningIn("cyclicAMIPolyPatch::setNeighbourFaceAreas() const")
noSf[faceI] = (1.0 - tgtMask_[faceI])*faceAreas0[faceI]; << "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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment