ENH: snappyHexMesh: input checking. See #972.

This commit is contained in:
mattijs
2018-08-13 15:55:41 +01:00
parent 4d03e4386d
commit 6c22596f3b
3 changed files with 21 additions and 2 deletions

View File

@ -204,6 +204,14 @@ void Foam::refinementFeatures::read
distances_[featI][j] = distLevels[j].first();
levels_[featI][j] = distLevels[j].second();
if (levels_[featI][j] < 0)
{
FatalErrorInFunction
<< "Feature " << featFileName
<< " has illegal refinement level " << levels_[featI][j]
<< exit(FatalError);
}
// Check in incremental order
if (j > 0)
{

View File

@ -207,6 +207,7 @@ Foam::refinementSurfaces::refinementSurfaces
(
globalMinLevel[surfI] < 0
|| globalMaxLevel[surfI] < globalMinLevel[surfI]
|| globalMaxLevel[surfI] < 0
|| globalLevelIncr[surfI] < 0
)
{

View File

@ -55,6 +55,8 @@ void Foam::shellSurfaces::setAndCheckLevels
const List<Tuple2<scalar, label>>& distLevels
)
{
const searchableSurface& shell = allGeometry_[shells_[shellI]];
if (modes_[shellI] != DISTANCE && distLevels.size() != 1)
{
FatalErrorInFunction
@ -73,6 +75,16 @@ void Foam::shellSurfaces::setAndCheckLevels
distances_[shellI][j] = distLevels[j].first();
levels_[shellI][j] = distLevels[j].second();
if (levels_[shellI][j] < -1)
{
FatalErrorInFunction
<< "Shell " << shell.name()
<< " has illegal refinement level "
<< levels_[shellI][j]
<< exit(FatalError);
}
// Check in incremental order
if (j > 0)
{
@ -95,8 +107,6 @@ void Foam::shellSurfaces::setAndCheckLevels
}
}
const searchableSurface& shell = allGeometry_[shells_[shellI]];
if (modes_[shellI] == DISTANCE)
{
Info<< "Refinement level according to distance to "