ENH: mapNearestAMI - added protection for case when srcFace =-1, e.g. if mesh bounds are dissimilar

This commit is contained in:
andy
2014-02-17 16:46:43 +00:00
committed by Andrew Heather
parent 8a564b9c58
commit a1a0c249a4

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -310,16 +310,19 @@ void Foam::mapNearestAMI<SourcePatch, TargetPatch>::calculate
{
label srcFaceI = findMappedSrcFace(tgtFaceI, tgtAddr);
// note - reversed search from src->tgt to tgt->src
findNearestFace
(
this->tgtPatch_,
this->srcPatch_,
tgtFaceI,
srcFaceI
);
if (srcFaceI >= 0)
{
// note - reversed search from src->tgt to tgt->src
findNearestFace
(
this->tgtPatch_,
this->srcPatch_,
tgtFaceI,
srcFaceI
);
tgtAddr[tgtFaceI].append(srcFaceI);
tgtAddr[tgtFaceI].append(srcFaceI);
}
}
}