Commit 6c22596f authored by mattijs's avatar mattijs
Browse files

ENH: snappyHexMesh: input checking. See #972.

parent 4d03e438
......@@ -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)
{
......
......@@ -207,6 +207,7 @@ Foam::refinementSurfaces::refinementSurfaces
(
globalMinLevel[surfI] < 0
|| globalMaxLevel[surfI] < globalMinLevel[surfI]
|| globalMaxLevel[surfI] < 0
|| globalLevelIncr[surfI] < 0
)
{
......
......@@ -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 "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment