diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C index 9f5575973a..0d67453ef8 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 @@ -31,14 +31,14 @@ License Foam::autoPtr Foam::PDRDragModel::New ( - const dictionary& PDRProperties, + const dictionary& dict, const compressible::RASModel& turbulence, const volScalarField& rho, const volVectorField& U, const surfaceScalarField& phi ) { - const word modelType(PDRProperties.get("PDRDragModel")); + const word modelType(dict.get("PDRDragModel")); Info<< "Selecting drag model " << modelType << endl; @@ -46,16 +46,17 @@ Foam::autoPtr Foam::PDRDragModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown PDRDragModel type " - << modelType << nl << nl - << "Valid PDRDragModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "PDRDragModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr - (cstrIter()(PDRProperties, turbulence, rho, U, phi)); + (cstrIter()(dict, turbulence, rho, U, phi)); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C index 3a41f4b8c1..177cec0b22 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 @@ -31,13 +31,13 @@ License Foam::autoPtr Foam::XiEqModel::New ( - const dictionary& propDict, + const dictionary& dict, const psiuReactionThermo& thermo, const compressible::RASModel& turbulence, const volScalarField& Su ) { - const word modelType(propDict.get("XiEqModel")); + const word modelType(dict.get("XiEqModel")); Info<< "Selecting flame-wrinkling model " << modelType << endl; @@ -45,15 +45,16 @@ Foam::autoPtr Foam::XiEqModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown XiEqModel type " - << modelType << nl << nl - << "Valid XiEqModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "XiEqModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } - return autoPtr(cstrIter()(propDict, thermo, turbulence, Su)); + return autoPtr(cstrIter()(dict, 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..d8e12bbc7f 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 @@ -31,13 +31,13 @@ License Foam::autoPtr Foam::XiGModel::New ( - const dictionary& propDict, + const dictionary& dict, const psiuReactionThermo& thermo, const compressible::RASModel& turbulence, const volScalarField& Su ) { - const word modelType(propDict.get("XiGModel")); + const word modelType(dict.get("XiGModel")); Info<< "Selecting flame-wrinkling model " << modelType << endl; @@ -45,15 +45,16 @@ Foam::autoPtr Foam::XiGModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown XiGModel type " - << modelType << nl << nl - << "Valid XiGModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "XiGModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } - return autoPtr(cstrIter()(propDict, thermo, turbulence, Su)); + return autoPtr(cstrIter()(dict, 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..7a4d6c7ae7 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 @@ -31,7 +31,7 @@ License Foam::autoPtr Foam::XiModel::New ( - const dictionary& propDict, + const dictionary& dict, const psiuReactionThermo& thermo, const compressible::RASModel& turbulence, const volScalarField& Su, @@ -40,7 +40,7 @@ Foam::autoPtr Foam::XiModel::New const surfaceScalarField& phi ) { - const word modelType(propDict.get("XiModel")); + const word modelType(dict.get("XiModel")); Info<< "Selecting flame-wrinkling model " << modelType << endl; @@ -48,16 +48,17 @@ Foam::autoPtr Foam::XiModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown XiModel type " - << modelType << nl << nl - << "Valid XiModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "XiModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr - (cstrIter()(propDict, thermo, turbulence, Su, rho, b, phi)); + (cstrIter()(dict, thermo, turbulence, Su, rho, b, phi)); } diff --git a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C index 9eda304cbc..956c2817ef 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 @@ -34,12 +34,12 @@ License Foam::autoPtr Foam::mixtureViscosityModel::New ( const word& name, - const dictionary& viscosityProperties, + const dictionary& dict, const volVectorField& U, const surfaceScalarField& phi ) { - const word modelType(viscosityProperties.get("transportModel")); + const word modelType(dict.get("transportModel")); Info<< "Selecting incompressible transport model " << modelType << endl; @@ -47,16 +47,17 @@ Foam::autoPtr Foam::mixtureViscosityModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown mixtureViscosityModel type " - << modelType << nl << nl - << "Valid mixtureViscosityModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "mixtureViscosityModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr - (cstrIter()(name, viscosityProperties, U, phi)); + (cstrIter()(name, dict, U, phi)); } diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C index 50271ea232..a9ca200ef4 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,13 @@ 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); + FatalIOErrorInLookup + ( + dict, + "relative velocity", + modelType, + *dictionaryConstructorTablePtr_ + ) << abort(FatalIOError); } 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..5826ee3781 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,19 @@ 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); + FatalIOErrorInLookup + ( + dict, + "interfaceCompositionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..cbff7d06c8 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,13 @@ Foam::autoPtr Foam::porousModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown modelType type " - << modelType << endl << endl - << "Valid porousModel types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "porousModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..867ebf8114 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,13 @@ 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); + FatalIOErrorInLookup + ( + dict, + "surfaceTensionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..7ecdf4e57d 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 @@ -34,7 +34,9 @@ Foam::autoPtr Foam::phaseModel::New const word& phaseName ) { - const word modelType(fluid.subDict(phaseName).get("type")); + const dictionary& dict = fluid.subDict(phaseName); + + const word modelType(dict.get("type")); Info<< "Selecting phaseModel for " << phaseName << ": " << modelType << endl; @@ -43,12 +45,13 @@ Foam::autoPtr Foam::phaseModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown phaseModel type " - << modelType << endl << endl - << "Valid phaseModel types are : " << endl - << phaseSystemConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "phaseModel", + modelType, + *phaseSystemConstructorTablePtr_ + ) << exit(FatalIOError); } 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..bbf285d8d8 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,38 +32,37 @@ Foam::autoPtr Foam::multiphaseSystem::New const fvMesh& mesh ) { - const word multiphaseSystemType + const IOdictionary dict ( - IOdictionary + IOobject ( - IOobject - ( - phasePropertiesName, - mesh.time().constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ) - ).get("type") + phasePropertiesName, + mesh.time().constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false // Do not register + ) ); - Info<< "Selecting multiphaseSystem " << multiphaseSystemType << endl; + const word systemType(dict.get("type")); - const auto cstrIter = - dictionaryConstructorTablePtr_->cfind(multiphaseSystemType); + Info<< "Selecting multiphaseSystem " << systemType << endl; + + const auto cstrIter = dictionaryConstructorTablePtr_->cfind(systemType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown multiphaseSystemType type " - << multiphaseSystemType << endl - << "Valid multiphaseSystem types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "multiphaseSystem", + systemType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } - 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..f929d81976 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,7 +35,7 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New const fvMesh& mesh ) { - IOdictionary phaseChangePropertiesDict + const IOdictionary dict ( IOobject ( @@ -44,14 +44,11 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New mesh, IOobject::MUST_READ, IOobject::NO_WRITE, - false + false // Do not register ) ); - const word modelType - ( - phaseChangePropertiesDict.get("phaseChangeTwoPhaseModel") - ); + const word modelType(dict.get("phaseChangeTwoPhaseModel")); Info<< "Selecting phaseChange model " << modelType << endl; @@ -59,16 +56,20 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown temperaturePhaseChangeTwoPhaseMixture type " - << modelType << nl << nl - << "Valid temperaturePhaseChangeTwoPhaseMixture types :" << endl - << componentsConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "temperaturePhaseChangeTwoPhaseMixture", + modelType, + *componentsConstructorTablePtr_ + ) << exit(FatalIOError); } - 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..a8280aca82 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,7 +37,7 @@ Foam::phaseChangeTwoPhaseMixture::New const surfaceScalarField& phi ) { - IOdictionary transportPropertiesDict + const IOdictionary dict ( IOobject ( @@ -46,14 +46,11 @@ Foam::phaseChangeTwoPhaseMixture::New U.db(), IOobject::MUST_READ, IOobject::NO_WRITE, - false + false // Do not register ) ); - const word modelType - ( - transportPropertiesDict.lookup("phaseChangeTwoPhaseMixture") - ); + const word modelType(dict.get("phaseChangeTwoPhaseMixture")); Info<< "Selecting phaseChange model " << modelType << endl; @@ -61,12 +58,13 @@ Foam::phaseChangeTwoPhaseMixture::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown phaseChangeTwoPhaseMixture type " - << modelType << nl << nl - << "Valid phaseChangeTwoPhaseMixture types :" << endl - << componentsConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "phaseChangeTwoPhaseMixture", + modelType, + *componentsConstructorTablePtr_ + ) << exit(FatalIOError); } 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..9b0fa16f03 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,13 @@ Foam::autoPtr Foam::dragModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown dragModel type " - << modelType << nl << nl - << "Valid dragModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + interfaceDict, + "dragModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..2001ea0b7d 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,13 @@ Foam::autoPtr Foam::heatTransferModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown heatTransferModel type " - << modelType << nl << nl - << "Valid heatTransferModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + interfaceDict, + "heatTransferModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..02f85b0259 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,13 @@ Foam::autoPtr Foam::diameterModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown diameterModel type " - << modelType << nl << nl - << "Valid diameterModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "diameterModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..6cb924170d 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,13 @@ Foam::aspectRatioModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown aspectRatioModel type " - << modelType << nl << nl - << "Valid aspectRatioModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "aspectRatioModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..de4be83fc9 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,13 @@ Foam::autoPtr Foam::dragModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown dragModel type " - << modelType << nl << nl - << "Valid dragModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "dragModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..55a32689ea 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,13 @@ Foam::autoPtr Foam::heatTransferModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown heatTransferModel type " - << modelType << nl << nl - << "Valid heatTransferModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "heatTransferModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..eec6654dbf 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,13 @@ Foam::autoPtr Foam::liftModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown liftModel type " - << modelType << nl << nl - << "Valid liftModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "liftModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..39124027d8 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,13 @@ Foam::swarmCorrection::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown swarmCorrection type " - << modelType << nl << nl - << "Valid swarmCorrection types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "swarmCorrection", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..a444eceddc 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,13 @@ Foam::turbulentDispersionModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown turbulentDispersionModel type " - << modelType << nl << nl - << "Valid turbulentDispersionModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "turbulentDispersionModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..c6b8c84da6 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,13 @@ Foam::autoPtr Foam::virtualMassModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown virtualMassModel type " - << modelType << nl << nl - << "Valid virtualMassModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "virtualMassModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..00438a1e5d 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,13 @@ Foam::autoPtr Foam::wallLubricationModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown wallLubricationModel type " - << modelType << nl << nl - << "Valid wallLubricationModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "wallLubricationModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..240a88b888 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,13 @@ Foam::kineticTheoryModels::conductivityModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown conductivityModel type " - << modelType << nl << nl - << "Valid conductivityModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "conductivityModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..006dd1ee3a 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,13 @@ Foam::kineticTheoryModels::frictionalStressModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown frictionalStressModel type " - << modelType << nl << nl - << "Valid frictionalStressModelType types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "frictionalStressModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..cc68c7b7eb 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,13 @@ Foam::kineticTheoryModels::granularPressureModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown granularPressureModel type " - << modelType << nl << nl - << "Valid granularPressureModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "granularPressureModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..254cafa44b 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,13 @@ Foam::kineticTheoryModels::radialModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown radialModel type " - << modelType << nl << nl - << "Valid radialModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "radialModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..e1d2dd18f4 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,21 @@ 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); + FatalIOErrorInLookup + ( + dict, + "viscosityModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..dcd7953611 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,22 @@ 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); + FatalIOErrorInLookup + ( + dict, + "blendingMethod", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..02f85b0259 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,13 @@ Foam::autoPtr Foam::diameterModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown diameterModel type " - << modelType << nl << nl - << "Valid diameterModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "diameterModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..5830bb925e 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,27 @@ 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); + FatalIOErrorInLookup + ( + dict, + "cellSizeAndAlignmentControl", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr @@ -97,7 +98,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..cf2a3e5186 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,34 @@ 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); + FatalIOErrorInLookup + ( + dict, + "cellSizeFunction", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..86889193dc 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,31 @@ 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); + FatalIOErrorInLookup + ( + dict, + "cellSizeCalculationType", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..b7c8e44fe5 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,31 @@ Foam::surfaceCellSizeFunction::surfaceCellSizeFunction Foam::autoPtr Foam::surfaceCellSizeFunction::New ( - const dictionary& surfaceCellSizeFunctionDict, + const dictionary& dict, const searchableSurface& surface, const scalar& defaultCellSize ) { - const word functionName - ( - surfaceCellSizeFunctionDict.get("surfaceCellSizeFunction") - ); + const word modelType(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); + FatalIOErrorInLookup + ( + dict, + "surfaceCellSizeFunction", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..3f9e29181a 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 @@ -41,10 +41,10 @@ defineRunTimeSelectionTable(faceAreaWeightModel, dictionary); Foam::faceAreaWeightModel::faceAreaWeightModel ( const word& type, - const dictionary& relaxationDict + const dictionary& dict ) : - dictionary(relaxationDict), + dictionary(dict), coeffDict_(optionalSubDict(type + "Coeffs")) {} @@ -53,10 +53,10 @@ Foam::faceAreaWeightModel::faceAreaWeightModel Foam::autoPtr Foam::faceAreaWeightModel::New ( - const dictionary& relaxationDict + const dictionary& dict ) { - const word modelType(relaxationDict.get("faceAreaWeightModel")); + const word modelType(dict.get("faceAreaWeightModel")); Info<< nl << "Selecting faceAreaWeightModel " << modelType << endl; @@ -64,15 +64,16 @@ Foam::autoPtr Foam::faceAreaWeightModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown faceAreaWeightModel type " - << modelType << nl << nl - << "Valid faceAreaWeightModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "faceAreaWeightModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } - return autoPtr(cstrIter()(relaxationDict)); + return autoPtr(cstrIter()(dict)); } 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..f7ea91cb42 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 @@ -71,7 +71,7 @@ Foam::initialPointsMethod::initialPointsMethod Foam::autoPtr Foam::initialPointsMethod::New ( - const dictionary& initialPointsDict, + const dictionary& dict, const Time& runTime, Random& rndGen, const conformationSurfaces& geometryToConformTo, @@ -79,21 +79,21 @@ Foam::autoPtr Foam::initialPointsMethod::New const autoPtr& decomposition ) { - const word methodName(initialPointsDict.get("initialPointsMethod")); + const word modelType(dict.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); + FatalIOErrorInLookup + ( + dict, + "initialPointsMethod", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return @@ -101,7 +101,7 @@ Foam::autoPtr Foam::initialPointsMethod::New ( cstrIter() ( - initialPointsDict, + dict, runTime, rndGen, geometryToConformTo, 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..0b86932d50 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 @@ -42,11 +42,11 @@ defineRunTimeSelectionTable(relaxationModel, dictionary); Foam::relaxationModel::relaxationModel ( const word& type, - const dictionary& relaxationDict, + const dictionary& dict, const Time& runTime ) : - dictionary(relaxationDict), + dictionary(dict), runTime_(runTime), coeffDict_(optionalSubDict(type + "Coeffs")) {} @@ -56,11 +56,11 @@ Foam::relaxationModel::relaxationModel Foam::autoPtr Foam::relaxationModel::New ( - const dictionary& relaxationDict, + const dictionary& dict, const Time& runTime ) { - const word modelType(relaxationDict.get("relaxationModel")); + const word modelType(dict.get("relaxationModel")); Info<< nl << "Selecting relaxationModel " << modelType << endl; @@ -68,15 +68,16 @@ Foam::autoPtr Foam::relaxationModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown relaxationModel type " - << modelType << nl << nl - << "Valid relaxationModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "relaxationModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } - return autoPtr(cstrIter()(relaxationDict, runTime)); + return autoPtr(cstrIter()(dict, 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..b7fe54c953 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,19 @@ 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); + FatalIOErrorInLookup + ( + dict, + "searchableSurfaceFeatures", + modelType, + *dictConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr(cstrIter()(surface, dict)); @@ -82,7 +83,4 @@ Foam::searchableSurfaceFeatures::~searchableSurfaceFeatures() {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - - // ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C index d62617c67b..f64b7c09bc 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,19 @@ 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); + FatalIOErrorInLookup + ( + dict, + "faceSelection", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr(cstrIter()(name, mesh, dict)); diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C index ba650d5142..870cef7a68 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C @@ -45,8 +45,7 @@ Foam::autoPtr Foam::helpType::New FatalErrorInFunction << "Valid helpType selections:" << nl << " " - << flatOutput(dictionaryConstructorTablePtr_->sortedToc()) - << endl + << flatOutput(dictionaryConstructorTablePtr_->sortedToc()) << nl << exit(FatalError); } else @@ -55,8 +54,7 @@ Foam::autoPtr Foam::helpType::New << "Unknown helpType type '" << helpTypeName << "'" << nl << nl << "Valid helpType selections:" << nl << " " - << flatOutput(dictionaryConstructorTablePtr_->sortedToc()) - << endl + << flatOutput(dictionaryConstructorTablePtr_->sortedToc()) << nl << abort(FatalError); } } diff --git a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C index 3a6477ac81..1df2c3fa56 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,13 @@ Foam::tabulatedWallFunctions::tabulatedWallFunction::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown tabulatedWallFunction type " << functionName - << nl << nl << "Valid tabulatedWallFunction types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "tabulatedWallFunction", + functionName, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..5c9a8b3518 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,13 @@ Foam::searchableSurfaceModifier::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown searchableSurfaceModifier type " - << type << nl << nl - << "Valid searchableSurfaceModifier types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "searchableSurfaceModifier", + type, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr(cstrIter()(geometry, dict)); diff --git a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C index 8aefa03888..e91b190543 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,13 @@ Foam::autoPtr Foam::ODESolver::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown ODESolver type " - << solverType << nl << nl - << "Valid ODESolver types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "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..a49a3af24e 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 @@ -102,8 +102,7 @@ Foam::autoPtr Foam::functionObject::New if (!dictionaryConstructorTablePtr_) { FatalErrorInFunction - << "Unknown function type " - << functionType << nl << nl + << "Cannot load function type " << functionType << nl << nl << "Table of functionObjects is empty" << endl << exit(FatalError); } @@ -112,12 +111,14 @@ Foam::autoPtr Foam::functionObject::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown function type " - << functionType << nl << nl - << "Valid function types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() << endl - << exit(FatalError); + // FatalError (not FatalIOError) to ensure it can be caught + // as an exception and ignored + 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..6826b42555 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")); @@ -161,7 +155,7 @@ Foam::autoPtr> Foam::pointPatchField::New if (!patchTypeCstrIter.found()) { FatalIOErrorInFunction(dict) - << "inconsistent patch and patchField types for \n" + << "Inconsistent patch and patchField types for\n" << " patch type " << p.type() << " and patchField type " << patchFieldType << exit(FatalIOError); @@ -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..ab613a1cc4 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,13 @@ Foam::autoPtr> Foam::tableReader::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown reader type " - << readerType << nl << nl - << "Valid reader types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + spec, + "reader", + readerType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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/OpenFOAM/primitives/nullObject/nullObject.H b/src/OpenFOAM/primitives/nullObject/nullObject.H index 2b0782cb54..e8ca12f952 100644 --- a/src/OpenFOAM/primitives/nullObject/nullObject.H +++ b/src/OpenFOAM/primitives/nullObject/nullObject.H @@ -48,10 +48,9 @@ SourceFiles namespace Foam { -// Forward declarations +// Forward Declarations class Istream; class Ostream; - class NullObject; /*---------------------------------------------------------------------------*\ @@ -111,6 +110,30 @@ public: { return data_[0].val; } + + //- No elements + inline constexpr bool empty() const + { + return true; + } + + //- Zero elements + inline constexpr label size() const + { + return 0; + } + + //- No-op method (for HashTable replacement) + inline const NullObject& toc() const + { + return *this; + } + + //- No-op method (for HashTable replacement) + inline const NullObject& sortedToc() const + { + return *this; + } }; diff --git a/src/OpenFOAM/primitives/strings/word/wordIOList.C b/src/OpenFOAM/primitives/strings/word/wordIOList.C index 3d8ff05616..2ba97e7fb5 100644 --- a/src/OpenFOAM/primitives/strings/word/wordIOList.C +++ b/src/OpenFOAM/primitives/strings/word/wordIOList.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-2013 OpenFOAM Foundation @@ -40,40 +40,47 @@ namespace Foam } -void Foam::printTable +Foam::Ostream& Foam::printTable ( - const List& wll, - List& columnWidth, - Ostream& os + const UList& tbl, + List& columnWidths, + Ostream& os, + bool headerSeparator ) { - if (wll.empty()) return; - - // Find the maximum word length for each column - columnWidth.setSize(wll[0].size(), string::size_type(0)); - forAll(columnWidth, coli) + if (tbl.empty()) { - forAll(wll, rowi) + return os; + } + + // Find maximum width for each column + columnWidths.resize(tbl.first().size(), std::string::size_type(0)); + + forAll(columnWidths, coli) + { + auto& colWidth = columnWidths[coli]; + + for (const wordList& tblRow : tbl) { - columnWidth[coli] = + colWidth = std::max ( - columnWidth[coli], - string::size_type(wll[rowi][coli].size()) + colWidth, + string::size_type(tblRow[coli].length()) ); } } // Print the rows adding spacing for the columns - forAll(wll, rowi) + for (const wordList& tblRow : tbl) { - forAll(wll[rowi], coli) + forAll(tblRow, coli) { - os << wll[rowi][coli]; + os << tblRow[coli]; for ( - string::size_type space=0; - space < columnWidth[coli] - wll[rowi][coli].size() + 2; + string::size_type space = 0; + space < columnWidths[coli] - tblRow[coli].length() + 2; ++space ) { @@ -82,15 +89,24 @@ void Foam::printTable } os << nl; - if (!rowi) os << nl; + if (headerSeparator) os << nl; + headerSeparator = false; } + + return os; } -void Foam::printTable(const List& wll, Ostream& os) +Foam::Ostream& Foam::printTable +( + const UList& tbl, + Ostream& os, + bool headerSeparator +) { - List columnWidth; - printTable(wll, columnWidth, os); + List columnWidths; + printTable(tbl, columnWidths, os, headerSeparator); + return os; } diff --git a/src/OpenFOAM/primitives/strings/word/wordIOList.H b/src/OpenFOAM/primitives/strings/word/wordIOList.H index 9063d32f97..610255c8f2 100644 --- a/src/OpenFOAM/primitives/strings/word/wordIOList.H +++ b/src/OpenFOAM/primitives/strings/word/wordIOList.H @@ -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-2013 OpenFOAM Foundation @@ -44,9 +44,22 @@ namespace Foam typedef IOList wordIOList; typedef IOList wordListIOList; - // Print word list list as a table - void printTable(const List&, List&, Ostream&); - void printTable(const List&, Ostream&); + //- Print a List of wordList as a table + Ostream& printTable + ( + const UList& tbl, + List& columnWidths, + Ostream& os, + bool headerSeparator = true + ); + + //- Print a List of wordList as a table + Ostream& printTable + ( + const UList& tbl, + Ostream& os, + bool headerSeparator = true + ); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C index 4da23366f6..2724841077 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C @@ -135,36 +135,36 @@ 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 + const IOdictionary modelDict ( - IOdictionary + IOobject ( - IOobject - ( - IOobject::groupName(propertiesName, alphaRhoPhi.group()), - U.time().constant(), - U.db(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ) - ).subDict("LES").get("LESModel") + IOobject::groupName(propertiesName, alphaRhoPhi.group()), + U.time().constant(), + U.db(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false // Do not register + ) ); + const dictionary& dict = modelDict.subDict("LES"); + + const word modelType(dict.get("LESModel")); + Info<< "Selecting LES turbulence model " << modelType << endl; auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown LESModel type " - << modelType << nl << nl - << "Valid LESModel types:" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "LESModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C index 3957598496..d66fca61f4 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,13 @@ Foam::autoPtr Foam::LESdelta::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown LESdelta type " - << deltaType << nl << nl - << "Valid LESdelta types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "LESdelta", + deltaType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr(cstrIter()(name, turbulence, dict)); @@ -119,14 +120,15 @@ Foam::autoPtr Foam::LESdelta::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown LESdelta type " - << deltaType << nl << nl - << "Valid LESdelta types :" << endl - << additionalConstructors.sortedToc() - << " and " - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "LESdelta", + deltaType, + additionalConstructors + ) + << " and " << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalIOError); } return autoPtr(cstrIter()(name, turbulence, dict)); diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C b/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C index 8abc1e8064..870ba34451 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,13 @@ Foam::autoPtr Foam::LESfilter::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown LESfilter type " - << filterType << nl << nl - << "Valid LESfilter types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "LESfilter", + filterType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..6667bf48cc 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C @@ -125,36 +125,36 @@ 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 + const IOdictionary modelDict ( - IOdictionary + IOobject ( - IOobject - ( - IOobject::groupName(propertiesName, alphaRhoPhi.group()), - U.time().constant(), - U.db(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ) - ).subDict("RAS").get("RASModel") + IOobject::groupName(propertiesName, alphaRhoPhi.group()), + U.time().constant(), + U.db(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false // Do not register + ) ); + const dictionary& dict = modelDict.subDict("RAS"); + + const word modelType(dict.get("RASModel")); + Info<< "Selecting RAS turbulence model " << modelType << endl; auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown RASModel type " - << modelType << nl << nl - << "Valid RASModel types:" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "RASModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr diff --git a/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C b/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C index 1b88a1d080..e106ad1a81 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,36 +87,34 @@ 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 + const IOdictionary dict ( - IOdictionary + IOobject ( - IOobject - ( - IOobject::groupName(propertiesName, alphaRhoPhi.group()), - U.time().constant(), - U.db(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ) - ).get("simulationType") + IOobject::groupName(propertiesName, alphaRhoPhi.group()), + U.time().constant(), + U.db(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false // Do not register + ) ); + const word modelType(dict.get("simulationType")); + Info<< "Selecting turbulence model type " << modelType << endl; auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown simulationType " - << modelType << nl << nl - << "Valid simulation types:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "simulationType", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr diff --git a/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C b/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C index 150114677e..de997e1459 100644 --- a/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C +++ b/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C @@ -92,7 +92,7 @@ Foam::laminarModel::New const word& propertiesName ) { - IOdictionary modelDict + const IOdictionary modelDict ( IOobject ( @@ -101,18 +101,17 @@ Foam::laminarModel::New U.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + false // Do not register ) ); - if (modelDict.found("laminar")) + const dictionary* dictptr = modelDict.findDict("laminar"); + + if (dictptr) { - // 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") - ); + const dictionary& dict = *dictptr; + + const word modelType(dict.get("laminarModel")); Info<< "Selecting laminar stress model " << modelType << endl; @@ -120,12 +119,13 @@ Foam::laminarModel::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown laminarModel type " - << modelType << nl << nl - << "Valid laminarModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "laminarModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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/combustionModels/combustionModel/combustionModelTemplates.C b/src/combustionModels/combustionModel/combustionModelTemplates.C index 569648e2c8..ce0fc8256e 100644 --- a/src/combustionModels/combustionModel/combustionModelTemplates.C +++ b/src/combustionModels/combustionModel/combustionModelTemplates.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 @@ -75,12 +75,16 @@ Foam::autoPtr Foam::combustionModel::New typedef typename CombustionModel::dictionaryConstructorTable cstrTableType; cstrTableType* cstrTable = CombustionModel::dictionaryConstructorTablePtr_; - const word compCombModelName = - combModelName + '<' + CombustionModel::reactionThermo::typeName + '>'; + const word compCombModelName + ( + combModelName + '<' + CombustionModel::reactionThermo::typeName + '>' + ); - const word thermoCombModelName = + const word thermoCombModelName + ( combModelName + '<' + CombustionModel::reactionThermo::typeName + ',' - + thermo.thermoName() + '>'; + + thermo.thermoName() + '>' + ); auto compCstrIter = cstrTable->cfind(compCombModelName); @@ -88,28 +92,61 @@ Foam::autoPtr Foam::combustionModel::New if (!compCstrIter.found() && !thermoCstrIter.found()) { - FatalErrorInFunction - << "Unknown " << combustionModel::typeName << " type " - << combModelName << endl << endl; - - const wordList names(cstrTable->toc()); - wordList thisCmpts; thisCmpts.append(word::null); thisCmpts.append(CombustionModel::reactionThermo::typeName); thisCmpts.append(basicThermo::splitThermoName(thermo.thermoName(), 5)); wordList validNames; - forAll(names, i) + + List validCmpts2; + validCmpts2.append + ( + // Header + wordList + ({ + word::null, + combustionModel::typeName, + "reactionThermo" + }) + ); + + List validCmpts7; + validCmpts7.append + ( + // Header + wordList + ({ + word::null, + combustionModel::typeName, + "reactionThermo", + "transport", + "thermo", + "equationOfState", + "specie", + "energy" + }) + ); + + for (const word& validName : cstrTable->sortedToc()) { - wordList cmpts(basicThermo::splitThermoName(names[i], 2)); - if (cmpts.size() != 2) + wordList cmpts(basicThermo::splitThermoName(validName, 2)); + + if (cmpts.size() == 2) { - cmpts = basicThermo::splitThermoName(names[i], 7); + validCmpts2.append(cmpts); + } + else + { + cmpts = basicThermo::splitThermoName(validName, 7); + if (cmpts.size() == 7) + { + validCmpts7.append(cmpts); + } } bool isValid = true; - for (label i = 1; i < cmpts.size() && isValid; ++ i) + for (label i = 1; i < cmpts.size() && isValid; ++i) { isValid = isValid && cmpts[i] == thisCmpts[i]; } @@ -120,49 +157,25 @@ Foam::autoPtr Foam::combustionModel::New } } - FatalErrorInFunction - << "Valid " << combustionModel::typeName << " types for this " - << "thermodynamic model are:" << endl << validNames << endl; - List validCmpts2, validCmpts7; - validCmpts2.append(wordList(2, word::null)); - validCmpts2[0][0] = combustionModel::typeName; - validCmpts2[0][1] = "reactionThermo"; - validCmpts7.append(wordList(7, word::null)); - validCmpts7[0][0] = combustionModel::typeName; - validCmpts7[0][1] = "reactionThermo"; - validCmpts7[0][2] = "transport"; - validCmpts7[0][3] = "thermo"; - validCmpts7[0][4] = "equationOfState"; - validCmpts7[0][5] = "specie"; - validCmpts7[0][6] = "energy"; - forAll(names, i) - { - const wordList cmpts2(basicThermo::splitThermoName(names[i], 2)); - const wordList cmpts7(basicThermo::splitThermoName(names[i], 7)); - if (cmpts2.size() == 2) - { - validCmpts2.append(cmpts2); - } - if (cmpts7.size() == 7) - { - validCmpts7.append(cmpts7); - } - } - - FatalErrorInFunction + FatalErrorInLookup + ( + combustionModel::typeName, + combModelName, + *cstrTable + ) << "All " << validCmpts2[0][0] << '/' << validCmpts2[0][1] - << " combinations are:" << endl << endl; - printTable(validCmpts2, FatalErrorInFunction); + << " combinations are:" << nl << nl; - FatalErrorInFunction << endl; + printTable(validCmpts2, FatalErrorInFunction) + << nl; FatalErrorInFunction << "All " << validCmpts7[0][0] << '/' << validCmpts7[0][1] - << "/thermoPhysics combinations are:" << endl << endl; - printTable(validCmpts7, FatalErrorInFunction); + << "/thermoPhysics combinations are:" << nl << nl; - FatalErrorInFunction << exit(FatalError); + printTable(validCmpts7, FatalErrorInFunction) + << exit(FatalError); } return autoPtr 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..c70fa46256 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 @@ -91,8 +91,6 @@ Foam::displacementMotionSolver::New const pointIOField& points0 ) { - //const word solverTypeName(solverDict.get("solver")); - Info<< "Selecting motion solver: " << solverTypeName << endl; const_cast(mesh.time()).libs().open @@ -113,12 +111,13 @@ Foam::displacementMotionSolver::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown solver type " - << solverTypeName << nl << nl - << "Valid solver types :" << endl - << displacementConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + solverDict, + "solver", + solverTypeName, + *displacementConstructorTablePtr_ + ) << exit(FatalIOError); } 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..867f23a8cf 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 @@ -31,11 +31,11 @@ License Foam::autoPtr Foam::solidBodyMotionFunction::New ( - const dictionary& SBMFCoeffs, + const dictionary& dict, const Time& runTime ) { - const word motionType(SBMFCoeffs.get("solidBodyMotionFunction")); + const word motionType(dict.get("solidBodyMotionFunction")); Info<< "Selecting solid-body motion function " << motionType << endl; @@ -43,15 +43,16 @@ Foam::autoPtr Foam::solidBodyMotionFunction::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown solidBodyMotionFunction type " - << motionType << nl << nl - << "Valid solidBodyMotionFunction types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "solidBodyMotionFunction", + motionType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } - return autoPtr(cstrIter()(SBMFCoeffs, runTime)); + return autoPtr(cstrIter()(dict, runTime)); } diff --git a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C index 34388b3d14..1ef14c5650 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,13 @@ Foam::autoPtr Foam::motionSolver::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown solver type " - << solverName << nl << nl - << "Valid solver types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + solverDict, + "solver", + solverName, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..66382678c4 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 @@ -30,41 +30,36 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::engineMesh::New -( - const Foam::IOobject& io -) +Foam::autoPtr Foam::engineMesh::New(const IOobject& io) { - // get model name, but do not register the dictionary - // otherwise it is registered in the database twice - const word modelType + const IOdictionary dict ( - IOdictionary + IOobject ( - IOobject - ( - "engineGeometry", - io.time().constant(), - io.db(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ) - ).lookup("engineMesh") + "engineGeometry", + io.time().constant(), + io.db(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false // Do not register + ) ); + const word modelType(dict.get("engineMesh")); + Info<< "Selecting engineMesh " << modelType << endl; auto cstrIter = IOobjectConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown engineMesh type " - << modelType << nl << nl - << "Valid engineMesh types :" << endl - << IOobjectConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "engineMesh", + modelType, + *IOobjectConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr(cstrIter()(io)); diff --git a/src/engine/engineTime/engineTime/engineTimeNew.C b/src/engine/engineTime/engineTime/engineTimeNew.C index 43d69ab689..b46a7cdbb5 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 @@ -42,11 +42,11 @@ Foam::autoPtr Foam::engineTime::New { IFstream engineDictFile("."/constantName/dictName); - dictionary engineDict(engineDictFile); + dictionary dict(engineDictFile); const word engineType ( - engineDict.lookupOrDefault("engineType", "crankConRod") + dict.getOrDefault("engineType", "crankConRod") ); Info<< "Selecting engine type " << engineType << endl; @@ -55,12 +55,13 @@ Foam::autoPtr Foam::engineTime::New if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown engine type " - << engineType << nl << nl - << "Valid engine types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "engine", + engineType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } 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..7e0814d2d0 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,36 +34,34 @@ 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 + const IOdictionary dict ( - IOdictionary + IOobject ( - IOobject - ( - "SRFProperties", - Urel.time().constant(), - Urel.db(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ) - ).lookup("SRFModel") + "SRFProperties", + Urel.time().constant(), + Urel.db(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false // Do not register + ) ); + const word modelType(dict.get("SRFModel")); + Info<< "Selecting SRFModel " << modelType << endl; auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown SRFModel type " - << modelType << nl << nl - << "Valid SRFModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "SRFModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr(cstrIter()(Urel)); diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C index d88d53f8a4..259f150bca 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,22 +88,19 @@ 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); + FatalIOErrorInLookup + ( + coeffs, + "fvOption", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } return autoPtr