diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C index a0994ab095297e2ba4d262bbf9aa21b0c65dbb44..78bc6b04d04386711c1ced5681abee9f32da0ce7 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -46,12 +46,12 @@ Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown PDRDragModel type " - << modelType << nl << nl - << "Valid PDRDragModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "PDRDragModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<PDRDragModel> diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C index de3b302ce9ab0997ae8d33b7156c505a2c8e6084..d953556ce096e90b1d6e4281fa8996d8cc111293 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown XiEqModel type " - << modelType << nl << nl - << "Valid XiEqModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "XiEqModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<XiEqModel>(cstrIter()(propDict, thermo, turbulence, Su)); diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C index 49206f3d0f44ff4a6eb30f0a20e8addf1e1c87d7..030c0c525ddba81ba8c36e5fba8365f31b8a5fcd 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown XiGModel type " - << modelType << nl << nl - << "Valid XiGModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "XiGModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<XiGModel>(cstrIter()(propDict, thermo, turbulence, Su)); diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C index 7aa31f3899bbbce1aa8773d13691a332086bba68..eec0afa7afa8cc0e5a89dd1347cea9bffbaa2146 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -48,12 +48,12 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown XiModel type " - << modelType << nl << nl - << "Valid XiModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "XiModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<XiModel> diff --git a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C index 9eda304cbc612a46a822273b8c248021a03e72d0..68dbbcc3086599c8e40e095a805eb0d7d5f07f24 100644 --- a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C +++ b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2015 OpenFOAM Foundation @@ -47,12 +47,12 @@ Foam::autoPtr<Foam::mixtureViscosityModel> Foam::mixtureViscosityModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown mixtureViscosityModel type " - << modelType << nl << nl - << "Valid mixtureViscosityModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "mixtureViscosityModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<mixtureViscosityModel> diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C index 50271ea232d7db1b15021c357521291830ba5391..752e101917909239e4498b5f5be2ed5f8d42c2ff 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2017 OpenFOAM Foundation @@ -114,12 +114,12 @@ Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown time scale model type " - << modelType << nl << nl - << "Valid time scale model types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "relative velocity", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/reflectionModel/reflectionModel/reflectionModelNew.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/reflectionModel/reflectionModel/reflectionModelNew.C index 8ce843c377272605bc6a517d042db3f55e1821ba..a228ebb335b1bfaf31286ea9a9ee92213410a081 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/reflectionModel/reflectionModel/reflectionModelNew.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/reflectionModel/reflectionModel/reflectionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,11 +43,13 @@ Foam::radiation::reflectionModel::New if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown reflectionModel type " << modelType << nl << nl - << "Valid types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "reflectionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<reflectionModel>(cstrIter()(dict, mesh)); diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/massTransferModels/interfaceCompositionModel/interfaceCompositionModelNew.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/massTransferModels/interfaceCompositionModel/interfaceCompositionModelNew.C index c280808dca9c0619a5b46983fe6dacdd5fa0bae4..7b2d53398becbea59176b5a399eedeeea89590e4 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/massTransferModels/interfaceCompositionModel/interfaceCompositionModelNew.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/massTransferModels/interfaceCompositionModel/interfaceCompositionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2017 OpenFOAM Foundation @@ -38,7 +38,7 @@ Foam::interfaceCompositionModel::New const phasePair& pair ) { - word interfaceCompositionModelType + const word modelType ( dict.get<word>("type") + "<" @@ -49,19 +49,18 @@ Foam::interfaceCompositionModel::New ); Info<< "Selecting interfaceCompositionModel for " - << pair << ": " << interfaceCompositionModelType << endl; + << pair << ": " << modelType << endl; - const auto cstrIter = - dictionaryConstructorTablePtr_->cfind(interfaceCompositionModelType); + const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown interfaceCompositionModelType type " - << interfaceCompositionModelType << nl << nl - << "Valid interfaceCompositionModel types are : " << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "interfaceCompositionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, pair); diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/porousModels/porousModel/porousModelNew.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/porousModels/porousModel/porousModelNew.C index 6262976365b152ad2bcff85695c4fd2744ad9441..c543ccb3f4fa752d81b2441d08dfb750e164204e 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/porousModels/porousModel/porousModelNew.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/porousModels/porousModel/porousModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,12 +43,12 @@ Foam::autoPtr<Foam::porousModel> Foam::porousModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown modelType type " - << modelType << endl << endl - << "Valid porousModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "porousModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, mesh); diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C index 653f0baae6d74da76da73ca64563115b08f4f239..88b8ec9a5d8d90cbc990095b7f4d373605e77fbe 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,12 +43,12 @@ Foam::autoPtr<Foam::surfaceTensionModel> Foam::surfaceTensionModel::New if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown surfaceTensionModel type " - << surfaceTensionModelType << endl << endl - << "Valid modelType types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalErrorInLookup + ( + "surfaceTensionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, pair, true); diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModelNew.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModelNew.C index 34aa5e2e41bbfb8f990a552718a9ca875f764af2..53368ea105221db664a350d4d14516373b54b980 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModelNew.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,12 +43,12 @@ Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown phaseModel type " - << modelType << endl << endl - << "Valid phaseModel types are : " << endl - << phaseSystemConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "phaseModel", + modelType, + *phaseSystemConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(fluid, phaseName); diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystemNew.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystemNew.C index 05367b6fec212fb9a431934d323f16dfa90b8a09..2d31a1211e8e987460383912995fa68b714f65d6 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystemNew.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystemNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,7 +32,7 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New const fvMesh& mesh ) { - const word multiphaseSystemType + const word systemType ( IOdictionary ( @@ -48,22 +48,21 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New ).get<word>("type") ); - Info<< "Selecting multiphaseSystem " << multiphaseSystemType << endl; + Info<< "Selecting multiphaseSystem " << systemType << endl; - const auto cstrIter = - dictionaryConstructorTablePtr_->cfind(multiphaseSystemType); + const auto cstrIter = dictionaryConstructorTablePtr_->cfind(systemType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown multiphaseSystemType type " - << multiphaseSystemType << endl - << "Valid multiphaseSystem types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "multiphaseSystem", + systemType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } - return autoPtr<multiphaseSystem> (cstrIter()(mesh)); + return autoPtr<multiphaseSystem>(cstrIter()(mesh)); } diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C index 6169ab62f4939bac095754ccaa84f6e5a841d5e1..a337a03a1a86467d8b9a2f43264117f0f9744465 100644 --- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,22 +35,20 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New const fvMesh& mesh ) { - IOdictionary phaseChangePropertiesDict - ( - IOobject - ( - "phaseChangeProperties", - mesh.time().constant(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ) - ); - const word modelType ( - phaseChangePropertiesDict.get<word>("phaseChangeTwoPhaseModel") + IOdictionary + ( + IOobject + ( + "phaseChangeProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false // Do not register + ) + ).get<word>("phaseChangeTwoPhaseModel") ); Info<< "Selecting phaseChange model " << modelType << endl; @@ -59,16 +57,19 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown temperaturePhaseChangeTwoPhaseMixture type " - << modelType << nl << nl - << "Valid temperaturePhaseChangeTwoPhaseMixture types :" << endl - << componentsConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "temperaturePhaseChangeTwoPhaseMixture", + modelType, + *componentsConstructorTablePtr_ + ) << exit(FatalError); } - return autoPtr<temperaturePhaseChangeTwoPhaseMixture> - (cstrIter()(thermo, mesh)); + return + autoPtr<temperaturePhaseChangeTwoPhaseMixture> + ( + cstrIter()(thermo, mesh) + ); } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C index 00bab3e5cbc0d753937af11330ee19811d50a344..6b2085bd8f84ceca217be7c7cfc726eeb8f01392 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -37,22 +37,20 @@ Foam::phaseChangeTwoPhaseMixture::New const surfaceScalarField& phi ) { - IOdictionary transportPropertiesDict - ( - IOobject - ( - "transportProperties", - U.time().constant(), - U.db(), - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ) - ); - const word modelType ( - transportPropertiesDict.lookup("phaseChangeTwoPhaseMixture") + IOdictionary + ( + IOobject + ( + "transportProperties", + U.time().constant(), + U.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE, + false // Do not register + ) + ).get<word>("phaseChangeTwoPhaseMixture") ); Info<< "Selecting phaseChange model " << modelType << endl; @@ -61,12 +59,12 @@ Foam::phaseChangeTwoPhaseMixture::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown phaseChangeTwoPhaseMixture type " - << modelType << nl << nl - << "Valid phaseChangeTwoPhaseMixture types :" << endl - << componentsConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "phaseChangeTwoPhaseMixture", + modelType, + *componentsConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<phaseChangeTwoPhaseMixture>(cstrIter()(U, phi)); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C index af421f1a152490e360dce227687f1ddfb562ca24..7f44ef980d4ef788c40dc71c79a4090a70ecf765 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -47,12 +47,12 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown dragModel type " - << modelType << nl << nl - << "Valid dragModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "dragModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(interfaceDict, phase1, phase2); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C index c6d839103cc756cc8fe18752602e9a3800e96b93..8ca8fddd58fa92fa5273f6b3501aee15041a097a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -39,7 +39,7 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New { const word modelType ( - interfaceDict.lookup("heatTransferModel" + phase1.name()) + interfaceDict.get<word>("heatTransferModel" + phase1.name()) ); Info<< "Selecting heatTransferModel for phase " @@ -51,12 +51,12 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown heatTransferModel type " - << modelType << nl << nl - << "Valid heatTransferModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "heatTransferModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(interfaceDict, alpha1, phase1, phase2); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C index fd0ca095ef96b4b77fdf8ad644b1542e4413f015..1961dd8759e3f29063ee5889a9a1294fbaae60d0 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -46,12 +46,12 @@ Foam::autoPtr<Foam::diameterModel> Foam::diameterModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown diameterModel type " - << modelType << nl << nl - << "Valid diameterModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "diameterModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter() diff --git a/applications/solvers/multiphase/reactingEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C index a2f793811adc36581f7c2107575b20f92d190b4e..e1db0a4e5d08692cc8576166dc64a36c6f0eba48 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C +++ b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C @@ -2,8 +2,10 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | +------------------------------------------------------------------------------- + | Copyright (C) 2017-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -106,9 +108,13 @@ void Foam::functionObjects::sizeDistribution::initialise default: { - FatalIOErrorInFunction(dict) - << "Unknown functionType. Valid types are:" - << functionTypeNames_ << nl << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "functionType", + word::null, + functionTypeNames_ + ) << exit(FatalIOError); } } @@ -126,9 +132,13 @@ void Foam::functionObjects::sizeDistribution::initialise default: { - FatalIOErrorInFunction(dict) - << "Unknown abszissaType. Valid types are:" - << abszissaTypeNames_ << nl << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "abszissaType", + word::null, + abszissaTypeNames_ + ) << exit(FatalIOError); } } @@ -139,7 +149,7 @@ void Foam::functionObjects::sizeDistribution::initialise FatalIOErrorInFunction(dict) << type() << " " << name() << ": " << selectionModeTypeNames_[selectionModeType_] - << "(" << selectionModeTypeName_ << "):" << nl + << '(' << selectionModeTypeName_ << "):" << nl << " Selection has no cells" << exit(FatalIOError); } @@ -147,7 +157,7 @@ void Foam::functionObjects::sizeDistribution::initialise Info<< type() << " " << name() << ":" << selectionModeTypeNames_[selectionModeType_] - << "(" << selectionModeTypeName_ << "):" << nl + << '(' << selectionModeTypeName_ << "):" << nl << " total cells = " << nCells_ << nl << " total volume = " << volume_ << nl << endl; @@ -160,7 +170,7 @@ void Foam::functionObjects::sizeDistribution::setCellZoneCells() { case rtCellZone: { - dict().lookup("cellZone") >> selectionModeTypeName_; + dict().readEntry("cellZone", selectionModeTypeName_); label zoneId = mesh().cellZones().findZoneID(selectionModeTypeName_); @@ -188,9 +198,13 @@ void Foam::functionObjects::sizeDistribution::setCellZoneCells() default: { - FatalIOErrorInFunction(dict_) - << "Unknown selectionMode type. Valid selectionMode types are:" - << selectionModeTypeNames_ << nl << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict_, + "selectionMode", + word::null, + selectionModeTypeNames_ + ) << exit(FatalIOError); } } } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C index 606cfb0f5cc7973ad9a39a462c80c076f66ff0df..6ce2f952d418e585d33a07c7a2ee5286804d218e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2015 OpenFOAM Foundation @@ -46,12 +46,12 @@ Foam::aspectRatioModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown aspectRatioModel type " - << modelType << nl << nl - << "Valid aspectRatioModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "aspectRatioModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, pair); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C index 3021df61be512d0db8cc0abe0b06bf1432cd0a5a..df30abe530a07edc11c52666d99452c5410ca8ef 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown dragModel type " - << modelType << nl << nl - << "Valid dragModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "dragModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, pair, true); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C index da0ad3cfc4579b993d8d385e05bfbd914609b467..47951c5cc491cd5d381895983958900b08054d35 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown heatTransferModel type " - << modelType << nl << nl - << "Valid heatTransferModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "heatTransferModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, pair); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C index 08f943e81b0e14f2a9d20eddcb3b790b0b6005db..03cc716499286af7d4c34858f9f8836264da14e4 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2015 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::autoPtr<Foam::liftModel> Foam::liftModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown liftModel type " - << modelType << nl << nl - << "Valid liftModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "liftModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, pair); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C index 927f482065a46d5b83a1553b48bca4789cbcc8ea..bc159a37b55f6fb088c47a1157fbedb6815b1222 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2015 OpenFOAM Foundation @@ -46,12 +46,12 @@ Foam::swarmCorrection::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown swarmCorrection type " - << modelType << nl << nl - << "Valid swarmCorrection types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "swarmCorrection", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, pair); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C index cfae8c139be0ee9aea01c1dabc664965379927c4..36517c284fd173d3c2b7b5f414b78e3145d4dc3c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2015 OpenFOAM Foundation @@ -46,12 +46,12 @@ Foam::turbulentDispersionModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown turbulentDispersionModel type " - << modelType << nl << nl - << "Valid turbulentDispersionModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "turbulentDispersionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, pair); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C index 50b07d19261864e5491e2a22d5e24b42e7b42b1c..ce1c07d5d39d24ef4ac3ff337ef936bedf30048a 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2015 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::autoPtr<Foam::virtualMassModel> Foam::virtualMassModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown virtualMassModel type " - << modelType << nl << nl - << "Valid virtualMassModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "virtualMassModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, pair, true); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C index fe631582684ba0bb7c356a84bc04c27afa8e7f59..e41854b98f2bd2c1534a7b454081a3fa09870a4a 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2015 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::autoPtr<Foam::wallLubricationModel> Foam::wallLubricationModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown wallLubricationModel type " - << modelType << nl << nl - << "Valid wallLubricationModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "wallLubricationModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, pair); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C index 43ae3eb16c692395622759723b3930509da1a296..dccdf6e14e8ae6e582ed4467a360ce7107c41db4 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -43,12 +43,12 @@ Foam::kineticTheoryModels::conductivityModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown conductivityModel type " - << modelType << nl << nl - << "Valid conductivityModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "conductivityModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<conductivityModel>(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C index da1414d7e2b6192fa87b7e01e43ab84b20dc9275..58f24c8c1a356bb0e0d1983808f03e4f5a8505e7 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -43,12 +43,12 @@ Foam::kineticTheoryModels::frictionalStressModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown frictionalStressModel type " - << modelType << nl << nl - << "Valid frictionalStressModelType types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "frictionalStressModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<frictionalStressModel>(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C index e8207d1d392e1b7b9b87f305cdfc8b7a79d28437..599cd015415f76830bdb8d2e042aa32bd86425b2 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -43,12 +43,12 @@ Foam::kineticTheoryModels::granularPressureModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown granularPressureModel type " - << modelType << nl << nl - << "Valid granularPressureModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "granularPressureModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<granularPressureModel>(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C index c2c7bfd2e82f6999992c695b884f130f6e3e695d..3df0d16c533fb5cb90a2cba5a86f59eb67f0dd5a 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -43,12 +43,12 @@ Foam::kineticTheoryModels::radialModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown radialModel type " - << modelType << nl << nl - << "Valid radialModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "radialModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<radialModel>(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C index e9d91e947c830f051239436c84a5871eed0f88e5..dc0817013e4a6f5a8252691461a0882a2242b62c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -35,20 +35,20 @@ Foam::kineticTheoryModels::viscosityModel::New const dictionary& dict ) { - const word modelName(dict.get<word>("viscosityModel")); + const word modelType(dict.get<word>("viscosityModel")); - Info<< "Selecting viscosityModel " << modelName << endl; + Info<< "Selecting viscosityModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown viscosityModel type " - << modelName << nl << nl - << "Valid viscosityModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "viscosityModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<viscosityModel>(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C index b28331ada762d3da2111b742e9d038f7c722ad46..b94e892fe9ec9b15c6caff5ac2680bec1ae841c4 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2015 OpenFOAM Foundation @@ -35,21 +35,21 @@ Foam::autoPtr<Foam::blendingMethod> Foam::blendingMethod::New const wordList& phaseNames ) { - const word methodName(dict.get<word>("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting " << dict.dictName() << " blending method: " - << methodName << endl; + << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown blendingMethod type " - << methodName << nl << nl - << "Valid blendingMethod types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "blendingMethod", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, phaseNames); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C index 445a3a6b388998541f13eddeb437c91fc79d86b0..dfc5d502c064e9fb118b352f1767c10f82e5109d 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -57,12 +57,13 @@ Foam::diameterModels::IATEsource::New if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown IATE source type " - << type << nl << nl - << "Valid IATE source types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "IATEsource", + type, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<IATEsource>(cstrIter()(iate, dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C index fd0ca095ef96b4b77fdf8ad644b1542e4413f015..1961dd8759e3f29063ee5889a9a1294fbaae60d0 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -46,12 +46,12 @@ Foam::autoPtr<Foam::diameterModel> Foam::diameterModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown diameterModel type " - << modelType << nl << nl - << "Valid diameterModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "diameterModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter() diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl.C index a0f4cb9c6979640b2473845fa4eec345993e8b2f..7bc8d847ba94cc24d7f690eddd2d23f93df0f1f2 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2015 OpenFOAM Foundation @@ -43,7 +43,7 @@ Foam::cellSizeAndAlignmentControl::cellSizeAndAlignmentControl ( const Time& runTime, const word& name, - const dictionary& controlFunctionDict, + const dictionary& dict, const conformationSurfaces& geometryToConformTo, const scalar& defaultCellSize ) @@ -52,7 +52,7 @@ Foam::cellSizeAndAlignmentControl::cellSizeAndAlignmentControl defaultCellSize_(defaultCellSize), forceInitialPointInsertion_ ( - controlFunctionDict.lookupOrDefault<Switch> + dict.lookupOrDefault<Switch> ( "forceInitialPointInsertion", Switch::OFF @@ -69,26 +69,26 @@ Foam::cellSizeAndAlignmentControl::New ( const Time& runTime, const word& name, - const dictionary& controlFunctionDict, + const dictionary& dict, const conformationSurfaces& geometryToConformTo, const scalar& defaultCellSize ) { - const word controlType(controlFunctionDict.get<word>("type")); + const word modelType(dict.get<word>("type")); Info<< indent << "Selecting cellSizeAndAlignmentControl " - << controlType << endl; + << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(controlType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown cellSizeAndAlignmentControl type " - << controlType << nl << nl - << "Valid cellSizeAndAlignmentControl types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "cellSizeAndAlignmentControl", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<cellSizeAndAlignmentControl> @@ -97,7 +97,7 @@ Foam::cellSizeAndAlignmentControl::New ( runTime, name, - controlFunctionDict, + dict, geometryToConformTo, defaultCellSize ) diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C index b9d32ef6d672d17ab4d54bf0863574bdced864b3..9f262b9b34d22e1364a2fc41c825cc84f4bec833 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2017 OpenFOAM Foundation @@ -123,37 +123,33 @@ Foam::cellSizeFunction::cellSizeFunction Foam::autoPtr<Foam::cellSizeFunction> Foam::cellSizeFunction::New ( - const dictionary& cellSizeFunctionDict, + const dictionary& dict, const searchableSurface& surface, const scalar& defaultCellSize, const labelList regionIndices ) { - const word functionName - ( - cellSizeFunctionDict.get<word>("cellSizeFunction") - ); + const word modelType(dict.get<word>("cellSizeFunction")); - Info<< indent << "Selecting cellSizeFunction " - << functionName << endl; + Info<< indent << "Selecting cellSizeFunction " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown cellSizeFunction type " - << functionName << nl << nl - << "Valid cellSizeFunction types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "cellSizeFunction", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<cellSizeFunction> ( cstrIter() ( - cellSizeFunctionDict, + dict, surface, defaultCellSize, regionIndices diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/cellSizeCalculationType/cellSizeCalculationType.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/cellSizeCalculationType/cellSizeCalculationType.C index 694b852d6b992b7d28b668c51032cff5347c7d7f..586a53cbc16bff23186c72ea58a40d0d861b42b9 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/cellSizeCalculationType/cellSizeCalculationType.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/cellSizeCalculationType/cellSizeCalculationType.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2015 OpenFOAM Foundation @@ -57,34 +57,30 @@ Foam::cellSizeCalculationType::cellSizeCalculationType Foam::autoPtr<Foam::cellSizeCalculationType> Foam::cellSizeCalculationType::New ( - const dictionary& cellSizeCalculationTypeDict, + const dictionary& dict, const triSurfaceMesh& surface, const scalar& defaultCellSize ) { - const word calculationType - ( - cellSizeCalculationTypeDict.get<word>("cellSizeCalculationType") - ); + const word modelType(dict.get<word>("cellSizeCalculationType")); - Info<< indent << "Selecting cellSizeCalculationType " - << calculationType << endl; + Info<< indent << "Selecting cellSizeCalculationType " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(calculationType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown cellSizeCalculationType type " - << calculationType << nl << nl - << "Valid cellSizeCalculationType types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "cellSizeCalculationType", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<cellSizeCalculationType> ( - cstrIter()(cellSizeCalculationTypeDict, surface, defaultCellSize) + cstrIter()(dict, surface, defaultCellSize) ); } diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C index e1ce94ba8eb4ccc63dd7a9c5ba7bee7a12de2f14..2e9e39567b2722cac5d793e9b4d612a6902d7823 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2017 OpenFOAM Foundation @@ -62,34 +62,33 @@ Foam::surfaceCellSizeFunction::surfaceCellSizeFunction Foam::autoPtr<Foam::surfaceCellSizeFunction> Foam::surfaceCellSizeFunction::New ( - const dictionary& surfaceCellSizeFunctionDict, + const dictionary& dict, const searchableSurface& surface, const scalar& defaultCellSize ) { - const word functionName + const word modelType ( - surfaceCellSizeFunctionDict.get<word>("surfaceCellSizeFunction") + dict.get<word>("surfaceCellSizeFunction") ); - Info<< indent << "Selecting surfaceCellSizeFunction " - << functionName << endl; + Info<< indent << "Selecting surfaceCellSizeFunction " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown surfaceCellSizeFunction type " - << functionName << nl << nl - << "Valid surfaceCellSizeFunction types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "surfaceCellSizeFunction", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<surfaceCellSizeFunction> ( - cstrIter()(surfaceCellSizeFunctionDict, surface, defaultCellSize) + cstrIter()(dict, surface, defaultCellSize) ); } diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C index 8944fc603bf75a775b09a9f4d3558e652e91ff71..92b667828c386e5631a5fdc284aebed2f49ac212 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2017 OpenFOAM Foundation @@ -64,12 +64,12 @@ Foam::autoPtr<Foam::faceAreaWeightModel> Foam::faceAreaWeightModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown faceAreaWeightModel type " - << modelType << nl << nl - << "Valid faceAreaWeightModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "faceAreaWeightModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<faceAreaWeightModel>(cstrIter()(relaxationDict)); diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C index 2b3887d5098e335496b7c0e567ee2c75a8c4d0f1..5120dffaeef75d4dab1388f7f937e8a438ad74c6 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2017 OpenFOAM Foundation @@ -79,21 +79,20 @@ Foam::autoPtr<Foam::initialPointsMethod> Foam::initialPointsMethod::New const autoPtr<backgroundMeshDecomposition>& decomposition ) { - const word methodName(initialPointsDict.get<word>("initialPointsMethod")); + const word modelType(initialPointsDict.get<word>("initialPointsMethod")); - Info<< nl << "Selecting initialPointsMethod " - << methodName << endl; + Info<< nl << "Selecting initialPointsMethod " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown initialPointsMethod type " - << methodName << nl << nl - << "Valid initialPointsMethod types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "initialPointsMethod", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C index 4916479462cd01513fc3108cfdf32706f1e6c2de..bcb3154d600d84c1d6db4d32c9f36b75f900c580 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2017 OpenFOAM Foundation @@ -68,12 +68,12 @@ Foam::autoPtr<Foam::relaxationModel> Foam::relaxationModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown relaxationModel type " - << modelType << nl << nl - << "Valid relaxationModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "relaxationModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<relaxationModel>(cstrIter()(relaxationDict, runTime)); diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C index c8717c00b7af5cae7576761f5528e3fe8ba444e1..1f041a19539ec020719b4abe6ee7bc64e42737e8 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2015 OpenFOAM Foundation @@ -45,18 +45,18 @@ Foam::searchableSurfaceFeatures::New const dictionary& dict ) { - const word featuresType = surface.type() + "Features"; + const word modelType(surface.type() + "Features"); - auto cstrIter = dictConstructorTablePtr_->cfind(featuresType); + auto cstrIter = dictConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown searchableSurfaceFeatures type " - << featuresType << nl << nl - << "Valid searchableSurfaceFeatures types :" << endl - << dictConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "searchableSurfaceFeatures", + modelType, + *dictConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<searchableSurfaceFeatures>(cstrIter()(surface, dict)); diff --git a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C index d62617c67b05afe2d8b939f31c45f71f0be86fe5..a2ce411a90e2af15d52d1ea6bcea167e380227a5 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C +++ b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2016 OpenFOAM Foundation @@ -68,18 +68,18 @@ Foam::autoPtr<Foam::faceSelection> Foam::faceSelection::New const dictionary& dict ) { - const word sampleType(dict.get<word>("type")); + const word modelType(dict.get<word>("type")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(sampleType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown faceSelection type " - << sampleType << nl << nl - << "Valid faceSelection types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "faceSelection", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<faceSelection>(cstrIter()(name, mesh, dict)); diff --git a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C index fd781ec8f67c3f8b2c3c674dd175e6fc7adec8ed..c0cf895bf4125baef1cbfc3afc35771e007a4cfe 100644 --- a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C +++ b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -44,11 +44,12 @@ Foam::tabulatedWallFunctions::tabulatedWallFunction::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown tabulatedWallFunction type " << functionName - << nl << nl << "Valid tabulatedWallFunction types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "tabulatedWallFunction", + functionName, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<tabulatedWallFunction>(cstrIter()(dict, mesh)); diff --git a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C index 7daae79047cd87493d08a04a64d63638cb35c6db..f7878f5d1fd4e2e0750f3df0435df53204cd7b6b 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C +++ b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C @@ -68,17 +68,19 @@ Foam::surfaceFeaturesExtraction::method::New const dictionary& dict ) { - const word methodName(dict.get<word>("extractionMethod")); + const word modelType(dict.get<word>("extractionMethod")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown extractionMethod " << methodName << nl << nl - << "Valid extraction methods:" << nl - << flatOutput(dictionaryConstructorTablePtr_->sortedToc()) - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "extractionMethod", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<method>(cstrIter.val()(dict)); diff --git a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C index 1ceebe07ca77f7fa470bd69a2863c6240ac0443b..f2d232b885703cc5b19b21a970697cc85be1a124 100644 --- a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C +++ b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014 OpenFOAM Foundation @@ -70,12 +70,12 @@ Foam::searchableSurfaceModifier::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown searchableSurfaceModifier type " - << type << nl << nl - << "Valid searchableSurfaceModifier types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "searchableSurfaceModifier", + type, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<searchableSurfaceModifier>(cstrIter()(geometry, dict)); diff --git a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C index 58f59c0bf9d7ca5eb46955dee3f68087146f436c..5f849e52b62f5a099f7f5f8c4ec88f7ab893fef1 100644 --- a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C +++ b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -42,12 +42,12 @@ Foam::autoPtr<Foam::ODESolver> Foam::ODESolver::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown ODESolver type " - << solverType << nl << nl - << "Valid ODESolver types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "ODESolver", + solverType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<ODESolver>(cstrIter()(odes, dict)); diff --git a/src/OpenFOAM/db/IOstreams/token/token.C b/src/OpenFOAM/db/IOstreams/token/token.C index d5cd96759ed0c25a5771b5c0d4d0e42ebb96b448..7e87f5da0e60cd34471fc477460dab7aae9d1975 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.C +++ b/src/OpenFOAM/db/IOstreams/token/token.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -62,12 +62,13 @@ Foam::autoPtr<Foam::token::compound> Foam::token::compound::New if (!cstrIter.found()) { - FatalIOErrorInFunction(is) - << "Unknown compound type " - << compoundType << nl << nl - << "Valid compound types:" << endl - << IstreamConstructorTablePtr_->sortedToc() - << abort(FatalIOError); + FatalIOErrorInLookup + ( + is, + "compound", + compoundType, + *IstreamConstructorTablePtr_ + ) << abort(FatalIOError); } return autoPtr<Foam::token::compound>(cstrIter()(is)); diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index 26d9403c47080d69a0444af33e76f80f34ea625d..2a255396b0defe1df579cdee33a92b59aa34bcd4 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -112,12 +112,12 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown function type " - << functionType << nl << nl - << "Valid function types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() << endl - << exit(FatalError); + FatalErrorInLookup + ( + "function", + functionType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<functionObject>(cstrIter()(name, runTime, dict)); diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C index 8c7baa705eb18940abd007e52c8db9d262c4ad49..368cd48377fc3f13927b371ea657b955cdf24002 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield |2011 OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -36,21 +36,18 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New const DimensionedField<Type, pointMesh>& iF ) { - if (debug) - { - InfoInFunction << "Constructing pointPatchField<Type>" << endl; - } + DebugInFunction << "Constructing pointPatchField<Type>" << endl; auto cstrIter = pointPatchConstructorTablePtr_->cfind(patchFieldType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown patchFieldType type " - << patchFieldType << nl << nl - << "Valid patchField types :" << endl - << pointPatchConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "patchFieldType", + patchFieldType, + *pointPatchConstructorTablePtr_ + ) << exit(FatalError); } autoPtr<pointPatchField<Type>> pfPtr(cstrIter()(p, iF)); @@ -111,10 +108,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New const dictionary& dict ) { - if (debug) - { - InfoInFunction << "Constructing pointPatchField<Type>" << endl; - } + DebugInFunction << "Constructing pointPatchField<Type>" << endl; const word patchFieldType(dict.get<word>("type")); @@ -184,21 +178,18 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New const pointPatchFieldMapper& pfMapper ) { - if (debug) - { - InfoInFunction << "Constructing pointPatchField<Type>" << endl; - } + DebugInFunction << "Constructing pointPatchField<Type>" << endl; auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type()); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown patchField type " - << ptf.type() << nl << nl - << "Valid patchField types :" << endl - << patchMapperConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "patchField", + ptf.type(), + *patchMapperConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(ptf, p, iF, pfMapper); diff --git a/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C b/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C index 1c4e484d5038ebb787f5e258879eb207235d1d05..2d2a4245116caed66cedc1856e58e21912d11477 100644 --- a/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C +++ b/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C @@ -436,12 +436,12 @@ Foam::autoPtr<Foam::fileOperation> Foam::fileOperation::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown fileHandler type " - << handlerType << nl << nl - << "Valid fileHandler types :" << endl - << wordConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "fileHandler", + handlerType, + *wordConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<fileOperation>(cstrIter()(verbose)); diff --git a/src/OpenFOAM/global/fileOperations/fileOperationInitialise/fileOperationInitialise.C b/src/OpenFOAM/global/fileOperations/fileOperationInitialise/fileOperationInitialise.C index aaf0e656a653a03c0682b2094890712e7e44ddb4..7d8cc600398156d57d8848463a9ff110a3b5dd69 100644 --- a/src/OpenFOAM/global/fileOperations/fileOperationInitialise/fileOperationInitialise.C +++ b/src/OpenFOAM/global/fileOperations/fileOperationInitialise/fileOperationInitialise.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2017-2018 OpenFOAM Foundation @@ -58,21 +58,18 @@ Foam::fileOperations::fileOperationInitialise::New char**& argv ) { - if (debug) - { - InfoInFunction << "Constructing fileOperationInitialise" << endl; - } + DebugInFunction << "Constructing fileOperationInitialise" << endl; auto cstrIter = wordConstructorTablePtr_->cfind(type); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown fileOperationInitialise type " - << type << nl << nl - << "Valid fileOperationInitialise types are" << endl - << wordConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "fileOperationInitialise", + type, + *wordConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<fileOperationInitialise>(cstrIter()(argc, argv)); diff --git a/src/OpenFOAM/graph/graph.C b/src/OpenFOAM/graph/graph.C index 50af571e993a8dda8e0754940e06cd5d8da26170..1469f6ba49c9886e476942ee4ad8b7a81b41f240 100644 --- a/src/OpenFOAM/graph/graph.C +++ b/src/OpenFOAM/graph/graph.C @@ -222,12 +222,12 @@ Foam::autoPtr<Foam::graph::writer> Foam::graph::writer::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown graph format " - << graphFormat << nl << nl - << "Valid graph formats :" << endl - << wordConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "graph", + graphFormat, + *wordConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<graph::writer>(cstrIter()()); diff --git a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C index 7f38a8dc2fab6a1ab0563ba3acfe7da8a4b5dd9d..0cd7f115ca6188fb8bbad00d10acc5a6fe97a4ef 100644 --- a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C +++ b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::autoPtr<Foam::tableReader<Type>> Foam::tableReader<Type>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown reader type " - << readerType << nl << nl - << "Valid reader types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "reader", + readerType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<tableReader<Type>>(cstrIter()(spec)); diff --git a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C index cb6fa4db59950ca09d27f55a8771affed5607c1e..efef3554701b24e0740a429f9db54357c2b52ccb 100644 --- a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C +++ b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C @@ -54,23 +54,18 @@ Foam::autoPtr<Foam::interpolationWeights> Foam::interpolationWeights::New const scalarField& samples ) { - if (debug) - { - InfoInFunction - << "Selecting interpolationWeights " - << type << endl; - } + DebugInFunction << "Selecting interpolationWeights " << type << endl; auto cstrIter = wordConstructorTablePtr_->cfind(type); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown interpolationWeights type " - << type << nl << nl - << "Valid interpolationWeights types :" << endl - << wordConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "interpolationWeights", + type, + *wordConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<interpolationWeights>(cstrIter()(samples)); diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C index 7905e040943a78ce6049d805da56120af7acb7e7..55193f7a61db310ef37edf30ccf368d552c394bd 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -49,12 +49,13 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New if (!cstrIter.found()) { - FatalIOErrorInFunction(preconditionerDict) - << "Unknown symmetric matrix preconditioner " - << preconditionerName << endl << endl - << "Valid symmetric matrix preconditioners are :" << endl - << symMatrixConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + preconditionerDict, + "symmetric matrix preconditioner", + preconditionerName, + *symMatrixConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner> @@ -73,12 +74,13 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New if (!cstrIter.found()) { - FatalIOErrorInFunction(preconditionerDict) - << "Unknown asymmetric matrix preconditioner " - << preconditionerName << endl << endl - << "Valid asymmetric matrix preconditioners are :" << endl - << asymMatrixConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + preconditionerDict, + "asymmetric matrix preconditioner", + preconditionerName, + *asymMatrixConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner> diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C index 74b9ccbc888cc0e7a1051f5c5cd10a38a9b61ec2..2e34bce3fcf94c2af419e3d91af3750dac1714cc 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -46,12 +46,13 @@ Foam::LduMatrix<Type, DType, LUType>::smoother::New if (!cstrIter.found()) { - FatalIOErrorInFunction(smootherDict) - << "Unknown symmetric matrix smoother " << smootherName - << endl << endl - << "Valid symmetric matrix smoothers are :" << endl - << symMatrixConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + smootherDict, + "symmetric matrix smoother", + smootherName, + *symMatrixConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<typename LduMatrix<Type, DType, LUType>::smoother> @@ -69,12 +70,13 @@ Foam::LduMatrix<Type, DType, LUType>::smoother::New if (!cstrIter.found()) { - FatalIOErrorInFunction(smootherDict) - << "Unknown asymmetric matrix smoother " << smootherName - << endl << endl - << "Valid asymmetric matrix smoothers are :" << endl - << asymMatrixConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + smootherDict, + "asymmetric matrix smoother", + smootherName, + *asymMatrixConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<typename LduMatrix<Type, DType, LUType>::smoother> diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C index 2426d57ecd945e33af7f0bba305d4b5f7cff75ce..cfc0d9663383981bcdf90a2cb3306dae64ba9099 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -59,12 +59,13 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New if (!cstrIter.found()) { - FatalIOErrorInFunction(solverDict) - << "Unknown symmetric matrix solver " << solverName - << endl << endl - << "Valid symmetric matrix solvers are :" << endl - << symMatrixConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + solverDict, + "symmetric matrix solver", + solverName, + *symMatrixConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<typename LduMatrix<Type, DType, LUType>::solver> @@ -83,12 +84,13 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New if (!cstrIter.found()) { - FatalIOErrorInFunction(solverDict) - << "Unknown asymmetric matrix solver " << solverName - << endl << endl - << "Valid asymmetric matrix solvers are :" << endl - << asymMatrixConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + solverDict, + "asymmetric matrix solver", + solverName, + *asymMatrixConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<typename LduMatrix<Type, DType, LUType>::solver> diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C index 7a4b846f48bbcd3aad30d2b359320391832522e9..d0c4f1f7b88579350568300ca3ffc832043a561e 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -93,12 +93,13 @@ Foam::lduMatrix::preconditioner::New if (!cstrIter.found()) { - FatalIOErrorInFunction(controls) - << "Unknown symmetric matrix preconditioner " - << name << nl << nl - << "Valid symmetric matrix preconditioners :" << endl - << symMatrixConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + controls, + "symmetric matrix preconditioner", + name, + *symMatrixConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<lduMatrix::preconditioner> @@ -116,12 +117,13 @@ Foam::lduMatrix::preconditioner::New if (!cstrIter.found()) { - FatalIOErrorInFunction(controls) - << "Unknown asymmetric matrix preconditioner " - << name << nl << nl - << "Valid asymmetric matrix preconditioners :" << endl - << asymMatrixConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + controls, + "asymmetric matrix preconditioner", + name, + *asymMatrixConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<lduMatrix::preconditioner> diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C index 8bbcf08ee6565d50b46e3f156c3be08ada66fb9f..1a54f9a5e30c1323f3836e458d63e9efff12c4b9 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -96,12 +96,13 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New if (!cstrIter.found()) { - FatalIOErrorInFunction(solverControls) - << "Unknown symmetric matrix smoother " - << name << nl << nl - << "Valid symmetric matrix smoothers are :" << endl - << symMatrixConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + solverControls, + "symmetric matrix smoother", + name, + *symMatrixConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<lduMatrix::smoother> @@ -122,12 +123,13 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New if (!cstrIter.found()) { - FatalIOErrorInFunction(solverControls) - << "Unknown asymmetric matrix smoother " - << name << nl << nl - << "Valid asymmetric matrix smoothers are :" << endl - << asymMatrixConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + solverControls, + "asymmetric matrix smoother", + name, + *asymMatrixConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<lduMatrix::smoother> diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C index 50b6f46bcc8638d095a78fb52768f6c0140dad55..d5174cd59b175726518b9921f55d256488136c27 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C @@ -73,11 +73,13 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New if (!cstrIter.found()) { - FatalIOErrorInFunction(solverControls) - << "Unknown symmetric matrix solver " << name << nl << nl - << "Valid symmetric matrix solvers are :" << endl - << symMatrixConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + solverControls, + "symmetric matrix solver", + name, + *symMatrixConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<lduMatrix::solver> @@ -99,11 +101,13 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New if (!cstrIter.found()) { - FatalIOErrorInFunction(solverControls) - << "Unknown asymmetric matrix solver " << name << nl << nl - << "Valid asymmetric matrix solvers are :" << endl - << asymMatrixConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + solverControls, + "asymmetric matrix solver", + name, + *asymMatrixConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<lduMatrix::solver> diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C index 8f67d266c8ef5dec5cb2bda6cd362a0bebd0438e..b9dd883a6c264d85ce49bbb4f36b3672d1132320 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C @@ -360,10 +360,7 @@ Foam::autoPtr<Foam::GAMGProcAgglomeration> Foam::GAMGProcAgglomeration::New const dictionary& controlDict ) { - if (debug) - { - InfoInFunction << "Constructing GAMGProcAgglomeration" << endl; - } + DebugInFunction << "Constructing GAMGProcAgglomeration" << endl; auto cstrIter = GAMGAgglomerationConstructorTablePtr_->cfind(type); 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 1424382db55ab1928fe11f53248abaa0005d1c47..b82c69eb4bc6b8c8adb56518d6159faddc45c863 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -41,12 +41,12 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown GAMGInterfaceField type " - << coupleType << nl - << "Valid GAMGInterfaceField types :" - << lduInterfaceFieldConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "GAMGInterfaceField", + coupleType, + *lduInterfaceFieldConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<GAMGInterfaceField>(cstrIter()(GAMGCp, fineInterface)); @@ -66,12 +66,12 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown GAMGInterfaceField type " - << coupleType << nl - << "Valid GAMGInterfaceField types :" - << lduInterfaceConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "GAMGInterfaceField", + coupleType, + *lduInterfaceConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<GAMGInterfaceField>(cstrIter()(GAMGCp, doTransform, rank)); 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 f51673a54281b9b39f4eede183f213f8896254bd..008ece20bd8553ba16f78042de439f53db821811 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -49,11 +49,12 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown GAMGInterface type " << coupleType << ".\n" - << "Valid GAMGInterface types :" - << lduInterfaceConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "GAMGInterface", + coupleType, + *lduInterfaceConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<GAMGInterface> @@ -84,11 +85,12 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown GAMGInterface type " << coupleType << ".\n" - << "Valid GAMGInterface types :" - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "GAMGInterface", + coupleType, + *IstreamConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<GAMGInterface>(cstrIter()(index, coarseInterfaces, is)); diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C index ca6493812ba79be3d5f12464c13b1e6f5e62e1e9..f14599b0c5422d5d06922c33b4cc9d2c77088bee 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -35,21 +35,18 @@ Foam::autoPtr<Foam::facePointPatch> Foam::facePointPatch::New const pointBoundaryMesh& bm ) { - if (debug) - { - InfoInFunction << "Constructing facePointPatch" << endl; - } + DebugInFunction << "Constructing facePointPatch" << endl; auto cstrIter = polyPatchConstructorTablePtr_->cfind(patch.type()); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown facePointPatch type " - << patch.type() << nl << nl - << "Valid facePointPatch types :" << endl - << polyPatchConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "facePointPatch", + patch.type(), + *polyPatchConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<facePointPatch>(cstrIter()(patch, bm)); diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C index 7ac62664a738b80ff63645251368874a7ce609b6..ef80623ebac16e51eb3bbbfcf59da03a1b4d22d3 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -40,21 +40,18 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New const polyBoundaryMesh& bm ) { - if (debug) - { - InfoInFunction << "Constructing polyPatch" << endl; - } + DebugInFunction << "Constructing polyPatch" << endl; auto cstrIter = wordConstructorTablePtr_->cfind(patchType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown polyPatch type " - << patchType << " for patch " << name << nl << nl - << "Valid polyPatch types :" << endl - << wordConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "polyPatch", + patchType, + *wordConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<polyPatch> @@ -80,10 +77,7 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New const polyBoundaryMesh& bm ) { - if (debug) - { - InfoInFunction << "Constructing polyPatch" << endl; - } + DebugInFunction << "Constructing polyPatch" << endl; word patchType(dict.get<word>("type")); dict.readIfPresent("geometricType", patchType); @@ -101,10 +95,7 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New const polyBoundaryMesh& bm ) { - if (debug) - { - InfoInFunction << "Constructing polyPatch" << endl; - } + DebugInFunction << "Constructing polyPatch" << endl; auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchType); @@ -117,12 +108,13 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown polyPatch type " - << patchType << " for patch " << name << nl << nl - << "Valid polyPatch types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "polyPatch", + patchType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C index ed01177e802cb64897e75b9120c619ecafd862a5..81308d5e763c93333dd20a250caff61bad49857d 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -38,10 +38,7 @@ Foam::autoPtr<Foam::cellZone> Foam::cellZone::New const cellZoneMesh& zm ) { - if (debug) - { - InfoInFunction << "Constructing cellZone " << name << endl; - } + DebugInFunction << "Constructing cellZone " << name << endl; const word zoneType(dict.get<word>("type")); @@ -49,12 +46,13 @@ Foam::autoPtr<Foam::cellZone> Foam::cellZone::New if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown cellZone type " - << zoneType << nl << nl - << "Valid cellZone types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "cellZone", + zoneType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<cellZone>(cstrIter()(name, dict, index, zm)); diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C index 56f2ce95773259c342620569cf3dd96e35b912bf..f8cbf33de7812bc96bbbf70f47650cedef438e54 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -38,10 +38,7 @@ Foam::autoPtr<Foam::faceZone> Foam::faceZone::New const faceZoneMesh& zm ) { - if (debug) - { - InfoInFunction << "Constructing faceZone " << name << endl; - } + DebugInFunction << "Constructing faceZone " << name << endl; const word zoneType(dict.get<word>("type")); @@ -49,12 +46,13 @@ Foam::autoPtr<Foam::faceZone> Foam::faceZone::New if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown faceZone type " - << zoneType << nl << nl - << "Valid faceZone types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "faceZone", + zoneType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<faceZone>(cstrIter()(name, dict, index, zm)); diff --git a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C index d7689f1ae3ac42742f2de2b9c5c9ea18fdb5b3b4..de17bf1c562f71796a9aece6756db0c6c4c78b88 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -38,10 +38,7 @@ Foam::autoPtr<Foam::pointZone> Foam::pointZone::New const pointZoneMesh& zm ) { - if (debug) - { - InfoInFunction << "Constructing pointZone " << name << endl; - } + DebugInFunction << "Constructing pointZone " << name << endl; const word zoneType(dict.get<word>("type")); @@ -49,12 +46,13 @@ Foam::autoPtr<Foam::pointZone> Foam::pointZone::New if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown pointZone type " - << zoneType << nl << nl - << "Valid pointZone types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "pointZone", + zoneType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<pointZone>(cstrIter()(name, dict, index, zm)); diff --git a/src/OpenFOAM/primitives/functions/Function1/Function1/Function1New.C b/src/OpenFOAM/primitives/functions/Function1/Function1/Function1New.C index 1fa65b93c5ce829d7afd8c5ffb0f8f07bb68e885..890983a8ca2cfdbc4cbc76a2e865a649ea47e70c 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Function1/Function1New.C +++ b/src/OpenFOAM/primitives/functions/Function1/Function1/Function1New.C @@ -54,7 +54,7 @@ Foam::autoPtr<Foam::Function1<Type>> Foam::Function1<Type>::New { FatalIOErrorInFunction(dict) << "Unknown Function1 type " - << Function1Type << " for Function1 " + << Function1Type << " for " << entryName << nl << nl << "Valid Function1 types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << nl @@ -110,7 +110,7 @@ Foam::autoPtr<Foam::Function1<Type>> Foam::Function1<Type>::New { FatalIOErrorInFunction(dict) << "Unknown Function1 type " - << Function1Type << " for Function1 " + << Function1Type << " for " << entryName << nl << nl << "Valid Function1 types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << nl diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C index ff860bd5da9f87e5aedeec27241c2f3802b3f270..4b1a77f16daf880cc3f515211baefdd168f48a02 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C @@ -135,8 +135,6 @@ Foam::LESModel<BasicTurbulenceModel>::New const word& propertiesName ) { - // get model name, but do not register the dictionary - // otherwise it is registered in the database twice const word modelType ( IOdictionary @@ -148,7 +146,7 @@ Foam::LESModel<BasicTurbulenceModel>::New U.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) ).subDict("LES").get<word>("LESModel") ); @@ -159,12 +157,12 @@ Foam::LESModel<BasicTurbulenceModel>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown LESModel type " - << modelType << nl << nl - << "Valid LESModel types:" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "LESModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<LESModel> diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C index 549bde8cffc8e893e4ceded8ea03f3096f84be2f..304a8c232c8e06c112d822f969177b67781740a0 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -80,12 +80,12 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown LESdelta type " - << deltaType << nl << nl - << "Valid LESdelta types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "LESdelta", + deltaType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<LESdelta>(cstrIter()(name, turbulence, dict)); @@ -119,13 +119,13 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown LESdelta type " - << deltaType << nl << nl - << "Valid LESdelta types :" << endl - << additionalConstructors.sortedToc() - << " and " - << dictionaryConstructorTablePtr_->sortedToc() + FatalErrorInLookup + ( + "LESdelta", + deltaType, + additionalConstructors + ) + << " and " << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C b/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C index 8300cbcd9e83a0ba7e9c3c7d9b240de45e246506..eb325db5eb7038e538b94cdcb50e5decad84b0bf 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -52,12 +52,12 @@ Foam::autoPtr<Foam::LESfilter> Foam::LESfilter::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown LESfilter type " - << filterType << nl << nl - << "Valid LESfilter types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "LESfilter", + filterType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<LESfilter>(cstrIter()(mesh, dict)); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C b/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C index 90561aaed5f6a535d27d6d95f0ed8304e5ea7c15..8c3c255dde243fcdf8f220b911395b04925c3302 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C @@ -125,8 +125,6 @@ Foam::RASModel<BasicTurbulenceModel>::New const word& propertiesName ) { - // get model name, but do not register the dictionary - // otherwise it is registered in the database twice const word modelType ( IOdictionary @@ -138,7 +136,7 @@ Foam::RASModel<BasicTurbulenceModel>::New U.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) ).subDict("RAS").get<word>("RASModel") ); @@ -149,12 +147,12 @@ Foam::RASModel<BasicTurbulenceModel>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown RASModel type " - << modelType << nl << nl - << "Valid RASModel types:" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "RASModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<RASModel> diff --git a/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C b/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C index 1b88a1d080390775ff2bce69b8b524e09f2cd3f0..81e9040aa103027284ba0cbe8303018ce990aec6 100644 --- a/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C +++ b/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2017 OpenFOAM Foundation @@ -87,8 +87,6 @@ Foam::TurbulenceModel<Alpha, Rho, BasicTurbulenceModel, TransportModel>::New const word& propertiesName ) { - // get model name, but do not register the dictionary - // otherwise it is registered in the database twice const word modelType ( IOdictionary @@ -100,7 +98,7 @@ Foam::TurbulenceModel<Alpha, Rho, BasicTurbulenceModel, TransportModel>::New U.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) ).get<word>("simulationType") ); @@ -111,12 +109,12 @@ Foam::TurbulenceModel<Alpha, Rho, BasicTurbulenceModel, TransportModel>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown simulationType " - << modelType << nl << nl - << "Valid simulation types:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "simulationType", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<TurbulenceModel> diff --git a/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C b/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C index 150114677e20d871df07205c252758a7083717d8..a2ece6cf6bf0b17f47d1e0555c85c634f07af754 100644 --- a/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C +++ b/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C @@ -101,14 +101,12 @@ Foam::laminarModel<BasicTurbulenceModel>::New U.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) ); if (modelDict.found("laminar")) { - // get model name, but do not register the dictionary - // otherwise it is registered in the database twice const word modelType ( modelDict.subDict("laminar").get<word>("laminarModel") @@ -120,12 +118,12 @@ Foam::laminarModel<BasicTurbulenceModel>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown laminarModel type " - << modelType << nl << nl - << "Valid laminarModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "laminarModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<laminarModel> diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C index 8e74f8f5862f58f2c503e21d57887fd907f0f9ed..06d4b14bd24ba680ac7b77f9c3f8f0d869ae6303 100644 --- a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C +++ b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -48,12 +48,13 @@ Foam::autoPtr<Foam::reactionRateFlameArea> Foam::reactionRateFlameArea::New if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown reactionRateFlameArea type " - << modelType << nl << nl - << "Valid reaction rate flame area types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "reactionRateFlameArea", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } const word className = modelType.substr(0, modelType.find('<')); diff --git a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C index 480c86774a0e93c3b9c2ccd04e7a2a7c6a2b4525..8328fda0dcbe603f29c8381bb24d3f424fea30a6 100644 --- a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C +++ b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -46,7 +46,7 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io) io.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ); if (dictHeader.typeHeaderOk<IOdictionary>(true)) @@ -75,12 +75,13 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io) if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown dynamicFvMesh type " - << modelType << nl << nl - << "Valid dynamicFvMesh types are :" << endl - << IOobjectConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "dynamicFvMesh", + modelType, + *IOobjectConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<dynamicFvMesh>(cstrIter()(io)); diff --git a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C index 0737597281dce7e53ad853c8d9fb73a3b404fde1..cae98fd46ca119cba2ac6e5298f71921f8157ebf 100644 --- a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C +++ b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -51,12 +51,12 @@ Foam::autoPtr<Foam::cellLooper> Foam::cellLooper::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown cellLooper type " - << type << nl << nl - << "Valid cellLooper types :" << endl - << wordConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "cellLooper", + type, + *wordConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<cellLooper>(cstrIter()(mesh)); diff --git a/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C b/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C index c5ed6a1c260f9e0c44290f456056c0e644a7d4fd..85318e23248d663aaa70097f3cb41b71764cb95e 100644 --- a/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C +++ b/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2016 OpenFOAM Foundation @@ -113,12 +113,12 @@ Foam::displacementMotionSolver::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown solver type " - << solverTypeName << nl << nl - << "Valid solver types :" << endl - << displacementConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "solver", + solverTypeName, + *displacementConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<displacementMotionSolver> diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C index b6f5981f024484746be257734920bfb5f96d4cd6..d9b9709a11e48916e49b037149053f0e00a0cb9f 100644 --- a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C +++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -43,12 +43,12 @@ Foam::autoPtr<Foam::solidBodyMotionFunction> Foam::solidBodyMotionFunction::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown solidBodyMotionFunction type " - << motionType << nl << nl - << "Valid solidBodyMotionFunction types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "solidBodyMotionFunction", + motionType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<solidBodyMotionFunction>(cstrIter()(SBMFCoeffs, runTime)); diff --git a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C index a1f486f65d53a4f2321a1e85fd216425f3fabdea..d81798baac632668ea6408103e27c5eee55a1e7d 100644 --- a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C +++ b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -134,12 +134,12 @@ Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown solver type " - << solverName << nl << nl - << "Valid solver types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "solver", + solverName, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<motionSolver>(cstrIter()(mesh, solverDict)); diff --git a/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C b/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C index a15e4c6daa60d6fad55e552cb4ebec24bb4efd78..88214fdf761dafeca82514624e307a563890b61f 100644 --- a/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C +++ b/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -38,23 +38,21 @@ Foam::autoPtr<Foam::polyMeshModifier> Foam::polyMeshModifier::New const polyTopoChanger& mme ) { - if (debug) - { - InfoInFunction << "Constructing polyMeshModifier" << endl; - } + DebugInFunction << "Constructing polyMeshModifier" << endl; - const word modifierType(dict.get<word>("type")); + const word modelType(dict.get<word>("type")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modifierType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown polyMeshModifier type " - << modifierType << nl << nl - << "Valid polyMeshModifier types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "polyMeshModifier", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<polyMeshModifier>(cstrIter()(name, dict, index, mme)); diff --git a/src/engine/engineMesh/engineMesh/engineMeshNew.C b/src/engine/engineMesh/engineMesh/engineMeshNew.C index b76d60c2cfb4a1e9a75ffdaaa850a58606a121a0..7c2ad6883206a4c935b3d04d0b0ca7faa7242779 100644 --- a/src/engine/engineMesh/engineMesh/engineMeshNew.C +++ b/src/engine/engineMesh/engineMesh/engineMeshNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -35,8 +35,6 @@ Foam::autoPtr<Foam::engineMesh> Foam::engineMesh::New const Foam::IOobject& io ) { - // get model name, but do not register the dictionary - // otherwise it is registered in the database twice const word modelType ( IOdictionary @@ -48,9 +46,9 @@ Foam::autoPtr<Foam::engineMesh> Foam::engineMesh::New io.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) - ).lookup("engineMesh") + ).get<word>("engineMesh") ); Info<< "Selecting engineMesh " << modelType << endl; @@ -59,12 +57,12 @@ Foam::autoPtr<Foam::engineMesh> Foam::engineMesh::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown engineMesh type " - << modelType << nl << nl - << "Valid engineMesh types :" << endl - << IOobjectConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "engineMesh", + modelType, + *IOobjectConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<engineMesh>(cstrIter()(io)); diff --git a/src/engine/engineTime/engineTime/engineTimeNew.C b/src/engine/engineTime/engineTime/engineTimeNew.C index 43d69ab6893f1ee421524fdbbd60c892328e0c13..3bd829ed261f7c0a9f95745e6cbbc249a44fcebe 100644 --- a/src/engine/engineTime/engineTime/engineTimeNew.C +++ b/src/engine/engineTime/engineTime/engineTimeNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -55,12 +55,12 @@ Foam::autoPtr<Foam::engineTime> Foam::engineTime::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown engine type " - << engineType << nl << nl - << "Valid engine types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "engine", + engineType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<engineTime> diff --git a/src/fileFormats/sampledSetWriters/writer.C b/src/fileFormats/sampledSetWriters/writer.C index 914f5fe5900be3f687aa6b7aaba50993a648a395..02a3bc309d08a1b0e3780c6404e5d51f7b59c907 100644 --- a/src/fileFormats/sampledSetWriters/writer.C +++ b/src/fileFormats/sampledSetWriters/writer.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -42,12 +42,12 @@ Foam::autoPtr<Foam::writer<Type>> Foam::writer<Type>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown write type " - << writeType << nl << nl - << "Valid write types :" << endl - << wordConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "writer", + writeType, + *wordConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<writer<Type>>(cstrIter()()); diff --git a/src/finiteArea/faMesh/faPatches/faPatch/faPatchNew.C b/src/finiteArea/faMesh/faPatches/faPatch/faPatchNew.C index 6b0e99d3f68d332b2f973aa77534258feecb6386..78639882c1bdab275a0805e7860738c7020124f1 100644 --- a/src/finiteArea/faMesh/faPatches/faPatch/faPatchNew.C +++ b/src/finiteArea/faMesh/faPatches/faPatch/faPatchNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016-2017 Wikki Ltd @@ -38,8 +38,7 @@ Foam::autoPtr<Foam::faPatch> Foam::faPatch::New const faBoundaryMesh& bm ) { - DebugInFunction - << "constructing faPatch" << endl; + DebugInFunction << "Constructing faPatch" << endl; const word patchType(dict.get<word>("type")); @@ -47,11 +46,13 @@ Foam::autoPtr<Foam::faPatch> Foam::faPatch::New if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown faPatch type " << patchType << nl << nl - << "Valid faPatch types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "faPatch", + patchType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<faPatch>(cstrIter()(name, dict, index, bm)); diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFieldNew.C b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFieldNew.C index 7c73e7d2355bf4cba0c81fe2d9cf3ef314b0502d..b3bcfb4fa274fd21fa54ed4c0c82d45cf2618551 100644 --- a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFieldNew.C +++ b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFieldNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016-2017 Wikki Ltd @@ -36,19 +36,18 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New const DimensionedField<Type, areaMesh>& iF ) { - DebugInFunction - << "constructing faPatchField<Type>" - << endl; + DebugInFunction << "Constructing faPatchField<Type>" << endl; auto cstrIter = patchConstructorTablePtr_->cfind(patchFieldType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown patchTypefield type " << patchFieldType << nl << nl - << "Valid patchField types are :" << nl - << patchConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "patchField", + patchFieldType, + *patchConstructorTablePtr_ + ) << exit(FatalError); } auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type()); @@ -68,17 +67,16 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New return cstrIter()(p, iF); } } - else - { - tmp<faPatchField<Type>> tfap = cstrIter()(p, iF); - // Check if constraint type override and store patchType if so - if (patchTypeCstrIter.found()) - { - tfap.ref().patchType() = actualPatchType; - } - return tfap; + + tmp<faPatchField<Type>> tfap = cstrIter()(p, iF); + + // Check if constraint type override and store patchType if so + if (patchTypeCstrIter.found()) + { + tfap.ref().patchType() = actualPatchType; } + return tfap; } @@ -102,9 +100,7 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New const dictionary& dict ) { - DebugInFunction - << "constructing faPatchField<Type>" - << endl; + DebugInFunction << "Constructing faPatchField<Type>" << endl; const word patchFieldType(dict.get<word>("type")); @@ -152,19 +148,18 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New const faPatchFieldMapper& pfMapper ) { - DebugInFunction - << "constructing faPatchField<Type>" - << endl; + DebugInFunction << "Constructing faPatchField<Type>" << endl; auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type()); if (!cstrIter.found()) { - FatalErrorInFunction - << "unknown patchTypefield type " << ptf.type() << nl << nl - << "Valid patchField types are :" << nl - << patchMapperConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "patchField", + ptf.type(), + *patchMapperConstructorTablePtr_ + ) << exit(FatalError); } auto patchTypeCstrIter = patchMapperConstructorTablePtr_->cfind(p.type()); @@ -173,10 +168,8 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New { return patchTypeCstrIter()(ptf, p, iF, pfMapper); } - else - { - return cstrIter()(ptf, p, iF, pfMapper); - } + + return cstrIter()(ptf, p, iF, pfMapper); } diff --git a/src/finiteArea/fields/faePatchFields/faePatchField/faePatchFieldNew.C b/src/finiteArea/fields/faePatchFields/faePatchField/faePatchFieldNew.C index 7d021a03cbcd0b8cabb376a18bca76dc05f095e1..7f0dbc6e08fa30efe019f743776b4a5ca667b0cc 100644 --- a/src/finiteArea/fields/faePatchFields/faePatchField/faePatchFieldNew.C +++ b/src/finiteArea/fields/faePatchFields/faePatchField/faePatchFieldNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016-2017 Wikki Ltd @@ -35,19 +35,18 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New const DimensionedField<Type, edgeMesh>& iF ) { - DebugInFunction - << "constructing faePatchField<Type>" - << endl; + DebugInFunction << "Constructing faePatchField" << endl; auto cstrIter = patchConstructorTablePtr_->cfind(patchFieldType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown patchTypefield type " << patchFieldType << nl << nl - << "Valid patchField types are :" << nl - << patchConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "patchField", + patchFieldType, + *patchConstructorTablePtr_ + ) << exit(FatalError); } auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type()); @@ -71,9 +70,7 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New const dictionary& dict ) { - DebugInFunction - << "constructing faePatchField<Type>" - << endl; + DebugInFunction << "Constructing faePatchField" << endl; const word patchFieldType(dict.get<word>("type")); @@ -121,19 +118,18 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New const faPatchFieldMapper& pfMapper ) { - DebugInFunction - << "constructing faePatchField<Type>" - << endl; + DebugInFunction << "Constructing faePatchField<Type>" << endl; auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type()); if (!cstrIter.found()) { - FatalErrorInFunction - << "unknown patchTypefield type " << ptf.type() << endl << endl - << "Valid patchField types are :" << endl - << patchMapperConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "patchField", + ptf.type(), + *patchMapperConstructorTablePtr_ + ) << exit(FatalError); } auto patchTypeCstrIter = patchMapperConstructorTablePtr_->cfind(p.type()); @@ -142,10 +138,8 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New { return patchTypeCstrIter()(ptf, p, iF, pfMapper); } - else - { - return cstrIter()(ptf, p, iF, pfMapper); - } + + return cstrIter()(ptf, p, iF, pfMapper); } diff --git a/src/finiteArea/finiteArea/convectionSchemes/faConvectionScheme/faConvectionScheme.C b/src/finiteArea/finiteArea/convectionSchemes/faConvectionScheme/faConvectionScheme.C index 45a99e9051203962aa431d643a30743f3eaacd22..168ceb43d5ace8d2bf2179229f2fd444cb5828f2 100644 --- a/src/finiteArea/finiteArea/convectionSchemes/faConvectionScheme/faConvectionScheme.C +++ b/src/finiteArea/finiteArea/convectionSchemes/faConvectionScheme/faConvectionScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016-2017 Wikki Ltd @@ -61,11 +61,13 @@ Foam::fa::convectionScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown convection scheme " << schemeName << nl << nl - << "Valid convection schemes are :" << nl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "convection", + schemeName, + *IstreamConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, faceFlux, schemeData); diff --git a/src/finiteArea/finiteArea/d2dt2Schemes/faD2dt2Scheme/faD2dt2Scheme.C b/src/finiteArea/finiteArea/d2dt2Schemes/faD2dt2Scheme/faD2dt2Scheme.C index c41a109465c302355c28ff311d9672ababf84f45..bfafabf81ba8e9ddf9ef1e44b93ac365649efc9b 100644 --- a/src/finiteArea/finiteArea/d2dt2Schemes/faD2dt2Scheme/faD2dt2Scheme.C +++ b/src/finiteArea/finiteArea/d2dt2Schemes/faD2dt2Scheme/faD2dt2Scheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2017 Volkswagen AG @@ -72,11 +72,13 @@ tmp<faD2dt2Scheme<Type>> faD2dt2Scheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown d2dt2 scheme " << schemeName << nl << nl - << "Valid d2dt2 schemes are :" << endl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "d2dt2", + schemeName, + *IstreamConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, schemeData); diff --git a/src/finiteArea/finiteArea/ddtSchemes/faDdtScheme/faDdtScheme.C b/src/finiteArea/finiteArea/ddtSchemes/faDdtScheme/faDdtScheme.C index 3e5973a7dc5d3fff754a63afbc1897a84c03b18e..b960dca8e6dc4cea418e34d8e43f3d9ab1828e66 100644 --- a/src/finiteArea/finiteArea/ddtSchemes/faDdtScheme/faDdtScheme.C +++ b/src/finiteArea/finiteArea/ddtSchemes/faDdtScheme/faDdtScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016-2017 Wikki Ltd @@ -69,11 +69,13 @@ tmp<faDdtScheme<Type>> faDdtScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown ddt scheme " << schemeName << nl << nl - << "Valid ddt schemes are :" << nl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "ddt", + schemeName, + *IstreamConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, schemeData); diff --git a/src/finiteArea/finiteArea/divSchemes/faDivScheme/faDivScheme.C b/src/finiteArea/finiteArea/divSchemes/faDivScheme/faDivScheme.C index d9abced858894e3cf2ab3a2db325c28408910167..658350c9437738d5ec97e4926c5d41bb34291396 100644 --- a/src/finiteArea/finiteArea/divSchemes/faDivScheme/faDivScheme.C +++ b/src/finiteArea/finiteArea/divSchemes/faDivScheme/faDivScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016-2017 Wikki Ltd @@ -70,12 +70,13 @@ tmp<divScheme<Type>> divScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown div scheme " - << schemeName << nl << nl - << "Valid div schemes are :" << nl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "div", + schemeName, + *IstreamConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, schemeData); diff --git a/src/finiteArea/finiteArea/gradSchemes/faGradScheme/faGradScheme.C b/src/finiteArea/finiteArea/gradSchemes/faGradScheme/faGradScheme.C index 0389565f551352248ace4f5f2af9d4fa4aa09937..ae313900278a424db140faf261cef16bbf060fa6 100644 --- a/src/finiteArea/finiteArea/gradSchemes/faGradScheme/faGradScheme.C +++ b/src/finiteArea/finiteArea/gradSchemes/faGradScheme/faGradScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016-2017 Wikki Ltd @@ -69,11 +69,13 @@ tmp<gradScheme<Type>> gradScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown grad scheme " << schemeName << nl << nl - << "Valid grad schemes are :" << nl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "grad", + schemeName, + *IstreamConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, schemeData); diff --git a/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.C b/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.C index 5da31a8099b2c3c4a49fcf414b1e059e5f97a4df..3d462df7768f7da4171a38d8f408040d122adee2 100644 --- a/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.C +++ b/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016-2017 Wikki Ltd @@ -70,11 +70,13 @@ tmp<laplacianScheme<Type>> laplacianScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown laplacian scheme " << schemeName << nl << nl - << "Valid laplacian schemes are :" << nl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "laplacian", + schemeName, + *IstreamConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, schemeData); diff --git a/src/finiteArea/finiteArea/lnGradSchemes/lnGradScheme/lnGradScheme.C b/src/finiteArea/finiteArea/lnGradSchemes/lnGradScheme/lnGradScheme.C index ffa1cabd23668b6025803459b81c7a6aff8d9764..36ba2e3ea9f03eb7645afdb1ff7d3c45d1740d1f 100644 --- a/src/finiteArea/finiteArea/lnGradSchemes/lnGradScheme/lnGradScheme.C +++ b/src/finiteArea/finiteArea/lnGradSchemes/lnGradScheme/lnGradScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016-2017 Wikki Ltd @@ -60,7 +60,7 @@ tmp<lnGradScheme<Type>> lnGradScheme<Type>::New if (schemeData.eof()) { FatalIOErrorInFunction(schemeData) - << "Discretisation scheme not specified" << nl << nl + << "Grad scheme not specified" << nl << nl << "Valid schemes are :" << endl << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -72,12 +72,13 @@ tmp<lnGradScheme<Type>> lnGradScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown discretisation scheme " - << schemeName << nl << nl - << "Valid schemes are :" << nl - << MeshConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "grad", + schemeName, + *MeshConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, schemeData); diff --git a/src/finiteArea/interpolation/edgeInterpolation/edgeInterpolationScheme/edgeInterpolationScheme.C b/src/finiteArea/interpolation/edgeInterpolation/edgeInterpolationScheme/edgeInterpolationScheme.C index 334296e9118c43e9a1f9d6909d3bbf7a516b5f7e..667909a16c70d06235791553159ff7ecdcb3af63 100644 --- a/src/finiteArea/interpolation/edgeInterpolation/edgeInterpolationScheme/edgeInterpolationScheme.C +++ b/src/finiteArea/interpolation/edgeInterpolation/edgeInterpolationScheme/edgeInterpolationScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016-2017 Wikki Ltd @@ -64,12 +64,13 @@ Foam::edgeInterpolationScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown discretisation scheme " - << schemeName << nl << nl - << "Valid schemes are :" << nl - << MeshConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "discretisation", + schemeName, + *MeshConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, schemeData); @@ -108,12 +109,13 @@ Foam::edgeInterpolationScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown discretisation scheme " - << schemeName << nl << nl - << "Valid schemes are :" << endl - << MeshFluxConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "discretisation", + schemeName, + *MeshFluxConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, faceFlux, schemeData); diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C index ec77ebdfed8549a8b9cdc232f7e4d7b971299941..aaf60ac9f645219e0c8fae20c4e8d2f3c6f7ef3a 100644 --- a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -34,8 +34,6 @@ Foam::autoPtr<Foam::SRF::SRFModel> Foam::SRF::SRFModel::New const volVectorField& Urel ) { - // get model name, but do not register the dictionary - // otherwise it is registered in the database twice const word modelType ( IOdictionary @@ -47,9 +45,9 @@ Foam::autoPtr<Foam::SRF::SRFModel> Foam::SRF::SRFModel::New Urel.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) - ).lookup("SRFModel") + ).get<word>("SRFModel") ); Info<< "Selecting SRFModel " << modelType << endl; @@ -58,12 +56,12 @@ Foam::autoPtr<Foam::SRF::SRFModel> Foam::SRF::SRFModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown SRFModel type " - << modelType << nl << nl - << "Valid SRFModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "SRFModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<SRFModel>(cstrIter()(Urel)); diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C index d88d53f8a416f33f4275ebfde15b239f3f07345f..be27d1f8ac32873b97fa7fa3c2ce2bf260751471 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -88,12 +88,12 @@ Foam::autoPtr<Foam::fv::option> Foam::fv::option::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown fvOption model type " - << modelType << nl << nl - << "Valid fvOption types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "fvOption", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<option>(cstrIter()(name, modelType, coeffs, mesh)); diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C index 53649e5901e8f4058dea6db866da815fdf5f1a96..9d6080cfbe18365e68be40823cd6a82a7cc2bcd6 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2015 OpenFOAM Foundation @@ -46,11 +46,12 @@ Foam::autoPtr<Foam::porosityModel> Foam::porosityModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown " << typeName << " type " << modelType << nl << nl - << "Valid types are:" << nl - << meshConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + typeName, + modelType, + *meshConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<porosityModel> diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C index dd986d96f8a3926dba3fb6db138b8ee90af6add6..2222146f5a4dc0c03deac0c80e15a7332da95266 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -48,12 +48,12 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown patchField type " - << patchFieldType << nl << nl - << "Valid patchField types :" << endl - << patchConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "patchField", + patchFieldType, + *patchConstructorTablePtr_ + ) << exit(FatalError); } auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type()); @@ -73,17 +73,16 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New return cstrIter()(p, iF); } } - else - { - tmp<fvPatchField<Type>> tfvp = cstrIter()(p, iF); - // Check if constraint type override and store patchType if so - if (patchTypeCstrIter.found()) - { - tfvp.ref().patchType() = actualPatchType; - } - return tfvp; + + tmp<fvPatchField<Type>> tfvp = cstrIter()(p, iF); + + // Check if constraint type override and store patchType if so + if (patchTypeCstrIter.found()) + { + tfvp.ref().patchType() = actualPatchType; } + return tfvp; } @@ -148,7 +147,7 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New if (patchTypeCstrIter.found() && patchTypeCstrIter() != cstrIter()) { FatalIOErrorInFunction(dict) - << "inconsistent patch and patchField types for \n" + << "inconsistent patch and patchField types for\n" " patch type " << p.type() << " and patchField type " << patchFieldType << exit(FatalIOError); @@ -177,11 +176,12 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown patchField type " << ptf.type() << nl << nl - << "Valid patchField types :" << endl - << patchMapperConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "patchField", + ptf.type(), + *patchMapperConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(ptf, p, iF, pfMapper); diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C index 97529eba2e5463faf91577ba4ca1b638d1b7a92f..120bfc37fa37cf5c6ec7d4031ffdfa3a187eca7a 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -36,21 +36,18 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New const DimensionedField<Type, surfaceMesh>& iF ) { - if (debug) - { - InfoInFunction << "Constructing fvsPatchField<Type>" << endl; - } + DebugInFunction << "Constructing fvsPatchField" << endl; auto cstrIter = patchConstructorTablePtr_->cfind(patchFieldType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown patchField type " - << patchFieldType << nl << nl - << "Valid patchField types :" << endl - << patchConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "patchField", + patchFieldType, + *patchConstructorTablePtr_ + ) << exit(FatalError); } if @@ -70,10 +67,8 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New return cstrIter()(p, iF); } } - else - { - return cstrIter()(p, iF); - } + + return cstrIter()(p, iF); } @@ -97,10 +92,7 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New const dictionary& dict ) { - if (debug) - { - InfoInFunction << "Constructing fvsPatchField<Type>" << endl; - } + DebugInFunction << "Constructing fvsPatchField" << endl; const word patchFieldType(dict.get<word>("type")); @@ -136,7 +128,7 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New if (patchTypeCstrIter.found() && patchTypeCstrIter() != cstrIter()) { FatalIOErrorInFunction(dict) - << "inconsistent patch and patchField types for \n" + << "inconsistent patch and patchField types for\n" " patch type " << p.type() << " and patchField type " << patchFieldType << exit(FatalIOError); @@ -156,20 +148,18 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New const fvPatchFieldMapper& pfMapper ) { - if (debug) - { - InfoInFunction << "Constructing fvsPatchField<Type>" << endl; - } + DebugInFunction << "Constructing fvsPatchField" << endl; auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type()); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown patchField type " << ptf.type() << nl << nl - << "Valid patchField types :" << endl - << patchMapperConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "patchField", + ptf.type(), + *patchMapperConstructorTablePtr_ + ) << exit(FatalError); } auto patchTypeCstrIter = patchMapperConstructorTablePtr_->cfind(p.type()); @@ -178,10 +168,8 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New { return patchTypeCstrIter()(ptf, p, iF, pfMapper); } - else - { - return cstrIter()(ptf, p, iF, pfMapper); - } + + return cstrIter()(ptf, p, iF, pfMapper); } diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C b/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C index b88314436fdf96f20c5cbb0a37bf97d403671f69..76cd0834ac9842dc666418ea0c1c694191d16065 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C +++ b/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -88,12 +88,13 @@ tmp<convectionScheme<Type>> convectionScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown convection scheme " - << schemeName << nl << nl - << "Valid convection schemes are :" << endl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "convection", + schemeName, + *IstreamConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, faceFlux, schemeData); @@ -130,12 +131,13 @@ tmp<convectionScheme<Type>> convectionScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown convection scheme " - << schemeName << nl << nl - << "Valid convection schemes are :" << endl - << MultivariateConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "convection", + schemeName, + *MultivariateConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, fields, faceFlux, schemeData); diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C b/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C index 805302f80ed5dfed6e3e5f199d57c5007c5a0340..114979f15d8b43b6239f9d84d9c941da61e4d149 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -67,12 +67,13 @@ tmp<d2dt2Scheme<Type>> d2dt2Scheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown d2dt2 scheme " - << schemeName << nl << nl - << "Valid d2dt2 schemes are :" << endl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "d2dt2", + schemeName, + *IstreamConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, schemeData); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C index c73a14f169ca958495d5ebe6ca85e05ce5444051..fa26f0b1805979b2a3a9ce7bcc1e6908728bd051 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2018 OpenFOAM Foundation @@ -71,12 +71,13 @@ tmp<ddtScheme<Type>> ddtScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown ddt scheme " - << schemeName << nl << nl - << "Valid ddt schemes are :" << endl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "ddt", + schemeName, + *IstreamConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, schemeData); diff --git a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C index d6606f953db03b06c2c3427a5a7db307384b9a69..224021bca724a03da6886f37b6843feb7daca2eb 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C @@ -58,12 +58,13 @@ Foam::tmp<Foam::fv::gradScheme<Type>> Foam::fv::gradScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown grad scheme " - << schemeName << nl << nl - << "Valid grad schemes are :" << endl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "grad", + schemeName, + *IstreamConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, schemeData); diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C index 2723af127efd12434410898e48842c8a9730b0a5..195178b68db0a590c10200eeaff100dd64ee1985 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -69,12 +69,13 @@ tmp<laplacianScheme<Type, GType>> laplacianScheme<Type, GType>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown laplacian scheme " - << schemeName << nl << nl - << "Valid laplacian schemes are :" << endl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "laplacian", + schemeName, + *IstreamConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, schemeData); diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C index 5505ddf7fd1bb8750da7af211c497f98c596a826..fa2187a083ce238126dc3b32bd5b53c303645d7e 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -71,12 +71,13 @@ tmp<snGradScheme<Type>> snGradScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown discretisation scheme " - << schemeName << nl << nl - << "Valid schemes are :" << endl - << MeshConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "discretisation", + schemeName, + *MeshConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, schemeData); diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C index d494091c9eb29f17d71762cb5f768401b77240cd..2daaaea918dede2dda0b1eb572f7b64c570aefd4 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -36,20 +36,18 @@ Foam::autoPtr<Foam::fvPatch> Foam::fvPatch::New const fvBoundaryMesh& bm ) { - if (debug) - { - InfoInFunction << "Constructing fvPatch" << endl; - } + DebugInFunction << "Constructing fvPatch" << endl; auto cstrIter = polyPatchConstructorTablePtr_->cfind(patch.type()); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown fvPatch type " << patch.type() << nl - << "Valid fvPatch types :" - << polyPatchConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "fvPatch", + patch.type(), + *polyPatchConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<fvPatch>(cstrIter()(patch, bm)); diff --git a/src/finiteVolume/fvMesh/simplifiedFvMesh/simplifiedFvMesh/simplifiedFvMesh.C b/src/finiteVolume/fvMesh/simplifiedFvMesh/simplifiedFvMesh/simplifiedFvMesh.C index e14c4bdeb71ca2b47ef5ec8918b4016336ed0f38..db0ea037cc466ca0cc20eb4621d65a7c840dbd94 100644 --- a/src/finiteVolume/fvMesh/simplifiedFvMesh/simplifiedFvMesh/simplifiedFvMesh.C +++ b/src/finiteVolume/fvMesh/simplifiedFvMesh/simplifiedFvMesh/simplifiedFvMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,12 +92,12 @@ Foam::autoPtr<Foam::simplifiedFvMesh> Foam::simplifiedFvMesh::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown simplified fvMesh type " - << modelType << nl << nl - << "Valid simplified fvMeshes :" << endl - << timeConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "simplified fvMesh", + modelType, + *timeConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<simplifiedFvMesh>(cstrIter()(runTime)); diff --git a/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.C b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.C index eee7e1496aff222f5a36c1b58887387a3069bd99..ba7efc00e28e807dffaedf42f72e32ed5d38ed70 100644 --- a/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.C +++ b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2015 OpenFOAM Foundation @@ -58,20 +58,20 @@ Foam::autoPtr<Foam::patchDistMethod> Foam::patchDistMethod::New const labelHashSet& patchIDs ) { - const word methodType(dict.get<word>("method")); + const word modelType(dict.get<word>("method")); - Info<< "Selecting patchDistMethod " << methodType << endl; + Info<< "Selecting patchDistMethod " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown patchDistMethod type " - << methodType << endl << endl - << "Valid patchDistMethod types : " << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "patchDistMethod", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, mesh, patchIDs); @@ -87,20 +87,19 @@ Foam::autoPtr<Foam::patchDistMethod> Foam::patchDistMethod::New const word& defaultPatchDistMethod ) { - word methodType = defaultPatchDistMethod; - dict.readIfPresent("method", methodType); + const word modelType(dict.getOrDefault("method", defaultPatchDistMethod)); - Info<< "Selecting patchDistMethod " << methodType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodType); + Info<< "Selecting patchDistMethod " << modelType << endl; + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown patchDistMethodType type " - << methodType << endl << endl - << "Valid patchDistMethod types : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "patchDistMethod", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, mesh, patchIDs); diff --git a/src/finiteVolume/interpolation/interpolation/interpolation/interpolationNew.C b/src/finiteVolume/interpolation/interpolation/interpolation/interpolationNew.C index 160b2dd77ba38fd88a6f3a0c8e2dfef7e66db56d..326aea8a3ea09435091a815173c915e4aedbf5b8 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolation/interpolationNew.C +++ b/src/finiteVolume/interpolation/interpolation/interpolation/interpolationNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -41,12 +41,12 @@ Foam::autoPtr<Foam::interpolation<Type>> Foam::interpolation<Type>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown interpolation type " << interpolationType - << " for field " << psi.name() << nl << nl - << "Valid interpolation types : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "interpolation", + interpolationType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<interpolation<Type>>(cstrIter()(psi)); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C index 3201afa2304275b89c90449b8de8c65885c9167c..56307b6b75e98d76f334599a4f7cc629ad979f92 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -62,12 +62,13 @@ Foam::limitedSurfaceInterpolationScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown discretisation scheme " - << schemeName << nl << nl - << "Valid schemes are :" << endl - << MeshConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "discretisation", + schemeName, + *MeshConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, schemeData); @@ -106,12 +107,13 @@ Foam::limitedSurfaceInterpolationScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown discretisation scheme " - << schemeName << nl << nl - << "Valid schemes are :" << endl - << MeshFluxConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "discretisation", + schemeName, + *MeshFluxConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, faceFlux, schemeData); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C index fee07974d39957703ed5075ce1617ca0e3ba2fea..4c66a25d0eef22322292a36794f6ae36603a4dbd 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -71,11 +71,13 @@ Foam::multivariateSurfaceInterpolationScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown discretisation scheme " << schemeName << nl << nl - << "Valid schemes are :" << endl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "discretisation", + schemeName, + *IstreamConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, vtfs, faceFlux, schemeData); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C index 43dbd5262c7d3d4923811b2c04eda84de382b274..7e33efa12372fdd836f82c7377f4c86c1c998b13 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -44,9 +44,8 @@ Foam::surfaceInterpolationScheme<Type>::New if (schemeData.eof()) { FatalIOErrorInFunction(schemeData) - << "Discretisation scheme not specified" - << endl << endl - << "Valid schemes are :" << endl + << "Discretisation scheme not specified\n\n" + << "Valid schemes:\n" << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -62,12 +61,13 @@ Foam::surfaceInterpolationScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown discretisation scheme " - << schemeName << nl << nl - << "Valid schemes are :" << endl - << MeshConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "discretisation", + schemeName, + *MeshConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(mesh, schemeData); @@ -105,12 +105,13 @@ Foam::surfaceInterpolationScheme<Type>::New if (!cstrIter.found()) { - FatalIOErrorInFunction(schemeData) - << "Unknown discretisation scheme " - << schemeName << nl << nl - << "Valid schemes are :" << endl - << MeshFluxConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + schemeData, + "discretisation", + schemeName, + *MeshFluxConstructorTablePtr_ + ) << exit(FatalIOError); } return cstrIter()(mesh, faceFlux, schemeData); diff --git a/src/functionObjects/field/fieldValues/fieldValue/fieldValueNew.C b/src/functionObjects/field/fieldValues/fieldValue/fieldValueNew.C index 633ea96067a91d51860386fc2dfe6b7fbf041bf9..070277db7ec19565ca6be5219d36ba7254172365 100644 --- a/src/functionObjects/field/fieldValues/fieldValue/fieldValueNew.C +++ b/src/functionObjects/field/fieldValues/fieldValue/fieldValueNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2016 OpenFOAM Foundation @@ -42,19 +42,19 @@ Foam::functionObjects::fieldValue::New if (output) { - Info<< "Selecting " << typeName << " " << modelType << endl; + Info<< "Selecting " << typeName << ' ' << modelType << endl; } auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown " << typeName << " type " - << modelType << nl << nl - << "Valid " << typeName << " types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + typeName, + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<fieldValue>(cstrIter()(name, obr, dict)); diff --git a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModelNew.C b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModelNew.C index 9cf1923c7c6ea0809e1fa0e8d7c0db6182bdcfbd..d5646409cb0d18b530c9ef7cd21af3387a6a41d5 100644 --- a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModelNew.C +++ b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,12 +44,12 @@ Foam::autoPtr<Foam::heatTransferCoeffModel> Foam::heatTransferCoeffModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown heatTransferCoeffModel type " - << modelType << nl << nl - << "Valid heatTransferCoeffModels :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "heatTransferCoeffModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<heatTransferCoeffModel>(cstrIter()(dict, mesh, TName)); diff --git a/src/functionObjects/graphics/runTimePostProcessing/pathline.C b/src/functionObjects/graphics/runTimePostProcessing/pathline.C index 1642b4496b4e74bb38319825ccc0925e32345baa..87c0896082344d9ba701c2d57dd65541375758a3 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/pathline.C +++ b/src/functionObjects/graphics/runTimePostProcessing/pathline.C @@ -180,12 +180,12 @@ Foam::functionObjects::runTimePostPro::pathline::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown pathline type " - << pathlineType << nl << nl - << "Valid pathline types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "pathline", + pathlineType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<pathline>(cstrIter()(parent, dict, colours)); diff --git a/src/functionObjects/graphics/runTimePostProcessing/pointData.C b/src/functionObjects/graphics/runTimePostProcessing/pointData.C index 6f013923ab818033e300b9a76d54da00be7b647c..ceb0e049bc9120d63834dd244e0ece1975a77203 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/pointData.C +++ b/src/functionObjects/graphics/runTimePostProcessing/pointData.C @@ -143,12 +143,12 @@ Foam::functionObjects::runTimePostPro::pointData::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown pointData type " - << pointDataType << nl << nl - << "Valid pointData types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "pointData", + pointDataType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<pointData>(cstrIter()(parent, dict, colours)); diff --git a/src/functionObjects/graphics/runTimePostProcessing/surface.C b/src/functionObjects/graphics/runTimePostProcessing/surface.C index 98c799f8f03003d5df0816e7a9f55c08ae1a4c97..ada35f59c452e43606028d72bb390433f212bd53 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/surface.C +++ b/src/functionObjects/graphics/runTimePostProcessing/surface.C @@ -256,12 +256,12 @@ Foam::functionObjects::runTimePostPro::surface::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown surface type " - << surfaceType << nl << nl - << "Valid surface types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "surface", + surfaceType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<surface>(cstrIter()(parent, dict, colours)); diff --git a/src/functionObjects/utilities/runTimeControl/runTimeCondition/runTimeCondition/runTimeConditionNew.C b/src/functionObjects/utilities/runTimeControl/runTimeCondition/runTimeCondition/runTimeConditionNew.C index 097298ea1567f1f0dcd27a6774fa10758a6a08b0..cfe70a17d983c6988abf4fbd429a76e95c2b8133 100644 --- a/src/functionObjects/utilities/runTimeControl/runTimeCondition/runTimeCondition/runTimeConditionNew.C +++ b/src/functionObjects/utilities/runTimeControl/runTimeCondition/runTimeCondition/runTimeConditionNew.C @@ -2,10 +2,8 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd. \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,20 +36,20 @@ Foam::functionObjects::runTimeControls::runTimeCondition::New stateFunctionObject& state ) { - const word conditionType(dict.get<word>("type")); + const word modelType(dict.get<word>("type")); - Info<< "Selecting runTimeCondition " << conditionType << endl; + Info<< "Selecting runTimeCondition " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(conditionType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown runTimeCondition type " - << conditionType << nl << nl - << "Valid runTimeCondition types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "runTimeCondition", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return diff --git a/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C index 012797eac2124fa934b61cd15c96cbec52b35c33..ba335410d6c3986b56ad66c3a92092fe8c2c80f8 100644 --- a/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -52,20 +52,20 @@ Foam::autoPtr<Foam::motionDiffusivity> Foam::motionDiffusivity::New Istream& mdData ) { - const word motionType(mdData); + const word modelType(mdData); - Info<< "Selecting motion diffusion: " << motionType << endl; + Info<< "Selecting motion diffusion: " << modelType << endl; - auto cstrIter = IstreamConstructorTablePtr_->cfind(motionType); + auto cstrIter = IstreamConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown diffusion type " - << motionType << nl << nl - << "Valid diffusion types :" << nl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "diffusion", + modelType, + *IstreamConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<motionDiffusivity>(cstrIter()(mesh, mdData)); diff --git a/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C b/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C index 4e39e956c3a3db148acdbf27fdbecaeb7c0297ef..8215444d663cf5acdb1680b3b126021a715ecaeb 100644 --- a/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C +++ b/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2015 OpenFOAM Foundation @@ -71,20 +71,20 @@ Foam::motionInterpolation::New(const fvMesh& mesh) Foam::autoPtr<Foam::motionInterpolation> Foam::motionInterpolation::New(const fvMesh& mesh, Istream& entry) { - const word type(entry); + const word modelType(entry); - Info<< "Selecting motion interpolation: " << type << endl; + Info<< "Selecting motion interpolation: " << modelType << endl; - auto cstrIter = IstreamConstructorTablePtr_->cfind(type); + auto cstrIter = IstreamConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown interpolation type " - << type << nl << nl - << "Valid interpolation types :" << endl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "interpolation", + modelType, + *IstreamConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<motionInterpolation>(cstrIter()(mesh, entry)); diff --git a/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C b/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C index a49a88d1c934bf65a9575ad618e184c32ff945e7..a584b022a8e10259a20fd94d3148d527ff506b00 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -78,12 +78,12 @@ Foam::autoPtr<Foam::profileModel> Foam::profileModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown profile model type " - << modelType << nl << nl - << "Valid model types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "profileModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<profileModel>(cstrIter()(dict, modelName)); diff --git a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModelNew.C b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModelNew.C index ae168d37521e8a023006a786ea5a6b192b9ca725..21190cb302dfe6fb3a25e3dca97c6e7ddc4aa00d 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModelNew.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2015 OpenFOAM Foundation @@ -43,12 +43,12 @@ Foam::autoPtr<Foam::trimModel> Foam::trimModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown " << typeName << " type " - << modelType << nl << nl - << "Valid " << typeName << " types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + typeName, + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<trimModel>(cstrIter()(rotor, dict)); diff --git a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C index b77c0664b0cbb1e31b514d4575b55e90548f9269..d95ed5703607e4415b6c3003a71388f2253eb262 100644 --- a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C +++ b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::BinaryCollisionModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown BinaryCollisionModel type " - << modelType << nl << nl - << "Valid BinaryCollisionModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "BinaryCollisionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<BinaryCollisionModel<CloudType>> diff --git a/src/lagrangian/DSMC/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C b/src/lagrangian/DSMC/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C index da5dfa29b28da637239f13358d89d97cc2eb1909..f03c8ac71231651b4a1c0109b58ccec754e0f04b 100644 --- a/src/lagrangian/DSMC/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C +++ b/src/lagrangian/DSMC/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::InflowBoundaryModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown InflowBoundaryModel type " - << modelType << nl << nl - << "Valid InflowBoundaryModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "InflowBoundaryModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<InflowBoundaryModel<CloudType>>(cstrIter()(dict, owner)); diff --git a/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C b/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C index 9cb954a012a5db2d4ecefcb1677786d89670a9af..93ee6bee418a1e3171e32043914cba94607aef96 100644 --- a/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C +++ b/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::WallInteractionModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown WallInteractionModel type " - << modelType << nl << nl - << "Valid WallInteractionModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "WallInteractionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<WallInteractionModel<CloudType>>(cstrIter()(dict, owner)); diff --git a/src/lagrangian/distributionModels/distributionModel/distributionModelNew.C b/src/lagrangian/distributionModels/distributionModel/distributionModelNew.C index a42b9e181f2fb478d95ed5a6d51984747c483538..980907e959e451bc6f3a9ca73ada0bb0f99c1067 100644 --- a/src/lagrangian/distributionModels/distributionModel/distributionModelNew.C +++ b/src/lagrangian/distributionModels/distributionModel/distributionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -43,12 +43,12 @@ Foam::autoPtr<Foam::distributionModel> Foam::distributionModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown distribution model type " - << modelType << nl << nl - << "Valid distribution model types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "distribution model", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } const dictionary distributionDict = diff --git a/src/lagrangian/intermediate/integrationScheme/integrationScheme/integrationSchemeNew.C b/src/lagrangian/intermediate/integrationScheme/integrationScheme/integrationSchemeNew.C index 429d7c6ea3b10382e5007221df74c8c10b1363c8..d65703dbbb7320e28bca85e122b0fb2f59b19521 100644 --- a/src/lagrangian/intermediate/integrationScheme/integrationScheme/integrationSchemeNew.C +++ b/src/lagrangian/intermediate/integrationScheme/integrationScheme/integrationSchemeNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -36,21 +36,21 @@ Foam::autoPtr<Foam::integrationScheme> Foam::integrationScheme::New const dictionary& dict ) { - const word schemeName(dict.get<word>(phiName)); + const word modelType(dict.get<word>(phiName)); Info<< "Selecting " << phiName << " integration scheme " - << schemeName << endl; + << modelType << endl; - auto cstrIter = wordConstructorTablePtr_->cfind(schemeName); + auto cstrIter = wordConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown integration scheme type " - << schemeName << nl << nl - << "Valid integration scheme types are:" << nl - << wordConstructorTablePtr_->sortedToc() << nl - << exit(FatalIOError); + FatalErrorInLookup + ( + "integration scheme", + modelType, + *wordConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<integrationScheme>(cstrIter()()); diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObjectNew.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObjectNew.C index 4415b534019862f0af096a255d75a9d04d2895a8..9bb9e26b27d95d2658fff19c88be06778a8192be 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObjectNew.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObjectNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -46,12 +46,12 @@ Foam::CloudFunctionObject<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown cloud function type " - << objectType << nl << nl - << "Valid cloud function types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "cloudFunctionObject", + objectType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<CloudFunctionObject<CloudType>> diff --git a/src/lagrangian/intermediate/submodels/HeterogeneousReactingModel/HeterogeneousReactingModel/HeterogeneousReactingModelNew.C b/src/lagrangian/intermediate/submodels/HeterogeneousReactingModel/HeterogeneousReactingModel/HeterogeneousReactingModelNew.C index 9f326da2079bfc0a47ab3b23a20b3c4d00c0f083..76d0bc5a9b6adc6c184bd3330b127d8329301425 100644 --- a/src/lagrangian/intermediate/submodels/HeterogeneousReactingModel/HeterogeneousReactingModel/HeterogeneousReactingModelNew.C +++ b/src/lagrangian/intermediate/submodels/HeterogeneousReactingModel/HeterogeneousReactingModel/HeterogeneousReactingModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,12 +43,12 @@ Foam::HeterogeneousReactingModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown heterogeneousReactingModel type " - << modelType << nl << nl - << "Valid types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "heterogeneousReactingModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<HeterogeneousReactingModel<CloudType>> diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C index 62c5c22baa9742b41c4edec4581d5d0a85fd138c..d7c765cec5bdd42e65775127eb46ee7348c447fd 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::CollisionModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown collisionModel type " - << modelType << nl << nl - << "Valid collisionModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "collisionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<CollisionModel<CloudType>>(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModelNew.C index cc1a1b0220dc0f2fbd2a9fb0219fdce0cf632a39..538a20b3b2fedd9915aea4cb0e3827544ff40191 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::PairModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown pairModel type " - << modelType << nl << nl - << "Valid pairModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "pairModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<PairModel<CloudType>>(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModelNew.C index 90a2cfe211b1bd31aa82842bb96523a71ef44c87..1730d26b7e656f13b3ea86ebde0acf1b13a847f0 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::WallModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown wallModel type " - << modelType << nl << nl - << "Valid wallModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "wallModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<WallModel<CloudType>>(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModelNew.C index ccbb628ec3de3d5e4911a7d3a68c38569563da8e..c0a982071182d7631bca3b07c79cbaae7789dd24 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::DispersionModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown dispersionModel type " - << modelType << nl << nl - << "Valid dispersionModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "dispersionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<DispersionModel<CloudType>>(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C index edcc6f4a5d60d72c26db7bcad537aaa1d8a6715b..5c0b6832940a3967f7bf38aea060f277afc7101a 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::InjectionModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown injectionModel type " - << modelType << nl << nl - << "Valid injectionModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "injectionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<InjectionModel<CloudType>>(cstrIter()(dict, owner)); @@ -73,12 +73,12 @@ Foam::InjectionModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown injection model type " - << modelType << nl << nl - << "Valid injection model types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "injectionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceNew.C b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceNew.C index 41d0bbd02aa66c434255ad20781177d353410bf4..195c03014f8ef293756cae124d6ac0dafb2613a6 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::ParticleForce<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown particle force type " - << forceType << nl << nl - << "Valid particle force types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "particle force", + forceType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<ParticleForce<CloudType>> diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C index 495ed153bbcb74ba9c105ab09b096174af93af0e..9fd6e672db545206c6a0e56bcfedb45ff5af0999 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::PatchInteractionModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown patch interaction model type " - << modelType << nl << nl - << "Valid patch interaction model types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "patchInteractionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<PatchInteractionModel<CloudType>>(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/StochasticCollision/StochasticCollisionModel/StochasticCollisionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/StochasticCollision/StochasticCollisionModel/StochasticCollisionModelNew.C index 61423e97b0944f31c689e9f71522e4e7caa30a59..ac4c09afa0be9161dd60ee0015a2ade611bcdade 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/StochasticCollision/StochasticCollisionModel/StochasticCollisionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/StochasticCollision/StochasticCollisionModel/StochasticCollisionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -46,12 +46,12 @@ Foam::StochasticCollisionModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown stochasticCollisionModel type " - << modelType << nl << nl - << "Valid stochasticCollisionModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "stochasticCollisionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<StochasticCollisionModel<CloudType>> diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C index 5aee383f6b9f7c4b32be3227ad7043c3030a6cd4..2b3bf07ba6ac1a3194cc1ec404c6dc7cfe994077 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::SurfaceFilmModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown surfaceFilmModel type " - << modelType << nl << nl - << "Valid surfaceFilmModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "surfaceFilmModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<SurfaceFilmModel<CloudType>>(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C index 4829c3362d6efd58cadaab8383398a5d66bc0c16..2cb8284c4c9d160f1b3e10b6e9f28ecb655d9764 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2017 OpenFOAM Foundation @@ -86,21 +86,20 @@ Foam::AveragingMethod<Type>::New const fvMesh& mesh ) { - const word averageType(dict.get<word>(typeName)); + const word modelType(dict.get<word>(typeName)); - //Info<< "Selecting averaging method " - // << averageType << endl; + //Info<< "Selecting averaging method " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(averageType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown averaging method " - << averageType << nl << nl - << "Valid averaging methods :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "averaging limiter", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<AveragingMethod<Type>>(cstrIter()(io, dict, mesh)); diff --git a/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.C b/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.C index 0d8583da946b17290b586d1d225bed58e23d9e30..de1f2c2152a3f8dadaad502bda77f5ba2b285062 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2015 OpenFOAM Foundation @@ -66,12 +66,12 @@ Foam::CorrectionLimitingMethod::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown correction limiter type " - << modelType << nl << nl - << "Valid correction limiter types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "correction limiter", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<CorrectionLimitingMethod>(cstrIter()(dict)); diff --git a/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C b/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C index 8c57278f376ffbb66bdf7893e2a4aefd1b9caa47..c4152c1b3466341cca6df51e0cd74f80749055c7 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2016 OpenFOAM Foundation @@ -90,12 +90,12 @@ Foam::DampingModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown damping model type " - << modelType << nl << nl - << "Valid damping model types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "damping model", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<DampingModel<CloudType>>(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C b/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C index 402e4ddf1a74e249e0501f5a6e1baa4509998e38..4269a44b580f3871f10809ea695b93176070eac3 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2016 OpenFOAM Foundation @@ -93,12 +93,12 @@ Foam::IsotropyModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown isotropy model type " - << modelType << nl << nl - << "Valid isotropy model types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "isotropy model", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<IsotropyModel<CloudType>>(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C index 842593251fdaf95f1467682466e1fa9df3d734e6..1cef066e9653769913eeb66d6cd554ed9e4a1f04 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2016 OpenFOAM Foundation @@ -92,12 +92,12 @@ Foam::PackingModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown packing model type " - << modelType << nl << nl - << "Valid packing model types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "packing model", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<PackingModel<CloudType>>(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.C b/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.C index 991bccf080a90debac15e837a2670d6090066ce1..0dcf71a887c4ff64d8bd4c301dfc5dc0ebb130f5 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2016 OpenFOAM Foundation @@ -71,12 +71,12 @@ Foam::autoPtr<Foam::ParticleStressModel> Foam::ParticleStressModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown particle stress model type " - << modelType << nl << nl - << "Valid particle stress model types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "particle stress model", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<ParticleStressModel>(cstrIter()(dict)); diff --git a/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.C b/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.C index d7412a193b80cdf4eb0eca594e02ae1d2e6af417..c9c7c321a5147b56f94fbcdaee2ec81c03035f76 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2015 OpenFOAM Foundation @@ -75,12 +75,12 @@ Foam::autoPtr<Foam::TimeScaleModel> Foam::TimeScaleModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown time scale model type " - << modelType << nl << nl - << "Valid time scale model types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "time scale model", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<TimeScaleModel>(cstrIter()(dict)); diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C index a91dec9cda3a3e0c09d9e1de2d34dfd74e0a921a..d06e814f536b64b75337fe413674a98055744553 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::CompositionModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown compositionModel type " - << modelType << nl << nl - << "Valid compositionModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() << nl - << exit(FatalError); + FatalErrorInLookup + ( + "compositionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<CompositionModel<CloudType>>(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C index 377fb6a0bc7d827205e3737a2f15dda284a8b371..a212ff5c29bc8af6dc24cb8362b90ef5b032569b 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::PhaseChangeModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown phaseChangeModel type " - << modelType << nl << nl - << "Valid phaseChangeModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "phaseChangeModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<PhaseChangeModel<CloudType>>(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 9d4aadeaf23d1c8b2ade5000e0bb8d26476151d2..d6964bd21eebe614f72c0ef765322ba6b7b2dda4 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModelNew.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::DevolatilisationModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown devolatilisationModel type " - << modelType << nl << nl - << "Valid devolatilisationModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "devolatilisationModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<DevolatilisationModel<CloudType>>(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 234bb0351995fffcebf3da066c77732aaa84eea5..73579205afd4b93d906c60717adc5207fa083ce9 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModelNew.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::SurfaceReactionModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown surfaceReactionModel type " - << modelType << nl << nl - << "Valid surfaceReactionModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "surfaceReactionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<SurfaceReactionModel<CloudType>>(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 603f02b789dfea9d22a79b23921fa291ee38f096..691795fcc005b628cc307c34f8269d449de3acf7 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModelNew.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::HeatTransferModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown heatTransferModel type " - << modelType << nl << nl - << "Valid heatTransferModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "heatTransferModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<HeatTransferModel<CloudType>>(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C index e449e0ad8988159d0aea0e3265d519489788c6bf..56601c8c35d55eadcb664db259a0e59ec33bc5cf 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C @@ -1,4 +1,4 @@ -/*---------------------------------------------------------------------------* \ +/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | diff --git a/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C b/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C index 6b5eeda70729843347e021f3b9556241ec98c39e..bcb6abf3dcb7e13d4ed09931dae4a4dd157a2859 100644 --- a/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C +++ b/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -37,22 +37,22 @@ Foam::autoPtr<Foam::energyScalingFunction> Foam::energyScalingFunction::New const pairPotential& pairPot ) { - const word scalingType(propDict.get<word>("energyScalingFunction")); + const word modelType(propDict.get<word>("energyScalingFunction")); Info<< "Selecting energy scaling function " - << scalingType << " for " + << modelType << " for " << name << " potential energy." << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(scalingType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown energyScalingFunction type " - << scalingType << nl << nl - << "Valid energyScalingFunction types:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "energyScalingFunction", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<energyScalingFunction>(cstrIter()(name, propDict, pairPot)); diff --git a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C index e93ea54a58c4969619b2bb4c71a1ca8bf1118967..22c7b9f04976ddbd3e000d1c7255e5e3aaf3e7cf 100644 --- a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C +++ b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -36,22 +36,22 @@ Foam::autoPtr<Foam::pairPotential> Foam::pairPotential::New const dictionary& propDict ) { - const word potentialType(propDict.get<word>("pairPotential")); + const word modelType(propDict.get<word>("pairPotential")); Info<< nl << "Selecting intermolecular pair potential " - << potentialType << " for " + << modelType << " for " << name << " interaction." << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(potentialType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown pairPotential type " - << potentialType << nl << nl - << "Valid pairPotential types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "pairPotential", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<pairPotential>(cstrIter()(name, propDict)); diff --git a/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C b/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C index 3386746728b2188c9d957c58c416293a757c144d..f3e856822786ff3fdc70c0fc39326ed769dea6f4 100644 --- a/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C +++ b/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -35,21 +35,21 @@ Foam::autoPtr<Foam::tetherPotential> Foam::tetherPotential::New const dictionary& propDict ) { - const word potentialType(propDict.get<word>("tetherPotential")); + const word modelType(propDict.get<word>("tetherPotential")); - Info<< nl << "Selecting tether potential " << potentialType + Info<< nl << "Selecting tether potential " << modelType << " for " << name << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(potentialType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown tetherPotential type " - << potentialType << nl << nl - << "Valid tetherPotential types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "tetherPotential", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<tetherPotential>(cstrIter()(name, propDict)); diff --git a/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModelNew.C b/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModelNew.C index 19a8eab8f2295bfbd891ae8856751665fff3a5d4..a7906305e9071aa053819a2f89275942271c9da6 100644 --- a/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModelNew.C +++ b/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::AtomizationModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown atomizationModel type " - << modelType - << "Valid atomizationModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "atomizationModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<AtomizationModel<CloudType>>(cstrIter()(dict, owner)); diff --git a/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModelNew.C b/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModelNew.C index 5a0c625b28efac76fbd08085bf664bf6dfe23d11..1cfb6e210c3104d19ab725945a79b274269e5987 100644 --- a/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModelNew.C +++ b/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::BreakupModel<CloudType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown breakupModel type " - << modelType << nl << nl - << "Valid breakupModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "breakupModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<BreakupModel<CloudType>>(cstrIter()(dict, owner)); diff --git a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C index d3276518338e84da0442f8f83d401d7742d1ae0c..20c6db9f611d6c68075ac227a54bacae3173d861 100644 --- a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C +++ b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -82,10 +82,7 @@ Foam::autoPtr<Foam::blockEdge> Foam::blockEdge::New Istream& is ) { - if (debug) - { - InfoInFunction << "Constructing blockEdge" << endl; - } + DebugInFunction << "Constructing blockEdge" << endl; const word edgeType(is); @@ -93,12 +90,12 @@ Foam::autoPtr<Foam::blockEdge> Foam::blockEdge::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown blockEdge type " - << edgeType << nl << nl - << "Valid blockEdge types :" << endl - << IstreamConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "blockEdge", + edgeType, + *IstreamConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<blockEdge>(cstrIter()(dict, index, geometry, points, is)); diff --git a/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C b/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C index da0327a587b9ea6ff78e517922439cdd7575ec19..c8ab005166bd847505e0b56a3ce2b849a6cb47c2 100644 --- a/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C +++ b/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C @@ -87,12 +87,12 @@ Foam::autoPtr<Foam::blockFace> Foam::blockFace::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown blockFace type " - << faceType << nl << nl - << "Valid blockFace types :" << endl - << IstreamConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "blockFace", + faceType, + *IstreamConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<blockFace>(cstrIter()(dict, index, geometry, is)); diff --git a/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C b/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C index b4f08bcf16896288dbf8fe6d2c4a1df3b77ccd46..3bcf7d058750ce605e9ab78be42e9cc5b1d46bef 100644 --- a/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C +++ b/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016 OpenFOAM Foundation @@ -59,10 +59,7 @@ Foam::autoPtr<Foam::blockVertex> Foam::blockVertex::New Istream& is ) { - if (debug) - { - InfoInFunction << "Constructing blockVertex" << endl; - } + DebugInFunction << "Constructing blockVertex" << endl; token firstToken(is); @@ -84,12 +81,12 @@ Foam::autoPtr<Foam::blockVertex> Foam::blockVertex::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown blockVertex type " - << faceType << nl << nl - << "Valid blockVertex types :" << endl - << IstreamConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "blockVertex", + faceType, + *IstreamConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<blockVertex>(cstrIter()(dict, index, geometry, is)); diff --git a/src/mesh/blockMesh/blocks/block/block.C b/src/mesh/blockMesh/blocks/block/block.C index 0e88b8458d4b03521170c85de7a984fff5644d2e..e0e8ccbc7149e6a2d6a9992bd54128afdd94e8fc 100644 --- a/src/mesh/blockMesh/blocks/block/block.C +++ b/src/mesh/blockMesh/blocks/block/block.C @@ -109,15 +109,15 @@ Foam::autoPtr<Foam::block> Foam::block::New const word blockOrCellShapeType(is); - auto cstr = IstreamConstructorTablePtr_->cfind(blockOrCellShapeType); + auto cstrIter = IstreamConstructorTablePtr_->cfind(blockOrCellShapeType); - if (!cstr.found()) + if (!cstrIter.found()) { is.putBack(token(blockOrCellShapeType)); return autoPtr<block>::New(dict, index, points, edges, faces, is); } - return autoPtr<block>(cstr()(dict, index, points, edges, faces, is)); + return autoPtr<block>(cstrIter()(dict, index, points, edges, faces, is)); } diff --git a/src/mesh/extrudeModel/extrudeModel/extrudeModelNew.C b/src/mesh/extrudeModel/extrudeModel/extrudeModelNew.C index b6afc75559c1efc555bca14724601c95595a69a6..614256d642462826db2df511bc5e4fc9b1e024b7 100644 --- a/src/mesh/extrudeModel/extrudeModel/extrudeModelNew.C +++ b/src/mesh/extrudeModel/extrudeModel/extrudeModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -42,12 +42,12 @@ Foam::autoPtr<Foam::extrudeModel> Foam::extrudeModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown extrudeModel type " - << modelType << nl << nl - << "Valid extrudeModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() << nl - << exit(FatalError); + FatalErrorInLookup + ( + "extrudeModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<extrudeModel>(cstrIter()(dict)); diff --git a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C index 0f4013b81973ca4db403b34ea5c61da9f08767a4..374340564a4c28d340ce983f0a69052d1d18cee0 100644 --- a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C +++ b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2015 OpenFOAM Foundation @@ -147,12 +147,12 @@ Foam::externalDisplacementMeshMover::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown externalDisplacementMeshMover type " - << type << nl << nl - << "Valid externalDisplacementMeshMover types:" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "externalDisplacementMeshMover", + type, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<externalDisplacementMeshMover> diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethodNew.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethodNew.C index cb60c85ecac1f9a899f539d467b4ece6cd241d13..7d933383384149e0d3189d2b7d1379fd671325d0 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethodNew.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethodNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2016 OpenFOAM Foundation @@ -39,21 +39,18 @@ Foam::AMIMethod<SourcePatch, TargetPatch>::New const bool requireMatch ) { - if (debug) - { - Info<< "Selecting AMIMethod " << methodName << endl; - } + DebugInfo << "Selecting AMIMethod " << methodName << endl; auto cstrIter = componentsConstructorTablePtr_->cfind(methodName); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown AMIMethod type " - << methodName << nl << nl - << "Valid AMIMethod types:" << nl - << componentsConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "AMIMethod", + methodName, + *componentsConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<AMIMethod<SourcePatch, TargetPatch>> diff --git a/src/meshTools/PatchFunction1/PatchFunction1New.C b/src/meshTools/PatchFunction1/PatchFunction1New.C index 5ff933a7200a2fa19e1fd4d79ede5f9c6b9a0517..2d857869bac8bea29e8612209f4a90c6c50195a1 100644 --- a/src/meshTools/PatchFunction1/PatchFunction1New.C +++ b/src/meshTools/PatchFunction1/PatchFunction1New.C @@ -40,7 +40,7 @@ Foam::autoPtr<Foam::PatchFunction1<Type>> Foam::PatchFunction1<Type>::New { const dictionary& coeffsDict(dict.subDict(entryName)); - const word modelType(coeffsDict.lookup("type")); + const word modelType(coeffsDict.getWord("type")); auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); diff --git a/src/meshTools/coordinate/rotation/coordinateRotation.C b/src/meshTools/coordinate/rotation/coordinateRotation.C index b8499b018e0d714c4ddbaca9c5eaaf8e0855ad5c..b9331133719764355f79f52b721b46d89c395be7 100644 --- a/src/meshTools/coordinate/rotation/coordinateRotation.C +++ b/src/meshTools/coordinate/rotation/coordinateRotation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2013 OpenFOAM Foundation @@ -78,12 +78,13 @@ Foam::autoPtr<Foam::coordinateRotation> Foam::coordinateRotation::New if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown coordinateRotation type " - << modelType << nl << nl - << "Valid types: " - << flatOutput(dictionaryConstructorTablePtr_->sortedToc()) - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "coordinateRotation", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<coordinateRotation>(cstrIter()(dict)); diff --git a/src/meshTools/coordinate/systems/coordinateSystemNew.C b/src/meshTools/coordinate/systems/coordinateSystemNew.C index 8597d1ee8be920c43be4f0ca5ddb3ffbe32c777f..19b222de3e3fa51b5176cdd81e33bb4718826367 100644 --- a/src/meshTools/coordinate/systems/coordinateSystemNew.C +++ b/src/meshTools/coordinate/systems/coordinateSystemNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -102,12 +102,13 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New // constructor, so just need to print those. if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown coordinate system type " - << modelType << nl << nl - << "Valid types: " - << flatOutput(dictionaryConstructorTablePtr_->sortedToc()) - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "coordinate system", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<coordinateSystem>(cstrIter()(dict)); @@ -129,12 +130,13 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown coordinate system type " - << modelType << nl << nl - << "Valid types: " - << flatOutput(dictionaryConstructorTablePtr_->sortedToc()) - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "coordinate system", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<coordinateSystem>(cstrIter()(dict)); @@ -188,7 +190,7 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New dictPtr = coordinateSystem::subDictCompat(dictPtr); } - word modelType = dictPtr->lookupOrDefault<word> + const word modelType = dictPtr->lookupOrDefault<word> ( "type", coordSystem::cartesian::typeName_() diff --git a/src/meshTools/edgeMesh/edgeMeshIO.C b/src/meshTools/edgeMesh/edgeMeshIO.C index 08e27243a39b77359f806129b47ccb5038221f3a..e41274babb99db05f86eec41fd50581fea25e4f0 100644 --- a/src/meshTools/edgeMesh/edgeMeshIO.C +++ b/src/meshTools/edgeMesh/edgeMeshIO.C @@ -89,10 +89,7 @@ void Foam::edgeMesh::write const edgeMesh& mesh ) { - if (debug) - { - InfoInFunction << "Writing to " << name << endl; - } + DebugInFunction << "Writing to " << name << endl; const word ext = name.ext(); @@ -100,11 +97,12 @@ void Foam::edgeMesh::write if (!mfIter.found()) { - FatalErrorInFunction - << "Unknown file extension " << ext << nl << nl - << "Valid types :" << endl - << writefileExtensionMemberFunctionTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "extension", + ext, + *writefileExtensionMemberFunctionTablePtr_ + ) << exit(FatalError); } else { diff --git a/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C b/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C index c0835be69b03fcfe8f7f46a4ba5d73ce9535ed45..b5bdbb282a7d0eaaf561bd37098717504729e1c5 100644 --- a/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C +++ b/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -49,12 +49,12 @@ Foam::autoPtr<Foam::searchableSurface> Foam::searchableSurface::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown searchableSurface type " - << searchableSurfaceType << nl << nl - << "Valid searchableSurface types :" << endl - << dictConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "searchableSurface", + searchableSurfaceType, + *dictConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<searchableSurface>(cstrIter()(io, dict)); diff --git a/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.C b/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.C index ae579e4e4a5f505e217e7004c7296872a4b18cc9..d3479a7cc3fc6990c9e0457058febb9f6d80efb0 100644 --- a/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.C +++ b/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,12 +57,12 @@ Foam::autoPtr<Foam::topoSetCellSource> Foam::topoSetCellSource::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown topoSetCellSource type " - << sourceType << nl << nl - << "Valid types :" << endl - << wordConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "topoSetCellSource", + sourceType, + *wordConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<topoSetCellSource>(cstrIter()(mesh, dict)); @@ -80,12 +80,12 @@ Foam::autoPtr<Foam::topoSetCellSource> Foam::topoSetCellSource::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown topoSetCellSource type " - << sourceType << nl << nl - << "Valid types :" << endl - << istreamConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "topoSetCellSource", + sourceType, + *istreamConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<topoSetCellSource>(cstrIter()(mesh, is)); diff --git a/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.C b/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.C index bc3cc62c2516df84d574bb047fb18546e9e1f78f..746fa60039feb4104f0939b4af497ccaf00928f4 100644 --- a/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.C +++ b/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,12 +57,12 @@ Foam::autoPtr<Foam::topoSetFaceSource> Foam::topoSetFaceSource::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown topoSetFaceSource type " - << sourceType << nl << nl - << "Valid types :" << endl - << wordConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "topoSetFaceSource", + sourceType, + *wordConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<topoSetFaceSource>(cstrIter()(mesh, dict)); @@ -80,12 +80,12 @@ Foam::autoPtr<Foam::topoSetFaceSource> Foam::topoSetFaceSource::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown topoSetFaceSource type " - << sourceType << nl << nl - << "Valid types :" << endl - << istreamConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "topoSetFaceSource", + sourceType, + *istreamConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<topoSetFaceSource>(cstrIter()(mesh, is)); diff --git a/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.C b/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.C index dd91b9c7a1589e51d60f9291e8fcf7c5c09f9238..5836d79263e585560db2d0d538f8333553b24614 100644 --- a/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.C +++ b/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,12 +57,12 @@ Foam::autoPtr<Foam::topoSetPointSource> Foam::topoSetPointSource::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown topoSetPointSource type " - << sourceType << nl << nl - << "Valid types :" << endl - << wordConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "topoSetPointSource", + sourceType, + *wordConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<topoSetPointSource>(cstrIter()(mesh, dict)); @@ -80,12 +80,12 @@ Foam::autoPtr<Foam::topoSetPointSource> Foam::topoSetPointSource::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown topoSetPointSource type " - << sourceType << nl << nl - << "Valid types :" << endl - << istreamConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "topoSetPointSource", + sourceType, + *istreamConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<topoSetPointSource>(cstrIter()(mesh, is)); diff --git a/src/meshTools/sets/topoSetSource/topoSetSource.C b/src/meshTools/sets/topoSetSource/topoSetSource.C index a5af75441b9ea10fd5e04261dbd01aa457e72c7a..88477de278144f5a6a5686393a4ff94ae3b31951 100644 --- a/src/meshTools/sets/topoSetSource/topoSetSource.C +++ b/src/meshTools/sets/topoSetSource/topoSetSource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -114,12 +114,12 @@ Foam::autoPtr<Foam::topoSetSource> Foam::topoSetSource::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown topoSetSource type " - << topoSetSourceType << nl << nl - << "Valid topoSetSource types :" << endl - << wordConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "topoSetSource", + topoSetSourceType, + *wordConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<topoSetSource>(cstrIter()(mesh, dict)); @@ -137,12 +137,12 @@ Foam::autoPtr<Foam::topoSetSource> Foam::topoSetSource::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown topoSetSource type " - << topoSetSourceType << nl << nl - << "Valid topoSetSource types :" << endl - << istreamConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "topoSetSource", + topoSetSourceType, + *istreamConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<topoSetSource>(cstrIter()(mesh, is)); diff --git a/src/meshTools/sets/topoSets/topoSet.C b/src/meshTools/sets/topoSets/topoSet.C index 1c95528a21052290b89daaf8cbedccb3e9f61542..46fcd368f7a53142cbc0adbcc1cb367c5b166815 100644 --- a/src/meshTools/sets/topoSets/topoSet.C +++ b/src/meshTools/sets/topoSets/topoSet.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -62,12 +62,12 @@ Foam::autoPtr<Foam::topoSet> Foam::topoSet::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown set type " - << setType << nl << nl - << "Valid set types :" << endl - << wordConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "set", + setType, + *wordConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<topoSet>(cstrIter()(mesh, name, r, w)); @@ -87,12 +87,12 @@ Foam::autoPtr<Foam::topoSet> Foam::topoSet::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown set type " - << setType << nl << nl - << "Valid set types :" << endl - << sizeConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "set", + setType, + *sizeConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<topoSet>(cstrIter()(mesh, name, size, w)); @@ -112,12 +112,12 @@ Foam::autoPtr<Foam::topoSet> Foam::topoSet::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown set type " - << setType << nl << nl - << "Valid set types :" << endl - << setConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "set", + setType, + *setConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<topoSet>(cstrIter()(mesh, name, set, w)); diff --git a/src/optimisation/adjointOptimisation/adjoint/ATCModel/ATCModel/ATCModel.C b/src/optimisation/adjointOptimisation/adjoint/ATCModel/ATCModel/ATCModel.C index 775f83ed7dbd315c6cec2747e68b13aae56a40ff..61ebdd376178eaa99424491f5fbc236581abdda0 100644 --- a/src/optimisation/adjointOptimisation/adjoint/ATCModel/ATCModel/ATCModel.C +++ b/src/optimisation/adjointOptimisation/adjoint/ATCModel/ATCModel/ATCModel.C @@ -140,11 +140,13 @@ autoPtr<ATCModel> ATCModel::New if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown ATCModel type " << modelType << nl << nl - << "Valid ATCModel types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "ATCModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<ATCModel> diff --git a/src/optimisation/adjointOptimisation/adjoint/ATCModel/zeroATCcells/zeroATCcells/zeroATCcells.C b/src/optimisation/adjointOptimisation/adjoint/ATCModel/zeroATCcells/zeroATCcells/zeroATCcells.C index 4afa06e624107de8d4138ebb6f9ae2809c4f626c..7d462dbe6b89d9a7b3fdcfdc317a5ebb769df2df 100644 --- a/src/optimisation/adjointOptimisation/adjoint/ATCModel/zeroATCcells/zeroATCcells/zeroATCcells.C +++ b/src/optimisation/adjointOptimisation/adjoint/ATCModel/zeroATCcells/zeroATCcells/zeroATCcells.C @@ -86,18 +86,20 @@ autoPtr<zeroATCcells> zeroATCcells::New { const word modelType ( - dict.lookupOrDefault<word>("maskType", "faceCells") + dict.getOrDefault<word>("maskType", "faceCells") ); auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown zeroATCcells type " << modelType << nl << nl - << "Valid zeroATCcells types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "zeroATCcells", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<zeroATCcells> (cstrIter()(mesh,dict)); diff --git a/src/optimisation/adjointOptimisation/adjoint/boundaryAdjointContributions/boundaryAdjointContribution/boundaryAdjointContribution.C b/src/optimisation/adjointOptimisation/adjoint/boundaryAdjointContributions/boundaryAdjointContribution/boundaryAdjointContribution.C index 22610d7759f7a9cfe0768a7e782c03506945d20c..0c354642c19f6cd4c7853c432842c101fd15b166 100644 --- a/src/optimisation/adjointOptimisation/adjoint/boundaryAdjointContributions/boundaryAdjointContribution/boundaryAdjointContribution.C +++ b/src/optimisation/adjointOptimisation/adjoint/boundaryAdjointContributions/boundaryAdjointContribution/boundaryAdjointContribution.C @@ -66,12 +66,12 @@ autoPtr<boundaryAdjointContribution> boundaryAdjointContribution::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown boundaryAdjointContribution type " << simulationType - << endl << endl - << "Valid boundaryAdjointContribution types are :" << endl - << dictionaryConstructorTablePtr_->toc() - << exit(FatalError); + FatalErrorInLookup + ( + "boundaryAdjointContribution", + simulationType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return diff --git a/src/optimisation/adjointOptimisation/adjoint/fvOptionsAdjoint/fvOptions/fvOptionAdjoint.C b/src/optimisation/adjointOptimisation/adjoint/fvOptionsAdjoint/fvOptions/fvOptionAdjoint.C index c3ddcc80904fcb1a7102517702e065463d88ce28..afd4bc5fe72f0333ea58f4362d3a10454a4a1417 100644 --- a/src/optimisation/adjointOptimisation/adjoint/fvOptionsAdjoint/fvOptions/fvOptionAdjoint.C +++ b/src/optimisation/adjointOptimisation/adjoint/fvOptionsAdjoint/fvOptions/fvOptionAdjoint.C @@ -63,7 +63,7 @@ Foam::autoPtr<Foam::fv::optionAdjoint> Foam::fv::optionAdjoint::New const fvMesh& mesh ) { - word modelType(coeffs.get<word>("type")); + const word modelType(coeffs.get<word>("type")); Info<< indent << "Selecting finite volume options model type " << modelType << endl; @@ -72,11 +72,12 @@ Foam::autoPtr<Foam::fv::optionAdjoint> Foam::fv::optionAdjoint::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown Model type " << modelType << nl << nl - << "Valid model types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "model", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<optionAdjoint>(cstrIter()(name, modelType, coeffs, mesh)); diff --git a/src/optimisation/adjointOptimisation/adjoint/objectiveManager/objectiveManager/objectiveManager.C b/src/optimisation/adjointOptimisation/adjoint/objectiveManager/objectiveManager/objectiveManager.C index ebba238ff401abb7457fbe24ddd3a60c0631c856..0f8395d01342e3795a5271ab6604a2257e4ea0aa 100644 --- a/src/optimisation/adjointOptimisation/adjoint/objectiveManager/objectiveManager/objectiveManager.C +++ b/src/optimisation/adjointOptimisation/adjoint/objectiveManager/objectiveManager/objectiveManager.C @@ -119,12 +119,12 @@ autoPtr<objectiveManager> objectiveManager::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown objectiveManagerType type " << managerType - << nl << nl - << "Valid objectiveManagerTypes are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "objectiveManagerType", + managerType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<objectiveManager> diff --git a/src/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveIncompressible/objectiveIncompressible.C b/src/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveIncompressible/objectiveIncompressible.C index bb1c3d62881a391651b16ff64f17dfd6bf8d730d..f5565dcf011a2c7eb2c557a07220ed8a185dac07 100644 --- a/src/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveIncompressible/objectiveIncompressible.C +++ b/src/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveIncompressible/objectiveIncompressible.C @@ -100,21 +100,21 @@ autoPtr<objectiveIncompressible> objectiveIncompressible::New const word& primalSolverName ) { - const word objectiveName = dict.dictName(); const word modelType(dict.get<word>("type")); - Info<< "Creating objective function : " << objectiveName + Info<< "Creating objective function : " << dict.dictName() << " of type " << modelType << endl; auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown objectiveIncompressible type " << modelType << nl << nl - << "Valid objectiveIncompressible types are :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "objectiveIncompressible", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<objectiveIncompressible> diff --git a/src/optimisation/adjointOptimisation/adjoint/objectives/objective/objective.C b/src/optimisation/adjointOptimisation/adjoint/objectives/objective/objective.C index c8f79a682d8bd9c4ae3e755af023355512db33a9..3e00a3cef932b4678fee0cbbcda8ecdc6994c601 100644 --- a/src/optimisation/adjointOptimisation/adjoint/objectives/objective/objective.C +++ b/src/optimisation/adjointOptimisation/adjoint/objectives/objective/objective.C @@ -155,11 +155,12 @@ autoPtr<objective> objective::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown objective type " << objectiveType << nl << nl - << "Valid types are :" << nl - << objectiveConstructorTablePtr_->toc() - << exit(FatalError); + FatalErrorInLookup + ( + "objective", + objectiveType, + *objectiveConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<objective> diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/adjointSensitivity/adjointSensitivityIncompressible.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/adjointSensitivity/adjointSensitivityIncompressible.C index b7476fa83201607d212dec99ec9f32672fa47e29..23c33340a946e8e14da86fa03518d5629b9591d5 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/adjointSensitivity/adjointSensitivityIncompressible.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/adjointSensitivity/adjointSensitivityIncompressible.C @@ -77,20 +77,21 @@ autoPtr<adjointSensitivity> adjointSensitivity::New fv::optionAdjointList& fvOptionsAdjoint ) { - const word sensitivityType(dict.get<word>("type")); + const word modelType(dict.get<word>("type")); - Info<< "adjointSensitivity type : " << sensitivityType << endl; + Info<< "adjointSensitivity type : " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(sensitivityType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown adjointSensitivity type " << sensitivityType - << nl << nl - << "Valid adjointSensitivity types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "adjointSensitivity", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<adjointSensitivity> diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/lineSearch/lineSearch.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/lineSearch/lineSearch.C index e992c64f5fd33003b9856fccb1c992a7ac15a1ff..c77f2e61c7ead6b3a1874ad8173f58bc60862b5f 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/lineSearch/lineSearch.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/lineSearch/lineSearch.C @@ -92,8 +92,7 @@ autoPtr<lineSearch> lineSearch::New { autoPtr<lineSearch> lineSrch(nullptr); - const word modelType = - dict.lookupOrDefault<word>("lineSearchType", "none"); + const word modelType(dict.getOrDefault<word>("lineSearchType", "none")); Info<< "lineSearch type : " << modelType << endl; @@ -103,12 +102,12 @@ autoPtr<lineSearch> lineSearch::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown lineSearch type " << modelType - << nl << nl - << "Valid lineSearch types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "lineSearch", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } lineSrch.reset((cstrIter()(dict, time)).ptr()); diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/stepUpdate/stepUpdate/stepUpdate.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/stepUpdate/stepUpdate/stepUpdate.C index 9995531007fa273989d5ef6a3f5a1c41231746c3..dd878889f69a7e9be3cc986cb1f604d7f4af0be9 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/stepUpdate/stepUpdate/stepUpdate.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/stepUpdate/stepUpdate/stepUpdate.C @@ -59,12 +59,12 @@ autoPtr<stepUpdate> stepUpdate::New(const dictionary& dict) if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown stepUpdate type " << modelType - << nl << nl - << "Valid stepUpdate types are : " << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "stepUpdate", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<stepUpdate>(cstrIter()(dict)); diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationManager/optimisationManager/optimisationManager.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationManager/optimisationManager/optimisationManager.C index cd67276f14de7bbcf9791c1e0eaabcbffe4450a8..71e52d909f5bdd226528bf82b329f88b7eece9da 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationManager/optimisationManager/optimisationManager.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationManager/optimisationManager/optimisationManager.C @@ -146,9 +146,9 @@ Foam::autoPtr<Foam::optimisationManager> Foam::optimisationManager::New fvMesh& mesh ) { - word modelType; - { - IOdictionary dict + const word modelType + ( + IOdictionary ( IOobject ( @@ -157,12 +157,11 @@ Foam::autoPtr<Foam::optimisationManager> Foam::optimisationManager::New mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false // do not register + false // Do not register ) - ); + ).get<word>("optimisationManager") + ); - modelType = dict.get<word>("optimisationManager"); - } Info<< "optimisationManager type : " << modelType << endl; @@ -170,11 +169,12 @@ Foam::autoPtr<Foam::optimisationManager> Foam::optimisationManager::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown optimisationManager type " << modelType << nl << nl - << "Valid optimisationManager types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "optimisationManager", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<optimisationManager>(cstrIter()(mesh)); diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationType/incompressible/optimisationType/optimisationTypeIncompressible.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationType/incompressible/optimisationType/optimisationTypeIncompressible.C index eebfc21d5581b20d0f143c1605f71373203aac53..78729071d4a011133b25b96ab752b00eab34e448 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationType/incompressible/optimisationType/optimisationTypeIncompressible.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationType/incompressible/optimisationType/optimisationTypeIncompressible.C @@ -131,11 +131,12 @@ autoPtr<optimisationType> optimisationType::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown optimisationType type " << modelType << nl << nl - << "Valid optimisationType types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "optimisationType", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<optimisationType> diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/updateMethod/updateMethod/updateMethod.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/updateMethod/updateMethod/updateMethod.C index b9c5e3275f9c8363d71e8173438426cdb5bc89c3..88f8701fea606300be5bf591cfd863a0154a09db 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/updateMethod/updateMethod/updateMethod.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/updateMethod/updateMethod/updateMethod.C @@ -239,12 +239,12 @@ Foam::autoPtr<Foam::updateMethod> Foam::updateMethod::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown updateMethod type " << modelType - << nl << nl - << "Valid updateMethod types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "updateMethod", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<updateMethod>(cstrIter()(mesh, dict)); diff --git a/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/adjointSolver/adjointSolver.C b/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/adjointSolver/adjointSolver.C index faab8a9e345c43e5b1d2fa72518beca910f9c47b..e7a950ac8b1ad0f8ef19c9828e1af42eeabb5428 100644 --- a/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/adjointSolver/adjointSolver.C +++ b/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/adjointSolver/adjointSolver.C @@ -82,16 +82,19 @@ Foam::autoPtr<Foam::adjointSolver> Foam::adjointSolver::New const word& primalSolverName ) { - const word adjointSolverType(dict.get<word>("type")); - auto cstrIter = adjointSolverConstructorTablePtr_->cfind(adjointSolverType); + const word solverType(dict.get<word>("type")); + + auto cstrIter = adjointSolverConstructorTablePtr_->cfind(solverType); if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown adjointSolver type " << adjointSolverType << nl << nl - << "Valid adjointSolver types are :" << nl - << adjointSolverConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "adjointSolver", + solverType, + *adjointSolverConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<adjointSolver> diff --git a/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/incompressible/incompressibleAdjointSolver/incompressibleAdjointSolver.C b/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/incompressible/incompressibleAdjointSolver/incompressibleAdjointSolver.C index 4a203611d3133fdc51284ab1443a33538f5f5ec9..2f69cd09b1dabd035ae6805fb301e8f47acce90e 100644 --- a/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/incompressible/incompressibleAdjointSolver/incompressibleAdjointSolver.C +++ b/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/incompressible/incompressibleAdjointSolver/incompressibleAdjointSolver.C @@ -87,12 +87,12 @@ Foam::incompressibleAdjointSolver::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown incompressibleAdjointSolver type " - << solverType << nl << nl - << "Valid incompressibleAdjointSolver types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "incompressibleAdjointSolver", + solverType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return diff --git a/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/incompressible/incompressiblePrimalSolver/incompressiblePrimalSolver.C b/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/incompressible/incompressiblePrimalSolver/incompressiblePrimalSolver.C index 0c85173b914efe637754097e02d70bdb41900e81..1b4984afe5b6fe965742e754ca205823b63cb2cc 100644 --- a/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/incompressible/incompressiblePrimalSolver/incompressiblePrimalSolver.C +++ b/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/incompressible/incompressiblePrimalSolver/incompressiblePrimalSolver.C @@ -91,12 +91,12 @@ Foam::incompressiblePrimalSolver::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown incompressiblePrimalSolver type " << solverType - << nl << nl - << "Valid incompressiblePrimalSolver types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "incompressiblePrimalSolver", + solverType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return diff --git a/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/primalSolver/primalSolver.C b/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/primalSolver/primalSolver.C index 3c8d89c8b944b104fd09154d0f82a7a102fce185..576f196be17d0f5090d44951b01bf9ff3ef793b9 100644 --- a/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/primalSolver/primalSolver.C +++ b/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/primalSolver/primalSolver.C @@ -61,18 +61,19 @@ Foam::autoPtr<Foam::primalSolver> Foam::primalSolver::New const dictionary& dict ) { - const word primalSolverType(dict.get<word>("type")); + const word solverType(dict.get<word>("type")); - auto cstrIter = primalSolverConstructorTablePtr_->cfind(primalSolverType); + auto cstrIter = primalSolverConstructorTablePtr_->cfind(solverType); if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown primalSolver type " << primalSolverType - << nl << nl - << "Valid primalSolver types are :" << nl - << primalSolverConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "primalSolver", + solverType, + *primalSolverConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<primalSolver>(cstrIter()(mesh, managerType, dict)); diff --git a/src/optimisation/adjointOptimisation/adjoint/solvers/solverControl/SIMPLEControl/SIMPLEControl/SIMPLEControl.C b/src/optimisation/adjointOptimisation/adjoint/solvers/solverControl/SIMPLEControl/SIMPLEControl/SIMPLEControl.C index f43578594e178f8b21f9bbf119f460857d9d7690..f3c56385e361dc6de84ceaca4ea4d0d80f057c20 100644 --- a/src/optimisation/adjointOptimisation/adjoint/solvers/solverControl/SIMPLEControl/SIMPLEControl/SIMPLEControl.C +++ b/src/optimisation/adjointOptimisation/adjoint/solvers/solverControl/SIMPLEControl/SIMPLEControl/SIMPLEControl.C @@ -70,11 +70,12 @@ Foam::autoPtr<Foam::SIMPLEControl> Foam::SIMPLEControl::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown control type " << managerType << nl << nl - << "Valid control types are :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "control", + managerType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<SIMPLEControl>(cstrIter()(mesh, managerType, solver)); diff --git a/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/variablesSet/variablesSetTemplates.C b/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/variablesSet/variablesSetTemplates.C index bc3fb50d51761f723181a18d7dd7d2fa46440442..6977a9d3cb8ade1840a363eb277dba04957884cf 100644 --- a/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/variablesSet/variablesSetTemplates.C +++ b/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/variablesSet/variablesSetTemplates.C @@ -256,7 +256,7 @@ void variablesSet::renameTurbulenceField mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE, - false // do not register temp field to avoid db collisions + false // Do not register ); if (headerCustomName.typeHeaderOk<VolFieldType>(true)) diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointRASModel/adjointRASModel.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointRASModel/adjointRASModel.C index 6e8dab5d259d14a0eaa0ad00357e78a223fd42f4..ab9737165b80ea9df1c1c360aeab582866616101 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointRASModel/adjointRASModel.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointRASModel/adjointRASModel.C @@ -166,8 +166,6 @@ autoPtr<adjointRASModel> adjointRASModel::New const word& adjointTurbulenceModelName ) { - // Get model name, but do not register the dictionary - // otherwise it is registered in the database twice const word modelType ( IOdictionary @@ -179,7 +177,7 @@ autoPtr<adjointRASModel> adjointRASModel::New primalVars.U().db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) ).get<word>("adjointRASModel") ); @@ -190,12 +188,12 @@ autoPtr<adjointRASModel> adjointRASModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown adjointRASModel type " - << modelType << nl << nl - << "Valid adjointRASModel types:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "adjointRASModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<adjointRASModel> diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointTurbulenceModel/adjointTurbulenceModel.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointTurbulenceModel/adjointTurbulenceModel.C index 9f085054a2c596ac17d9ea93a2b1580229067025..bd63172ad93fc262b35a058b89f5cfc362001b35 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointTurbulenceModel/adjointTurbulenceModel.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointTurbulenceModel/adjointTurbulenceModel.C @@ -80,8 +80,6 @@ autoPtr<adjointTurbulenceModel> adjointTurbulenceModel::New const word& adjointTurbulenceModelName ) { - // Get model name, but do not register the dictionary - // otherwise it is registered in the database twice const word modelType ( IOdictionary @@ -93,7 +91,7 @@ autoPtr<adjointTurbulenceModel> adjointTurbulenceModel::New primalVars.U().db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) ).get<word>("simulationType") ); diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/RASModelVariables/RASModelVariables.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/RASModelVariables/RASModelVariables.C index 1757edf3426f7e7b87a506a6ea5c4e923e8a5861..6f4bc1157cc38293e88329858ad32f6a4915a480 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/RASModelVariables/RASModelVariables.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/RASModelVariables/RASModelVariables.C @@ -186,8 +186,6 @@ autoPtr<RASModelVariables> RASModelVariables::New const solverControl& SolverControl ) { - // Get model name, but do not register the dictionary - // otherwise it is registered in the database twice const word modelType ( IOdictionary @@ -199,7 +197,7 @@ autoPtr<RASModelVariables> RASModelVariables::New mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) ).subOrEmptyDict("RAS").lookupOrDefault<word>("RASModel", "laminar") ); @@ -210,11 +208,12 @@ autoPtr<RASModelVariables> RASModelVariables::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown RASModelVariables type " << modelType << nl << nl - << "Valid RASModelVariables types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "RASModelVariables", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<RASModelVariables>(cstrIter()(mesh, SolverControl)); diff --git a/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C b/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C index d25311212ef529cb22a2038579779808a55cb75c..848e0cefcbe6387206f0464521d5363d001aeb56 100644 --- a/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C +++ b/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -65,10 +65,7 @@ Foam::autoPtr<Foam::cellCellStencil> Foam::cellCellStencil::New const bool update ) { - if (debug) - { - InfoInFunction << "Constructing cellCellStencil" << endl; - } + DebugInFunction << "Constructing cellCellStencil" << endl; const word stencilType(dict.get<word>("method")); @@ -76,12 +73,12 @@ Foam::autoPtr<Foam::cellCellStencil> Foam::cellCellStencil::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown cellCellStencil type " - << stencilType << nl << nl - << "Valid cellCellStencil types :" << endl - << meshConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "cellCellStencil", + stencilType, + *meshConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<cellCellStencil>(cstrIter()(mesh, dict, update)); diff --git a/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C b/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C index 8727b1c358e6de821fed9ec4ec64b2f953c6fde0..966b2159a39df6160f92d164e87b289f91488010 100644 --- a/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C +++ b/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2015-2017 OpenFOAM Foundation @@ -85,12 +85,13 @@ Foam::decompositionConstraint::New if (!cstrIter.found()) { - FatalIOErrorInFunction(dict) - << "Unknown decompositionConstraint: " - << modelType << nl << nl - << "Valid types:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + dict, + "decompositionConstraint", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<decompositionConstraint>(cstrIter()(dict)); diff --git a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C index 08194bce0d65836d4c0a048eec6819ffb8078de6..d94614e28f5a817d9db2fbd93ff629290b6c80fd 100644 --- a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C +++ b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C @@ -365,12 +365,12 @@ Foam::autoPtr<Foam::decompositionMethod> Foam::decompositionMethod::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown decompositionMethod " - << methodType << nl << nl - << "Valid decompositionMethods : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "decompositionMethod", + methodType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } // verbose diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/newCHFModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/newCHFModel.C index 91f5a9b078431eed582a161cacfe87d060bf3eff..96f9b0d04752b26581b2eff8ad6165a2af449e7c 100644 --- a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/newCHFModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/newCHFModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2015-2018 OpenFOAM Foundation @@ -35,22 +35,20 @@ Foam::wallBoilingModels::CHFModel::New const dictionary& dict ) { - word CHFModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); - Info<< "Selecting CHFModel: " - << CHFModelType << endl; + Info<< "Selecting CHFModel: " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(CHFModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown CHFModelType type " - << CHFModelType << endl << endl - << "Valid CHFModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "CHFModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict); diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/newCHFSubCoolModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/newCHFSubCoolModel.C index c670075a66bcee5f785186139c34d4661361a804..f4ffddaf10ac8e8e10a3a1b4dd650dc90e80c2ba 100644 --- a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/newCHFSubCoolModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/newCHFSubCoolModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,22 +33,20 @@ Foam::wallBoilingModels::CHFSubCoolModel::New const dictionary& dict ) { - word CHFModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); - Info<< "Selecting CHFSubCoolModel: " - << CHFModelType << endl; + Info<< "Selecting CHFSubCoolModel: " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(CHFModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown CHFModelType type " - << CHFModelType << endl << endl - << "Valid CHFSubCoolModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "CHFSubCoolModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict); diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/newLeidenfrostModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/newLeidenfrostModel.C index 2ddd99a335bc47b113cf632c784e33f9b27d0a7e..1c8dd2b20b5d254a2ae2574d4ad9fdbee27347b4 100644 --- a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/newLeidenfrostModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/newLeidenfrostModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,22 +33,20 @@ Foam::wallBoilingModels::LeidenfrostModel::New const dictionary& dict ) { - word LeidenfrostModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); - Info<< "Selecting LeidenfrostModel: " - << LeidenfrostModelType << endl; + Info<< "Selecting LeidenfrostModel: " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(LeidenfrostModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown LeidenfrostModelType type " - << LeidenfrostModelType << endl << endl - << "Valid LeidenfrostModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "LeidenfrostModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict); diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/newMHFModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/newMHFModel.C index 742629380eb0aa3c1113ee1d9400cad1363f3862..07ca0478210297e2a9e43096488ab963481e095f 100644 --- a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/newMHFModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/newMHFModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016 OpenFOAM Foundation @@ -35,22 +35,20 @@ Foam::wallBoilingModels::MHFModel::New const dictionary& dict ) { - word MHFModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); - Info<< "Selecting MHFModel: " - << MHFModelType << endl; + Info<< "Selecting MHFModel: " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(MHFModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown MHFModelType type " - << MHFModelType << endl << endl - << "Valid MHFModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "MHFModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict); diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/newTDNBModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/newTDNBModel.C index 92553f81d446792ac776363c5cdae1dafe14ec8d..76bfbeda0cc61fea7f24e3dde9b928c091c8f4aa 100644 --- a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/newTDNBModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/newTDNBModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016 OpenFOAM Foundation @@ -35,22 +35,20 @@ Foam::wallBoilingModels::TDNBModel::New const dictionary& dict ) { - word TDNBModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); - Info<< "Selecting TDNBModel: " - << TDNBModelType << endl; + Info<< "Selecting TDNBModel: " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(TDNBModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown TDNBModelType type " - << TDNBModelType << endl << endl - << "Valid TDNBModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "TDNBModelType", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict); diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C index 01f5db648f76d13d3a6c820851cb85e8c0d8b708..424716637ae4b93c62a063f3dfb01cef57124450 100644 --- a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C @@ -2,8 +2,10 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | +------------------------------------------------------------------------------- + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,22 +35,20 @@ Foam::wallBoilingModels::departureDiameterModel::New const dictionary& dict ) { - word departureDiameterModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); - Info<< "Selecting departureDiameterModel: " - << departureDiameterModelType << endl; + Info<< "Selecting departureDiameterModel: " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(departureDiameterModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown departureDiameterModelType type " - << departureDiameterModelType << endl << endl - << "Valid departureDiameterModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "departureDiameterModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict); diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C index 1a61878e015b0074a84fc37f75eb5e8fdf83224e..86335bc12ab0db59a470d8648e869cf7cf8b7b09 100644 --- a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C @@ -2,8 +2,10 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | +------------------------------------------------------------------------------- + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,22 +35,20 @@ Foam::wallBoilingModels::departureFrequencyModel::New const dictionary& dict ) { - word departureFrequencyModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); - Info<< "Selecting departureFrequencyModel: " - << departureFrequencyModelType << endl; + Info<< "Selecting departureFrequencyModel: " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(departureFrequencyModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown departureFrequencyModelType type " - << departureFrequencyModelType << endl << endl - << "Valid departureFrequencyModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "departureFrequencyModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict); diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/newfilmBoilingModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/newfilmBoilingModel.C index 1b518fb3ebdeb418ed7731f1478ba4bb4cc6433d..b4807c3b83a33aa4151bba3d469d8e21b52c7733 100644 --- a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/newfilmBoilingModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/newfilmBoilingModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,22 +33,21 @@ Foam::wallBoilingModels::filmBoilingModel::New const dictionary& dict ) { - word filmBoilingModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting filmBoilingModel: " - << filmBoilingModelType << endl; + << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(filmBoilingModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown filmBoilingModelType type " - << filmBoilingModelType << endl << endl - << "Valid filmBoilingModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "filmBoilingModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict); diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C index 25dfc4121a2d87a59c309e935db0eb8e785b6ff0..a9aa2390c330509c7a3552c856bdd5d030e01784 100644 --- a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016-2018 OpenFOAM Foundation @@ -35,22 +35,20 @@ Foam::wallBoilingModels::nucleationSiteModel::New const dictionary& dict ) { - word nucleationSiteModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); - Info<< "Selecting nucleationSiteModel: " - << nucleationSiteModelType << endl; + Info<< "Selecting nucleationSiteModel: " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(nucleationSiteModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown nucleationSiteModelType type " - << nucleationSiteModelType << endl << endl - << "Valid nucleationSiteModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "nucleationSiteModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict); diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C index 126d2dd198bea81b1cfdfa701f4d2697104841f1..d11d7c3069194cf6367617fdd8a6fd7ce4eab62e 100644 --- a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016-2018 OpenFOAM Foundation @@ -35,22 +35,21 @@ Foam::wallBoilingModels::partitioningModel::New const dictionary& dict ) { - word partitioningModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting partitioningModel: " - << partitioningModelType << endl; + << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(partitioningModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown partitioningModelType type " - << partitioningModelType << endl << endl - << "Valid partitioningModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "partitioningModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict); diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C index baf84f78ed93fe52655df8565acec85727ba0fe0..64b0e6ee9e037fccd68cab4a1704a40b3ebf7d39 100644 --- a/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2015-2018 OpenFOAM Foundation @@ -38,9 +38,9 @@ Foam::interfaceCompositionModel::New const phasePair& pair ) { - word interfaceCompositionModelType + const word modelType ( - word(dict.lookup("type")) + dict.get<word>("type") + "<" + pair.phase1().thermo().type() + "," @@ -49,19 +49,18 @@ Foam::interfaceCompositionModel::New ); Info<< "Selecting interfaceCompositionModel for " - << pair << ": " << interfaceCompositionModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(interfaceCompositionModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown interfaceCompositionModelType type " - << interfaceCompositionModelType << endl << endl - << "Valid interfaceCompositionModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "interfaceCompositionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict, pair); diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C index 6f69f3d9529db13a1395b1d39530be9adca6a7b3..f2f10e0ecfe85d3db5bed5ddbd09fe84742db3e3 100644 --- a/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2015-2018 OpenFOAM Foundation @@ -36,22 +36,21 @@ Foam::autoPtr<Foam::massTransferModel> Foam::massTransferModel::New const phasePair& pair ) { - word massTransferModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting massTransferModel for " - << pair << ": " << massTransferModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(massTransferModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown massTransferModelType type " - << massTransferModelType << endl << endl - << "Valid massTransferModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "massTransferModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict, pair); diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C index 390431dd77c2cf53f56ef76cd0e253d33f65b92a..3eac33f2a6cc9b32665752d33cb1739e697afcb5 100644 --- a/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C @@ -2,8 +2,10 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | +------------------------------------------------------------------------------- + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,22 +35,20 @@ Foam::autoPtr<Foam::saturationModel> Foam::saturationModel::New const objectRegistry& db ) { - word saturationModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); - Info<< "Selecting saturationModel: " - << saturationModelType << endl; + Info<< "Selecting saturationModel: " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(saturationModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown saturationModelType type " - << saturationModelType << endl << endl - << "Valid saturationModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "saturationModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict, db); diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C index dd5b54355a44c09916c219ed90722785219b4041..c2b878a24009a8c9e7d28f18368c1abcfb74b49e 100644 --- a/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2015-2018 OpenFOAM Foundation @@ -37,22 +37,21 @@ Foam::surfaceTensionModel::New const phasePair& pair ) { - word surfaceTensionModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting surfaceTensionModel for " - << pair << ": " << surfaceTensionModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(surfaceTensionModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown surfaceTensionModelType type " - << surfaceTensionModelType << endl << endl - << "Valid surfaceTensionModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "surfaceTensionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict, pair, true); diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C index 9f1167219e187a33d0634419235437ece2ffa65d..c52f0f8dddd75f6e4dd9e53e4cb7bf0ab875444b 100644 --- a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2018 OpenFOAM Foundation @@ -37,22 +37,21 @@ Foam::aspectRatioModel::New const phasePair& pair ) { - word aspectRatioModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting aspectRatioModel for " - << pair << ": " << aspectRatioModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(aspectRatioModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown aspectRatioModelType type " - << aspectRatioModelType << endl << endl - << "Valid aspectRatioModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "swarmCorrection", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict, pair); diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C index bdf7300cea0eef3a3373eafb625b0807da4f698c..5f44d0aea8dd19e0bd6c276475450d3c50489a52 100644 --- a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2018 OpenFOAM Foundation @@ -36,22 +36,21 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New const phasePair& pair ) { - word dragModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting dragModel for " - << pair << ": " << dragModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(dragModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown dragModelType type " - << dragModelType << endl << endl - << "Valid dragModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "dragModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict, pair, true); diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C index 894acf11d74993ed092957ee6f206baadd99a0b1..531d7afa6a4c9f0ee949579de89c1839937a43ae 100644 --- a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2018 OpenFOAM Foundation @@ -36,22 +36,21 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New const phasePair& pair ) { - word heatTransferModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting heatTransferModel for " - << pair << ": " << heatTransferModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(heatTransferModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown heatTransferModelType type " - << heatTransferModelType << endl << endl - << "Valid heatTransferModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "heatTransferModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict, pair); diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C index 49fe9f292f87df7f0cac0d6505c729791d2d2399..e6f2959ec9ac762faa35e340c385d409d1323da9 100644 --- a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2018 OpenFOAM Foundation @@ -36,22 +36,21 @@ Foam::autoPtr<Foam::liftModel> Foam::liftModel::New const phasePair& pair ) { - word liftModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting liftModel for " - << pair << ": " << liftModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(liftModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown liftModelType type " - << liftModelType << endl << endl - << "Valid liftModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "liftModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict, pair); diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/newPhaseTransferModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/newPhaseTransferModel.C index e2949076f06bc529e4d2bf339a76ba36edeb37ec..0761b675241718da8eeb3e3adb81ad365ea0924a 100644 --- a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/newPhaseTransferModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/newPhaseTransferModel.C @@ -2,8 +2,10 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | +------------------------------------------------------------------------------- + | Copyright (C) 2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,22 +36,21 @@ Foam::autoPtr<Foam::phaseTransferModel> Foam::phaseTransferModel::New const phasePair& pair ) { - word phaseTransferModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting phaseTransferModel for " - << pair << ": " << phaseTransferModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(phaseTransferModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown phaseTransferModelType type " - << phaseTransferModelType << endl << endl - << "Valid phaseTransferModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "phaseTransferModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict, pair); diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C index 63be8885f34c556539dccbfc182a10a07a88ffa5..48314da29d18d2f329f3f7030548dec45f344f7f 100644 --- a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2018 OpenFOAM Foundation @@ -37,22 +37,21 @@ Foam::swarmCorrection::New const phasePair& pair ) { - word swarmCorrectionType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting swarmCorrection for " - << pair << ": " << swarmCorrectionType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(swarmCorrectionType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown swarmCorrectionType type " - << swarmCorrectionType << endl << endl - << "Valid swarmCorrection types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "swarmCorrection", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict, pair); diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C index c88621eac5c6f2b8192c043bbf1abb67657cf7d1..c1cc88f949e54e4ec1185fb135fcba66adf4db11 100644 --- a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2018 OpenFOAM Foundation @@ -37,22 +37,21 @@ Foam::turbulentDispersionModel::New const phasePair& pair ) { - word turbulentDispersionModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting turbulentDispersionModel for " - << pair << ": " << turbulentDispersionModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(turbulentDispersionModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown turbulentDispersionModelType type " - << turbulentDispersionModelType << endl << endl - << "Valid turbulentDispersionModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "turbulentDispersionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict, pair); diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C index e3407f2cd101bac186d25df05ff832a2c797e50f..903fce9e02078dd60b41d2efcebd18f20d49c1ba 100644 --- a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2018 OpenFOAM Foundation @@ -36,22 +36,21 @@ Foam::autoPtr<Foam::virtualMassModel> Foam::virtualMassModel::New const phasePair& pair ) { - word virtualMassModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting virtualMassModel for " - << pair << ": " << virtualMassModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(virtualMassModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown virtualMassModelType type " - << virtualMassModelType << endl << endl - << "Valid virtualMassModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "virtualMassModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict, pair, true); diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C index 8979682f9e512b968bb146ab814d14c4bb0eacac..e23e92962b9a07b27e5993f3a1fe774b091d96ce 100644 --- a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2015-2018 OpenFOAM Foundation @@ -36,22 +36,21 @@ Foam::autoPtr<Foam::wallDampingModel> Foam::wallDampingModel::New const phasePair& pair ) { - word wallDampingModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting wallDampingModel for " - << pair << ": " << wallDampingModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(wallDampingModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown wallDampingModelType type " - << wallDampingModelType << endl << endl - << "Valid wallDampingModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "wallDampingModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict, pair); diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C index 52cd99513042e830b3f8c2b5dd5fbcd021cffb36..06ce046f7b901ff808ad231f58b3e657b0ba0217 100644 --- a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2018 OpenFOAM Foundation @@ -36,22 +36,21 @@ Foam::autoPtr<Foam::wallLubricationModel> Foam::wallLubricationModel::New const phasePair& pair ) { - word wallLubricationModelType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting wallLubricationModel for " - << pair << ": " << wallLubricationModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(wallLubricationModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown wallLubricationModelType type " - << wallLubricationModelType << endl << endl - << "Valid wallLubricationModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "wallLubricationModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict, pair); diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C index 7a3f226b0ac5e62ec356f42c377b35465d000da0..1b3b73268aa15c8b3fd78d3a10ce62de321f70d7 100644 --- a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2014-2018 OpenFOAM Foundation @@ -36,22 +36,21 @@ Foam::autoPtr<Foam::blendingMethod> Foam::blendingMethod::New const wordList& phaseNames ) { - word blendingMethodType(dict.lookup("type")); + const word modelType(dict.get<word>("type")); Info<< "Selecting " << modelName << " blending method: " - << blendingMethodType << endl; + << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(blendingMethodType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown blendingMethodType type " - << blendingMethodType << endl << endl - << "Valid blendingMethod types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "blendingMethod", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(dict, phaseNames); diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C index c02cc1e8a6aa636b4444a8247d09b61217445158..69c4ef2d3e6b58a3c60ee593c1074cd322522ca1 100644 --- a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2018 OpenFOAM Foundation @@ -35,32 +35,29 @@ Foam::autoPtr<Foam::diameterModel> Foam::diameterModel::New const phaseModel& phase ) { - word diameterModelType - ( - dict.lookup("diameterModel") - ); + const word modelType(dict.get<word>("diameterModel")); Info << "Selecting diameterModel for phase " << phase.name() << ": " - << diameterModelType << endl; + << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(diameterModelType); + auto cstrIter = + dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown diameterModelType type " - << diameterModelType << endl << endl - << "Valid diameterModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "diameterModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter() ( - dict.optionalSubDict(diameterModelType + "Coeffs"), + dict.optionalSubDict(modelType + "Coeffs"), phase ); } diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C index 1ecd45349b23ebaf7e38ba0d83f2e49dd36cb725..8abcda5173518fd61127d812432e4f5c16873695 100644 --- a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2015-2018 OpenFOAM Foundation @@ -37,22 +37,21 @@ Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::New const label index ) { - word phaseModelType(fluid.subDict(phaseName).lookup("type")); + const word modelType(fluid.subDict(phaseName).get<word>("type")); Info<< "Selecting phaseModel for " - << phaseName << ": " << phaseModelType << endl; + << phaseName << ": " << modelType << endl; - phaseSystemConstructorTable::iterator cstrIter = - phaseSystemConstructorTablePtr_->find(phaseModelType); + auto cstrIter = phaseSystemConstructorTablePtr_->cfind(modelType); - if (cstrIter == phaseSystemConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown phaseModelType type " - << phaseModelType << endl << endl - << "Valid phaseModel types are : " << endl - << phaseSystemConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "phaseModel", + modelType, + *phaseSystemConstructorTablePtr_ + ) << abort(FatalError); } return cstrIter()(fluid, phaseName, index); diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/binaryBreakupModel/binaryBreakupModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/binaryBreakupModel/binaryBreakupModel.C index 9d1c0060cebf813aa9b6098b5ce1586a5529103e..65f958cf78eebb69e6991b82a0cd94365b5f1ec3 100644 --- a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/binaryBreakupModel/binaryBreakupModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/binaryBreakupModel/binaryBreakupModel.C @@ -2,8 +2,10 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | +------------------------------------------------------------------------------- + | Copyright (C) 2017-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,22 +44,21 @@ namespace diameterModels Foam::autoPtr<Foam::diameterModels::binaryBreakupModel> Foam::diameterModels::binaryBreakupModel::New ( - const word& type, + const word& modelType, const populationBalanceModel& popBal, const dictionary& dict ) { - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(type); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown binary breakup model type " - << type << nl << nl - << "Valid binary breakup model types : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "binary breakup model", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<binaryBreakupModel>(cstrIter()(popBal, dict)); diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/breakupModel/breakupModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/breakupModel/breakupModel.C index af11fec39d9d1d7fbfa160640b3dd11c300d6380..f659d84dd3f0cffcc95e416bad721b64675febc7 100644 --- a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/breakupModel/breakupModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/breakupModel/breakupModel.C @@ -2,8 +2,10 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | +------------------------------------------------------------------------------- + | Copyright (C) 2017-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,22 +44,21 @@ namespace diameterModels Foam::autoPtr<Foam::diameterModels::breakupModel> Foam::diameterModels::breakupModel::New ( - const word& type, + const word& modelType, const populationBalanceModel& popBal, const dictionary& dict ) { - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(type); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown breakup model type " - << type << nl << nl - << "Valid breakup model types : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "breakupModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<breakupModel>(cstrIter()(popBal, dict)); diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/breakupModel/breakupModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/breakupModel/breakupModel.H index 16a61b7f30230ed184b7c919523f236ea4131616..5cb8e79276d80074cf221ce8591fba35405c33dc 100644 --- a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/breakupModel/breakupModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/breakupModel/breakupModel.H @@ -2,8 +2,10 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | +------------------------------------------------------------------------------- + | Copyright (C) 2017-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -128,15 +130,14 @@ public: static autoPtr<breakupModel> New ( - const word& type, + const word& modelType, const populationBalanceModel& popBal, const dictionary& dict ); //- Destructor - virtual ~breakupModel() - {} + virtual ~breakupModel() = default; // Member Functions diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/coalescenceModel/coalescenceModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/coalescenceModel/coalescenceModel.C index 0c9f9d3ab09f7258aa4e20684e40c0485561a428..b104d53d92a778ec78abc69cd940a7b02c4fe357 100644 --- a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/coalescenceModel/coalescenceModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/coalescenceModel/coalescenceModel.C @@ -2,8 +2,10 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | +------------------------------------------------------------------------------- + | Copyright (C) 2017-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -47,17 +49,16 @@ Foam::diameterModels::coalescenceModel::New const dictionary& dict ) { - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(type); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown coalescence model type " - << type << nl << nl - << "Valid coalescence model types : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "coalescenceModel", + type, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<coalescenceModel>(cstrIter()(popBal, dict)); diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.C index 4370e474eea090ecfaec23f2b7d0a63caaa7c1c3..98f1e6033a523c2e8b40967ed2ee36641f3d5959 100644 --- a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.C @@ -2,8 +2,10 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | +------------------------------------------------------------------------------- + | Copyright (C) 2017-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -47,22 +49,21 @@ Foam::diameterModels::daughterSizeDistributionModel::New const dictionary& dict ) { - word daughterSizeDistributionModelType + const word modelType ( - dict.lookup("daughterSizeDistributionModel") + dict.get<word>("daughterSizeDistributionModel") ); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(daughterSizeDistributionModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown daughter size distribution model type " - << daughterSizeDistributionModelType << endl << endl - << "Valid daughter size distribution model types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "daughterSizeDistributionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(breakup, dict); diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/driftModel/driftModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/driftModel/driftModel.C index d09acfa639c6df2c844f60f95d69e620e1ef7dac..2c8d69fae28161238ed8b078ceda3ad6d21bf725 100644 --- a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/driftModel/driftModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/driftModel/driftModel.C @@ -2,8 +2,10 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | +------------------------------------------------------------------------------- + | Copyright (C) 2017-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,17 +50,16 @@ Foam::diameterModels::driftModel::New const dictionary& dict ) { - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(type); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown drift model type " - << type << nl << nl - << "Valid drift model types : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "driftModel", + type, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<driftModel>(cstrIter()(popBal, dict)); diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/nucleationModel/nucleationModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/nucleationModel/nucleationModel.C index db13a5f557e71f3e9ad9a49b8279ab909a8ed639..850a931ae5193d06abf522bd53efb5888a577066 100644 --- a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/nucleationModel/nucleationModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/nucleationModel/nucleationModel.C @@ -2,8 +2,10 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | +------------------------------------------------------------------------------- + | Copyright (C) 2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,17 +50,16 @@ Foam::diameterModels::nucleationModel::New const dictionary& dict ) { - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(type); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown nucleation model type " - << type << nl << nl - << "Valid nucleation model types : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "nucleationModel", + type, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<nucleationModel>(cstrIter()(popBal, dict)); diff --git a/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C index 078e37b25da3f1400ece777adf0d05fffd7bcc4f..580d79d635c07a0f0f092635d81b860aa8e6c268 100644 --- a/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2015-2018 OpenFOAM Foundation @@ -34,7 +34,7 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New const fvMesh& mesh ) { - const word multiphaseSystemType + const word systemType ( IOdictionary ( @@ -47,23 +47,21 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New IOobject::NO_WRITE, false ) - ).lookup("type") + ).get<word>("type") ); - Info<< "Selecting multiphaseSystem " - << multiphaseSystemType << endl; + Info<< "Selecting multiphaseSystem " << systemType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(multiphaseSystemType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(systemType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown multiphaseSystemType type " - << multiphaseSystemType << endl << endl - << "Valid multiphaseSystem types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "multiphaseSystem", + systemType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(mesh); diff --git a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C index fdc7adb282b961ff036417e18d0c87845ce02b1e..764d98bae50423800f6533995fa509059cd6e299 100644 --- a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2018 OpenFOAM Foundation @@ -35,23 +35,20 @@ Foam::kineticTheoryModels::conductivityModel::New const dictionary& dict ) { - word conductivityModelType(dict.lookup("conductivityModel")); + const word modelType(dict.get<word>("conductivityModel")); - Info<< "Selecting conductivityModel " - << conductivityModelType << endl; + Info<< "Selecting conductivityModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(conductivityModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalError - << "conductivityModel::New(const dictionary&) : " << endl - << " unknown conductivityModelType type " - << conductivityModelType - << ", constructor not in hash table" << endl << endl - << " Valid conductivityModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorInLookup + ( + "conductivityModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<conductivityModel>(cstrIter()(dict)); diff --git a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C index 4574606b937ba5a4a1ba32aa8e05ef9be50284ca..638f4f921f5326dce9c1412033922a86b602dc1b 100644 --- a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2018 OpenFOAM Foundation @@ -35,24 +35,20 @@ Foam::kineticTheoryModels::frictionalStressModel::New const dictionary& dict ) { - word frictionalStressModelType(dict.lookup("frictionalStressModel")); + const word modelType(dict.get<word>("frictionalStressModel")); - Info<< "Selecting frictionalStressModel " - << frictionalStressModelType << endl; + Info<< "Selecting frictionalStressModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(frictionalStressModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalError - << "frictionalStressModel::New(const dictionary&) : " << endl - << " unknown frictionalStressModelType type " - << frictionalStressModelType - << ", constructor not in hash table" << endl << endl - << " Valid frictionalStressModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "frictionalStressModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<frictionalStressModel>(cstrIter()(dict)); diff --git a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C index e791ec01bf77ff07087dc64549e1727c4bfcc677..23117dfb37e62aee2b9aa8154c75f40a24f5aeb5 100644 --- a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2018 OpenFOAM Foundation @@ -35,24 +35,20 @@ Foam::kineticTheoryModels::granularPressureModel::New const dictionary& dict ) { - word granularPressureModelType(dict.lookup("granularPressureModel")); + const word modelType(dict.get<word>("granularPressureModel")); - Info<< "Selecting granularPressureModel " - << granularPressureModelType << endl; + Info<< "Selecting granularPressureModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(granularPressureModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalError - << "granularPressureModel::New(const dictionary&) : " << endl - << " unknown granularPressureModelType type " - << granularPressureModelType - << ", constructor not in hash table" << endl << endl - << " Valid granularPressureModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "granularPressureModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<granularPressureModel>(cstrIter()(dict)); diff --git a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C index 48e96d81eae8b28d05ee6bf259df605104199cf1..a27c1356cb6a1276c3981ce24267b7e58d1f7f2f 100644 --- a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2018 OpenFOAM Foundation @@ -35,24 +35,20 @@ Foam::kineticTheoryModels::radialModel::New const dictionary& dict ) { - word radialModelType(dict.lookup("radialModel")); + const word modelType(dict.get<word>("radialModel")); - Info<< "Selecting radialModel " - << radialModelType << endl; + Info<< "Selecting radialModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(radialModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalError - << "radialModel::New(const dictionary&) : " << endl - << " unknown radialModelType type " - << radialModelType - << ", constructor not in hash table" << endl << endl - << " Valid radialModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "radialModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<radialModel>(cstrIter()(dict)); diff --git a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C index 429842a2c6e228bfb21637e068b590aef0c6723e..c4b1fb0b1cf5e51fad6bb0c2fde74d83bb25cf50 100644 --- a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2018 OpenFOAM Foundation @@ -35,23 +35,20 @@ Foam::kineticTheoryModels::viscosityModel::New const dictionary& dict ) { - word viscosityModelType(dict.lookup("viscosityModel")); + const word modelType(dict.get<word>("viscosityModel")); - Info<< "Selecting viscosityModel " - << viscosityModelType << endl; + Info<< "Selecting viscosityModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(viscosityModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalError - << "viscosityModel::New(const dictionary&) : " << endl - << " unknown viscosityModelType type " - << viscosityModelType - << ", constructor not in hash table" << endl << endl - << " Valid viscosityModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorInLookup + ( + "viscosityModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<viscosityModel>(cstrIter()(dict)); diff --git a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C index 0722b9216f7c60c6e908c975aa2e8a874fc7fe21..db3fd3931eeb3fed893e2ce6f7864791a68c882b 100644 --- a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2018 OpenFOAM Foundation @@ -52,17 +52,16 @@ Foam::diameterModels::IATEsource::New const dictionary& dict ) { - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(type); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown IATE source type " - << type << nl << nl - << "Valid IATE source types : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "IATEsource", + type, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<IATEsource>(cstrIter()(iate, dict)); diff --git a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C index f92e886cea5d466e1781ad625110a5f7c7c27883..74cf632bd5483698bcc5c548eb88219817f475d4 100644 --- a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2015-2018 OpenFOAM Foundation @@ -34,7 +34,7 @@ Foam::autoPtr<Foam::twoPhaseSystem> Foam::twoPhaseSystem::New const fvMesh& mesh ) { - const word twoPhaseSystemType + const word systemType ( IOdictionary ( @@ -47,23 +47,21 @@ Foam::autoPtr<Foam::twoPhaseSystem> Foam::twoPhaseSystem::New IOobject::NO_WRITE, false ) - ).lookup("type") + ).get<word>("type") ); - Info<< "Selecting twoPhaseSystem " - << twoPhaseSystemType << endl; + Info<< "Selecting twoPhaseSystem " << systemType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(twoPhaseSystemType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(systemType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown twoPhaseSystemType type " - << twoPhaseSystemType << endl << endl - << "Valid twoPhaseSystem types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "twoPhaseSystem", + systemType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(mesh); diff --git a/src/randomProcesses/noise/noiseModels/noiseModel/noiseModelNew.C b/src/randomProcesses/noise/noiseModels/noiseModel/noiseModelNew.C index 5867a75e6918f05312e93bd0ddd903567372f675..b14f70f235040832febcce9cd83a630bbe135106 100644 --- a/src/randomProcesses/noise/noiseModels/noiseModel/noiseModelNew.C +++ b/src/randomProcesses/noise/noiseModels/noiseModel/noiseModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,12 +37,12 @@ Foam::autoPtr<Foam::noiseModel> Foam::noiseModel::New(const dictionary& dict) if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown noiseModel type " - << modelType << nl << nl - << "Valid noiseModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "noiseModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<noiseModel>(cstrIter()(dict.subDict(modelType + "Coeffs"))); diff --git a/src/randomProcesses/windowModels/windowModel/windowModelNew.C b/src/randomProcesses/windowModels/windowModel/windowModelNew.C index de0ceeb32aa25f31cff73361a65131309b415150..2b61fa80aec3ff52b42eda8660ea7826e75ee48a 100644 --- a/src/randomProcesses/windowModels/windowModel/windowModelNew.C +++ b/src/randomProcesses/windowModels/windowModel/windowModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,12 +41,12 @@ Foam::autoPtr<Foam::windowModel> Foam::windowModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown windowModel type " - << modelType << nl << nl - << "Valid windowModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "windowModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<windowModel> diff --git a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelNew.C b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelNew.C index ec67c4ea55370f468118bb04c14b1377f9517a5d..aa6fd9c8af8a349185b196b8882c6afcfd4a9a6c 100644 --- a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelNew.C +++ b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -46,7 +46,6 @@ autoPtr<pyrolysisModel> pyrolysisModel::New const word& regionType ) { - // get model name, but do not register the dictionary const word modelType ( IOdictionary @@ -58,7 +57,7 @@ autoPtr<pyrolysisModel> pyrolysisModel::New mesh, IOobject::MUST_READ, IOobject::NO_WRITE, - false + false // Do not register ) ).get<word>("pyrolysisModel") ); @@ -69,12 +68,12 @@ autoPtr<pyrolysisModel> pyrolysisModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown pyrolysisModel type " - << modelType << nl << nl - << "Valid pyrolysisModel types :" << nl - << meshConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "pyrolysisModel", + modelType, + *meshConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<pyrolysisModel>(cstrIter()(modelType, mesh, regionType)); @@ -97,12 +96,12 @@ autoPtr<pyrolysisModel> pyrolysisModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown pyrolysisModel type " - << modelType << nl << nl - << "Valid pyrolysisModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "pyrolysisModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<pyrolysisModel> diff --git a/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObjectNew.C b/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObjectNew.C index 1f726d2da3123eacffc00cffd1a4391cf511f388..8955eefb961216b8e8706e1e160aca5c928e0f32 100644 --- a/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObjectNew.C +++ b/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObjectNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2017 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::regionModels::regionModelFunctionObject::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown region model function type " - << modelType << nl << nl - << "Valid region model function types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "regionModelFunction", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C index a814b96852882849d7f5e9efca58c8b799c48683..7dd0660959ed1b8f1713bac0ed46903274229c95 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2017 OpenFOAM Foundation @@ -53,12 +53,12 @@ autoPtr<filmThermoModel> filmThermoModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown filmThermoModel type " - << modelType << nl << nl - << "Valid filmThermoModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "filmThermoModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<filmThermoModel>(cstrIter()(model, dict)); diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C index 7fa54e2ab0e615b3c0cf8c250c3ca4be5d062a5f..3d631361ade143a597d9c6e4b3ef32ade086a3e6 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2017 OpenFOAM Foundation @@ -52,12 +52,12 @@ autoPtr<filmTurbulenceModel> filmTurbulenceModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown filmTurbulenceModel type " - << modelType << nl << nl - << "Valid filmTurbulenceModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "filmTurbulenceModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<filmTurbulenceModel>(cstrIter()(model, dict)); diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/force/forceNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/force/forceNew.C index aabc317e4721fe30305963241eb5dedb91824fc5..8df44c17708780f8ce1755aafd6f242c6d7a24d0 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/force/forceNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/force/forceNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -51,11 +51,12 @@ autoPtr<force> force::New if (!cstrIter.found()) { - FatalErrorInFunction << "Unknown force type " - << modelType << nl << nl - << "Valid force types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "force", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<force>(cstrIter()(model, dict)); diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C index fe9aae42950fc27acb513daae5b2868eb3fe7629..9f9ddfe0a7ecf3f6234cd9e8ee8f60806d631c47 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -51,12 +51,12 @@ autoPtr<injectionModel> injectionModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown injectionModel type " - << modelType << nl << nl - << "Valid injectionModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "injectionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<injectionModel>(cstrIter()(model, dict)); diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/transferModels/transferModel/transferModelNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/transferModels/transferModel/transferModelNew.C index d9b88ca49d05c369b9d771232df66f26a00abd9e..36e1af51510fe5a0ceef7d39a6dfa38f9c19bfc3 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/transferModels/transferModel/transferModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/transferModels/transferModel/transferModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2017 OpenFOAM Foundation @@ -51,12 +51,12 @@ autoPtr<transferModel> transferModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown transferModel type " - << modelType << nl << nl - << "Valid transferModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() - << exit(FatalError); + FatalErrorInLookup + ( + "transferModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<transferModel>(cstrIter()(model, dict)); diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/filmRadiationModel/filmRadiationModelNew.C b/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/filmRadiationModel/filmRadiationModelNew.C index a57cfa473a89dd9700d8a0a2a78ce86d47492139..ba85f97d72e946eb4f2d12f85ab0f8cd058e5793 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/filmRadiationModel/filmRadiationModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/filmRadiationModel/filmRadiationModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -52,12 +52,12 @@ autoPtr<filmRadiationModel> filmRadiationModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown radiationModel type " - << modelType << nl << nl - << "Valid filmRadiationModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "radiationModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<filmRadiationModel>(cstrIter()(model, dict)); diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C index d92cf8063744516e84e4c234a60eb5a60d54ff10..d084bd577cca8b461daf96ee3eab3a693155b984 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2017 OpenFOAM Foundation @@ -53,12 +53,12 @@ autoPtr<filmViscosityModel> filmViscosityModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown filmViscosityModel type " - << modelType << nl << nl - << "Valid filmViscosityModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "filmViscosityModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<filmViscosityModel>(cstrIter()(model, dict, mu)); diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C b/src/regionModels/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C index 29cd092f227458a36415830a5af30e1021fe6fb7..cbe05ba8d0d6d4659ffdbf58908b6564f39e8180 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -52,12 +52,12 @@ autoPtr<heatTransferModel> heatTransferModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown heatTransferModel type " - << modelType << nl << nl - << "Valid heatTransferModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "heatTransferModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<heatTransferModel>(cstrIter()(model, dict)); diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C index 600b2d41a378c915bf20401cc4145e182e1448c2..edbe85e4a9196fc6c7ca66f2b1ded1cd775a552c 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -52,12 +52,12 @@ autoPtr<phaseChangeModel> phaseChangeModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown phaseChangeModel type " - << modelType << nl << nl - << "Valid phaseChangeModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "phaseChangeModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<phaseChangeModel>(cstrIter()(model, dict)); diff --git a/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModelNew.C b/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModelNew.C index 103b26c969ee350866933b38632fabc501df0768..d2af051f299ea68e1326ee72ea9c1f2615b5b143 100644 --- a/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModelNew.C +++ b/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -44,31 +44,24 @@ autoPtr<surfaceFilmModel> surfaceFilmModel::New const word& regionType ) { - word modelType; + word modelType(surfaceFilmModels::noFilm::typeName); { - IOobject surfaceFilmPropertiesDictHeader + IOobject dictHeader ( regionType + "Properties", mesh.time().constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE, - false + false // Do not register ); - if (surfaceFilmPropertiesDictHeader.typeHeaderOk<IOdictionary>()) + if (dictHeader.typeHeaderOk<IOdictionary>()) { - IOdictionary surfaceFilmPropertiesDict - ( - surfaceFilmPropertiesDictHeader - ); + IOdictionary propDict(dictHeader); - surfaceFilmPropertiesDict.readEntry("surfaceFilmModel", modelType); - } - else - { - modelType = surfaceFilmModels::noFilm::typeName; + propDict.readEntry("surfaceFilmModel", modelType); } } @@ -78,12 +71,12 @@ autoPtr<surfaceFilmModel> surfaceFilmModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown surfaceFilmModel type " - << modelType << nl << nl - << "Valid surfaceFilmModel types :" << nl - << meshConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "surfaceFilmModel", + modelType, + *meshConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<surfaceFilmModel> diff --git a/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C b/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C index 2c2a2141af596c8cc83d9a2954db87682adc6cc2..a10690a27b21b2cc51a7a93f682cf08a84190cd2 100644 --- a/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C +++ b/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -58,13 +58,12 @@ autoPtr<thermalBaffleModel> thermalBaffleModel::New(const fvMesh& mesh) if (!cstrIter.found()) { - - FatalErrorInFunction - << "Unknown thermalBaffleModel type " - << modelType << nl << nl - << "Valid thermalBaffleModel types :" << nl - << meshConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "thermalBaffleModel", + modelType, + *meshConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<thermalBaffleModel>(cstrIter()(modelType, mesh)); @@ -84,12 +83,12 @@ autoPtr<thermalBaffleModel> thermalBaffleModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown thermalBaffleModel type " - << modelType << nl << nl - << "Valid thermalBaffleModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "thermalBaffleModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<thermalBaffleModel>(cstrIter()(modelType, mesh, dict)); diff --git a/src/renumber/renumberMethods/renumberMethod/renumberMethod.C b/src/renumber/renumberMethods/renumberMethod/renumberMethod.C index 76e84b4805914137d3d96a048a922c79493ef6ff..efbe180c771870cc2f8e6388625245923e8aecef 100644 --- a/src/renumber/renumberMethods/renumberMethod/renumberMethod.C +++ b/src/renumber/renumberMethods/renumberMethod/renumberMethod.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -54,12 +54,12 @@ Foam::autoPtr<Foam::renumberMethod> Foam::renumberMethod::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown renumberMethod " - << methodType << nl << nl - << "Valid renumberMethods are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "renumberMethod", + methodType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<renumberMethod>(cstrIter()(renumberDict)); diff --git a/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C b/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C index ad182a51e3d0a6e1970ffa5e97d62429fda31aa5..53913abaef6bd185ca733ddb34f6a27570e26870 100644 --- a/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C +++ b/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016 OpenFOAM Foundation @@ -82,12 +82,12 @@ Foam::autoPtr<Foam::RBD::rigidBody> Foam::RBD::rigidBody::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown rigidBody type " - << bodyType << nl << nl - << "Valid rigidBody types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "rigidBody", + bodyType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<rigidBody>(cstrIter()(name, dict)); diff --git a/src/rigidBodyDynamics/joints/joint/joint.C b/src/rigidBodyDynamics/joints/joint/joint.C index f641b30242ab3e62558fcc0260ea00a75244abb9..781eb22aa56ea6fcb809773be4ce0b9fdffaf73c 100644 --- a/src/rigidBodyDynamics/joints/joint/joint.C +++ b/src/rigidBodyDynamics/joints/joint/joint.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016 OpenFOAM Foundation @@ -59,12 +59,12 @@ Foam::autoPtr<Foam::RBD::joint> Foam::RBD::joint::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown joint type " - << bodyType << nl << nl - << "Valid joint types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "joint", + bodyType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<joint>(cstrIter()(dict)); diff --git a/src/rigidBodyDynamics/restraints/restraint/rigidBodyRestraintNew.C b/src/rigidBodyDynamics/restraints/restraint/rigidBodyRestraintNew.C index cc93089a9bf4194c579afdc0135df86191f68c85..c00a883128b3fea885c4cd50edb1249c12f813f1 100644 --- a/src/rigidBodyDynamics/restraints/restraint/rigidBodyRestraintNew.C +++ b/src/rigidBodyDynamics/restraints/restraint/rigidBodyRestraintNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016 OpenFOAM Foundation @@ -43,12 +43,12 @@ Foam::RBD::restraint::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown restraint type " - << restraintType << nl << nl - << "Valid restraint types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "restraint", + restraintType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<restraint>(cstrIter()(name, dict, model)); diff --git a/src/rigidBodyDynamics/rigidBodySolvers/rigidBodySolver/newRigidBodySolver.C b/src/rigidBodyDynamics/rigidBodySolvers/rigidBodySolver/newRigidBodySolver.C index 890293f757cd8ab8a46b4254410a29b9102cd9ac..e7bb67529ab1ed0ef720e8d1e25863e2ac57b183 100644 --- a/src/rigidBodyDynamics/rigidBodySolvers/rigidBodySolver/newRigidBodySolver.C +++ b/src/rigidBodyDynamics/rigidBodySolvers/rigidBodySolver/newRigidBodySolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016 OpenFOAM Foundation @@ -43,12 +43,12 @@ Foam::autoPtr<Foam::RBD::rigidBodySolver> Foam::RBD::rigidBodySolver::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown rigidBodySolverType type " - << solverType << nl << nl - << "Valid rigidBodySolver types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "rigidBodySolverType", + solverType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(body, dict); diff --git a/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethodNew.C b/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethodNew.C index c6990003f4681dd7563190ec5065732eb3608b28..5a367dc50521a9b074a8b303f385dd0fe1cfa999 100644 --- a/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethodNew.C +++ b/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethodNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2015 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::autoPtr<Foam::meshToMeshMethod> Foam::meshToMeshMethod::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown meshToMesh type " - << methodName << nl << nl - << "Valid meshToMesh types :" << nl - << componentsConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "meshToMesh", + methodName, + *componentsConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<meshToMeshMethod>(cstrIter()(src, tgt)); diff --git a/src/sampling/sampledSet/sampledSet/sampledSet.C b/src/sampling/sampledSet/sampledSet/sampledSet.C index 714d050ea8f109fb9adaa05f9486d0d7fc0a9d3d..80d74fb4004ac9c63392e850f72769037ca72043 100644 --- a/src/sampling/sampledSet/sampledSet/sampledSet.C +++ b/src/sampling/sampledSet/sampledSet/sampledSet.C @@ -531,12 +531,12 @@ Foam::autoPtr<Foam::sampledSet> Foam::sampledSet::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown sample type " - << sampleType << nl << nl - << "Valid sample types : " << nl - << wordConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "sample", + sampleType, + *wordConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<sampledSet> diff --git a/src/sampling/sampledSurface/readers/surfaceReaderNew.C b/src/sampling/sampledSurface/readers/surfaceReaderNew.C index 53be1c7a0e7eef8cf70452c1d0f9e3a1f51a2bf1..de3955af0efd09618bfceeb1cf172979868c71e6 100644 --- a/src/sampling/sampledSurface/readers/surfaceReaderNew.C +++ b/src/sampling/sampledSurface/readers/surfaceReaderNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,11 +37,12 @@ Foam::autoPtr<Foam::surfaceReader> Foam::surfaceReader::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown reader type \"" << readerType << "\"\n\n" - << "Valid reader types: " - << fileNameConstructorTablePtr_->sortedToc() << nl - << exit(FatalError); + FatalErrorInLookup + ( + "reader", + readerType, + *fileNameConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<surfaceReader>(cstrIter()(fName)); diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C index ebb5048e53a3ee5a6bb1f1cca183631085b69cf7..ba08c015fa96f5a4789d9726225caa9f643e043b 100644 --- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C +++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C @@ -75,12 +75,12 @@ Foam::autoPtr<Foam::sampledSurface> Foam::sampledSurface::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown sample type " - << sampleType << nl << nl - << "Valid sample types :" << endl - << wordConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "sample", + sampleType, + *wordConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<sampledSurface>(cstrIter()(name, mesh, dict)); diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C index e85e4a2db1d07831ea70899f1f117dac4310c4dc..e60e072ec1be95d522ba594610daa9687094c13b 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -39,19 +39,19 @@ Foam::sixDoFRigidBodyMotionConstraint::New { const word constraintType ( - sDoFRBMCDict.lookup("sixDoFRigidBodyMotionConstraint") + sDoFRBMCDict.get<word>("sixDoFRigidBodyMotionConstraint") ); auto cstrIter = dictionaryConstructorTablePtr_->cfind(constraintType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown sixDoFRigidBodyMotionConstraint type " - << constraintType << nl << nl - << "Valid sixDoFRigidBodyMotionConstraint types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "sixDoFRigidBodyMotionConstraint", + constraintType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<sixDoFRigidBodyMotionConstraint> diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C index 0b9d5670b277a78e981558d22aa5097b8cd5163e..c5db5256e4a9e556243d343947678c81667c05e8 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::sixDoFRigidBodyMotionRestraint::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown sixDoFRigidBodyMotionRestraint type " - << restraintType << nl << nl - << "Valid sixDoFRigidBodyMotionRestraint types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "sixDoFRigidBodyMotionRestraint", + restraintType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<sixDoFRigidBodyMotionRestraint> diff --git a/src/sixDoFRigidBodyMotion/sixDoFSolvers/sixDoFSolver/newSixDoFSolver.C b/src/sixDoFRigidBodyMotion/sixDoFSolvers/sixDoFSolver/newSixDoFSolver.C index f292c3b27515cb5aeedf708b69ad64af54f39742..3516b8b8c1328e986f9de87d20b1c4d6c1acb9fd 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFSolvers/sixDoFSolver/newSixDoFSolver.C +++ b/src/sixDoFRigidBodyMotion/sixDoFSolvers/sixDoFSolver/newSixDoFSolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2015 OpenFOAM Foundation @@ -43,12 +43,12 @@ Foam::autoPtr<Foam::sixDoFSolver> Foam::sixDoFSolver::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown sixDoFSolver type " - << solverType << nl << nl - << "Valid sixDoFSolver types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "sixDoFSolver", + solverType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, body); diff --git a/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C b/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C index 77173c09257851763226398ca0a97c82616bc4bc..24c4ab3f7585e8dd3c5d22cf643f6d24051ff94a 100644 --- a/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C +++ b/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -48,12 +48,12 @@ Foam::barotropicCompressibilityModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown barotropicCompressibilityModel type " - << modelType << nl << nl - << "Valid barotropicCompressibilityModel types : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "barotropicCompressibilityModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<barotropicCompressibilityModel> diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C b/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C index 19db3c6476de24ac4f9f720d9922ca204bf723c8..1f880533ebf66b98bc516818a56744b12df78fea 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2017 OpenFOAM Foundation @@ -39,6 +39,8 @@ typename Table::iterator Foam::basicThermo::lookupThermo ) { // Lookup the thermo package + + // Table iterator, not const_iterator auto cstrIter = tablePtr->find(thermoTypeName); // Print error message if package not found in the table @@ -181,16 +183,17 @@ typename Table::iterator Foam::basicThermo::lookupThermo Info<< "Selecting thermodynamics package " << thermoTypeName << endl; + // Table iterator, not const_iterator auto cstrIter = tablePtr->find(thermoTypeName); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown " << Thermo::typeName << " type " - << thermoTypeName << nl << nl - << "Valid " << Thermo::typeName << " types are:" << nl - << tablePtr->sortedToc() << nl - << exit(FatalError); + FatalErrorInLookup + ( + Thermo::typeName, + thermoTypeName, + *tablePtr + ) << exit(FatalError); } return cstrIter; diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C index c285df3dd778c410ece0223eddb7cdfc85a48027..fef6fb5b6baca695d0fe5a1f3c3eec508b71d0df 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C @@ -45,7 +45,7 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New thermo.db(), IOobject::MUST_READ, IOobject::NO_WRITE, - false + false // Do not register ) ); diff --git a/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C b/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C index b14970fe2143017b035b21e1d64770dab832bb75..eceff0ae9561e4f0384b33d19aea98447dd11afa 100644 --- a/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C +++ b/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -34,7 +34,6 @@ Foam::autoPtr<Foam::laminarFlameSpeed> Foam::laminarFlameSpeed::New const psiuReactionThermo& ct ) { - // do not register the dictionary IOdictionary propDict ( IOobject @@ -44,7 +43,7 @@ Foam::autoPtr<Foam::laminarFlameSpeed> Foam::laminarFlameSpeed::New ct.T().db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) ); @@ -56,12 +55,13 @@ Foam::autoPtr<Foam::laminarFlameSpeed> Foam::laminarFlameSpeed::New if (!cstrIter.found()) { - FatalIOErrorInFunction(propDict) - << "Unknown laminarFlameSpeed type " - << modelType << nl << nl - << "Valid laminarFlameSpeed types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + propDict, + "laminarFlameSpeedCorrelation", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<laminarFlameSpeed>(cstrIter()(propDict, ct)); diff --git a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModelNew.C b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModelNew.C index 08006ea28348bb1e1486271357ace16eeb66b70b..d8acd0c47e9cad5768de3d877c3d281adc20de1f 100644 --- a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModelNew.C +++ b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -43,7 +43,7 @@ Foam::radiation::radiationModel::New T.mesh(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ); word modelType("none"); @@ -63,12 +63,12 @@ Foam::radiation::radiationModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown radiationModel type " - << modelType << nl << nl - << "Valid radiationModel types :" << nl - << TConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "radiationModel", + modelType, + *TConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<radiationModel>(cstrIter()(T)); @@ -90,12 +90,12 @@ Foam::radiation::radiationModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown radiationModel type " - << modelType << nl << nl - << "Valid radiationModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "radiationModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<radiationModel>(cstrIter()(dict, T)); diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C index c9f16793e497e176da64cc10bf18c626c7e0787d..7efc5947ff53c2902eab479786806b570e3a3bec 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::radiation::absorptionEmissionModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown absorptionEmissionModel type " - << modelType << nl << nl - << "Valid absorptionEmissionModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "absorptionEmissionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<absorptionEmissionModel>(cstrIter()(dict, mesh)); diff --git a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C index e96f92639398ad46567d8c42e165a16ec81bc11f..90d03b13ecfd1c472fdfacc2726d9be3528e3465 100644 --- a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C +++ b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C @@ -60,12 +60,12 @@ Foam::radiation::boundaryRadiationPropertiesPatch::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown modelType type " - << modelType << nl << nl - << "Valid radiation types are : " << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "radiationModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(dict, pp); diff --git a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C b/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C index a7aa25bdbc1b485acaf3bd0e42ae2175ba14d20f..159fba4086b1fc202f6ed677546eb07801bb3da3 100644 --- a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -44,12 +44,12 @@ Foam::autoPtr<Foam::radiation::scatterModel> Foam::radiation::scatterModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown scatterModel type " - << modelType << nl << nl - << "Valid scatterModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "scatterModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<scatterModel>(cstrIter()(dict, mesh)); diff --git a/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C b/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C index 03c460e7e42d4302cb9f525e721dfeff442dc30b..640e4deb0e9aaa873fcf5deb0cc666e953c4b841 100644 --- a/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2013-2015 OpenFOAM Foundation @@ -48,12 +48,12 @@ Foam::radiation::sootModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown sootModel type " - << modelType << nl << nl - << "Valid sootModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "sootModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } const word className = modelType.substr(0, modelType.find('<')); diff --git a/src/thermophysicalModels/radiation/submodels/wallAbsorptionEmissionModel/wallAbsorptionEmissionModel/wallAbsorptionEmissionModelNew.C b/src/thermophysicalModels/radiation/submodels/wallAbsorptionEmissionModel/wallAbsorptionEmissionModel/wallAbsorptionEmissionModelNew.C index 9e609ce72a45310a14645c8ecac239bc7ecc6a57..49f24fc88d8d6489b684ad1cd7a99ae132d560e8 100644 --- a/src/thermophysicalModels/radiation/submodels/wallAbsorptionEmissionModel/wallAbsorptionEmissionModel/wallAbsorptionEmissionModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/wallAbsorptionEmissionModel/wallAbsorptionEmissionModel/wallAbsorptionEmissionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,16 +37,16 @@ wallAbsorptionEmissionModel::New { const word modelType(dict.get<word>("type")); - auto cstrIter = dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown wallAbsorptionEmissionModel type " - << modelType << nl << nl - << "Valid wallAbsorptionEmissionModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "wallAbsorptionEmissionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<wallAbsorptionEmissionModel>(cstrIter()(dict, pp)); diff --git a/src/thermophysicalModels/radiation/submodels/wallTransmissivityModel/wallTransmissivityModel/wallTransmissivityModelNew.C b/src/thermophysicalModels/radiation/submodels/wallTransmissivityModel/wallTransmissivityModel/wallTransmissivityModelNew.C index 9588920a8a760ff5c48094881df65832d57fcabd..699820a606e1f4645cf5aa3b57c3bba3eab2598c 100644 --- a/src/thermophysicalModels/radiation/submodels/wallTransmissivityModel/wallTransmissivityModel/wallTransmissivityModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/wallTransmissivityModel/wallTransmissivityModel/wallTransmissivityModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,12 +41,12 @@ wallTransmissivityModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown wallTransmissivityModel type " - << modelType << nl << nl - << "Valid wallTransmissivityModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "wallTransmissivityModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<wallTransmissivityModel>(cstrIter()(dict, pp)); diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C index 5aa77461f5c9ae12b9968c5995d898d0b1fa1066..33553971f0611d84db8761d2c4d6d6e53ae319e6 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -49,12 +49,12 @@ Foam::chemistryReader<ThermoType>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown chemistryReader type " - << readerName << nl << nl - << "Valid chemistryReader types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "chemistryReader", + readerName, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<chemistryReader<ThermoType>> diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C index b9fc371eca6e3d18cdf6ab225902a3806792f9e1..d8fbc532795cf05acac5e95f1b5f1768df3a95c5 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C @@ -361,12 +361,12 @@ Foam::Reaction<ReactionThermo>::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown reaction type " - << reactionTypeName << nl << nl - << "Valid reaction types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "reaction", + reactionTypeName, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<Reaction<ReactionThermo>> diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C index 9ddbbea6b8f5f8ff1cdb634ba0fa1466454d6a90..0fee3bc567816a70e80d56fa3e95edda64bba540 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -100,12 +100,12 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown liquidProperties type " - << name << nl << nl - << "Valid liquidProperties types :" << nl - << ConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "liquidProperties", + name, + *ConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<liquidProperties>(cstrIter()()); @@ -137,12 +137,12 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown liquidProperties type " - << liquidType << nl << nl - << "Valid liquidProperties types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "liquidProperties", + liquidType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<liquidProperties> @@ -158,12 +158,12 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown liquidProperties type " - << liquidType << nl << nl - << "Valid liquidProperties types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "liquidProperties", + liquidType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<liquidProperties>(cstrIter()(dict)); diff --git a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C index 88d208cbf0875e301e441b699fc8ab46acbf97cc..289db76b5eac01015d4539887c3fee86e15be0e6 100644 --- a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C +++ b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -35,21 +35,18 @@ Foam::autoPtr<Foam::solidProperties> Foam::solidProperties::New const word& name ) { - if (debug) - { - InfoInFunction << "Constructing solidProperties" << endl; - } + DebugInFunction << "Constructing solidProperties" << endl; auto cstrIter = ConstructorTablePtr_->cfind(name); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown solidProperties type " - << name << nl << nl - << "Valid solidProperties types :" << nl - << ConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "solidProperties", + name, + *ConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<solidProperties>(cstrIter()()); @@ -61,10 +58,7 @@ Foam::autoPtr<Foam::solidProperties> Foam::solidProperties::New const dictionary& dict ) { - if (debug) - { - InfoInFunction << "Constructing solid" << endl; - } + DebugInFunction << "Constructing solid" << endl; const word solidType(dict.dictName()); @@ -87,12 +81,12 @@ Foam::autoPtr<Foam::solidProperties> Foam::solidProperties::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown solidProperties type " - << solidType << nl << nl - << "Valid solidProperties types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "solidProperties", + solidType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<solidProperties>(cstrIter()(dict)); diff --git a/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C b/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C index 3508fa63f0a30747c8dd530c2d6321eb62511746..edee7d0bcf19ad50635cc4f3f368170d310e8ba4 100644 --- a/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C +++ b/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,7 @@ Foam::autoPtr<Foam::thermophysicalFunction> Foam::thermophysicalFunction::New Istream& is ) { - if (debug) - { - InfoInFunction - << "Constructing thermophysicalFunction" - << endl; - } + DebugInFunction << "Constructing thermophysicalFunction" << endl; const word functionType(is); @@ -58,12 +53,12 @@ Foam::autoPtr<Foam::thermophysicalFunction> Foam::thermophysicalFunction::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown thermophysicalFunction type " - << functionType << nl << nl - << "Valid thermophysicalFunction types :" << endl - << IstreamConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "thermophysicalFunction", + functionType, + *IstreamConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<thermophysicalFunction>(cstrIter()(is)); @@ -75,12 +70,7 @@ Foam::autoPtr<Foam::thermophysicalFunction> Foam::thermophysicalFunction::New const dictionary& dict ) { - if (debug) - { - InfoInFunction - << "Constructing thermophysicalFunction" - << endl; - } + DebugInFunction << "Constructing thermophysicalFunction" << endl; const word functionType(dict.get<word>("functionType")); @@ -88,12 +78,12 @@ Foam::autoPtr<Foam::thermophysicalFunction> Foam::thermophysicalFunction::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown thermophysicalFunction type " - << functionType << nl << nl - << "Valid thermophysicalFunction types are :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInLookup + ( + "thermophysicalFunction", + functionType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalError); } return autoPtr<thermophysicalFunction>(cstrIter()(dict)); diff --git a/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.C b/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.C index 7be89d28281b33e496ccc59ce9fc496d2ff7b1c7..c70560c09d2014715fff58c39c5f3af760763245 100644 --- a/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.C +++ b/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2017 OpenFOAM Foundation @@ -58,21 +58,18 @@ Foam::thermophysicalProperties::New const word& name ) { - if (debug) - { - InfoInFunction << "Constructing thermophysicalProperties" << endl; - } + DebugInFunction << "Constructing thermophysicalProperties" << endl; auto cstrIter = ConstructorTablePtr_->cfind(name); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown thermophysicalProperties type " - << name << nl << nl - << "Valid thermophysicalProperties types are:" << nl - << ConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "thermophysicalProperties", + name, + *ConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<thermophysicalProperties>(cstrIter()()); @@ -85,23 +82,20 @@ Foam::thermophysicalProperties::New const dictionary& dict ) { - if (debug) - { - InfoInFunction << "Constructing thermophysicalProperties" << endl; - } + DebugInFunction << "Constructing thermophysicalProperties" << endl; - const word& propertiesTypeName = dict.dictName(); + const word& modelType = dict.dictName(); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(propertiesTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown thermophysicalProperties type " - << propertiesTypeName << nl << nl - << "Valid thermophysicalProperties types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "thermophysicalProperties", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<thermophysicalProperties>(cstrIter()(dict)); diff --git a/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C b/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C index b46119cb0184c487c649ee6f8ca437e68325ed97..6f29ce3b895742082a13a3895652ae450eac44b8 100644 --- a/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C +++ b/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -47,12 +47,12 @@ Foam::autoPtr<Foam::viscosityModel> Foam::viscosityModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown viscosityModel type " - << modelType << nl << nl - << "Valid viscosityModels :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "viscosityModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return autoPtr<viscosityModel> diff --git a/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C b/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C index 67df8628de70c92ba5b7c9f916b9fe5c0ebef99d..a4a6dc75bdd4ef5e26f48232e6c5b599a8a0b25b 100644 --- a/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C +++ b/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2017 OpenFOAM Foundation @@ -48,12 +48,12 @@ Foam::autoPtr<Foam::surfaceTensionModel> Foam::surfaceTensionModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown surfaceTensionModel type " - << modelType << nl << nl - << "Valid surfaceTensionModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalErrorInLookup + ( + "surfaceTensionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalError); } return cstrIter()(sigmaDict, mesh); diff --git a/src/waveModels/waveModel/waveModelNew.C b/src/waveModels/waveModel/waveModelNew.C index 6c07dc29b778243c6f18d925ea6018da3b157eac..55240bcc116bc0a67eb919bb39f06649def3d226 100644 --- a/src/waveModels/waveModel/waveModelNew.C +++ b/src/waveModels/waveModel/waveModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2015 IH-Cantabria @@ -68,12 +68,13 @@ Foam::autoPtr<Foam::waveModel> Foam::waveModel::New if (!cstrIter.found()) { - FatalIOErrorInFunction(waveDict) - << "Unknown waveModel type " - << modelType << nl << nl - << "Valid waveModel types :" << nl - << patchConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + FatalIOErrorInLookup + ( + waveDict, + "waveModel", + modelType, + *patchConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr<waveModel>(cstrIter()(patchDict, mesh, patch));