STYLE: avoid deprecated lookup methods

This commit is contained in:
Mark Olesen 2019-05-22 15:06:12 +01:00 committed by Andrew Heather
parent 0ae939e8f8
commit b5d775a691
3 changed files with 14 additions and 16 deletions

View File

@ -779,7 +779,7 @@ int main(int argc, char *argv[])
const bool overwrite = args.found("overwrite");
const bool checkGeometry = args.found("checkGeometry");
const bool surfaceSimplify = args.found("surfaceSimplify");
const bool dryRun = args.optionFound("dry-run");
const bool dryRun = args.found("dry-run");
if (dryRun)
{
@ -788,7 +788,6 @@ int main(int argc, char *argv[])
}
#include "createNamedMesh.H"
Info<< "Read mesh in = "
<< runTime.cpuTimeIncrement() << " s" << endl;

View File

@ -303,26 +303,25 @@ bool Foam::distributedTriSurfaceMesh::read()
}
else
{
procBb_[Pstream::myProcNo()] =
List<treeBoundBox>(dict_.lookup("bounds"));
dict_.readEntry("bounds", procBb_[Pstream::myProcNo()]);
Pstream::gatherList(procBb_);
Pstream::scatterList(procBb_);
// Wanted distribution type
distType_ = distributionTypeNames_.lookup("distributionType", dict_);
distType_ = distributionTypeNames_.get("distributionType", dict_);
// Merge distance
mergeDist_ = readScalar(dict_.lookup("mergeDistance"));
dict_.readEntry("mergeDistance", mergeDist_);
// Distribution type
surfaceClosed_ = dict_.lookupOrDefault<bool>("closed", false);
surfaceClosed_ = dict_.getOrDefault<bool>("closed", false);
outsideVolType_ = volumeType::UNKNOWN;
word volType;
if (dict_.readIfPresent<word>("outsideVolumeType", volType))
{
outsideVolType_ = volumeType::names[volType];
}
outsideVolType_ = volumeType::names.getOrDefault
(
"outsideVolumeType",
dict_,
volumeType::UNKNOWN
);
}
return true;
@ -2669,7 +2668,7 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
// Optionally override settings from provided dictionary
{
// Wanted distribution type
distType_ = distributionTypeNames_.lookupOrDefault
distributionTypeNames_.readIfPresent
(
"distributionType",
dict_,
@ -2686,7 +2685,7 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
surfaceClosed_ = closed;
}
outsideVolType_ = volumeType::names.lookupOrDefault
outsideVolType_ = volumeType::names.getOrDefault
(
"outsideVolumeType",
dict_,

View File

@ -117,7 +117,7 @@ Foam::waveMakerPointPatchVectorField::waveMakerPointPatchVectorField
)
:
fixedValuePointPatchField<vector>(p, iF, dict, false),
motionType_(motionTypeNames.lookup("motionType", dict)),
motionType_(motionTypeNames.get("motionType", dict)),
n_(dict.get<vector>("n")),
gHat_(Zero),
initialDepth_(dict.get<scalar>("initialDepth")),