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

@ -175,8 +175,8 @@ Foam::arraySet::arraySet
:
sampledSet(name, mesh, searchEngine, dict),
coordSys_(dict),
pointsDensity_(dict.lookup("pointsDensity")),
spanBox_(dict.lookup("spanBox"))
pointsDensity_(dict.get<labelVector>("pointsDensity")),
spanBox_(dict.get<vector>("spanBox"))
{
genSamples();
}

View File

@ -47,6 +47,7 @@ SourceFiles
#define arraySet_H
#include "sampledSet.H"
#include "labelVector.H"
#include "DynamicList.H"
#include "coordinateSystem.H"
@ -73,10 +74,10 @@ class arraySet
coordinateSystem coordSys_;
//- Point density vector
Vector<label> pointsDensity_;
labelVector pointsDensity_;
//- Span box
Vector<scalar> spanBox_;
vector spanBox_;
// Private Member Functions