STYLE: use auto and cfind to simplify selector usage (issue #512)

This commit is contained in:
Mark Olesen
2017-07-03 10:36:03 +02:00
parent a09815fae2
commit bc1f2fa97e
246 changed files with 1109 additions and 1481 deletions

View File

@ -40,15 +40,14 @@ Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
Info<< "Selecting flame-wrinkling model " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown PDRDragModel type "
<< modelType << nl << nl
<< "Valid PDRDragModels are : " << endl
<< "Valid PDRDragModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -39,15 +39,14 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
Info<< "Selecting flame-wrinkling model " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown XiEqModel type "
<< modelType << nl << nl
<< "Valid XiEqModels are : " << endl
<< "Valid XiEqModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -39,15 +39,14 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
Info<< "Selecting flame-wrinkling model " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown XiGModel type "
<< modelType << nl << nl
<< "Valid XiGModels are : " << endl
<< "Valid XiGModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -42,15 +42,14 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
Info<< "Selecting flame-wrinkling model " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown XiModel type "
<< modelType << nl << nl
<< "Valid XiModels are : " << endl
<< "Valid XiModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -41,15 +41,14 @@ Foam::autoPtr<Foam::mixtureViscosityModel> Foam::mixtureViscosityModel::New
Info<< "Selecting incompressible transport model " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown mixtureViscosityModel type "
<< modelType << nl << nl
<< "Valid mixtureViscosityModels are : " << endl
<< "Valid mixtureViscosityModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -104,19 +104,18 @@ Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New
const incompressibleTwoPhaseInteractingMixture& mixture
)
{
word modelType(dict.lookup(typeName));
const word modelType(dict.lookup(typeName));
Info<< "Selecting relative velocity model " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown time scale model type " << modelType
<< ", constructor not in hash table" << nl << nl
<< " Valid time scale model types are:" << nl
<< "Unknown time scale model type "
<< modelType << nl << nl
<< "Valid time scale model types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< abort(FatalError);
}
@ -141,13 +140,13 @@ Foam::relativeVelocityModel::~relativeVelocityModel()
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
tmp<volScalarField> Foam::relativeVelocityModel::rho() const
Foam::tmp<Foam::volScalarField> Foam::relativeVelocityModel::rho() const
{
return alphac_*rhoc_ + alphad_*rhod_;
}
tmp<volSymmTensorField> Foam::relativeVelocityModel::tauDm() const
Foam::tmp<Foam::volSymmTensorField> Foam::relativeVelocityModel::tauDm() const
{
volScalarField betac(alphac_*rhoc_);
volScalarField betad(alphad_*rhod_);

View File

@ -48,7 +48,7 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New
)
);
word temperaturePhaseChangeTwoPhaseMixtureTypeName
const word modelType
(
phaseChangePropertiesDict.lookup
(
@ -56,19 +56,16 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New
)
);
Info<< "Selecting phaseChange model "
<< temperaturePhaseChangeTwoPhaseMixtureTypeName << endl;
Info<< "Selecting phaseChange model " << modelType << endl;
componentsConstructorTable::iterator cstrIter =
componentsConstructorTablePtr_
->find(temperaturePhaseChangeTwoPhaseMixtureTypeName);
auto cstrIter = componentsConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown temperaturePhaseChangeTwoPhaseMixture type "
<< temperaturePhaseChangeTwoPhaseMixtureTypeName << endl << endl
<< "Valid temperaturePhaseChangeTwoPhaseMixtures are : " << endl
<< modelType << nl << nl
<< "Valid temperaturePhaseChangeTwoPhaseMixture types :" << endl
<< componentsConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -48,24 +48,21 @@ Foam::phaseChangeTwoPhaseMixture::New
)
);
word phaseChangeTwoPhaseMixtureTypeName
const word modelType
(
transportPropertiesDict.lookup("phaseChangeTwoPhaseMixture")
);
Info<< "Selecting phaseChange model "
<< phaseChangeTwoPhaseMixtureTypeName << endl;
Info<< "Selecting phaseChange model " << modelType << endl;
componentsConstructorTable::iterator cstrIter =
componentsConstructorTablePtr_
->find(phaseChangeTwoPhaseMixtureTypeName);
auto cstrIter = componentsConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown phaseChangeTwoPhaseMixture type "
<< phaseChangeTwoPhaseMixtureTypeName << endl << endl
<< "Valid phaseChangeTwoPhaseMixtures are : " << endl
<< modelType << nl << nl
<< "Valid phaseChangeTwoPhaseMixture types :" << endl
<< componentsConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -34,22 +34,21 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New
const phaseModel& phase2
)
{
word dragModelType(interfaceDict.lookup("type"));
const word modelType(interfaceDict.lookup("type"));
Info << "Selecting dragModel for phase "
<< phase1.name()
<< ": "
<< dragModelType << endl;
<< modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(dragModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown dragModelType type "
<< dragModelType << endl << endl
<< "Valid dragModel types are : " << endl
<< "Unknown dragModel type "
<< modelType << nl << nl
<< "Valid dragModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -35,7 +35,7 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New
const phaseModel& phase2
)
{
word heatTransferModelType
const word modelType
(
interfaceDict.lookup("heatTransferModel" + phase1.name())
);
@ -43,17 +43,16 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New
Info<< "Selecting heatTransferModel for phase "
<< phase1.name()
<< ": "
<< heatTransferModelType << endl;
<< modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(heatTransferModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown heatTransferModelType type "
<< heatTransferModelType << endl << endl
<< "Valid heatTransferModel types are : " << endl
<< "Unknown heatTransferModel type "
<< modelType << nl << nl
<< "Valid heatTransferModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -33,32 +33,28 @@ Foam::autoPtr<Foam::diameterModel> Foam::diameterModel::New
const phaseModel& phase
)
{
word diameterModelType
(
dict.lookup("diameterModel")
);
const word modelType(dict.lookup("diameterModel"));
Info << "Selecting diameterModel for phase "
<< phase.name()
<< ": "
<< diameterModelType << endl;
<< modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(diameterModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown diameterModelType type "
<< diameterModelType << endl << endl
<< "Valid diameterModel types are : " << endl
<< "Unknown diameterModel type "
<< modelType << nl << nl
<< "Valid diameterModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()
(
dict.optionalSubDict(diameterModelType + "Coeffs"),
dict.optionalSubDict(modelType + "Coeffs"),
phase
);
}

View File

@ -36,7 +36,7 @@ Foam::interfaceCompositionModel::New
const phasePair& pair
)
{
word interfaceCompositionModelType
const word modelType
(
word(dict.lookup("type"))
+ "<"
@ -47,17 +47,16 @@ Foam::interfaceCompositionModel::New
);
Info<< "Selecting interfaceCompositionModel for "
<< pair << ": " << interfaceCompositionModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(interfaceCompositionModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown interfaceCompositionModelType type "
<< interfaceCompositionModelType << endl << endl
<< "Valid interfaceCompositionModel types are : " << endl
<< "Unknown interfaceCompositionModel type "
<< modelType << nl << nl
<< "Valid interfaceCompositionModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -34,20 +34,19 @@ Foam::autoPtr<Foam::massTransferModel> Foam::massTransferModel::New
const phasePair& pair
)
{
word massTransferModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting massTransferModel for "
<< pair << ": " << massTransferModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(massTransferModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown massTransferModelType type "
<< massTransferModelType << endl << endl
<< "Valid massTransferModel types are : " << endl
<< "Unknown massTransferModel type "
<< modelType << nl << nl
<< "Valid massTransferModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -32,20 +32,18 @@ Foam::autoPtr<Foam::saturationModel> Foam::saturationModel::New
const dictionary& dict
)
{
word saturationModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting saturationModel: "
<< saturationModelType << endl;
Info<< "Selecting saturationModel: " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(saturationModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown saturationModelType type "
<< saturationModelType << endl << endl
<< "Valid saturationModel types are : " << endl
<< "Unknown saturationModel type "
<< modelType << nl << nl
<< "Valid saturationModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -35,20 +35,19 @@ Foam::surfaceTensionModel::New
const phasePair& pair
)
{
word surfaceTensionModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting surfaceTensionModel for "
<< pair << ": " << surfaceTensionModelType << endl;
<< pair << ": " << modelType << endl;
multiphaseConstructorTable::iterator cstrIter =
multiphaseConstructorTablePtr_->find(surfaceTensionModelType);
auto cstrIter = multiphaseConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown surfaceTensionModelType type "
<< surfaceTensionModelType << endl << endl
<< "Valid surfaceTensionModel types are : " << endl
<< "Unknown surfaceTensionModel type "
<< modelType << nl << nl
<< "Valid surfaceTensionModel types :" << endl
<< multiphaseConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -35,20 +35,19 @@ Foam::aspectRatioModel::New
const phasePair& pair
)
{
word aspectRatioModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting aspectRatioModel for "
<< pair << ": " << aspectRatioModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(aspectRatioModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown aspectRatioModelType type "
<< aspectRatioModelType << endl << endl
<< "Valid aspectRatioModel types are : " << endl
<< "Unknown aspectRatioModel type "
<< modelType << nl << nl
<< "Valid aspectRatioModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -34,20 +34,19 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New
const phasePair& pair
)
{
word dragModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting dragModel for "
<< pair << ": " << dragModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(dragModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown dragModelType type "
<< dragModelType << endl << endl
<< "Valid dragModel types are : " << endl
<< "Unknown dragModel type "
<< modelType << nl << nl
<< "Valid dragModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -34,20 +34,19 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New
const phasePair& pair
)
{
word heatTransferModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting heatTransferModel for "
<< pair << ": " << heatTransferModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(heatTransferModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown heatTransferModelType type "
<< heatTransferModelType << endl << endl
<< "Valid heatTransferModel types are : " << endl
<< "Unknown heatTransferModel type "
<< modelType << nl << nl
<< "Valid heatTransferModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -34,20 +34,19 @@ Foam::autoPtr<Foam::liftModel> Foam::liftModel::New
const phasePair& pair
)
{
word liftModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting liftModel for "
<< pair << ": " << liftModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(liftModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown liftModelType type "
<< liftModelType << endl << endl
<< "Valid liftModel types are : " << endl
<< "Unknown liftModel type "
<< modelType << nl << nl
<< "Valid liftModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -35,20 +35,19 @@ Foam::swarmCorrection::New
const phasePair& pair
)
{
word swarmCorrectionType(dict.lookup("type"));
const word correctionType(dict.lookup("type"));
Info<< "Selecting swarmCorrection for "
<< pair << ": " << swarmCorrectionType << endl;
<< pair << ": " << correctionType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(swarmCorrectionType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(correctionType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown swarmCorrectionType type "
<< swarmCorrectionType << endl << endl
<< "Valid swarmCorrection types are : " << endl
<< "Unknown swarmCorrection type "
<< correctionType << nl << nl
<< "Valid swarmCorrection types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -35,20 +35,19 @@ Foam::turbulentDispersionModel::New
const phasePair& pair
)
{
word turbulentDispersionModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting turbulentDispersionModel for "
<< pair << ": " << turbulentDispersionModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(turbulentDispersionModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown turbulentDispersionModelType type "
<< turbulentDispersionModelType << endl << endl
<< "Valid turbulentDispersionModel types are : " << endl
<< "Unknown turbulentDispersionModel type "
<< modelType << nl << nl
<< "Valid turbulentDispersionModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -34,20 +34,19 @@ Foam::autoPtr<Foam::virtualMassModel> Foam::virtualMassModel::New
const phasePair& pair
)
{
word virtualMassModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting virtualMassModel for "
<< pair << ": " << virtualMassModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(virtualMassModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown virtualMassModelType type "
<< virtualMassModelType << endl << endl
<< "Valid virtualMassModel types are : " << endl
<< "Unknown virtualMassModel type "
<< modelType << nl << nl
<< "Valid virtualMassModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -34,20 +34,19 @@ Foam::autoPtr<Foam::wallDampingModel> Foam::wallDampingModel::New
const phasePair& pair
)
{
word wallDampingModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting wallDampingModel for "
<< pair << ": " << wallDampingModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(wallDampingModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown wallDampingModelType type "
<< wallDampingModelType << endl << endl
<< "Valid wallDampingModel types are : " << endl
<< "Unknown wallDampingModel type "
<< modelType << nl << nl
<< "Valid wallDampingModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -34,20 +34,19 @@ Foam::autoPtr<Foam::wallLubricationModel> Foam::wallLubricationModel::New
const phasePair& pair
)
{
word wallLubricationModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting wallLubricationModel for "
<< pair << ": " << wallLubricationModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(wallLubricationModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown wallLubricationModelType type "
<< wallLubricationModelType << endl << endl
<< "Valid wallLubricationModel types are : " << endl
<< "Unknown wallLubricationModel type "
<< modelType << nl << nl
<< "Valid wallLubricationModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -33,20 +33,19 @@ Foam::autoPtr<Foam::blendingMethod> Foam::blendingMethod::New
const wordList& phaseNames
)
{
word blendingMethodType(dict.lookup("type"));
const word methodType(dict.lookup("type"));
Info<< "Selecting " << dict.dictName() << " blending method: "
<< blendingMethodType << endl;
<< methodType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(blendingMethodType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown blendingMethodType type "
<< blendingMethodType << endl << endl
<< "Valid blendingMethod types are : " << endl
<< "Unknown blendingMethod type "
<< methodType << nl << nl
<< "Valid blendingMethod types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -33,32 +33,28 @@ Foam::autoPtr<Foam::diameterModel> Foam::diameterModel::New
const phaseModel& phase
)
{
word diameterModelType
(
dict.lookup("diameterModel")
);
const word modelType(dict.lookup("diameterModel"));
Info << "Selecting diameterModel for phase "
<< phase.name()
<< ": "
<< diameterModelType << endl;
<< modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(diameterModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown diameterModelType type "
<< diameterModelType << endl << endl
<< "Valid diameterModel types are : " << endl
<< "Unknown diameterModel type "
<< modelType << nl << nl
<< "Valid diameterModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()
(
dict.optionalSubDict(diameterModelType + "Coeffs"),
dict.optionalSubDict(modelType + "Coeffs"),
phase
);
}

View File

@ -35,20 +35,19 @@ Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::New
const label index
)
{
word phaseModelType(fluid.subDict(phaseName).lookup("type"));
const word modelType(fluid.subDict(phaseName).lookup("type"));
Info<< "Selecting phaseModel for "
<< phaseName << ": " << phaseModelType << endl;
<< phaseName << ": " << modelType << endl;
phaseSystemConstructorTable::iterator cstrIter =
phaseSystemConstructorTablePtr_->find(phaseModelType);
auto cstrIter = phaseSystemConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown phaseModelType type "
<< phaseModelType << endl << endl
<< "Valid phaseModel types are : " << endl
<< "Unknown phaseModel type "
<< modelType << nl << nl
<< "Valid phaseModel types :" << endl
<< phaseSystemConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -32,7 +32,7 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New
const fvMesh& mesh
)
{
const word multiphaseSystemType
const word systemType
(
IOdictionary
(
@ -48,18 +48,16 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New
).lookup("type")
);
Info<< "Selecting multiphaseSystem "
<< multiphaseSystemType << endl;
Info<< "Selecting multiphaseSystem " << systemType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(multiphaseSystemType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(systemType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown multiphaseSystemType type "
<< multiphaseSystemType << endl << endl
<< "Valid multiphaseSystem types are : " << endl
<< "Unknown multiphaseSystem type "
<< systemType << nl << nl
<< "Valid multiphaseSystem types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -33,20 +33,18 @@ Foam::wallBoilingModels::departureDiameterModel::New
const dictionary& dict
)
{
word departureDiameterModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting departureDiameterModel: "
<< departureDiameterModelType << endl;
Info<< "Selecting departureDiameterModel: " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(departureDiameterModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown departureDiameterModelType type "
<< departureDiameterModelType << endl << endl
<< "Valid departureDiameterModel types are : " << endl
<< "Unknown departureDiameterModel type "
<< modelType << nl << nl
<< "Valid departureDiameterModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -33,20 +33,18 @@ Foam::wallBoilingModels::departureFrequencyModel::New
const dictionary& dict
)
{
word departureFrequencyModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting departureFrequencyModel: "
<< departureFrequencyModelType << endl;
Info<< "Selecting departureFrequencyModel: " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(departureFrequencyModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown departureFrequencyModelType type "
<< departureFrequencyModelType << endl << endl
<< "Valid departureFrequencyModel types are : " << endl
<< "Unknown departureFrequencyModel type "
<< modelType << nl << nl
<< "Valid departureFrequencyModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -33,20 +33,18 @@ Foam::wallBoilingModels::nucleationSiteModel::New
const dictionary& dict
)
{
word nucleationSiteModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting nucleationSiteModel: "
<< nucleationSiteModelType << endl;
Info<< "Selecting nucleationSiteModel: " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(nucleationSiteModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown nucleationSiteModelType type "
<< nucleationSiteModelType << endl << endl
<< "Valid nucleationSiteModel types are : " << endl
<< "Unknown nucleationSiteModel type "
<< modelType << nl << nl
<< "Valid nucleationSiteModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -33,20 +33,18 @@ Foam::wallBoilingModels::partitioningModel::New
const dictionary& dict
)
{
word partitioningModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting partitioningModel: "
<< partitioningModelType << endl;
Info<< "Selecting partitioningModel: " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(partitioningModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown partitioningModelType type "
<< partitioningModelType << endl << endl
<< "Valid partitioningModel types are : " << endl
<< "Unknown partitioningModel type "
<< modelType << nl << nl
<< "Valid partitioningModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -33,23 +33,20 @@ Foam::kineticTheoryModels::conductivityModel::New
const dictionary& dict
)
{
word conductivityModelType(dict.lookup("conductivityModel"));
const word modelType(dict.lookup("conductivityModel"));
Info<< "Selecting conductivityModel "
<< conductivityModelType << endl;
Info<< "Selecting conductivityModel " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(conductivityModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalError
<< "conductivityModel::New(const dictionary&) : " << endl
<< " unknown conductivityModelType type "
<< conductivityModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid conductivityModelType types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError);
FatalErrorInFunction
<< "Unknown conductivityModel type "
<< modelType << nl << nl
<< "Valid conductivityModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<conductivityModel>(cstrIter()(dict));

View File

@ -33,24 +33,20 @@ Foam::kineticTheoryModels::frictionalStressModel::New
const dictionary& dict
)
{
word frictionalStressModelType(dict.lookup("frictionalStressModel"));
const word modelType(dict.lookup("frictionalStressModel"));
Info<< "Selecting frictionalStressModel "
<< frictionalStressModelType << endl;
Info<< "Selecting frictionalStressModel " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(frictionalStressModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalError
<< "frictionalStressModel::New(const dictionary&) : " << endl
<< " unknown frictionalStressModelType type "
<< frictionalStressModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid frictionalStressModelType types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc()
<< abort(FatalError);
FatalErrorInFunction
<< "Unknown frictionalStressModel type "
<< modelType << nl << nl
<< "Valid frictionalStressModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<frictionalStressModel>(cstrIter()(dict));

View File

@ -33,24 +33,20 @@ Foam::kineticTheoryModels::granularPressureModel::New
const dictionary& dict
)
{
word granularPressureModelType(dict.lookup("granularPressureModel"));
const word modelType(dict.lookup("granularPressureModel"));
Info<< "Selecting granularPressureModel "
<< granularPressureModelType << endl;
Info<< "Selecting granularPressureModel " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(granularPressureModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalError
<< "granularPressureModel::New(const dictionary&) : " << endl
<< " unknown granularPressureModelType type "
<< granularPressureModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid granularPressureModelType types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc()
<< abort(FatalError);
FatalErrorInFunction
<< "Unknown granularPressureModel type "
<< modelType << nl << nl
<< "Valid granularPressureModel types : " << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<granularPressureModel>(cstrIter()(dict));

View File

@ -33,24 +33,20 @@ Foam::kineticTheoryModels::radialModel::New
const dictionary& dict
)
{
word radialModelType(dict.lookup("radialModel"));
const word modelType(dict.lookup("radialModel"));
Info<< "Selecting radialModel "
<< radialModelType << endl;
Info<< "Selecting radialModel " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(radialModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalError
<< "radialModel::New(const dictionary&) : " << endl
<< " unknown radialModelType type "
<< radialModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid radialModelType types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc()
<< abort(FatalError);
FatalErrorInFunction
<< "Unknown radialModel type "
<< modelType << nl << nl
<< "Valid radialModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<radialModel>(cstrIter()(dict));

View File

@ -33,23 +33,20 @@ Foam::kineticTheoryModels::viscosityModel::New
const dictionary& dict
)
{
word viscosityModelType(dict.lookup("viscosityModel"));
const word modelType(dict.lookup("viscosityModel"));
Info<< "Selecting viscosityModel "
<< viscosityModelType << endl;
Info<< "Selecting viscosityModel " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(viscosityModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalError
<< "viscosityModel::New(const dictionary&) : " << endl
<< " unknown viscosityModelType type "
<< viscosityModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid viscosityModelType types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError);
FatalErrorInFunction
<< "Unknown viscosityModel type "
<< modelType << nl << nl
<< "Valid viscosityModel types :" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<viscosityModel>(cstrIter()(dict));

View File

@ -50,15 +50,14 @@ Foam::diameterModels::IATEsource::New
const dictionary& dict
)
{
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(type);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(type);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown IATE source type "
<< type << nl << nl
<< "Valid IATE source types : " << endl
<< "Valid IATE source types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -32,7 +32,7 @@ Foam::autoPtr<Foam::twoPhaseSystem> Foam::twoPhaseSystem::New
const fvMesh& mesh
)
{
const word twoPhaseSystemType
const word systemType
(
IOdictionary
(
@ -48,18 +48,16 @@ Foam::autoPtr<Foam::twoPhaseSystem> Foam::twoPhaseSystem::New
).lookup("type")
);
Info<< "Selecting twoPhaseSystem "
<< twoPhaseSystemType << endl;
Info<< "Selecting twoPhaseSystem " << systemType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(twoPhaseSystemType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(systemType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown twoPhaseSystemType type "
<< twoPhaseSystemType << endl << endl
<< "Valid twoPhaseSystem types are : " << endl
<< "Unknown twoPhaseSystem type "
<< systemType << nl << nl
<< "Valid twoPhaseSystem types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -35,20 +35,19 @@ Foam::aspectRatioModel::New
const phasePair& pair
)
{
word aspectRatioModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting aspectRatioModel for "
<< pair << ": " << aspectRatioModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(aspectRatioModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown aspectRatioModelType type "
<< aspectRatioModelType << endl << endl
<< "Valid aspectRatioModel types are : " << endl
<< "Unknown aspectRatioModel type "
<< modelType << nl << nl
<< "Valid aspectRatioModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -34,20 +34,19 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New
const phasePair& pair
)
{
word dragModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting dragModel for "
<< pair << ": " << dragModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(dragModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown dragModelType type "
<< dragModelType << endl << endl
<< "Valid dragModel types are : " << endl
<< "Unknown dragModel type "
<< modelType << nl << nl
<< "Valid dragModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -34,20 +34,19 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New
const phasePair& pair
)
{
word heatTransferModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting heatTransferModel for "
<< pair << ": " << heatTransferModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(heatTransferModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown heatTransferModelType type "
<< heatTransferModelType << endl << endl
<< "Valid heatTransferModel types are : " << endl
<< "Unknown heatTransferModel type "
<< modelType << nl << nl
<< "Valid heatTransferModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -34,20 +34,19 @@ Foam::autoPtr<Foam::liftModel> Foam::liftModel::New
const phasePair& pair
)
{
word liftModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting liftModel for "
<< pair << ": " << liftModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(liftModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown liftModelType type "
<< liftModelType << endl << endl
<< "Valid liftModel types are : " << endl
<< "Unknown liftModel type "
<< modelType << nl << nl
<< "Valid liftModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -35,20 +35,19 @@ Foam::swarmCorrection::New
const phasePair& pair
)
{
word swarmCorrectionType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting swarmCorrection for "
<< pair << ": " << swarmCorrectionType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(swarmCorrectionType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown swarmCorrectionType type "
<< swarmCorrectionType << endl << endl
<< "Valid swarmCorrection types are : " << endl
<< "Unknown swarmCorrection type "
<< modelType << nl << nl
<< "Valid swarmCorrection types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -35,20 +35,19 @@ Foam::turbulentDispersionModel::New
const phasePair& pair
)
{
word turbulentDispersionModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting turbulentDispersionModel for "
<< pair << ": " << turbulentDispersionModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(turbulentDispersionModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown turbulentDispersionModelType type "
<< turbulentDispersionModelType << endl << endl
<< "Valid turbulentDispersionModel types are : " << endl
<< "Unknown turbulentDispersionModel type "
<< modelType << nl << nl
<< "Valid turbulentDispersionModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -34,20 +34,19 @@ Foam::autoPtr<Foam::virtualMassModel> Foam::virtualMassModel::New
const phasePair& pair
)
{
word virtualMassModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting virtualMassModel for "
<< pair << ": " << virtualMassModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(virtualMassModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown virtualMassModelType type "
<< virtualMassModelType << endl << endl
<< "Valid virtualMassModel types are : " << endl
<< "Unknown virtualMassModel type "
<< modelType << nl << nl
<< "Valid virtualMassModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -34,20 +34,19 @@ Foam::autoPtr<Foam::wallLubricationModel> Foam::wallLubricationModel::New
const phasePair& pair
)
{
word wallLubricationModelType(dict.lookup("type"));
const word modelType(dict.lookup("type"));
Info<< "Selecting wallLubricationModel for "
<< pair << ": " << wallLubricationModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(wallLubricationModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown wallLubricationModelType type "
<< wallLubricationModelType << endl << endl
<< "Valid wallLubricationModel types are : " << endl
<< "Unknown wallLubricationModel type "
<< modelType << nl << nl
<< "Valid wallLubricationModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -33,23 +33,20 @@ Foam::kineticTheoryModels::conductivityModel::New
const dictionary& dict
)
{
word conductivityModelType(dict.lookup("conductivityModel"));
const word modelType(dict.lookup("conductivityModel"));
Info<< "Selecting conductivityModel "
<< conductivityModelType << endl;
Info<< "Selecting conductivityModel " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(conductivityModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalError
<< "conductivityModel::New(const dictionary&) : " << endl
<< " unknown conductivityModelType type "
<< conductivityModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid conductivityModelType types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError);
FatalErrorInFunction
<< "Unknown conductivityModel type "
<< modelType << nl << nl
<< "Valid conductivityModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<conductivityModel>(cstrIter()(dict));

View File

@ -33,24 +33,20 @@ Foam::kineticTheoryModels::frictionalStressModel::New
const dictionary& dict
)
{
word frictionalStressModelType(dict.lookup("frictionalStressModel"));
const word modelType(dict.lookup("frictionalStressModel"));
Info<< "Selecting frictionalStressModel "
<< frictionalStressModelType << endl;
Info<< "Selecting frictionalStressModel " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(frictionalStressModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalError
<< "frictionalStressModel::New(const dictionary&) : " << endl
<< " unknown frictionalStressModelType type "
<< frictionalStressModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid frictionalStressModelType types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc()
<< abort(FatalError);
FatalErrorInFunction
<< "Unknown frictionalStressModel type "
<< modelType << nl << nl
<< "Valid frictionalStressModelType types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<frictionalStressModel>(cstrIter()(dict));

View File

@ -33,24 +33,20 @@ Foam::kineticTheoryModels::granularPressureModel::New
const dictionary& dict
)
{
word granularPressureModelType(dict.lookup("granularPressureModel"));
const word modelType(dict.lookup("granularPressureModel"));
Info<< "Selecting granularPressureModel "
<< granularPressureModelType << endl;
Info<< "Selecting granularPressureModel " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(granularPressureModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalError
<< "granularPressureModel::New(const dictionary&) : " << endl
<< " unknown granularPressureModelType type "
<< granularPressureModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid granularPressureModelType types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc()
<< abort(FatalError);
FatalErrorInFunction
<< "Unknown granularPressureModel type "
<< modelType << nl << nl
<< "Valid granularPressureModel types :" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<granularPressureModel>(cstrIter()(dict));

View File

@ -33,24 +33,20 @@ Foam::kineticTheoryModels::radialModel::New
const dictionary& dict
)
{
word radialModelType(dict.lookup("radialModel"));
const word modelType(dict.lookup("radialModel"));
Info<< "Selecting radialModel "
<< radialModelType << endl;
Info<< "Selecting radialModel " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(radialModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalError
<< "radialModel::New(const dictionary&) : " << endl
<< " unknown radialModelType type "
<< radialModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid radialModelType types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc()
<< abort(FatalError);
FatalErrorInFunction
<< "Unknown radialModel type "
<< modelType << nl << nl
<< "Valid radialModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<radialModel>(cstrIter()(dict));

View File

@ -33,23 +33,20 @@ Foam::kineticTheoryModels::viscosityModel::New
const dictionary& dict
)
{
word viscosityModelType(dict.lookup("viscosityModel"));
const word modelName(dict.lookup("viscosityModel"));
Info<< "Selecting viscosityModel "
<< viscosityModelType << endl;
Info<< "Selecting viscosityModel " << modelName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(viscosityModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelName);
if (!cstrIter.found())
{
FatalError
<< "viscosityModel::New(const dictionary&) : " << endl
<< " unknown viscosityModelType type "
<< viscosityModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid viscosityModelType types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError);
FatalErrorInFunction
<< "Unknown viscosityModel type "
<< modelName << nl << nl
<< "Valid viscosityModel types :" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<viscosityModel>(cstrIter()(dict));

View File

@ -33,20 +33,19 @@ Foam::autoPtr<Foam::blendingMethod> Foam::blendingMethod::New
const wordList& phaseNames
)
{
word blendingMethodType(dict.lookup("type"));
const word methodName(dict.lookup("type"));
Info<< "Selecting " << dict.dictName() << " blending method: "
<< blendingMethodType << endl;
<< methodName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(blendingMethodType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodName);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown blendingMethodType type "
<< blendingMethodType << endl << endl
<< "Valid blendingMethod types are : " << endl
<< "Unknown blendingMethod type "
<< methodName << nl << nl
<< "Valid blendingMethod types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -51,15 +51,14 @@ Foam::diameterModels::IATEsource::New
const dictionary& dict
)
{
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(type);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(type);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown IATE source type "
<< type << nl << nl
<< "Valid IATE source types : " << endl
<< "Valid IATE source types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -33,32 +33,28 @@ Foam::autoPtr<Foam::diameterModel> Foam::diameterModel::New
const phaseModel& phase
)
{
word diameterModelType
(
dict.lookup("diameterModel")
);
const word modelType(dict.lookup("diameterModel"));
Info << "Selecting diameterModel for phase "
<< phase.name()
<< ": "
<< diameterModelType << endl;
<< modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(diameterModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown diameterModelType type "
<< diameterModelType << endl << endl
<< "Valid diameterModel types are : " << endl
<< "Unknown diameterModel type "
<< modelType << nl << nl
<< "Valid diameterModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()
(
dict.optionalSubDict(diameterModelType + "Coeffs"),
dict.optionalSubDict(modelType + "Coeffs"),
phase
);
}

View File

@ -35,10 +35,6 @@ defineRunTimeSelectionTable(cellSizeAndAlignmentControl, dictionary);
}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cellSizeAndAlignmentControl::cellSizeAndAlignmentControl
@ -57,7 +53,7 @@ Foam::cellSizeAndAlignmentControl::cellSizeAndAlignmentControl
controlFunctionDict.lookupOrDefault<Switch>
(
"forceInitialPointInsertion",
"off"
Switch::OFF
)
),
name_(name)
@ -76,28 +72,20 @@ Foam::cellSizeAndAlignmentControl::New
const scalar& defaultCellSize
)
{
word cellSizeAndAlignmentControlTypeName
(
controlFunctionDict.lookup("type")
);
const word controlType(controlFunctionDict.lookup("type"));
Info<< indent << "Selecting cellSizeAndAlignmentControl "
<< cellSizeAndAlignmentControlTypeName << endl;
<< controlType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find
(
cellSizeAndAlignmentControlTypeName
);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(controlType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown cellSizeAndAlignmentControl type "
<< cellSizeAndAlignmentControlTypeName
<< endl << endl
<< "Valid cellSizeAndAlignmentControl types are :" << endl
<< dictionaryConstructorTablePtr_->toc()
<< controlType << nl << nl
<< "Valid cellSizeAndAlignmentControl types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -121,8 +109,4 @@ Foam::cellSizeAndAlignmentControl::~cellSizeAndAlignmentControl()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -32,10 +32,11 @@ namespace Foam
{
defineTypeNameAndDebug(cellSizeFunction, 0);
defineRunTimeSelectionTable(cellSizeFunction, dictionary);
scalar cellSizeFunction::snapToSurfaceTol_ = 1e-10;
}
Foam::scalar Foam::cellSizeFunction::snapToSurfaceTol_ = 1e-10;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cellSizeFunction::cellSizeFunction
@ -122,25 +123,23 @@ Foam::autoPtr<Foam::cellSizeFunction> Foam::cellSizeFunction::New
const labelList regionIndices
)
{
word cellSizeFunctionTypeName
const word functionName
(
cellSizeFunctionDict.lookup("cellSizeFunction")
);
Info<< indent << "Selecting cellSizeFunction " << cellSizeFunctionTypeName
<< endl;
Info<< indent << "Selecting cellSizeFunction "
<< functionName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(cellSizeFunctionTypeName);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionName);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown cellSizeFunction type "
<< cellSizeFunctionTypeName
<< endl << endl
<< "Valid cellSizeFunction types are :" << endl
<< dictionaryConstructorTablePtr_->toc()
<< functionName << nl << nl
<< "Valid cellSizeFunction types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -60,25 +60,23 @@ Foam::autoPtr<Foam::cellSizeCalculationType> Foam::cellSizeCalculationType::New
const scalar& defaultCellSize
)
{
word cellSizeCalculationTypeTypeName
const word calculationType
(
cellSizeCalculationTypeDict.lookup("cellSizeCalculationType")
);
Info<< indent << "Selecting cellSizeCalculationType "
<< cellSizeCalculationTypeTypeName << endl;
<< calculationType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(cellSizeCalculationTypeTypeName);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(calculationType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown cellSizeCalculationType type "
<< cellSizeCalculationTypeTypeName
<< endl << endl
<< "Valid cellSizeCalculationType types are :" << endl
<< dictionaryConstructorTablePtr_->toc()
<< calculationType << nl << nl
<< "Valid cellSizeCalculationType types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -34,6 +34,7 @@ namespace Foam
defineRunTimeSelectionTable(surfaceCellSizeFunction, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceCellSizeFunction::surfaceCellSizeFunction
@ -64,25 +65,23 @@ Foam::autoPtr<Foam::surfaceCellSizeFunction> Foam::surfaceCellSizeFunction::New
const scalar& defaultCellSize
)
{
word surfaceCellSizeFunctionTypeName
const word functionName
(
surfaceCellSizeFunctionDict.lookup("surfaceCellSizeFunction")
);
Info<< indent << "Selecting surfaceCellSizeFunction "
<< surfaceCellSizeFunctionTypeName << endl;
<< functionName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(surfaceCellSizeFunctionTypeName);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionName);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown surfaceCellSizeFunction type "
<< surfaceCellSizeFunctionTypeName
<< endl << endl
<< "Valid surfaceCellSizeFunction types are :" << endl
<< dictionaryConstructorTablePtr_->toc()
<< functionName << nl << nl
<< "Valid surfaceCellSizeFunction types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -26,20 +26,17 @@ License
#include "faceAreaWeightModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(faceAreaWeightModel, 0);
defineRunTimeSelectionTable(faceAreaWeightModel, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
faceAreaWeightModel::faceAreaWeightModel
Foam::faceAreaWeightModel::faceAreaWeightModel
(
const word& type,
const dictionary& relaxationDict
@ -52,30 +49,24 @@ faceAreaWeightModel::faceAreaWeightModel
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
autoPtr<faceAreaWeightModel> faceAreaWeightModel::New
Foam::autoPtr<Foam::faceAreaWeightModel> Foam::faceAreaWeightModel::New
(
const dictionary& relaxationDict
)
{
word faceAreaWeightModelTypeName
(
relaxationDict.lookup("faceAreaWeightModel")
);
const word modelType(relaxationDict.lookup("faceAreaWeightModel"));
Info<< nl << "Selecting faceAreaWeightModel "
<< faceAreaWeightModelTypeName << endl;
Info<< nl << "Selecting faceAreaWeightModel " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(faceAreaWeightModelTypeName);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown faceAreaWeightModel type "
<< faceAreaWeightModelTypeName
<< endl << endl
<< "Valid faceAreaWeightModel types are :" << endl
<< dictionaryConstructorTablePtr_->toc()
<< modelType << nl << nl
<< "Valid faceAreaWeightModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -85,12 +76,8 @@ autoPtr<faceAreaWeightModel> faceAreaWeightModel::New
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
faceAreaWeightModel::~faceAreaWeightModel()
Foam::faceAreaWeightModel::~faceAreaWeightModel()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -26,20 +26,17 @@ License
#include "initialPointsMethod.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(initialPointsMethod, 0);
defineRunTimeSelectionTable(initialPointsMethod, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
initialPointsMethod::initialPointsMethod
Foam::initialPointsMethod::initialPointsMethod
(
const word& type,
const dictionary& initialPointsDict,
@ -73,7 +70,7 @@ initialPointsMethod::initialPointsMethod
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
autoPtr<initialPointsMethod> initialPointsMethod::New
Foam::autoPtr<Foam::initialPointsMethod> Foam::initialPointsMethod::New
(
const dictionary& initialPointsDict,
const Time& runTime,
@ -83,25 +80,20 @@ autoPtr<initialPointsMethod> initialPointsMethod::New
const autoPtr<backgroundMeshDecomposition>& decomposition
)
{
word initialPointsMethodTypeName
(
initialPointsDict.lookup("initialPointsMethod")
);
const word methodName(initialPointsDict.lookup("initialPointsMethod"));
Info<< nl << "Selecting initialPointsMethod "
<< initialPointsMethodTypeName << endl;
<< methodName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(initialPointsMethodTypeName);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodName);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown initialPointsMethod type "
<< initialPointsMethodTypeName
<< endl << endl
<< "Valid initialPointsMethod types are :" << endl
<< dictionaryConstructorTablePtr_->toc()
<< methodName << nl << nl
<< "Valid initialPointsMethod types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -123,12 +115,8 @@ autoPtr<initialPointsMethod> initialPointsMethod::New
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
initialPointsMethod::~initialPointsMethod()
Foam::initialPointsMethod::~initialPointsMethod()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -26,20 +26,18 @@ License
#include "relaxationModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(relaxationModel, 0);
defineRunTimeSelectionTable(relaxationModel, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
relaxationModel::relaxationModel
Foam::relaxationModel::relaxationModel
(
const word& type,
const dictionary& relaxationDict,
@ -54,31 +52,25 @@ relaxationModel::relaxationModel
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
autoPtr<relaxationModel> relaxationModel::New
Foam::autoPtr<Foam::relaxationModel> Foam::relaxationModel::New
(
const dictionary& relaxationDict,
const Time& runTime
)
{
word relaxationModelTypeName
(
relaxationDict.lookup("relaxationModel")
);
const word modelType(relaxationDict.lookup("relaxationModel"));
Info<< nl << "Selecting relaxationModel "
<< relaxationModelTypeName << endl;
Info<< nl << "Selecting relaxationModel " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(relaxationModelTypeName);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown relaxationModel type "
<< relaxationModelTypeName
<< endl << endl
<< "Valid relaxationModel types are :" << endl
<< dictionaryConstructorTablePtr_->toc()
<< modelType << nl << nl
<< "Valid relaxationModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -88,12 +80,8 @@ autoPtr<relaxationModel> relaxationModel::New
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
relaxationModel::~relaxationModel()
Foam::relaxationModel::~relaxationModel()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -43,17 +43,16 @@ Foam::searchableSurfaceFeatures::New
const dictionary& dict
)
{
word searchableSurfaceFeaturesType = surface.type() + "Features";
const word featuresType = surface.type() + "Features";
dictConstructorTable::iterator cstrIter =
dictConstructorTablePtr_->find(searchableSurfaceFeaturesType);
auto cstrIter = dictConstructorTablePtr_->cfind(featuresType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown searchableSurfaceFeatures type "
<< searchableSurfaceFeaturesType << endl << endl
<< "Valid searchableSurfaceFeatures types : " << endl
<< featuresType << nl << nl
<< "Valid searchableSurfaceFeatures types :" << endl
<< dictConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -68,15 +68,14 @@ Foam::autoPtr<Foam::faceSelection> Foam::faceSelection::New
{
const word sampleType(dict.lookup("type"));
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(sampleType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(sampleType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown faceSelection type "
<< sampleType << nl << nl
<< "Valid faceSelection types : " << endl
<< "Valid faceSelection types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -34,8 +34,7 @@ Foam::autoPtr<Foam::helpType> Foam::helpType::New
{
Info<< "Selecting helpType " << helpTypeName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(helpTypeName);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(helpTypeName);
if (!cstrIter.found())
{

View File

@ -25,34 +25,27 @@ License
#include "tabulatedWallFunction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace tabulatedWallFunctions
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
autoPtr<tabulatedWallFunction> tabulatedWallFunction::New
Foam::autoPtr<Foam::tabulatedWallFunctions::tabulatedWallFunction>
Foam::tabulatedWallFunctions::tabulatedWallFunction::New
(
const dictionary& dict,
const polyMesh& mesh
)
{
word twfTypeName = dict.lookup("tabulatedWallFunction");
const word functionName = dict.lookup("tabulatedWallFunction");
Info<< "Selecting tabulatedWallFunction " << twfTypeName << endl;
Info<< "Selecting tabulatedWallFunction " << functionName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(twfTypeName);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionName);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown tabulatedWallFunction type " << twfTypeName
<< "Unknown tabulatedWallFunction type " << functionName
<< nl << nl << "Valid tabulatedWallFunction types are:" << nl
<< dictionaryConstructorTablePtr_->toc()
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -60,9 +53,4 @@ autoPtr<tabulatedWallFunction> tabulatedWallFunction::New
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace tabulatedWallFunctions
} // End namespace Foam
// ************************************************************************* //

View File

@ -64,15 +64,14 @@ Foam::searchableSurfaceModifier::New
const dictionary& dict
)
{
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(type);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(type);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown searchableSurfaceModifier type "
<< type << nl << nl
<< "Valid searchableSurfaceModifier types : " << endl
<< "Valid searchableSurfaceModifier types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -33,18 +33,17 @@ Foam::autoPtr<Foam::ODESolver> Foam::ODESolver::New
const dictionary& dict
)
{
word ODESolverTypeName(dict.lookup("solver"));
Info<< "Selecting ODE solver " << ODESolverTypeName << endl;
const word solverType(dict.lookup("solver"));
Info<< "Selecting ODE solver " << solverType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(ODESolverTypeName);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown ODESolver type "
<< ODESolverTypeName << nl << nl
<< "Valid ODESolvers are : " << endl
<< solverType << nl << nl
<< "Valid ODESolver types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -62,13 +62,13 @@ Foam::autoPtr<Foam::token::compound> Foam::token::compound::New
Istream& is
)
{
IstreamConstructorTable::iterator cstrIter =
IstreamConstructorTablePtr_->find(compoundType);
auto cstrIter = IstreamConstructorTablePtr_->cfind(compoundType);
if (!cstrIter.found())
{
FatalIOErrorInFunction(is)
<< "Unknown compound type " << compoundType << nl << nl
<< "Unknown compound type "
<< compoundType << nl << nl
<< "Valid compound types:" << endl
<< IstreamConstructorTablePtr_->sortedToc()
<< abort(FatalIOError);

View File

@ -97,8 +97,8 @@ bool Foam::functionEntry::execute
return true;
}
executedictionaryIstreamMemberFunctionTable::iterator mfIter =
executedictionaryIstreamMemberFunctionTablePtr_->find(functionName);
auto mfIter =
executedictionaryIstreamMemberFunctionTablePtr_->cfind(functionName);
if (!mfIter.found())
{
@ -106,8 +106,8 @@ bool Foam::functionEntry::execute
<< "Unknown functionEntry '" << functionName
<< "' in " << is.name() << " near line " << is.lineNumber()
<< nl << nl
<< "Valid functionEntries are :" << endl
<< executedictionaryIstreamMemberFunctionTablePtr_->toc()
<< "Valid functionEntries :" << endl
<< executedictionaryIstreamMemberFunctionTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -136,8 +136,11 @@ bool Foam::functionEntry::execute
return true;
}
executeprimitiveEntryIstreamMemberFunctionTable::iterator mfIter =
executeprimitiveEntryIstreamMemberFunctionTablePtr_->find(functionName);
auto mfIter =
executeprimitiveEntryIstreamMemberFunctionTablePtr_->cfind
(
functionName
);
if (!mfIter.found())
{
@ -145,8 +148,8 @@ bool Foam::functionEntry::execute
<< "Unknown functionEntry '" << functionName
<< "' in " << is.name() << " near line " << is.lineNumber()
<< nl << nl
<< "Valid functionEntries are :" << endl
<< executeprimitiveEntryIstreamMemberFunctionTablePtr_->toc()
<< "Valid functionEntries :" << endl
<< executeprimitiveEntryIstreamMemberFunctionTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -100,15 +100,14 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
<< exit(FatalError);
}
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(functionType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown function type "
<< functionType << nl << nl
<< "Valid functions are : " << nl
<< "Valid function types :" << nl
<< dictionaryConstructorTablePtr_->sortedToc() << endl
<< exit(FatalError);
}

View File

@ -91,8 +91,8 @@ Foam::pointPatchField<Type>::NewCalculatedType
const pointPatchField<Type2>& pf
)
{
typename pointPatchConstructorTable::iterator patchTypeCstrIter =
pointPatchConstructorTablePtr_->find(pf.patch().type());
auto patchTypeCstrIter =
pointPatchConstructorTablePtr_->cfind(pf.patch().type());
if (patchTypeCstrIter.found())
{

View File

@ -39,15 +39,14 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
InfoInFunction << "Constructing pointPatchField<Type>" << endl;
}
typename pointPatchConstructorTable::iterator cstrIter =
pointPatchConstructorTablePtr_->find(patchFieldType);
auto cstrIter = pointPatchConstructorTablePtr_->cfind(patchFieldType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown patchFieldType type "
<< patchFieldType << nl << nl
<< "Valid patchField types are :" << endl
<< "Valid patchField types :" << endl
<< pointPatchConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -63,8 +62,8 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
if (pfPtr().constraintType() != p.constraintType())
{
// Use default constraint type
typename pointPatchConstructorTable::iterator patchTypeCstrIter =
pointPatchConstructorTablePtr_->find(p.type());
auto patchTypeCstrIter =
pointPatchConstructorTablePtr_->cfind(p.type());
if (!patchTypeCstrIter.found())
{
@ -117,14 +116,13 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
word patchFieldType(dict.lookup("type"));
typename dictionaryConstructorTable::iterator cstrIter
= dictionaryConstructorTablePtr_->find(patchFieldType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType);
if (!cstrIter.found())
{
if (!disallowGenericPointPatchField)
{
cstrIter = dictionaryConstructorTablePtr_->find("generic");
cstrIter = dictionaryConstructorTablePtr_->cfind("generic");
}
if (!cstrIter.found())
@ -134,7 +132,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
dict
) << "Unknown patchField type " << patchFieldType
<< " for patch type " << p.type() << nl << nl
<< "Valid patchField types are :" << endl
<< "Valid patchField types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
@ -157,8 +155,8 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
else
{
// Use default constraint type
typename dictionaryConstructorTable::iterator patchTypeCstrIter
= dictionaryConstructorTablePtr_->find(p.type());
auto patchTypeCstrIter
= dictionaryConstructorTablePtr_->cfind(p.type());
if (!patchTypeCstrIter.found())
{
@ -193,15 +191,14 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
InfoInFunction << "Constructing pointPatchField<Type>" << endl;
}
typename patchMapperConstructorTable::iterator cstrIter =
patchMapperConstructorTablePtr_->find(ptf.type());
auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type());
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown patchField type "
<< ptf.type() << nl << nl
<< "Valid patchField types are :" << endl
<< "Valid patchField types :" << endl
<< patchMapperConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -212,15 +212,14 @@ Foam::autoPtr<Foam::graph::writer> Foam::graph::writer::New
<< exit(FatalError);
}
wordConstructorTable::iterator cstrIter =
wordConstructorTablePtr_->find(graphFormat);
auto cstrIter = wordConstructorTablePtr_->cfind(graphFormat);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown graph format " << graphFormat
<< endl << endl
<< "Valid graph formats are : " << endl
<< "Unknown graph format "
<< graphFormat << nl << nl
<< "Valid graph formats :" << endl
<< wordConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -39,16 +39,14 @@ Foam::autoPtr<Foam::tableReader<Type>> Foam::tableReader<Type>::New
"openFoam"
);
typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_
->find(readerType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(readerType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown reader type " << readerType
<< nl << nl
<< "Valid reader types : " << nl
<< "Unknown reader type "
<< readerType << nl << nl
<< "Valid reader types :" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -78,8 +76,7 @@ void Foam::tableReader<Type>::write(Ostream& os) const
{
if (this->type() != "openFoam")
{
os.writeKeyword("readerType")
<< this->type() << token::END_STATEMENT << nl;
os.writeEntry("readerType", this->type());
}
}

View File

@ -27,23 +27,18 @@ License
#include "addToRunTimeSelectionTable.H"
#include "Time.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(interpolationWeights, 0);
defineRunTimeSelectionTable(interpolationWeights, word);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
interpolationWeights::interpolationWeights
(
const scalarField& samples
)
Foam::interpolationWeights::interpolationWeights(const scalarField& samples)
:
samples_(samples)
{}
@ -51,7 +46,7 @@ interpolationWeights::interpolationWeights
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
autoPtr<interpolationWeights> interpolationWeights::New
Foam::autoPtr<Foam::interpolationWeights> Foam::interpolationWeights::New
(
const word& type,
const scalarField& samples
@ -64,16 +59,14 @@ autoPtr<interpolationWeights> interpolationWeights::New
<< type << endl;
}
wordConstructorTable::iterator cstrIter =
wordConstructorTablePtr_->find(type);
auto cstrIter = wordConstructorTablePtr_->cfind(type);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown interpolationWeights type "
<< type
<< endl << endl
<< "Valid interpolationWeights types are :" << endl
<< type << nl << nl
<< "Valid interpolationWeights types :" << endl
<< wordConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -84,12 +77,8 @@ autoPtr<interpolationWeights> interpolationWeights::New
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
interpolationWeights::~interpolationWeights()
Foam::interpolationWeights::~interpolationWeights()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -35,14 +35,14 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
const dictionary& preconditionerDict
)
{
word preconditionerName = preconditionerDict.lookup("preconditioner");
const word preconditionerName = preconditionerDict.lookup("preconditioner");
if (sol.matrix().symmetric())
{
typename symMatrixConstructorTable::iterator constructorIter =
symMatrixConstructorTablePtr_->find(preconditionerName);
auto cstrIter =
symMatrixConstructorTablePtr_->cfind(preconditionerName);
if (!constructorIter.found())
if (!cstrIter.found())
{
FatalIOErrorInFunction
(
@ -50,13 +50,13 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
) << "Unknown symmetric matrix preconditioner "
<< preconditionerName << endl << endl
<< "Valid symmetric matrix preconditioners are :" << endl
<< symMatrixConstructorTablePtr_->toc()
<< symMatrixConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner>
(
constructorIter()
cstrIter()
(
sol,
preconditionerDict
@ -65,10 +65,10 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
}
else if (sol.matrix().asymmetric())
{
typename asymMatrixConstructorTable::iterator constructorIter =
asymMatrixConstructorTablePtr_->find(preconditionerName);
auto cstrIter =
asymMatrixConstructorTablePtr_->cfind(preconditionerName);
if (!constructorIter.found())
if (!cstrIter.found())
{
FatalIOErrorInFunction
(
@ -76,13 +76,13 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
) << "Unknown asymmetric matrix preconditioner "
<< preconditionerName << endl << endl
<< "Valid asymmetric matrix preconditioners are :" << endl
<< asymMatrixConstructorTablePtr_->toc()
<< asymMatrixConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner>
(
constructorIter()
cstrIter()
(
sol,
preconditionerDict

View File

@ -40,22 +40,21 @@ Foam::LduMatrix<Type, DType, LUType>::smoother::New
if (matrix.symmetric())
{
typename symMatrixConstructorTable::iterator constructorIter =
symMatrixConstructorTablePtr_->find(smootherName);
auto cstrIter = symMatrixConstructorTablePtr_->cfind(smootherName);
if (!constructorIter.found())
if (!cstrIter.found())
{
FatalIOErrorInFunction(smootherDict)
<< "Unknown symmetric matrix smoother " << smootherName
<< endl << endl
<< "Valid symmetric matrix smoothers are :" << endl
<< symMatrixConstructorTablePtr_->toc()
<< symMatrixConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<typename LduMatrix<Type, DType, LUType>::smoother>
(
constructorIter()
cstrIter()
(
fieldName,
matrix
@ -64,22 +63,21 @@ Foam::LduMatrix<Type, DType, LUType>::smoother::New
}
else if (matrix.asymmetric())
{
typename asymMatrixConstructorTable::iterator constructorIter =
asymMatrixConstructorTablePtr_->find(smootherName);
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(smootherName);
if (!constructorIter.found())
if (!cstrIter.found())
{
FatalIOErrorInFunction(smootherDict)
<< "Unknown asymmetric matrix smoother " << smootherName
<< endl << endl
<< "Valid asymmetric matrix smoothers are :" << endl
<< asymMatrixConstructorTablePtr_->toc()
<< asymMatrixConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<typename LduMatrix<Type, DType, LUType>::smoother>
(
constructorIter()
cstrIter()
(
fieldName,
matrix

View File

@ -37,7 +37,7 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New
const dictionary& solverDict
)
{
word solverName = solverDict.lookup("solver");
const word solverName = solverDict.lookup("solver");
if (matrix.diagonal())
{
@ -53,22 +53,21 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New
}
else if (matrix.symmetric())
{
typename symMatrixConstructorTable::iterator constructorIter =
symMatrixConstructorTablePtr_->find(solverName);
auto cstrIter = symMatrixConstructorTablePtr_->cfind(solverName);
if (!constructorIter.found())
if (!cstrIter.found())
{
FatalIOErrorInFunction(solverDict)
<< "Unknown symmetric matrix solver " << solverName
<< endl << endl
<< "Valid symmetric matrix solvers are :" << endl
<< symMatrixConstructorTablePtr_->toc()
<< symMatrixConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<typename LduMatrix<Type, DType, LUType>::solver>
(
constructorIter()
cstrIter()
(
fieldName,
matrix,
@ -78,22 +77,21 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New
}
else if (matrix.asymmetric())
{
typename asymMatrixConstructorTable::iterator constructorIter =
asymMatrixConstructorTablePtr_->find(solverName);
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(solverName);
if (!constructorIter.found())
if (!cstrIter.found())
{
FatalIOErrorInFunction(solverDict)
<< "Unknown asymmetric matrix solver " << solverName
<< endl << endl
<< "Valid asymmetric matrix solvers are :" << endl
<< asymMatrixConstructorTablePtr_->toc()
<< asymMatrixConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<typename LduMatrix<Type, DType, LUType>::solver>
(
constructorIter()
cstrIter()
(
fieldName,
matrix,

View File

@ -82,10 +82,9 @@ Foam::lduMatrix::preconditioner::New
if (sol.matrix().symmetric())
{
symMatrixConstructorTable::iterator constructorIter =
symMatrixConstructorTablePtr_->find(name);
auto cstrIter = symMatrixConstructorTablePtr_->cfind(name);
if (!constructorIter.found())
if (!cstrIter.found())
{
FatalIOErrorInFunction
(
@ -99,7 +98,7 @@ Foam::lduMatrix::preconditioner::New
return autoPtr<lduMatrix::preconditioner>
(
constructorIter()
cstrIter()
(
sol,
controls
@ -108,10 +107,9 @@ Foam::lduMatrix::preconditioner::New
}
else if (sol.matrix().asymmetric())
{
asymMatrixConstructorTable::iterator constructorIter =
asymMatrixConstructorTablePtr_->find(name);
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name);
if (!constructorIter.found())
if (!cstrIter.found())
{
FatalIOErrorInFunction
(
@ -125,7 +123,7 @@ Foam::lduMatrix::preconditioner::New
return autoPtr<lduMatrix::preconditioner>
(
constructorIter()
cstrIter()
(
sol,
controls

View File

@ -86,10 +86,9 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New
if (matrix.symmetric())
{
symMatrixConstructorTable::iterator constructorIter =
symMatrixConstructorTablePtr_->find(name);
auto cstrIter = symMatrixConstructorTablePtr_->cfind(name);
if (!constructorIter.found())
if (!cstrIter.found())
{
FatalIOErrorInFunction(solverControls)
<< "Unknown symmetric matrix smoother "
@ -101,7 +100,7 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New
return autoPtr<lduMatrix::smoother>
(
constructorIter()
cstrIter()
(
fieldName,
matrix,
@ -113,10 +112,9 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New
}
else if (matrix.asymmetric())
{
asymMatrixConstructorTable::iterator constructorIter =
asymMatrixConstructorTablePtr_->find(name);
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name);
if (!constructorIter.found())
if (!cstrIter.found())
{
FatalIOErrorInFunction(solverControls)
<< "Unknown asymmetric matrix smoother "
@ -128,7 +126,7 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New
return autoPtr<lduMatrix::smoother>
(
constructorIter()
cstrIter()
(
fieldName,
matrix,

View File

@ -66,10 +66,9 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
}
else if (matrix.symmetric())
{
symMatrixConstructorTable::iterator constructorIter =
symMatrixConstructorTablePtr_->find(name);
auto cstrIter = symMatrixConstructorTablePtr_->cfind(name);
if (!constructorIter.found())
if (!cstrIter.found())
{
FatalIOErrorInFunction(solverControls)
<< "Unknown symmetric matrix solver " << name << nl << nl
@ -80,7 +79,7 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
return autoPtr<lduMatrix::solver>
(
constructorIter()
cstrIter()
(
fieldName,
matrix,
@ -93,10 +92,9 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
}
else if (matrix.asymmetric())
{
asymMatrixConstructorTable::iterator constructorIter =
asymMatrixConstructorTablePtr_->find(name);
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name);
if (!constructorIter.found())
if (!cstrIter.found())
{
FatalIOErrorInFunction(solverControls)
<< "Unknown asymmetric matrix solver " << name << nl << nl
@ -107,7 +105,7 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
return autoPtr<lduMatrix::solver>
(
constructorIter()
cstrIter()
(
fieldName,
matrix,

View File

@ -304,17 +304,16 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
lduMeshConstructorTablePtr_
);
lduMeshConstructorTable::iterator cstrIter =
lduMeshConstructorTablePtr_->find(agglomeratorType);
auto cstrIter = lduMeshConstructorTablePtr_->cfind(agglomeratorType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown GAMGAgglomeration type "
<< agglomeratorType << ".\n"
<< "Valid matrix GAMGAgglomeration types are :"
<< "Valid matrix GAMGAgglomeration types :"
<< lduMatrixConstructorTablePtr_->sortedToc() << endl
<< "Valid geometric GAMGAgglomeration types are :"
<< "Valid geometric GAMGAgglomeration types :"
<< lduMeshConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -369,8 +368,8 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
}
else
{
lduMatrixConstructorTable::iterator cstrIter =
lduMatrixConstructorTablePtr_->find(agglomeratorType);
auto cstrIter =
lduMatrixConstructorTablePtr_->cfind(agglomeratorType);
return store(cstrIter()(matrix, controlDict).ptr());
}
@ -405,15 +404,14 @@ Foam::autoPtr<Foam::GAMGAgglomeration> Foam::GAMGAgglomeration::New
geometryConstructorTablePtr_
);
geometryConstructorTable::iterator cstrIter =
geometryConstructorTablePtr_->find(agglomeratorType);
auto cstrIter = geometryConstructorTablePtr_->cfind(agglomeratorType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown GAMGAgglomeration type "
<< agglomeratorType << ".\n"
<< "Valid geometric GAMGAgglomeration types are :"
<< "Valid geometric GAMGAgglomeration types :"
<< geometryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -361,15 +361,14 @@ Foam::autoPtr<Foam::GAMGProcAgglomeration> Foam::GAMGProcAgglomeration::New
InfoInFunction << "Constructing GAMGProcAgglomeration" << endl;
}
GAMGAgglomerationConstructorTable::iterator cstrIter =
GAMGAgglomerationConstructorTablePtr_->find(type);
auto cstrIter = GAMGAgglomerationConstructorTablePtr_->cfind(type);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown GAMGProcAgglomeration type "
<< type << " for GAMGAgglomeration " << agglom.type() << nl << nl
<< "Valid GAMGProcAgglomeration types are :" << endl
<< "Valid GAMGProcAgglomeration types :" << endl
<< GAMGAgglomerationConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -35,15 +35,14 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New
{
const word coupleType(fineInterface.interfaceFieldType());
lduInterfaceFieldConstructorTable::iterator cstrIter =
lduInterfaceFieldConstructorTablePtr_->find(coupleType);
auto cstrIter = lduInterfaceFieldConstructorTablePtr_->cfind(coupleType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown GAMGInterfaceField type "
<< coupleType << nl
<< "Valid GAMGInterfaceField types are :"
<< "Valid GAMGInterfaceField types :"
<< lduInterfaceFieldConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -61,15 +60,14 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New
{
const word coupleType(GAMGCp.type());
lduInterfaceConstructorTable::iterator cstrIter =
lduInterfaceConstructorTablePtr_->find(coupleType);
auto cstrIter = lduInterfaceConstructorTablePtr_->cfind(coupleType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown GAMGInterfaceField type "
<< coupleType << nl
<< "Valid GAMGInterfaceField types are :"
<< "Valid GAMGInterfaceField types :"
<< lduInterfaceConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -43,14 +43,13 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
{
const word coupleType(fineInterface.type());
lduInterfaceConstructorTable::iterator cstrIter =
lduInterfaceConstructorTablePtr_->find(coupleType);
auto cstrIter = lduInterfaceConstructorTablePtr_->cfind(coupleType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown GAMGInterface type " << coupleType << ".\n"
<< "Valid GAMGInterface types are :"
<< "Valid GAMGInterface types :"
<< lduInterfaceConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -79,14 +78,13 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
Istream& is
)
{
IstreamConstructorTable::iterator cstrIter =
IstreamConstructorTablePtr_->find(coupleType);
auto cstrIter = IstreamConstructorTablePtr_->cfind(coupleType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown GAMGInterface type " << coupleType << ".\n"
<< "Valid GAMGInterface types are :"
<< "Valid GAMGInterface types :"
<< IstreamConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -38,16 +38,14 @@ Foam::autoPtr<Foam::facePointPatch> Foam::facePointPatch::New
InfoInFunction << "Constructing facePointPatch" << endl;
}
polyPatchConstructorTable::iterator cstrIter =
polyPatchConstructorTablePtr_->find(patch.type());
auto cstrIter = polyPatchConstructorTablePtr_->cfind(patch.type());
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown facePointPatch type "
<< patch.type()
<< nl << nl
<< "Valid facePointPatch types are :" << endl
<< patch.type() << nl << nl
<< "Valid facePointPatch types :" << endl
<< polyPatchConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -279,13 +279,7 @@ Foam::wordList Foam::polyPatch::constraintTypes()
label i = 0;
for
(
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->begin();
cstrIter != dictionaryConstructorTablePtr_->end();
++cstrIter
)
forAllConstIters(*dictionaryConstructorTablePtr_, cstrIter)
{
if (constraintType(cstrIter.key()))
{

View File

@ -43,15 +43,14 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New
InfoInFunction << "Constructing polyPatch" << endl;
}
wordConstructorTable::iterator cstrIter =
wordConstructorTablePtr_->find(patchType);
auto cstrIter = wordConstructorTablePtr_->cfind(patchType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown polyPatch type "
<< patchType << " for patch " << name << nl << nl
<< "Valid polyPatch types are :" << endl
<< "Valid polyPatch types :" << endl
<< wordConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -105,14 +104,13 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New
InfoInFunction << "Constructing polyPatch" << endl;
}
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(patchType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchType);
if (!cstrIter.found())
{
if (!disallowGenericPolyPatch)
{
cstrIter = dictionaryConstructorTablePtr_->find("genericPatch");
cstrIter = dictionaryConstructorTablePtr_->cfind("genericPatch");
}
if (!cstrIter.found())
@ -122,7 +120,7 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New
dict
) << "Unknown polyPatch type "
<< patchType << " for patch " << name << nl << nl
<< "Valid polyPatch types are :" << endl
<< "Valid polyPatch types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}

View File

@ -43,8 +43,7 @@ Foam::autoPtr<Foam::cellZone> Foam::cellZone::New
const word zoneType(dict.lookup("type"));
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(zoneType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType);
if (!cstrIter.found())
{
@ -53,7 +52,7 @@ Foam::autoPtr<Foam::cellZone> Foam::cellZone::New
dict
) << "Unknown cellZone type "
<< zoneType << nl << nl
<< "Valid cellZone types are:" << nl
<< "Valid cellZone types :" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}

View File

@ -43,8 +43,7 @@ Foam::autoPtr<Foam::faceZone> Foam::faceZone::New
const word zoneType(dict.lookup("type"));
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(zoneType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType);
if (!cstrIter.found())
{
@ -53,7 +52,7 @@ Foam::autoPtr<Foam::faceZone> Foam::faceZone::New
dict
) << "Unknown faceZone type "
<< zoneType << nl << nl
<< "Valid faceZone types are:" << nl
<< "Valid faceZone types :" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}

View File

@ -43,8 +43,7 @@ Foam::autoPtr<Foam::pointZone> Foam::pointZone::New
const word zoneType(dict.lookup("type"));
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(zoneType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType);
if (!cstrIter.found())
{
@ -53,7 +52,7 @@ Foam::autoPtr<Foam::pointZone> Foam::pointZone::New
dict
) << "Unknown pointZone type "
<< zoneType << nl << nl
<< "Valid pointZone types are:" << nl
<< "Valid pointZone types :" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}

View File

@ -40,8 +40,7 @@ Foam::autoPtr<Foam::Function1<Type>> Foam::Function1<Type>::New
const word Function1Type(coeffsDict.lookup("type"));
typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(Function1Type);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(Function1Type);
if (!cstrIter.found())
{
@ -49,7 +48,7 @@ Foam::autoPtr<Foam::Function1<Type>> Foam::Function1<Type>::New
<< "Unknown Function1 type "
<< Function1Type << " for Function1 "
<< entryName << nl << nl
<< "Valid Function1 types are:" << nl
<< "Valid Function1 types :" << nl
<< dictionaryConstructorTablePtr_->sortedToc() << nl
<< exit(FatalError);
}
@ -76,8 +75,7 @@ Foam::autoPtr<Foam::Function1<Type>> Foam::Function1<Type>::New
Function1Type = firstToken.wordToken();
}
typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(Function1Type);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(Function1Type);
if (!cstrIter.found())
{
@ -85,7 +83,7 @@ Foam::autoPtr<Foam::Function1<Type>> Foam::Function1<Type>::New
<< "Unknown Function1 type "
<< Function1Type << " for Function1 "
<< entryName << nl << nl
<< "Valid Function1 types are:" << nl
<< "Valid Function1 types :" << nl
<< dictionaryConstructorTablePtr_->sortedToc() << nl
<< exit(FatalError);
}

View File

@ -153,8 +153,7 @@ Foam::LESModel<BasicTurbulenceModel>::New
Info<< "Selecting LES turbulence model " << modelType << endl;
typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{

View File

@ -73,15 +73,14 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New
Info<< "Selecting LES delta type " << deltaType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(deltaType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(deltaType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown LESdelta type "
<< deltaType << nl << nl
<< "Valid LESdelta types are :" << endl
<< "Valid LESdelta types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -102,36 +101,31 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New
Info<< "Selecting LES delta type " << deltaType << endl;
// First on additional ones
dictionaryConstructorTable::const_iterator cstrIter =
additionalConstructors.find(deltaType);
if (cstrIter != additionalConstructors.end())
// First any additional ones
{
return autoPtr<LESdelta>(cstrIter()(name, turbulence, dict));
}
else
{
dictionaryConstructorTable::const_iterator cstrIter =
dictionaryConstructorTablePtr_->find(deltaType);
auto cstrIter = additionalConstructors.cfind(deltaType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown LESdelta type "
<< deltaType << nl << nl
<< "Valid LESdelta types are :" << endl
<< additionalConstructors.sortedToc()
<< " and "
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
return autoPtr<LESdelta>();
}
else
if (cstrIter.found())
{
return autoPtr<LESdelta>(cstrIter()(name, turbulence, dict));
}
}
auto cstrIter = dictionaryConstructorTablePtr_->cfind(deltaType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown LESdelta type "
<< deltaType << nl << nl
<< "Valid LESdelta types :" << endl
<< additionalConstructors.sortedToc()
<< " and "
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<LESdelta>(cstrIter()(name, turbulence, dict));
}

View File

@ -46,15 +46,14 @@ Foam::autoPtr<Foam::LESfilter> Foam::LESfilter::New
{
const word filterType(dict.lookup(filterDictName));
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(filterType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(filterType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown LESfilter type "
<< filterType << nl << nl
<< "Valid LESfilter types are :" << endl
<< "Valid LESfilter types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -143,8 +143,7 @@ Foam::RASModel<BasicTurbulenceModel>::New
Info<< "Selecting RAS turbulence model " << modelType << endl;
typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{

View File

@ -105,15 +105,14 @@ Foam::TurbulenceModel<Alpha, Rho, BasicTurbulenceModel, TransportModel>::New
Info<< "Selecting turbulence model type " << modelType << endl;
typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown TurbulenceModel type "
<< "Unknown simulationType "
<< modelType << nl << nl
<< "Valid TurbulenceModel types:" << endl
<< "Valid simulation types:" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -114,15 +114,14 @@ Foam::laminarModel<BasicTurbulenceModel>::New
Info<< "Selecting laminar stress model " << modelType << endl;
typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown laminarModel type "
<< modelType << nl << nl
<< "Valid laminarModel types:" << endl
<< "Valid laminarModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -42,8 +42,8 @@ Foam::autoPtr<Foam::reactionRateFlameArea> Foam::reactionRateFlameArea::New
Info<< "Selecting reaction rate flame area correlation "
<< reactionRateFlameAreaType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(reactionRateFlameAreaType);
auto cstrIter =
dictionaryConstructorTablePtr_->cfind(reactionRateFlameAreaType);
if (!cstrIter.found())
{
@ -51,9 +51,9 @@ Foam::autoPtr<Foam::reactionRateFlameArea> Foam::reactionRateFlameArea::New
(
dict
) << "Unknown reactionRateFlameArea type "
<< reactionRateFlameAreaType << endl << endl
<< "Valid reaction rate flame area types are :" << endl
<< dictionaryConstructorTablePtr_->toc()
<< reactionRateFlameAreaType << nl << nl
<< "Valid reaction rate flame area types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}

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