diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C index 9f5575973a..7e3e0050f3 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -46,12 +46,12 @@ Foam::autoPtr 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 diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C index 3a41f4b8c1..1a5c8c6a5b 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::autoPtr 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(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 def35f6ab0..a80cca32e5 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::autoPtr 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(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 b83b952eff..edfad3536c 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -48,12 +48,12 @@ Foam::autoPtr 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 diff --git a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C index 9eda304cbc..68dbbcc308 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::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 diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C index 50271ea232..752e101917 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::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 8ce843c377..a228ebb335 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(cstrIter()(dict, mesh)); diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/massTransferModels/interfaceCompositionModel/interfaceCompositionModelNew.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/massTransferModels/interfaceCompositionModel/interfaceCompositionModelNew.C index c280808dca..7b2d53398b 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("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 6262976365..c543ccb3f4 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::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 653f0baae6..88b8ec9a5d 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::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 34aa5e2e41..53368ea105 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::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 05367b6fec..2d31a1211e 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::New const fvMesh& mesh ) { - const word multiphaseSystemType + const word systemType ( IOdictionary ( @@ -48,22 +48,21 @@ Foam::autoPtr Foam::multiphaseSystem::New ).get("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 (cstrIter()(mesh)); + return autoPtr(cstrIter()(mesh)); } diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C index 6169ab62f4..a337a03a1a 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("phaseChangeTwoPhaseModel") + IOdictionary + ( + IOobject + ( + "phaseChangeProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false // Do not register + ) + ).get("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 - (cstrIter()(thermo, mesh)); + return + autoPtr + ( + cstrIter()(thermo, mesh) + ); } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C index 7ae264ca7e..43f8c8ce72 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 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("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(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 af421f1a15..7f44ef980d 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::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 c6d839103c..8ca8fddd58 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::New { const word modelType ( - interfaceDict.lookup("heatTransferModel" + phase1.name()) + interfaceDict.get("heatTransferModel" + phase1.name()) ); Info<< "Selecting heatTransferModel for phase " @@ -51,12 +51,12 @@ Foam::autoPtr 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 fd0ca095ef..1961dd8759 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::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 a2f793811a..e1db0a4e5d 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 606cfb0f5c..6ce2f952d4 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 ef06f546ac..2425f7a0cc 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::autoPtr 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 da0ad3cfc4..47951c5cc4 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::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 08f943e81b..03cc716499 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::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 927f482065..bc159a37b5 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 cfae8c139b..36517c284f 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 50b07d1926..ce1c07d5d3 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::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 fe63158268..e41854b98f 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::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 43ae3eb16c..dccdf6e14e 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(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 da1414d7e2..58f24c8c1a 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(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 e8207d1d39..599cd01541 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(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 c2c7bfd2e8..3df0d16c53 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(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 e9d91e947c..dc0817013e 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("viscosityModel")); + const word modelType(dict.get("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(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 b28331ada7..b94e892fe9 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::New const wordList& phaseNames ) { - const word methodName(dict.get("type")); + const word modelType(dict.get("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 445a3a6b38..dfc5d502c0 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(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 fd0ca095ef..1961dd8759 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::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 a0f4cb9c69..7bc8d847ba 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 + dict.lookupOrDefault ( "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("type")); + const word modelType(dict.get("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 @@ -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 c88fb2418c..f9a5979099 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 | Copyright (C) 2009-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2017 OpenFOAM Foundation @@ -123,37 +123,33 @@ Foam::cellSizeFunction::cellSizeFunction Foam::autoPtr Foam::cellSizeFunction::New ( - const dictionary& cellSizeFunctionDict, + const dictionary& dict, const searchableSurface& surface, const scalar& defaultCellSize, const labelList regionIndices ) { - const word functionName - ( - cellSizeFunctionDict.get("cellSizeFunction") - ); + const word modelType(dict.get("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 ( 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 694b852d6b..586a53cbc1 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::New ( - const dictionary& cellSizeCalculationTypeDict, + const dictionary& dict, const triSurfaceMesh& surface, const scalar& defaultCellSize ) { - const word calculationType - ( - cellSizeCalculationTypeDict.get("cellSizeCalculationType") - ); + const word modelType(dict.get("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 ( - 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 e1ce94ba8e..2e9e39567b 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::New ( - const dictionary& surfaceCellSizeFunctionDict, + const dictionary& dict, const searchableSurface& surface, const scalar& defaultCellSize ) { - const word functionName + const word modelType ( - surfaceCellSizeFunctionDict.get("surfaceCellSizeFunction") + dict.get("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 ( - 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 9ee3b07dfd..311bbeceaf 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 | Copyright (C) 2009-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2017 OpenFOAM Foundation @@ -64,12 +64,12 @@ Foam::autoPtr 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(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 c2adf2706f..d321ce3225 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 | Copyright (C) 2009-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2017 OpenFOAM Foundation @@ -79,21 +79,20 @@ Foam::autoPtr Foam::initialPointsMethod::New const autoPtr& decomposition ) { - const word methodName(initialPointsDict.get("initialPointsMethod")); + const word modelType(initialPointsDict.get("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 d3c8324b2f..34338ecf51 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 | Copyright (C) 2009-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2012-2017 OpenFOAM Foundation @@ -68,12 +68,12 @@ Foam::autoPtr 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(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 c8717c00b7..1f041a1953 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(cstrIter()(surface, dict)); diff --git a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C index d62617c67b..a2ce411a90 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::New const dictionary& dict ) { - const word sampleType(dict.get("type")); + const word modelType(dict.get("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(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 3a6477ac81..f4a1b5d301 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 | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010, 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(cstrIter()(dict, mesh)); diff --git a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C index 7daae79047..f7878f5d1f 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("extractionMethod")); + const word modelType(dict.get("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(cstrIter.val()(dict)); diff --git a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C index 1ceebe07ca..f2d232b885 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(cstrIter()(geometry, dict)); diff --git a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C index 8aefa03888..4fa3e770a8 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -42,12 +42,12 @@ Foam::autoPtr 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(cstrIter()(odes, dict)); diff --git a/src/OpenFOAM/db/IOstreams/token/token.C b/src/OpenFOAM/db/IOstreams/token/token.C index 14f9606373..518fe86d57 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) 2004-2011, 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011, 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -62,12 +62,13 @@ Foam::autoPtr 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(cstrIter()(is)); diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index a22661d90f..fd831eb7f0 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) 2009-2011, 2017-2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011, 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -112,12 +112,12 @@ Foam::autoPtr 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(cstrIter()(name, runTime, dict)); diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C index e00c28198c..fd2bc09aad 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -36,21 +36,18 @@ Foam::autoPtr> Foam::pointPatchField::New const DimensionedField& iF ) { - if (debug) - { - InfoInFunction << "Constructing pointPatchField" << endl; - } + DebugInFunction << "Constructing pointPatchField" << 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> pfPtr(cstrIter()(p, iF)); @@ -111,10 +108,7 @@ Foam::autoPtr> Foam::pointPatchField::New const dictionary& dict ) { - if (debug) - { - InfoInFunction << "Constructing pointPatchField" << endl; - } + DebugInFunction << "Constructing pointPatchField" << endl; const word patchFieldType(dict.get("type")); @@ -184,21 +178,18 @@ Foam::autoPtr> Foam::pointPatchField::New const pointPatchFieldMapper& pfMapper ) { - if (debug) - { - InfoInFunction << "Constructing pointPatchField" << endl; - } + DebugInFunction << "Constructing pointPatchField" << 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 6611940880..6faced8087 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::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(cstrIter()(verbose)); diff --git a/src/OpenFOAM/global/fileOperations/fileOperationInitialise/fileOperationInitialise.C b/src/OpenFOAM/global/fileOperations/fileOperationInitialise/fileOperationInitialise.C index aaf0e656a6..7d8cc60039 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(cstrIter()(argc, argv)); diff --git a/src/OpenFOAM/graph/graph.C b/src/OpenFOAM/graph/graph.C index 27d6a40d61..9a503ad295 100644 --- a/src/OpenFOAM/graph/graph.C +++ b/src/OpenFOAM/graph/graph.C @@ -222,12 +222,12 @@ Foam::autoPtr 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(cstrIter()()); diff --git a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C index bcb7a54850..b97bd57e99 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 | Copyright (C) 2011-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,12 +45,12 @@ Foam::autoPtr> Foam::tableReader::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>(cstrIter()(spec)); diff --git a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C index cb6fa4db59..efef355470 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::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(cstrIter()(samples)); diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C index 7905e04094..55193f7a61 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::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::preconditioner> @@ -73,12 +74,13 @@ Foam::LduMatrix::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::preconditioner> diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C index 74b9ccbc88..2e34bce3fc 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::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::smoother> @@ -69,12 +70,13 @@ Foam::LduMatrix::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::smoother> diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C index 2426d57ecd..cfc0d96633 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::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::solver> @@ -83,12 +84,13 @@ Foam::LduMatrix::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::solver> diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C index 0f54d84063..115d3132be 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 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 @@ -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 diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C index 5a67b4b776..4ac4e68770 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -96,12 +96,13 @@ Foam::autoPtr 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 @@ -122,12 +123,13 @@ Foam::autoPtr 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 diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C index 1de274d98b..8df5387ce8 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::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 @@ -99,11 +101,13 @@ Foam::autoPtr 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 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 8f67d266c8..b9dd883a6c 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::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 3b82f1cc2c..8d62e600fc 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -41,12 +41,12 @@ Foam::autoPtr 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(cstrIter()(GAMGCp, fineInterface)); @@ -66,12 +66,12 @@ Foam::autoPtr 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(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 f3449cfef8..4ef806e7a7 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -49,11 +49,12 @@ Foam::autoPtr 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 @@ -84,11 +85,12 @@ Foam::autoPtr 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(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 9ea12134cc..55c516ad53 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -35,21 +35,18 @@ Foam::autoPtr 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(cstrIter()(patch, bm)); diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C index 001378c317..0322cdb67e 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -40,21 +40,18 @@ Foam::autoPtr 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 @@ -80,10 +77,7 @@ Foam::autoPtr Foam::polyPatch::New const polyBoundaryMesh& bm ) { - if (debug) - { - InfoInFunction << "Constructing polyPatch" << endl; - } + DebugInFunction << "Constructing polyPatch" << endl; word patchType(dict.get("type")); dict.readIfPresent("geometricType", patchType); @@ -101,10 +95,7 @@ Foam::autoPtr 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::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 42576953fe..f3d5c83a27 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -38,10 +38,7 @@ Foam::autoPtr Foam::cellZone::New const cellZoneMesh& zm ) { - if (debug) - { - InfoInFunction << "Constructing cellZone " << name << endl; - } + DebugInFunction << "Constructing cellZone " << name << endl; const word zoneType(dict.get("type")); @@ -49,12 +46,13 @@ Foam::autoPtr 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(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 76b5580474..e1d5bd2c75 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -38,10 +38,7 @@ Foam::autoPtr Foam::faceZone::New const faceZoneMesh& zm ) { - if (debug) - { - InfoInFunction << "Constructing faceZone " << name << endl; - } + DebugInFunction << "Constructing faceZone " << name << endl; const word zoneType(dict.get("type")); @@ -49,12 +46,13 @@ Foam::autoPtr 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(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 dbec8c5565..8ae67bdb55 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -38,10 +38,7 @@ Foam::autoPtr Foam::pointZone::New const pointZoneMesh& zm ) { - if (debug) - { - InfoInFunction << "Constructing pointZone " << name << endl; - } + DebugInFunction << "Constructing pointZone " << name << endl; const word zoneType(dict.get("type")); @@ -49,12 +46,13 @@ Foam::autoPtr 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(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 1fa65b93c5..890983a8ca 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::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::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 4da23366f6..5f4815fbfd 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C @@ -135,8 +135,6 @@ Foam::LESModel::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::New U.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) ).subDict("LES").get("LESModel") ); @@ -159,12 +157,12 @@ Foam::LESModel::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 diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C index 3957598496..2758eb5a57 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -80,12 +80,12 @@ Foam::autoPtr 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(cstrIter()(name, turbulence, dict)); @@ -119,13 +119,13 @@ Foam::autoPtr 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 8abc1e8064..211a826240 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -52,12 +52,12 @@ Foam::autoPtr 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(cstrIter()(mesh, dict)); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C b/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C index 298cc18daf..47b05d9978 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C @@ -125,8 +125,6 @@ Foam::RASModel::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::New U.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) ).subDict("RAS").get("RASModel") ); @@ -149,12 +147,12 @@ Foam::RASModel::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 diff --git a/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C b/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C index 1b88a1d080..81e9040aa1 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::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::New U.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) ).get("simulationType") ); @@ -111,12 +109,12 @@ Foam::TurbulenceModel::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 diff --git a/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C b/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C index 150114677e..a2ece6cf6b 100644 --- a/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C +++ b/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C @@ -101,14 +101,12 @@ Foam::laminarModel::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("laminarModel") @@ -120,12 +118,12 @@ Foam::laminarModel::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 diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C index 27d9e6884c..114aae997c 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 | Copyright (C) 2011-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -48,12 +48,13 @@ Foam::autoPtr 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 d9c48350c6..68420f2e7b 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 | Copyright (C) 2004-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -46,7 +46,7 @@ Foam::autoPtr Foam::dynamicFvMesh::New(const IOobject& io) io.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ); if (dictHeader.typeHeaderOk(true)) @@ -75,12 +75,13 @@ Foam::autoPtr 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(cstrIter()(io)); diff --git a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C index 9b30fcb8b4..65108dfacd 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -51,12 +51,12 @@ Foam::autoPtr 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(cstrIter()(mesh)); diff --git a/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C b/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C index c5ed6a1c26..85318e2324 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 diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C index bd69e6d60b..a422aca2de 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -43,12 +43,12 @@ Foam::autoPtr 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(cstrIter()(SBMFCoeffs, runTime)); diff --git a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C index 34388b3d14..5b4dd68c13 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 | Copyright (C) 2004-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -134,12 +134,12 @@ Foam::autoPtr 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(cstrIter()(mesh, solverDict)); diff --git a/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C b/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C index 0a52da0f0d..c10f84e457 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -38,23 +38,21 @@ Foam::autoPtr Foam::polyMeshModifier::New const polyTopoChanger& mme ) { - if (debug) - { - InfoInFunction << "Constructing polyMeshModifier" << endl; - } + DebugInFunction << "Constructing polyMeshModifier" << endl; - const word modifierType(dict.get("type")); + const word modelType(dict.get("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(cstrIter()(name, dict, index, mme)); diff --git a/src/engine/engineMesh/engineMesh/engineMeshNew.C b/src/engine/engineMesh/engineMesh/engineMeshNew.C index 596dbe212c..c7096ffcb7 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -35,8 +35,6 @@ Foam::autoPtr 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::New io.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) - ).lookup("engineMesh") + ).get("engineMesh") ); Info<< "Selecting engineMesh " << modelType << endl; @@ -59,12 +57,12 @@ Foam::autoPtr 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(cstrIter()(io)); diff --git a/src/engine/engineTime/engineTime/engineTimeNew.C b/src/engine/engineTime/engineTime/engineTimeNew.C index 43d69ab689..3bd829ed26 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::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 diff --git a/src/fileFormats/sampledSetWriters/writer.C b/src/fileFormats/sampledSetWriters/writer.C index e258c24cc8..4f705fbe2c 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 | Copyright (C) 2004-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -42,12 +42,12 @@ Foam::autoPtr> Foam::writer::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>(cstrIter()()); diff --git a/src/finiteArea/faMesh/faPatches/faPatch/faPatchNew.C b/src/finiteArea/faMesh/faPatches/faPatch/faPatchNew.C index 6b0e99d3f6..78639882c1 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::New const faBoundaryMesh& bm ) { - DebugInFunction - << "constructing faPatch" << endl; + DebugInFunction << "Constructing faPatch" << endl; const word patchType(dict.get("type")); @@ -47,11 +46,13 @@ Foam::autoPtr 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(cstrIter()(name, dict, index, bm)); diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFieldNew.C b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFieldNew.C index 7c73e7d235..b3bcfb4fa2 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::New const DimensionedField& iF ) { - DebugInFunction - << "constructing faPatchField" - << endl; + DebugInFunction << "Constructing faPatchField" << 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::New return cstrIter()(p, iF); } } - else - { - tmp> tfap = cstrIter()(p, iF); - // Check if constraint type override and store patchType if so - if (patchTypeCstrIter.found()) - { - tfap.ref().patchType() = actualPatchType; - } - return tfap; + + tmp> 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::New const dictionary& dict ) { - DebugInFunction - << "constructing faPatchField" - << endl; + DebugInFunction << "Constructing faPatchField" << endl; const word patchFieldType(dict.get("type")); @@ -152,19 +148,18 @@ Foam::tmp> Foam::faPatchField::New const faPatchFieldMapper& pfMapper ) { - DebugInFunction - << "constructing faPatchField" - << endl; + DebugInFunction << "Constructing faPatchField" << 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::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 7d021a03cb..7f0dbc6e08 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::New const DimensionedField& iF ) { - DebugInFunction - << "constructing faePatchField" - << 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::New const dictionary& dict ) { - DebugInFunction - << "constructing faePatchField" - << endl; + DebugInFunction << "Constructing faePatchField" << endl; const word patchFieldType(dict.get("type")); @@ -121,19 +118,18 @@ Foam::tmp> Foam::faePatchField::New const faPatchFieldMapper& pfMapper ) { - DebugInFunction - << "constructing faePatchField" - << endl; + DebugInFunction << "Constructing faePatchField" << 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::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 45a99e9051..168ceb43d5 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::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 c41a109465..bfafabf81b 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::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 3e5973a7dc..b960dca8e6 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::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 d9abced858..658350c943 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::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 0389565f55..ae31390027 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::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 5da31a8099..3d462df776 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::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 ffa1cabd23..36ba2e3ea9 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::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::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 334296e911..667909a16c 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::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::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 5f3f62221b..91c8848e36 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 | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2015 OpenFOAM Foundation @@ -34,8 +34,6 @@ Foam::autoPtr 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::New Urel.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) - ).lookup("SRFModel") + ).get("SRFModel") ); Info<< "Selecting SRFModel " << modelType << endl; @@ -58,12 +56,12 @@ Foam::autoPtr 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(cstrIter()(Urel)); diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C index d88d53f8a4..be27d1f8ac 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::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