Skip to content
Snippets Groups Projects
Commit 4e04c196 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

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

parent 4ad73873
No related branches found
No related tags found
No related merge requests found
Showing
with 23 additions and 23 deletions
...@@ -48,7 +48,7 @@ Foam::XiEqModel::XiEqModel ...@@ -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),
......
...@@ -35,7 +35,7 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New ...@@ -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;
......
...@@ -48,7 +48,7 @@ Foam::XiGModel::XiGModel ...@@ -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),
......
...@@ -35,7 +35,7 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New ...@@ -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;
......
...@@ -51,7 +51,7 @@ Foam::XiModel::XiModel ...@@ -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),
......
...@@ -38,7 +38,7 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New ...@@ -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;
......
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."
......
...@@ -8,7 +8,7 @@ SLGThermo slgThermo(mesh, thermo); ...@@ -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)
......
...@@ -8,7 +8,7 @@ thermo.validate(args.executable(), "h", "e"); ...@@ -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)
......
...@@ -8,7 +8,7 @@ thermo.validate(args.executable(), "h", "e"); ...@@ -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)
......
...@@ -8,7 +8,7 @@ thermo.validate(args.executable(), "h", "e"); ...@@ -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)
......
...@@ -11,7 +11,7 @@ ...@@ -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)
......
...@@ -12,7 +12,7 @@ SLGThermo slgThermo(mesh, thermo); ...@@ -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)
......
...@@ -10,7 +10,7 @@ SLGThermo slgThermo(mesh, thermo); ...@@ -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)
......
...@@ -10,7 +10,7 @@ SLGThermo slgThermo(mesh, thermo); ...@@ -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)
......
...@@ -11,7 +11,7 @@ SLGThermo slgThermo(mesh, thermo); ...@@ -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)
......
...@@ -10,7 +10,7 @@ SLGThermo slgThermo(mesh, thermo); ...@@ -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)
......
...@@ -37,7 +37,7 @@ Foam::autoPtr<Foam::mixtureViscosityModel> Foam::mixtureViscosityModel::New ...@@ -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;
......
...@@ -104,7 +104,7 @@ Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New ...@@ -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;
......
...@@ -38,7 +38,7 @@ Foam::interfaceCompositionModel::New ...@@ -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()
+ "," + ","
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment