ENH: faceZone: warn for illegal contents

This commit is contained in:
mattijs
2013-06-13 14:13:53 +01:00
parent 180c59fbe2
commit 104d262f8d

View File

@ -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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -171,6 +171,20 @@ void Foam::faceZone::checkAddressing() const
<< " size of flip map: " << flipMap_.size() << " size of flip map: " << flipMap_.size()
<< abort(FatalError); << 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;
}
}
} }