From eabb03aa2ac7b2cf74b37edcb1ef1f1f29a526e8 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 1 Apr 2016 16:59:51 +0100 Subject: [PATCH] faceZoneToCell: Corrected cell selection logic Patch contributed by Mattijs Janssens Resolved bug-report http://www.openfoam.org/mantisbt/view.php?id=2038 --- .../sets/cellSources/faceZoneToCell/faceZoneToCell.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C index 9157348433..3f5d7ece30 100644 --- a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C +++ b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C @@ -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); }