STYLE: avoid unrestricted dictionary lookup in conversion, sampling, surfMesh

- aids with detection of excess tokens (issue #762)

- deprecated dictionary::operator[] in favour of the lookup() method
  which offers more flexibilty and clarity of purpose.
  Additionally, the read<> and get<> forms should generally be used
  instead anyhow.
This commit is contained in:
Mark Olesen
2018-07-18 13:33:00 +02:00
parent 956abe3f38
commit a592ebc073
59 changed files with 158 additions and 262 deletions

View File

@ -292,7 +292,7 @@ int main(int argc, char *argv[])
// message.
if (surfaceDict.found("surfaces") || !dictName.hasExt())
{
loader.select(wordReList(surfaceDict.lookup("surfaces")));
loader.select(surfaceDict.get<wordRes>("surfaces"));
}
else
{
@ -508,7 +508,7 @@ int main(int argc, char *argv[])
boolList surfBaffleRegions(surf.patches().size(), false);
if (surfaceDict.found("baffles"))
{
wordReList baffleSelect(surfaceDict.lookup("baffles"));
wordRes baffleSelect(surfaceDict.get<wordRes>("baffles"));
wordList patchNames(surf.patches().size());
forAll(surf.patches(), patchi)
@ -549,7 +549,11 @@ int main(int argc, char *argv[])
if (surfaceDict.isDict("addFeatures"))
{
const word addFeName = surfaceDict.subDict("addFeatures")["name"];
const word addFeName
(
surfaceDict.subDict("addFeatures").get<word>("name")
);
Info<< "Adding (without merging) features from " << addFeName
<< nl << endl;
@ -736,7 +740,7 @@ int main(int argc, char *argv[])
outputName,
feMesh,
surf,
readScalar(surfaceDict.lookup("maxFeatureProximity"))
surfaceDict.get<scalar>("maxFeatureProximity")
);
if (writeVTK)