BUG: faceZone: checkAddressing gets called when mesh.nFaces not set yet.

This commit is contained in:
mattijs
2013-06-21 11:30:26 +01:00
parent 20726d5371
commit 8776981c71

View File

@ -174,14 +174,17 @@ void Foam::faceZone::checkAddressing() const
const labelList& mf = *this;
// Note: nFaces, nCells might not be set yet on mesh so use owner size
const label nFaces = zoneMesh().mesh().faceOwner().size();
bool hasWarned = false;
forAll(mf, i)
{
if (!hasWarned && (mf[i] < 0 || mf[i] >= zoneMesh().mesh().nFaces()))
if (!hasWarned && (mf[i] < 0 || mf[i] >= nFaces))
{
WarningIn("void Foam::faceZone::checkAddressing() const")
<< "Illegal face index " << mf[i] << " outside range 0.."
<< zoneMesh().mesh().nFaces()-1 << endl;
<< nFaces-1 << endl;
hasWarned = true;
}
}