mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: snappyHexMesh: input checking. See #972.
This commit is contained in:
@ -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 "
|
||||
|
||||
Reference in New Issue
Block a user