From 104d262f8dc81c424b13fbc379ba75a1d4d12c89 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 13 Jun 2013 14:13:53 +0100 Subject: [PATCH] ENH: faceZone: warn for illegal contents --- .../meshes/polyMesh/zones/faceZone/faceZone.C | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C index 2615d21705..7e3850891d 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -171,6 +171,20 @@ void Foam::faceZone::checkAddressing() const << " size of flip map: " << flipMap_.size() << abort(FatalError); } + + const labelList& mf = *this; + + bool hasWarned = false; + forAll(mf, i) + { + if (!hasWarned && (mf[i] < 0 || mf[i] >= zoneMesh().mesh().nFaces())) + { + WarningIn("void Foam::faceZone::checkAddressing() const") + << "Illegal face index " << mf[i] << " outside range 0.." + << zoneMesh().mesh().nFaces()-1 << endl; + hasWarned = true; + } + } }