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; Info<< "Selecting flame-wrinkling model " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter = auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
dictionaryConstructorTablePtr_->find(modelType);
if (!cstrIter.found()) if (!cstrIter.found())
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unknown PDRDragModel type " << "Unknown PDRDragModel type "
<< modelType << nl << nl << modelType << nl << nl
<< "Valid PDRDragModels are : " << endl << "Valid PDRDragModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc() << dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError); << exit(FatalError);
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -27,23 +27,18 @@ License
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "Time.H" #include "Time.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(interpolationWeights, 0); defineTypeNameAndDebug(interpolationWeights, 0);
defineRunTimeSelectionTable(interpolationWeights, word); defineRunTimeSelectionTable(interpolationWeights, word);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
interpolationWeights::interpolationWeights Foam::interpolationWeights::interpolationWeights(const scalarField& samples)
(
const scalarField& samples
)
: :
samples_(samples) samples_(samples)
{} {}
@ -51,7 +46,7 @@ interpolationWeights::interpolationWeights
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
autoPtr<interpolationWeights> interpolationWeights::New Foam::autoPtr<Foam::interpolationWeights> Foam::interpolationWeights::New
( (
const word& type, const word& type,
const scalarField& samples const scalarField& samples
@ -64,16 +59,14 @@ autoPtr<interpolationWeights> interpolationWeights::New
<< type << endl; << type << endl;
} }
wordConstructorTable::iterator cstrIter = auto cstrIter = wordConstructorTablePtr_->cfind(type);
wordConstructorTablePtr_->find(type);
if (!cstrIter.found()) if (!cstrIter.found())
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unknown interpolationWeights type " << "Unknown interpolationWeights type "
<< type << type << nl << nl
<< endl << endl << "Valid interpolationWeights types :" << endl
<< "Valid interpolationWeights types are :" << endl
<< wordConstructorTablePtr_->sortedToc() << wordConstructorTablePtr_->sortedToc()
<< exit(FatalError); << exit(FatalError);
} }
@ -84,12 +77,8 @@ autoPtr<interpolationWeights> interpolationWeights::New
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * 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 const dictionary& preconditionerDict
) )
{ {
word preconditionerName = preconditionerDict.lookup("preconditioner"); const word preconditionerName = preconditionerDict.lookup("preconditioner");
if (sol.matrix().symmetric()) if (sol.matrix().symmetric())
{ {
typename symMatrixConstructorTable::iterator constructorIter = auto cstrIter =
symMatrixConstructorTablePtr_->find(preconditionerName); symMatrixConstructorTablePtr_->cfind(preconditionerName);
if (!constructorIter.found()) if (!cstrIter.found())
{ {
FatalIOErrorInFunction FatalIOErrorInFunction
( (
@ -50,13 +50,13 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
) << "Unknown symmetric matrix preconditioner " ) << "Unknown symmetric matrix preconditioner "
<< preconditionerName << endl << endl << preconditionerName << endl << endl
<< "Valid symmetric matrix preconditioners are :" << endl << "Valid symmetric matrix preconditioners are :" << endl
<< symMatrixConstructorTablePtr_->toc() << symMatrixConstructorTablePtr_->sortedToc()
<< exit(FatalIOError); << exit(FatalIOError);
} }
return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner> return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner>
( (
constructorIter() cstrIter()
( (
sol, sol,
preconditionerDict preconditionerDict
@ -65,10 +65,10 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
} }
else if (sol.matrix().asymmetric()) else if (sol.matrix().asymmetric())
{ {
typename asymMatrixConstructorTable::iterator constructorIter = auto cstrIter =
asymMatrixConstructorTablePtr_->find(preconditionerName); asymMatrixConstructorTablePtr_->cfind(preconditionerName);
if (!constructorIter.found()) if (!cstrIter.found())
{ {
FatalIOErrorInFunction FatalIOErrorInFunction
( (
@ -76,13 +76,13 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
) << "Unknown asymmetric matrix preconditioner " ) << "Unknown asymmetric matrix preconditioner "
<< preconditionerName << endl << endl << preconditionerName << endl << endl
<< "Valid asymmetric matrix preconditioners are :" << endl << "Valid asymmetric matrix preconditioners are :" << endl
<< asymMatrixConstructorTablePtr_->toc() << asymMatrixConstructorTablePtr_->sortedToc()
<< exit(FatalIOError); << exit(FatalIOError);
} }
return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner> return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner>
( (
constructorIter() cstrIter()
( (
sol, sol,
preconditionerDict preconditionerDict

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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