diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C index 3208681241..869f9da12e 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C @@ -27,7 +27,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::PDRDragModel::New +Foam::autoPtr +Foam::PDRDragModel::New ( const dictionary& PDRProperties, const compressible::RASModel& turbulence, @@ -36,12 +37,15 @@ Foam::autoPtr Foam::PDRDragModel::New const surfaceScalarField& phi ) { - word PDRDragModelTypeName = PDRProperties.lookup("PDRDragModel"); + const word modelType + ( + PDRProperties.lookup("PDRDragModel") + ); - Info<< "Selecting flame-wrinkling model " << PDRDragModelTypeName << endl; + Info<< "Selecting flame-wrinkling model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(PDRDragModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -49,7 +53,7 @@ Foam::autoPtr Foam::PDRDragModel::New ( "PDRDragModel::New" ) << "Unknown PDRDragModel type " - << PDRDragModelTypeName << endl << endl + << modelType << nl << nl << "Valid PDRDragModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C index b785c5b8e0..90a5d60787 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C @@ -27,7 +27,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::XiEqModel::New +Foam::autoPtr +Foam::XiEqModel::New ( const dictionary& XiEqProperties, const hhuCombustionThermo& thermo, @@ -35,12 +36,15 @@ Foam::autoPtr Foam::XiEqModel::New const volScalarField& Su ) { - word XiEqModelTypeName = XiEqProperties.lookup("XiEqModel"); + const word modelType + ( + XiEqProperties.lookup("XiEqModel") + ); - Info<< "Selecting flame-wrinkling model " << XiEqModelTypeName << endl; + Info<< "Selecting flame-wrinkling model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(XiEqModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -53,8 +57,8 @@ Foam::autoPtr Foam::XiEqModel::New " const volScalarField& Su" ")" ) << "Unknown XiEqModel type " - << XiEqModelTypeName << endl << endl - << "Valid XiEqModels are : " << endl + << modelType << nl << nl + << "Valid XiEqModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C index 728bce124b..9f229740cc 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C @@ -27,7 +27,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::XiGModel::New +Foam::autoPtr +Foam::XiGModel::New ( const dictionary& XiGProperties, const hhuCombustionThermo& thermo, @@ -35,12 +36,15 @@ Foam::autoPtr Foam::XiGModel::New const volScalarField& Su ) { - word XiGModelTypeName = XiGProperties.lookup("XiGModel"); + const word modelType + ( + XiGProperties.lookup("XiGModel") + ); - Info<< "Selecting flame-wrinkling model " << XiGModelTypeName << endl; + Info<< "Selecting flame-wrinkling model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(XiGModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -53,8 +57,8 @@ Foam::autoPtr Foam::XiGModel::New " const volScalarField& Su" ")" ) << "Unknown XiGModel type " - << XiGModelTypeName << endl << endl - << "Valid XiGModels are : " << endl + << modelType << nl << nl + << "Valid XiGModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C index dfd748265c..ae3d5b4988 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C @@ -27,7 +27,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::XiModel::New +Foam::autoPtr +Foam::XiModel::New ( const dictionary& XiProperties, const hhuCombustionThermo& thermo, @@ -38,12 +39,15 @@ Foam::autoPtr Foam::XiModel::New const surfaceScalarField& phi ) { - word XiModelTypeName = XiProperties.lookup("XiModel"); + const word modelType + ( + XiProperties.lookup("XiModel") + ); - Info<< "Selecting flame-wrinkling model " << XiModelTypeName << endl; + Info<< "Selecting flame-wrinkling model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(XiModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -51,8 +55,8 @@ Foam::autoPtr Foam::XiModel::New ( "XiModel::New" ) << "Unknown XiModel type " - << XiModelTypeName << endl << endl - << "Valid XiModels are : " << endl + << modelType << nl << nl + << "Valid XiModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/combustionModelNew.C b/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/combustionModelNew.C index 40f2bb2e2f..09291807c3 100644 --- a/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/combustionModelNew.C +++ b/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/combustionModelNew.C @@ -27,7 +27,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::combustionModel::New +Foam::autoPtr +Foam::combustionModel::New ( const dictionary& combustionProperties, const hsCombustionThermo& thermo, @@ -36,15 +37,18 @@ Foam::autoPtr Foam::combustionModel::New const volScalarField& rho ) { - word combustionModelTypeName = combustionProperties.lookup + const word modelType ( - "combustionModel" + combustionProperties.lookup + ( + "combustionModel" + ) ); - Info<< "Selecting combustion model " << combustionModelTypeName << endl; + Info<< "Selecting combustion model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(combustionModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -52,8 +56,8 @@ Foam::autoPtr Foam::combustionModel::New ( "combustionModel::New" ) << "Unknown combustionModel type " - << combustionModelTypeName << endl << endl - << "Valid combustionModels are : " << endl + << modelType << nl << nl + << "Valid combustionModels are : " << endl << dictionaryConstructorTablePtr_->toc() << exit(FatalError); } diff --git a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H index 65be09775c..ea325dabe0 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H @@ -11,7 +11,7 @@ basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); - word inertSpecie(thermo.lookup("inertSpecie")); + const word inertSpecie(thermo.lookup("inertSpecie")); if (!composition.contains(inertSpecie)) { diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H index cf3f484bdb..3ad06c22b3 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H @@ -11,7 +11,7 @@ basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); - word inertSpecie(thermo.lookup("inertSpecie")); + const word inertSpecie(thermo.lookup("inertSpecie")); if (!composition.contains(inertSpecie)) { diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H index 9c196e2905..8048acd648 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H @@ -11,7 +11,7 @@ basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); - word inertSpecie(thermo.lookup("inertSpecie")); + const word inertSpecie(thermo.lookup("inertSpecie")); volScalarField& p = thermo.p(); volScalarField& hs = thermo.hs(); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H index e071ac8b3d..0fd631fb7f 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H @@ -11,7 +11,7 @@ basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); - word inertSpecie(thermo.lookup("inertSpecie")); + const word inertSpecie(thermo.lookup("inertSpecie")); if (!composition.contains(inertSpecie)) { diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C index c45a772e4a..b78b018880 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C @@ -36,22 +36,21 @@ Foam::phaseChangeTwoPhaseMixture::New const word& alpha1Name ) { - IOdictionary transportPropertiesDict + // get model name, but do not register the dictionary + const word phaseChangeTwoPhaseMixtureTypeName ( - IOobject + IOdictionary ( - "transportProperties", - U.time().constant(), - U.db(), - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ) - ); - - word phaseChangeTwoPhaseMixtureTypeName - ( - transportPropertiesDict.lookup("phaseChangeTwoPhaseMixture") + IOobject + ( + "transportProperties", + U.time().constant(), + U.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ) + ).lookup("phaseChangeTwoPhaseMixture") ); Info<< "Selecting phaseChange model " @@ -67,8 +66,8 @@ Foam::phaseChangeTwoPhaseMixture::New ( "phaseChangeTwoPhaseMixture::New" ) << "Unknown phaseChangeTwoPhaseMixture type " - << phaseChangeTwoPhaseMixtureTypeName << endl << endl - << "Valid phaseChangeTwoPhaseMixtures are : " << endl + << phaseChangeTwoPhaseMixtureTypeName << nl << nl + << "Valid phaseChangeTwoPhaseMixture types are : " << endl << componentsConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/settlingFoam/createFields.H b/applications/solvers/multiphase/settlingFoam/createFields.H index 6833c90ec9..c8e05c4209 100644 --- a/applications/solvers/multiphase/settlingFoam/createFields.H +++ b/applications/solvers/multiphase/settlingFoam/createFields.H @@ -159,7 +159,7 @@ Info<< "Selecting Drift-Flux model " << endl; - word VdjModel(transportProperties.lookup("VdjModel")); + const word VdjModel(transportProperties.lookup("VdjModel")); Info<< tab << VdjModel << " selected\n" << endl; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C index 2f147a0dee..773a6c70f9 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C @@ -27,7 +27,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::dragModel::New +Foam::autoPtr +Foam::dragModel::New ( const dictionary& interfaceDict, const volScalarField& alpha, @@ -35,7 +36,7 @@ Foam::autoPtr Foam::dragModel::New const phaseModel& phaseb ) { - word dragModelType + const word modelType ( interfaceDict.lookup("dragModel" + phasea.name()) ); @@ -43,20 +44,21 @@ Foam::autoPtr Foam::dragModel::New Info<< "Selecting dragModel for phase " << phasea.name() << ": " - << dragModelType << endl; + << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(dragModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "dragModel::New : " << endl - << " unknown dragModelType type " - << dragModelType - << ", constructor not in hash table" << endl << endl - << " Valid dragModel types are : " << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "dragModel::New(...)" + ) << "Unknown dragModel type " + << modelType << nl << nl + << "Valid dragModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return cstrIter()(interfaceDict, alpha, phasea, phaseb); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModelNew.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModelNew.C index 74b2a1fbcc..66c851a48d 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModelNew.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModelNew.C @@ -27,28 +27,32 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::conductivityModel::New +Foam::autoPtr +Foam::conductivityModel::New ( const dictionary& dict ) { - word conductivityModelType(dict.lookup("conductivityModel")); + const word modelType + ( + dict.lookup("conductivityModel") + ); - Info<< "Selecting conductivityModel " - << conductivityModelType << endl; + Info<< "Selecting conductivityModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(conductivityModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "conductivityModel::New(const dictionary&) : " << endl - << " unknown conductivityModelType type " - << conductivityModelType - << ", constructor not in hash table" << endl << endl - << " Valid conductivityModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "conductivityModel::New(const dictionary&)" + ) << "Unknown conductivityModel type " + << modelType << nl << nl + << "Valid conductivityModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C index 391737f16b..7ce2ce03fc 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C @@ -27,28 +27,33 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::frictionalStressModel::New +Foam::autoPtr +Foam::frictionalStressModel::New ( const dictionary& dict ) { - word frictionalStressModelType(dict.lookup("frictionalStressModel")); + const word modelType + ( + dict.lookup("frictionalStressModel") + ); - Info<< "Selecting frictionalStressModel " - << frictionalStressModelType << endl; + Info<< "Selecting frictionalStressModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(frictionalStressModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "frictionalStressModel::New(const dictionary&) : " << endl - << " unknown frictionalStressModelType type " - << frictionalStressModelType - << ", constructor not in hash table" << endl << endl - << " Valid frictionalStressModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "frictionalStressModel::New(const dictionary&)" + ) + << "Unknown frictionalStressModel type " + << modelType << nl << nl + << "Valid frictionalStressModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModelNew.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModelNew.C index f9697eca51..d7f4d745f6 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModelNew.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModelNew.C @@ -27,28 +27,32 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::granularPressureModel::New +Foam::autoPtr +Foam::granularPressureModel::New ( const dictionary& dict ) { - word granularPressureModelType(dict.lookup("granularPressureModel")); + const word modelType + ( + dict.lookup("granularPressureModel") + ); - Info<< "Selecting granularPressureModel " - << granularPressureModelType << endl; + Info<< "Selecting granularPressureModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(granularPressureModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "granularPressureModel::New(const dictionary&) : " << endl - << " unknown granularPressureModelType type " - << granularPressureModelType - << ", constructor not in hash table" << endl << endl - << " Valid granularPressureModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "granularPressureModel::New(const dictionary&)" + ) << "Unknown granularPressureModel type " + << modelType << nl << nl + << "Valid granularPressureModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModelNew.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModelNew.C index f2a46d79c4..3e729140ce 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModelNew.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModelNew.C @@ -27,28 +27,33 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::radialModel::New +Foam::autoPtr +Foam::radialModel::New ( const dictionary& dict ) { - word radialModelType(dict.lookup("radialModel")); + const word modelType + ( + dict.lookup("radialModel") + ); - Info<< "Selecting radialModel " - << radialModelType << endl; + Info<< "Selecting radialModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(radialModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "radialModel::New(const dictionary&) : " << endl - << " unknown radialModelType type " - << radialModelType - << ", constructor not in hash table" << endl << endl - << " Valid radialModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "radialModel::New(const dictionary&)" + ) + << "Unknown radialModel type " + << modelType << nl << nl + << "Valid radialModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModelNew.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModelNew.C index 8998c45053..32e3dc7fe1 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModelNew.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModelNew.C @@ -33,23 +33,26 @@ Foam::kineticTheoryModels::viscosityModel::New const dictionary& dict ) { - word viscosityModelType(dict.lookup("viscosityModel")); + const word modelType + ( + dict.lookup("viscosityModel") + ); - Info<< "Selecting viscosityModel " - << viscosityModelType << endl; + Info<< "Selecting viscosityModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(viscosityModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "viscosityModel::New(const dictionary&) : " << endl - << " unknown viscosityModelType type " - << viscosityModelType - << ", constructor not in hash table" << endl << endl - << " Valid viscosityModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "viscosityModel::New(const dictionary&)" + ) << "Unknown viscosityModel type " + << modelType << nl << nl + << "Valid viscosityModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C index 805cd23845..055cbb2773 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C @@ -134,7 +134,8 @@ Foam::phaseModel::phaseModel } -Foam::autoPtr Foam::phaseModel::New +Foam::autoPtr +Foam::phaseModel::New ( const fvMesh& mesh, const dictionary& transportProperties, diff --git a/applications/utilities/mesh/conversion/star3ToFoam/createBoundaryFaces.C b/applications/utilities/mesh/conversion/star3ToFoam/createBoundaryFaces.C index 5f6c995929..341b2b8e26 100644 --- a/applications/utilities/mesh/conversion/star3ToFoam/createBoundaryFaces.C +++ b/applications/utilities/mesh/conversion/star3ToFoam/createBoundaryFaces.C @@ -166,7 +166,9 @@ void starMesh::markBoundaryFaces() } } - FatalError << " $ bset,add,vset,all" << abort(FatalError); + FatalError + << " $ bset,add,vset,all" + << abort(FatalError); } } } diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/extrudeModelNew.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/extrudeModelNew.C index e242e5fada..1e91ed4c0d 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/extrudeModelNew.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/extrudeModelNew.C @@ -27,25 +27,30 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::extrudeModel::New +Foam::autoPtr +Foam::extrudeModel::New ( const dictionary& dict ) { - word extrudeModelType(dict.lookup("extrudeModel")); + const word modelType + ( + dict.lookup("extrudeModel") + ); - Info<< "Selecting extrudeModel " << extrudeModelType << endl; + Info<< "Selecting extrudeModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(extrudeModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn("extrudeModel::New(const dictionary&)") - << "Unknown extrudeModelType type " - << extrudeModelType - << ", constructor not in hash table" << nl << nl - << " Valid extrudeModel types are :" << nl + FatalErrorIn + ( + "extrudeModel::New(const dictionary&)" + ) << "Unknown extrudeModel type " + << modelType << nl << nl + << "Valid extrudeModel types are :" << nl << dictionaryConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } @@ -55,4 +60,3 @@ Foam::autoPtr Foam::extrudeModel::New // ************************************************************************* // - diff --git a/applications/utilities/mesh/manipulation/cellSet/cellSet.C b/applications/utilities/mesh/manipulation/cellSet/cellSet.C index 276614687a..3eafef872b 100644 --- a/applications/utilities/mesh/manipulation/cellSet/cellSet.C +++ b/applications/utilities/mesh/manipulation/cellSet/cellSet.C @@ -59,9 +59,8 @@ int main(int argc, char *argv[]) ); - word setName(cellSetDict.lookup("name")); - - word actionName(cellSetDict.lookup("action")); + const word setName(cellSetDict.lookup("name")); + const word actionName(cellSetDict.lookup("action")); topoSetSource::setAction action = topoSetSource::toAction(actionName); diff --git a/applications/utilities/mesh/manipulation/faceSet/faceSet.C b/applications/utilities/mesh/manipulation/faceSet/faceSet.C index 63e7a68c66..7c97b95ef5 100644 --- a/applications/utilities/mesh/manipulation/faceSet/faceSet.C +++ b/applications/utilities/mesh/manipulation/faceSet/faceSet.C @@ -59,9 +59,8 @@ int main(int argc, char *argv[]) ); - word setName(faceSetDict.lookup("name")); - - word actionName(faceSetDict.lookup("action")); + const word setName(faceSetDict.lookup("name")); + const word actionName(faceSetDict.lookup("action")); topoSetSource::setAction action = topoSetSource::toAction(actionName); diff --git a/applications/utilities/mesh/manipulation/pointSet/pointSet.C b/applications/utilities/mesh/manipulation/pointSet/pointSet.C index 79ed4fae71..8219ec41b6 100644 --- a/applications/utilities/mesh/manipulation/pointSet/pointSet.C +++ b/applications/utilities/mesh/manipulation/pointSet/pointSet.C @@ -59,9 +59,8 @@ int main(int argc, char *argv[]) ); - word setName(pointSetDict.lookup("name")); - - word actionName(pointSetDict.lookup("action")); + const word setName(pointSetDict.lookup("name")); + const word actionName(pointSetDict.lookup("action")); topoSetSource::setAction action = topoSetSource::toAction(actionName); diff --git a/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C b/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C index b3a8efdc79..783848d09b 100644 --- a/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C +++ b/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C @@ -331,7 +331,7 @@ int main(int argc, char *argv[]) ) ); - word setName(refineDict.lookup("set")); + const word setName(refineDict.lookup("set")); cellSet cells(mesh, setName); diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index 321fd92ff3..f63026e3f0 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -154,9 +154,9 @@ int main(int argc, char *argv[]) } // get requested numberOfSubdomains - label nDomains = 0; - { - IOdictionary decompDict + const label nDomains = readLabel + ( + IOdictionary ( IOobject ( @@ -168,10 +168,8 @@ int main(int argc, char *argv[]) IOobject::NO_WRITE, false ) - ); - - decompDict.lookup("numberOfSubdomains") >> nDomains; - } + ).lookup("numberOfSubdomains") + ); if (decomposeFieldsOnly) { diff --git a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/calcFaceAddressing.C b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/calcFaceAddressing.C index 1546fcdea5..0aa65dc1b5 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/calcFaceAddressing.C +++ b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/calcFaceAddressing.C @@ -72,14 +72,17 @@ labelList calcFaceAddressing << " face labels:" << faces << endl << " cellI:" << cellI << endl; - FatalError << "Faces consist of vertices:" << endl; + FatalError + << "Faces consist of vertices:" << endl; + forAll(faces, faceI) { FatalError << " face:" << faces[faceI] << allFaces[faces[faceI]] << endl; } - FatalError << exit(FatalError); + FatalError + << exit(FatalError); } } return shapeToMesh; diff --git a/applications/utilities/postProcessing/dataConversion/foamToGMV/readConversionProperties.H b/applications/utilities/postProcessing/dataConversion/foamToGMV/readConversionProperties.H index c1a0cd7c78..b19e03ab19 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToGMV/readConversionProperties.H +++ b/applications/utilities/postProcessing/dataConversion/foamToGMV/readConversionProperties.H @@ -28,7 +28,8 @@ word format if ((format != "ascii") && (format != "ieeei4r8")) { - FatalError << "format type: " << format << " unknown." + FatalError + << "format type: " << format << " unknown." << " Valid options are: ascii ieeei4r8" << abort(FatalError); @@ -44,6 +45,7 @@ if (cells != "hex") ) { - FatalError << "cells type: " << cells << " unknown." + FatalError + << "cells type: " << cells << " unknown." << abort(FatalError); } diff --git a/applications/utilities/thermophysical/adiabaticFlameT/adiabaticFlameT.C b/applications/utilities/thermophysical/adiabaticFlameT/adiabaticFlameT.C index d7d282ec9b..5139b8c499 100644 --- a/applications/utilities/thermophysical/adiabaticFlameT/adiabaticFlameT.C +++ b/applications/utilities/thermophysical/adiabaticFlameT/adiabaticFlameT.C @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) scalar T0(readScalar(control.lookup("T0"))); - word fuelName(control.lookup("fuel")); + const word fuelName(control.lookup("fuel")); scalar n(readScalar(control.lookup("n"))); scalar m(readScalar(control.lookup("m"))); diff --git a/applications/utilities/thermophysical/equilibriumFlameT/equilibriumFlameT.C b/applications/utilities/thermophysical/equilibriumFlameT/equilibriumFlameT.C index 0549688e34..2990cc81dc 100644 --- a/applications/utilities/thermophysical/equilibriumFlameT/equilibriumFlameT.C +++ b/applications/utilities/thermophysical/equilibriumFlameT/equilibriumFlameT.C @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) scalar P(readScalar(control.lookup("P"))); - word fuel(control.lookup("fuel")); + const word fuelName(control.lookup("fuel")); scalar n(readScalar(control.lookup("n"))); scalar m(readScalar(control.lookup("m"))); @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) Info<< nl << "Reading Burcat data for relevant species" << nl << endl; // Reactants - thermo FUEL(thermoData.lookup(fuel)); + thermo FUEL(thermoData.lookup(fuelName)); thermo O2(thermoData.lookup("O2")); thermo N2(thermoData.lookup("N2")); diff --git a/etc/codeTemplates/source/_Template.C b/etc/codeTemplates/source/_Template.C index 43c2dc7253..ed2b7283af 100644 --- a/etc/codeTemplates/source/_Template.C +++ b/etc/codeTemplates/source/_Template.C @@ -64,7 +64,8 @@ Foam::CLASSNAME::CLASSNAME(const CLASSNAME&) // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::CLASSNAME::New() +Foam::autoPtr +Foam::CLASSNAME::New() { return autoPtr(new CLASSNAME); } diff --git a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C index 03b1578017..add1e02b05 100644 --- a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C +++ b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C @@ -27,7 +27,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::ODESolver::New +Foam::autoPtr +Foam::ODESolver::New ( const Foam::word& ODESolverTypeName, const Foam::ODE& ode @@ -44,8 +45,8 @@ Foam::autoPtr Foam::ODESolver::New ( "ODESolver::New(const word& ODESolverTypeName, const ODE& ode)" ) << "Unknown ODESolver type " - << ODESolverTypeName << endl << endl - << "Valid ODESolvers are : " << endl + << ODESolverTypeName << nl << nl + << "Valid ODESolvers are : " << endl << ODEConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C b/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C index 3fb364d9bb..fc85d5fa26 100644 --- a/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C +++ b/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C @@ -72,7 +72,7 @@ bool Foam::IOobject::readHeader(Istream& is) is.format(headerDict.lookup("format")); headerClassName_ = word(headerDict.lookup("class")); - word headerObject(headerDict.lookup("object")); + const word headerObject(headerDict.lookup("object")); if (IOobject::debug && headerObject != name()) { IOWarningIn("IOobject::readHeader(Istream&)", is) diff --git a/src/OpenFOAM/db/IOstreams/token/token.C b/src/OpenFOAM/db/IOstreams/token/token.C index 50c0d80f3c..487f903839 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.C +++ b/src/OpenFOAM/db/IOstreams/token/token.C @@ -52,7 +52,8 @@ Foam::token::compound::~compound() // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::token::compound::New +Foam::autoPtr +Foam::token::compound::New ( const word& compoundType, Istream& is diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index 35525f65f4..0afa8d69b3 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -95,7 +95,7 @@ void Foam::Time::adjustDeltaT() void Foam::Time::setControls() { // default is to resume calculation from "latestTime" - word startFrom = controlDict_.lookupOrDefault + const word startFrom = controlDict_.lookupOrDefault ( "startFrom", "latestTime" diff --git a/src/OpenFOAM/db/Time/TimeIO.C b/src/OpenFOAM/db/Time/TimeIO.C index d16b4c8014..11031875df 100644 --- a/src/OpenFOAM/db/Time/TimeIO.C +++ b/src/OpenFOAM/db/Time/TimeIO.C @@ -94,7 +94,7 @@ void Foam::Time::readDict() if (controlDict_.found("timeFormat")) { - word formatName(controlDict_.lookup("timeFormat")); + const word formatName(controlDict_.lookup("timeFormat")); if (formatName == "general") { diff --git a/src/OpenFOAM/db/dictionary/dictionaryIO.C b/src/OpenFOAM/db/dictionary/dictionaryIO.C index 1c452bafaf..4ee2af5750 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryIO.C +++ b/src/OpenFOAM/db/dictionary/dictionaryIO.C @@ -118,7 +118,8 @@ Foam::dictionary::dictionary(Istream& is) } -Foam::autoPtr Foam::dictionary::New(Istream& is) +Foam::autoPtr +Foam::dictionary::New(Istream& is) { return autoPtr(new dictionary(is)); } diff --git a/src/OpenFOAM/db/dictionary/entry/entryIO.C b/src/OpenFOAM/db/dictionary/entry/entryIO.C index cbe2179172..ea1f91a495 100644 --- a/src/OpenFOAM/db/dictionary/entry/entryIO.C +++ b/src/OpenFOAM/db/dictionary/entry/entryIO.C @@ -191,7 +191,8 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is) } -Foam::autoPtr Foam::entry::New(Istream& is) +Foam::autoPtr +Foam::entry::New(Istream& is) { is.fatalCheck("entry::New(Istream&)"); diff --git a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C index dfd4a27417..e19c807bf8 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C @@ -82,7 +82,7 @@ bool Foam::functionEntry::execute "(const word& functionName, dictionary& parentDict, Istream&)" ) << "Unknown functionEntry '" << functionName << "' in " << is.name() << " near line " << is.lineNumber() - << endl << endl + << nl << nl << "Valid functionEntries are :" << endl << executedictionaryIstreamMemberFunctionTablePtr_->toc() << exit(FatalError); @@ -128,7 +128,7 @@ bool Foam::functionEntry::execute "(const word&, const dictionary&, primitiveEntry&, Istream&)" ) << "Unknown functionEntry '" << functionName << "' in " << is.name() << " near line " << is.lineNumber() - << endl << endl + << nl << nl << "Valid functionEntries are :" << endl << executeprimitiveEntryIstreamMemberFunctionTablePtr_->toc() << exit(FatalError); diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index 79bfcdb3b2..35a20392ef 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C @@ -43,14 +43,15 @@ Foam::functionObject::functionObject(const word& name) // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::functionObject::New +Foam::autoPtr +Foam::functionObject::New ( const word& name, const Time& t, const dictionary& functionDict ) { - word functionType(functionDict.lookup("type")); + const word functionType(functionDict.lookup("type")); if (debug) { diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C index 749511b2cf..0eace332cc 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C @@ -26,7 +26,8 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -Foam::autoPtr > Foam::pointPatchField::New +Foam::autoPtr< Foam::pointPatchField > +Foam::pointPatchField::New ( const word& patchFieldType, const word& actualPatchType, @@ -53,8 +54,7 @@ Foam::autoPtr > Foam::pointPatchField::New "PointPatchField::New" "(const word&, const word&, const pointPatch&, const Field&)" ) << "Unknown patchFieldType type " - << patchFieldType - << endl << endl + << patchFieldType << nl << nl << "Valid patchField types are :" << endl << pointPatchConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -96,7 +96,8 @@ Foam::autoPtr > Foam::pointPatchField::New template -Foam::autoPtr > Foam::pointPatchField::New +Foam::autoPtr< Foam::pointPatchField > +Foam::pointPatchField::New ( const word& patchFieldType, const pointPatch& p, @@ -108,7 +109,8 @@ Foam::autoPtr > Foam::pointPatchField::New template -Foam::autoPtr > Foam::pointPatchField::New +Foam::autoPtr< Foam::pointPatchField > +Foam::pointPatchField::New ( const pointPatch& p, const DimensionedField& iF, @@ -143,7 +145,7 @@ Foam::autoPtr > Foam::pointPatchField::New "New(const pointPatch&, const Field&, const dictionary&)", dict ) << "Unknown patchField type " << patchFieldType - << " for patch type " << p.type() << endl << endl + << " for patch type " << p.type() << nl << nl << "Valid patchField types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -194,7 +196,8 @@ Foam::autoPtr > Foam::pointPatchField::New // Return a pointer to a new patch created on freestore from // a given pointPatchField mapped onto a new patch template -Foam::autoPtr > Foam::pointPatchField::New +Foam::autoPtr< Foam::pointPatchField > +Foam::pointPatchField::New ( const pointPatchField& ptf, const pointPatch& p, @@ -219,12 +222,15 @@ Foam::autoPtr > Foam::pointPatchField::New { FatalErrorIn ( - "PointPatchField::" - "New(const pointPatchField&, " - "const pointPatch&, const Field&, " - "const pointPatchFieldMapper&)" - ) << "unknown patchTypefield type " - << ptf.type() << endl << endl + "PointPatchField::New" + "(" + "const pointPatchField&, " + "const pointPatch&, " + "const DimensionedField&, " + "const pointPatchFieldMapper&" + ")" + ) << "Unknown patchField type " + << ptf.type() << nl << nl << "Valid patchField types are :" << endl << patchMapperConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/OpenFOAM/graph/graph.C b/src/OpenFOAM/graph/graph.C index 1257377608..930badb76d 100644 --- a/src/OpenFOAM/graph/graph.C +++ b/src/OpenFOAM/graph/graph.C @@ -28,19 +28,18 @@ License #include "IOmanip.H" #include "Pair.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(graph::writer, 0); + defineRunTimeSelectionTable(graph::writer, word); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(graph::writer, 0); -defineRunTimeSelectionTable(graph::writer, word); // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void graph::readCurves(Istream& is) +void Foam::graph::readCurves(Istream& is) { List xyData(is); @@ -59,7 +58,7 @@ void graph::readCurves(Istream& is) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -graph::graph +Foam::graph::graph ( const string& title, const string& xName, @@ -74,7 +73,7 @@ graph::graph {} -graph::graph +Foam::graph::graph ( const string& title, const string& xName, @@ -92,7 +91,7 @@ graph::graph } -graph::graph +Foam::graph::graph ( const string& title, const string& xName, @@ -108,7 +107,7 @@ graph::graph } -graph::graph(Istream& is) +Foam::graph::graph(Istream& is) : title_(is), xName_(is), @@ -118,7 +117,7 @@ graph::graph(Istream& is) } -const scalarField& graph::y() const +const Foam::scalarField& Foam::graph::y() const { if (size() != 1) { @@ -130,7 +129,8 @@ const scalarField& graph::y() const return *begin()(); } -scalarField& graph::y() + +Foam::scalarField& Foam::graph::y() { if (size() != 1) { @@ -143,7 +143,8 @@ scalarField& graph::y() } -autoPtr graph::writer::New(const word& graphFormat) +Foam::autoPtr +Foam::graph::writer::New(const word& graphFormat) { if (!wordConstructorTablePtr_) { @@ -173,7 +174,7 @@ autoPtr graph::writer::New(const word& graphFormat) } -void graph::writer::writeXY +void Foam::graph::writer::writeXY ( const scalarField& x, const scalarField& y, @@ -187,7 +188,7 @@ void graph::writer::writeXY } -void graph::writeTable(Ostream& os) const +void Foam::graph::writeTable(Ostream& os) const { forAll(x_, xi) { @@ -202,13 +203,13 @@ void graph::writeTable(Ostream& os) const } -void graph::write(Ostream& os, const word& format) const +void Foam::graph::write(Ostream& os, const word& format) const { writer::New(format)().write(*this, os); } -void graph::write(const fileName& fName, const word& format) const +void Foam::graph::write(const fileName& fName, const word& format) const { autoPtr graphWriter(writer::New(format)); @@ -227,7 +228,7 @@ void graph::write(const fileName& fName, const word& format) const } -Ostream& operator<<(Ostream& os, const graph& g) +Foam::Ostream& Foam::operator<<(Ostream& os, const graph& g) { g.writeTable(os); os.check("Ostream& operator<<(Ostream&, const graph&)"); @@ -235,8 +236,4 @@ Ostream& operator<<(Ostream& os, const graph& g) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C index e374ea0f76..a66d777dc7 100644 --- a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C +++ b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C @@ -58,7 +58,8 @@ Foam::procLduInterface::procLduInterface ( "procLduInterface::procLduInterface" "(const lduInterfaceField&, const scalarField&" - ) << "unknown lduInterface type " << interface.interface().type() + ) << "Unknown lduInterface type " + << interface.interface().type() << exit(FatalError); } } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C index da2406d66a..c5864b52b9 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C @@ -58,7 +58,8 @@ Foam::lduMatrix::smoother::getName } -Foam::autoPtr Foam::lduMatrix::smoother::New +Foam::autoPtr +Foam::lduMatrix::smoother::New ( const word& fieldName, const lduMatrix& matrix, diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C index f34e5334dc..edbd8e4226 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C @@ -37,7 +37,8 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::lduMatrix::solver::New +Foam::autoPtr +Foam::lduMatrix::solver::New ( const word& fieldName, const lduMatrix& matrix, @@ -47,7 +48,7 @@ Foam::autoPtr Foam::lduMatrix::solver::New const dictionary& solverControls ) { - word name(solverControls.lookup("solver")); + const word name(solverControls.lookup("solver")); if (matrix.diagonal()) { diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C index 4431db24df..9196ad0a12 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C @@ -102,7 +102,7 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New ) ) { - word agglomeratorType(controlDict.lookup("agglomerator")); + const word agglomeratorType(controlDict.lookup("agglomerator")); dlLibraryTable::open ( @@ -157,7 +157,7 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New ) ) { - word agglomeratorType(controlDict.lookup("agglomerator")); + const word agglomeratorType(controlDict.lookup("agglomerator")); dlLibraryTable::open ( diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C index c5d1cebda6..e1e06c965f 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C @@ -27,13 +27,14 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::GAMGInterfaceField::New +Foam::autoPtr +Foam::GAMGInterfaceField::New ( const GAMGInterface& GAMGCp, const lduInterfaceField& fineInterface ) { - word coupleType(fineInterface.interfaceFieldType()); + const word coupleType(fineInterface.interfaceFieldType()); lduInterfaceConstructorTable::iterator cstrIter = lduInterfaceConstructorTablePtr_->find(coupleType); @@ -45,7 +46,8 @@ Foam::autoPtr Foam::GAMGInterfaceField::New "GAMGInterfaceField::New" "(const GAMGInterface& GAMGCp, " "const lduInterfaceField& fineInterface)" - ) << "Unknown GAMGInterfaceField type " << coupleType << ".\n" + ) << "Unknown GAMGInterfaceField type " + << coupleType << nl << "Valid GAMGInterfaceField types are :" << lduInterfaceConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C index ddbd89eea2..fac2aea8a5 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C @@ -29,14 +29,15 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::GAMGInterface::New +Foam::autoPtr +Foam::GAMGInterface::New ( const lduInterface& fineInterface, const labelField& localRestrictAddressing, const labelField& neighbourRestrictAddressing ) { - word coupleType(fineInterface.type()); + const word coupleType(fineInterface.type()); lduInterfaceConstructorTable::iterator cstrIter = lduInterfaceConstructorTablePtr_->find(coupleType); diff --git a/src/OpenFOAM/matrices/tolerances/tolerances.C b/src/OpenFOAM/matrices/tolerances/tolerances.C index 487d8ec1a7..dead8a2490 100644 --- a/src/OpenFOAM/matrices/tolerances/tolerances.C +++ b/src/OpenFOAM/matrices/tolerances/tolerances.C @@ -62,7 +62,7 @@ bool tolerances::read() { if (regIOobject::read()) { - word toleranceSetName(lookup("toleranceSet")); + const word toleranceSetName(lookup("toleranceSet")); const dictionary& toleranceSet(subDict(toleranceSetName)); if (toleranceSet.found("relaxationFactors")) diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C index 718bbab1bf..a05b8d37a9 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C @@ -27,12 +27,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -autoPtr facePointPatch::New +Foam::autoPtr +Foam::facePointPatch::New ( const polyPatch& patch, const pointBoundaryMesh& bm @@ -57,7 +53,7 @@ autoPtr facePointPatch::New "const pointBoundaryMesh&) : " ) << "Unknown facePointPatch type " << patch.type() - << endl << endl + << nl << nl << "Valid facePointPatch types are :" << endl << polyPatchConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -67,8 +63,4 @@ autoPtr facePointPatch::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C index 2e821e9036..d2ea21bd0a 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C @@ -28,7 +28,8 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::autoPtr Foam::polyPatch::New +Foam::autoPtr +Foam::polyPatch::New ( const word& patchType, const word& name, @@ -55,8 +56,8 @@ Foam::autoPtr Foam::polyPatch::New ( "polyPatch::New(const word&, const word&, const label, " "const label, const label, const polyBoundaryMesh&) " - ) << "Unknown polyPatch type " << patchType << " for patch " << name - << endl << endl + ) << "Unknown polyPatch type " + << patchType << " for patch " << name << nl << nl << "Valid polyPatch types are :" << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -66,7 +67,8 @@ Foam::autoPtr Foam::polyPatch::New } -Foam::autoPtr Foam::polyPatch::New +Foam::autoPtr +Foam::polyPatch::New ( const word& name, const dictionary& dict, @@ -82,7 +84,6 @@ Foam::autoPtr Foam::polyPatch::New } word patchType(dict.lookup("type")); - dict.readIfPresent("geometricType", patchType); dictionaryConstructorTable::iterator cstrIter = @@ -102,9 +103,8 @@ Foam::autoPtr Foam::polyPatch::New "polyPatch::New(const word&, const dictionary&, " "const label, const polyBoundaryMesh&)", dict - ) << "Unknown polyPatch type " << patchType - << " for patch " << name - << endl << endl + ) << "Unknown polyPatch type " + << patchType << " for patch " << name << nl << nl << "Valid polyPatch types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C index 3c1efbb1a2..a5ec479f68 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C @@ -28,7 +28,8 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::autoPtr Foam::cellZone::New +Foam::autoPtr +Foam::cellZone::New ( const word& name, const dictionary& dict, @@ -43,7 +44,10 @@ Foam::autoPtr Foam::cellZone::New << endl; } - word zoneType(dict.lookup("type")); + const word zoneType + ( + dict.lookup("type") + ); dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(zoneType); @@ -55,7 +59,8 @@ Foam::autoPtr Foam::cellZone::New "cellZone::New(const word&, const dictionary&, " "const label, const cellZoneMesh&)", dict - ) << "Unknown cellZone type " << zoneType << endl << endl + ) << "Unknown cellZone type " + << zoneType << nl << nl << "Valid cellZone types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C index 8948833404..f8e41d8947 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C @@ -28,7 +28,8 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::autoPtr Foam::faceZone::New +Foam::autoPtr +Foam::faceZone::New ( const word& name, const dictionary& dict, @@ -43,7 +44,10 @@ Foam::autoPtr Foam::faceZone::New << endl; } - word zoneType(dict.lookup("type")); + const word zoneType + ( + dict.lookup("type") + ); dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(zoneType); @@ -55,7 +59,8 @@ Foam::autoPtr Foam::faceZone::New "faceZone::New(const word&, const dictionary&, " "const label, const faceZoneMesh&)", dict - ) << "Unknown faceZone type " << zoneType << endl << endl + ) << "Unknown faceZone type " + << zoneType << nl << nl << "Valid faceZone types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C index bac22f1e18..e1ce962d50 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C @@ -28,7 +28,8 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::autoPtr Foam::pointZone::New +Foam::autoPtr +Foam::pointZone::New ( const word& name, const dictionary& dict, @@ -43,7 +44,10 @@ Foam::autoPtr Foam::pointZone::New << endl; } - word zoneType(dict.lookup("type")); + const word zoneType + ( + dict.lookup("type") + ); dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(zoneType); @@ -55,7 +59,8 @@ Foam::autoPtr Foam::pointZone::New "pointZone::New(const word&, const dictionary&, " "const label, const pointZoneMesh&)", dict - ) << "Unknown pointZone type " << zoneType << endl << endl + ) << "Unknown pointZone type " + << zoneType << nl << nl << "Valid pointZone types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C index 9fadac3ca5..5cdc5e9d89 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C +++ b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C @@ -189,7 +189,7 @@ Foam::plane::plane(const dictionary& dict) unitVector_(vector::zero), basePoint_(point::zero) { - word planeType(dict.lookup("planeType")); + const word planeType(dict.lookup("planeType")); if (planeType == "planeEquation") { diff --git a/src/conversion/ensight/part/ensightPart.C b/src/conversion/ensight/part/ensightPart.C index 2321946d3a..aa1eacd628 100644 --- a/src/conversion/ensight/part/ensightPart.C +++ b/src/conversion/ensight/part/ensightPart.C @@ -126,9 +126,10 @@ Foam::ensightPart::ensightPart(const ensightPart& part) // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::ensightPart::New(Istream& is) +Foam::autoPtr +Foam::ensightPart::New(Istream& is) { - word partType(is); + const word partType(is); istreamConstructorTable::iterator cstrIter = istreamConstructorTablePtr_->find(partType); @@ -139,7 +140,8 @@ Foam::autoPtr Foam::ensightPart::New(Istream& is) ( "ensightPart::New(Istream&)", is - ) << "unknown ensightPart type " << partType << endl << endl + ) << "unknown ensightPart type " + << partType << nl << nl << "Valid ensightPart types are :" << endl << istreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C index 536c397923..57311b38dd 100644 --- a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C +++ b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C @@ -29,12 +29,11 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::dynamicFvMesh::New(const IOobject& io) +Foam::autoPtr +Foam::dynamicFvMesh::New(const IOobject& io) { - // Enclose the creation of the dynamicMesh to ensure it is - // deleted before the dynamicFvMesh is created otherwise the dictionary - // is entered in the database twice - IOdictionary dynamicMeshDict + // do not register the dictionary + IOdictionary dict ( IOobject ( @@ -47,13 +46,13 @@ Foam::autoPtr Foam::dynamicFvMesh::New(const IOobject& io) ) ); - word dynamicFvMeshTypeName(dynamicMeshDict.lookup("dynamicFvMesh")); + const word dynamicFvMeshTypeName(dict.lookup("dynamicFvMesh")); Info<< "Selecting dynamicFvMesh " << dynamicFvMeshTypeName << endl; dlLibraryTable::open ( - dynamicMeshDict, + dict, "dynamicFvMeshLibs", IOobjectConstructorTablePtr_ ); @@ -75,8 +74,8 @@ Foam::autoPtr Foam::dynamicFvMesh::New(const IOobject& io) FatalErrorIn ( "dynamicFvMesh::New(const IOobject&)" - ) << "Unknown dynamicFvMesh type " << dynamicFvMeshTypeName - << endl << endl + ) << "Unknown dynamicFvMesh type " + << dynamicFvMeshTypeName << nl << nl << "Valid dynamicFvMesh types are :" << endl << IOobjectConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C index 3619122c6b..9b996ff876 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C @@ -27,20 +27,22 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::solidBodyMotionFunction::New +Foam::autoPtr +Foam::solidBodyMotionFunction::New ( const dictionary& SBMFCoeffs, const Time& runTime ) { - word solidBodyMotionFunctionTypeName = - SBMFCoeffs.lookup("solidBodyMotionFunction"); + const word motionType + ( + SBMFCoeffs.lookup("solidBodyMotionFunction") + ); - Info<< "Selecting solid-body motion function " - << solidBodyMotionFunctionTypeName << endl; + Info<< "Selecting solid-body motion function " << motionType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(solidBodyMotionFunctionTypeName); + dictionaryConstructorTablePtr_->find(motionType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -52,8 +54,8 @@ Foam::autoPtr Foam::solidBodyMotionFunction::New " const Time& runTime" ")" ) << "Unknown solidBodyMotionFunction type " - << solidBodyMotionFunctionTypeName << endl << endl - << "Valid solidBodyMotionFunctions are : " << endl + << motionType << nl << nl + << "Valid solidBodyMotionFunctions are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C index 0dbb3e7377..aadb0781d6 100644 --- a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C +++ b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C @@ -28,36 +28,34 @@ License #include "ListOps.H" #include "meshTools.H" - +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(cellLooper, 0); -defineRunTimeSelectionTable(cellLooper, word); + defineTypeNameAndDebug(cellLooper, 0); + defineRunTimeSelectionTable(cellLooper, word); +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Construct named object from given arguments -autoPtr cellLooper::New +Foam::autoPtr +Foam::cellLooper::New ( const word& type, const polyMesh& mesh ) { wordConstructorTable::iterator cstrIter = - wordConstructorTablePtr_ - ->find(type); + wordConstructorTablePtr_->find(type); if (cstrIter == wordConstructorTablePtr_->end()) { FatalErrorIn ( "cellLooper::New(const word&, const polyMesh&)" - ) << "Unknown set type " << type - << endl << endl + ) << "Unknown set type " + << type << nl << nl << "Valid cellLooper types : " << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -66,7 +64,6 @@ autoPtr cellLooper::New return autoPtr(cstrIter()(mesh)); } -} // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -207,7 +204,6 @@ Foam::label Foam::cellLooper::getMisAlignedEdge // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::cellLooper::cellLooper(const polyMesh& mesh) : edgeVertex(mesh) diff --git a/src/dynamicMesh/meshCut/directions/directions.C b/src/dynamicMesh/meshCut/directions/directions.C index 0ea45f5f04..b49dc435dc 100644 --- a/src/dynamicMesh/meshCut/directions/directions.C +++ b/src/dynamicMesh/meshCut/directions/directions.C @@ -303,7 +303,7 @@ Foam::directions::directions label nDirs = 0; - word coordSystem(dict.lookup("coordinateSystem")); + const word coordSystem(dict.lookup("coordinateSystem")); if (coordSystem == "global") { @@ -341,7 +341,7 @@ Foam::directions::directions { const dictionary& patchDict = dict.subDict("patchLocalCoeffs"); - word patchName(patchDict.lookup("patch")); + const word patchName(patchDict.lookup("patch")); label patchI = mesh.boundaryMesh().findPatchID(patchName); @@ -352,7 +352,8 @@ Foam::directions::directions "directions::directions(const polyMesh&, const dictionary&," "const twoDPointCorrector*" ) << "Cannot find patch " - << patchName << exit(FatalError); + << patchName + << exit(FatalError); } // Take zeroth face on patch @@ -440,7 +441,8 @@ Foam::directions::directions "const twoDPointCorrector*" ) << "Unknown coordinate system " << coordSystem << endl - << "Known types are global and patchLocal" << exit(FatalError); + << "Known types are global and patchLocal" + << exit(FatalError); } } diff --git a/src/dynamicMesh/motionSolver/motionSolver.C b/src/dynamicMesh/motionSolver/motionSolver.C index 764ad193ad..2979d1fe06 100644 --- a/src/dynamicMesh/motionSolver/motionSolver.C +++ b/src/dynamicMesh/motionSolver/motionSolver.C @@ -58,7 +58,8 @@ Foam::motionSolver::motionSolver(const polyMesh& mesh) // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::motionSolver::New(const polyMesh& mesh) +Foam::autoPtr +Foam::motionSolver::New(const polyMesh& mesh) { IOdictionary solverDict ( @@ -75,7 +76,7 @@ Foam::autoPtr Foam::motionSolver::New(const polyMesh& mesh) Istream& msData = solverDict.lookup("solver"); - word solverTypeName(msData); + const word solverTypeName(msData); Info<< "Selecting motion solver: " << solverTypeName << endl; @@ -103,9 +104,9 @@ Foam::autoPtr Foam::motionSolver::New(const polyMesh& mesh) FatalErrorIn ( "motionSolver::New(const polyMesh& mesh)" - ) << "Unknown solver type " << solverTypeName - << endl << endl - << "Valid solver types are: " << endl + ) << "Unknown solver type " + << solverTypeName << nl << nl + << "Valid solver types are:" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C b/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C index f900853459..f7b74a432e 100644 --- a/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C +++ b/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C @@ -26,14 +26,10 @@ License #include "polyMeshModifier.H" #include "dictionary.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -autoPtr polyMeshModifier::New +Foam::autoPtr +Foam::polyMeshModifier::New ( const word& name, const dictionary& dict, @@ -49,10 +45,10 @@ autoPtr polyMeshModifier::New << endl; } - word patchType(dict.lookup("type")); + const word modifierType(dict.lookup("type")); dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(patchType); + dictionaryConstructorTablePtr_->find(modifierType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -61,7 +57,8 @@ autoPtr polyMeshModifier::New "polyMeshModifier::New(const word&, const dictionary&, " "const label, const polyMesh&)", dict - ) << "Unknown polyMeshModifier type " << patchType << endl << endl + ) << "Unknown polyMeshModifier type " + << modifierType << nl << nl << "Valid polyMeshModifier types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -71,8 +68,4 @@ autoPtr polyMeshModifier::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/engine/engineMesh/engineMesh/engineMeshNew.C b/src/engine/engineMesh/engineMesh/engineMeshNew.C index 16db348f1f..d34011d279 100644 --- a/src/engine/engineMesh/engineMesh/engineMeshNew.C +++ b/src/engine/engineMesh/engineMesh/engineMeshNew.C @@ -28,18 +28,17 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::engineMesh::New +Foam::autoPtr +Foam::engineMesh::New ( const Foam::IOobject& io ) { - word engineMeshTypeName; - - // Enclose the creation of the engineGeometry to ensure it is - // deleted before the engineMesh is created otherwise the dictionary - // is entered in the database twice - { - IOdictionary engineGeometryDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -50,23 +49,21 @@ Foam::autoPtr Foam::engineMesh::New IOobject::NO_WRITE, false ) - ); + ).lookup("engineMesh") + ); - engineGeometryDict.lookup("engineMesh") >> engineMeshTypeName; - } - - Info<< "Selecting engineMesh " << engineMeshTypeName << endl; + Info<< "Selecting engineMesh " << modelType << endl; IOobjectConstructorTable::iterator cstrIter = - IOobjectConstructorTablePtr_->find(engineMeshTypeName); + IOobjectConstructorTablePtr_->find(modelType); if (cstrIter == IOobjectConstructorTablePtr_->end()) { FatalErrorIn ( "engineMesh::New(const IOobject&)" - ) << "Unknown engineMesh type " << engineMeshTypeName - << endl << endl + ) << "Unknown engineMesh type " + << modelType << nl << nl << "Valid engineMesh types are :" << endl << IOobjectConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C index d181f56835..db5a422ad1 100644 --- a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C @@ -25,27 +25,19 @@ License #include "SRFModel.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace SRF -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -autoPtr SRFModel::New +Foam::autoPtr +Foam::SRF::SRFModel::New ( const volVectorField& Urel ) { - word SRFModelTypeName; - - // Enclose the creation of the SRFPropertiesDict to ensure it is - // deleted before the SRFModel is created - otherwise the dictionary - // is entered in the database twice - { - IOdictionary SRFPropertiesDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -53,25 +45,24 @@ autoPtr SRFModel::New Urel.time().constant(), Urel.db(), IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("SRFModel") + ); - SRFPropertiesDict.lookup("SRFModel") >> SRFModelTypeName; - } - - Info<< "Selecting SRFModel " << SRFModelTypeName << endl; + Info<< "Selecting SRFModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(SRFModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn ( "SRFModel::New(const fvMesh&)" - ) << "Unknown SRFModel type " << SRFModelTypeName - << nl << nl + ) << "Unknown SRFModel type " + << modelType << nl << nl << "Valid SRFModel types are :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -81,9 +72,4 @@ autoPtr SRFModel::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace SRF -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C index 86884666a9..0e119e7d32 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C @@ -52,8 +52,8 @@ Foam::tmp > Foam::fvPatchField::New ( "fvPatchField::New(const word&, const word&, const fvPatch&, " "const DimensionedField&)" - ) << "Unknown patchTypefield type " << patchFieldType - << endl << endl + ) << "Unknown patchField type " + << patchFieldType << nl << nl << "Valid patchField types are :" << endl << patchConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -104,7 +104,7 @@ Foam::tmp > Foam::fvPatchField::New const dictionary& dict ) { - word patchFieldType(dict.lookup("type")); + const word patchFieldType(dict.lookup("type")); if (debug) { @@ -133,7 +133,7 @@ Foam::tmp > Foam::fvPatchField::New "const dictionary&)", dict ) << "Unknown patchField type " << patchFieldType - << " for patch type " << p.type() << endl << endl + << " for patch type " << p.type() << nl << nl << "Valid patchField types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -200,7 +200,7 @@ Foam::tmp > Foam::fvPatchField::New "fvPatchField::New(const fvPatchField&, " "const fvPatch&, const DimensionedField&, " "const fvPatchFieldMapper&)" - ) << "unknown patchTypefield type " << ptf.type() << endl << endl + ) << "Unknown patchField type " << ptf.type() << nl << nl << "Valid patchField types are :" << endl << patchMapperConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C index b8ad302fdd..dd9b25f1a4 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C @@ -56,8 +56,8 @@ tmp > fvsPatchField::New ( "fvsPatchField::New(const word&, const word&, const fvPatch&" ", const Field&)" - ) << "Unknown patchTypefield type " << patchFieldType - << endl << endl + ) << "Unknown patchField type " + << patchFieldType << nl << nl << "Valid patchField types are :" << endl << patchConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -116,7 +116,7 @@ tmp > fvsPatchField::New << endl; } - word patchFieldType(dict.lookup("type")); + const word patchFieldType(dict.lookup("type")); typename dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(patchFieldType); @@ -136,7 +136,7 @@ tmp > fvsPatchField::New "const dictionary&)", dict ) << "Unknown patchField type " << patchFieldType - << " for patch type " << p.type() << endl << endl + << " for patch type " << p.type() << nl << nl << "Valid patchField types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -204,7 +204,7 @@ tmp > fvsPatchField::New "fvsPatchField::New(const fvsPatchField&, " "const fvPatch&, const Field&, " "const fvPatchFieldMapper&)" - ) << "unknown patchTypefield type " << ptf.type() << endl << endl + ) << "Unknown patchField type " << ptf.type() << nl << nl << "Valid patchField types are :" << endl << patchMapperConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C b/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C index 225aea40c2..f072f57001 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C +++ b/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C @@ -82,7 +82,7 @@ tmp > convectionScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(schemeName); @@ -94,7 +94,7 @@ tmp > convectionScheme::New "convectionScheme::New" "(const fvMesh&, const surfaceScalarField&, Istream&)", schemeData - ) << "unknown convection scheme " << schemeName << endl << endl + ) << "Unknown convection scheme " << schemeName << nl << nl << "Valid convection schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -139,7 +139,7 @@ tmp > convectionScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename MultivariateConstructorTable::iterator cstrIter = MultivariateConstructorTablePtr_->find(schemeName); @@ -153,7 +153,7 @@ tmp > convectionScheme::New "const typename multivariateSurfaceInterpolationScheme" "::fieldTable&, const surfaceScalarField&, Istream&)", schemeData - ) << "unknown convection scheme " << schemeName << endl << endl + ) << "Unknown convection scheme " << schemeName << nl << nl << "Valid convection schemes are :" << endl << MultivariateConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C b/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C index 858e6ecd9a..72c3b907cf 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C @@ -67,7 +67,7 @@ tmp > d2dt2Scheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(schemeName); @@ -78,7 +78,7 @@ tmp > d2dt2Scheme::New ( "d2dt2Scheme::New(const fvMesh&, Istream&)", schemeData - ) << "unknown d2dt2 scheme " << schemeName << endl << endl + ) << "Unknown d2dt2 scheme " << schemeName << nl << nl << "Valid d2dt2 schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C index 71022e571f..260eaec08f 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C @@ -65,7 +65,7 @@ tmp > ddtScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(schemeName); @@ -76,7 +76,7 @@ tmp > ddtScheme::New ( "ddtScheme::New(const fvMesh&, Istream&)", schemeData - ) << "unknown ddt scheme " << schemeName << endl << endl + ) << "Unknown ddt scheme " << schemeName << nl << nl << "Valid ddt schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C b/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C index 51502b701a..9045e8b509 100644 --- a/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C +++ b/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C @@ -68,7 +68,7 @@ tmp > divScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(schemeName); @@ -79,7 +79,8 @@ tmp > divScheme::New ( "divScheme::New(const fvMesh&, Istream&)", schemeData - ) << "unknown div scheme " << schemeName << endl << endl + ) << "unknown div scheme " + << schemeName << nl << nl << "Valid div schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C index 7667e6325f..faba3c984d 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C @@ -57,7 +57,7 @@ Foam::tmp > Foam::fv::gradScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(schemeName); @@ -69,7 +69,7 @@ Foam::tmp > Foam::fv::gradScheme::New "gradScheme::New" "(const fvMesh& mesh, Istream& schemeData)", schemeData - ) << "unknown grad scheme " << schemeName << endl << endl + ) << "Unknown grad scheme " << schemeName << nl << nl << "Valid grad schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C index 6ee704dbe4..fa55b32dbd 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C @@ -66,7 +66,7 @@ tmp > laplacianScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(schemeName); @@ -77,7 +77,7 @@ tmp > laplacianScheme::New ( "laplacianScheme::New(const fvMesh&, Istream&)", schemeData - ) << "unknown laplacian scheme " << schemeName << endl << endl + ) << "Unknown laplacian scheme " << schemeName << nl << nl << "Valid laplacian schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C index 9ebba2a0f1..4c0cf42e7f 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C @@ -68,7 +68,7 @@ tmp > snGradScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename MeshConstructorTable::iterator constructorIter = MeshConstructorTablePtr_->find(schemeName); @@ -79,8 +79,8 @@ tmp > snGradScheme::New ( "snGradScheme::New(const fvMesh&, Istream&)", schemeData - ) << "Unknown discretisation scheme " << schemeName - << endl << endl + ) << "Unknown discretisation scheme " + << schemeName << nl << nl << "Valid schemes are :" << endl << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C index 4a7facee23..b371396989 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C @@ -28,7 +28,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::fvPatch::New +Foam::autoPtr +Foam::fvPatch::New ( const polyPatch& patch, const fvBoundaryMesh& bm @@ -47,7 +48,7 @@ Foam::autoPtr Foam::fvPatch::New if (cstrIter == polyPatchConstructorTablePtr_->end()) { FatalErrorIn("fvPatch::New(const polyPatch&, const fvBoundaryMesh&)") - << "Unknown fvPatch type " << patch.type() << ".\n" + << "Unknown fvPatch type " << patch.type() << nl << "Valid fvPatch types are :" << polyPatchConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C index 2618a1a570..313f6ad1d8 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C @@ -65,7 +65,7 @@ limitedSurfaceInterpolationScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename MeshConstructorTable::iterator constructorIter = MeshConstructorTablePtr_->find(schemeName); @@ -77,8 +77,8 @@ limitedSurfaceInterpolationScheme::New "limitedSurfaceInterpolationScheme::" "New(const fvMesh&, Istream&)", schemeData - ) << "Unknown discretisation scheme " << schemeName - << endl << endl + ) << "Unknown discretisation scheme " + << schemeName << nl << nl << "Valid schemes are :" << endl << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -120,7 +120,7 @@ limitedSurfaceInterpolationScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename MeshFluxConstructorTable::iterator constructorIter = MeshFluxConstructorTablePtr_->find(schemeName); @@ -132,8 +132,8 @@ limitedSurfaceInterpolationScheme::New "limitedSurfaceInterpolationScheme::New" "(const fvMesh&, const surfaceScalarField&, Istream&)", schemeData - ) << "Unknown discretisation scheme " << schemeName - << endl << endl + ) << "Unknown discretisation scheme " + << schemeName << nl << nl << "Valid schemes are :" << endl << MeshFluxConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C index aa349204a8..c7d3cfb451 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C @@ -76,7 +76,7 @@ multivariateSurfaceInterpolationScheme::New << endl; } - word schemeName(schemeData); + const word schemeName(schemeData); typename IstreamConstructorTable::iterator constructorIter = IstreamConstructorTablePtr_->find(schemeName); @@ -89,7 +89,7 @@ multivariateSurfaceInterpolationScheme::New "(const fvMesh& mesh, const fieldTable&, " "const surfaceScalarField&, Istream&)", schemeData - ) << "unknown discretisation scheme " << schemeName << endl << endl + ) << "Unknown discretisation scheme " << schemeName << nl << nl << "Valid schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C index 0a51f574f1..43f52f271b 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C @@ -59,7 +59,7 @@ tmp > surfaceInterpolationScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); if (surfaceInterpolation::debug || surfaceInterpolationScheme::debug) { @@ -79,8 +79,8 @@ tmp > surfaceInterpolationScheme::New ( "surfaceInterpolationScheme::New(const fvMesh&, Istream&)", schemeData - ) << "Unknown discretisation scheme " << schemeName - << endl << endl + ) << "Unknown discretisation scheme " + << schemeName << nl << nl << "Valid schemes are :" << endl << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -113,7 +113,7 @@ tmp > surfaceInterpolationScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); if (surfaceInterpolation::debug || surfaceInterpolationScheme::debug) { @@ -134,8 +134,8 @@ tmp > surfaceInterpolationScheme::New "surfaceInterpolationScheme::New" "(const fvMesh&, const surfaceScalarField&, Istream&)", schemeData - ) << "Unknown discretisation scheme " << schemeName - << endl << endl + ) << "Unknown discretisation scheme " + << schemeName << nl << nl << "Valid schemes are :" << endl << MeshFluxConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C index aad5896b41..3f3b570fff 100644 --- a/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C @@ -30,7 +30,6 @@ License namespace Foam { defineTypeNameAndDebug(motionDiffusivity, 0); - defineRunTimeSelectionTable(motionDiffusivity, Istream); } @@ -45,18 +44,19 @@ Foam::motionDiffusivity::motionDiffusivity(const fvMotionSolver& mSolver) // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::motionDiffusivity::New +Foam::autoPtr +Foam::motionDiffusivity::New ( const fvMotionSolver& mSolver, Istream& mdData ) { - word diffTypeName(mdData); + const word motionType(mdData); - Info<< "Selecting motion diffusion: " << diffTypeName << endl; + Info<< "Selecting motion diffusion: " << motionType << endl; IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(diffTypeName); + IstreamConstructorTablePtr_->find(motionType); if (cstrIter == IstreamConstructorTablePtr_->end()) { @@ -64,8 +64,8 @@ Foam::autoPtr Foam::motionDiffusivity::New ( "motionDiffusivity::New(const tetPolyMesh& tetMesh, " "const Istream& dict)" - ) << "Unknown diffusion type " << diffTypeName - << endl << endl + ) << "Unknown diffusion type " + << motionType << nl << nl << "Valid diffusion types are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/lagrangian/basic/Cloud/CloudIO.C b/src/lagrangian/basic/Cloud/CloudIO.C index d607a3a068..067378c3cf 100644 --- a/src/lagrangian/basic/Cloud/CloudIO.C +++ b/src/lagrangian/basic/Cloud/CloudIO.C @@ -39,7 +39,7 @@ Foam::word Foam::Cloud::cloudPropertiesName("cloudProperties"); template void Foam::Cloud::readCloudUniformProperties() { - IOobject uniformPropsDictHeader + IOobject dictObj ( cloudPropertiesName, time().timeName(), @@ -50,11 +50,11 @@ void Foam::Cloud::readCloudUniformProperties() false ); - if (uniformPropsDictHeader.headerOk()) + if (dictObj.headerOk()) { - const IOdictionary uniformPropsDict(uniformPropsDictHeader); + const IOdictionary uniformPropsDict(dictObj); - word procName("processor" + Foam::name(Pstream::myProcNo())); + const word procName("processor" + Foam::name(Pstream::myProcNo())); if (uniformPropsDict.found(procName)) { uniformPropsDict.subDict(procName).lookup("particleCount") diff --git a/src/lagrangian/dieselSpray/injector/injectorType/injectorType.C b/src/lagrangian/dieselSpray/injector/injectorType/injectorType.C index a78356f9d5..83c9207c4b 100644 --- a/src/lagrangian/dieselSpray/injector/injectorType/injectorType.C +++ b/src/lagrangian/dieselSpray/injector/injectorType/injectorType.C @@ -46,26 +46,29 @@ Foam::injectorType::injectorType // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::injectorType::New +Foam::autoPtr +Foam::injectorType::New ( const Time& t, const dictionary& dict ) { - word injectorTypeName(dict.lookup("injectorType")); + const word modelType + ( + dict.lookup("injectorType") + ); - Info<< "Selecting injectorType " << injectorTypeName << endl; + Info<< "Selecting injectorType " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(injectorTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn("injectorType::New(const dictionary&)") << "Unknown injectorType type " - << injectorTypeName - << ", constructor not in hash table" << nl << nl - << " Valid injector types are:" << nl + << modelType << nl << nl + << "Valid injectorTypes are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } diff --git a/src/lagrangian/dieselSpray/spray/spray.C b/src/lagrangian/dieselSpray/spray/spray.C index 925a6335c3..e21063b569 100644 --- a/src/lagrangian/dieselSpray/spray/spray.C +++ b/src/lagrangian/dieselSpray/spray/spray.C @@ -51,7 +51,6 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::spray::spray ( const volVectorField& U, @@ -340,8 +339,8 @@ Foam::spray::spray Info<< specieName << endl; } - FatalError<< - "The liquid component " << liquidName + FatalError + << "The liquid component " << liquidName << " does not exist in the species composition.Y() list.\n" << "(Probably not defined in )" << abort(FatalError); diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModelNew.C index 1772cace2b..6dda97beae 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModelNew.C +++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModelNew.C @@ -28,47 +28,40 @@ License #include "LISA.H" #include "noAtomization.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -autoPtr atomizationModel::New +Foam::autoPtr +Foam::atomizationModel::New ( const dictionary& dict, spray& sm ) { - word atomizationModelType + const word modelType ( dict.lookup("atomizationModel") ); - Info<< "Selecting atomizationModel " - << atomizationModelType << endl; + Info<< "Selecting atomizationModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(atomizationModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "atomizationModel::New(const dictionary&, const spray&) : " << endl - << " unknown atomizationModelType type " - << atomizationModelType - << ", constructor not in hash table" << endl << endl - << " Valid atomizationModel types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "atomizationModel::New(const dictionary&, const spray&)" + ) << "Unknown atomizationModel type " + << modelType << nl << nl + << "Valid atomizationModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict, sm)); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModelNew.C index 42376b3352..a1e04ffe38 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModelNew.C +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModelNew.C @@ -29,41 +29,37 @@ License #include "reitzDiwakar.H" #include "reitzKHRT.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -autoPtr breakupModel::New +Foam::autoPtr +Foam::breakupModel::New ( const dictionary& dict, spray& sm ) { - word breakupModelType(dict.lookup("breakupModel")); + const word modelType + ( + dict.lookup("breakupModel") + ); - Info<< "Selecting breakupModel " << breakupModelType << endl; + Info<< "Selecting breakupModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(breakupModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn("breakupModel::New(const dictionary&, const spray&)") - << " unknown breakupModelType type " << breakupModelType - << ", constructor not in hash table" << nl << nl - << " Valid breakupModel types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + << "Unknown breakupModel type " + << modelType << nl << nl + << "Valid breakupModel types are :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict, sm)); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/collisionModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/collisionModelNew.C index ffed012ff4..e0d86aa903 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/collisionModelNew.C +++ b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/collisionModelNew.C @@ -30,43 +30,36 @@ License #include "ORourkeCollisionModel.H" #include "trajectoryModel.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -autoPtr collisionModel::New +Foam::autoPtr +Foam::collisionModel::New ( const dictionary& dict, spray& sm, Random& rndGen ) { - word collisionModelType + const word modelType ( dict.lookup("collisionModel") ); - Info<< "Selecting collisionModel " - << collisionModelType << endl; - + Info<< "Selecting collisionModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(collisionModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "collisionModel::New(const dictionary&, const spray&) : " - << endl - << " unknown collisionModelType type " - << collisionModelType - << ", constructor not in hash table" << endl << endl - << " Valid collisionModel types are :" - << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() + FatalErrorIn + ( + "collisionModel::New(const dictionary&, const spray&)" + ) << "Unknown collisionModel type " + << modelType << nl << nl + << "Valid collisionModel types are :" << nl + << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } @@ -74,8 +67,4 @@ autoPtr collisionModel::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/dispersionModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/dispersionModelNew.C index 9cb0ae8f0e..f5fc96605a 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/dispersionModelNew.C +++ b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/dispersionModelNew.C @@ -28,48 +28,39 @@ License #include "dispersionModel.H" #include "noDispersion.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -autoPtr dispersionModel::New +Foam::autoPtr +Foam::dispersionModel::New ( const dictionary& dict, spray& sm ) { - word dispersionModelType + const word modelType ( dict.lookup("dispersionModel") ); - Info<< "Selecting dispersionModel " - << dispersionModelType << endl; + Info<< "Selecting dispersionModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(dispersionModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "dispersionModel::New(const dictionary&, const spray&) : " - << endl - << " unknown dispersionModelType type " - << dispersionModelType - << ", constructor not in hash table" << endl << endl - << " Valid dispersionModel types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "dispersionModel::New(const dictionary&, const spray&)" + ) << "Unknown dispersionModel type " + << modelType << nl << nl + << "Valid dispersionModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict, sm)); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/dragModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/dragModelNew.C index cfa4cd8493..4bc7e5f898 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/dragModelNew.C +++ b/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/dragModelNew.C @@ -30,27 +30,25 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam +Foam::autoPtr +Foam::dragModel::New(const dictionary& dict) { + const word modelType + ( + dict.lookup("dragModel") + ); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -autoPtr dragModel::New(const dictionary& dict) -{ - word dragModelType(dict.lookup("dragModel")); - - Info<< "Selecting dragModel " - << dragModelType << endl; + Info<< "Selecting dragModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(dragModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn("dragModel::New(const dictionary&)") - << "Unknown dragModelType type " << dragModelType - << ", constructor not in hash table" << nl << nl - << " Valid dragModel types are:" << nl + << "Unknown dragModel type " + << modelType << nl << nl + << "Valid dragModel types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } @@ -59,8 +57,4 @@ autoPtr dragModel::New(const dictionary& dict) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/evaporationModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/evaporationModelNew.C index 57d0c0157b..59e80075ff 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/evaporationModelNew.C +++ b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/evaporationModelNew.C @@ -34,7 +34,10 @@ License Foam::autoPtr Foam::evaporationModel::New(const dictionary& dict) { - word modelType(dict.lookup("evaporationModel")); + const word modelType + ( + dict.lookup("evaporationModel") + ); Info<< "Selecting evaporationModel " << modelType << endl; @@ -44,9 +47,8 @@ Foam::evaporationModel::New(const dictionary& dict) if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn("evaporationModel::New(const dictionary&)") - << "Unknown evaporationModelType type " << modelType - << ", constructor not in hash table" << nl << nl - << " Valid evaporationModel types are: " << nl + << "Unknown evaporationModel type " + << modelType << nl << nl << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } diff --git a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/heatTransferModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/heatTransferModelNew.C index e1b8c42336..3c691edfac 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/heatTransferModelNew.C +++ b/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/heatTransferModelNew.C @@ -28,32 +28,31 @@ License #include "heatTransferModel.H" #include "noHeatTransfer.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -autoPtr heatTransferModel::New +Foam::autoPtr +Foam::heatTransferModel::New ( const dictionary& dict ) { - word heatTransferModelType(dict.lookup("heatTransferModel")); + const word modelType + ( + dict.lookup("heatTransferModel") + ); - Info<< "Selecting heatTransferModel " << heatTransferModelType << endl; + Info<< "Selecting heatTransferModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(heatTransferModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn("heatTransferModel::New(const dictionary&)") - << "Unknown heatTransferModelType type " - << heatTransferModelType - << ", constructor not in hash table" << nl << nl - << " Valid heatTransferModel types are:" << nl + << "Unknown heatTransferModel type " + << modelType << nl << nl + << "Valid heatTransferModel types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } @@ -62,8 +61,4 @@ autoPtr heatTransferModel::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C index 343d01a311..7ab341a38e 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C @@ -65,7 +65,8 @@ Foam::ChomiakInjector::ChomiakInjector if (sm.injectors().size() != maxSprayAngle_.size()) { - FatalError << "ChomiakInjector::ChomiakInjector" + FatalError + << "ChomiakInjector::ChomiakInjector" << "(const dictionary& dict, spray& sm)\n" << "Wrong number of entries in maxSprayAngle" << abort(FatalError); diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.C index 52c24b17f8..de57c436e6 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.C @@ -68,7 +68,8 @@ Foam::blobsSwirlInjector::blobsSwirlInjector if (sm.injectors().size() != coneAngle_.size()) { - FatalError << "blobsSwirlInjector::blobsSwirlInjector" + FatalError + << "blobsSwirlInjector::blobsSwirlInjector" << "(const dictionary& dict, spray& sm)\n" << "Wrong number of entries in innerAngle" << abort(FatalError); diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModelNew.C index e92af2e29a..616b0d243a 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModelNew.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModelNew.C @@ -28,33 +28,32 @@ License #include "injectorModel.H" #include "volFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -autoPtr injectorModel::New +Foam::autoPtr +Foam::injectorModel::New ( const dictionary& dict, spray& sm ) { - word injectorModelType(dict.lookup("injectorModel")); + const word modelType + ( + dict.lookup("injectorModel") + ); - Info<< "Selecting injectorModel " - << injectorModelType << endl; + Info<< "Selecting injectorModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(injectorModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn("injectorModel::New(const dictionary&, spray&)") - << "Unknown injectorModelType type " << injectorModelType - << ", constructor not in hash table" << nl << nl - << " Valid injectorModel types are:" << nl + << "Unknown injectorModel type " + << modelType << nl << nl + << "Valid injectorModel types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } @@ -63,8 +62,4 @@ autoPtr injectorModel::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/wallModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/wallModelNew.C index 75a390123a..d281e6a58e 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/wallModelNew.C +++ b/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/wallModelNew.C @@ -27,33 +27,32 @@ License #include "wallModel.H" #include "removeParcel.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -autoPtr wallModel::New +Foam::autoPtr +Foam::wallModel::New ( const dictionary& dict, const volVectorField& U, spray& sm ) { - word wallModelType(dict.lookup("wallModel")); + const word modelType + ( + dict.lookup("wallModel") + ); - Info<< "Selecting wallModel " << wallModelType << endl; + Info<< "Selecting wallModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(wallModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn("wallModel::New(const dictionary&, const spray&)") - << "Unknown wallModelType type " << wallModelType - << ", constructor not in hash table" << nl << nl - << " Valid wallModel types are:" << nl + << "Unknown wallModel type " + << modelType << nl << nl + << "Valid wallModel types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } @@ -62,8 +61,4 @@ autoPtr wallModel::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C index 1746dc608c..24196871fd 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C @@ -35,14 +35,15 @@ Foam::BinaryCollisionModel::New CloudType& owner ) { - word BinaryCollisionModelType(dict.lookup("BinaryCollisionModel")); + const word modelType + ( + dict.lookup("BinaryCollisionModel") + ); - Info<< "Selecting BinaryCollisionModel " - << BinaryCollisionModelType - << endl; + Info<< "Selecting BinaryCollisionModel " << modelType << endl; typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(BinaryCollisionModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -51,11 +52,11 @@ Foam::BinaryCollisionModel::New "BinaryCollisionModel::New" "(const dictionary&, CloudType&)" ) - << "Unknown BinaryCollisionModelType type " - << BinaryCollisionModelType - << ", constructor not in hash table" << nl << nl - << " Valid BinaryCollisionModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + << "Unknown BinaryCollisionModel type " + << modelType << nl << nl + << "Valid BinaryCollisionModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr > diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C index 27388eb389..8a682da17e 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C @@ -35,12 +35,15 @@ Foam::InflowBoundaryModel::New CloudType& owner ) { - word InflowBoundaryModelType(dict.lookup("InflowBoundaryModel")); + const word modelType + ( + dict.lookup("InflowBoundaryModel") + ); - Info<< "Selecting InflowBoundaryModel " << InflowBoundaryModelType << endl; + Info<< "Selecting InflowBoundaryModel " << modelType << endl; typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(InflowBoundaryModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -48,11 +51,11 @@ Foam::InflowBoundaryModel::New ( "InflowBoundaryModel::New" "(const dictionary&, CloudType&)" - ) << "Unknown InflowBoundaryModelType type " - << InflowBoundaryModelType - << ", constructor not in hash table" << nl << nl - << " Valid InflowBoundaryModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + ) << "Unknown InflowBoundaryModel type " + << modelType << nl << nl + << "Valid InflowBoundaryModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C index b7cc575c25..bd421e2d56 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C @@ -35,13 +35,15 @@ Foam::WallInteractionModel::New CloudType& owner ) { - word WallInteractionModelType(dict.lookup("WallInteractionModel")); + const word modelType + ( + dict.lookup("WallInteractionModel") + ); - Info<< "Selecting WallInteractionModel " << WallInteractionModelType - << endl; + Info<< "Selecting WallInteractionModel " << modelType << endl; typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(WallInteractionModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -50,11 +52,11 @@ Foam::WallInteractionModel::New "WallInteractionModel::New" "(const dictionary&, CloudType&)" ) - << "Unknown WallInteractionModelType type " - << WallInteractionModelType - << ", constructor not in hash table" << nl << nl - << " Valid WallInteractionModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + << "Unknown WallInteractionModel type " + << modelType << nl << nl + << "Valid WallInteractionModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntryNew.C b/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntryNew.C index 8cb18924cc..7110b8b7be 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntryNew.C +++ b/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntryNew.C @@ -28,7 +28,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template -Foam::autoPtr > Foam::DataEntry::New +Foam::autoPtr< Foam::DataEntry > +Foam::DataEntry::New ( const word& entryName, const dictionary& dict @@ -43,10 +44,13 @@ Foam::autoPtr > Foam::DataEntry::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn("DataEntry::New(Istream&)") - << "Unknown DataEntry type " << DataEntryType << " for DataEntry " - << entryName << ". Constructor not in hash table" << nl << nl - << " Valid DataEntry types are:" << nl + FatalErrorIn + ( + "DataEntry::New(Istream&)" + ) << "Unknown DataEntry type " + << DataEntryType << " for DataEntry " + << entryName << nl << nl + << "Valid DataEntry types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModelNew.C index e81b6f021d..c503ba60f0 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModelNew.C @@ -35,12 +35,15 @@ Foam::DispersionModel::New CloudType& owner ) { - word DispersionModelType(dict.lookup("DispersionModel")); + const word modelType + ( + dict.lookup("DispersionModel") + ); - Info<< "Selecting DispersionModel " << DispersionModelType << endl; + Info<< "Selecting DispersionModel " << modelType << endl; typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(DispersionModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -51,11 +54,11 @@ Foam::DispersionModel::New "const dictionary&, " "CloudType&" ")" - ) << "Unknown DispersionModelType type " - << DispersionModelType - << ", constructor not in hash table" << nl << nl - << " Valid DispersionModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + ) << "Unknown DispersionModel type " + << modelType << nl << nl + << "Valid DispersionModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModelNew.C index b7028737f6..429f60378c 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModelNew.C @@ -28,18 +28,22 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template -Foam::autoPtr > Foam::DragModel::New +Foam::autoPtr > +Foam::DragModel::New ( const dictionary& dict, CloudType& owner ) { - word DragModelType(dict.lookup("DragModel")); + const word modelType + ( + dict.lookup("DragModel") + ); - Info<< "Selecting DragModel " << DragModelType << endl; + Info<< "Selecting DragModel " << modelType << endl; typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(DragModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -50,10 +54,9 @@ Foam::autoPtr > Foam::DragModel::New "const dictionary&," "CloudType&" ")" - ) << "Unknown DragModelType type " - << DragModelType - << ", constructor not in hash table" << nl << nl - << " Valid DragModel types are:" << nl + ) << "Unknown DragModel type " + << modelType << nl << nl + << "Valid DragModel types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C index f7436f5ada..52a64faa82 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C @@ -319,7 +319,7 @@ Foam::InjectionModel::InjectionModel Info<< " Constructing " << owner.mesh().nGeometricD() << "-D injection" << endl; - word parcelBasisType = coeffDict_.lookup("parcelBasisType"); + const word parcelBasisType = coeffDict_.lookup("parcelBasisType"); if (parcelBasisType == "mass") { parcelBasis_ = pbMass; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C index 6624718248..552a0cc67c 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C @@ -35,12 +35,15 @@ Foam::InjectionModel::New CloudType& owner ) { - word InjectionModelType(dict.lookup("InjectionModel")); + const word modelType + ( + dict.lookup("InjectionModel") + ); - Info<< "Selecting InjectionModel " << InjectionModelType << endl; + Info<< "Selecting InjectionModel " << modelType << endl; typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(InjectionModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -51,10 +54,9 @@ Foam::InjectionModel::New "const dictionary&, " "CloudType&" ")" - ) << "Unknown InjectionModelType type " - << InjectionModelType - << ", constructor not in hash table" << nl << nl - << " Valid InjectionModel types are:" << nl + ) << "Unknown InjectionModel type " + << modelType << nl << nl + << "Valid InjectionModel types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C index a894432e23..07751da5e0 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C @@ -35,13 +35,15 @@ Foam::PatchInteractionModel::New CloudType& owner ) { - word PatchInteractionModelType(dict.lookup("PatchInteractionModel")); + const word modelType + ( + dict.lookup("PatchInteractionModel") + ); - Info<< "Selecting PatchInteractionModel " << PatchInteractionModelType - << endl; + Info<< "Selecting PatchInteractionModel " << modelType << endl; typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(PatchInteractionModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -52,11 +54,11 @@ Foam::PatchInteractionModel::New "const dictionary&, " "CloudType&" ")" - ) << "Unknown PatchInteractionModelType type " - << PatchInteractionModelType - << ", constructor not in hash table" << nl << nl - << " Valid PatchInteractionModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + ) << "Unknown PatchInteractionModel type " + << modelType << nl << nl + << "Valid PatchInteractionModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModelNew.C index bde423cfc4..d4df99d7e8 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModelNew.C @@ -35,12 +35,15 @@ Foam::PostProcessingModel::New CloudType& owner ) { - word PostProcessingModelType(dict.lookup("PostProcessingModel")); + const word modelType + ( + dict.lookup("PostProcessingModel") + ); - Info<< "Selecting PostProcessingModel " << PostProcessingModelType << endl; + Info<< "Selecting PostProcessingModel " << modelType << endl; typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(PostProcessingModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -51,11 +54,11 @@ Foam::PostProcessingModel::New "const dictionary&, " "CloudType&" ")" - ) << "Unknown PostProcessingModelType type " - << PostProcessingModelType - << ", constructor not in hash table" << nl << nl - << " Valid PostProcessingModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + ) << "Unknown PostProcessingModel type " + << modelType << nl << nl + << "Valid PostProcessingModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C index 97ced9e959..001972fcad 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C @@ -36,12 +36,15 @@ Foam::SurfaceFilmModel::New const dimensionedVector& g ) { - word SurfaceFilmModelType(dict.lookup("SurfaceFilmModel")); + const word modelType + ( + dict.lookup("SurfaceFilmModel") + ); - Info<< "Selecting SurfaceFilmModel " << SurfaceFilmModelType << endl; + Info<< "Selecting SurfaceFilmModel " << modelType << endl; typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(SurfaceFilmModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -53,10 +56,10 @@ Foam::SurfaceFilmModel::New "CloudType&" ")" ) << "Unknown SurfaceFilmModel type " - << SurfaceFilmModelType - << ", constructor not in hash table" << nl << nl - << " Valid SurfaceFilmModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + << modelType << nl << nl + << "Valid SurfaceFilmModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner, g)); diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C index fc3f5e8f06..8e08d54321 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C @@ -35,12 +35,15 @@ Foam::CompositionModel::New CloudType& owner ) { - word CompositionModelType(dict.lookup("CompositionModel")); + const word modelType + ( + dict.lookup("CompositionModel") + ); - Info<< "Selecting CompositionModel " << CompositionModelType << endl; + Info<< "Selecting CompositionModel " << modelType << endl; typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(CompositionModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -51,10 +54,9 @@ Foam::CompositionModel::New "const dictionary&, " "CloudType&" ")" - ) << "Unknown CompositionModelType type " - << CompositionModelType - << ", constructor not in hash table" << nl << nl - << " Valid CompositionModel types are:" << nl + ) << "Unknown CompositionModel type " + << modelType << nl << nl + << "Valid CompositionModel types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C index 9f2fa34969..8b8987157d 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C @@ -35,12 +35,15 @@ Foam::PhaseChangeModel::New CloudType& owner ) { - word PhaseChangeModelType(dict.lookup("PhaseChangeModel")); + const word modelType + ( + dict.lookup("PhaseChangeModel") + ); - Info<< "Selecting PhaseChangeModel " << PhaseChangeModelType << endl; + Info<< "Selecting PhaseChangeModel " << modelType << endl; typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(PhaseChangeModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -51,11 +54,11 @@ Foam::PhaseChangeModel::New "const dictionary&, " "CloudType&" ")" - ) << "Unknown PhaseChangeModelType type " - << PhaseChangeModelType - << ", constructor not in hash table" << nl << nl - << " Valid PhaseChangeModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + ) << "Unknown PhaseChangeModel type " + << modelType << nl << nl + << "Valid PhaseChangeModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModelNew.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModelNew.C index d5a24aecf6..0609c7b1b7 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModelNew.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModelNew.C @@ -35,13 +35,15 @@ Foam::DevolatilisationModel::New CloudType& owner ) { - word DevolatilisationModelType(dict.lookup("DevolatilisationModel")); + const word modelType + ( + dict.lookup("DevolatilisationModel") + ); - Info<< "Selecting DevolatilisationModel " << DevolatilisationModelType - << endl; + Info<< "Selecting DevolatilisationModel " << modelType << endl; typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(DevolatilisationModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -52,11 +54,11 @@ Foam::DevolatilisationModel::New "const dictionary&, " "CloudType&" ")" - ) << "Unknown DevolatilisationModelType type " - << DevolatilisationModelType - << ", constructor not in hash table" << nl << nl - << " Valid DevolatilisationModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + ) << "Unknown DevolatilisationModel type " + << modelType << nl << nl + << "Valid DevolatilisationModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModelNew.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModelNew.C index a5211728a7..caca8de814 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModelNew.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModelNew.C @@ -35,13 +35,15 @@ Foam::SurfaceReactionModel::New CloudType& owner ) { - word SurfaceReactionModelType(dict.lookup("SurfaceReactionModel")); + const word modelType + ( + dict.lookup("SurfaceReactionModel") + ); - Info<< "Selecting SurfaceReactionModel " << SurfaceReactionModelType - << endl; + Info<< "Selecting SurfaceReactionModel " << modelType << endl; typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(SurfaceReactionModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -52,11 +54,11 @@ Foam::SurfaceReactionModel::New "const dictionary&, " "CloudType&" ")" - ) << "Unknown SurfaceReactionModelType type " - << SurfaceReactionModelType - << ", constructor not in hash table" << nl << nl - << " Valid SurfaceReactionModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + ) << "Unknown SurfaceReactionModel type " + << modelType << nl << nl + << "Valid SurfaceReactionModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModelNew.C b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModelNew.C index 3daef016a0..55719729b1 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModelNew.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModelNew.C @@ -35,12 +35,15 @@ Foam::HeatTransferModel::New CloudType& owner ) { - word HeatTransferModelType(dict.lookup("HeatTransferModel")); + const word modelType + ( + dict.lookup("HeatTransferModel") + ); - Info<< "Selecting HeatTransferModel " << HeatTransferModelType << endl; + Info<< "Selecting HeatTransferModel " << modelType << endl; typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(HeatTransferModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -51,11 +54,11 @@ Foam::HeatTransferModel::New "const dictionary&, " "CloudType&" ")" - ) << "Unknown HeatTransferModelType type " - << HeatTransferModelType - << ", constructor not in hash table" << nl << nl - << " Valid HeatTransferModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + ) << "Unknown HeatTransferModel type " + << modelType << nl << nl + << "Valid HeatTransferModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C index b6d93b721d..b329a9a45a 100644 --- a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C +++ b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C @@ -64,9 +64,8 @@ void Foam::moleculeCloud::buildConstProps() forAll(idList, i) { - const word& id(idList[i]); - - const dictionary& molDict(moleculePropertiesDict.subDict(id)); + const word& id = idList[i]; + const dictionary& molDict = moleculePropertiesDict.subDict(id); List siteIdNames = molDict.lookup("siteIds"); @@ -1162,9 +1161,9 @@ void Foam::moleculeCloud::applyConstraintsAndThermostats void Foam::moleculeCloud::writeXYZ(const fileName& fName) const { - OFstream str(fName); + OFstream os(fName); - str << nSites() << nl << "moleculeCloud site positions in angstroms" << nl; + os << nSites() << nl << "moleculeCloud site positions in angstroms" << nl; forAllConstIter(moleculeCloud, *this, mol) { @@ -1174,7 +1173,7 @@ void Foam::moleculeCloud::writeXYZ(const fileName& fName) const { const point& sP = mol().sitePositions()[i]; - str << pot_.siteIdList()[cP.siteIds()[i]] + os << pot_.siteIdList()[cP.siteIds()[i]] << ' ' << sP.x()*1e10 << ' ' << sP.y()*1e10 << ' ' << sP.z()*1e10 diff --git a/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C b/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C index c6348ccf55..66d8b4d636 100644 --- a/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C +++ b/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C @@ -25,31 +25,28 @@ License #include "energyScalingFunction.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -autoPtr energyScalingFunction::New +Foam::autoPtr +Foam::energyScalingFunction::New ( const word& name, const dictionary& energyScalingFunctionProperties, const pairPotential& pairPot ) { - word energyScalingFunctionTypeName + const word scalingType ( energyScalingFunctionProperties.lookup("energyScalingFunction") ); Info<< "Selecting energy scaling function " - << energyScalingFunctionTypeName << " for " + << scalingType << " for " << name << " potential energy." << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(energyScalingFunctionTypeName); + dictionaryConstructorTablePtr_->find(scalingType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -57,8 +54,8 @@ autoPtr energyScalingFunction::New ( "energyScalingFunction::New()" ) << "Unknown energyScalingFunction type " - << energyScalingFunctionTypeName << nl << nl - << "Valid energyScalingFunctions are: " << nl + << scalingType << nl << nl + << "Valid energyScalingFunctions are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -68,8 +65,4 @@ autoPtr energyScalingFunction::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C index 468c728777..acbec90e29 100644 --- a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C +++ b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C @@ -25,27 +25,27 @@ License #include "pairPotential.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -autoPtr pairPotential::New +Foam::autoPtr +Foam::pairPotential::New ( const word& name, const dictionary& pairPotentialProperties ) { - word pairPotentialTypeName(pairPotentialProperties.lookup("pairPotential")); + const word potentialType + ( + pairPotentialProperties.lookup("pairPotential") + ); Info<< nl << "Selecting intermolecular pair potential " - << pairPotentialTypeName << " for " + << potentialType << " for " << name << " interaction." << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(pairPotentialTypeName); + dictionaryConstructorTablePtr_->find(potentialType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -53,8 +53,8 @@ autoPtr pairPotential::New ( "pairPotential::New()" ) << "Unknown pairPotential type " - << pairPotentialTypeName << nl << nl - << "Valid pairPotentials are: " << nl + << potentialType << nl << nl + << "Valid pairPotentials are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -64,8 +64,4 @@ autoPtr pairPotential::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/lagrangian/molecularDynamics/potential/potential/potential.C b/src/lagrangian/molecularDynamics/potential/potential/potential.C index d84013236f..4b3475f66c 100644 --- a/src/lagrangian/molecularDynamics/potential/potential/potential.C +++ b/src/lagrangian/molecularDynamics/potential/potential/potential.C @@ -27,10 +27,9 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void Foam::potential::setSiteIdList(const IOdictionary& moleculePropertiesDict) +void Foam::potential::setSiteIdList(const dictionary& moleculePropertiesDict) { DynamicList siteIdList; - DynamicList pairPotentialSiteIdList; forAll(idList_, i) @@ -39,7 +38,7 @@ void Foam::potential::setSiteIdList(const IOdictionary& moleculePropertiesDict) if (!moleculePropertiesDict.found(id)) { - FatalErrorIn("potential::setSiteIdList(const IOdictionary&)") + FatalErrorIn("potential::setSiteIdList(const dictionary&)") << id << " molecule subDict not found" << nl << abort(FatalError); } @@ -66,7 +65,7 @@ void Foam::potential::setSiteIdList(const IOdictionary& moleculePropertiesDict) if (findIndex(siteIdNames, siteId) == -1) { - FatalErrorIn("potential::setSiteIdList(const IOdictionary&)") + FatalErrorIn("potential::setSiteIdList(const dictionary&)") << siteId << " in pairPotentialSiteIds is not in siteIds: " << siteIdNames << nl << abort(FatalError); } @@ -112,21 +111,22 @@ void Foam::potential::potential::readPotentialDict() idList_ = List(idListDict.lookup("idList")); - IOdictionary moleculePropertiesDict + setSiteIdList ( - IOobject + IOdictionary ( - "moleculeProperties", - mesh_.time().constant(), - mesh_, - IOobject::MUST_READ, - IOobject::NO_WRITE, - false + IOobject + ( + "moleculeProperties", + mesh_.time().constant(), + mesh_, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ) ) ); - setSiteIdList(moleculePropertiesDict); - List pairPotentialSiteIdList ( SubList(siteIdList_, nPairPotIds_) diff --git a/src/lagrangian/molecularDynamics/potential/potential/potential.H b/src/lagrangian/molecularDynamics/potential/potential/potential.H index 8ea0043784..1ebf03a428 100644 --- a/src/lagrangian/molecularDynamics/potential/potential/potential.H +++ b/src/lagrangian/molecularDynamics/potential/potential/potential.H @@ -76,7 +76,7 @@ class potential // Private Member Functions - void setSiteIdList(const IOdictionary& moleculePropertiesDict); + void setSiteIdList(const dictionary& moleculePropertiesDict); void readPotentialDict(); diff --git a/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C b/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C index 2950c4578d..917d2ad209 100644 --- a/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C +++ b/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C @@ -27,29 +27,24 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -autoPtr tetherPotential::New +Foam::autoPtr +Foam::tetherPotential::New ( const word& name, const dictionary& tetherPotentialProperties ) { - word - tetherPotentialTypeName - ( - tetherPotentialProperties.lookup("tetherPotential") - ); + const word potentialType + ( + tetherPotentialProperties.lookup("tetherPotential") + ); Info<< nl << "Selecting tether potential " - << tetherPotentialTypeName << " for " + << potentialType << " for " << name << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(tetherPotentialTypeName); + dictionaryConstructorTablePtr_->find(potentialType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -57,8 +52,8 @@ autoPtr tetherPotential::New ( "tetherPotential::New()" ) << "Unknown tetherPotential type " - << tetherPotentialTypeName << nl << nl - << "Valid tetherPotentials are: " << nl + << potentialType << nl << nl + << "Valid tetherPotentials are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -68,8 +63,4 @@ autoPtr tetherPotential::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/mesh/blockMesh/curvedEdges/curvedEdge.C b/src/mesh/blockMesh/curvedEdges/curvedEdge.C index 85b2921fcc..84d2aa3460 100644 --- a/src/mesh/blockMesh/curvedEdges/curvedEdge.C +++ b/src/mesh/blockMesh/curvedEdges/curvedEdge.C @@ -74,7 +74,8 @@ Foam::autoPtr Foam::curvedEdge::clone() const } -Foam::autoPtr Foam::curvedEdge::New +Foam::autoPtr +Foam::curvedEdge::New ( const pointField& points, Istream& is @@ -87,7 +88,7 @@ Foam::autoPtr Foam::curvedEdge::New << endl; } - word edgeType(is); + const word edgeType(is); IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(edgeType); @@ -95,7 +96,8 @@ Foam::autoPtr Foam::curvedEdge::New if (cstrIter == IstreamConstructorTablePtr_->end()) { FatalErrorIn("curvedEdge::New(const pointField&, Istream&)") - << "Unknown curvedEdge type " << edgeType << endl << endl + << "Unknown curvedEdge type " + << edgeType << nl << nl << "Valid curvedEdge types are" << endl << IstreamConstructorTablePtr_->sortedToc() << abort(FatalError); diff --git a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C index 18f6148270..54d8b2d895 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C @@ -127,7 +127,8 @@ Foam::coordinateRotation::coordinateRotation // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::coordinateRotation::New +Foam::autoPtr +Foam::coordinateRotation::New ( const dictionary& dict ) @@ -159,7 +160,8 @@ Foam::autoPtr Foam::coordinateRotation::New ( "coordinateRotation::New(const dictionary&)", dict - ) << "Unknown coordinateRotation type " << rotType << nl << nl + ) << "Unknown coordinateRotation type " + << rotType << nl << nl << "Valid coordinateRotation types are :" << nl << "[default: axes " << typeName_() << "]" << dictionaryConstructorTablePtr_->sortedToc() diff --git a/src/meshTools/coordinateSystems/coordinateSystemNew.C b/src/meshTools/coordinateSystems/coordinateSystemNew.C index 2ee1df3253..87af596881 100644 --- a/src/meshTools/coordinateSystems/coordinateSystemNew.C +++ b/src/meshTools/coordinateSystems/coordinateSystemNew.C @@ -28,7 +28,8 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::autoPtr Foam::coordinateSystem::New +Foam::autoPtr +Foam::coordinateSystem::New ( const word& name, const dictionary& dict @@ -62,7 +63,8 @@ Foam::autoPtr Foam::coordinateSystem::New ( "coordinateSystem::New(const word&, const dictionary&)", dict - ) << "Unknown coordinateSystem type " << coordType << nl << nl + ) << "Unknown coordinateSystem type " + << coordType << nl << nl << "Valid coordinateSystem types are :" << nl << "[default: " << typeName_() << "]" << dictionaryConstructorTablePtr_->sortedToc() @@ -73,7 +75,8 @@ Foam::autoPtr Foam::coordinateSystem::New } -Foam::autoPtr Foam::coordinateSystem::New +Foam::autoPtr +Foam::coordinateSystem::New ( const word& coordType, const word& name, @@ -99,7 +102,8 @@ Foam::autoPtr Foam::coordinateSystem::New "coordinateSystem::New(const word&, const word&, " "const point&, const coordinateRotation&) : " "constructing coordinateSystem" - ) << "Unknown coordinateSystem type " << coordType << nl << nl + ) << "Unknown coordinateSystem type " + << coordType << nl << nl << "Valid coordinateSystem types are :" << nl << origRotationConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -109,7 +113,8 @@ Foam::autoPtr Foam::coordinateSystem::New } -Foam::autoPtr Foam::coordinateSystem::New +Foam::autoPtr +Foam::coordinateSystem::New ( Istream& is ) diff --git a/src/meshTools/searchableSurface/searchableSurface.C b/src/meshTools/searchableSurface/searchableSurface.C index 5d6f6eb7eb..8c2deab0c3 100644 --- a/src/meshTools/searchableSurface/searchableSurface.C +++ b/src/meshTools/searchableSurface/searchableSurface.C @@ -30,13 +30,16 @@ License namespace Foam { - -defineTypeNameAndDebug(searchableSurface, 0); -defineRunTimeSelectionTable(searchableSurface, dict); + defineTypeNameAndDebug(searchableSurface, 0); + defineRunTimeSelectionTable(searchableSurface, dict); +} -// Construct named object from dictionary -autoPtr searchableSurface::New +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +Foam::autoPtr +Foam::searchableSurface::New ( const word& searchableSurfaceType, const IOobject& io, @@ -78,7 +81,4 @@ Foam::searchableSurface::~searchableSurface() {} -} // End namespace Foam - - // ************************************************************************* // diff --git a/src/meshTools/sets/topoSetSource/topoSetSource.C b/src/meshTools/sets/topoSetSource/topoSetSource.C index bddeca6e29..1830364750 100644 --- a/src/meshTools/sets/topoSetSource/topoSetSource.C +++ b/src/meshTools/sets/topoSetSource/topoSetSource.C @@ -31,13 +31,43 @@ License namespace Foam { + defineTypeNameAndDebug(topoSetSource, 0); + defineRunTimeSelectionTable(topoSetSource, word); + defineRunTimeSelectionTable(topoSetSource, istream); +} -defineTypeNameAndDebug(topoSetSource, 0); -defineRunTimeSelectionTable(topoSetSource, word); -defineRunTimeSelectionTable(topoSetSource, istream); -// Construct named object from dictionary -autoPtr topoSetSource::New +Foam::HashTable* Foam::topoSetSource::usageTablePtr_ = NULL; + +template<> +const char* Foam::NamedEnum::names[] = +{ + "clear", + "new", + "invert", + "add", + "delete", + "subset", + "list", + "remove" +}; + + +const Foam::NamedEnum + Foam::topoSetSource::actionNames_; + + +const Foam::string Foam::topoSetSource::illegalSource_ +( + "Illegal topoSetSource name" +); + + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::autoPtr +Foam::topoSetSource::New ( const word& topoSetSourceType, const polyMesh& mesh, @@ -65,8 +95,8 @@ autoPtr topoSetSource::New } -// Construct named object from Istream -autoPtr topoSetSource::New +Foam::autoPtr +Foam::topoSetSource::New ( const word& topoSetSourceType, const polyMesh& mesh, @@ -94,35 +124,6 @@ autoPtr topoSetSource::New } -} // End namespace Foam - - -Foam::HashTable* Foam::topoSetSource::usageTablePtr_ = NULL; - -template<> -const char* Foam::NamedEnum::names[] = -{ - "clear", - "new", - "invert", - "add", - "delete", - "subset", - "list", - "remove" -}; - - -const Foam::NamedEnum - Foam::topoSetSource::actionNames_; - - -const Foam::string Foam::topoSetSource::illegalSource_ -( - "Illegal topoSetSource name" -); - - Foam::Istream& Foam::topoSetSource::checkIs(Istream& is) { if (is.good() && !is.eof()) @@ -161,7 +162,6 @@ void Foam::topoSetSource::addOrDelete // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::topoSetSource::topoSetSource(const polyMesh& mesh) : mesh_(mesh) diff --git a/src/meshTools/sets/topoSets/topoSet.C b/src/meshTools/sets/topoSets/topoSet.C index c578771759..6e4bc3e885 100644 --- a/src/meshTools/sets/topoSets/topoSet.C +++ b/src/meshTools/sets/topoSets/topoSet.C @@ -29,21 +29,21 @@ License #include "boundBox.H" #include "Time.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(topoSet, 0); -defineRunTimeSelectionTable(topoSet, word); -defineRunTimeSelectionTable(topoSet, size); -defineRunTimeSelectionTable(topoSet, set); + defineTypeNameAndDebug(topoSet, 0); + defineRunTimeSelectionTable(topoSet, word); + defineRunTimeSelectionTable(topoSet, size); + defineRunTimeSelectionTable(topoSet, set); +} -// Construct named object from existing set. -autoPtr topoSet::New +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::autoPtr +Foam::topoSet::New ( const word& setType, const polyMesh& mesh, @@ -73,8 +73,8 @@ autoPtr topoSet::New } -// Construct named object from size (non-existing set). -autoPtr topoSet::New +Foam::autoPtr +Foam::topoSet::New ( const word& setType, const polyMesh& mesh, @@ -104,8 +104,8 @@ autoPtr topoSet::New } -// Construct named object from existing set. -autoPtr topoSet::New +Foam::autoPtr +Foam::topoSet::New ( const word& setType, const polyMesh& mesh, @@ -135,7 +135,7 @@ autoPtr topoSet::New } -Foam::fileName topoSet::topoSet::localPath +Foam::fileName Foam::topoSet::topoSet::localPath ( const polyMesh& mesh, const word& name @@ -149,7 +149,7 @@ Foam::fileName topoSet::topoSet::localPath // Update stored cell numbers using map. // Do in two passes to prevent allocation if nothing changed. -void topoSet::topoSet::updateLabels(const labelList& map) +void Foam::topoSet::topoSet::updateLabels(const labelList& map) { // Iterate over map to see if anything changed bool changed = false; @@ -197,7 +197,7 @@ void topoSet::topoSet::updateLabels(const labelList& map) } -void topoSet::topoSet::check(const label maxLabel) +void Foam::topoSet::topoSet::check(const label maxLabel) { forAllConstIter(topoSet, *this, iter) { @@ -214,7 +214,7 @@ void topoSet::topoSet::check(const label maxLabel) // Write maxElem elements, starting at iter. Updates iter and elemI. -void topoSet::writeDebug +void Foam::topoSet::writeDebug ( Ostream& os, const label maxElem, @@ -239,7 +239,7 @@ void topoSet::writeDebug // Write maxElem elements, starting at iter. Updates iter and elemI. -void topoSet::writeDebug +void Foam::topoSet::writeDebug ( Ostream& os, const pointField& coords, @@ -264,7 +264,7 @@ void topoSet::writeDebug } -void topoSet::writeDebug +void Foam::topoSet::writeDebug ( Ostream& os, const pointField& coords, @@ -308,7 +308,7 @@ void topoSet::writeDebug // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -topoSet::topoSet(const IOobject& obj, const word& wantedType) +Foam::topoSet::topoSet(const IOobject& obj, const word& wantedType) : regIOobject(obj) { @@ -331,7 +331,7 @@ topoSet::topoSet(const IOobject& obj, const word& wantedType) } -topoSet::topoSet +Foam::topoSet::topoSet ( const polyMesh& mesh, const word& wantedType, @@ -378,7 +378,7 @@ topoSet::topoSet } -topoSet::topoSet +Foam::topoSet::topoSet ( const polyMesh& mesh, const word& name, @@ -408,7 +408,7 @@ topoSet::topoSet {} -topoSet::topoSet +Foam::topoSet::topoSet ( const polyMesh& mesh, const word& name, @@ -438,14 +438,14 @@ topoSet::topoSet {} -topoSet::topoSet(const IOobject& obj, const label size) +Foam::topoSet::topoSet(const IOobject& obj, const label size) : regIOobject(obj), labelHashSet(size) {} -topoSet::topoSet(const IOobject& obj, const labelHashSet& set) +Foam::topoSet::topoSet(const IOobject& obj, const labelHashSet& set) : regIOobject(obj), labelHashSet(set) @@ -455,13 +455,13 @@ topoSet::topoSet(const IOobject& obj, const labelHashSet& set) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -topoSet::~topoSet() +Foam::topoSet::~topoSet() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void topoSet::invert(const label maxLen) +void Foam::topoSet::invert(const label maxLen) { // Keep copy of current set. labelHashSet currentSet(*this); @@ -480,7 +480,7 @@ void topoSet::invert(const label maxLen) } -void topoSet::subset(const topoSet& set) +void Foam::topoSet::subset(const topoSet& set) { // Keep copy of current set. labelHashSet currentSet(*this); @@ -499,7 +499,7 @@ void topoSet::subset(const topoSet& set) } -void topoSet::addSet(const topoSet& set) +void Foam::topoSet::addSet(const topoSet& set) { forAllConstIter(topoSet, set, iter) { @@ -508,7 +508,7 @@ void topoSet::addSet(const topoSet& set) } -void topoSet::deleteSet(const topoSet& set) +void Foam::topoSet::deleteSet(const topoSet& set) { forAllConstIter(topoSet, set, iter) { @@ -517,13 +517,13 @@ void topoSet::deleteSet(const topoSet& set) } -void topoSet::sync(const polyMesh&) +void Foam::topoSet::sync(const polyMesh&) { notImplemented("topoSet::sync(const polyMesh&)"); } -void topoSet::writeDebug(Ostream& os, const label maxLen) const +void Foam::topoSet::writeDebug(Ostream& os, const label maxLen) const { label n = 0; @@ -554,7 +554,7 @@ void topoSet::writeDebug(Ostream& os, const label maxLen) const } -//void topoSet::writeDebug +//void Foam::topoSet::writeDebug //( // Ostream&, // const primitiveMesh&, @@ -568,13 +568,13 @@ void topoSet::writeDebug(Ostream& os, const label maxLen) const //} -bool topoSet::writeData(Ostream& os) const +bool Foam::topoSet::writeData(Ostream& os) const { return (os << *this).good(); } -void topoSet::updateMesh(const mapPolyMesh&) +void Foam::topoSet::updateMesh(const mapPolyMesh&) { notImplemented("topoSet::updateMesh(const mapPolyMesh&)"); } @@ -590,14 +590,10 @@ void topoSet::updateMesh(const mapPolyMesh&) // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // -void topoSet::operator=(const topoSet& rhs) +void Foam::topoSet::operator=(const topoSet& rhs) { labelHashSet::operator=(rhs); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C index 844272e98b..adc86641a8 100644 --- a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C +++ b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C @@ -42,18 +42,21 @@ namespace Foam // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::autoPtr Foam::decompositionMethod::New +Foam::autoPtr +Foam::decompositionMethod::New ( const dictionary& decompositionDict ) { - word decompositionMethodTypeName(decompositionDict.lookup("method")); + const word methodType + ( + decompositionDict.lookup("method") + ); - Info<< "Selecting decompositionMethod " - << decompositionMethodTypeName << endl; + Info<< "Selecting decompositionMethod " << methodType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(decompositionMethodTypeName); + dictionaryConstructorTablePtr_->find(methodType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -62,7 +65,7 @@ Foam::autoPtr Foam::decompositionMethod::New "decompositionMethod::New" "(const dictionary& decompositionDict)" ) << "Unknown decompositionMethod " - << decompositionMethodTypeName << endl << endl + << methodType << nl << nl << "Valid decompositionMethods are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -72,19 +75,22 @@ Foam::autoPtr Foam::decompositionMethod::New } -Foam::autoPtr Foam::decompositionMethod::New +Foam::autoPtr +Foam::decompositionMethod::New ( const dictionary& decompositionDict, const polyMesh& mesh ) { - word decompositionMethodTypeName(decompositionDict.lookup("method")); + const word methodType + ( + decompositionDict.lookup("method") + ); - Info<< "Selecting decompositionMethod " - << decompositionMethodTypeName << endl; + Info<< "Selecting decompositionMethod " << methodType << endl; dictionaryMeshConstructorTable::iterator cstrIter = - dictionaryMeshConstructorTablePtr_->find(decompositionMethodTypeName); + dictionaryMeshConstructorTablePtr_->find(methodType); if (cstrIter == dictionaryMeshConstructorTablePtr_->end()) { @@ -94,7 +100,7 @@ Foam::autoPtr Foam::decompositionMethod::New "(const dictionary& decompositionDict, " "const polyMesh& mesh)" ) << "Unknown decompositionMethod " - << decompositionMethodTypeName << endl << endl + << methodType << nl << nl << "Valid decompositionMethods are : " << endl << dictionaryMeshConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/parallel/decompose/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C b/src/parallel/decompose/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C index 1c3619a17e..98f8081608 100644 --- a/src/parallel/decompose/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C +++ b/src/parallel/decompose/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C @@ -53,7 +53,7 @@ namespace Foam void Foam::hierarchGeomDecomp::setDecompOrder() { - word order(geomDecomDict_.lookup("order")); + const word order(geomDecomDict_.lookup("order")); if (order.size() != 3) { diff --git a/src/postProcessing/foamCalcFunctions/calcType/calcTypeNew.C b/src/postProcessing/foamCalcFunctions/calcType/calcTypeNew.C index e95a314581..ef2930b759 100644 --- a/src/postProcessing/foamCalcFunctions/calcType/calcTypeNew.C +++ b/src/postProcessing/foamCalcFunctions/calcType/calcTypeNew.C @@ -27,7 +27,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::calcType::New +Foam::autoPtr +Foam::calcType::New ( const word& calcTypeName ) @@ -40,9 +41,8 @@ Foam::autoPtr Foam::calcType::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn("calcType::New()") - << " unknown calcType type " << calcTypeName - << ", constructor not in hash table" << nl << nl - << " Valid calcType selections are: " << nl + << "Unknown calcType type " << calcTypeName + << "Valid calcType selections are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << nl << abort(FatalError); } diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C index 37a60039f6..19d639eaf2 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C @@ -30,17 +30,16 @@ License Foam::autoPtr Foam::sixDoFRigidBodyMotionConstraint::New(const dictionary& sDoFRBMCDict) { - word sixDoFRigidBodyMotionConstraintTypeName = - sDoFRBMCDict.lookup("sixDoFRigidBodyMotionConstraint"); + const word constraintType + ( + sDoFRBMCDict.lookup("sixDoFRigidBodyMotionConstraint") + ); // Info<< "Selecting sixDoFRigidBodyMotionConstraint function " - // << sixDoFRigidBodyMotionConstraintTypeName << endl; + // << constraintType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find - ( - sixDoFRigidBodyMotionConstraintTypeName - ); + dictionaryConstructorTablePtr_->find(constraintType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -51,8 +50,8 @@ Foam::sixDoFRigidBodyMotionConstraint::New(const dictionary& sDoFRBMCDict) "const dictionary& sDoFRBMCDict" ")" ) << "Unknown sixDoFRigidBodyMotionConstraint type " - << sixDoFRigidBodyMotionConstraintTypeName << endl << endl - << "Valid sixDoFRigidBodyMotionConstraints are : " << endl + << constraintType << nl << nl + << "Valid sixDoFRigidBodyMotionConstraints are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C index 71eb61ea3b..05b575e946 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C @@ -30,17 +30,16 @@ License Foam::autoPtr Foam::sixDoFRigidBodyMotionRestraint::New(const dictionary& sDoFRBMRDict) { - word sixDoFRigidBodyMotionRestraintTypeName = - sDoFRBMRDict.lookup("sixDoFRigidBodyMotionRestraint"); + const word restraintType + ( + sDoFRBMRDict.lookup("sixDoFRigidBodyMotionRestraint") + ); // Info<< "Selecting sixDoFRigidBodyMotionRestraint function " - // << sixDoFRigidBodyMotionRestraintTypeName << endl; + // << restraintType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find - ( - sixDoFRigidBodyMotionRestraintTypeName - ); + dictionaryConstructorTablePtr_->find(restraintType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -51,8 +50,8 @@ Foam::sixDoFRigidBodyMotionRestraint::New(const dictionary& sDoFRBMRDict) "const dictionary& sDoFRBMRDict" ")" ) << "Unknown sixDoFRigidBodyMotionRestraint type " - << sixDoFRigidBodyMotionRestraintTypeName << endl << endl - << "Valid sixDoFRigidBodyMotionRestraints are : " << endl + << restraintType << nl << nl + << "Valid sixDoFRigidBodyMotionRestraint types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C index 285eb7ac10..d24ac8d366 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C @@ -193,7 +193,7 @@ bool Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::read moment_ = interpolationTable(sDoFRBMRCoeffs_); - word angleFormat = sDoFRBMRCoeffs_.lookup("angleFormat"); + const word angleFormat = sDoFRBMRCoeffs_.lookup("angleFormat"); if (angleFormat == "degrees" || angleFormat == "degree") { @@ -210,7 +210,7 @@ bool Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::read "Foam::sixDoFRigidBodyMotionRestraints::" "tabulatedAxialAngularSpring::read" "(" - "const dictionary& sDoFRBMCDict" + "const dictionary&" ")" ) << "angleFormat must be degree, degrees, radian or radians" diff --git a/src/sampling/sampledSet/sampledSet/sampledSet.C b/src/sampling/sampledSet/sampledSet/sampledSet.C index 152016b7a3..fa867d813f 100644 --- a/src/sampling/sampledSet/sampledSet/sampledSet.C +++ b/src/sampling/sampledSet/sampledSet/sampledSet.C @@ -406,7 +406,8 @@ Foam::sampledSet::~sampledSet() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::autoPtr Foam::sampledSet::New +Foam::autoPtr +Foam::sampledSet::New ( const word& name, const polyMesh& mesh, @@ -414,7 +415,10 @@ Foam::autoPtr Foam::sampledSet::New const dictionary& dict ) { - word sampleType(dict.lookup("type")); + const word sampleType + ( + dict.lookup("type") + ); wordConstructorTable::iterator cstrIter = wordConstructorTablePtr_->find(sampleType); @@ -423,10 +427,10 @@ Foam::autoPtr Foam::sampledSet::New { FatalErrorIn ( - "sampledSet::New(const word&, " - "const polyMesh&, meshSearch&, const dictionary&)" - ) << "Unknown sample type " << sampleType - << endl << endl + "sampledSet::New" + "(const word&, const polyMesh&, meshSearch&, const dictionary&)" + ) << "Unknown sample type " + << sampleType << nl << nl << "Valid sample types : " << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/sampling/sampledSet/writers/writer.C b/src/sampling/sampledSet/writers/writer.C index e4a4b5f032..5accc37a0d 100644 --- a/src/sampling/sampledSet/writers/writer.C +++ b/src/sampling/sampledSet/writers/writer.C @@ -31,7 +31,8 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template -Foam::autoPtr > Foam::writer::New +Foam::autoPtr< Foam::writer > +Foam::writer::New ( const word& writeType ) @@ -45,8 +46,8 @@ Foam::autoPtr > Foam::writer::New FatalErrorIn ( "writer::New(const word&)" - ) << "Unknown write type " << writeType - << endl << endl + ) << "Unknown write type " + << writeType << nl << nl << "Valid write types : " << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C index 21e6ac7e96..8422825104 100644 --- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C +++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C @@ -122,7 +122,10 @@ Foam::sampledSurface::New const dictionary& dict ) { - word sampleType(dict.lookup("type")); + const word sampleType + ( + dict.lookup("type") + ); if (debug) { Info<< "Selecting sampledType " << sampleType << endl; @@ -137,8 +140,8 @@ Foam::sampledSurface::New ( "sampledSurface::New" "(const word&, const polyMesh&, const dictionary&)" - ) << "Unknown sample type " << sampleType - << endl << endl + ) << "Unknown sample type " + << sampleType << nl << nl << "Valid sample types : " << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C index 7bddebcc8e..ff382bb6c3 100644 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C @@ -34,7 +34,10 @@ Foam::surfaceFilmModels::injectionModel::New const dictionary& dict ) { - word modelType(dict.lookup("injectionModel")); + const word modelType + ( + dict.lookup("injectionModel") + ); Info<< " Selecting injectionModel " << modelType << endl; diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C index 7cc04c0027..4ac8687971 100644 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C @@ -34,7 +34,10 @@ Foam::surfaceFilmModels::phaseChangeModel::New const dictionary& dict ) { - word modelType(dict.lookup("phaseChangeModel")); + const word modelType + ( + dict.lookup("phaseChangeModel") + ); Info<< " Selecting phaseChangeModel " << modelType << endl; diff --git a/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModelNew.C b/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModelNew.C index fb9d7e3bb6..78ac50b30f 100644 --- a/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModelNew.C +++ b/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModelNew.C @@ -36,10 +36,10 @@ Foam::surfaceFilmModels::surfaceFilmModel::New const dimensionedVector& g ) { - word modelType; - - { - IOdictionary surfaceFilmPropertiesDict + // get model name, but do not register the dictionary + const word modelType + ( + IOdictionary ( IOobject ( @@ -50,10 +50,8 @@ Foam::surfaceFilmModels::surfaceFilmModel::New IOobject::NO_WRITE, false ) - ); - - surfaceFilmPropertiesDict.lookup("surfaceFilmModel") >> modelType; - } + ).lookup("surfaceFilmModel") + ); Info<< "Selecting surfaceFilmModel " << modelType << endl; diff --git a/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C b/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C index 9d323327b8..bf22d0cb73 100644 --- a/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C +++ b/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C @@ -35,16 +35,15 @@ Foam::barotropicCompressibilityModel::New const word& psiName ) { - word bcModelTypeName + const word modelType ( compressibilityProperties.lookup("barotropicCompressibilityModel") ); - Info<< "Selecting compressibility model " - << bcModelTypeName << endl; + Info<< "Selecting compressibility model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(bcModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -52,8 +51,8 @@ Foam::barotropicCompressibilityModel::New ( "barotropicCompressibilityModel::New(const volScalarField&)" ) << "Unknown barotropicCompressibilityModel type " - << bcModelTypeName << endl << endl - << "Valid barotropicCompressibilityModels are : " << endl + << modelType << nl << nl + << "Valid barotropicCompressibilityModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermoNew.C b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermoNew.C index 4fe563c9e6..81013626c8 100644 --- a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermoNew.C +++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermoNew.C @@ -27,18 +27,17 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::basicPsiThermo::New +Foam::autoPtr +Foam::basicPsiThermo::New ( const fvMesh& mesh ) { - word thermoTypeName; - - // Enclose the creation of the thermophysicalProperties to ensure it is - // deleted before the turbulenceModel is created otherwise the dictionary - // is entered in the database twice - { - IOdictionary thermoDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -46,22 +45,21 @@ Foam::autoPtr Foam::basicPsiThermo::New mesh.time().constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("thermoType") + ); - thermoDict.lookup("thermoType") >> thermoTypeName; - } - - Info<< "Selecting thermodynamics package " << thermoTypeName << endl; + Info<< "Selecting thermodynamics package " << modelType << endl; fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(thermoTypeName); + fvMeshConstructorTablePtr_->find(modelType); if (cstrIter == fvMeshConstructorTablePtr_->end()) { FatalErrorIn("basicPsiThermo::New(const fvMesh&)") - << "Unknown basicPsiThermo type " << thermoTypeName << nl << nl + << "Unknown basicPsiThermo type " << modelType << nl << nl << "Valid basicPsiThermo types are:" << nl << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); diff --git a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermoNew.C b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermoNew.C index 101f05d4fe..19ec52d434 100644 --- a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermoNew.C +++ b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermoNew.C @@ -27,18 +27,17 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::basicRhoThermo::New +Foam::autoPtr +Foam::basicRhoThermo::New ( const fvMesh& mesh ) { - word thermoTypeName; - - // Enclose the creation of the thermophysicalProperties to ensure it is - // deleted before the turbulenceModel is created otherwise the dictionary - // is entered in the database twice - { - IOdictionary thermoDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -46,22 +45,22 @@ Foam::autoPtr Foam::basicRhoThermo::New mesh.time().constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("thermoType") + ); - thermoDict.lookup("thermoType") >> thermoTypeName; - } - - Info<< "Selecting thermodynamics package " << thermoTypeName << endl; + Info<< "Selecting thermodynamics package " << modelType << endl; fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(thermoTypeName); + fvMeshConstructorTablePtr_->find(modelType); if (cstrIter == fvMeshConstructorTablePtr_->end()) { FatalErrorIn("basicRhoThermo::New(const fvMesh&)") - << "Unknown basicRhoThermo type " << thermoTypeName << nl << nl + << "Unknown basicRhoThermo type " + << modelType << nl << nl << "Valid basicRhoThermo types are:" << nl << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelNew.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelNew.C index 85784a6ad5..8ba8a2b7e3 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelNew.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelNew.C @@ -27,20 +27,17 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::psiChemistryModel::New +Foam::autoPtr +Foam::psiChemistryModel::New ( const fvMesh& mesh ) { - word psiChemistryModelType; - word thermoTypeName; - word userModel; - - // Enclose the creation of the chemistrtyProperties to ensure it is - // deleted before the chemistrtyProperties is created otherwise the - // dictionary is entered in the database twice - { - IOdictionary chemistryPropertiesDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word userModel + ( + IOdictionary ( IOobject ( @@ -48,27 +45,26 @@ Foam::autoPtr Foam::psiChemistryModel::New mesh.time().constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("psiChemistryModel") + ); - chemistryPropertiesDict.lookup("psiChemistryModel") >> userModel; + // construct chemistry model type name by inserting first template argument + const label tempOpen = userModel.find('<'); + const label tempClose = userModel.find('>'); - // construct chemistry model type name by inserting first template - // argument - label tempOpen = userModel.find('<'); - label tempClose = userModel.find('>'); + const word className = userModel(0, tempOpen); + const word thermoTypeName = + userModel(tempOpen + 1, tempClose - tempOpen - 1); - word className = userModel(0, tempOpen); - thermoTypeName = userModel(tempOpen + 1, tempClose - tempOpen - 1); - - psiChemistryModelType = - className + '<' + typeName + ',' + thermoTypeName + '>'; - } + const word modelType = + className + '<' + typeName + ',' + thermoTypeName + '>'; if (debug) { - Info<< "Selecting psiChemistryModel " << psiChemistryModelType << endl; + Info<< "Selecting psiChemistryModel " << modelType << endl; } else { @@ -76,16 +72,18 @@ Foam::autoPtr Foam::psiChemistryModel::New } fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(psiChemistryModelType); + fvMeshConstructorTablePtr_->find(modelType); if (cstrIter == fvMeshConstructorTablePtr_->end()) { if (debug) { FatalErrorIn("psiChemistryModelBase::New(const mesh&)") - << "Unknown psiChemistryModel type " << psiChemistryModelType - << nl << nl << "Valid psiChemistryModel types are:" << nl - << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); + << "Unknown psiChemistryModel type " + << modelType << nl << nl + << "Valid psiChemistryModel types are:" << nl + << fvMeshConstructorTablePtr_->sortedToc() << nl + << exit(FatalError); } else { diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelNew.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelNew.C index 6f3b6c4b7c..049549a2e3 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelNew.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelNew.C @@ -27,20 +27,17 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::rhoChemistryModel::New +Foam::autoPtr +Foam::rhoChemistryModel::New ( const fvMesh& mesh ) { - word rhoChemistryModelType; - word thermoTypeName; - word userModel; - - // Enclose the creation of the chemistrtyProperties to ensure it is - // deleted before the chemistrtyProperties is created otherwise the - // dictionary is entered in the database twice - { - IOdictionary chemistryPropertiesDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word userModel + ( + IOdictionary ( IOobject ( @@ -48,27 +45,26 @@ Foam::autoPtr Foam::rhoChemistryModel::New mesh.time().constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("rhoChemistryModel") + ); - chemistryPropertiesDict.lookup("rhoChemistryModel") >> userModel; + // construct chemistry model type name by inserting first template argument + const label tempOpen = userModel.find('<'); + const label tempClose = userModel.find('>'); - // construct chemistry model type name by inserting first template - // argument - label tempOpen = userModel.find('<'); - label tempClose = userModel.find('>'); + const word className = userModel(0, tempOpen); + const word thermoTypeName = + userModel(tempOpen + 1, tempClose - tempOpen - 1); - word className = userModel(0, tempOpen); - thermoTypeName = userModel(tempOpen + 1, tempClose - tempOpen - 1); - - rhoChemistryModelType = - className + '<' + typeName + ',' + thermoTypeName + '>'; - } + const word modelType = + className + '<' + typeName + ',' + thermoTypeName + '>'; if (debug) { - Info<< "Selecting rhoChemistryModel " << rhoChemistryModelType << endl; + Info<< "Selecting rhoChemistryModel " << modelType << endl; } else { @@ -76,16 +72,18 @@ Foam::autoPtr Foam::rhoChemistryModel::New } fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(rhoChemistryModelType); + fvMeshConstructorTablePtr_->find(modelType); if (cstrIter == fvMeshConstructorTablePtr_->end()) { if (debug) { FatalErrorIn("rhoChemistryModelBase::New(const mesh&)") - << "Unknown rhoChemistryModel type " << rhoChemistryModelType - << nl << nl << "Valid rhoChemistryModel types are:" << nl - << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); + << "Unknown rhoChemistryModel type " + << modelType << nl << nl + << "Valid rhoChemistryModel types are:" << nl + << fvMeshConstructorTablePtr_->sortedToc() << nl + << exit(FatalError); } else { @@ -96,9 +94,11 @@ Foam::autoPtr Foam::rhoChemistryModel::New } FatalErrorIn("rhoChemistryModelBase::New(const mesh&)") - << "Unknown rhoChemistryModel type " << userModel - << nl << nl << "Valid rhoChemistryModel types are:" << nl - << models << nl << exit(FatalError); + << "Unknown rhoChemistryModel type " + << userModel << nl << nl + << "Valid rhoChemistryModel types are:" << nl + << models << nl + << exit(FatalError); } } diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C index 44551e14cd..38c7f9d8a8 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C @@ -25,9 +25,6 @@ License #include "chemistrySolver.H" -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template @@ -49,8 +46,4 @@ Foam::chemistrySolver::~chemistrySolver() {} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolverNew.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolverNew.C index f7d7a36a39..625c5b3b69 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolverNew.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolverNew.C @@ -36,9 +36,12 @@ Foam::chemistrySolver::New const word& thermoTypeName ) { - word modelName(model.lookup("chemistrySolver")); + const word modelName + ( + model.lookup("chemistrySolver") + ); - word chemistrySolverType = + const word chemistrySolverType = modelName + '<' + compTypeName + ',' + thermoTypeName + '>'; Info<< "Selecting chemistrySolver " << modelName << endl; @@ -66,8 +69,9 @@ Foam::chemistrySolver::New "const word&, " "const word&" ")" - ) << "Unknown chemistrySolver type " << modelName - << nl << nl << "Valid chemistrySolver types are:" << nl + ) << "Unknown chemistrySolver type " + << modelName << nl << nl + << "Valid chemistrySolver types are:" << nl << models << nl << exit(FatalError); } diff --git a/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C b/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C index 4ed4165d0a..990f84d591 100644 --- a/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C +++ b/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C @@ -27,12 +27,14 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::laminarFlameSpeed::New +Foam::autoPtr +Foam::laminarFlameSpeed::New ( const hhuCombustionThermo& ct ) { - IOdictionary laminarFlameSpeedDict + // do not register the dictionary + IOdictionary propDict ( IOobject ( @@ -45,9 +47,9 @@ Foam::autoPtr Foam::laminarFlameSpeed::New ) ); - word laminarFlameSpeedType + const word laminarFlameSpeedType ( - laminarFlameSpeedDict.lookup("laminarFlameSpeedCorrelation") + propDict.lookup("laminarFlameSpeedCorrelation") ); Info<< "Selecting laminar flame speed correlation " @@ -61,15 +63,15 @@ Foam::autoPtr Foam::laminarFlameSpeed::New FatalIOErrorIn ( "laminarFlameSpeed::New(const hhuCombustionThermo&)", - laminarFlameSpeedDict + propDict ) << "Unknown laminarFlameSpeed type " - << laminarFlameSpeedType << endl << endl + << laminarFlameSpeedType << nl << nl << "Valid laminarFlameSpeed types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } - return autoPtr(cstrIter()(laminarFlameSpeedDict, ct)); + return autoPtr(cstrIter()(propDict, ct)); } diff --git a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C b/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C index 19b88994d6..c3d7ded785 100644 --- a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C +++ b/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C @@ -73,7 +73,8 @@ Foam::liquidMixture::liquidMixture // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::liquidMixture::New +Foam::autoPtr +Foam::liquidMixture::New ( const dictionary& thermophysicalProperties ) diff --git a/src/thermophysicalModels/liquids/liquid/liquid.C b/src/thermophysicalModels/liquids/liquid/liquid.C index 6d84424375..2d9b234859 100644 --- a/src/thermophysicalModels/liquids/liquid/liquid.C +++ b/src/thermophysicalModels/liquids/liquid/liquid.C @@ -39,7 +39,8 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::autoPtr Foam::liquid::New(Istream& is) +Foam::autoPtr +Foam::liquid::New(Istream& is) { if (debug) { @@ -48,9 +49,8 @@ Foam::autoPtr Foam::liquid::New(Istream& is) << endl; } - word liquidType(is); - - word coeffs(is); + const word liquidType(is); + const word coeffs(is); if (coeffs == "defaultCoeffs") { @@ -60,8 +60,8 @@ Foam::autoPtr Foam::liquid::New(Istream& is) if (cstrIter == ConstructorTablePtr_->end()) { FatalErrorIn("liquid::New(Istream&)") - << "Unknown liquid type " << liquidType - << nl << nl + << "Unknown liquid type " + << liquidType << nl << nl << "Valid liquid types are:" << nl << ConstructorTablePtr_->sortedToc() << abort(FatalError); @@ -77,8 +77,8 @@ Foam::autoPtr Foam::liquid::New(Istream& is) if (cstrIter == IstreamConstructorTablePtr_->end()) { FatalErrorIn("liquid::New(Istream&)") - << "Unknown liquid type " << liquidType - << endl << endl + << "Unknown liquid type " + << liquidType << nl << nl << "Valid liquid types are:" << nl << IstreamConstructorTablePtr_->sortedToc() << abort(FatalError); diff --git a/src/thermophysicalModels/pdfs/pdf/pdfNew.C b/src/thermophysicalModels/pdfs/pdf/pdfNew.C index 0ba75a59f0..ca7b5c3e63 100644 --- a/src/thermophysicalModels/pdfs/pdf/pdfNew.C +++ b/src/thermophysicalModels/pdfs/pdf/pdfNew.C @@ -27,23 +27,27 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::pdfs::pdf::New +Foam::autoPtr +Foam::pdfs::pdf::New ( const dictionary& dict, Random& rndGen ) { - word pdfType(dict.lookup("pdfType")); + const word modelType + ( + dict.lookup("pdfType") + ); - Info<< "Selecting pdfType " << pdfType << endl; + Info<< "Selecting pdfType " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(pdfType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn("pdfs::pdf::New(const dictionary&, Random&)") - << "unknown pdf type " << pdfType << nl << nl + << "Unknown pdf type " << modelType << nl << nl << "Valid pdf types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModelNew.C b/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModelNew.C index b179864876..1437b9195d 100644 --- a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModelNew.C +++ b/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModelNew.C @@ -26,26 +26,18 @@ License #include "error.H" #include "radiationModel.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace radiation -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -autoPtr radiationModel::New +Foam::autoPtr +Foam::radiation::radiationModel::New ( const volScalarField& T ) { - word radiationModelTypeName; - - // Note: no need to register/keep radiationProperties since models read - // it themselves. - { - IOdictionary radiationPropertiesDict + // get model name, but do not register the dictionary + const word modelType + ( + IOdictionary ( IOobject ( @@ -56,24 +48,21 @@ autoPtr radiationModel::New IOobject::NO_WRITE, false ) - ); + ).lookup("radiationModel") + ); - radiationPropertiesDict.lookup("radiationModel") - >> radiationModelTypeName; - } - - Info<< "Selecting radiationModel " << radiationModelTypeName << endl; + Info<< "Selecting radiationModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(radiationModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn ( "radiationModel::New(const volScalarField&)" - ) << "Unknown radiationModel type " << radiationModelTypeName - << nl << nl + ) << "Unknown radiationModel type " + << modelType << nl << nl << "Valid radiationModel types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -83,9 +72,4 @@ autoPtr radiationModel::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End radiation -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C index 65ea51c018..827c9f2a62 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C @@ -35,23 +35,24 @@ Foam::radiation::absorptionEmissionModel::New const fvMesh& mesh ) { - word absorptionEmissionModelType(dict.lookup("absorptionEmissionModel")); + const word modelType + ( + dict.lookup("absorptionEmissionModel") + ); - Info<< "Selecting absorptionEmissionModel " - << absorptionEmissionModelType << endl; + Info<< "Selecting absorptionEmissionModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(absorptionEmissionModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn ( "absorptionEmissionModel::New(const dictionary&, const fvMesh&)" - ) << "Unknown absorptionEmissionModelType type " - << absorptionEmissionModelType - << ", constructor not in hash table" << nl << nl - << " Valid absorptionEmissionModel types are :" << nl + ) << "Unknown absorptionEmissionModel type " + << modelType << nl << nl + << "Valid absorptionEmissionModel types are :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C b/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C index 64d4bb567b..83ddcb58c2 100644 --- a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C @@ -28,28 +28,31 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::autoPtr Foam::radiation::scatterModel::New +Foam::autoPtr +Foam::radiation::scatterModel::New ( const dictionary& dict, const fvMesh& mesh ) { - word scatterModelType(dict.lookup("scatterModel")); + const word modelType + ( + dict.lookup("scatterModel") + ); - Info<< "Selecting scatterModel " << scatterModelType << endl; + Info<< "Selecting scatterModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(scatterModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn ( "scatterModel::New(const dictionary&, const fvMesh&)" - ) << "Unknown scatterModelType type " - << scatterModelType - << ", constructor not in hash table" << nl << nl - << " Valid scatterModel types are :" << nl + ) << "Unknown scatterModel type " + << modelType << nl << nl + << "Valid scatterModel types are :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C index 14733bf69f..fca68606a0 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C @@ -35,7 +35,7 @@ Foam::chemistryReader::New ) { // Let the chemistry reader type default to CHEMKIN - // for backward compatability + // for backward compatibility word chemistryReaderTypeName("chemkinReader"); // otherwise use the specified reader @@ -53,7 +53,7 @@ Foam::chemistryReader::New "chemistryReader::New(const dictionary& thermoDict)" ) << "Unknown chemistryReader type " << chemistryReaderTypeName << nl << nl - << "Valid chemistryReaders are: " << nl + << "Valid chemistryReader types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermoNew.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermoNew.C index b19ab43654..309d4d2702 100644 --- a/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermoNew.C +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermoNew.C @@ -28,18 +28,17 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::hCombustionThermo::New +Foam::autoPtr +Foam::hCombustionThermo::New ( const fvMesh& mesh ) { - word hCombustionThermoTypeName; - - // Enclose the creation of the thermophysicalProperties to ensure it is - // deleted before the turbulenceModel is created otherwise the dictionary - // is entered in the database twice - { - IOdictionary thermoDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -47,24 +46,22 @@ Foam::autoPtr Foam::hCombustionThermo::New mesh.time().constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("thermoType") + ); - thermoDict.lookup("thermoType") >> hCombustionThermoTypeName; - } - - Info<< "Selecting thermodynamics package " << hCombustionThermoTypeName - << endl; + Info<< "Selecting thermodynamics package " << modelType << endl; fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(hCombustionThermoTypeName); + fvMeshConstructorTablePtr_->find(modelType); if (cstrIter == fvMeshConstructorTablePtr_->end()) { FatalErrorIn("hCombustionThermo::New(const fvMesh&)") << "Unknown hCombustionThermo type " - << hCombustionThermoTypeName << nl << nl + << modelType << nl << nl << "Valid hCombustionThermo types are:" << nl << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); @@ -74,19 +71,18 @@ Foam::autoPtr Foam::hCombustionThermo::New } -Foam::autoPtr Foam::hCombustionThermo::NewType +Foam::autoPtr +Foam::hCombustionThermo::NewType ( const fvMesh& mesh, const word& thermoType ) { - word hCombustionThermoTypeName; - - // Enclose the creation of the thermophysicalProperties to ensure it is - // deleted before the turbulenceModel is created otherwise the dictionary - // is entered in the database twice - { - IOdictionary thermoDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -94,50 +90,55 @@ Foam::autoPtr Foam::hCombustionThermo::NewType mesh.time().constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("thermoType") + ); - thermoDict.lookup("thermoType") >> hCombustionThermoTypeName; - if (hCombustionThermoTypeName.find(thermoType) == string::npos) + if (modelType.find(thermoType) == string::npos) + { + wordList allModels = fvMeshConstructorTablePtr_->sortedToc(); + DynamicList validModels; + forAll(allModels, i) { - wordList allModels = fvMeshConstructorTablePtr_->sortedToc(); - DynamicList validModels; - forAll(allModels, i) + if (allModels[i].find(thermoType) != string::npos) { - if (allModels[i].find(thermoType) != string::npos) - { - validModels.append(allModels[i]); - } + validModels.append(allModels[i]); } - - FatalErrorIn - ( - "autoPtr hCombustionThermo::NewType" - "(" - "const fvMesh&, " - "const word&" - ")" - ) << "Inconsistent thermo package selected:" << nl << nl - << hCombustionThermoTypeName << nl << nl << "Please select a " - << "thermo package based on " << thermoType - << ". Valid options include:" << nl << validModels << nl - << exit(FatalError); } + + FatalErrorIn + ( + "autoPtr hCombustionThermo::NewType" + "(" + "const fvMesh&, " + "const word&" + ")" + ) << "Inconsistent thermo package selected:" << nl << nl + << modelType << nl << nl << "Please select a " + << "thermo package based on " << thermoType + << ". Valid options include:" << nl << validModels << nl + << exit(FatalError); } - Info<< "Selecting thermodynamics package " << hCombustionThermoTypeName - << endl; + Info<< "Selecting thermodynamics package " << modelType << endl; fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(hCombustionThermoTypeName); + fvMeshConstructorTablePtr_->find(modelType); if (cstrIter == fvMeshConstructorTablePtr_->end()) { - FatalErrorIn("hCombustionThermo::New(const fvMesh&)") - << "Unknown hCombustionThermo type " - << hCombustionThermoTypeName << nl << nl + FatalErrorIn + ( + "autoPtr hCombustionThermo::NewType" + "(" + "const fvMesh&, " + "const word&" + ")" + ) << "Unknown hCombustionThermo type " + << modelType << nl << nl << "Valid hCombustionThermo types are:" << nl << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); diff --git a/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermoNew.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermoNew.C index 8353ee1a2d..805f44449a 100644 --- a/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermoNew.C +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermoNew.C @@ -28,20 +28,14 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam +Foam::autoPtr +Foam::hhuCombustionThermo::New(const fvMesh& mesh) { - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -autoPtr hhuCombustionThermo::New(const fvMesh& mesh) -{ - word hhuCombustionThermoTypeName; - - // Enclose the creation of the thermophysicalProperties to ensure it is - // deleted before the turbulenceModel is created otherwise the dictionary - // is entered in the database twice - { - IOdictionary thermoDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -49,24 +43,22 @@ autoPtr hhuCombustionThermo::New(const fvMesh& mesh) mesh.time().constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("thermoType") + ); - thermoDict.lookup("thermoType") >> hhuCombustionThermoTypeName; - } - - Info<< "Selecting thermodynamics package " - << hhuCombustionThermoTypeName << endl; + Info<< "Selecting thermodynamics package " << modelType << endl; fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(hhuCombustionThermoTypeName); + fvMeshConstructorTablePtr_->find(modelType); if (cstrIter == fvMeshConstructorTablePtr_->end()) { FatalErrorIn("hhuCombustionThermo::New(const fvMesh&)") << "Unknown hhuCombustionThermo type " - << hhuCombustionThermoTypeName << endl << endl + << modelType << nl << nl << "Valid hhuCombustionThermo types are :" << endl << fvMeshConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -76,8 +68,4 @@ autoPtr hhuCombustionThermo::New(const fvMesh& mesh) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermoNew.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermoNew.C index eae3805982..c7b94d1ace 100644 --- a/src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermoNew.C +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermoNew.C @@ -28,18 +28,17 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::hsCombustionThermo::New +Foam::autoPtr +Foam::hsCombustionThermo::New ( const fvMesh& mesh ) { - word hsCombustionThermoTypeName; - - // Enclose the creation of the thermophysicalProperties to ensure it is - // deleted before the turbulenceModel is created otherwise the dictionary - // is entered in the database twice - { - IOdictionary thermoDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -47,25 +46,23 @@ Foam::autoPtr Foam::hsCombustionThermo::New mesh.time().constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("thermoType") + ); - thermoDict.lookup("thermoType") >> hsCombustionThermoTypeName; - } - - Info<< "Selecting thermodynamics package " << hsCombustionThermoTypeName - << endl; + Info<< "Selecting thermodynamics package " << modelType << endl; fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(hsCombustionThermoTypeName); + fvMeshConstructorTablePtr_->find(modelType); if (cstrIter == fvMeshConstructorTablePtr_->end()) { FatalErrorIn("hsCombustionThermo::New(const fvMesh&)") << "Unknown hsCombustionThermo type " - << hsCombustionThermoTypeName << nl << nl - << "Valid hsCombustionThermo types are:" << nl + << modelType << nl << nl + << "Valid hsCombustionThermo types:" << nl << fvMeshConstructorTablePtr_->toc() << nl << exit(FatalError); } @@ -74,19 +71,18 @@ Foam::autoPtr Foam::hsCombustionThermo::New } -Foam::autoPtr Foam::hsCombustionThermo::NewType +Foam::autoPtr +Foam::hsCombustionThermo::NewType ( const fvMesh& mesh, const word& thermoType ) { - word hsCombustionThermoTypeName; - - // Enclose the creation of the thermophysicalProperties to ensure it is - // deleted before the turbulenceModel is created otherwise the dictionary - // is entered in the database twice - { - IOdictionary thermoDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -94,50 +90,54 @@ Foam::autoPtr Foam::hsCombustionThermo::NewType mesh.time().constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("thermoType") + ); - thermoDict.lookup("thermoType") >> hsCombustionThermoTypeName; - - if (hsCombustionThermoTypeName.find(thermoType) == string::npos) + if (modelType.find(thermoType) == string::npos) + { + wordList allModels = fvMeshConstructorTablePtr_->toc(); + DynamicList validModels; + forAll(allModels, i) { - wordList allModels = fvMeshConstructorTablePtr_->toc(); - DynamicList validModels; - forAll(allModels, i) + if (allModels[i].find(thermoType) != string::npos) { - if (allModels[i].find(thermoType) != string::npos) - { - validModels.append(allModels[i]); - } + validModels.append(allModels[i]); } - - FatalErrorIn - ( - "autoPtr hsCombustionThermo::NewType" - "(" - "const fvMesh&, " - "const word&" - ")" - ) << "Inconsistent thermo package selected:" << nl << nl - << hsCombustionThermoTypeName << nl << nl << "Please select a " - << "thermo package based on " << thermoType - << ". Valid options include:" << nl << validModels << nl - << exit(FatalError); } + + FatalErrorIn + ( + "autoPtr hsCombustionThermo::NewType" + "(" + "const fvMesh&, " + "const word&" + ")" + ) << "Inconsistent thermo package selected:" << nl << nl + << modelType << nl << nl << "Please select a " + << "thermo package based on " << thermoType + << ". Valid options include:" << nl << validModels << nl + << exit(FatalError); } - Info<< "Selecting thermodynamics package " << hsCombustionThermoTypeName - << endl; + Info<< "Selecting thermodynamics package " << modelType << endl; fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(hsCombustionThermoTypeName); + fvMeshConstructorTablePtr_->find(modelType); if (cstrIter == fvMeshConstructorTablePtr_->end()) { - FatalErrorIn("hsCombustionThermo::New(const fvMesh&)") - << "Unknown hsCombustionThermo type " - << hsCombustionThermoTypeName << nl << nl + FatalErrorIn + ( + "autoPtr hsCombustionThermo::NewType" + "(" + "const fvMesh&, " + "const word&" + ")" + ) << "Unknown hsCombustionThermo type " + << modelType << nl << nl << "Valid hsCombustionThermo types are:" << nl << fvMeshConstructorTablePtr_->toc() << nl << exit(FatalError); diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermoNew.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermoNew.C index 64808fb72b..6afa8d33e6 100644 --- a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermoNew.C +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermoNew.C @@ -28,18 +28,17 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::hReactionThermo::New +Foam::autoPtr +Foam::hReactionThermo::New ( const fvMesh& mesh ) { - word hReactionThermoTypeName; - - // Enclose the creation of the thermophysicalProperties to ensure it is - // deleted before the turbulenceModel is created otherwise the dictionary - // is entered in the database twice - { - IOdictionary thermoDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -47,25 +46,23 @@ Foam::autoPtr Foam::hReactionThermo::New mesh.time().constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("thermoType") + ); - thermoDict.lookup("thermoType") >> hReactionThermoTypeName; - } - - Info<< "Selecting thermodynamics package " << hReactionThermoTypeName - << endl; + Info<< "Selecting thermodynamics package " << modelType << endl; fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(hReactionThermoTypeName); + fvMeshConstructorTablePtr_->find(modelType); if (cstrIter == fvMeshConstructorTablePtr_->end()) { FatalErrorIn("hReactionThermo::New(const fvMesh&)") << "Unknown hReactionThermo type " - << hReactionThermoTypeName << nl << nl - << "Valid hReactionThermo types are:" << nl + << modelType << nl << nl + << "Valid hReactionThermo types:" << nl << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } @@ -74,19 +71,18 @@ Foam::autoPtr Foam::hReactionThermo::New } -Foam::autoPtr Foam::hReactionThermo::NewType +Foam::autoPtr +Foam::hReactionThermo::NewType ( const fvMesh& mesh, const word& thermoType ) { - word hReactionThermoTypeName; - - // Enclose the creation of the thermophysicalProperties to ensure it is - // deleted before the turbulenceModel is created otherwise the dictionary - // is entered in the database twice - { - IOdictionary thermoDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -94,51 +90,55 @@ Foam::autoPtr Foam::hReactionThermo::NewType mesh.time().constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("thermoType") + ); - thermoDict.lookup("thermoType") >> hReactionThermoTypeName; - - if (hReactionThermoTypeName.find(thermoType) == string::npos) + if (modelType.find(thermoType) == string::npos) + { + wordList allModels = fvMeshConstructorTablePtr_->sortedToc(); + DynamicList validModels; + forAll(allModels, i) { - wordList allModels = fvMeshConstructorTablePtr_->sortedToc(); - DynamicList validModels; - forAll(allModels, i) + if (allModels[i].find(thermoType) != string::npos) { - if (allModels[i].find(thermoType) != string::npos) - { - validModels.append(allModels[i]); - } + validModels.append(allModels[i]); } - - FatalErrorIn - ( - "autoPtr hReactionThermo::NewType" - "(" - "const fvMesh&, " - "const word&" - ")" - ) << "Inconsistent thermo package selected:" << nl << nl - << hReactionThermoTypeName << nl << nl << "Please select a " - << "thermo package based on " << thermoType - << ". Valid options include:" << nl << validModels << nl - << exit(FatalError); } + + FatalErrorIn + ( + "autoPtr hReactionThermo::NewType" + "(" + "const fvMesh&, " + "const word&" + ")" + ) << "Inconsistent thermo package selected:" << nl << nl + << modelType << nl << nl << "Please select a " + << "thermo package based on " << thermoType + << ". Valid options include:" << nl << validModels << nl + << exit(FatalError); } - Info<< "Selecting thermodynamics package " << hReactionThermoTypeName - << endl; + Info<< "Selecting thermodynamics package " << modelType << endl; fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(hReactionThermoTypeName); + fvMeshConstructorTablePtr_->find(modelType); if (cstrIter == fvMeshConstructorTablePtr_->end()) { - FatalErrorIn("hReactionThermo::New(const fvMesh&)") - << "Unknown hReactionThermo type " - << hReactionThermoTypeName << nl << nl - << "Valid hReactionThermo types are:" << nl + FatalErrorIn + ( + "autoPtr hReactionThermo::NewType" + "(" + "const fvMesh&, " + "const word&" + ")" + ) << "Unknown hReactionThermo type " + << modelType << nl << nl + << "Valid hReactionThermo types:" << nl << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermoNew.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermoNew.C index e834777291..f8518cd45f 100644 --- a/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermoNew.C +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermoNew.C @@ -28,18 +28,17 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::hsReactionThermo::New +Foam::autoPtr +Foam::hsReactionThermo::New ( const fvMesh& mesh ) { - word hsReactionThermoTypeName; - - // Enclose the creation of the thermophysicalProperties to ensure it is - // deleted before the turbulenceModel is created otherwise the dictionary - // is entered in the database twice - { - IOdictionary thermoDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -47,25 +46,23 @@ Foam::autoPtr Foam::hsReactionThermo::New mesh.time().constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("thermoType") + ); - thermoDict.lookup("thermoType") >> hsReactionThermoTypeName; - } - - Info<< "Selecting thermodynamics package " << hsReactionThermoTypeName - << endl; + Info<< "Selecting thermodynamics package " << modelType << endl; fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(hsReactionThermoTypeName); + fvMeshConstructorTablePtr_->find(modelType); if (cstrIter == fvMeshConstructorTablePtr_->end()) { FatalErrorIn("hsReactionThermo::New(const fvMesh&)") << "Unknown hsReactionThermo type " - << hsReactionThermoTypeName << nl << nl - << "Valid hsReactionThermo types are:" << nl + << modelType << nl << nl + << "Valid hsReactionThermo types:" << nl << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } @@ -74,19 +71,18 @@ Foam::autoPtr Foam::hsReactionThermo::New } -Foam::autoPtr Foam::hsReactionThermo::NewType +Foam::autoPtr +Foam::hsReactionThermo::NewType ( const fvMesh& mesh, const word& thermoType ) { - word hsReactionThermoTypeName; - - // Enclose the creation of the thermophysicalProperties to ensure it is - // deleted before the turbulenceModel is created otherwise the dictionary - // is entered in the database twice - { - IOdictionary thermoDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -94,51 +90,51 @@ Foam::autoPtr Foam::hsReactionThermo::NewType mesh.time().constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("thermoType") + ); - thermoDict.lookup("thermoType") >> hsReactionThermoTypeName; + Info<< "Selecting thermodynamics package " << modelType << endl; - if (hsReactionThermoTypeName.find(thermoType) == string::npos) + if (modelType.find(thermoType) == string::npos) + { + wordList allModels = fvMeshConstructorTablePtr_->sortedToc(); + DynamicList validModels; + forAll(allModels, i) { - wordList allModels = fvMeshConstructorTablePtr_->sortedToc(); - DynamicList validModels; - forAll(allModels, i) + if (allModels[i].find(thermoType) != string::npos) { - if (allModels[i].find(thermoType) != string::npos) - { - validModels.append(allModels[i]); - } + validModels.append(allModels[i]); } - - FatalErrorIn - ( - "autoPtr hsReactionThermo::NewType" - "(" - "const fvMesh&, " - "const word&" - ")" - ) << "Inconsistent thermo package selected:" << nl << nl - << hsReactionThermoTypeName << nl << nl << "Please select a " - << "thermo package based on " << thermoType - << ". Valid options include:" << nl << validModels << nl - << exit(FatalError); } + + FatalErrorIn + ( + "autoPtr hsReactionThermo::NewType" + "(" + "const fvMesh&, " + "const word&" + ")" + ) << "Inconsistent thermo package selected:" << nl << nl + << modelType << nl << nl << "Please select a " + << "thermo package based on " << thermoType + << ". Valid options include:" << nl << validModels << nl + << exit(FatalError); } - Info<< "Selecting thermodynamics package " << hsReactionThermoTypeName - << endl; + Info<< "Selecting thermodynamics package " << modelType << endl; fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(hsReactionThermoTypeName); + fvMeshConstructorTablePtr_->find(modelType); if (cstrIter == fvMeshConstructorTablePtr_->end()) { FatalErrorIn("hsReactionThermo::New(const fvMesh&)") << "Unknown hsReactionThermo type " - << hsReactionThermoTypeName << nl << nl - << "Valid hsReactionThermo types are:" << nl + << modelType << nl << nl + << "Valid hsReactionThermo types:" << nl << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/thermophysicalModels/solidMixture/solidMixture/solidMixture.C b/src/thermophysicalModels/solidMixture/solidMixture/solidMixture.C index ab62e053bb..a69ddb4bf3 100644 --- a/src/thermophysicalModels/solidMixture/solidMixture/solidMixture.C +++ b/src/thermophysicalModels/solidMixture/solidMixture/solidMixture.C @@ -27,7 +27,6 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::solidMixture::solidMixture ( const dictionary& thermophysicalProperties @@ -50,7 +49,8 @@ Foam::solidMixture::solidMixture // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::solidMixture::New +Foam::autoPtr +Foam::solidMixture::New ( const dictionary& thermophysicalProperties ) diff --git a/src/thermophysicalModels/solids/solid/solidNew.C b/src/thermophysicalModels/solids/solid/solidNew.C index 9e690b4cae..c3695cec9e 100644 --- a/src/thermophysicalModels/solids/solid/solidNew.C +++ b/src/thermophysicalModels/solids/solid/solidNew.C @@ -27,7 +27,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::solid::New(Istream& is) +Foam::autoPtr +Foam::solid::New(Istream& is) { if (debug) { @@ -36,9 +37,8 @@ Foam::autoPtr Foam::solid::New(Istream& is) << endl; } - word solidType(is); - - word coeffs(is); + const word solidType(is); + const word coeffs(is); if (coeffs == "defaultCoeffs") { @@ -49,7 +49,7 @@ Foam::autoPtr Foam::solid::New(Istream& is) { FatalErrorIn("solid::New(Istream&)") << "Unknown solid type " << solidType << nl << nl - << "Valid solid types are:" << endl + << "Valid solid types are :" << endl << ConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -65,7 +65,7 @@ Foam::autoPtr Foam::solid::New(Istream& is) { FatalErrorIn("solid::New(Istream&)") << "Unknown solid type " << solidType << nl << nl - << "Valid solid types are:" << endl + << "Valid solid types are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C index bf1c77931f..8a8700d29e 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C @@ -26,15 +26,10 @@ License #include "Reaction.H" #include "DynamicList.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -void Reaction::setThermo +void Foam::Reaction::setThermo ( const HashPtrTable& thermoDatabase ) @@ -62,9 +57,8 @@ void Reaction::setThermo } -// Construct from components template -Reaction::Reaction +Foam::Reaction::Reaction ( const speciesTable& species, const List& lhs, @@ -81,9 +75,8 @@ Reaction::Reaction } -// Construct as copy given new speciesTable template -Reaction::Reaction +Foam::Reaction::Reaction ( const Reaction& r, const speciesTable& species @@ -97,7 +90,7 @@ Reaction::Reaction template -Reaction::specieCoeffs::specieCoeffs +Foam::Reaction::specieCoeffs::specieCoeffs ( const speciesTable& species, Istream& is @@ -146,7 +139,7 @@ Reaction::specieCoeffs::specieCoeffs template -void Reaction::setLRhs(Istream& is) +void Foam::Reaction::setLRhs(Istream& is) { DynamicList dlrhs; @@ -187,9 +180,8 @@ void Reaction::setLRhs(Istream& is) } -//- Construct from Istream template -Reaction::Reaction +Foam::Reaction::Reaction ( const speciesTable& species, const HashPtrTable& thermoDatabase, @@ -207,7 +199,8 @@ Reaction::Reaction // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // template -autoPtr > Reaction::New +Foam::autoPtr > +Foam::Reaction::New ( const speciesTable& species, const HashPtrTable& thermoDatabase, @@ -221,13 +214,13 @@ autoPtr > Reaction::New "Reaction::New(const speciesTable& species," " const HashPtrTable& thermoDatabase, Istream&)", is - ) << "Reaction type not specified" << endl << endl + ) << "Reaction type not specified" << nl << nl << "Valid Reaction types are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } - word reactionTypeName(is); + const word reactionTypeName(is); typename IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(reactionTypeName); @@ -239,7 +232,8 @@ autoPtr > Reaction::New "Reaction::New(const speciesTable& species," " const HashPtrTable& thermoDatabase, Istream&)", is - ) << "Unknown reaction type " << reactionTypeName << endl << endl + ) << "Unknown reaction type " + << reactionTypeName << nl << nl << "Valid reaction types are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -255,7 +249,7 @@ autoPtr > Reaction::New // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Reaction::write(Ostream& os) const +void Foam::Reaction::write(Ostream& os) const { os << type() << nl << " "; @@ -310,7 +304,7 @@ void Reaction::write(Ostream& os) const template -scalar Reaction::kf +Foam::scalar Foam::Reaction::kf ( const scalar T, const scalar p, @@ -322,7 +316,7 @@ scalar Reaction::kf template -scalar Reaction::kr +Foam::scalar Foam::Reaction::kr ( const scalar kfwd, const scalar T, @@ -334,7 +328,7 @@ scalar Reaction::kr } template -scalar Reaction::kr +Foam::scalar Foam::Reaction::kr ( const scalar T, const scalar p, @@ -345,8 +339,4 @@ scalar Reaction::kr } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C index 08fecc77a0..322260c643 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C +++ b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C @@ -42,7 +42,7 @@ Foam::thermalPorousZone::thermalPorousZone { if (const dictionary* dictPtr = dict.subDictPtr("thermalModel")) { - word thermalModel(dictPtr->lookup("type")); + const word thermalModel(dictPtr->lookup("type")); if (thermalModel == "fixedTemperature") { diff --git a/src/thermophysicalModels/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C b/src/thermophysicalModels/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C index ad75ccb1ce..6497b05131 100644 --- a/src/thermophysicalModels/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C +++ b/src/thermophysicalModels/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C @@ -32,15 +32,15 @@ License namespace Foam { + defineTypeNameAndDebug(thermophysicalFunction, 0); + defineRunTimeSelectionTable(thermophysicalFunction, Istream); +} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -defineTypeNameAndDebug(thermophysicalFunction, 0); -defineRunTimeSelectionTable(thermophysicalFunction, Istream); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -autoPtr thermophysicalFunction::New(Istream& is) +Foam::autoPtr +Foam::thermophysicalFunction::New(Istream& is) { if (debug) { @@ -49,7 +49,7 @@ autoPtr thermophysicalFunction::New(Istream& is) << endl; } - word thermophysicalFunctionType(is); + const word thermophysicalFunctionType(is); IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(thermophysicalFunctionType); @@ -59,7 +59,7 @@ autoPtr thermophysicalFunction::New(Istream& is) FatalErrorIn("thermophysicalFunction::New(Istream&)") << "Unknown thermophysicalFunction type " << thermophysicalFunctionType - << endl << endl + << nl << nl << "Valid thermophysicalFunction types are :" << endl << IstreamConstructorTablePtr_->sortedToc() << abort(FatalError); @@ -68,9 +68,4 @@ autoPtr thermophysicalFunction::New(Istream& is) return autoPtr(cstrIter()(is)); } - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/transportModels/incompressible/transportModel/transportModel.C b/src/transportModels/incompressible/transportModel/transportModel.C index d1b6ddc97f..c9a0c8e20d 100644 --- a/src/transportModels/incompressible/transportModel/transportModel.C +++ b/src/transportModels/incompressible/transportModel/transportModel.C @@ -27,14 +27,10 @@ License #include "viscosityModel.H" #include "volFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -transportModel::transportModel +Foam::transportModel::transportModel ( const volVectorField& U, const surfaceScalarField& phi @@ -56,20 +52,16 @@ transportModel::transportModel // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * // -transportModel::~transportModel() +Foam::transportModel::~transportModel() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -bool transportModel::read() +bool Foam::transportModel::read() { return regIOobject::read(); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C b/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C index 974cc2c5bd..d2424513c7 100644 --- a/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C +++ b/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C @@ -29,12 +29,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -autoPtr viscosityModel::New +Foam::autoPtr +Foam::viscosityModel::New ( const word& name, const dictionary& viscosityProperties, @@ -42,13 +38,15 @@ autoPtr viscosityModel::New const surfaceScalarField& phi ) { - word viscosityModelTypeName(viscosityProperties.lookup("transportModel")); + const word modelType + ( + viscosityProperties.lookup("transportModel") + ); - Info<< "Selecting incompressible transport model " - << viscosityModelTypeName << endl; + Info<< "Selecting incompressible transport model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(viscosityModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -57,8 +55,8 @@ autoPtr viscosityModel::New "viscosityModel::New(const volVectorField&, " "const surfaceScalarField&)" ) << "Unknown viscosityModel type " - << viscosityModelTypeName << endl << endl - << "Valid viscosityModels are : " << endl + << modelType << nl << nl + << "Valid viscosityModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -68,8 +66,4 @@ autoPtr viscosityModel::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C b/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C index 1d9ca4172c..39efc1ee49 100644 --- a/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C +++ b/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C @@ -26,19 +26,17 @@ License #include "LESdelta.H" #include "calculatedFvPatchFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(LESdelta, 0); -defineRunTimeSelectionTable(LESdelta, dictionary); + defineTypeNameAndDebug(LESdelta, 0); + defineRunTimeSelectionTable(LESdelta, dictionary); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -LESdelta::LESdelta(const word& name, const fvMesh& mesh) +Foam::LESdelta::LESdelta(const word& name, const fvMesh& mesh) : mesh_(mesh), delta_ @@ -60,14 +58,15 @@ LESdelta::LESdelta(const word& name, const fvMesh& mesh) // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -autoPtr LESdelta::New +Foam::autoPtr +Foam::LESdelta::New ( const word& name, const fvMesh& mesh, const dictionary& dict ) { - word deltaType(dict.lookup("delta")); + const word deltaType(dict.lookup("delta")); dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(deltaType); @@ -77,7 +76,8 @@ autoPtr LESdelta::New FatalErrorIn ( "LESdelta::New(const fvMesh&, const dictionary&)" - ) << "Unknown LESdelta type " << deltaType << endl << endl + ) << "Unknown LESdelta type " + << deltaType << nl << nl << "Valid LESdelta types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -87,8 +87,4 @@ autoPtr LESdelta::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C b/src/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C index e865914a8a..56a503f8cd 100644 --- a/src/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C +++ b/src/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C @@ -24,29 +24,27 @@ License \*---------------------------------------------------------------------------*/ #include "error.H" - #include "LESfilter.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTypeNameAndDebug(LESfilter, 0); -defineRunTimeSelectionTable(LESfilter, dictionary); +namespace Foam +{ + defineTypeNameAndDebug(LESfilter, 0); + defineRunTimeSelectionTable(LESfilter, dictionary); +} // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -autoPtr LESfilter::New +Foam::autoPtr +Foam::LESfilter::New ( const fvMesh& mesh, const dictionary& dict ) { - word filterType(dict.lookup("filter")); + const word filterType(dict.lookup("filter")); dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(filterType); @@ -56,7 +54,8 @@ autoPtr LESfilter::New FatalErrorIn ( "LESfilter::New(const fvMesh&, const dictionary&)" - ) << "Unknown LESfilter type " << filterType << endl << endl + ) << "Unknown LESfilter type " + << filterType << nl << nl << "Valid LESfilter types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -65,9 +64,5 @@ autoPtr LESfilter::New return autoPtr(cstrIter()(mesh, dict)); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -} // End namespace Foam // ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.C b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C index da5925f6a3..e95f9def5c 100644 --- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.C +++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C @@ -100,13 +100,11 @@ autoPtr LESModel::New const basicThermo& thermoPhysicalModel ) { - word modelName; - - // Enclose the creation of the dictionary to ensure it is deleted - // before the turbulenceModel is created otherwise the dictionary is - // entered in the database twice - { - IOdictionary dict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -114,17 +112,16 @@ autoPtr LESModel::New U.time().constant(), U.db(), IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("LESModel") + ); - dict.lookup("LESModel") >> modelName; - } - - Info<< "Selecting LES turbulence model " << modelName << endl; + Info<< "Selecting LES turbulence model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -136,9 +133,9 @@ autoPtr LESModel::New "const surfaceScalarField&, " "const basicThermo&" ")" - ) << "Unknown LESModel type " << modelName - << endl << endl - << "Valid LESModel types are :" << endl + ) << "Unknown LESModel type " + << modelType << nl << nl + << "Valid LESModel types:" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C index f24a953e63..755318a1d8 100644 --- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C @@ -106,13 +106,11 @@ autoPtr RASModel::New const basicThermo& thermophysicalModel ) { - word modelName; - - // Enclose the creation of the dictionary to ensure it is deleted - // before the turbulenceModel is created otherwise the dictionary is - // entered in the database twice - { - IOdictionary dict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -120,17 +118,16 @@ autoPtr RASModel::New U.time().constant(), U.db(), IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("RASModel") + ); - dict.lookup("RASModel") >> modelName; - } - - Info<< "Selecting RAS turbulence model " << modelName << endl; + Info<< "Selecting RAS turbulence model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -143,9 +140,9 @@ autoPtr RASModel::New "const surfaceScalarField&, " "basicThermo&" ")" - ) << "Unknown RASModel type " << modelName - << endl << endl - << "Valid RASModel types are :" << endl + ) << "Unknown RASModel type " + << modelType << nl << nl + << "Valid RASModel types:" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C index 2a9b567e65..5c936fa28e 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C +++ b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C @@ -69,13 +69,11 @@ autoPtr turbulenceModel::New const basicThermo& thermophysicalModel ) { - word modelName; - - // Enclose the creation of the dictionary to ensure it is deleted - // before the turbulenceModel is created otherwise the dictionary is - // entered in the database twice - { - IOdictionary dict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -83,17 +81,16 @@ autoPtr turbulenceModel::New U.time().constant(), U.db(), IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("simulationType") + ); - dict.lookup("simulationType") >> modelName; - } - - Info<< "Selecting turbulence model type " << modelName << endl; + Info<< "Selecting turbulence model type " << modelType << endl; turbulenceModelConstructorTable::iterator cstrIter = - turbulenceModelConstructorTablePtr_->find(modelName); + turbulenceModelConstructorTablePtr_->find(modelType); if (cstrIter == turbulenceModelConstructorTablePtr_->end()) { @@ -102,9 +99,9 @@ autoPtr turbulenceModel::New "turbulenceModel::New(const volScalarField&, " "const volVectorField&, const surfaceScalarField&, " "basicThermo&)" - ) << "Unknown turbulenceModel type " << modelName - << endl << endl - << "Valid turbulenceModel types are :" << endl + ) << "Unknown turbulenceModel type " + << modelType << nl << nl + << "Valid turbulenceModel types:" << endl << turbulenceModelConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C index 7b08a32e72..574e387f1c 100644 --- a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C +++ b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C @@ -97,13 +97,11 @@ autoPtr LESModel::New transportModel& transport ) { - word modelName; - - // Enclose the creation of the dictionary to ensure it is deleted - // before the turbulenceModel is created otherwise the dictionary is - // entered in the database twice - { - IOdictionary dict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -111,17 +109,16 @@ autoPtr LESModel::New U.time().constant(), U.db(), IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("LESModel") + ); - dict.lookup("LESModel") >> modelName; - } - - Info<< "Selecting LES turbulence model " << modelName << endl; + Info<< "Selecting LES turbulence model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -133,9 +130,9 @@ autoPtr LESModel::New "const surfaceScalarField& ," "transportModel&" ")" - ) << "Unknown LESModel type " << modelName - << endl << endl - << "Valid LESModel types are :" << endl + ) << "Unknown LESModel type " + << modelType << nl << nl + << "Valid LESModel types:" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C index dd921835cd..87d50dedd7 100644 --- a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C +++ b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C @@ -104,13 +104,11 @@ autoPtr RASModel::New transportModel& transport ) { - word modelName; - - // Enclose the creation of the dictionary to ensure it is deleted - // before the turbulenceModel is created otherwise the dictionary is - // entered in the database twice - { - IOdictionary dict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -118,17 +116,16 @@ autoPtr RASModel::New U.time().constant(), U.db(), IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("RASModel") + ); - dict.lookup("RASModel") >> modelName; - } - - Info<< "Selecting RAS turbulence model " << modelName << endl; + Info<< "Selecting RAS turbulence model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -140,9 +137,9 @@ autoPtr RASModel::New "const surfaceScalarField&, " "transportModel&" ")" - ) << "Unknown RASModel type " << modelName - << endl << endl - << "Valid RASModel types are :" << endl + ) << "Unknown RASModel type " + << modelType << nl << nl + << "Valid RASModel types:" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C index 445b9924d8..1aeea66fd3 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C +++ b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C @@ -66,13 +66,11 @@ autoPtr turbulenceModel::New transportModel& transport ) { - word modelName; - - // Enclose the creation of the dictionary to ensure it is deleted - // before the turbulenceModel is created otherwise the dictionary is - // entered in the database twice - { - IOdictionary dict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -80,17 +78,16 @@ autoPtr turbulenceModel::New U.time().constant(), U.db(), IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("simulationType") + ); - dict.lookup("simulationType") >> modelName; - } - - Info<< "Selecting turbulence model type " << modelName << endl; + Info<< "Selecting turbulence model type " << modelType << endl; turbulenceModelConstructorTable::iterator cstrIter = - turbulenceModelConstructorTablePtr_->find(modelName); + turbulenceModelConstructorTablePtr_->find(modelType); if (cstrIter == turbulenceModelConstructorTablePtr_->end()) { @@ -98,9 +95,9 @@ autoPtr turbulenceModel::New ( "turbulenceModel::New(const volVectorField&, " "const surfaceScalarField&, transportModel&)" - ) << "Unknown turbulenceModel type " << modelName - << endl << endl - << "Valid turbulenceModel types are :" << endl + ) << "Unknown turbulenceModel type " + << modelType << nl << nl + << "Valid turbulenceModel types:" << endl << turbulenceModelConstructorTablePtr_->sortedToc() << exit(FatalError); }