diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C index b7bfbd08ae..80c429419d 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -43,9 +43,9 @@ Foam::autoPtr Foam::PDRDragModel::New Info<< "Selecting drag model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -57,7 +57,9 @@ Foam::autoPtr Foam::PDRDragModel::New } return autoPtr - (cstrIter()(dict, turbulence, rho, U, phi)); + ( + ctorPtr(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 ff1f3ccbdf..3cb2daa4b8 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,9 +42,9 @@ Foam::autoPtr Foam::XiEqModel::New Info<< "Selecting flame-wrinkling model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::autoPtr Foam::XiEqModel::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(dict, thermo, turbulence, Su)); + return autoPtr(ctorPtr(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 1061ae392a..f8f6d355d8 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,9 +42,9 @@ Foam::autoPtr Foam::XiGModel::New Info<< "Selecting flame-wrinkling model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::autoPtr Foam::XiGModel::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(dict, thermo, turbulence, Su)); + return autoPtr(ctorPtr(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 eb2d92eebc..46a23d41fd 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -45,9 +45,9 @@ Foam::autoPtr Foam::XiModel::New Info<< "Selecting flame-wrinkling model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -59,7 +59,9 @@ Foam::autoPtr Foam::XiModel::New } return autoPtr - (cstrIter()(dict, thermo, turbulence, Su, rho, b, phi)); + ( + ctorPtr(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 40fb18ef6c..6fc82c54bb 100644 --- a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C +++ b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -44,9 +44,9 @@ Foam::autoPtr Foam::mixtureViscosityModel::New Info<< "Selecting incompressible transport model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -58,7 +58,9 @@ Foam::autoPtr Foam::mixtureViscosityModel::New } return autoPtr - (cstrIter()(name, dict, U, phi)); + ( + ctorPtr(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 13ac5c1d7d..2cdf9d7626 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -111,9 +111,9 @@ Foam::autoPtr Foam::relativeVelocityModel::New Info<< "Selecting relative velocity model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -127,7 +127,7 @@ Foam::autoPtr Foam::relativeVelocityModel::New return autoPtr ( - cstrIter() + ctorPtr ( dict.optionalSubDict(modelType + "Coeffs"), mixture diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/reflectionModel/reflectionModel/reflectionModelNew.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/reflectionModel/reflectionModel/reflectionModelNew.C index 62bc964218..ae30ffd4b1 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/reflectionModel/reflectionModel/reflectionModelNew.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/reflectionModel/reflectionModel/reflectionModelNew.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -41,9 +41,9 @@ Foam::radiation::reflectionModel::New Info<< "Selecting reflectionModel " << modelType << endl; - const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -54,7 +54,7 @@ Foam::radiation::reflectionModel::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(dict, mesh)); + return autoPtr(ctorPtr(dict, mesh)); } diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtureNew.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtureNew.C index 02bb89045a..0de3d22ae3 100644 --- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtureNew.C +++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtureNew.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016-2019 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -54,9 +54,9 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New Info<< "Selecting phaseChange model " << modelType << endl; - auto cstrIter = componentsConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = componentsConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -70,7 +70,7 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New return autoPtr ( - cstrIter()(thermo, mesh) + ctorPtr(thermo, mesh) ); } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C index eb7b80d04d..db6564ffa1 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -56,9 +56,9 @@ Foam::phaseChangeTwoPhaseMixture::New Info<< "Selecting phaseChange model " << modelType << endl; - auto cstrIter = componentsConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = componentsConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -69,7 +69,7 @@ Foam::phaseChangeTwoPhaseMixture::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(U, phi)); + return autoPtr(ctorPtr(U, phi)); } 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 441f5391d5..150135ba9a 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 @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2015 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -80,9 +80,9 @@ Foam::cellSizeAndAlignmentControl::New Info<< indent << "Selecting cellSizeAndAlignmentControl " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -95,7 +95,7 @@ Foam::cellSizeAndAlignmentControl::New return autoPtr ( - cstrIter() + ctorPtr ( runTime, name, 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 a7a4e673f1..7d0aa35585 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 @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -134,9 +134,9 @@ Foam::autoPtr Foam::cellSizeFunction::New Info<< indent << "Selecting cellSizeFunction " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -149,7 +149,7 @@ Foam::autoPtr Foam::cellSizeFunction::New return autoPtr ( - cstrIter() + ctorPtr ( dict, surface, 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 322c0f19b5..0435c3fc43 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 @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -67,9 +67,9 @@ Foam::autoPtr Foam::cellSizeCalculationType::New Info<< indent << "Selecting cellSizeCalculationType " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -82,7 +82,7 @@ Foam::autoPtr Foam::cellSizeCalculationType::New return autoPtr ( - cstrIter()(dict, surface, defaultCellSize) + ctorPtr(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 da5e87dda5..905739ea93 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 @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2017 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -72,9 +72,9 @@ Foam::autoPtr Foam::surfaceCellSizeFunction::New Info<< indent << "Selecting surfaceCellSizeFunction " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -87,7 +87,7 @@ Foam::autoPtr Foam::surfaceCellSizeFunction::New return autoPtr ( - cstrIter()(dict, surface, defaultCellSize) + ctorPtr(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 a3da8a6c8c..6ca72fdce8 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -61,9 +61,9 @@ Foam::autoPtr Foam::faceAreaWeightModel::New Info<< nl << "Selecting faceAreaWeightModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -74,7 +74,7 @@ Foam::autoPtr Foam::faceAreaWeightModel::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(dict)); + return autoPtr(ctorPtr(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 7c16c948bc..1ed3f52e01 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -84,9 +84,9 @@ Foam::autoPtr Foam::initialPointsMethod::New Info<< nl << "Selecting initialPointsMethod " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -100,7 +100,7 @@ Foam::autoPtr Foam::initialPointsMethod::New return autoPtr ( - cstrIter() + ctorPtr ( dict, runTime, 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 9121d9792f..fa9ac3b124 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -65,9 +65,9 @@ Foam::autoPtr Foam::relaxationModel::New Info<< nl << "Selecting relaxationModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -78,7 +78,7 @@ Foam::autoPtr Foam::relaxationModel::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(dict, runTime)); + return autoPtr(ctorPtr(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 17b7cb14c4..c26412f069 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,9 +48,9 @@ Foam::searchableSurfaceFeatures::New { const word modelType(surface.type() + "Features"); - auto cstrIter = dictConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -61,7 +61,7 @@ Foam::searchableSurfaceFeatures::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(surface, dict)); + return autoPtr(ctorPtr(surface, dict)); } diff --git a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C index bc30bb2c8a..015be95822 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C +++ b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -71,9 +71,9 @@ Foam::autoPtr Foam::faceSelection::New { const word modelType(dict.get("type")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -84,7 +84,7 @@ Foam::autoPtr Foam::faceSelection::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(name, mesh, dict)); + return autoPtr(ctorPtr(name, mesh, dict)); } diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundaryTemplates.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundaryTemplates.C index 43fa15d792..9e2faa1794 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundaryTemplates.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundaryTemplates.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2017 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C index c6c65b47b4..59a8851c40 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2015 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,9 +35,9 @@ Foam::autoPtr Foam::helpType::New const word& helpTypeName ) { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(helpTypeName); + auto* ctorPtr = dictionaryConstructorTable(helpTypeName); - if (!cstrIter.found()) + if (!ctorPtr) { // special treatment for -help // exit without stack trace @@ -61,7 +62,7 @@ Foam::autoPtr Foam::helpType::New Info<< "Selecting helpType '" << helpTypeName << "'" << endl; - return autoPtr(cstrIter()()); + return autoPtr(ctorPtr()); } diff --git a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.C b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.C index a13bba92bc..1625ad1d3f 100644 --- a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.C +++ b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,7 +40,7 @@ using namespace Foam::constant; namespace Foam { - defineMemberFunctionSelectionTable(PDRobstacle, read, dictRead); + defineMemberFunctionSelectionTable(PDRobstacle, read, dictionary); } diff --git a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.H b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.H index 7328b7ecb0..d0dede5418 100644 --- a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.H +++ b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 Shell Research Ltd. - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -178,7 +178,7 @@ public: void, PDRobstacle, read, - dictRead, + dictionary, ( PDRobstacle& obs, const dictionary& dict diff --git a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleIO.C b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleIO.C index 342a3175cf..dfd1bcd39a 100644 --- a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleIO.C +++ b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleIO.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -41,18 +41,20 @@ bool Foam::PDRobstacle::read(Istream& is) const word obsType(is); const dictionary dict(is); - const auto mfIter = readdictReadMemberFunctionTablePtr_->cfind(obsType); + auto* mfuncPtr = readdictionaryMemberFunctionTable(obsType); - if (!mfIter.good()) + if (!mfuncPtr) { - FatalIOErrorInFunction(is) - << "Unknown obstacle type: " << obsType << nl - << "Valid types:" << nl - << readdictReadMemberFunctionTablePtr_->sortedToc() << nl - << exit(FatalIOError); + FatalIOErrorInLookup + ( + is, + "obstacle", + obsType, + *readdictionaryMemberFunctionTablePtr_ + ) << exit(FatalIOError); } - mfIter()(*this, dict); + mfuncPtr(*this, dict); return true; } diff --git a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleTypes.C b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleTypes.C index 3fc8275f46..078b5a7df0 100644 --- a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleTypes.C +++ b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleTypes.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -45,7 +45,7 @@ using namespace Foam::constant; PDRobstacle, \ obsType, \ read, \ - dictRead, \ + dictionary, \ obsName \ ); \ } \ diff --git a/applications/utilities/preProcessing/setAlphaField/alphaFieldFunctions/implicitFunctions/implicitFunction.C b/applications/utilities/preProcessing/setAlphaField/alphaFieldFunctions/implicitFunctions/implicitFunction.C index fb5e1220f6..bc6b33f426 100644 --- a/applications/utilities/preProcessing/setAlphaField/alphaFieldFunctions/implicitFunctions/implicitFunction.C +++ b/applications/utilities/preProcessing/setAlphaField/alphaFieldFunctions/implicitFunctions/implicitFunction.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. Copyright (C) 2019-2020 DLR ------------------------------------------------------------------------------- License @@ -46,9 +46,9 @@ Foam::autoPtr Foam::implicitFunction::New const dictionary& dict ) { - auto cstrIter = dictConstructorTablePtr_->cfind(implicitFunctionType); + auto* ctorPtr = dictConstructorTable(implicitFunctionType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -59,7 +59,7 @@ Foam::autoPtr Foam::implicitFunction::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(dict)); + return autoPtr(ctorPtr(dict)); } diff --git a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C index cb862e61c0..5ee26060e3 100644 --- a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C +++ b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -41,9 +41,9 @@ Foam::tabulatedWallFunctions::tabulatedWallFunction::New Info<< "Selecting tabulatedWallFunction " << functionName << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionName); + auto* ctorPtr = dictionaryConstructorTable(functionName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -54,7 +54,7 @@ Foam::tabulatedWallFunctions::tabulatedWallFunction::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(dict, mesh)); + return autoPtr(ctorPtr(dict, mesh)); } diff --git a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C index 3e924b4e00..b5723df239 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C +++ b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -72,9 +72,9 @@ Foam::surfaceFeaturesExtraction::method::New { const word modelType(dict.get("extractionMethod")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -85,7 +85,7 @@ Foam::surfaceFeaturesExtraction::method::New ) << exit(FatalIOError); } - return autoPtr(cstrIter.val()(dict)); + return autoPtr(ctorPtr(dict)); } diff --git a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C index dcd295f001..0b3b028fe1 100644 --- a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C +++ b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -67,9 +67,9 @@ Foam::searchableSurfaceModifier::New const dictionary& dict ) { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); + auto* ctorPtr = dictionaryConstructorTable(type); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -80,7 +80,7 @@ Foam::searchableSurfaceModifier::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(geometry, dict)); + return autoPtr(ctorPtr(geometry, dict)); } diff --git a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C index 1ed2d81c87..b9a88f2aeb 100644 --- a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C +++ b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -39,9 +39,9 @@ Foam::autoPtr Foam::ODESolver::New const word solverType(dict.get("solver")); Info<< "Selecting ODE solver " << solverType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverType); + auto* ctorPtr = dictionaryConstructorTable(solverType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -52,7 +52,7 @@ Foam::autoPtr Foam::ODESolver::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(odes, dict)); + return autoPtr(ctorPtr(odes, dict)); } diff --git a/src/OpenFOAM/db/IOstreams/token/token.C b/src/OpenFOAM/db/IOstreams/token/token.C index 313ca75fd1..5cfbdfb8fd 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.C +++ b/src/OpenFOAM/db/IOstreams/token/token.C @@ -58,9 +58,9 @@ Foam::autoPtr Foam::token::compound::New Istream& is ) { - auto cstrIter = IstreamConstructorTablePtr_->cfind(compoundType); + auto* ctorPtr = IstreamConstructorTable(compoundType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -71,7 +71,7 @@ Foam::autoPtr Foam::token::compound::New ) << abort(FatalIOError); } - return autoPtr(cstrIter()(is)); + return autoPtr(ctorPtr(is)); } diff --git a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C index 62664f00df..c363b63f87 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C @@ -100,10 +100,10 @@ bool Foam::functionEntry::execute return true; } - auto mfIter = - executedictionaryIstreamMemberFunctionTablePtr_->cfind(functionName); + auto* mfuncPtr = + executedictionaryIstreamMemberFunctionTable(functionName); - if (!mfIter.found()) + if (!mfuncPtr) { FatalErrorInFunction << "Unknown functionEntry '" << functionName @@ -114,7 +114,7 @@ bool Foam::functionEntry::execute << exit(FatalError); } - return mfIter()(parentDict, is); + return mfuncPtr(parentDict, is); } @@ -139,13 +139,10 @@ bool Foam::functionEntry::execute return true; } - auto mfIter = - executeprimitiveEntryIstreamMemberFunctionTablePtr_->cfind - ( - functionName - ); + auto* mfuncPtr = + executeprimitiveEntryIstreamMemberFunctionTable(functionName); - if (!mfIter.found()) + if (!mfuncPtr) { FatalErrorInFunction << "Unknown functionEntry '" << functionName @@ -156,7 +153,7 @@ bool Foam::functionEntry::execute << exit(FatalError); } - return mfIter()(parentDict, entry, is); + return mfuncPtr(parentDict, entry, is); } diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index edabdf8d0a..2229135ae3 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2020 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -108,9 +108,9 @@ Foam::autoPtr Foam::functionObject::New << exit(FatalError); } - auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionType); + auto* ctorPtr = dictionaryConstructorTable(functionType); - if (!cstrIter.found()) + if (!ctorPtr) { // FatalError (not FatalIOError) to ensure it can be caught // as an exception and ignored @@ -122,7 +122,7 @@ Foam::autoPtr Foam::functionObject::New ) << exit(FatalError); } - return autoPtr(cstrIter()(name, runTime, dict)); + return autoPtr(ctorPtr(name, runTime, dict)); } diff --git a/src/OpenFOAM/expressions/exprEntry/expressionEntry.C b/src/OpenFOAM/expressions/exprEntry/expressionEntry.C index 6e83f0b738..652572b5ed 100644 --- a/src/OpenFOAM/expressions/exprEntry/expressionEntry.C +++ b/src/OpenFOAM/expressions/exprEntry/expressionEntry.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Original code Copyright (C) 2014-2018 Bernhard Gschaider - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -119,9 +119,9 @@ Foam::exprTools::expressionEntry::New const word& name ) { - auto cstrIter = emptyConstructorTablePtr_->cfind(name); + auto* ctorPtr = emptyConstructorTable(name); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -131,7 +131,7 @@ Foam::exprTools::expressionEntry::New ) << exit(FatalError); } - return autoPtr(cstrIter()()); + return autoPtr(ctorPtr()); } diff --git a/src/OpenFOAM/expressions/exprResult/exprResult.C b/src/OpenFOAM/expressions/exprResult/exprResult.C index 2b43da245f..a208502198 100644 --- a/src/OpenFOAM/expressions/exprResult/exprResult.C +++ b/src/OpenFOAM/expressions/exprResult/exprResult.C @@ -314,9 +314,9 @@ Foam::expressions::exprResult::New if (dict.getOrDefault("unsetValue", false)) { - auto cstrIter = emptyConstructorTablePtr_->cfind(resultType); + auto* ctorPtr = emptyConstructorTable(resultType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -330,13 +330,13 @@ Foam::expressions::exprResult::New DebugInfo << "Creating unset result of type " << resultType << nl; - return autoPtr(cstrIter()()); + return autoPtr(ctorPtr()); } - auto cstrIter = dictionaryConstructorTablePtr_->cfind(resultType); + auto* ctorPtr = dictionaryConstructorTable(resultType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -350,7 +350,7 @@ Foam::expressions::exprResult::New DebugInfo << "Creating result of type " << resultType << nl; - return autoPtr(cstrIter()(dict)); + return autoPtr(ctorPtr(dict)); } diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C index 60a2a4b7eb..34002cc383 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -93,14 +94,13 @@ Foam::pointPatchField::NewCalculatedType const pointPatchField& pf ) { - auto patchTypeCstrIter = - pointPatchConstructorTablePtr_->cfind(pf.patch().type()); + auto* patchTypeCtor = pointPatchConstructorTable(pf.patch().type()); - if (patchTypeCstrIter.found()) + if (patchTypeCtor) { return autoPtr> ( - patchTypeCstrIter() + patchTypeCtor ( pf.patch(), Field::null() diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C index 42dafa6419..38efd74909 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C @@ -39,9 +39,9 @@ Foam::autoPtr> Foam::pointPatchField::New { DebugInFunction << "Constructing pointPatchField" << endl; - auto cstrIter = pointPatchConstructorTablePtr_->cfind(patchFieldType); + auto* ctorPtr = pointPatchConstructorTable(patchFieldType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -51,7 +51,7 @@ Foam::autoPtr> Foam::pointPatchField::New ) << exit(FatalError); } - autoPtr> pfPtr(cstrIter()(p, iF)); + autoPtr> pfPtr(ctorPtr(p, iF)); if ( @@ -64,10 +64,9 @@ Foam::autoPtr> Foam::pointPatchField::New // Incompatible (constraint-wise) with the patch type // - use default constraint type - auto patchTypeCstrIter = - pointPatchConstructorTablePtr_->cfind(p.type()); + auto* patchTypeCtor = pointPatchConstructorTable(p.type()); - if (!patchTypeCstrIter.found()) + if (!patchTypeCtor) { FatalErrorInFunction << "Inconsistent patch and patchField types for\n" @@ -76,7 +75,7 @@ Foam::autoPtr> Foam::pointPatchField::New << exit(FatalError); } - return patchTypeCstrIter()(p, iF); + return patchTypeCtor(p, iF); } } else @@ -115,16 +114,16 @@ Foam::autoPtr> Foam::pointPatchField::New const word patchFieldType(dict.get("type")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType); + auto* ctorPtr = dictionaryConstructorTable(patchFieldType); - if (!cstrIter.found()) + if (!ctorPtr) { if (!disallowGenericPointPatchField) { - cstrIter = dictionaryConstructorTablePtr_->cfind("generic"); + ctorPtr = dictionaryConstructorTable("generic"); } - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInFunction(dict) << "Unknown patchField type " << patchFieldType @@ -136,7 +135,7 @@ Foam::autoPtr> Foam::pointPatchField::New } // Construct (but not necessarily returned) - autoPtr> pfPtr(cstrIter()(p, iF, dict)); + autoPtr> pfPtr(ctorPtr(p, iF, dict)); if ( @@ -149,10 +148,9 @@ Foam::autoPtr> Foam::pointPatchField::New // Incompatible (constraint-wise) with the patch type // - use default constraint type - auto patchTypeCstrIter = - dictionaryConstructorTablePtr_->cfind(p.type()); + auto* patchTypeCtor = dictionaryConstructorTable(p.type()); - if (!patchTypeCstrIter.found()) + if (!patchTypeCtor) { FatalIOErrorInFunction(dict) << "Inconsistent patch and patchField types for\n" @@ -161,7 +159,7 @@ Foam::autoPtr> Foam::pointPatchField::New << exit(FatalIOError); } - return patchTypeCstrIter()(p, iF, dict); + return patchTypeCtor(p, iF, dict); } } @@ -180,9 +178,9 @@ Foam::autoPtr> Foam::pointPatchField::New { DebugInFunction << "Constructing pointPatchField" << endl; - auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type()); + auto* ctorPtr = patchMapperConstructorTable(ptf.type()); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -192,7 +190,7 @@ Foam::autoPtr> Foam::pointPatchField::New ) << exit(FatalError); } - return cstrIter()(ptf, p, iF, pfMapper); + return ctorPtr(ptf, p, iF, pfMapper); } diff --git a/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C b/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C index 3919c92f96..94d9adf1b1 100644 --- a/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C +++ b/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C @@ -711,9 +711,9 @@ Foam::fileOperation::New DebugInFunction << "Constructing fileHandler" << endl; - auto cstrIter = wordConstructorTablePtr_->cfind(handlerType); + auto* ctorPtr = wordConstructorTable(handlerType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -723,7 +723,7 @@ Foam::fileOperation::New ) << abort(FatalError); } - return autoPtr(cstrIter()(verbose)); + return autoPtr(ctorPtr(verbose)); } diff --git a/src/OpenFOAM/global/fileOperations/fileOperationInitialise/fileOperationInitialise.C b/src/OpenFOAM/global/fileOperations/fileOperationInitialise/fileOperationInitialise.C index ff83c57845..562fc7c266 100644 --- a/src/OpenFOAM/global/fileOperations/fileOperationInitialise/fileOperationInitialise.C +++ b/src/OpenFOAM/global/fileOperations/fileOperationInitialise/fileOperationInitialise.C @@ -85,9 +85,9 @@ Foam::fileOperations::fileOperationInitialise::New { DebugInFunction << "Constructing fileOperationInitialise" << endl; - auto cstrIter = wordConstructorTablePtr_->cfind(type); + auto* ctorPtr = wordConstructorTable(type); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -97,7 +97,7 @@ Foam::fileOperations::fileOperationInitialise::New ) << abort(FatalError); } - return autoPtr(cstrIter()(argc, argv)); + return autoPtr(ctorPtr(argc, argv)); } diff --git a/src/OpenFOAM/graph/graph.C b/src/OpenFOAM/graph/graph.C index 0e0f18dac5..eaa4a7b1cd 100644 --- a/src/OpenFOAM/graph/graph.C +++ b/src/OpenFOAM/graph/graph.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -219,9 +219,9 @@ Foam::autoPtr Foam::graph::writer::New << exit(FatalError); } - auto cstrIter = wordConstructorTablePtr_->cfind(graphFormat); + auto* ctorPtr = wordConstructorTable(graphFormat); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -231,7 +231,7 @@ Foam::autoPtr Foam::graph::writer::New ) << exit(FatalError); } - return autoPtr(cstrIter()()); + return autoPtr(ctorPtr()); } diff --git a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C index c3d2423de6..c11f5df271 100644 --- a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C +++ b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,9 +42,9 @@ Foam::autoPtr> Foam::tableReader::New "openFoam" ); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(readerType); + auto* ctorPtr = dictionaryConstructorTable(readerType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::autoPtr> Foam::tableReader::New ) << exit(FatalIOError); } - return autoPtr>(cstrIter()(spec)); + return autoPtr>(ctorPtr(spec)); } diff --git a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C index 540fa01f79..c64c815d88 100644 --- a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C +++ b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -57,9 +57,9 @@ Foam::autoPtr Foam::interpolationWeights::New { DebugInFunction << "Selecting interpolationWeights " << type << endl; - auto cstrIter = wordConstructorTablePtr_->cfind(type); + auto* ctorPtr = wordConstructorTable(type); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -69,7 +69,7 @@ Foam::autoPtr Foam::interpolationWeights::New ) << exit(FatalError); } - return autoPtr(cstrIter()(samples)); + return autoPtr(ctorPtr(samples)); } diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C index 31a359ee07..c61d8b6a76 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -45,10 +45,9 @@ Foam::LduMatrix::preconditioner::New if (sol.matrix().symmetric()) { - auto cstrIter = - symMatrixConstructorTablePtr_->cfind(preconditionerName); + auto* ctorPtr = symMatrixConstructorTable(preconditionerName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -61,7 +60,7 @@ Foam::LduMatrix::preconditioner::New return autoPtr::preconditioner> ( - cstrIter() + ctorPtr ( sol, preconditionerDict @@ -70,10 +69,9 @@ Foam::LduMatrix::preconditioner::New } else if (sol.matrix().asymmetric()) { - auto cstrIter = - asymMatrixConstructorTablePtr_->cfind(preconditionerName); + auto* ctorPtr = asymMatrixConstructorTable(preconditionerName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -86,7 +84,7 @@ Foam::LduMatrix::preconditioner::New return autoPtr::preconditioner> ( - cstrIter() + ctorPtr ( sol, preconditionerDict diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C index 7796bfea81..69f5073f09 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -43,9 +43,9 @@ Foam::LduMatrix::smoother::New if (matrix.symmetric()) { - auto cstrIter = symMatrixConstructorTablePtr_->cfind(smootherName); + auto* ctorPtr = symMatrixConstructorTable(smootherName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -58,7 +58,7 @@ Foam::LduMatrix::smoother::New return autoPtr::smoother> ( - cstrIter() + ctorPtr ( fieldName, matrix @@ -67,9 +67,9 @@ Foam::LduMatrix::smoother::New } else if (matrix.asymmetric()) { - auto cstrIter = asymMatrixConstructorTablePtr_->cfind(smootherName); + auto* ctorPtr = asymMatrixConstructorTable(smootherName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -82,7 +82,7 @@ Foam::LduMatrix::smoother::New return autoPtr::smoother> ( - cstrIter() + ctorPtr ( fieldName, matrix diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C index f8d88c2c4b..59d117381e 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C @@ -56,9 +56,9 @@ Foam::LduMatrix::solver::New } else if (matrix.symmetric()) { - auto cstrIter = symMatrixConstructorTablePtr_->cfind(solverName); + auto* ctorPtr = symMatrixConstructorTable(solverName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -71,7 +71,7 @@ Foam::LduMatrix::solver::New return autoPtr::solver> ( - cstrIter() + ctorPtr ( fieldName, matrix, @@ -81,9 +81,9 @@ Foam::LduMatrix::solver::New } else if (matrix.asymmetric()) { - auto cstrIter = asymMatrixConstructorTablePtr_->cfind(solverName); + auto* ctorPtr = asymMatrixConstructorTable(solverName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -96,7 +96,7 @@ Foam::LduMatrix::solver::New return autoPtr::solver> ( - cstrIter() + ctorPtr ( fieldName, matrix, diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C index fe87a93f41..8cf8789338 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -90,9 +90,9 @@ Foam::lduMatrix::preconditioner::New if (sol.matrix().symmetric()) { - auto cstrIter = symMatrixConstructorTablePtr_->cfind(name); + auto* ctorPtr = symMatrixConstructorTable(name); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -105,7 +105,7 @@ Foam::lduMatrix::preconditioner::New return autoPtr ( - cstrIter() + ctorPtr ( sol, controls @@ -114,9 +114,9 @@ Foam::lduMatrix::preconditioner::New } else if (sol.matrix().asymmetric()) { - auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name); + auto* ctorPtr = asymMatrixConstructorTable(name); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -129,7 +129,7 @@ Foam::lduMatrix::preconditioner::New return autoPtr ( - cstrIter() + ctorPtr ( sol, controls diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C index a66348f245..901d4ea880 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -93,9 +93,9 @@ Foam::autoPtr Foam::lduMatrix::smoother::New if (matrix.symmetric()) { - auto cstrIter = symMatrixConstructorTablePtr_->cfind(name); + auto* ctorPtr = symMatrixConstructorTable(name); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -108,7 +108,7 @@ Foam::autoPtr Foam::lduMatrix::smoother::New return autoPtr ( - cstrIter() + ctorPtr ( fieldName, matrix, @@ -120,9 +120,9 @@ Foam::autoPtr Foam::lduMatrix::smoother::New } else if (matrix.asymmetric()) { - auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name); + auto* ctorPtr = asymMatrixConstructorTable(name); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -135,7 +135,7 @@ Foam::autoPtr Foam::lduMatrix::smoother::New return autoPtr ( - cstrIter() + ctorPtr ( fieldName, matrix, diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C index 2a7bb5ec6e..bae0f3d9e7 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C @@ -70,9 +70,9 @@ Foam::autoPtr Foam::lduMatrix::solver::New } else if (matrix.symmetric()) { - auto cstrIter = symMatrixConstructorTablePtr_->cfind(name); + auto* ctorPtr = symMatrixConstructorTable(name); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -85,7 +85,7 @@ Foam::autoPtr Foam::lduMatrix::solver::New return autoPtr ( - cstrIter() + ctorPtr ( fieldName, matrix, @@ -98,9 +98,9 @@ Foam::autoPtr Foam::lduMatrix::solver::New } else if (matrix.asymmetric()) { - auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name); + auto* ctorPtr = asymMatrixConstructorTable(name); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -113,7 +113,7 @@ Foam::autoPtr Foam::lduMatrix::solver::New return autoPtr ( - cstrIter() + ctorPtr ( fieldName, matrix, diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C index 645cfaa152..4a5ffe33fe 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C @@ -319,9 +319,9 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New lduMeshConstructorTablePtr_ ); - auto cstrIter = lduMeshConstructorTablePtr_->cfind(agglomeratorType); + auto* ctorPtr = lduMeshConstructorTable(agglomeratorType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInFunction << "Unknown GAMGAgglomeration type " @@ -333,7 +333,7 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New << exit(FatalError); } - return store(cstrIter()(mesh, controlDict).ptr()); + return store(ctorPtr(mesh, controlDict).ptr()); } } @@ -370,20 +370,15 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New lduMatrixConstructorTablePtr_ ); - if - ( - !lduMatrixConstructorTablePtr_ - || !lduMatrixConstructorTablePtr_->found(agglomeratorType) - ) + auto* ctorPtr = lduMatrixConstructorTable(agglomeratorType); + + if (!ctorPtr) { return New(mesh, controlDict); } else { - auto cstrIter = - lduMatrixConstructorTablePtr_->cfind(agglomeratorType); - - return store(cstrIter()(matrix, controlDict).ptr()); + return store(ctorPtr(matrix, controlDict).ptr()); } } } @@ -422,9 +417,9 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New geometryConstructorTablePtr_ ); - auto cstrIter = geometryConstructorTablePtr_->cfind(agglomeratorType); + auto* ctorPtr = geometryConstructorTable(agglomeratorType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInFunction << "Unknown GAMGAgglomeration type " @@ -436,7 +431,7 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New return store ( - cstrIter() + ctorPtr ( mesh, cellVolumes, 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 7fb23ff19c..47681853c0 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2017 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -364,9 +365,9 @@ Foam::autoPtr Foam::GAMGProcAgglomeration::New { DebugInFunction << "Constructing GAMGProcAgglomeration" << endl; - auto cstrIter = GAMGAgglomerationConstructorTablePtr_->cfind(type); + auto* ctorPtr = GAMGAgglomerationConstructorTable(type); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInFunction << "Unknown GAMGProcAgglomeration type " @@ -376,7 +377,7 @@ Foam::autoPtr Foam::GAMGProcAgglomeration::New << exit(FatalError); } - return autoPtr(cstrIter()(agglom, controlDict)); + return autoPtr(ctorPtr(agglom, controlDict)); } 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 7655843781..59ffcde856 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,9 +38,9 @@ Foam::autoPtr Foam::GAMGInterfaceField::New { const word coupleType(fineInterface.interfaceFieldType()); - auto cstrIter = lduInterfaceFieldConstructorTablePtr_->cfind(coupleType); + auto* ctorPtr = lduInterfaceFieldConstructorTable(coupleType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -50,7 +50,7 @@ Foam::autoPtr Foam::GAMGInterfaceField::New ) << exit(FatalError); } - return autoPtr(cstrIter()(GAMGCp, fineInterface)); + return autoPtr(ctorPtr(GAMGCp, fineInterface)); } @@ -63,9 +63,9 @@ Foam::autoPtr Foam::GAMGInterfaceField::New { const word coupleType(GAMGCp.type()); - auto cstrIter = lduInterfaceConstructorTablePtr_->cfind(coupleType); + auto* ctorPtr = lduInterfaceConstructorTable(coupleType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -75,7 +75,7 @@ Foam::autoPtr Foam::GAMGInterfaceField::New ) << exit(FatalError); } - return autoPtr(cstrIter()(GAMGCp, doTransform, rank)); + return autoPtr(ctorPtr(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 5cae89551b..7d8b855eda 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,9 +46,9 @@ Foam::autoPtr Foam::GAMGInterface::New { const word coupleType(fineInterface.type()); - auto cstrIter = lduInterfaceConstructorTablePtr_->cfind(coupleType); + auto* ctorPtr = lduInterfaceConstructorTable(coupleType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -60,7 +60,7 @@ Foam::autoPtr Foam::GAMGInterface::New return autoPtr ( - cstrIter() + ctorPtr ( index, coarseInterfaces, @@ -82,9 +82,9 @@ Foam::autoPtr Foam::GAMGInterface::New Istream& is ) { - auto cstrIter = IstreamConstructorTablePtr_->cfind(coupleType); + auto* ctorPtr = IstreamConstructorTable(coupleType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -94,7 +94,7 @@ Foam::autoPtr Foam::GAMGInterface::New ) << exit(FatalError); } - return autoPtr(cstrIter()(index, coarseInterfaces, is)); + return autoPtr(ctorPtr(index, coarseInterfaces, is)); } diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C index 02640b4179..21261cfe56 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,9 +38,9 @@ Foam::autoPtr Foam::facePointPatch::New { DebugInFunction << "Constructing facePointPatch" << endl; - auto cstrIter = polyPatchConstructorTablePtr_->cfind(patch.type()); + auto* ctorPtr = polyPatchConstructorTable(patch.type()); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -50,7 +50,7 @@ Foam::autoPtr Foam::facePointPatch::New ) << exit(FatalError); } - return autoPtr(cstrIter()(patch, bm)); + return autoPtr(ctorPtr(patch, bm)); } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C index d466d6f174..61be272817 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C @@ -276,21 +276,27 @@ Foam::polyPatch::~polyPatch() bool Foam::polyPatch::constraintType(const word& pt) { - return pointPatchField::pointPatchConstructorTablePtr_->found(pt); + return + ( + pointPatchField::pointPatchConstructorTablePtr_ + && pointPatchField::pointPatchConstructorTablePtr_->found(pt) + ); } Foam::wordList Foam::polyPatch::constraintTypes() { - wordList cTypes(dictionaryConstructorTablePtr_->size()); + const auto& cnstrTable = *dictionaryConstructorTablePtr_; + + wordList cTypes(cnstrTable.size()); label i = 0; - forAllConstIters(*dictionaryConstructorTablePtr_, cstrIter) + forAllConstIters(cnstrTable, iter) { - if (constraintType(cstrIter.key())) + if (constraintType(iter.key())) { - cTypes[i++] = cstrIter.key(); + cTypes[i++] = iter.key(); } } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C index 4d9b0a18b2..cf1bfde74b 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -43,9 +43,9 @@ Foam::autoPtr Foam::polyPatch::New { DebugInFunction << "Constructing polyPatch" << endl; - auto cstrIter = wordConstructorTablePtr_->cfind(patchType); + auto* ctorPtr = wordConstructorTable(patchType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -57,7 +57,7 @@ Foam::autoPtr Foam::polyPatch::New return autoPtr ( - cstrIter() + ctorPtr ( name, size, @@ -98,16 +98,16 @@ Foam::autoPtr Foam::polyPatch::New { DebugInFunction << "Constructing polyPatch" << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchType); + auto* ctorPtr = dictionaryConstructorTable(patchType); - if (!cstrIter.found()) + if (!ctorPtr) { if (!disallowGenericPolyPatch) { - cstrIter = dictionaryConstructorTablePtr_->cfind("genericPatch"); + ctorPtr = dictionaryConstructorTable("genericPatch"); } - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -119,7 +119,7 @@ Foam::autoPtr Foam::polyPatch::New } } - return autoPtr(cstrIter()(name, dict, index, bm, patchType)); + return autoPtr(ctorPtr(name, dict, index, bm, patchType)); } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C index 6e48eb2a7e..d3106b938e 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -43,9 +43,9 @@ Foam::autoPtr Foam::cellZone::New const word zoneType(dict.get("type")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType); + auto* ctorPtr = dictionaryConstructorTable(zoneType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -56,7 +56,7 @@ Foam::autoPtr Foam::cellZone::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(name, dict, index, zm)); + return autoPtr(ctorPtr(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 14ff989c76..05725ffe6a 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -43,9 +43,9 @@ Foam::autoPtr Foam::faceZone::New const word zoneType(dict.get("type")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType); + auto* ctorPtr = dictionaryConstructorTable(zoneType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -56,7 +56,7 @@ Foam::autoPtr Foam::faceZone::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(name, dict, index, zm)); + return autoPtr(ctorPtr(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 f8cbf189fb..97c5da6bd3 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -43,9 +43,9 @@ Foam::autoPtr Foam::pointZone::New const word zoneType(dict.get("type")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType); + auto* ctorPtr = dictionaryConstructorTable(zoneType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -56,7 +56,7 @@ Foam::autoPtr Foam::pointZone::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(name, dict, index, zm)); + return autoPtr(ctorPtr(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 ae20893b4a..3e8727606a 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Function1/Function1New.C +++ b/src/OpenFOAM/primitives/functions/Function1/Function1/Function1New.C @@ -123,9 +123,9 @@ Foam::Function1::New } - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInFunction(dict) << "Unknown Function1 type " @@ -135,7 +135,7 @@ Foam::Function1::New << exit(FatalIOError); } - return cstrIter()(entryName, *coeffs); + return ctorPtr(entryName, *coeffs); } diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C index d93635c97a..1608a5682a 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C @@ -163,9 +163,9 @@ Foam::LESModel::New Info<< "Selecting LES turbulence model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -178,7 +178,7 @@ Foam::LESModel::New return autoPtr ( - cstrIter()(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName) + ctorPtr(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName) ); } diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C index 554def6e99..168c538e66 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C @@ -77,9 +77,9 @@ Foam::autoPtr Foam::LESdelta::New Info<< "Selecting LES " << lookupName << " type " << deltaType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(deltaType); + auto* ctorPtr = dictionaryConstructorTable(deltaType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -90,7 +90,7 @@ Foam::autoPtr Foam::LESdelta::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(name, turbulence, dict)); + return autoPtr(ctorPtr(name, turbulence, dict)); } @@ -107,16 +107,19 @@ Foam::autoPtr Foam::LESdelta::New Info<< "Selecting LES " << lookupName << " type " << deltaType << endl; - // Additional ones first - auto cstrIter = additionalConstructors.cfind(deltaType); - - // Regular ones - if (!cstrIter.found()) + // First any additional ones { - cstrIter = dictionaryConstructorTablePtr_->cfind(deltaType); + auto ctorIter = additionalConstructors.cfind(deltaType); + + if (ctorIter.found()) + { + return autoPtr(ctorIter.val()(name, turbulence, dict)); + } } - if (!cstrIter.found()) + auto* ctorPtr = dictionaryConstructorTable(deltaType); + + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -126,7 +129,7 @@ Foam::autoPtr Foam::LESdelta::New *dictionaryConstructorTablePtr_ ); - if (additionalConstructors.size()) + if (!additionalConstructors.empty()) { FatalIOError << " and " << additionalConstructors.sortedToc() << nl; @@ -136,7 +139,7 @@ Foam::autoPtr Foam::LESdelta::New << exit(FatalIOError); } - return autoPtr(cstrIter()(name, turbulence, dict)); + return autoPtr(ctorPtr(name, turbulence, dict)); } diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C b/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C index 51811d6f2c..87b5232ea0 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -49,9 +49,9 @@ Foam::autoPtr Foam::LESfilter::New { const word filterType(dict.get(filterDictName)); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(filterType); + auto* ctorPtr = dictionaryConstructorTable(filterType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -62,7 +62,7 @@ Foam::autoPtr Foam::LESfilter::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(mesh, dict)); + return autoPtr(ctorPtr(mesh, dict)); } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C b/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C index 90f9a15d6b..43b5745d88 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C @@ -145,9 +145,9 @@ Foam::RASModel::New Info<< "Selecting RAS turbulence model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -160,7 +160,7 @@ Foam::RASModel::New return autoPtr ( - cstrIter()(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName) + ctorPtr(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName) ); } diff --git a/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C b/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C index 7eaf600c9f..8400b981c8 100644 --- a/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C +++ b/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -105,9 +105,9 @@ Foam::TurbulenceModel::New Info<< "Selecting turbulence model type " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -120,7 +120,7 @@ Foam::TurbulenceModel::New return autoPtr ( - cstrIter()(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName) + ctorPtr(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName) ); } diff --git a/src/TurbulenceModels/turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/generalizedNewtonianViscosityModel/generalizedNewtonianViscosityModelNew.C b/src/TurbulenceModels/turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/generalizedNewtonianViscosityModel/generalizedNewtonianViscosityModelNew.C index 17ff06d370..6d6a218093 100644 --- a/src/TurbulenceModels/turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/generalizedNewtonianViscosityModel/generalizedNewtonianViscosityModelNew.C +++ b/src/TurbulenceModels/turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/generalizedNewtonianViscosityModel/generalizedNewtonianViscosityModelNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2018-2020 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,9 +40,9 @@ Foam::laminarModels::generalizedNewtonianViscosityModel::New Info<< "Selecting generalized Newtonian model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->find(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -53,7 +53,7 @@ Foam::laminarModels::generalizedNewtonianViscosityModel::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(dict)); + return autoPtr(ctorPtr(dict)); } diff --git a/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C b/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C index 3b2b179b36..3e9eba5d0f 100644 --- a/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C +++ b/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016-2017 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -120,9 +120,9 @@ Foam::laminarModel::New Info<< "Selecting laminar stress model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -135,7 +135,7 @@ Foam::laminarModel::New return autoPtr ( - cstrIter() + ctorPtr ( alpha, rho, diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C index a9f404289b..c70d377a15 100644 --- a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C +++ b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -45,9 +45,9 @@ Foam::autoPtr Foam::reactionRateFlameArea::New Info<< "Selecting reaction rate flame area correlation " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -61,7 +61,7 @@ Foam::autoPtr Foam::reactionRateFlameArea::New const word className = modelType.substr(0, modelType.find('<')); return autoPtr - (cstrIter()(className, dict, mesh, combModel)); + (ctorPtr(className, dict, mesh, combModel)); } diff --git a/src/combustionModels/combustionModel/combustionModelTemplates.C b/src/combustionModels/combustionModel/combustionModelTemplates.C index fcf4d4a059..7473db0270 100644 --- a/src/combustionModels/combustionModel/combustionModelTemplates.C +++ b/src/combustionModels/combustionModel/combustionModelTemplates.C @@ -186,7 +186,7 @@ Foam::autoPtr Foam::combustionModel::New return autoPtr ( - ctorIter()(combModelName, thermo, turb, combustionProperties) + ctorIter.val()(combModelName, thermo, turb, combustionProperties) ); } diff --git a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C index 0ae2fd5c1f..ea6a5d9a02 100644 --- a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C +++ b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C @@ -72,9 +72,8 @@ Foam::autoPtr Foam::dynamicFvMesh::New(const IOobject& io) << exit(FatalError); } - auto doInitCstrIter = doInitConstructorTablePtr_->cfind(modelType); - - if (doInitCstrIter.found()) + auto* doInitCtor = doInitConstructorTable(modelType); + if (doInitCtor) { DebugInfo << "Constructing dynamicFvMesh with explicit initialisation" @@ -82,7 +81,7 @@ Foam::autoPtr Foam::dynamicFvMesh::New(const IOobject& io) // Two-step constructor // 1. Construct mesh, do not initialise - autoPtr meshPtr(doInitCstrIter()(io, false)); + autoPtr meshPtr(doInitCtor(io, false)); // 2. Initialise parents and itself meshPtr().init(true); @@ -90,9 +89,9 @@ Foam::autoPtr Foam::dynamicFvMesh::New(const IOobject& io) return meshPtr; } - auto cstrIter = IOobjectConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = IOobjectConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -103,7 +102,7 @@ Foam::autoPtr Foam::dynamicFvMesh::New(const IOobject& io) ) << exit(FatalIOError); } - return autoPtr(cstrIter()(io)); + return autoPtr(ctorPtr(io)); } DebugInfo diff --git a/src/dynamicFvMesh/simplifiedDynamicFvMesh/simplifiedDynamicFvMesh.C b/src/dynamicFvMesh/simplifiedDynamicFvMesh/simplifiedDynamicFvMesh.C index 7bc324253a..92403dedf1 100644 --- a/src/dynamicFvMesh/simplifiedDynamicFvMesh/simplifiedDynamicFvMesh.C +++ b/src/dynamicFvMesh/simplifiedDynamicFvMesh/simplifiedDynamicFvMesh.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -64,12 +64,12 @@ Foam::simplifiedMeshes::simplifiedDynamicFvMeshBase::New const word modelType(dict.get("dynamicFvMesh")); - auto cstrIter = timeConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = timeConstructorTable(modelType); - if (cstrIter.found()) + if (ctorPtr) { Info<< "Selecting simplified mesh model " << modelType << endl; - return autoPtr(cstrIter()(io.time(), io.name())); + return autoPtr(ctorPtr(io.time(), io.name())); } } diff --git a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C index e96bd7d725..457ffc491f 100644 --- a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C +++ b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,9 +48,9 @@ Foam::autoPtr Foam::cellLooper::New const polyMesh& mesh ) { - auto cstrIter = wordConstructorTablePtr_->cfind(type); + auto* ctorPtr = wordConstructorTable(type); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -60,7 +60,7 @@ Foam::autoPtr Foam::cellLooper::New ) << exit(FatalError); } - return autoPtr(cstrIter()(mesh)); + return autoPtr(ctorPtr(mesh)); } diff --git a/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C b/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C index 3217fff6a1..39d2654685 100644 --- a/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C +++ b/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation - Copyright (C) 2016-2019 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -108,9 +108,9 @@ Foam::displacementMotionSolver::New << exit(FatalError); } - auto cstrIter = displacementConstructorTablePtr_->cfind(solverTypeName); + auto* ctorPtr = displacementConstructorTable(solverTypeName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -123,7 +123,7 @@ Foam::displacementMotionSolver::New return autoPtr ( - cstrIter() + ctorPtr ( mesh, solverDict, diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C index 7fb8dae315..41f59990b3 100644 --- a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C +++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,9 +40,9 @@ Foam::autoPtr Foam::solidBodyMotionFunction::New Info<< "Selecting solid-body motion function " << motionType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(motionType); + auto* ctorPtr = dictionaryConstructorTable(motionType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -53,7 +53,7 @@ Foam::autoPtr Foam::solidBodyMotionFunction::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(dict, runTime)); + return autoPtr(ctorPtr(dict, runTime)); } diff --git a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C index d8952dd77e..8ec0424182 100644 --- a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C +++ b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C @@ -130,9 +130,9 @@ Foam::autoPtr Foam::motionSolver::New << exit(FatalError); } - auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverName); + auto* ctorPtr = dictionaryConstructorTable(solverName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -143,7 +143,7 @@ Foam::autoPtr Foam::motionSolver::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(mesh, solverDict)); + return autoPtr(ctorPtr(mesh, solverDict)); } diff --git a/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C b/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C index c0407cc7b6..4cfafc59be 100644 --- a/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C +++ b/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -43,9 +43,9 @@ Foam::autoPtr Foam::polyMeshModifier::New const word modelType(dict.get("type")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -56,7 +56,7 @@ Foam::autoPtr Foam::polyMeshModifier::New ) << exit(FatalIOError); } - return autoPtr(cstrIter()(name, dict, index, mme)); + return autoPtr(ctorPtr(name, dict, index, mme)); } diff --git a/src/engine/engineMesh/engineMesh/engineMeshNew.C b/src/engine/engineMesh/engineMesh/engineMeshNew.C index aa7cbedf12..9cb427c8da 100644 --- a/src/engine/engineMesh/engineMesh/engineMeshNew.C +++ b/src/engine/engineMesh/engineMesh/engineMeshNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -50,9 +50,9 @@ Foam::autoPtr Foam::engineMesh::New(const IOobject& io) Info<< "Selecting engineMesh " << modelType << endl; - auto cstrIter = IOobjectConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = IOobjectConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -63,7 +63,7 @@ Foam::autoPtr Foam::engineMesh::New(const IOobject& io) ) << exit(FatalIOError); } - return autoPtr(cstrIter()(io)); + return autoPtr(ctorPtr(io)); } diff --git a/src/engine/engineTime/engineTime/engineTimeNew.C b/src/engine/engineTime/engineTime/engineTimeNew.C index 66a3355383..2d4cba2a65 100644 --- a/src/engine/engineTime/engineTime/engineTimeNew.C +++ b/src/engine/engineTime/engineTime/engineTimeNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -52,9 +52,9 @@ Foam::autoPtr Foam::engineTime::New Info<< "Selecting engine type " << engineType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(engineType); + auto* ctorPtr = dictionaryConstructorTable(engineType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -67,7 +67,7 @@ Foam::autoPtr Foam::engineTime::New return autoPtr ( - cstrIter() + ctorPtr ( name, rootPath, diff --git a/src/faOptions/faOption/faOption.C b/src/faOptions/faOption/faOption.C index b043867f81..89632a88c0 100644 --- a/src/faOptions/faOption/faOption.C +++ b/src/faOptions/faOption/faOption.C @@ -98,9 +98,9 @@ Foam::autoPtr Foam::fa::option::New dictionaryConstructorTablePtr_ ); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInFunction << "Unknown faOption model type " @@ -110,7 +110,7 @@ Foam::autoPtr Foam::fa::option::New << exit(FatalError); } - return autoPtr