Commit 736e4596 authored by mattijs's avatar mattijs
Browse files

ENH: autoHexMesh: warn for unused entries

parent 13082485
......@@ -126,14 +126,20 @@ Foam::refinementSurfaces::refinementSurfaces
List<Map<scalar> > regionAngle(surfI);
List<Map<autoPtr<dictionary> > > regionPatchInfo(surfI);
HashSet<word> 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;
......
......@@ -387,15 +387,21 @@ Foam::shellSurfaces::shellSurfaces
distances_.setSize(shellI);
levels_.setSize(shellI);
HashSet<word> 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.
......
Supports Markdown
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