From 7d88075842a79467592b086105f58150979862e9 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 5 Oct 2018 09:56:17 +0200 Subject: [PATCH 01/12] ENH: dictionary lookup with detection of zero tokens (#1033) - the opposite problem from issue #762. Now we also test if the input token stream had any tokens at all. - called by the dictionary get<> and readEntry() methods. --- .../test/dictionary2/Test-dictionary2.C | 82 +++++++++++++++- src/OpenFOAM/db/dictionary/dictionary.C | 94 ++++++++++++------- src/OpenFOAM/db/dictionary/dictionary.H | 6 +- .../db/dictionary/dictionaryTemplates.C | 10 +- src/OpenFOAM/global/argList/argList.C | 32 +++++-- src/OpenFOAM/global/argList/argList.H | 12 ++- src/OpenFOAM/global/argList/argListI.H | 10 +- 7 files changed, 185 insertions(+), 61 deletions(-) diff --git a/applications/test/dictionary2/Test-dictionary2.C b/applications/test/dictionary2/Test-dictionary2.C index 36460568e6..fc883a9cf5 100644 --- a/applications/test/dictionary2/Test-dictionary2.C +++ b/applications/test/dictionary2/Test-dictionary2.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,8 +25,7 @@ Application Test-dictionary2 Description - - Test dictionary insertion + Test dictionary insertion and some reading functionality. \*---------------------------------------------------------------------------*/ @@ -208,6 +207,83 @@ int main(int argc, char *argv[]) Info<< nl << "dictionary" << nl << nl; dict1.write(Info, false); + + { + Info<< nl << "Test reading good/bad/empty scalar entries" << nl; + dictionary dict2 + ( + IStringStream + ( + "good 3.14159;\n" + "empty;\n" + // "bad text;\n" // always fails + // "bad 3.14159 1234;\n" // fails for readScalar + )() + ); + dict2.write(Info); + + + // With readScalar + { + Info<< nl << "Test some bad input with readScalar()" << nl; + + const bool throwingIOError = FatalIOError.throwExceptions(); + const bool throwingError = FatalError.throwExceptions(); + + try + { + scalar val1 = readScalar(dict2.lookup("good")); + // scalar val2 = readScalar(dict2.lookup("bad")); + scalar val2 = -1; + scalar val3 = readScalar(dict2.lookup("empty")); + + Info<< "got good=" << val1 << " bad=" << val2 + << " empty=" << val3 << nl; + } + catch (Foam::IOerror& err) + { + Info<< "Caught FatalIOError " << err << nl << endl; + } + catch (Foam::error& err) + { + Info<< "Caught FatalError " << err << nl << endl; + } + FatalError.throwExceptions(throwingError); + FatalIOError.throwExceptions(throwingIOError); + } + + + // With get + { + Info<< nl << "Test some bad input with get()" << nl; + + const bool throwingIOError = FatalIOError.throwExceptions(); + const bool throwingError = FatalError.throwExceptions(); + + try + { + scalar val1 = dict2.get("good"); + // scalar val2 = dict2.get("bad"); + scalar val2 = -1; + scalar val3 = dict2.get("empty"); + + Info<< "got good=" << val1 << " bad=" << val2 + << " empty=" << val3 << nl; + } + catch (Foam::IOerror& err) + { + Info<< "Caught FatalIOError " << err << nl << endl; + } + catch (Foam::error& err) + { + Info<< "Caught FatalError " << err << nl << endl; + } + FatalError.throwExceptions(throwingError); + FatalIOError.throwExceptions(throwingIOError); + } + } + + Info<< "\nDone\n" << endl; return 0; diff --git a/src/OpenFOAM/db/dictionary/dictionary.C b/src/OpenFOAM/db/dictionary/dictionary.C index 580744d06c..125c73e127 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.C +++ b/src/OpenFOAM/db/dictionary/dictionary.C @@ -48,24 +48,59 @@ bool Foam::dictionary::writeOptionalEntries // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void Foam::dictionary::excessTokens +void Foam::dictionary::checkITstream ( const word& keyword, const ITstream& is ) const { - const label nExcess = is.nRemainingTokens(); - - if (!nExcess) + if (is.nRemainingTokens()) { - return; + const label remaining = is.nRemainingTokens(); + + // Similar to SafeFatalIOError + if (JobInfo::constructed) + { + OSstream& err = + FatalIOError + ( + "", // functionName + "", // sourceFileName + 0, // sourceFileLineNumber + this->name(), // ioFileName + is.lineNumber() // ioStartLineNumber + ); + + err << "'" << keyword << "' has " + << remaining << " excess tokens in stream" << nl << nl + << " "; + is.writeList(err, 0); + + err << exit(FatalIOError); + } + else + { + std::cerr + << nl + << "--> FOAM FATAL IO ERROR:" << nl; + + std::cerr + << "'" << keyword << "' has " + << remaining << " excess tokens in stream" << nl << nl; + + std::cerr + << "file: " << this->name() + << " at line " << is.lineNumber() << '.' << nl + << std::endl; + + ::exit(1); + } } - - // Similar to SafeFatalIOError - - if (JobInfo::constructed) + else if (!is.size()) { - OSstream& err = + // Similar to SafeFatalIOError + if (JobInfo::constructed) + { FatalIOError ( "", // functionName @@ -73,31 +108,24 @@ void Foam::dictionary::excessTokens 0, // sourceFileLineNumber this->name(), // ioFileName is.lineNumber() // ioStartLineNumber - ); + ) + << "'" << keyword << "' had no tokens in stream" << nl << nl + << exit(FatalIOError); + } + else + { + std::cerr + << nl + << "--> FOAM FATAL IO ERROR:" << nl + << "'" << keyword << "' had no tokens in stream" << nl << nl; - err << "'" << keyword << "' has " - << nExcess << " excess tokens in stream" << nl << nl - << " "; - is.writeList(err, 0); + std::cerr + << "file: " << this->name() + << " at line " << is.lineNumber() << '.' << nl + << std::endl; - err << exit(FatalIOError); - } - else - { - std::cerr - << nl - << "--> FOAM FATAL IO ERROR:" << nl; - - std::cerr - << "'" << keyword << "' has " - << nExcess << " excess tokens in stream" << nl << nl; - - std::cerr - << "file: " << this->name() - << " at line " << is.lineNumber() << '.' << nl - << std::endl; - - ::exit(1); + ::exit(1); + } } } diff --git a/src/OpenFOAM/db/dictionary/dictionary.H b/src/OpenFOAM/db/dictionary/dictionary.H index 384efa081b..dafb0b5179 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.H +++ b/src/OpenFOAM/db/dictionary/dictionary.H @@ -383,8 +383,10 @@ private: ) const; - //- Emit FatalIOError if excess tokens exist - void excessTokens(const word& keyword, const ITstream& is) const; + //- Check after reading if the input token stream has unconsumed + //- tokens remaining or if there were no tokens in the first place. + // Emits FatalIOError + void checkITstream(const word& keyword, const ITstream& is) const; public: diff --git a/src/OpenFOAM/db/dictionary/dictionaryTemplates.C b/src/OpenFOAM/db/dictionary/dictionaryTemplates.C index 95cd8ab8a7..fab47e6488 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryTemplates.C +++ b/src/OpenFOAM/db/dictionary/dictionaryTemplates.C @@ -97,7 +97,7 @@ bool Foam::dictionary::readCompat ITstream& is = finder.ptr()->stream(); is >> val; - excessTokens(keyword, is); + checkITstream(keyword, is); return true; } @@ -144,7 +144,7 @@ T Foam::dictionary::lookupOrDefault ITstream& is = finder.ptr()->stream(); is >> val; - excessTokens(keyword, is); + checkITstream(keyword, is); return val; } @@ -178,7 +178,7 @@ T Foam::dictionary::lookupOrAddDefault ITstream& is = finder.ptr()->stream(); is >> val; - excessTokens(keyword, is); + checkITstream(keyword, is); return val; } @@ -212,7 +212,7 @@ bool Foam::dictionary::readEntry ITstream& is = finder.ptr()->stream(); is >> val; - excessTokens(keyword, is); + checkITstream(keyword, is); return true; } @@ -262,7 +262,7 @@ T Foam::dictionary::lookupOrDefaultCompat ITstream& is = finder.ptr()->stream(); is >> val; - excessTokens(keyword, is); + checkITstream(keyword, is); return val; } diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index bb03845536..84a6736bd6 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -202,32 +202,46 @@ static void printBuildInfo(const bool full=true) // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // -void Foam::argList::warnTrailing(const ITstream& is, const label index) +void Foam::argList::checkITstream(const ITstream& is, const label index) { - const label nExcess = is.nRemainingTokens(); + const label remaining = is.nRemainingTokens(); - if (nExcess) + if (remaining) { std::cerr << nl << "--> FOAM WARNING:" << nl << "argument " << index << " has " - << nExcess << " excess tokens" << nl << nl; + << remaining << " excess tokens" << nl << nl; + } + else if (!is.size()) + { + std::cerr + << nl + << "--> FOAM WARNING:" << nl + << "argument " << index << " had no tokens" << nl << nl; } } -void Foam::argList::warnTrailing(const ITstream& is, const word& optName) +void Foam::argList::checkITstream(const ITstream& is, const word& optName) { - const label nExcess = is.nRemainingTokens(); + const label remaining = is.nRemainingTokens(); - if (nExcess) + if (remaining) { std::cerr << nl << "--> FOAM WARNING:" << nl << "option -" << optName << " has " - << nExcess << " excess tokens" << nl << nl; + << remaining << " excess tokens" << nl << nl; + } + else if (!is.size()) + { + std::cerr + << nl + << "--> FOAM WARNING:" << nl + << "option -" << optName << " had no tokens" << nl << nl; } } @@ -1141,7 +1155,7 @@ void Foam::argList::parse source = "-hostRoots"; ITstream is = this->lookup("hostRoots"); List> hostRoots(is); - warnTrailing(is, "hostRoots"); + checkITstream(is, "hostRoots"); for (const auto& hostRoot : hostRoots) { diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H index ba1baa8f3a..3bcc32ea1e 100644 --- a/src/OpenFOAM/global/argList/argList.H +++ b/src/OpenFOAM/global/argList/argList.H @@ -161,11 +161,15 @@ class argList const string& str ); - //- Warn if there are input tokens remaining on the stream - static void warnTrailing(const ITstream& is, const label index); + //- Check after reading if the input token stream has unconsumed + //- tokens remaining or if there were no tokens in the first place. + // Emits Warning + static void checkITstream(const ITstream& is, const label index); - //- Warn if there are input tokens remaining on the stream - static void warnTrailing(const ITstream& is, const word& optName); + //- Check after reading if the input token stream has unconsumed + //- tokens remaining or if there were no tokens in the first place. + // Emits Warning + static void checkITstream(const ITstream& is, const word& optName); //- Read a List of values from ITstream, //- treating a single entry like a list of size 1. diff --git a/src/OpenFOAM/global/argList/argListI.H b/src/OpenFOAM/global/argList/argListI.H index 8457a4cf82..c473becff1 100644 --- a/src/OpenFOAM/global/argList/argListI.H +++ b/src/OpenFOAM/global/argList/argListI.H @@ -230,7 +230,7 @@ inline T Foam::argList::get(const label index) const T val; is >> val; - warnTrailing(is, index); + checkITstream(is, index); return val; } @@ -244,7 +244,7 @@ inline T Foam::argList::opt(const word& optName) const T val; is >> val; - warnTrailing(is, optName); + checkITstream(is, optName); return val; } @@ -309,7 +309,7 @@ inline Foam::List Foam::argList::getList(const label index) const List list; readList(is, list); - warnTrailing(is, index); + checkITstream(is, index); return list; } @@ -323,7 +323,7 @@ inline Foam::List Foam::argList::getList(const word& optName) const List list; readList(is, list); - warnTrailing(is, optName); + checkITstream(is, optName); return list; } @@ -341,7 +341,7 @@ inline bool Foam::argList::readListIfPresent ITstream is(optName, options_[optName]); readList(is, list); - warnTrailing(is, optName); + checkITstream(is, optName); return true; } From 13778f76477b76991d01d5c2bf3aae2cf9ef35fd Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 5 Oct 2018 10:15:13 +0200 Subject: [PATCH 02/12] ENH: use dictionary::readEntry for detection of input errors (#762, #1033) - instead of dict.lookup(name) >> val; can use dict.readEntry(name, val); for checking of input token sizes. This helps catch certain types of input errors: { key1 ; // <- Missing value key2 1234 // <- Missing ';' terminator key3 val; } STYLE: readIfPresent() instead of 'if found ...' in a few more places. --- .../XiGModels/basicXiSubG/basicXiSubG.C | 2 +- .../XiModels/XiEqModels/Gulder/Gulder.C | 6 ++-- .../XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C | 10 +++--- .../instabilityXiEq/instabilityXiEq.C | 2 +- .../PDRFoam/XiModels/XiGModels/KTS/KTS.C | 2 +- .../XiGModels/instabilityG/instabilityG.C | 4 +-- .../PDRFoam/XiModels/algebraic/algebraic.C | 2 +- .../PDRFoam/XiModels/transport/transport.C | 2 +- .../VoFSolidificationMeltingSourceIO.C | 2 +- ...incompressibleTwoPhaseInteractingMixture.C | 4 +-- .../BinghamPlastic/BinghamPlastic.C | 6 ++-- .../mixtureViscosityModels/plastic/plastic.C | 6 ++-- .../multiphaseSystem/multiphaseSystem.C | 2 +- .../constant/constant.C | 4 +-- .../thermoIncompressibleTwoPhaseMixture.C | 16 +++++----- .../twoPhaseMixtureEThermo.C | 10 +++--- .../incompressibleThreePhaseMixture.C | 6 ++-- .../phaseChangeTwoPhaseMixtures/Kunz/Kunz.C | 8 ++--- .../Merkle/Merkle.C | 8 ++--- .../SchnerrSauer/SchnerrSauer.C | 8 ++--- .../phaseChangeTwoPhaseMixture.C | 8 ++--- .../multiphaseSystem/multiphaseSystem.C | 12 +++---- .../multiphaseSystem/phaseModel/phaseModel.C | 8 ++--- .../multiphaseMixture/multiphaseMixture.C | 8 ++--- .../multiphaseMixture/phase/phase.C | 2 +- .../constantDiameter/constantDiameter.C | 2 +- .../isothermalDiameter/isothermalDiameter.C | 4 +-- .../kineticTheoryModel/kineticTheoryModel.C | 2 +- .../phasePressureModel/phasePressureModel.C | 6 ++-- .../twoPhaseSystem/diameterModels/IATE/IATE.C | 4 +-- .../kineticTheoryModel/kineticTheoryModel.C | 2 +- .../phasePressureModel/phasePressureModel.C | 6 ++-- .../twoPhaseSystem/diameterModels/IATE/IATE.C | 4 +-- .../constantDiameter/constantDiameter.C | 2 +- .../isothermalDiameter/isothermalDiameter.C | 4 +-- .../extrude/extrudeMesh/extrudeMesh.C | 4 +-- .../extrudeToRegionMesh/extrudeToRegionMesh.C | 4 +-- .../surfaceOffsetLinearDistance.C | 12 +++---- .../manipulation/renumberMesh/renumberMesh.C | 2 +- .../helpTypes/helpSolver/helpSolver.C | 2 +- .../foamHelp/helpTypes/helpType/helpType.C | 2 +- .../foamToEnsightParts/getTimeIndex.H | 2 +- .../postProcessing/postProcess/postProcess.C | 4 +-- .../createZeroDirectory/caseInfo.C | 6 ++-- .../createZeroDirectory/solverTemplate.C | 2 +- .../preProcessing/mapFields/mapFields.C | 4 +-- .../preProcessing/mapFieldsPar/mapFieldsPar.C | 4 +-- .../extractionMethod/extractFromFile.C | 2 +- .../extractionMethod/extractFromSurface.C | 2 +- .../functionObject/FUNCTIONOBJECT.C | 9 +++--- .../GeometricField/GeometricField.C | 10 +++--- .../UniformDimensionedField.C | 2 +- .../interpolationLookUpTable.C | 6 ++-- .../uniformInterpolationTable.C | 8 ++--- .../matrices/LduMatrix/LduMatrix/LduMatrixI.H | 5 +-- .../lduMatrix/lduMatrixPreconditioner.C | 4 +-- .../lduMatrix/lduMatrix/lduMatrixSmoother.C | 4 +-- .../meshes/meshShapes/cellModel/cellModelIO.C | 8 ++--- .../constraint/cyclic/cyclicPolyPatch.C | 6 ++-- .../constraint/oldCyclic/oldCyclicPolyPatch.C | 6 ++-- .../demandDrivenEntry/demandDrivenEntryI.H | 2 +- .../functions/Function1/TableFile/TableFile.C | 2 +- ...allHeatFluxTemperatureFvPatchScalarField.C | 7 ++-- ...tureCoupledBaffleMixedFvPatchScalarField.C | 5 ++- ...eratureRadCoupledMixedFvPatchScalarField.C | 5 ++- .../turbulenceModels/LES/LESModel/LESModel.C | 2 +- .../LES/LESdeltas/smoothDelta/smoothDelta.C | 2 +- .../anisotropicFilter/anisotropicFilter.C | 2 +- .../LESfilters/laplaceFilter/laplaceFilter.C | 2 +- .../turbulenceModels/RAS/RASModel/RASModel.C | 2 +- src/combustionModels/FSD/FSD.C | 4 +-- .../consumptionSpeed/consumptionSpeed.C | 8 ++--- .../reactionRateFlameArea.C | 2 +- .../relaxation/relaxation.C | 4 +-- src/combustionModels/PaSR/PaSR.C | 2 +- .../combustionModel/combustionModel.C | 8 ++--- .../combustionModelTemplates.C | 2 +- src/combustionModels/diffusion/diffusion.C | 2 +- .../eddyDissipationDiffusionModel.C | 2 +- .../eddyDissipationModelBase.C | 2 +- .../infinitelyFastChemistry.C | 2 +- src/combustionModels/laminar/laminar.C | 10 ++---- .../extrudePatchMesh/extrudePatchMesh.C | 8 ++--- .../solidBodyMotionFunctions/SDA/SDA.C | 22 ++++++------- .../axisRotationMotion/axisRotationMotion.C | 4 +-- .../linearMotion/linearMotion.C | 2 +- .../oscillatingLinearMotion.C | 4 +-- .../oscillatingRotatingMotion.C | 6 ++-- .../tabulated6DoFMotion/tabulated6DoFMotion.C | 2 +- .../inletOutlet/inletOutletFaPatchField.C | 5 +-- .../cfdTools/general/MRF/MRFZone.C | 4 +-- .../general/coupling/externalFileCoupler.C | 2 +- .../porosityModel/fixedCoeff/fixedCoeff.C | 6 ++-- .../porosityModel/porosityModel.C | 2 +- ...ureForceBaffleVelocityFvPatchVectorField.C | 5 +-- .../derived/advective/advectiveFvPatchField.C | 2 +- .../derived/fan/fanFvPatchField.C | 4 +-- .../fanPressureFvPatchScalarField.C | 4 +-- .../plenumPressureFvPatchScalarField.C | 6 +--- .../fieldSelection/fieldSelection.C | 2 +- .../functionObjects/volRegion/volRegion.C | 2 +- .../distributionModels/binned/binned.C | 2 +- .../cloudSolution/cloudSolution.C | 8 ++--- .../Templates/ThermoCloud/ThermoCloud.C | 2 +- .../ParticleCollector/ParticleCollector.C | 2 +- .../ConeNozzleInjection/ConeNozzleInjection.C | 2 +- .../InjectionModel/InjectionModel.C | 4 +-- .../LocalInteraction/patchInteractionData.C | 2 +- .../SingleMixtureFraction.C | 6 ++-- .../ThermoSurfaceFilm/ThermoSurfaceFilm.C | 8 ++--- .../derived/doubleSigmoid/doubleSigmoid.C | 8 ++--- .../derived/sigmoid/sigmoid.C | 4 +-- .../pairPotential/derived/azizChen/azizChen.C | 18 +++++------ .../derived/dampedCoulomb/dampedCoulomb.C | 2 +- .../exponentialRepulsion.C | 4 +-- .../derived/lennardJones/lennardJones.C | 4 +-- .../derived/maitlandSmith/maitlandSmith.C | 8 ++--- .../potential/potential/potential.C | 8 ++--- .../derived/harmonicSpring/harmonicSpring.C | 2 +- .../derived/pitchForkRing/pitchForkRing.C | 6 ++-- .../restrainedHarmonicSpring.C | 4 +-- .../BreakupModel/BreakupModel/BreakupModel.C | 4 +-- .../spray/submodels/BreakupModel/ETAB/ETAB.C | 6 ++-- .../BreakupModel/PilchErdman/PilchErdman.C | 4 +-- .../BreakupModel/ReitzDiwakar/ReitzDiwakar.C | 8 ++--- .../BreakupModel/ReitzKHRT/ReitzKHRT.C | 12 +++---- .../refinementSurfaces/surfaceZonesInfo.C | 2 +- .../shellSurfaces/shellSurfaces.C | 4 +-- .../cyclicAMIPolyPatch/cyclicAMIPolyPatch.C | 6 ++-- .../coordinateRotation/axesRotation.C | 4 +-- .../coordinateRotation/cylindrical.C | 2 +- .../coordinateSystems/coordinateSystem.C | 4 +-- .../mappedPolyPatch/mappedPatchBase.C | 7 ++-- .../geomDecomp/geomDecomp.C | 2 +- .../reactingOneDim/reactingOneDim.C | 8 ++--- .../pyrolysisModels/thermo/thermo.C | 4 +-- .../kinematicSingleLayer.C | 6 ++-- .../constantFilmThermo/constantFilmThermo.C | 20 ++++++------ .../liquidFilmThermo/liquidFilmThermo.C | 6 ++-- .../surfaceFilmModel/surfaceFilmModelNew.C | 2 +- .../thermoSingleLayer/thermoSingleLayer.C | 4 +-- .../thermalBaffle/thermalBaffle.C | 4 +-- .../linearAxialAngularSpring.C | 4 +-- .../restraints/linearDamper/linearDamper.C | 2 +- .../restraints/linearSpring/linearSpring.C | 10 +++--- .../sphericalAngularDamper.C | 2 +- .../rigidBodyMotion/rigidBodyMotion.C | 4 +-- .../rigidBodyMeshMotion/rigidBodyMeshMotion.C | 2 +- .../sixDoFRigidBodyMotionAxisConstraint.C | 2 +- .../sixDoFRigidBodyMotionLineConstraint.C | 2 +- .../sixDoFRigidBodyMotionPlaneConstraint.C | 2 +- .../linearAxialAngularSpring.C | 4 +-- .../restraints/linearDamper/linearDamper.C | 2 +- .../restraints/linearSpring/linearSpring.C | 10 +++--- .../sphericalAngularDamper.C | 2 +- .../sphericalAngularSpring.C | 4 +-- .../tabulatedAxialAngularSpring.C | 2 +- .../sixDoFRigidBodyMotionIO.C | 4 +-- .../sixDoFRigidBodyMotionSolver.C | 4 +-- .../Chung/Chung.C | 8 ++--- .../Wallis/Wallis.C | 8 ++--- .../linear/linear.C | 4 +-- .../reduction/DRGEP/DRGEP.C | 5 +-- .../TDACChemistryModel/reduction/EFA/EFA.C | 6 ++-- .../fvDOM/absorptionCoeffs/absorptionCoeffs.C | 12 +++---- .../radiationModels/fvDOM/fvDOM/fvDOM.C | 5 +-- .../radiationModel/radiationModel.C | 8 ++--- .../radiationModel/radiationModelNew.C | 2 +- .../radiationModels/solarLoad/solarLoad.C | 4 +-- .../radiationModels/viewFactor/viewFactor.C | 5 +-- .../greyMeanSolidAbsorptionEmission.C | 4 +-- .../multiBandSolidAbsorptionEmission.C | 4 +-- .../wideBandAbsorptionEmission.C | 4 +-- .../solarCalculator/solarCalculator.C | 32 ++++++++----------- .../sootModel/sootModel/sootModelNew.C | 4 +-- .../multiBandSolidTransmissivity.C | 2 +- .../chemkinReader/chemkinReader.C | 16 ++++------ .../thirdBodyEfficienciesI.H | 6 ++-- 178 files changed, 420 insertions(+), 479 deletions(-) diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C b/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C index 26104e40ab..04d3b6a5a4 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C @@ -104,7 +104,7 @@ bool Foam::XiGModels::basicSubGrid::read(const dictionary& XiGProperties) { XiGModel::read(XiGProperties); - XiGModelCoeffs_.lookup("k1") >> k1; + XiGModelCoeffs_.readEntry("k1", k1); return true; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.C index c2b863087c..acbe023e0c 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.C @@ -96,9 +96,9 @@ bool Foam::XiEqModels::Gulder::read(const dictionary& XiEqProperties) { XiEqModel::read(XiEqProperties); - XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef_; - XiEqModelCoeffs_.lookup("uPrimeCoef") >> uPrimeCoef_; - XiEqModelCoeffs_.lookup("subGridSchelkin") >> subGridSchelkin_; + XiEqModelCoeffs_.readEntry("XiEqCoef", XiEqCoef_); + XiEqModelCoeffs_.readEntry("uPrimeCoef", uPrimeCoef_); + XiEqModelCoeffs_.readEntry("subGridSchelkin", subGridSchelkin_); return true; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C index c7b55925ca..59758b889e 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C @@ -147,11 +147,11 @@ bool Foam::XiEqModels::SCOPEXiEq::read(const dictionary& XiEqProperties) { XiEqModel::read(XiEqProperties); - XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef_; - XiEqModelCoeffs_.lookup("XiEqExp") >> XiEqExp_; - XiEqModelCoeffs_.lookup("lCoef") >> lCoef_; - XiEqModelCoeffs_.lookup("uPrimeCoef") >> uPrimeCoef_; - XiEqModelCoeffs_.lookup("subGridSchelkin") >> subGridSchelkin_; + XiEqModelCoeffs_.readEntry("XiEqCoef", XiEqCoef_); + XiEqModelCoeffs_.readEntry("XiEqExp", XiEqExp_); + XiEqModelCoeffs_.readEntry("lCoef", lCoef_); + XiEqModelCoeffs_.readEntry("uPrimeCoef", uPrimeCoef_); + XiEqModelCoeffs_.readEntry("subGridSchelkin", subGridSchelkin_); return true; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C index 9894fb166e..39651e983c 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C @@ -73,7 +73,7 @@ bool Foam::XiEqModels::instability::read(const dictionary& XiEqProperties) { XiEqModel::read(XiEqProperties); - XiEqModelCoeffs_.lookup("XiEqIn") >> XiEqIn; + XiEqModelCoeffs_.readEntry("XiEqIn", XiEqIn); return XiEqModel_->read(XiEqModelCoeffs_); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.C index aaddecc9d9..5750278f32 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.C @@ -76,7 +76,7 @@ bool Foam::XiGModels::KTS::read(const dictionary& XiGProperties) { XiGModel::read(XiGProperties); - XiGModelCoeffs_.lookup("GEtaCoef") >> GEtaCoef_; + XiGModelCoeffs_.readEntry("GEtaCoef", GEtaCoef_); return true; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C index eb3aeffeaf..a516bf0e46 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C @@ -86,8 +86,8 @@ bool Foam::XiGModels::instabilityG::read(const dictionary& XiGProperties) { XiGModel::read(XiGProperties); - XiGModelCoeffs_.lookup("GIn") >> GIn_; - XiGModelCoeffs_.lookup("lambdaIn") >> lambdaIn_; + XiGModelCoeffs_.readEntry("GIn", GIn_); + XiGModelCoeffs_.readEntry("lambdaIn", lambdaIn_); return true; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C b/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C index d744272d69..7908a578b5 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C @@ -89,7 +89,7 @@ bool Foam::XiModels::algebraic::read(const dictionary& XiProperties) { XiModel::read(XiProperties); - XiModelCoeffs_.lookup("XiShapeCoef") >> XiShapeCoef; + XiModelCoeffs_.readEntry("XiShapeCoef", XiShapeCoef); return true; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.C b/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.C index a3eabb0721..b23c057a6a 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.C @@ -136,7 +136,7 @@ bool Foam::XiModels::transport::read(const dictionary& XiProperties) { XiModel::read(XiProperties); - XiModelCoeffs_.lookup("XiShapeCoef") >> XiShapeCoef; + XiModelCoeffs_.readEntry("XiShapeCoef", XiShapeCoef); return true; } diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSourceIO.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSourceIO.C index 43e5df3da0..775fd10c3f 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSourceIO.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSourceIO.C @@ -32,7 +32,7 @@ bool Foam::fv::VoFSolidificationMeltingSource::read(const dictionary& dict) if (cellSetOption::read(dict)) { alphaSolidT_ = Function1::New("alphaSolidT", coeffs_); - coeffs_.lookup("L") >> L_; + coeffs_.readEntry("L", L_); coeffs_.readIfPresent("relax", relax_); coeffs_.readIfPresent("Cu", Cu_); coeffs_.readIfPresent("q", q_); diff --git a/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.C b/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.C index 5058b55eaf..6bf159f2ff 100644 --- a/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.C +++ b/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.C @@ -122,8 +122,8 @@ bool Foam::incompressibleTwoPhaseInteractingMixture::read() && nucModel_().read(subDict(phase2Name_)) ) { - muModel_->viscosityProperties().lookup("rho") >> rhod_; - nucModel_->viscosityProperties().lookup("rho") >> rhoc_; + muModel_->viscosityProperties().readEntry("rho", rhod_); + nucModel_->viscosityProperties().readEntry("rho", rhoc_); dd_ = dimensionedScalar ( diff --git a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/BinghamPlastic/BinghamPlastic.C b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/BinghamPlastic/BinghamPlastic.C index 2711e79d9d..45100db021 100644 --- a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/BinghamPlastic/BinghamPlastic.C +++ b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/BinghamPlastic/BinghamPlastic.C @@ -128,9 +128,9 @@ bool Foam::mixtureViscosityModels::BinghamPlastic::read { plastic::read(viscosityProperties); - plasticCoeffs_.lookup("yieldStressCoeff") >> yieldStressCoeff_; - plasticCoeffs_.lookup("yieldStressExponent") >> yieldStressExponent_; - plasticCoeffs_.lookup("yieldStressOffset") >> yieldStressOffset_; + plasticCoeffs_.readEntry("yieldStressCoeff", yieldStressCoeff_); + plasticCoeffs_.readEntry("yieldStressExponent", yieldStressExponent_); + plasticCoeffs_.readEntry("yieldStressOffset", yieldStressOffset_); return true; } diff --git a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/plastic/plastic.C b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/plastic/plastic.C index c096513474..a11032ff13 100644 --- a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/plastic/plastic.C +++ b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/plastic/plastic.C @@ -119,9 +119,9 @@ bool Foam::mixtureViscosityModels::plastic::read plasticCoeffs_ = viscosityProperties.optionalSubDict(typeName + "Coeffs"); - plasticCoeffs_.lookup("k") >> plasticViscosityCoeff_; - plasticCoeffs_.lookup("n") >> plasticViscosityExponent_; - plasticCoeffs_.lookup("muMax") >> muMax_; + plasticCoeffs_.readEntry("k", plasticViscosityCoeff_); + plasticCoeffs_.readEntry("n", plasticViscosityExponent_); + plasticCoeffs_.readEntry("muMax", muMax_); return true; } diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystem.C index 93de23a995..e7d8c06615 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystem.C @@ -271,7 +271,7 @@ void Foam::multiphaseSystem::solve() const dictionary& alphaControls = mesh.solverDict("alpha"); label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles"))); label nAlphaCorr(readLabel(alphaControls.lookup("nAlphaCorr"))); - mesh.solverDict("alpha").lookup("cAlphas") >> cAlphas_; + mesh.solverDict("alpha").readEntry("cAlphas", cAlphas_); // Reset ddtAlphaMax ddtAlphaMax_ = dimensionedScalar(dimless, Zero); diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C index 6a79460da6..f82f1f197c 100644 --- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C +++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C @@ -158,8 +158,8 @@ bool Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::read() { if (temperaturePhaseChangeTwoPhaseMixture::read()) { - subDict(type() + "Coeffs").lookup("coeffC") >> coeffC_; - subDict(type() + "Coeffs").lookup("coeffE") >> coeffE_; + subDict(type() + "Coeffs").readEntry("coeffC", coeffC_); + subDict(type() + "Coeffs").readEntry("coeffE", coeffE_); return true; } diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.C index 4be68f4c26..2cfcbdbe7c 100644 --- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.C @@ -109,17 +109,17 @@ bool Foam::thermoIncompressibleTwoPhaseMixture::read() { if (incompressibleTwoPhaseMixture::read()) { - subDict(phase1Name_).lookup("kappa") >> kappa1_; - subDict(phase2Name_).lookup("kappa") >> kappa2_; + subDict(phase1Name_).readEntry("kappa", kappa1_); + subDict(phase2Name_).readEntry("kappa", kappa2_); - subDict(phase1Name_).lookup("Cp") >> Cp1_; - subDict(phase2Name_).lookup("Cp") >> Cp2_; + subDict(phase1Name_).readEntry("Cp", Cp1_); + subDict(phase2Name_).readEntry("Cp", Cp2_); - subDict(phase1Name_).lookup("Cv") >> Cv1_; - subDict(phase2Name_).lookup("Cv") >> Cv2_; + subDict(phase1Name_).readEntry("Cv", Cv1_); + subDict(phase2Name_).readEntry("Cv", Cv2_); - subDict(phase1Name_).lookup("hf") >> Hf1_; - subDict(phase2Name_).lookup("hf") >> Hf2_; + subDict(phase1Name_).readEntry("hf", Hf1_); + subDict(phase2Name_).readEntry("hf", Hf2_); return true; } diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C index 3910f68bcd..8ef64f38c9 100644 --- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C +++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C @@ -581,14 +581,12 @@ bool Foam::twoPhaseMixtureEThermo::read() { if (basicThermo::read() && thermoIncompressibleTwoPhaseMixture::read()) { - basicThermo::lookup("pDivU") >> pDivU_; - basicThermo::lookup("TSat") >> TSat_; + basicThermo::readEntry("pDivU", pDivU_); + basicThermo::readEntry("TSat", TSat_); return true; } - else - { - return false; - } + + return false; } diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.C b/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.C index e68661b678..1d9e81636f 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.C +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.C @@ -231,9 +231,9 @@ bool Foam::incompressibleThreePhaseMixture::read() && nuModel3_().read(*this) ) { - nuModel1_->viscosityProperties().lookup("rho") >> rho1_; - nuModel2_->viscosityProperties().lookup("rho") >> rho2_; - nuModel3_->viscosityProperties().lookup("rho") >> rho3_; + nuModel1_->viscosityProperties().readEntry("rho", rho1_); + nuModel2_->viscosityProperties().readEntry("rho", rho2_); + nuModel3_->viscosityProperties().readEntry("rho", rho3_); return true; } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C index 0a172e764a..a39647a35c 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C @@ -104,10 +104,10 @@ bool Foam::phaseChangeTwoPhaseMixtures::Kunz::read() { phaseChangeTwoPhaseMixtureCoeffs_ = optionalSubDict(type() + "Coeffs"); - phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf") >> UInf_; - phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf") >> tInf_; - phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cc") >> Cc_; - phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cv") >> Cv_; + phaseChangeTwoPhaseMixtureCoeffs_.readEntry("UInf", UInf_); + phaseChangeTwoPhaseMixtureCoeffs_.readEntry("tInf", tInf_); + phaseChangeTwoPhaseMixtureCoeffs_.readEntry("Cc", Cc_); + phaseChangeTwoPhaseMixtureCoeffs_.readEntry("Cv", Cv_); mcCoeff_ = Cc_*rho2()/tInf_; mvCoeff_ = Cv_*rho2()/(0.5*rho1()*sqr(UInf_)*tInf_); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C index f682ed5725..09e977d988 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C @@ -99,10 +99,10 @@ bool Foam::phaseChangeTwoPhaseMixtures::Merkle::read() { phaseChangeTwoPhaseMixtureCoeffs_ = optionalSubDict(type() + "Coeffs"); - phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf") >> UInf_; - phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf") >> tInf_; - phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cc") >> Cc_; - phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cv") >> Cv_; + phaseChangeTwoPhaseMixtureCoeffs_.readEntry("UInf", UInf_); + phaseChangeTwoPhaseMixtureCoeffs_.readEntry("tInf", tInf_); + phaseChangeTwoPhaseMixtureCoeffs_.readEntry("Cc", Cc_); + phaseChangeTwoPhaseMixtureCoeffs_.readEntry("Cv", Cv_); mcCoeff_ = Cc_/(0.5*sqr(UInf_)*tInf_); mvCoeff_ = Cv_*rho1()/(0.5*sqr(UInf_)*tInf_*rho2()); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C index 7d02a651fe..17d218fdae 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C @@ -153,10 +153,10 @@ bool Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::read() { phaseChangeTwoPhaseMixtureCoeffs_ = optionalSubDict(type() + "Coeffs"); - phaseChangeTwoPhaseMixtureCoeffs_.lookup("n") >> n_; - phaseChangeTwoPhaseMixtureCoeffs_.lookup("dNuc") >> dNuc_; - phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cc") >> Cc_; - phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cv") >> Cv_; + phaseChangeTwoPhaseMixtureCoeffs_.readEntry("n", n_); + phaseChangeTwoPhaseMixtureCoeffs_.readEntry("dNuc", dNuc_); + phaseChangeTwoPhaseMixtureCoeffs_.readEntry("Cc", Cc_); + phaseChangeTwoPhaseMixtureCoeffs_.readEntry("Cv", Cv_); return true; } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C index c4fe701a2f..e8abc554f4 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C @@ -78,14 +78,12 @@ bool Foam::phaseChangeTwoPhaseMixture::read() if (incompressibleTwoPhaseMixture::read()) { phaseChangeTwoPhaseMixtureCoeffs_ = optionalSubDict(type() + "Coeffs"); - lookup("pSat") >> pSat_; + readEntry("pSat", pSat_); return true; } - else - { - return false; - } + + return false; } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index 2815e56690..e48594f970 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -944,16 +944,14 @@ bool Foam::multiphaseSystem::read() readOK &= iter().read(phaseData[phasei++].dict()); } - lookup("sigmas") >> sigmas_; - lookup("interfaceCompression") >> cAlphas_; - lookup("virtualMass") >> Cvms_; + readEntry("sigmas", sigmas_); + readEntry("interfaceCompression", cAlphas_); + readEntry("virtualMass", Cvms_); return readOK; } - else - { - return false; - } + + return false; } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C index 9b66605cf8..d50c2b34c3 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C @@ -222,10 +222,10 @@ bool Foam::phaseModel::read(const dictionary& phaseDict) //if (nuModel_->read(phaseDict_)) { - phaseDict_.lookup("nu") >> nu_.value(); - phaseDict_.lookup("kappa") >> kappa_.value(); - phaseDict_.lookup("Cp") >> Cp_.value(); - phaseDict_.lookup("rho") >> rho_.value(); + phaseDict_.readEntry("nu", nu_.value()); + phaseDict_.readEntry("kappa", kappa_.value()); + phaseDict_.readEntry("Cp", Cp_.value()); + phaseDict_.readEntry("rho", rho_.value()); return true; } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index 27f1e937d4..c6c366951d 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -701,14 +701,12 @@ bool Foam::multiphaseMixture::read() readOK &= iter().read(phaseData[phasei++].dict()); } - lookup("sigmas") >> sigmas_; + readEntry("sigmas", sigmas_); return readOK; } - else - { - return false; - } + + return false; } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C index e7a5603c9f..63b3e0779b 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C @@ -84,7 +84,7 @@ bool Foam::phase::read(const dictionary& phaseDict) if (nuModel_->read(phaseDict_)) { - phaseDict_.lookup("rho") >> rho_; + phaseDict_.readEntry("rho", rho_); return true; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.C index 5d8ec7464d..8e787e7765 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.C @@ -88,7 +88,7 @@ bool Foam::diameterModels::constant::read(const dictionary& phaseProperties) { diameterModel::read(phaseProperties); - diameterProperties_.lookup("d") >> d_; + diameterProperties_.readEntry("d", d_); return true; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.C index 921dbdba5b..845e8b0d25 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.C @@ -81,8 +81,8 @@ bool Foam::diameterModels::isothermal::read(const dictionary& phaseProperties) { diameterModel::read(phaseProperties); - diameterProperties_.lookup("d0") >> d0_; - diameterProperties_.lookup("p0") >> p0_; + diameterProperties_.readEntry("d0", d0_); + diameterProperties_.readEntry("p0", p0_); return true; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 5e09566569..71fdca8d88 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -212,7 +212,7 @@ bool Foam::RASModels::kineticTheoryModel::read() >::read() ) { - coeffDict().lookup("equilibrium") >> equilibrium_; + coeffDict().readEntry("equilibrium", equilibrium_); e_.readIfPresent(coeffDict()); alphaMax_.readIfPresent(coeffDict()); alphaMinFriction_.readIfPresent(coeffDict()); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index 9176b7a1c8..90549eda9c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -94,9 +94,9 @@ bool Foam::RASModels::phasePressureModel::read() >::read() ) { - coeffDict().lookup("alphaMax") >> alphaMax_; - coeffDict().lookup("preAlphaExp") >> preAlphaExp_; - coeffDict().lookup("expMax") >> expMax_; + coeffDict().readEntry("alphaMax", alphaMax_); + coeffDict().readEntry("preAlphaExp", preAlphaExp_); + coeffDict().readEntry("expMax", expMax_); g0_.readIfPresent(coeffDict()); return true; diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C index 9bae6c06e8..b2d0547f5c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C @@ -174,8 +174,8 @@ bool Foam::diameterModels::IATE::read(const dictionary& phaseProperties) { diameterModel::read(phaseProperties); - diameterProperties_.lookup("dMax") >> dMax_; - diameterProperties_.lookup("dMin") >> dMin_; + diameterProperties_.readEntry("dMax", dMax_); + diameterProperties_.readEntry("dMin", dMin_); // Re-create all the sources updating number, type and coefficients PtrList diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 5e09566569..71fdca8d88 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -212,7 +212,7 @@ bool Foam::RASModels::kineticTheoryModel::read() >::read() ) { - coeffDict().lookup("equilibrium") >> equilibrium_; + coeffDict().readEntry("equilibrium", equilibrium_); e_.readIfPresent(coeffDict()); alphaMax_.readIfPresent(coeffDict()); alphaMinFriction_.readIfPresent(coeffDict()); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index 4c272f8d57..b00f887c98 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -100,9 +100,9 @@ bool Foam::RASModels::phasePressureModel::read() >::read() ) { - coeffDict().lookup("alphaMax") >> alphaMax_; - coeffDict().lookup("preAlphaExp") >> preAlphaExp_; - coeffDict().lookup("expMax") >> expMax_; + coeffDict().readEntry("alphaMax", alphaMax_); + coeffDict().readEntry("preAlphaExp", preAlphaExp_); + coeffDict().readEntry("expMax", expMax_); g0_.readIfPresent(coeffDict()); return true; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C index afa96a571a..00f8188f78 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C @@ -184,8 +184,8 @@ bool Foam::diameterModels::IATE::read(const dictionary& phaseProperties) { diameterModel::read(phaseProperties); - diameterProperties_.lookup("dMax") >> dMax_; - diameterProperties_.lookup("dMin") >> dMin_; + diameterProperties_.readEntry("dMax", dMax_); + diameterProperties_.readEntry("dMin", dMin_); // Re-create all the sources updating number, type and coefficients PtrList diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/constantDiameter/constantDiameter.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/constantDiameter/constantDiameter.C index 1f6cf5c441..5868057dd5 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/constantDiameter/constantDiameter.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/constantDiameter/constantDiameter.C @@ -91,7 +91,7 @@ bool Foam::diameterModels::constant::read(const dictionary& phaseProperties) { diameterModel::read(phaseProperties); - diameterProperties_.lookup("d") >> d_; + diameterProperties_.readEntry("d", d_); return true; } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/isothermalDiameter/isothermalDiameter.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/isothermalDiameter/isothermalDiameter.C index 2754ce8d73..ec349b7f18 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/isothermalDiameter/isothermalDiameter.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/isothermalDiameter/isothermalDiameter.C @@ -81,8 +81,8 @@ bool Foam::diameterModels::isothermal::read(const dictionary& phaseProperties) { diameterModel::read(phaseProperties); - diameterProperties_.lookup("d0") >> d0_; - diameterProperties_.lookup("p0") >> p0_; + diameterProperties_.readEntry("d0", d0_); + diameterProperties_.readEntry("p0", p0_); return true; } diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C index ce99b04a4f..26b33a8605 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C @@ -362,7 +362,7 @@ int main(int argc, char *argv[]) /"processor" + Foam::name(Pstream::myProcNo()); } wordList sourcePatches; - dict.lookup("sourcePatches") >> sourcePatches; + dict.readEntry("sourcePatches", sourcePatches); if (sourcePatches.size() == 1) { @@ -581,7 +581,7 @@ int main(int argc, char *argv[]) labelList exposedPatchID; if (mode == PATCH) { - dict.lookup("exposedPatchName") >> backPatchName; + dict.readEntry("exposedPatchName", backPatchName); exposedPatchID.setSize ( extrudePatch.size(), diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C index c53ed69934..e5dc81bbdf 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -1514,7 +1514,7 @@ int main(int argc, char *argv[]) const bool hasZones = dict.found("faceZones"); if (hasZones) { - dict.lookup("faceZones") >> zoneNames; + dict.readEntry("faceZones", zoneNames); dict.readIfPresent("faceZonesShadow", zoneShadowNames); // Check @@ -1528,7 +1528,7 @@ int main(int argc, char *argv[]) } else { - dict.lookup("faceSets") >> zoneNames; + dict.readEntry("faceSets", zoneNames); dict.readIfPresent("faceSetsShadow", zoneShadowNames); } diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/surfaceOffsetLinearDistance/surfaceOffsetLinearDistance.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/surfaceOffsetLinearDistance/surfaceOffsetLinearDistance.C index 60892120ef..b186ae50b9 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/surfaceOffsetLinearDistance/surfaceOffsetLinearDistance.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/surfaceOffsetLinearDistance/surfaceOffsetLinearDistance.C @@ -71,10 +71,9 @@ Foam::surfaceOffsetLinearDistance::surfaceOffsetLinearDistance totalDistance_(), totalDistanceSqr_() { - if (coeffsDict().found("totalDistanceCoeff")) + if (coeffsDict().readIfPresent("totalDistanceCoeff", totalDistance_)) { - totalDistance_ = - coeffsDict().get("totalDistanceCoeff") * defaultCellSize; + totalDistance_ *= defaultCellSize; if (coeffsDict().found("linearDistanceCoeff")) { @@ -84,11 +83,10 @@ Foam::surfaceOffsetLinearDistance::surfaceOffsetLinearDistance << nl << exit(FatalError) << endl; } } - else if (coeffsDict().found("linearDistanceCoeff")) + else if (coeffsDict().readIfPresent("linearDistanceCoeff", totalDistance_)) { - totalDistance_ = - coeffsDict().get("linearDistanceCoeff") * defaultCellSize - + surfaceOffset_; + totalDistance_ *= defaultCellSize; + totalDistance_ += surfaceOffset_; } else { diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C index 6a9bac6bed..4e15db3fe6 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C +++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C @@ -749,7 +749,7 @@ int main(int argc, char *argv[]) << endl; } - renumberDict.lookup("writeMaps") >> writeMaps; + renumberDict.readEntry("writeMaps", writeMaps); if (writeMaps) { Info<< "Writing renumber maps (new to old) to polyMesh." << nl diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpSolver/helpSolver.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpSolver/helpSolver.C index 1da7406536..782580d5a2 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpSolver/helpSolver.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpSolver/helpSolver.C @@ -85,7 +85,7 @@ void Foam::helpTypes::helpSolver::execute } else if (args.found("read")) { - mesh.time().controlDict().lookup("application") >> solver; + mesh.time().controlDict().readEntry("application", solver); displayDoc(solver, ".*solvers/.*Foam/", true, "C"); } else diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpType.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpType.C index 93c628dafb..3b6d9130b8 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpType.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpType.C @@ -119,7 +119,7 @@ void Foam::helpType::displayDoc { const dictionary& docDict = debug::controlDict().subDict("Documentation"); - docDict.lookup("docBrowser") >> docBrowser; + docDict.readEntry("docBrowser", docBrowser); } doxygenXmlParser parser diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/getTimeIndex.H b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/getTimeIndex.H index 91c718994f..8ce3150b75 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/getTimeIndex.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/getTimeIndex.H @@ -29,7 +29,7 @@ io.readOpt() = IOobject::MUST_READ_IF_MODIFIED; IOdictionary timeObject(io); - timeObject.lookup("index") >> timeIndex; + timeObject.readEntry("index", timeIndex); } else { diff --git a/applications/utilities/postProcessing/postProcess/postProcess.C b/applications/utilities/postProcessing/postProcess/postProcess.C index 89deb92640..f0a2b99b64 100644 --- a/applications/utilities/postProcessing/postProcess/postProcess.C +++ b/applications/utilities/postProcessing/postProcess/postProcess.C @@ -157,11 +157,11 @@ int main(int argc, char *argv[]) functionObjects::fileFieldSelection fields(mesh); if (args.found("fields")) { - args.lookup("fields")() >> fields; + fields.insert(args.getList("fields")); } if (args.found("field")) { - fields.insert(args.lookup("field")()); + fields.insert(args.opt("field")); } // Externally stored dictionary for functionObjectList diff --git a/applications/utilities/preProcessing/createZeroDirectory/caseInfo.C b/applications/utilities/preProcessing/createZeroDirectory/caseInfo.C index efb0cce16b..65c2fea250 100644 --- a/applications/utilities/preProcessing/createZeroDirectory/caseInfo.C +++ b/applications/utilities/preProcessing/createZeroDirectory/caseInfo.C @@ -129,9 +129,9 @@ Foam::caseInfo::caseInfo(const Time& runTime, const word& regionName) forAll(conditionNames_, i) { const dictionary& dict = bcDict_.subDict(conditionNames_[i]); - dict.lookup("category") >> patchCategories_[i]; - dict.lookup("type") >> patchTypes_[i]; - dict.lookup("patches") >> patchNames_[i]; + dict.readEntry("category", patchCategories_[i]); + dict.readEntry("type", patchTypes_[i]); + dict.readEntry("patches", patchNames_[i]); } updateGeometricBoundaryField(); diff --git a/applications/utilities/preProcessing/createZeroDirectory/solverTemplate.C b/applications/utilities/preProcessing/createZeroDirectory/solverTemplate.C index 678c1e5b49..0c85961e7e 100644 --- a/applications/utilities/preProcessing/createZeroDirectory/solverTemplate.C +++ b/applications/utilities/preProcessing/createZeroDirectory/solverTemplate.C @@ -217,7 +217,7 @@ void Foam::solverTemplate::setRegionProperties const word& fieldName = fieldNames_[regionI][i]; const dictionary& dict = fieldDict.subDict(fieldName); - dict.lookup("type") >> fieldTypes_[regionI][i]; + dict.readEntry("type", fieldTypes_[regionI][i]); fieldDimensions_[regionI].set ( i, diff --git a/applications/utilities/preProcessing/mapFields/mapFields.C b/applications/utilities/preProcessing/mapFields/mapFields.C index 75afb798bc..d6fe357854 100644 --- a/applications/utilities/preProcessing/mapFields/mapFields.C +++ b/applications/utilities/preProcessing/mapFields/mapFields.C @@ -361,8 +361,8 @@ int main(int argc, char *argv[]) ) ); - mapFieldsDict.lookup("patchMap") >> patchMap; - mapFieldsDict.lookup("cuttingPatches") >> cuttingPatches; + mapFieldsDict.readEntry("patchMap", patchMap); + mapFieldsDict.readEntry("cuttingPatches", cuttingPatches); } if (parallelSource && !parallelTarget) diff --git a/applications/utilities/preProcessing/mapFieldsPar/mapFieldsPar.C b/applications/utilities/preProcessing/mapFieldsPar/mapFieldsPar.C index 0d30bacc78..09ba335ea6 100644 --- a/applications/utilities/preProcessing/mapFieldsPar/mapFieldsPar.C +++ b/applications/utilities/preProcessing/mapFieldsPar/mapFieldsPar.C @@ -313,8 +313,8 @@ int main(int argc, char *argv[]) ) ); - mapFieldsDict.lookup("patchMap") >> patchMap; - mapFieldsDict.lookup("cuttingPatches") >> cuttingPatches; + mapFieldsDict.readEntry("patchMap", patchMap); + mapFieldsDict.readEntry("cuttingPatches", cuttingPatches); } #include "setTimeIndex.H" diff --git a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromFile.C b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromFile.C index 7cb51d0ccf..1287e1fba7 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromFile.C +++ b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromFile.C @@ -56,7 +56,7 @@ Foam::surfaceFeaturesExtraction::extractFromFile::extractFromFile const dictionary& coeffDict = dict.optionalSubDict("extractFromFileCoeffs"); - coeffDict.lookup("featureEdgeFile") >> featureEdgeFile_; + coeffDict.readEntry("featureEdgeFile", featureEdgeFile_); coeffDict.readIfPresent("geometricTestOnly", geometricTestOnly_); } diff --git a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromSurface.C b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromSurface.C index 6635a95a3e..9be509f85f 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromSurface.C +++ b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromSurface.C @@ -55,7 +55,7 @@ Foam::surfaceFeaturesExtraction::extractFromSurface::extractFromSurface const dictionary& coeffDict = dict.optionalSubDict("extractFromSurfaceCoeffs"); - coeffDict.lookup("includedAngle") >> includedAngle_; + coeffDict.readEntry("includedAngle", includedAngle_); coeffDict.readIfPresent("geometricTestOnly", geometricTestOnly_); } diff --git a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C index a862aadf3b..3accc508ac 100644 --- a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C +++ b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C @@ -51,8 +51,8 @@ Foam::functionObjects::FUNCTIONOBJECT::FUNCTIONOBJECT : fvMeshFunctionObject(name, runTime, dict), wordData_(dict.lookupOrDefault("wordData", "defaultWord")), - scalarData_(readScalar(dict.lookup("scalarData"))), - labelData_(readLabel(dict.lookup("labelData"))) + scalarData_(dict.get("scalarData")), + labelData_(dict.get