mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: autoHexMesh: warn for unused entries
This commit is contained in:
@ -126,14 +126,20 @@ Foam::refinementSurfaces::refinementSurfaces
|
|||||||
List<Map<scalar> > regionAngle(surfI);
|
List<Map<scalar> > regionAngle(surfI);
|
||||||
List<Map<autoPtr<dictionary> > > regionPatchInfo(surfI);
|
List<Map<autoPtr<dictionary> > > regionPatchInfo(surfI);
|
||||||
|
|
||||||
|
|
||||||
|
HashSet<word> unmatchedKeys(surfacesDict.toc());
|
||||||
|
|
||||||
surfI = 0;
|
surfI = 0;
|
||||||
forAll(allGeometry.names(), geomI)
|
forAll(allGeometry.names(), geomI)
|
||||||
{
|
{
|
||||||
const word& geomName = 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;
|
names_[surfI] = geomName;
|
||||||
surfaces_[surfI] = geomI;
|
surfaces_[surfI] = geomI;
|
||||||
@ -154,16 +160,17 @@ Foam::refinementSurfaces::refinementSurfaces
|
|||||||
|| globalLevelIncr[surfI] < 0
|
|| globalLevelIncr[surfI] < 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalIOErrorIn
|
||||||
(
|
(
|
||||||
"refinementSurfaces::refinementSurfaces"
|
"refinementSurfaces::refinementSurfaces"
|
||||||
"(const searchableSurfaces&, const dictionary>&"
|
"(const searchableSurfaces&, const dictionary>&",
|
||||||
|
dict
|
||||||
) << "Illegal level specification for surface "
|
) << "Illegal level specification for surface "
|
||||||
<< names_[surfI]
|
<< names_[surfI]
|
||||||
<< " : minLevel:" << globalMinLevel[surfI]
|
<< " : minLevel:" << globalMinLevel[surfI]
|
||||||
<< " maxLevel:" << globalMaxLevel[surfI]
|
<< " maxLevel:" << globalMaxLevel[surfI]
|
||||||
<< " levelIncrement:" << globalLevelIncr[surfI]
|
<< " levelIncrement:" << globalLevelIncr[surfI]
|
||||||
<< exit(FatalError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -286,17 +293,18 @@ Foam::refinementSurfaces::refinementSurfaces
|
|||||||
|| levelIncr < 0
|
|| levelIncr < 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalIOErrorIn
|
||||||
(
|
(
|
||||||
"refinementSurfaces::refinementSurfaces"
|
"refinementSurfaces::refinementSurfaces"
|
||||||
"(const searchableSurfaces&, const dictionary>&"
|
"(const searchableSurfaces&, const dictionary&",
|
||||||
|
dict
|
||||||
) << "Illegal level specification for surface "
|
) << "Illegal level specification for surface "
|
||||||
<< names_[surfI] << " region "
|
<< names_[surfI] << " region "
|
||||||
<< regionNames[regionI]
|
<< regionNames[regionI]
|
||||||
<< " : minLevel:" << refLevel[0]
|
<< " : minLevel:" << refLevel[0]
|
||||||
<< " maxLevel:" << refLevel[1]
|
<< " maxLevel:" << refLevel[1]
|
||||||
<< " levelIncrement:" << levelIncr
|
<< " 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
|
// Calculate local to global region offset
|
||||||
label nRegions = 0;
|
label nRegions = 0;
|
||||||
|
|
||||||
|
|||||||
@ -387,15 +387,21 @@ Foam::shellSurfaces::shellSurfaces
|
|||||||
distances_.setSize(shellI);
|
distances_.setSize(shellI);
|
||||||
levels_.setSize(shellI);
|
levels_.setSize(shellI);
|
||||||
|
|
||||||
|
HashSet<word> unmatchedKeys(shellsDict.toc());
|
||||||
shellI = 0;
|
shellI = 0;
|
||||||
forAll(allGeometry.names(), geomI)
|
|
||||||
|
forAll(allGeometry_.names(), geomI)
|
||||||
{
|
{
|
||||||
const word& geomName = 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;
|
shells_[shellI] = geomI;
|
||||||
const dictionary& dict = shellsDict.subDict(geomName);
|
|
||||||
modes_[shellI] = refineModeNames_.read(dict.lookup("mode"));
|
modes_[shellI] = refineModeNames_.read(dict.lookup("mode"));
|
||||||
|
|
||||||
// Read pairs of distance+level
|
// 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
|
// Orient shell surfaces before any searching is done. Note that this
|
||||||
// only needs to be done for inside or outside. Orienting surfaces
|
// only needs to be done for inside or outside. Orienting surfaces
|
||||||
// constructs lots of addressing which we want to avoid.
|
// constructs lots of addressing which we want to avoid.
|
||||||
|
|||||||
Reference in New Issue
Block a user