ENH: snappyHexMesh: limit warnings to 100 points. Fixes #941.

This commit is contained in:
mattijs
2018-07-23 12:54:41 +01:00
parent c26ef75df4
commit f72fb23d30
3 changed files with 63 additions and 18 deletions

View File

@ -233,10 +233,6 @@ public:
{ {
return minAreaRatio_; return minAreaRatio_;
} }
}; };

View File

@ -2015,12 +2015,23 @@ Foam::vectorField Foam::snappySnapDriver::calcNearestSurface
{ {
if (snapSurf[pointi] == -1) if (snapSurf[pointi] == -1)
{ {
WarningInFunction static label nWarn = 0;
<< "For point:" << pointi
<< " coordinate:" << localPoints[pointi] if (nWarn < 100)
<< " did not find any surface within:" {
<< minSnapDist[pointi] WarningInFunction
<< " metre." << endl; << "For point:" << pointi
<< " coordinate:" << localPoints[pointi]
<< " did not find any surface within:"
<< minSnapDist[pointi] << " metre." << endl;
nWarn++;
if (nWarn == 100)
{
WarningInFunction
<< "Reached warning limit " << nWarn
<< ". Suppressing further warnings." << endl;
}
}
} }
} }

View File

@ -328,9 +328,21 @@ void Foam::snappySnapDriver::calcNearestFace
} }
else else
{ {
WarningInFunction static label nWarn = 0;
<< "Did not find surface near face centre " << fc[hiti]
if (nWarn < 100)
{
WarningInFunction
<< "Did not find surface near face centre " << fc[hiti]
<< endl; << endl;
nWarn++;
if (nWarn == 100)
{
WarningInFunction
<< "Reached warning limit " << nWarn
<< ". Suppressing further warnings." << endl;
}
}
} }
} }
} }
@ -392,9 +404,22 @@ void Foam::snappySnapDriver::calcNearestFace
} }
else else
{ {
WarningInFunction static label nWarn = 0;
<< "Did not find surface near face centre " << fc[hiti]
<< endl; if (nWarn < 100)
{
WarningInFunction
<< "Did not find surface near face centre " << fc[hiti]
<< endl;
nWarn++;
if (nWarn == 100)
{
WarningInFunction
<< "Reached warning limit " << nWarn
<< ". Suppressing further warnings." << endl;
}
}
} }
} }
@ -3283,9 +3308,22 @@ void Foam::snappySnapDriver::reverseAttractMeshPoints
} }
else else
{ {
WarningInFunction static label nWarn = 0;
<< "Did not find pp point near " << featPt
<< endl; if (nWarn < 100)
{
WarningInFunction
<< "Did not find pp point near " << featPt
<< endl;
nWarn++;
if (nWarn == 100)
{
WarningInFunction
<< "Reached warning limit " << nWarn
<< ". Suppressing further warnings." << endl;
}
}
} }
} }
} }