ENH: use dictionary::get<word>() instead of lookup() in a few places

This commit is contained in:
Mark Olesen
2018-10-19 09:11:31 +02:00
parent 4ad73873af
commit 4e04c1966f
183 changed files with 279 additions and 263 deletions

View File

@ -48,7 +48,7 @@ Foam::XiEqModel::XiEqModel
( (
XiEqProperties.subDict XiEqProperties.subDict
( (
word(XiEqProperties.lookup("XiEqModel")) + "Coeffs" XiEqProperties.get<word>("XiEqModel") + "Coeffs"
) )
), ),
thermo_(thermo), thermo_(thermo),

View File

@ -35,7 +35,7 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
const volScalarField& Su const volScalarField& Su
) )
{ {
const word modelType(propDict.lookup("XiEqModel")); const word modelType(propDict.get<word>("XiEqModel"));
Info<< "Selecting flame-wrinkling model " << modelType << endl; Info<< "Selecting flame-wrinkling model " << modelType << endl;

View File

@ -48,7 +48,7 @@ Foam::XiGModel::XiGModel
( (
XiGProperties.subDict XiGProperties.subDict
( (
word(XiGProperties.lookup("XiGModel")) + "Coeffs" XiGProperties.get<word>("XiGModel") + "Coeffs"
) )
), ),
thermo_(thermo), thermo_(thermo),

View File

@ -35,7 +35,7 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
const volScalarField& Su const volScalarField& Su
) )
{ {
const word modelType(propDict.lookup("XiGModel")); const word modelType(propDict.get<word>("XiGModel"));
Info<< "Selecting flame-wrinkling model " << modelType << endl; Info<< "Selecting flame-wrinkling model " << modelType << endl;

View File

@ -51,7 +51,7 @@ Foam::XiModel::XiModel
( (
XiProperties.subDict XiProperties.subDict
( (
word(XiProperties.lookup("XiModel")) + "Coeffs" XiProperties.get<word>("XiModel") + "Coeffs"
) )
), ),
thermo_(thermo), thermo_(thermo),

View File

@ -38,7 +38,7 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
const surfaceScalarField& phi const surfaceScalarField& phi
) )
{ {
const word modelType(propDict.lookup("XiModel")); const word modelType(propDict.get<word>("XiModel"));
Info<< "Selecting flame-wrinkling model " << modelType << endl; Info<< "Selecting flame-wrinkling model " << modelType << endl;

View File

@ -1,13 +1,13 @@
word constProp(initialConditions.lookup("constantProperty")); word constProp(initialConditions.get<word>("constantProperty"));
if ((constProp != "pressure") && (constProp != "volume")) if (constProp != "pressure" && constProp != "volume")
{ {
FatalError << "in initialConditions, unknown constantProperty type " FatalError << "in initialConditions, unknown constantProperty type "
<< constProp << nl << " Valid types are: pressure volume." << constProp << nl << " Valid types are: pressure volume."
<< abort(FatalError); << abort(FatalError);
} }
word fractionBasis(initialConditions.lookup("fractionBasis")); word fractionBasis(initialConditions.get<word>("fractionBasis"));
if ((fractionBasis != "mass") && (fractionBasis != "mole")) if (fractionBasis != "mass" && fractionBasis != "mole")
{ {
FatalError << "in initialConditions, unknown fractionBasis type " << nl FatalError << "in initialConditions, unknown fractionBasis type " << nl
<< "Valid types are: mass or mole." << "Valid types are: mass or mole."

View File

@ -8,7 +8,7 @@ SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.get<word>("inertSpecie"));
if (!composition.species().found(inertSpecie)) if (!composition.species().found(inertSpecie))
{ {
FatalIOErrorIn(args.executable().c_str(), thermo) FatalIOErrorIn(args.executable().c_str(), thermo)

View File

@ -8,7 +8,7 @@ thermo.validate(args.executable(), "h", "e");
basicSpecieMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.get<word>("inertSpecie"));
if (!composition.species().found(inertSpecie)) if (!composition.species().found(inertSpecie))
{ {
FatalIOErrorIn(args.executable().c_str(), thermo) FatalIOErrorIn(args.executable().c_str(), thermo)

View File

@ -8,7 +8,7 @@ thermo.validate(args.executable(), "h", "e");
basicSpecieMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.get<word>("inertSpecie"));
if (!composition.species().found(inertSpecie)) if (!composition.species().found(inertSpecie))
{ {
FatalIOErrorIn(args.executable().c_str(), thermo) FatalIOErrorIn(args.executable().c_str(), thermo)

View File

@ -8,7 +8,7 @@ thermo.validate(args.executable(), "h", "e");
basicSpecieMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.get<word>("inertSpecie"));
if (!composition.species().found(inertSpecie)) if (!composition.species().found(inertSpecie))
{ {
FatalIOErrorIn(args.executable().c_str(), thermo) FatalIOErrorIn(args.executable().c_str(), thermo)

View File

@ -11,7 +11,7 @@
label inertIndex = -1; label inertIndex = -1;
if (Y.size()) if (Y.size())
{ {
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.get<word>("inertSpecie"));
if (!composition.species().found(inertSpecie)) if (!composition.species().found(inertSpecie))
{ {
FatalIOErrorIn(args.executable().c_str(), thermo) FatalIOErrorIn(args.executable().c_str(), thermo)

View File

@ -12,7 +12,7 @@ SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.get<word>("inertSpecie"));
if (!composition.species().found(inertSpecie)) if (!composition.species().found(inertSpecie))
{ {
FatalIOErrorIn(args.executable().c_str(), thermo) FatalIOErrorIn(args.executable().c_str(), thermo)

View File

@ -10,7 +10,7 @@ SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.get<word>("inertSpecie"));
if (!composition.species().found(inertSpecie)) if (!composition.species().found(inertSpecie))
{ {
FatalIOErrorIn(args.executable().c_str(), thermo) FatalIOErrorIn(args.executable().c_str(), thermo)

View File

@ -10,7 +10,7 @@ SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.get<word>("inertSpecie"));
if (!composition.species().found(inertSpecie)) if (!composition.species().found(inertSpecie))
{ {
FatalIOErrorIn(args.executable().c_str(), thermo) FatalIOErrorIn(args.executable().c_str(), thermo)

View File

@ -11,7 +11,7 @@ SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.get<word>("inertSpecie"));
if (!composition.species().found(inertSpecie)) if (!composition.species().found(inertSpecie))
{ {
FatalIOErrorIn(args.executable().c_str(), thermo) FatalIOErrorIn(args.executable().c_str(), thermo)

View File

@ -10,7 +10,7 @@ SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.get<word>("inertSpecie"));
if (!composition.species().found(inertSpecie)) if (!composition.species().found(inertSpecie))
{ {
FatalIOErrorIn(args.executable().c_str(), thermo) FatalIOErrorIn(args.executable().c_str(), thermo)

View File

@ -37,7 +37,7 @@ Foam::autoPtr<Foam::mixtureViscosityModel> Foam::mixtureViscosityModel::New
const surfaceScalarField& phi const surfaceScalarField& phi
) )
{ {
const word modelType(viscosityProperties.lookup("transportModel")); const word modelType(viscosityProperties.get<word>("transportModel"));
Info<< "Selecting incompressible transport model " << modelType << endl; Info<< "Selecting incompressible transport model " << modelType << endl;

View File

@ -104,7 +104,7 @@ Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New
const incompressibleTwoPhaseInteractingMixture& mixture const incompressibleTwoPhaseInteractingMixture& mixture
) )
{ {
const word modelType(dict.lookup(typeName)); const word modelType(dict.get<word>(typeName));
Info<< "Selecting relative velocity model " << modelType << endl; Info<< "Selecting relative velocity model " << modelType << endl;

View File

@ -38,7 +38,7 @@ Foam::interfaceCompositionModel::New
{ {
word interfaceCompositionModelType word interfaceCompositionModelType
( (
word(dict.lookup("type")) dict.get<word>("type")
+ "<" + "<"
+ pair.phase1().thermo().type() + pair.phase1().thermo().type()
+ "," + ","

View File

@ -34,7 +34,7 @@ Foam::autoPtr<Foam::porousModel> Foam::porousModel::New
const fvMesh& mesh const fvMesh& mesh
) )
{ {
word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting porousModel for " Info<< "Selecting porousModel for "
<< ": " << modelType << endl; << ": " << modelType << endl;

View File

@ -34,12 +34,12 @@ Foam::autoPtr<Foam::surfaceTensionModel> Foam::surfaceTensionModel::New
const phasePair& pair const phasePair& pair
) )
{ {
word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting surfaceTensionModel for " Info<< "Selecting surfaceTensionModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;
const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found()) if (!cstrIter.found())
{ {

View File

@ -34,7 +34,7 @@ Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::New
const word& phaseName const word& phaseName
) )
{ {
word modelType(fluid.subDict(phaseName).lookup("type")); const word modelType(fluid.subDict(phaseName).get<word>("type"));
Info<< "Selecting phaseModel for " Info<< "Selecting phaseModel for "
<< phaseName << ": " << modelType << endl; << phaseName << ": " << modelType << endl;

View File

@ -45,7 +45,7 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New
IOobject::NO_WRITE, IOobject::NO_WRITE,
false false
) )
).lookup("type") ).get<word>("type")
); );
Info<< "Selecting multiphaseSystem " << multiphaseSystemType << endl; Info<< "Selecting multiphaseSystem " << multiphaseSystemType << endl;

View File

@ -34,7 +34,7 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New
const phaseModel& phase2 const phaseModel& phase2
) )
{ {
const word modelType(interfaceDict.lookup("type")); const word modelType(interfaceDict.get<word>("type"));
Info << "Selecting dragModel for phase " Info << "Selecting dragModel for phase "
<< phase1.name() << phase1.name()

View File

@ -33,7 +33,7 @@ Foam::autoPtr<Foam::diameterModel> Foam::diameterModel::New
const phaseModel& phase const phaseModel& phase
) )
{ {
const word modelType(dict.lookup("diameterModel")); const word modelType(dict.get<word>("diameterModel"));
Info << "Selecting diameterModel for phase " Info << "Selecting diameterModel for phase "
<< phase.name() << phase.name()

View File

@ -38,7 +38,7 @@ Foam::interfaceCompositionModel::New
{ {
const word modelType const word modelType
( (
word(dict.lookup("type")) dict.get<word>("type")
+ "<" + "<"
+ pair.phase1().thermo().type() + pair.phase1().thermo().type()
+ "," + ","

View File

@ -34,7 +34,7 @@ Foam::autoPtr<Foam::massTransferModel> Foam::massTransferModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting massTransferModel for " Info<< "Selecting massTransferModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -32,7 +32,7 @@ Foam::autoPtr<Foam::saturationModel> Foam::saturationModel::New
const dictionary& dict const dictionary& dict
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting saturationModel: " << modelType << endl; Info<< "Selecting saturationModel: " << modelType << endl;

View File

@ -35,7 +35,7 @@ Foam::surfaceTensionModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting surfaceTensionModel for " Info<< "Selecting surfaceTensionModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -35,7 +35,7 @@ Foam::aspectRatioModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting aspectRatioModel for " Info<< "Selecting aspectRatioModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -34,7 +34,7 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting dragModel for " Info<< "Selecting dragModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -34,7 +34,7 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting heatTransferModel for " Info<< "Selecting heatTransferModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -34,7 +34,7 @@ Foam::autoPtr<Foam::liftModel> Foam::liftModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting liftModel for " Info<< "Selecting liftModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -35,7 +35,7 @@ Foam::swarmCorrection::New
const phasePair& pair const phasePair& pair
) )
{ {
const word correctionType(dict.lookup("type")); const word correctionType(dict.get<word>("type"));
Info<< "Selecting swarmCorrection for " Info<< "Selecting swarmCorrection for "
<< pair << ": " << correctionType << endl; << pair << ": " << correctionType << endl;

View File

@ -35,7 +35,7 @@ Foam::turbulentDispersionModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting turbulentDispersionModel for " Info<< "Selecting turbulentDispersionModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -34,7 +34,7 @@ Foam::autoPtr<Foam::virtualMassModel> Foam::virtualMassModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting virtualMassModel for " Info<< "Selecting virtualMassModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -34,7 +34,7 @@ Foam::autoPtr<Foam::wallDampingModel> Foam::wallDampingModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting wallDampingModel for " Info<< "Selecting wallDampingModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -34,7 +34,7 @@ Foam::autoPtr<Foam::wallLubricationModel> Foam::wallLubricationModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting wallLubricationModel for " Info<< "Selecting wallLubricationModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -33,7 +33,7 @@ Foam::autoPtr<Foam::blendingMethod> Foam::blendingMethod::New
const wordList& phaseNames const wordList& phaseNames
) )
{ {
const word methodType(dict.lookup("type")); const word methodType(dict.get<word>("type"));
Info<< "Selecting " << dict.dictName() << " blending method: " Info<< "Selecting " << dict.dictName() << " blending method: "
<< methodType << endl; << methodType << endl;

View File

@ -33,7 +33,7 @@ Foam::autoPtr<Foam::diameterModel> Foam::diameterModel::New
const phaseModel& phase const phaseModel& phase
) )
{ {
const word modelType(dict.lookup("diameterModel")); const word modelType(dict.get<word>("diameterModel"));
Info << "Selecting diameterModel for phase " Info << "Selecting diameterModel for phase "
<< phase.name() << phase.name()

View File

@ -35,7 +35,7 @@ Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::New
const label index const label index
) )
{ {
const word modelType(fluid.subDict(phaseName).lookup("type")); const word modelType(fluid.subDict(phaseName).get<word>("type"));
Info<< "Selecting phaseModel for " Info<< "Selecting phaseModel for "
<< phaseName << ": " << modelType << endl; << phaseName << ": " << modelType << endl;

View File

@ -45,7 +45,7 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New
IOobject::NO_WRITE, IOobject::NO_WRITE,
false false
) )
).lookup("type") ).get<word>("type")
); );
Info<< "Selecting multiphaseSystem " << systemType << endl; Info<< "Selecting multiphaseSystem " << systemType << endl;

View File

@ -33,7 +33,7 @@ Foam::wallBoilingModels::departureDiameterModel::New
const dictionary& dict const dictionary& dict
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting departureDiameterModel: " << modelType << endl; Info<< "Selecting departureDiameterModel: " << modelType << endl;

View File

@ -33,7 +33,7 @@ Foam::wallBoilingModels::departureFrequencyModel::New
const dictionary& dict const dictionary& dict
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting departureFrequencyModel: " << modelType << endl; Info<< "Selecting departureFrequencyModel: " << modelType << endl;

View File

@ -33,7 +33,7 @@ Foam::wallBoilingModels::nucleationSiteModel::New
const dictionary& dict const dictionary& dict
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting nucleationSiteModel: " << modelType << endl; Info<< "Selecting nucleationSiteModel: " << modelType << endl;

View File

@ -33,7 +33,7 @@ Foam::wallBoilingModels::partitioningModel::New
const dictionary& dict const dictionary& dict
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting partitioningModel: " << modelType << endl; Info<< "Selecting partitioningModel: " << modelType << endl;

View File

@ -33,7 +33,7 @@ Foam::kineticTheoryModels::conductivityModel::New
const dictionary& dict const dictionary& dict
) )
{ {
const word modelType(dict.lookup("conductivityModel")); const word modelType(dict.get<word>("conductivityModel"));
Info<< "Selecting conductivityModel " << modelType << endl; Info<< "Selecting conductivityModel " << modelType << endl;

View File

@ -33,7 +33,7 @@ Foam::kineticTheoryModels::frictionalStressModel::New
const dictionary& dict const dictionary& dict
) )
{ {
const word modelType(dict.lookup("frictionalStressModel")); const word modelType(dict.get<word>("frictionalStressModel"));
Info<< "Selecting frictionalStressModel " << modelType << endl; Info<< "Selecting frictionalStressModel " << modelType << endl;

View File

@ -33,7 +33,7 @@ Foam::kineticTheoryModels::granularPressureModel::New
const dictionary& dict const dictionary& dict
) )
{ {
const word modelType(dict.lookup("granularPressureModel")); const word modelType(dict.get<word>("granularPressureModel"));
Info<< "Selecting granularPressureModel " << modelType << endl; Info<< "Selecting granularPressureModel " << modelType << endl;

View File

@ -33,7 +33,7 @@ Foam::kineticTheoryModels::radialModel::New
const dictionary& dict const dictionary& dict
) )
{ {
const word modelType(dict.lookup("radialModel")); const word modelType(dict.get<word>("radialModel"));
Info<< "Selecting radialModel " << modelType << endl; Info<< "Selecting radialModel " << modelType << endl;

View File

@ -33,7 +33,7 @@ Foam::kineticTheoryModels::viscosityModel::New
const dictionary& dict const dictionary& dict
) )
{ {
const word modelType(dict.lookup("viscosityModel")); const word modelType(dict.get<word>("viscosityModel"));
Info<< "Selecting viscosityModel " << modelType << endl; Info<< "Selecting viscosityModel " << modelType << endl;

View File

@ -45,7 +45,7 @@ Foam::autoPtr<Foam::twoPhaseSystem> Foam::twoPhaseSystem::New
IOobject::NO_WRITE, IOobject::NO_WRITE,
false false
) )
).lookup("type") ).get<word>("type")
); );
Info<< "Selecting twoPhaseSystem " << systemType << endl; Info<< "Selecting twoPhaseSystem " << systemType << endl;

View File

@ -35,7 +35,7 @@ Foam::aspectRatioModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting aspectRatioModel for " Info<< "Selecting aspectRatioModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -34,7 +34,7 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting dragModel for " Info<< "Selecting dragModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -34,7 +34,7 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting heatTransferModel for " Info<< "Selecting heatTransferModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -34,7 +34,7 @@ Foam::autoPtr<Foam::liftModel> Foam::liftModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting liftModel for " Info<< "Selecting liftModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -35,7 +35,7 @@ Foam::swarmCorrection::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting swarmCorrection for " Info<< "Selecting swarmCorrection for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -35,7 +35,7 @@ Foam::turbulentDispersionModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting turbulentDispersionModel for " Info<< "Selecting turbulentDispersionModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -34,7 +34,7 @@ Foam::autoPtr<Foam::virtualMassModel> Foam::virtualMassModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting virtualMassModel for " Info<< "Selecting virtualMassModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -34,7 +34,7 @@ Foam::autoPtr<Foam::wallLubricationModel> Foam::wallLubricationModel::New
const phasePair& pair const phasePair& pair
) )
{ {
const word modelType(dict.lookup("type")); const word modelType(dict.get<word>("type"));
Info<< "Selecting wallLubricationModel for " Info<< "Selecting wallLubricationModel for "
<< pair << ": " << modelType << endl; << pair << ": " << modelType << endl;

View File

@ -33,7 +33,7 @@ Foam::kineticTheoryModels::conductivityModel::New
const dictionary& dict const dictionary& dict
) )
{ {
const word modelType(dict.lookup("conductivityModel")); const word modelType(dict.get<word>("conductivityModel"));
Info<< "Selecting conductivityModel " << modelType << endl; Info<< "Selecting conductivityModel " << modelType << endl;

View File

@ -33,7 +33,7 @@ Foam::kineticTheoryModels::frictionalStressModel::New
const dictionary& dict const dictionary& dict
) )
{ {
const word modelType(dict.lookup("frictionalStressModel")); const word modelType(dict.get<word>("frictionalStressModel"));
Info<< "Selecting frictionalStressModel " << modelType << endl; Info<< "Selecting frictionalStressModel " << modelType << endl;

View File

@ -33,7 +33,7 @@ Foam::kineticTheoryModels::granularPressureModel::New
const dictionary& dict const dictionary& dict
) )
{ {
const word modelType(dict.lookup("granularPressureModel")); const word modelType(dict.get<word>("granularPressureModel"));
Info<< "Selecting granularPressureModel " << modelType << endl; Info<< "Selecting granularPressureModel " << modelType << endl;

View File

@ -33,7 +33,7 @@ Foam::kineticTheoryModels::radialModel::New
const dictionary& dict const dictionary& dict
) )
{ {
const word modelType(dict.lookup("radialModel")); const word modelType(dict.get<word>("radialModel"));
Info<< "Selecting radialModel " << modelType << endl; Info<< "Selecting radialModel " << modelType << endl;

View File

@ -33,7 +33,7 @@ Foam::kineticTheoryModels::viscosityModel::New
const dictionary& dict const dictionary& dict
) )
{ {
const word modelName(dict.lookup("viscosityModel")); const word modelName(dict.get<word>("viscosityModel"));
Info<< "Selecting viscosityModel " << modelName << endl; Info<< "Selecting viscosityModel " << modelName << endl;

View File

@ -33,7 +33,7 @@ Foam::autoPtr<Foam::blendingMethod> Foam::blendingMethod::New
const wordList& phaseNames const wordList& phaseNames
) )
{ {
const word methodName(dict.lookup("type")); const word methodName(dict.get<word>("type"));
Info<< "Selecting " << dict.dictName() << " blending method: " Info<< "Selecting " << dict.dictName() << " blending method: "
<< methodName << endl; << methodName << endl;

View File

@ -33,7 +33,7 @@ Foam::autoPtr<Foam::diameterModel> Foam::diameterModel::New
const phaseModel& phase const phaseModel& phase
) )
{ {
const word modelType(dict.lookup("diameterModel")); const word modelType(dict.get<word>("diameterModel"));
Info << "Selecting diameterModel for phase " Info << "Selecting diameterModel for phase "
<< phase.name() << phase.name()

View File

@ -661,8 +661,8 @@ int main(int argc, char *argv[])
const word& key = iter().keyword(); const word& key = iter().keyword();
const dictionary& dict = iter().dict(); const dictionary& dict = iter().dict();
const word cyclicName = dict.lookup("cyclicMasterPatch"); const word cyclicName = dict.get<word>("cyclicMasterPatch");
const word wallName = dict.lookup("wallPatch"); const word wallName = dict.get<word>("wallPatch");
FixedList<word, 3> nameAndType; FixedList<word, 3> nameAndType;
nameAndType[0] = key; nameAndType[0] = key;
nameAndType[1] = wallName; nameAndType[1] = wallName;
@ -685,12 +685,12 @@ int main(int argc, char *argv[])
} }
// All exposed faces that are not explicitly marked to be put into a patch // All exposed faces that are not explicitly marked to be put into a patch
const word defaultPatch(dict.lookup("defaultPatch")); const word defaultPatch(dict.get<word>("defaultPatch"));
Info<< "Faces that get exposed become boundary faces in patch " Info<< "Faces that get exposed become boundary faces in patch "
<< defaultPatch << endl; << defaultPatch << endl;
const word blockedSetName(dict.lookup("blockedCells")); const word blockedSetName(dict.get<word>("blockedCells"));
Info<< "Reading blocked cells from cellSet " << blockedSetName Info<< "Reading blocked cells from cellSet " << blockedSetName
<< endl; << endl;
@ -1276,7 +1276,7 @@ int main(int argc, char *argv[])
<< " so might have to be moved back to constant/" << nl << " so might have to be moved back to constant/" << nl
<< endl; << endl;
word startFrom(runTime.controlDict().lookup("startFrom")); const word startFrom(runTime.controlDict().get<word>("startFrom"));
if (startFrom != "latestTime") if (startFrom != "latestTime")
{ {

View File

@ -138,13 +138,22 @@ void Foam::helpType::displayDoc
if (parser.found(className)) if (parser.found(className))
{ {
fileName docFile(doxyPath/parser.subDict(className).lookup("filename")); fileName docFile
(
doxyPath/parser.subDict(className).get<fileName>("filename")
);
// can use FOAM_DOC_BROWSER='application file://%f' if required // can use FOAM_DOC_BROWSER='application file://%f' if required
docBrowser.replaceAll("%f", docFile); docBrowser.replaceAll("%f", docFile);
fileName classDirectory(parser.subDict(className).lookup("path")); fileName classDirectory
word classFile(parser.subDict(className).lookup("name")); (
parser.subDict(className).get<fileName>("path")
);
const word classFile
(
parser.subDict(className).get<word>("name")
);
Info<< "Showing documentation for type " << className << nl << endl; Info<< "Showing documentation for type " << className << nl << endl;

View File

@ -342,7 +342,7 @@ void determineDecomposition
scalarField cellWeights; scalarField cellWeights;
if (method.found("weightField")) if (method.found("weightField"))
{ {
word weightName = method.lookup("weightField"); word weightName = method.get<word>("weightField");
volScalarField weights volScalarField weights
( (

View File

@ -4,6 +4,6 @@ const word dictName("particleTrackDict");
IOdictionary propsDict(dictIO); IOdictionary propsDict(dictIO);
word cloudName(propsDict.lookup("cloud")); word cloudName(propsDict.get<word>("cloud"));
List<word> userFields(propsDict.lookup("fields")); List<word> userFields(propsDict.lookup("fields"));

View File

@ -257,7 +257,7 @@ int main(int argc, char *argv[])
entry::disableFunctionEntries = 1; entry::disableFunctionEntries = 1;
// Read the solver // Read the solver
const word& solverName = controlDict.lookup("application"); const word solverName(controlDict.get<word>("application"));
// Generate solver template // Generate solver template
const solverTemplate solver(baseDir, runTime, solverName); const solverTemplate solver(baseDir, runTime, solverName);

View File

@ -34,7 +34,7 @@ Foam::tabulatedWallFunctions::tabulatedWallFunction::New
const polyMesh& mesh const polyMesh& mesh
) )
{ {
const word functionName = dict.lookup("tabulatedWallFunction"); const word functionName(dict.get<word>("tabulatedWallFunction"));
Info<< "Selecting tabulatedWallFunction " << functionName << endl; Info<< "Selecting tabulatedWallFunction " << functionName << endl;

View File

@ -68,7 +68,7 @@ Foam::surfaceFeaturesExtraction::method::New
const dictionary& dict const dictionary& dict
) )
{ {
const word methodName = dict.lookup("extractionMethod"); const word methodName(dict.get<word>("extractionMethod"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodName); auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodName);

View File

@ -104,7 +104,7 @@ int main(int argc, char *argv[])
( (
searchableSurfaceModifier::New searchableSurfaceModifier::New
( (
surfDict.lookup("type"), surfDict.get<word>("type"),
allGeometry, allGeometry,
surfDict surfDict
) )
@ -129,7 +129,7 @@ int main(int argc, char *argv[])
( (
searchableSurfaceModifier::New searchableSurfaceModifier::New
( (
regionDict.lookup("type"), regionDict.get<word>("type"),
allGeometry, allGeometry,
regionDict regionDict
) )

View File

@ -107,7 +107,7 @@ const HashTable<dimensionedScalar>& unitSet()
<< exit(FatalIOError); << exit(FatalIOError);
} }
const word unitSetCoeffs(word(dict.lookup("unitSet")) + "Coeffs"); const word unitSetCoeffs(dict.get<word>("unitSet") + "Coeffs");
if (!dict.found(unitSetCoeffs)) if (!dict.found(unitSetCoeffs))
{ {

View File

@ -114,7 +114,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
InfoInFunction << "Constructing pointPatchField<Type>" << endl; InfoInFunction << "Constructing pointPatchField<Type>" << endl;
} }
word patchFieldType(dict.lookup("type")); const word patchFieldType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType); auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType);
@ -144,7 +144,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
if if
( (
!dict.found("patchType") !dict.found("patchType")
|| word(dict.lookup("patchType")) != p.type() || dict.get<word>("patchType") != p.type()
) )
{ {
if (pfPtr().constraintType() == p.constraintType()) if (pfPtr().constraintType() == p.constraintType())

View File

@ -65,7 +65,7 @@ T dimensionedConstant
{ {
dictionary& dict = dimensionedConstants(); dictionary& dict = dimensionedConstants();
const word unitSet(dict.lookup("unitSet")); const word unitSet(dict.get<word>("unitSet"));
dictionary& unitDict(dict.subDict(unitSet + "Coeffs")); dictionary& unitDict(dict.subDict(unitSet + "Coeffs"));

View File

@ -35,7 +35,10 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
const dictionary& preconditionerDict const dictionary& preconditionerDict
) )
{ {
const word preconditionerName = preconditionerDict.lookup("preconditioner"); const word preconditionerName
(
preconditionerDict.get<word>("preconditioner")
);
if (sol.matrix().symmetric()) if (sol.matrix().symmetric())
{ {

View File

@ -36,7 +36,7 @@ Foam::LduMatrix<Type, DType, LUType>::smoother::New
const dictionary& smootherDict const dictionary& smootherDict
) )
{ {
word smootherName = smootherDict.lookup("smoother"); const word smootherName(smootherDict.get<word>("smoother"));
if (matrix.symmetric()) if (matrix.symmetric())
{ {

View File

@ -37,7 +37,7 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New
const dictionary& solverDict const dictionary& solverDict
) )
{ {
const word solverName = solverDict.lookup("solver"); const word solverName(solverDict.get<word>("solver"));
if (matrix.diagonal()) if (matrix.diagonal())
{ {

View File

@ -47,7 +47,7 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
const dictionary& solverControls const dictionary& solverControls
) )
{ {
const word name(solverControls.lookup("solver")); const word name(solverControls.get<word>("solver"));
if (matrix.diagonal()) if (matrix.diagonal())
{ {

View File

@ -57,7 +57,7 @@ bool Foam::tolerances::read()
{ {
if (regIOobject::read()) if (regIOobject::read())
{ {
const word toleranceSetName(lookup("toleranceSet")); const word toleranceSetName(get<word>("toleranceSet"));
const dictionary& toleranceSet(subDict(toleranceSetName)); const dictionary& toleranceSet(subDict(toleranceSetName));
if (toleranceSet.found("relaxationFactors")) if (toleranceSet.found("relaxationFactors"))
@ -78,10 +78,8 @@ bool Foam::tolerances::read()
return true; return true;
} }
else
{ return false;
return false;
}
} }

View File

@ -63,7 +63,7 @@ Foam::genericPolyPatch::genericPolyPatch
) )
: :
polyPatch(name, dict, index, bm, patchType), polyPatch(name, dict, index, bm, patchType),
actualTypeName_(dict.lookup("type")), actualTypeName_(dict.get<word>("type")),
dict_(dict) dict_(dict)
{} {}

View File

@ -83,7 +83,7 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New
InfoInFunction << "Constructing polyPatch" << endl; InfoInFunction << "Constructing polyPatch" << endl;
} }
word patchType(dict.lookup("type")); word patchType(dict.get<word>("type"));
dict.readIfPresent("geometricType", patchType); dict.readIfPresent("geometricType", patchType);
return polyPatch::New(patchType, name, dict, index, bm); return polyPatch::New(patchType, name, dict, index, bm);

View File

@ -41,7 +41,7 @@ Foam::autoPtr<Foam::cellZone> Foam::cellZone::New
InfoInFunction << "Constructing cellZone " << name << endl; InfoInFunction << "Constructing cellZone " << name << endl;
} }
const word zoneType(dict.lookup("type")); const word zoneType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType); auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType);

View File

@ -41,7 +41,7 @@ Foam::autoPtr<Foam::faceZone> Foam::faceZone::New
InfoInFunction << "Constructing faceZone " << name << endl; InfoInFunction << "Constructing faceZone " << name << endl;
} }
const word zoneType(dict.lookup("type")); const word zoneType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType); auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType);

View File

@ -41,7 +41,7 @@ Foam::autoPtr<Foam::pointZone> Foam::pointZone::New
InfoInFunction << "Constructing pointZone " << name << endl; InfoInFunction << "Constructing pointZone " << name << endl;
} }
const word zoneType(dict.lookup("type")); const word zoneType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType); auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType);

View File

@ -38,7 +38,7 @@ Foam::autoPtr<Foam::Function1<Type>> Foam::Function1<Type>::New
{ {
const dictionary& coeffsDict(dict.subDict(entryName)); const dictionary& coeffsDict(dict.subDict(entryName));
const word Function1Type(coeffsDict.lookup("type")); const word Function1Type(coeffsDict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(Function1Type); auto cstrIter = dictionaryConstructorTablePtr_->cfind(Function1Type);
@ -57,7 +57,7 @@ Foam::autoPtr<Foam::Function1<Type>> Foam::Function1<Type>::New
} }
else else
{ {
Istream& is = dict.lookup(entryName); // non-recursive, allow patterns Istream& is = dict.lookup(entryName, keyType::REGEX);
token firstToken(is); token firstToken(is);
word Function1Type; word Function1Type;

View File

@ -70,7 +70,7 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New
const word& lookupName const word& lookupName
) )
{ {
const word deltaType(dict.lookup(lookupName)); const word deltaType(dict.get<word>(lookupName));
Info<< "Selecting LES " << lookupName << " type " << deltaType << endl; Info<< "Selecting LES " << lookupName << " type " << deltaType << endl;
@ -99,7 +99,7 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New
const word& lookupName const word& lookupName
) )
{ {
const word deltaType(dict.lookup(lookupName)); const word deltaType(dict.get<word>(lookupName));
Info<< "Selecting LES " << lookupName << " type " << deltaType << endl; Info<< "Selecting LES " << lookupName << " type " << deltaType << endl;

View File

@ -44,7 +44,7 @@ Foam::autoPtr<Foam::LESfilter> Foam::LESfilter::New
const word& filterDictName const word& filterDictName
) )
{ {
const word filterType(dict.lookup(filterDictName)); const word filterType(dict.get<word>(filterDictName));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(filterType); auto cstrIter = dictionaryConstructorTablePtr_->cfind(filterType);

View File

@ -63,7 +63,7 @@ Foam::porosityModels::powerLawLopesdaCostaZone::powerLawLopesdaCostaZone
scalar searchSpan(coeffs.get<scalar>("searchSpan")); scalar searchSpan(coeffs.get<scalar>("searchSpan"));
// Top surface file name defining the extent of the porous region // Top surface file name defining the extent of the porous region
word topSurfaceFileName(coeffs.lookup("topSurface")); const word topSurfaceFileName(coeffs.get<word>("topSurface"));
// List of the ground patches defining the lower surface // List of the ground patches defining the lower surface
// of the porous region // of the porous region

View File

@ -51,7 +51,7 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io)
{ {
IOdictionary dict(dictHeader); IOdictionary dict(dictHeader);
const word modelType(dict.lookup("dynamicFvMesh")); const word modelType(dict.get<word>("dynamicFvMesh"));
Info<< "Selecting dynamicFvMesh " << modelType << endl; Info<< "Selecting dynamicFvMesh " << modelType << endl;

View File

@ -77,7 +77,7 @@ Foam::dynamicMultiMotionSolverFvMesh::dynamicMultiMotionSolverFvMesh
{ {
const dictionary& subDict = iter().dict(); const dictionary& subDict = iter().dict();
word zoneName(subDict.lookup("cellZone")); const word zoneName(subDict.get<word>("cellZone"));
zoneIDs_[zoneI] = cellZones().findZoneID(zoneName); zoneIDs_[zoneI] = cellZones().findZoneID(zoneName);

View File

@ -60,7 +60,7 @@ Foam::simplifiedMeshes::simplifiedDynamicFvMeshBase::New
{ {
IOdictionary dict(dictHeader); IOdictionary dict(dictHeader);
const word modelType(dict.lookup("dynamicFvMesh")); const word modelType(dict.get<word>("dynamicFvMesh"));
auto cstrIter = timeConstructorTablePtr_->cfind(modelType); auto cstrIter = timeConstructorTablePtr_->cfind(modelType);

View File

@ -568,7 +568,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshTools::newMesh
forAll(patchEntries, patchI) forAll(patchEntries, patchI)
{ {
const entry& e = patchEntries[patchI]; const entry& e = patchEntries[patchI];
const word type(e.dict().lookup("type")); const word type(e.dict().get<word>("type"));
if if
( (

View File

@ -340,7 +340,7 @@ Foam::directions::directions
{ {
const dictionary& patchDict = dict.subDict("patchLocalCoeffs"); const dictionary& patchDict = dict.subDict("patchLocalCoeffs");
const word patchName(patchDict.lookup("patch")); const word patchName(patchDict.get<word>("patch"));
const label patchi = mesh.boundaryMesh().findPatchID(patchName); const label patchi = mesh.boundaryMesh().findPatchID(patchName);

View File

@ -89,7 +89,7 @@ Foam::displacementMotionSolver::New
const pointIOField& points0 const pointIOField& points0
) )
{ {
//const word solverTypeName(solverDict.lookup("solver")); //const word solverTypeName(solverDict.get<word>("solver"));
Info<< "Selecting motion solver: " << solverTypeName << endl; Info<< "Selecting motion solver: " << solverTypeName << endl;

View File

@ -230,7 +230,7 @@ Foam::displacementLayeredMotionMotionSolver::faceZoneEvaluate
tmp<vectorField> tfld(new vectorField(meshPoints.size())); tmp<vectorField> tfld(new vectorField(meshPoints.size()));
vectorField& fld = tfld.ref(); vectorField& fld = tfld.ref();
const word type(dict.lookup("type")); const word type(dict.get<word>("type"));
if (type == "fixedValue") if (type == "fixedValue")
{ {
@ -262,7 +262,7 @@ Foam::displacementLayeredMotionMotionSolver::faceZoneEvaluate
{ {
// Reads name of name of patch. Then get average point displacement on // Reads name of name of patch. Then get average point displacement on
// patch. That becomes the value of fld. // patch. That becomes the value of fld.
const word patchName(dict.lookup("patch")); const word patchName(dict.get<word>("patch"));
label patchID = mesh().boundaryMesh().findPatchID(patchName); label patchID = mesh().boundaryMesh().findPatchID(patchName);
pointField pdf pointField pdf
( (
@ -451,7 +451,7 @@ void Foam::displacementLayeredMotionMotionSolver::cellZoneSolve
} }
const word interpolationScheme = zoneDict.lookup("interpolationScheme"); const word interpolationScheme(zoneDict.get<word>("interpolationScheme"));
if (interpolationScheme == "oneSided") if (interpolationScheme == "oneSided")
{ {

Some files were not shown because too many files have changed in this diff Show More