faceZoneToCell: Corrected cell selection logic

Patch contributed by Mattijs Janssens
Resolved bug-report http://www.openfoam.org/mantisbt/view.php?id=2038
This commit is contained in:
Henry Weller 2016-04-01 16:59:51 +01:00
parent 5312f6c7f0
commit eabb03aa2a

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -90,7 +90,7 @@ void Foam::faceZoneToCell::combine(topoSet& set, const bool add) const
forAll(cellLabels, i)
{
// Only do active cells
if (cellLabels[i] < mesh_.nCells())
if (cellLabels[i] >= 0 && cellLabels[i] < mesh_.nCells())
{
addOrDelete(set, cellLabels[i], add);
}