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/incompressible/pimpleFoam/overPimpleDyMFoam/createFields.H b/applications/solvers/incompressible/pimpleFoam/overPimpleDyMFoam/createFields.H index 53ef26b0ca..f70ef1a472 100644 --- a/applications/solvers/incompressible/pimpleFoam/overPimpleDyMFoam/createFields.H +++ b/applications/solvers/incompressible/pimpleFoam/overPimpleDyMFoam/createFields.H @@ -52,7 +52,6 @@ mesh.setFluxRequired(p.name()); nonInt.insert("cellInterpolationWeight"); } - // Mask field for zeroing out contributions on hole cells #include "createCellMask.H" 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/test/decomposePar/Test-decomposePar.C b/applications/test/decomposePar/Test-decomposePar.C index 30445a26b7..26673bf6b1 100644 --- a/applications/test/decomposePar/Test-decomposePar.C +++ b/applications/test/decomposePar/Test-decomposePar.C @@ -121,41 +121,27 @@ int main(int argc, char *argv[]) fileName decompDictFile; args.readIfPresent("decomposeParDict", decompDictFile); + // Get all region names wordList regionNames; - wordList regionDirs; if (allRegions) { - Info<< "Decomposing all regions in regionProperties" << nl << endl; - regionProperties rp(runTime); - forAllConstIters(rp, iter) - { - const wordList& regions = iter(); - forAll(regions, i) - { - if (!regionNames.found(regions[i])) - { - regionNames.append(regions[i]); - } - } - } - regionDirs = regionNames; + regionNames = regionProperties(runTime).names(); + + Info<< "Decomposing all regions in regionProperties" << nl + << " " << flatOutput(regionNames) << nl << endl; } else { - regionNames.resize(1, fvMesh::defaultRegion); - regionDirs.resize(1, word::null); - - if (args.readIfPresent("region", regionNames.first())) - { - regionDirs.first() = regionNames.first(); - } + regionNames.resize(1); + regionNames.first() = + args.lookupOrDefault("region", fvMesh::defaultRegion); } - forAll(regionNames, regioni) { const word& regionName = regionNames[regioni]; - const word& regionDir = regionDirs[regioni]; + const word& regionDir = + (regionName == fvMesh::defaultRegion ? word::null : regionName); Info<< "\n\nDecomposing mesh " << regionName << nl << endl; Info<< "Create mesh..." << flush; 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/applications/test/fileName/Test-fileName.C b/applications/test/fileName/Test-fileName.C index 3ad28e5f77..8d97b9f1f5 100644 --- a/applications/test/fileName/Test-fileName.C +++ b/applications/test/fileName/Test-fileName.C @@ -621,12 +621,18 @@ int main(int argc, char *argv[]) << "pathName.name() = >" << pathName.name() << "<\n" << "pathName.path() = " << pathName.path() << nl << "pathName.ext() = >" << pathName.ext() << "<\n" - << "pathName.name(true) = >" << pathName.name(true) << "<\n"; + << "pathName.nameLessExt= >" << pathName.nameLessExt() << "<\n"; Info<< "pathName.components() = " << pathName.components() << nl << "pathName.component(2) = " << pathName.component(2) << nl << endl; + Info<< "hasPath = " << Switch(pathName.hasPath()) << nl; + pathName.removePath(); + Info<< "removed path = " << pathName << nl; + + Info<< nl << nl; + // try with different combination // The final one should emit warnings for (label start = 0; start <= wrdList.size(); ++start) diff --git a/applications/test/instant/Make/files b/applications/test/instant/Make/files new file mode 100644 index 0000000000..c7dd9f8146 --- /dev/null +++ b/applications/test/instant/Make/files @@ -0,0 +1,3 @@ +Test-instant.C + +EXE = $(FOAM_USER_APPBIN)/Test-instant diff --git a/applications/test/instant/Make/options b/applications/test/instant/Make/options new file mode 100644 index 0000000000..6a9e9810b3 --- /dev/null +++ b/applications/test/instant/Make/options @@ -0,0 +1,2 @@ +/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */ +/* EXE_LIBS = -lfiniteVolume */ diff --git a/applications/test/instant/Test-instant.C b/applications/test/instant/Test-instant.C new file mode 100644 index 0000000000..f0487c9857 --- /dev/null +++ b/applications/test/instant/Test-instant.C @@ -0,0 +1,82 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Description + Test instant, fileNameInstant + +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "instant.H" +#include "fileNameInstant.H" +#include "DynamicList.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + DynamicList times; + + times.append(instant{}); + times.append({12, "abc"}); + times.append(instant{3.14159}); + times.append({300.456, "def"}); + times.append({454.456, "xyz"}); + times.append({10, "ten"}); + + { + word timeName("twenty"); + + Info<<"move append: " << timeName << nl; + times.append({20, std::move(timeName)}); + Info<<"after append: " << timeName << nl; + } + + Info<< nl << "times:" << times << nl; + sort(times); + Info<< "Sorted:" << times << nl; + + + DynamicList files; + files.append(fileNameInstant{}); + files.append({12, "twelve"}); + files.append({3.14, "/path/almost-pi"}); + files.append({300, "/dev/value"}); + files.append({454, "/tmp/xyz"}); + files.append({10, "ten"}); + + Info<< nl << "files:" << files << nl; + sort(files); + Info<< "Sorted:" << files << nl; + + + Info<< "\nEnd\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/test/string/Test-string.C b/applications/test/string/Test-string.C index 81c126b8af..52d2b58ab2 100644 --- a/applications/test/string/Test-string.C +++ b/applications/test/string/Test-string.C @@ -36,6 +36,7 @@ Description #include "uint.H" #include "scalar.H" #include "Switch.H" +#include "fileName.H" #include "stringList.H" using namespace Foam; @@ -64,6 +65,34 @@ int main(int argc, char *argv[]) subDict.add("value2", "test2"); dict.add("FOAM_RUN", subDict); + if (false) + { + typedef std::string inputType; + typedef string outputType; + + inputType in1("move-construct-from"); + + Info<<"move construct from " << in1.length() << nl; + + outputType out1(std::move(in1)); + + Info<<"after move construct " + << out1.size() << ", " << in1.size() << nl; + + in1 = "move-assign-from"; + out1 = "some-text-rubbish"; + out1.resize(10); + + Info<<"move assign from " << in1.length() << nl; + + out1 = std::move(in1); + + Info<<"after move assign " + << out1.size() << ", " << in1.size() << nl; + + return 0; + } + // basic expansions { 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/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index f11942fba9..e061325c84 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -330,19 +330,14 @@ int main(int argc, char *argv[]) fileName decompDictFile; args.readIfPresent("decomposeParDict", decompDictFile); + // Get all region names wordList regionNames; if (allRegions) { - Info<< "Decomposing all regions in regionProperties" << nl << nl; - regionProperties rp(runTime); + regionNames = regionProperties(runTime).names(); - wordHashSet names; - forAllConstIters(rp, iter) - { - names.insert(iter.object()); - } - - regionNames = names.sortedToc(); + Info<< "Decomposing all regions in regionProperties" << nl + << " " << flatOutput(regionNames) << nl << endl; } else { diff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C index 7645b9c91f..37e179440d 100644 --- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C +++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C @@ -180,17 +180,11 @@ int main(int argc, char *argv[]) wordList regionDirs; if (allRegions) { - Info<< "Reconstructing all regions in regionProperties" << nl << endl; - regionProperties rp(runTime); - - wordHashSet names; - forAllConstIters(rp, iter) - { - names.insert(iter.object()); - } - - regionNames = names.sortedToc(); + regionNames = regionProperties(runTime).names(); regionDirs = regionNames; + + Info<< "Reconstructing all regions in regionProperties" << nl + << " " << flatOutput(regionNames) << nl << endl; } else { diff --git a/applications/utilities/parallelProcessing/redistributePar/redistributePar.C b/applications/utilities/parallelProcessing/redistributePar/redistributePar.C index 664ba34078..b7ae617422 100644 --- a/applications/utilities/parallelProcessing/redistributePar/redistributePar.C +++ b/applications/utilities/parallelProcessing/redistributePar/redistributePar.C @@ -2499,21 +2499,16 @@ int main(int argc, char *argv[]) wordList regionNames; if (args.found("allRegions")) { - Info<< "Decomposing all regions in regionProperties" << nl << endl; - regionProperties rp(runTime); + regionNames = regionProperties(runTime).names(); - wordHashSet names; - forAllConstIters(rp, iter) - { - names.insert(iter.object()); - } - - regionNames = names.sortedToc(); + Info<< "Decomposing all regions in regionProperties" << nl + << " " << flatOutput(regionNames) << nl << endl; } else { - regionNames = {fvMesh::defaultRegion}; - args.readIfPresent("region", regionNames[0]); + regionNames.resize(1); + regionNames.first() = + args.lookupOrDefault("region", fvMesh::defaultRegion); } 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/graphics/PVReaders/PVFoamReader/CMakeLists-Project.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists-Project.txt index f5b7e80988..0adeba5198 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists-Project.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists-Project.txt @@ -8,6 +8,7 @@ link_directories( include_directories( ${LIB_SRC}/OpenFOAM/lnInclude ${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude + ${LIB_SRC}/fileFormats/lnInclude ${LIB_SRC}/conversion/lnInclude ${LIB_SRC}/finiteArea/lnInclude ${LIB_SRC}/finiteVolume/lnInclude @@ -19,6 +20,7 @@ set(OPENFOAM_LIBRARIES OpenFOAM finiteVolume finiteArea + fileFormats conversion ) 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