diff --git a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C index f0277b2990..b61fa74be3 100644 --- a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C +++ b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C @@ -126,14 +126,20 @@ Foam::refinementSurfaces::refinementSurfaces List > regionAngle(surfI); List > > regionPatchInfo(surfI); + + HashSet unmatchedKeys(surfacesDict.toc()); + surfI = 0; forAll(allGeometry.names(), geomI) { const word& geomName = allGeometry_.names()[geomI]; - if (surfacesDict.found(geomName)) + const entry* ePtr = surfacesDict.lookupEntryPtr(geomName, false, true); + + if (ePtr) { - const dictionary& dict = surfacesDict.subDict(geomName); + const dictionary& dict = ePtr->dict(); + unmatchedKeys.erase(ePtr->keyword()); names_[surfI] = geomName; surfaces_[surfI] = geomI; @@ -154,16 +160,17 @@ Foam::refinementSurfaces::refinementSurfaces || globalLevelIncr[surfI] < 0 ) { - FatalErrorIn + FatalIOErrorIn ( "refinementSurfaces::refinementSurfaces" - "(const searchableSurfaces&, const dictionary>&" + "(const searchableSurfaces&, const dictionary>&", + dict ) << "Illegal level specification for surface " << names_[surfI] << " : minLevel:" << globalMinLevel[surfI] << " maxLevel:" << globalMaxLevel[surfI] << " levelIncrement:" << globalLevelIncr[surfI] - << exit(FatalError); + << exit(FatalIOError); } @@ -286,17 +293,18 @@ Foam::refinementSurfaces::refinementSurfaces || levelIncr < 0 ) { - FatalErrorIn + FatalIOErrorIn ( "refinementSurfaces::refinementSurfaces" - "(const searchableSurfaces&, const dictionary>&" + "(const searchableSurfaces&, const dictionary&", + dict ) << "Illegal level specification for surface " << names_[surfI] << " region " << regionNames[regionI] << " : minLevel:" << refLevel[0] << " maxLevel:" << refLevel[1] << " levelIncrement:" << levelIncr - << exit(FatalError); + << exit(FatalIOError); } @@ -328,6 +336,19 @@ Foam::refinementSurfaces::refinementSurfaces } } + if (unmatchedKeys.size() > 0) + { + IOWarningIn + ( + "refinementSurfaces::refinementSurfaces(..)", + surfacesDict + ) << "Not all entries in refinementSurfaces dictionary were used." + << " The following entries were not used : " + << unmatchedKeys.sortedToc() + << endl; + } + + // Calculate local to global region offset label nRegions = 0; diff --git a/src/mesh/autoMesh/autoHexMesh/shellSurfaces/shellSurfaces.C b/src/mesh/autoMesh/autoHexMesh/shellSurfaces/shellSurfaces.C index 8de805a692..cd39802553 100644 --- a/src/mesh/autoMesh/autoHexMesh/shellSurfaces/shellSurfaces.C +++ b/src/mesh/autoMesh/autoHexMesh/shellSurfaces/shellSurfaces.C @@ -387,15 +387,21 @@ Foam::shellSurfaces::shellSurfaces distances_.setSize(shellI); levels_.setSize(shellI); + HashSet unmatchedKeys(shellsDict.toc()); shellI = 0; - forAll(allGeometry.names(), geomI) + + forAll(allGeometry_.names(), geomI) { const word& geomName = allGeometry_.names()[geomI]; - if (shellsDict.found(geomName)) + const entry* ePtr = shellsDict.lookupEntryPtr(geomName, false, true); + + if (ePtr) { + const dictionary& dict = ePtr->dict(); + unmatchedKeys.erase(ePtr->keyword()); + shells_[shellI] = geomI; - const dictionary& dict = shellsDict.subDict(geomName); modes_[shellI] = refineModeNames_.read(dict.lookup("mode")); // Read pairs of distance+level @@ -405,6 +411,18 @@ Foam::shellSurfaces::shellSurfaces } } + if (unmatchedKeys.size() > 0) + { + IOWarningIn + ( + "shellSurfaces::shellSurfaces(..)", + shellsDict + ) << "Not all entries in refinementRegions dictionary were used." + << " The following entries were not used : " + << unmatchedKeys.sortedToc() + << endl; + } + // Orient shell surfaces before any searching is done. Note that this // only needs to be done for inside or outside. Orienting surfaces // constructs lots of addressing which we want to avoid.