ENH: use singleton method for accessing runtime selection

STYLE: use alias to mark partialFaceAreaWeightAMI deprecation after v2012
This commit is contained in:
Mark Olesen
2021-10-12 19:44:00 +02:00
parent 4fc6ec1d1d
commit ba8d6bddcc
337 changed files with 1555 additions and 1542 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
Info<< "Selecting drag model " << modelType << endl; Info<< "Selecting drag model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -57,7 +57,9 @@ Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
} }
return autoPtr<PDRDragModel> return autoPtr<PDRDragModel>
(cstrIter()(dict, turbulence, rho, U, phi)); (
ctorPtr(dict, turbulence, rho, U, phi)
);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -42,9 +42,9 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
Info<< "Selecting flame-wrinkling model " << modelType << endl; Info<< "Selecting flame-wrinkling model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -55,7 +55,7 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<XiEqModel>(cstrIter()(dict, thermo, turbulence, Su)); return autoPtr<XiEqModel>(ctorPtr(dict, thermo, turbulence, Su));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -42,9 +42,9 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
Info<< "Selecting flame-wrinkling model " << modelType << endl; Info<< "Selecting flame-wrinkling model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -55,7 +55,7 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<XiGModel>(cstrIter()(dict, thermo, turbulence, Su)); return autoPtr<XiGModel>(ctorPtr(dict, thermo, turbulence, Su));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -45,9 +45,9 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
Info<< "Selecting flame-wrinkling model " << modelType << endl; Info<< "Selecting flame-wrinkling model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -59,7 +59,9 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
} }
return autoPtr<XiModel> return autoPtr<XiModel>
(cstrIter()(dict, thermo, turbulence, Su, rho, b, phi)); (
ctorPtr(dict, thermo, turbulence, Su, rho, b, phi)
);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2014-2015 OpenFOAM Foundation Copyright (C) 2014-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -44,9 +44,9 @@ Foam::autoPtr<Foam::mixtureViscosityModel> Foam::mixtureViscosityModel::New
Info<< "Selecting incompressible transport model " << modelType << endl; Info<< "Selecting incompressible transport model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -58,7 +58,9 @@ Foam::autoPtr<Foam::mixtureViscosityModel> Foam::mixtureViscosityModel::New
} }
return autoPtr<mixtureViscosityModel> return autoPtr<mixtureViscosityModel>
(cstrIter()(name, dict, U, phi)); (
ctorPtr(name, dict, U, phi)
);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2014-2017 OpenFOAM Foundation Copyright (C) 2014-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -111,9 +111,9 @@ Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New
Info<< "Selecting relative velocity model " << modelType << endl; Info<< "Selecting relative velocity model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -127,7 +127,7 @@ Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New
return return
autoPtr<relativeVelocityModel> autoPtr<relativeVelocityModel>
( (
cstrIter() ctorPtr
( (
dict.optionalSubDict(modelType + "Coeffs"), dict.optionalSubDict(modelType + "Coeffs"),
mixture mixture

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017-2019 OpenCFD Ltd. Copyright (C) 2017-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -41,9 +41,9 @@ Foam::radiation::reflectionModel::New
Info<< "Selecting reflectionModel " << modelType << endl; Info<< "Selecting reflectionModel " << modelType << endl;
const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -54,7 +54,7 @@ Foam::radiation::reflectionModel::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<reflectionModel>(cstrIter()(dict, mesh)); return autoPtr<reflectionModel>(ctorPtr(dict, mesh));
} }

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2019 OpenCFD Ltd. Copyright (C) 2016-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -54,9 +54,9 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New
Info<< "Selecting phaseChange model " << modelType << endl; Info<< "Selecting phaseChange model " << modelType << endl;
auto cstrIter = componentsConstructorTablePtr_->cfind(modelType); auto* ctorPtr = componentsConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -70,7 +70,7 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New
return return
autoPtr<temperaturePhaseChangeTwoPhaseMixture> autoPtr<temperaturePhaseChangeTwoPhaseMixture>
( (
cstrIter()(thermo, mesh) ctorPtr(thermo, mesh)
); );
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -56,9 +56,9 @@ Foam::phaseChangeTwoPhaseMixture::New
Info<< "Selecting phaseChange model " << modelType << endl; Info<< "Selecting phaseChange model " << modelType << endl;
auto cstrIter = componentsConstructorTablePtr_->cfind(modelType); auto* ctorPtr = componentsConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -69,7 +69,7 @@ Foam::phaseChangeTwoPhaseMixture::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<phaseChangeTwoPhaseMixture>(cstrIter()(U, phi)); return autoPtr<phaseChangeTwoPhaseMixture>(ctorPtr(U, phi));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2015 OpenFOAM Foundation Copyright (C) 2012-2015 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -80,9 +80,9 @@ Foam::cellSizeAndAlignmentControl::New
Info<< indent << "Selecting cellSizeAndAlignmentControl " Info<< indent << "Selecting cellSizeAndAlignmentControl "
<< modelType << endl; << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -95,7 +95,7 @@ Foam::cellSizeAndAlignmentControl::New
return autoPtr<cellSizeAndAlignmentControl> return autoPtr<cellSizeAndAlignmentControl>
( (
cstrIter() ctorPtr
( (
runTime, runTime,
name, name,

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -134,9 +134,9 @@ Foam::autoPtr<Foam::cellSizeFunction> Foam::cellSizeFunction::New
Info<< indent << "Selecting cellSizeFunction " << modelType << endl; Info<< indent << "Selecting cellSizeFunction " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -149,7 +149,7 @@ Foam::autoPtr<Foam::cellSizeFunction> Foam::cellSizeFunction::New
return autoPtr<cellSizeFunction> return autoPtr<cellSizeFunction>
( (
cstrIter() ctorPtr
( (
dict, dict,
surface, surface,

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2015 OpenFOAM Foundation Copyright (C) 2012-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -67,9 +67,9 @@ Foam::autoPtr<Foam::cellSizeCalculationType> Foam::cellSizeCalculationType::New
Info<< indent << "Selecting cellSizeCalculationType " << modelType << endl; Info<< indent << "Selecting cellSizeCalculationType " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -82,7 +82,7 @@ Foam::autoPtr<Foam::cellSizeCalculationType> Foam::cellSizeCalculationType::New
return autoPtr<cellSizeCalculationType> return autoPtr<cellSizeCalculationType>
( (
cstrIter()(dict, surface, defaultCellSize) ctorPtr(dict, surface, defaultCellSize)
); );
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -72,9 +72,9 @@ Foam::autoPtr<Foam::surfaceCellSizeFunction> Foam::surfaceCellSizeFunction::New
Info<< indent << "Selecting surfaceCellSizeFunction " << modelType << endl; Info<< indent << "Selecting surfaceCellSizeFunction " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -87,7 +87,7 @@ Foam::autoPtr<Foam::surfaceCellSizeFunction> Foam::surfaceCellSizeFunction::New
return autoPtr<surfaceCellSizeFunction> return autoPtr<surfaceCellSizeFunction>
( (
cstrIter()(dict, surface, defaultCellSize) ctorPtr(dict, surface, defaultCellSize)
); );
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -61,9 +61,9 @@ Foam::autoPtr<Foam::faceAreaWeightModel> Foam::faceAreaWeightModel::New
Info<< nl << "Selecting faceAreaWeightModel " << modelType << endl; Info<< nl << "Selecting faceAreaWeightModel " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -74,7 +74,7 @@ Foam::autoPtr<Foam::faceAreaWeightModel> Foam::faceAreaWeightModel::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<faceAreaWeightModel>(cstrIter()(dict)); return autoPtr<faceAreaWeightModel>(ctorPtr(dict));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -84,9 +84,9 @@ Foam::autoPtr<Foam::initialPointsMethod> Foam::initialPointsMethod::New
Info<< nl << "Selecting initialPointsMethod " << modelType << endl; Info<< nl << "Selecting initialPointsMethod " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -100,7 +100,7 @@ Foam::autoPtr<Foam::initialPointsMethod> Foam::initialPointsMethod::New
return return
autoPtr<initialPointsMethod> autoPtr<initialPointsMethod>
( (
cstrIter() ctorPtr
( (
dict, dict,
runTime, runTime,

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -65,9 +65,9 @@ Foam::autoPtr<Foam::relaxationModel> Foam::relaxationModel::New
Info<< nl << "Selecting relaxationModel " << modelType << endl; Info<< nl << "Selecting relaxationModel " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -78,7 +78,7 @@ Foam::autoPtr<Foam::relaxationModel> Foam::relaxationModel::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<relaxationModel>(cstrIter()(dict, runTime)); return autoPtr<relaxationModel>(ctorPtr(dict, runTime));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2013-2015 OpenFOAM Foundation Copyright (C) 2013-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -48,9 +48,9 @@ Foam::searchableSurfaceFeatures::New
{ {
const word modelType(surface.type() + "Features"); const word modelType(surface.type() + "Features");
auto cstrIter = dictConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -61,7 +61,7 @@ Foam::searchableSurfaceFeatures::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<searchableSurfaceFeatures>(cstrIter()(surface, dict)); return autoPtr<searchableSurfaceFeatures>(ctorPtr(surface, dict));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -71,9 +71,9 @@ Foam::autoPtr<Foam::faceSelection> Foam::faceSelection::New
{ {
const word modelType(dict.get<word>("type")); const word modelType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -84,7 +84,7 @@ Foam::autoPtr<Foam::faceSelection> Foam::faceSelection::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<faceSelection>(cstrIter()(name, mesh, dict)); return autoPtr<faceSelection>(ctorPtr(name, mesh, dict));
} }

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2015 OpenFOAM Foundation Copyright (C) 2012-2015 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -34,9 +35,9 @@ Foam::autoPtr<Foam::helpType> Foam::helpType::New
const word& helpTypeName const word& helpTypeName
) )
{ {
auto cstrIter = dictionaryConstructorTablePtr_->cfind(helpTypeName); auto* ctorPtr = dictionaryConstructorTable(helpTypeName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
// special treatment for -help // special treatment for -help
// exit without stack trace // exit without stack trace
@ -61,7 +62,7 @@ Foam::autoPtr<Foam::helpType> Foam::helpType::New
Info<< "Selecting helpType '" << helpTypeName << "'" << endl; Info<< "Selecting helpType '" << helpTypeName << "'" << endl;
return autoPtr<helpType>(cstrIter()()); return autoPtr<helpType>(ctorPtr());
} }

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2019-2020 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -40,7 +40,7 @@ using namespace Foam::constant;
namespace Foam namespace Foam
{ {
defineMemberFunctionSelectionTable(PDRobstacle, read, dictRead); defineMemberFunctionSelectionTable(PDRobstacle, read, dictionary);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016 Shell Research Ltd. Copyright (C) 2016 Shell Research Ltd.
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -178,7 +178,7 @@ public:
void, void,
PDRobstacle, PDRobstacle,
read, read,
dictRead, dictionary,
( (
PDRobstacle& obs, PDRobstacle& obs,
const dictionary& dict const dictionary& dict

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2019-2020 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -41,18 +41,20 @@ bool Foam::PDRobstacle::read(Istream& is)
const word obsType(is); const word obsType(is);
const dictionary dict(is); const dictionary dict(is);
const auto mfIter = readdictReadMemberFunctionTablePtr_->cfind(obsType); auto* mfuncPtr = readdictionaryMemberFunctionTable(obsType);
if (!mfIter.good()) if (!mfuncPtr)
{ {
FatalIOErrorInFunction(is) FatalIOErrorInLookup
<< "Unknown obstacle type: " << obsType << nl (
<< "Valid types:" << nl is,
<< readdictReadMemberFunctionTablePtr_->sortedToc() << nl "obstacle",
<< exit(FatalIOError); obsType,
*readdictionaryMemberFunctionTablePtr_
) << exit(FatalIOError);
} }
mfIter()(*this, dict); mfuncPtr(*this, dict);
return true; return true;
} }

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -45,7 +45,7 @@ using namespace Foam::constant;
PDRobstacle, \ PDRobstacle, \
obsType, \ obsType, \
read, \ read, \
dictRead, \ dictionary, \
obsName \ obsName \
); \ ); \
} \ } \

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
Copyright (C) 2019-2020 DLR Copyright (C) 2019-2020 DLR
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -46,9 +46,9 @@ Foam::autoPtr<Foam::implicitFunction> Foam::implicitFunction::New
const dictionary& dict const dictionary& dict
) )
{ {
auto cstrIter = dictConstructorTablePtr_->cfind(implicitFunctionType); auto* ctorPtr = dictConstructorTable(implicitFunctionType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -59,7 +59,7 @@ Foam::autoPtr<Foam::implicitFunction> Foam::implicitFunction::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<implicitFunction>(cstrIter()(dict)); return autoPtr<implicitFunction>(ctorPtr(dict));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -41,9 +41,9 @@ Foam::tabulatedWallFunctions::tabulatedWallFunction::New
Info<< "Selecting tabulatedWallFunction " << functionName << endl; Info<< "Selecting tabulatedWallFunction " << functionName << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionName); auto* ctorPtr = dictionaryConstructorTable(functionName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -54,7 +54,7 @@ Foam::tabulatedWallFunctions::tabulatedWallFunction::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<tabulatedWallFunction>(cstrIter()(dict, mesh)); return autoPtr<tabulatedWallFunction>(ctorPtr(dict, mesh));
} }

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017 OpenCFD Ltd. Copyright (C) 2017-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -72,9 +72,9 @@ Foam::surfaceFeaturesExtraction::method::New
{ {
const word modelType(dict.get<word>("extractionMethod")); const word modelType(dict.get<word>("extractionMethod"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -85,7 +85,7 @@ Foam::surfaceFeaturesExtraction::method::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<method>(cstrIter.val()(dict)); return autoPtr<method>(ctorPtr(dict));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2014 OpenFOAM Foundation Copyright (C) 2014 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -67,9 +67,9 @@ Foam::searchableSurfaceModifier::New
const dictionary& dict const dictionary& dict
) )
{ {
auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); auto* ctorPtr = dictionaryConstructorTable(type);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -80,7 +80,7 @@ Foam::searchableSurfaceModifier::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<searchableSurfaceModifier>(cstrIter()(geometry, dict)); return autoPtr<searchableSurfaceModifier>(ctorPtr(geometry, dict));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -39,9 +39,9 @@ Foam::autoPtr<Foam::ODESolver> Foam::ODESolver::New
const word solverType(dict.get<word>("solver")); const word solverType(dict.get<word>("solver"));
Info<< "Selecting ODE solver " << solverType << endl; Info<< "Selecting ODE solver " << solverType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverType); auto* ctorPtr = dictionaryConstructorTable(solverType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -52,7 +52,7 @@ Foam::autoPtr<Foam::ODESolver> Foam::ODESolver::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<ODESolver>(cstrIter()(odes, dict)); return autoPtr<ODESolver>(ctorPtr(odes, dict));
} }

View File

@ -58,9 +58,9 @@ Foam::autoPtr<Foam::token::compound> Foam::token::compound::New
Istream& is Istream& is
) )
{ {
auto cstrIter = IstreamConstructorTablePtr_->cfind(compoundType); auto* ctorPtr = IstreamConstructorTable(compoundType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -71,7 +71,7 @@ Foam::autoPtr<Foam::token::compound> Foam::token::compound::New
) << abort(FatalIOError); ) << abort(FatalIOError);
} }
return autoPtr<Foam::token::compound>(cstrIter()(is)); return autoPtr<Foam::token::compound>(ctorPtr(is));
} }

View File

@ -100,10 +100,10 @@ bool Foam::functionEntry::execute
return true; return true;
} }
auto mfIter = auto* mfuncPtr =
executedictionaryIstreamMemberFunctionTablePtr_->cfind(functionName); executedictionaryIstreamMemberFunctionTable(functionName);
if (!mfIter.found()) if (!mfuncPtr)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unknown functionEntry '" << functionName << "Unknown functionEntry '" << functionName
@ -114,7 +114,7 @@ bool Foam::functionEntry::execute
<< exit(FatalError); << exit(FatalError);
} }
return mfIter()(parentDict, is); return mfuncPtr(parentDict, is);
} }
@ -139,13 +139,10 @@ bool Foam::functionEntry::execute
return true; return true;
} }
auto mfIter = auto* mfuncPtr =
executeprimitiveEntryIstreamMemberFunctionTablePtr_->cfind executeprimitiveEntryIstreamMemberFunctionTable(functionName);
(
functionName
);
if (!mfIter.found()) if (!mfuncPtr)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unknown functionEntry '" << functionName << "Unknown functionEntry '" << functionName
@ -156,7 +153,7 @@ bool Foam::functionEntry::execute
<< exit(FatalError); << exit(FatalError);
} }
return mfIter()(parentDict, entry, is); return mfuncPtr(parentDict, entry, is);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2020 OpenCFD Ltd. Copyright (C) 2017-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -108,9 +108,9 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
<< exit(FatalError); << 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 // FatalError (not FatalIOError) to ensure it can be caught
// as an exception and ignored // as an exception and ignored
@ -122,7 +122,7 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
) << exit(FatalError); ) << exit(FatalError);
} }
return autoPtr<functionObject>(cstrIter()(name, runTime, dict)); return autoPtr<functionObject>(ctorPtr(name, runTime, dict));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Original code Copyright (C) 2014-2018 Bernhard Gschaider Original code Copyright (C) 2014-2018 Bernhard Gschaider
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -119,9 +119,9 @@ Foam::exprTools::expressionEntry::New
const word& name const word& name
) )
{ {
auto cstrIter = emptyConstructorTablePtr_->cfind(name); auto* ctorPtr = emptyConstructorTable(name);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -131,7 +131,7 @@ Foam::exprTools::expressionEntry::New
) << exit(FatalError); ) << exit(FatalError);
} }
return autoPtr<expressionEntry>(cstrIter()()); return autoPtr<expressionEntry>(ctorPtr());
} }

View File

@ -314,9 +314,9 @@ Foam::expressions::exprResult::New
if (dict.getOrDefault("unsetValue", false)) if (dict.getOrDefault("unsetValue", false))
{ {
auto cstrIter = emptyConstructorTablePtr_->cfind(resultType); auto* ctorPtr = emptyConstructorTable(resultType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -330,13 +330,13 @@ Foam::expressions::exprResult::New
DebugInfo DebugInfo
<< "Creating unset result of type " << resultType << nl; << "Creating unset result of type " << resultType << nl;
return autoPtr<exprResult>(cstrIter()()); return autoPtr<exprResult>(ctorPtr());
} }
auto cstrIter = dictionaryConstructorTablePtr_->cfind(resultType); auto* ctorPtr = dictionaryConstructorTable(resultType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -350,7 +350,7 @@ Foam::expressions::exprResult::New
DebugInfo DebugInfo
<< "Creating result of type " << resultType << nl; << "Creating result of type " << resultType << nl;
return autoPtr<exprResult>(cstrIter()(dict)); return autoPtr<exprResult>(ctorPtr(dict));
} }

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -93,14 +94,13 @@ Foam::pointPatchField<Type>::NewCalculatedType
const pointPatchField<Type2>& pf const pointPatchField<Type2>& pf
) )
{ {
auto patchTypeCstrIter = auto* patchTypeCtor = pointPatchConstructorTable(pf.patch().type());
pointPatchConstructorTablePtr_->cfind(pf.patch().type());
if (patchTypeCstrIter.found()) if (patchTypeCtor)
{ {
return autoPtr<pointPatchField<Type>> return autoPtr<pointPatchField<Type>>
( (
patchTypeCstrIter() patchTypeCtor
( (
pf.patch(), pf.patch(),
Field<Type>::null() Field<Type>::null()

View File

@ -39,9 +39,9 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
{ {
DebugInFunction << "Constructing pointPatchField<Type>" << endl; DebugInFunction << "Constructing pointPatchField<Type>" << endl;
auto cstrIter = pointPatchConstructorTablePtr_->cfind(patchFieldType); auto* ctorPtr = pointPatchConstructorTable(patchFieldType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -51,7 +51,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
) << exit(FatalError); ) << exit(FatalError);
} }
autoPtr<pointPatchField<Type>> pfPtr(cstrIter()(p, iF)); autoPtr<pointPatchField<Type>> pfPtr(ctorPtr(p, iF));
if if
( (
@ -64,10 +64,9 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
// Incompatible (constraint-wise) with the patch type // Incompatible (constraint-wise) with the patch type
// - use default constraint type // - use default constraint type
auto patchTypeCstrIter = auto* patchTypeCtor = pointPatchConstructorTable(p.type());
pointPatchConstructorTablePtr_->cfind(p.type());
if (!patchTypeCstrIter.found()) if (!patchTypeCtor)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Inconsistent patch and patchField types for\n" << "Inconsistent patch and patchField types for\n"
@ -76,7 +75,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
<< exit(FatalError); << exit(FatalError);
} }
return patchTypeCstrIter()(p, iF); return patchTypeCtor(p, iF);
} }
} }
else else
@ -115,16 +114,16 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
const word patchFieldType(dict.get<word>("type")); const word patchFieldType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType); auto* ctorPtr = dictionaryConstructorTable(patchFieldType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
if (!disallowGenericPointPatchField) if (!disallowGenericPointPatchField)
{ {
cstrIter = dictionaryConstructorTablePtr_->cfind("generic"); ctorPtr = dictionaryConstructorTable("generic");
} }
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "Unknown patchField type " << patchFieldType << "Unknown patchField type " << patchFieldType
@ -136,7 +135,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
} }
// Construct (but not necessarily returned) // Construct (but not necessarily returned)
autoPtr<pointPatchField<Type>> pfPtr(cstrIter()(p, iF, dict)); autoPtr<pointPatchField<Type>> pfPtr(ctorPtr(p, iF, dict));
if if
( (
@ -149,10 +148,9 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
// Incompatible (constraint-wise) with the patch type // Incompatible (constraint-wise) with the patch type
// - use default constraint type // - use default constraint type
auto patchTypeCstrIter = auto* patchTypeCtor = dictionaryConstructorTable(p.type());
dictionaryConstructorTablePtr_->cfind(p.type());
if (!patchTypeCstrIter.found()) if (!patchTypeCtor)
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "Inconsistent patch and patchField types for\n" << "Inconsistent patch and patchField types for\n"
@ -161,7 +159,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
<< exit(FatalIOError); << exit(FatalIOError);
} }
return patchTypeCstrIter()(p, iF, dict); return patchTypeCtor(p, iF, dict);
} }
} }
@ -180,9 +178,9 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
{ {
DebugInFunction << "Constructing pointPatchField<Type>" << endl; DebugInFunction << "Constructing pointPatchField<Type>" << endl;
auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type()); auto* ctorPtr = patchMapperConstructorTable(ptf.type());
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -192,7 +190,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
) << exit(FatalError); ) << exit(FatalError);
} }
return cstrIter()(ptf, p, iF, pfMapper); return ctorPtr(ptf, p, iF, pfMapper);
} }

View File

@ -711,9 +711,9 @@ Foam::fileOperation::New
DebugInFunction DebugInFunction
<< "Constructing fileHandler" << endl; << "Constructing fileHandler" << endl;
auto cstrIter = wordConstructorTablePtr_->cfind(handlerType); auto* ctorPtr = wordConstructorTable(handlerType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -723,7 +723,7 @@ Foam::fileOperation::New
) << abort(FatalError); ) << abort(FatalError);
} }
return autoPtr<fileOperation>(cstrIter()(verbose)); return autoPtr<fileOperation>(ctorPtr(verbose));
} }

View File

@ -85,9 +85,9 @@ Foam::fileOperations::fileOperationInitialise::New
{ {
DebugInFunction << "Constructing fileOperationInitialise" << endl; DebugInFunction << "Constructing fileOperationInitialise" << endl;
auto cstrIter = wordConstructorTablePtr_->cfind(type); auto* ctorPtr = wordConstructorTable(type);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -97,7 +97,7 @@ Foam::fileOperations::fileOperationInitialise::New
) << abort(FatalError); ) << abort(FatalError);
} }
return autoPtr<fileOperationInitialise>(cstrIter()(argc, argv)); return autoPtr<fileOperationInitialise>(ctorPtr(argc, argv));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -219,9 +219,9 @@ Foam::autoPtr<Foam::graph::writer> Foam::graph::writer::New
<< exit(FatalError); << exit(FatalError);
} }
auto cstrIter = wordConstructorTablePtr_->cfind(graphFormat); auto* ctorPtr = wordConstructorTable(graphFormat);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -231,7 +231,7 @@ Foam::autoPtr<Foam::graph::writer> Foam::graph::writer::New
) << exit(FatalError); ) << exit(FatalError);
} }
return autoPtr<graph::writer>(cstrIter()()); return autoPtr<graph::writer>(ctorPtr());
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -42,9 +42,9 @@ Foam::autoPtr<Foam::tableReader<Type>> Foam::tableReader<Type>::New
"openFoam" "openFoam"
); );
auto cstrIter = dictionaryConstructorTablePtr_->cfind(readerType); auto* ctorPtr = dictionaryConstructorTable(readerType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -55,7 +55,7 @@ Foam::autoPtr<Foam::tableReader<Type>> Foam::tableReader<Type>::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<tableReader<Type>>(cstrIter()(spec)); return autoPtr<tableReader<Type>>(ctorPtr(spec));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2015 OpenFOAM Foundation Copyright (C) 2012-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -57,9 +57,9 @@ Foam::autoPtr<Foam::interpolationWeights> Foam::interpolationWeights::New
{ {
DebugInFunction << "Selecting interpolationWeights " << type << endl; DebugInFunction << "Selecting interpolationWeights " << type << endl;
auto cstrIter = wordConstructorTablePtr_->cfind(type); auto* ctorPtr = wordConstructorTable(type);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -69,7 +69,7 @@ Foam::autoPtr<Foam::interpolationWeights> Foam::interpolationWeights::New
) << exit(FatalError); ) << exit(FatalError);
} }
return autoPtr<interpolationWeights>(cstrIter()(samples)); return autoPtr<interpolationWeights>(ctorPtr(samples));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -45,10 +45,9 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
if (sol.matrix().symmetric()) if (sol.matrix().symmetric())
{ {
auto cstrIter = auto* ctorPtr = symMatrixConstructorTable(preconditionerName);
symMatrixConstructorTablePtr_->cfind(preconditionerName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -61,7 +60,7 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner> return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner>
( (
cstrIter() ctorPtr
( (
sol, sol,
preconditionerDict preconditionerDict
@ -70,10 +69,9 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
} }
else if (sol.matrix().asymmetric()) else if (sol.matrix().asymmetric())
{ {
auto cstrIter = auto* ctorPtr = asymMatrixConstructorTable(preconditionerName);
asymMatrixConstructorTablePtr_->cfind(preconditionerName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -86,7 +84,7 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner> return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner>
( (
cstrIter() ctorPtr
( (
sol, sol,
preconditionerDict preconditionerDict

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -43,9 +43,9 @@ Foam::LduMatrix<Type, DType, LUType>::smoother::New
if (matrix.symmetric()) if (matrix.symmetric())
{ {
auto cstrIter = symMatrixConstructorTablePtr_->cfind(smootherName); auto* ctorPtr = symMatrixConstructorTable(smootherName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -58,7 +58,7 @@ Foam::LduMatrix<Type, DType, LUType>::smoother::New
return autoPtr<typename LduMatrix<Type, DType, LUType>::smoother> return autoPtr<typename LduMatrix<Type, DType, LUType>::smoother>
( (
cstrIter() ctorPtr
( (
fieldName, fieldName,
matrix matrix
@ -67,9 +67,9 @@ Foam::LduMatrix<Type, DType, LUType>::smoother::New
} }
else if (matrix.asymmetric()) else if (matrix.asymmetric())
{ {
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(smootherName); auto* ctorPtr = asymMatrixConstructorTable(smootherName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -82,7 +82,7 @@ Foam::LduMatrix<Type, DType, LUType>::smoother::New
return autoPtr<typename LduMatrix<Type, DType, LUType>::smoother> return autoPtr<typename LduMatrix<Type, DType, LUType>::smoother>
( (
cstrIter() ctorPtr
( (
fieldName, fieldName,
matrix matrix

View File

@ -56,9 +56,9 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New
} }
else if (matrix.symmetric()) else if (matrix.symmetric())
{ {
auto cstrIter = symMatrixConstructorTablePtr_->cfind(solverName); auto* ctorPtr = symMatrixConstructorTable(solverName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -71,7 +71,7 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New
return autoPtr<typename LduMatrix<Type, DType, LUType>::solver> return autoPtr<typename LduMatrix<Type, DType, LUType>::solver>
( (
cstrIter() ctorPtr
( (
fieldName, fieldName,
matrix, matrix,
@ -81,9 +81,9 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New
} }
else if (matrix.asymmetric()) else if (matrix.asymmetric())
{ {
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(solverName); auto* ctorPtr = asymMatrixConstructorTable(solverName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -96,7 +96,7 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New
return autoPtr<typename LduMatrix<Type, DType, LUType>::solver> return autoPtr<typename LduMatrix<Type, DType, LUType>::solver>
( (
cstrIter() ctorPtr
( (
fieldName, fieldName,
matrix, matrix,

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -90,9 +90,9 @@ Foam::lduMatrix::preconditioner::New
if (sol.matrix().symmetric()) if (sol.matrix().symmetric())
{ {
auto cstrIter = symMatrixConstructorTablePtr_->cfind(name); auto* ctorPtr = symMatrixConstructorTable(name);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -105,7 +105,7 @@ Foam::lduMatrix::preconditioner::New
return autoPtr<lduMatrix::preconditioner> return autoPtr<lduMatrix::preconditioner>
( (
cstrIter() ctorPtr
( (
sol, sol,
controls controls
@ -114,9 +114,9 @@ Foam::lduMatrix::preconditioner::New
} }
else if (sol.matrix().asymmetric()) else if (sol.matrix().asymmetric())
{ {
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name); auto* ctorPtr = asymMatrixConstructorTable(name);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -129,7 +129,7 @@ Foam::lduMatrix::preconditioner::New
return autoPtr<lduMatrix::preconditioner> return autoPtr<lduMatrix::preconditioner>
( (
cstrIter() ctorPtr
( (
sol, sol,
controls controls

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -93,9 +93,9 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New
if (matrix.symmetric()) if (matrix.symmetric())
{ {
auto cstrIter = symMatrixConstructorTablePtr_->cfind(name); auto* ctorPtr = symMatrixConstructorTable(name);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -108,7 +108,7 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New
return autoPtr<lduMatrix::smoother> return autoPtr<lduMatrix::smoother>
( (
cstrIter() ctorPtr
( (
fieldName, fieldName,
matrix, matrix,
@ -120,9 +120,9 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New
} }
else if (matrix.asymmetric()) else if (matrix.asymmetric())
{ {
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name); auto* ctorPtr = asymMatrixConstructorTable(name);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -135,7 +135,7 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New
return autoPtr<lduMatrix::smoother> return autoPtr<lduMatrix::smoother>
( (
cstrIter() ctorPtr
( (
fieldName, fieldName,
matrix, matrix,

View File

@ -70,9 +70,9 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
} }
else if (matrix.symmetric()) else if (matrix.symmetric())
{ {
auto cstrIter = symMatrixConstructorTablePtr_->cfind(name); auto* ctorPtr = symMatrixConstructorTable(name);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -85,7 +85,7 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
return autoPtr<lduMatrix::solver> return autoPtr<lduMatrix::solver>
( (
cstrIter() ctorPtr
( (
fieldName, fieldName,
matrix, matrix,
@ -98,9 +98,9 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
} }
else if (matrix.asymmetric()) else if (matrix.asymmetric())
{ {
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name); auto* ctorPtr = asymMatrixConstructorTable(name);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -113,7 +113,7 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
return autoPtr<lduMatrix::solver> return autoPtr<lduMatrix::solver>
( (
cstrIter() ctorPtr
( (
fieldName, fieldName,
matrix, matrix,

View File

@ -319,9 +319,9 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
lduMeshConstructorTablePtr_ lduMeshConstructorTablePtr_
); );
auto cstrIter = lduMeshConstructorTablePtr_->cfind(agglomeratorType); auto* ctorPtr = lduMeshConstructorTable(agglomeratorType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unknown GAMGAgglomeration type " << "Unknown GAMGAgglomeration type "
@ -333,7 +333,7 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
<< exit(FatalError); << 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_ lduMatrixConstructorTablePtr_
); );
if auto* ctorPtr = lduMatrixConstructorTable(agglomeratorType);
(
!lduMatrixConstructorTablePtr_ if (!ctorPtr)
|| !lduMatrixConstructorTablePtr_->found(agglomeratorType)
)
{ {
return New(mesh, controlDict); return New(mesh, controlDict);
} }
else else
{ {
auto cstrIter = return store(ctorPtr(matrix, controlDict).ptr());
lduMatrixConstructorTablePtr_->cfind(agglomeratorType);
return store(cstrIter()(matrix, controlDict).ptr());
} }
} }
} }
@ -422,9 +417,9 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
geometryConstructorTablePtr_ geometryConstructorTablePtr_
); );
auto cstrIter = geometryConstructorTablePtr_->cfind(agglomeratorType); auto* ctorPtr = geometryConstructorTable(agglomeratorType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unknown GAMGAgglomeration type " << "Unknown GAMGAgglomeration type "
@ -436,7 +431,7 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
return store return store
( (
cstrIter() ctorPtr
( (
mesh, mesh,
cellVolumes, cellVolumes,

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -364,9 +365,9 @@ Foam::autoPtr<Foam::GAMGProcAgglomeration> Foam::GAMGProcAgglomeration::New
{ {
DebugInFunction << "Constructing GAMGProcAgglomeration" << endl; DebugInFunction << "Constructing GAMGProcAgglomeration" << endl;
auto cstrIter = GAMGAgglomerationConstructorTablePtr_->cfind(type); auto* ctorPtr = GAMGAgglomerationConstructorTable(type);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unknown GAMGProcAgglomeration type " << "Unknown GAMGProcAgglomeration type "
@ -376,7 +377,7 @@ Foam::autoPtr<Foam::GAMGProcAgglomeration> Foam::GAMGProcAgglomeration::New
<< exit(FatalError); << exit(FatalError);
} }
return autoPtr<GAMGProcAgglomeration>(cstrIter()(agglom, controlDict)); return autoPtr<GAMGProcAgglomeration>(ctorPtr(agglom, controlDict));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -38,9 +38,9 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New
{ {
const word coupleType(fineInterface.interfaceFieldType()); const word coupleType(fineInterface.interfaceFieldType());
auto cstrIter = lduInterfaceFieldConstructorTablePtr_->cfind(coupleType); auto* ctorPtr = lduInterfaceFieldConstructorTable(coupleType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -50,7 +50,7 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New
) << exit(FatalError); ) << exit(FatalError);
} }
return autoPtr<GAMGInterfaceField>(cstrIter()(GAMGCp, fineInterface)); return autoPtr<GAMGInterfaceField>(ctorPtr(GAMGCp, fineInterface));
} }
@ -63,9 +63,9 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New
{ {
const word coupleType(GAMGCp.type()); const word coupleType(GAMGCp.type());
auto cstrIter = lduInterfaceConstructorTablePtr_->cfind(coupleType); auto* ctorPtr = lduInterfaceConstructorTable(coupleType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -75,7 +75,7 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New
) << exit(FatalError); ) << exit(FatalError);
} }
return autoPtr<GAMGInterfaceField>(cstrIter()(GAMGCp, doTransform, rank)); return autoPtr<GAMGInterfaceField>(ctorPtr(GAMGCp, doTransform, rank));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -46,9 +46,9 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
{ {
const word coupleType(fineInterface.type()); const word coupleType(fineInterface.type());
auto cstrIter = lduInterfaceConstructorTablePtr_->cfind(coupleType); auto* ctorPtr = lduInterfaceConstructorTable(coupleType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -60,7 +60,7 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
return autoPtr<GAMGInterface> return autoPtr<GAMGInterface>
( (
cstrIter() ctorPtr
( (
index, index,
coarseInterfaces, coarseInterfaces,
@ -82,9 +82,9 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
Istream& is Istream& is
) )
{ {
auto cstrIter = IstreamConstructorTablePtr_->cfind(coupleType); auto* ctorPtr = IstreamConstructorTable(coupleType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -94,7 +94,7 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
) << exit(FatalError); ) << exit(FatalError);
} }
return autoPtr<GAMGInterface>(cstrIter()(index, coarseInterfaces, is)); return autoPtr<GAMGInterface>(ctorPtr(index, coarseInterfaces, is));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -38,9 +38,9 @@ Foam::autoPtr<Foam::facePointPatch> Foam::facePointPatch::New
{ {
DebugInFunction << "Constructing facePointPatch" << endl; DebugInFunction << "Constructing facePointPatch" << endl;
auto cstrIter = polyPatchConstructorTablePtr_->cfind(patch.type()); auto* ctorPtr = polyPatchConstructorTable(patch.type());
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -50,7 +50,7 @@ Foam::autoPtr<Foam::facePointPatch> Foam::facePointPatch::New
) << exit(FatalError); ) << exit(FatalError);
} }
return autoPtr<facePointPatch>(cstrIter()(patch, bm)); return autoPtr<facePointPatch>(ctorPtr(patch, bm));
} }

View File

@ -276,21 +276,27 @@ Foam::polyPatch::~polyPatch()
bool Foam::polyPatch::constraintType(const word& pt) bool Foam::polyPatch::constraintType(const word& pt)
{ {
return pointPatchField<scalar>::pointPatchConstructorTablePtr_->found(pt); return
(
pointPatchField<scalar>::pointPatchConstructorTablePtr_
&& pointPatchField<scalar>::pointPatchConstructorTablePtr_->found(pt)
);
} }
Foam::wordList Foam::polyPatch::constraintTypes() Foam::wordList Foam::polyPatch::constraintTypes()
{ {
wordList cTypes(dictionaryConstructorTablePtr_->size()); const auto& cnstrTable = *dictionaryConstructorTablePtr_;
wordList cTypes(cnstrTable.size());
label i = 0; 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();
} }
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New
{ {
DebugInFunction << "Constructing polyPatch" << endl; DebugInFunction << "Constructing polyPatch" << endl;
auto cstrIter = wordConstructorTablePtr_->cfind(patchType); auto* ctorPtr = wordConstructorTable(patchType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -57,7 +57,7 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New
return autoPtr<polyPatch> return autoPtr<polyPatch>
( (
cstrIter() ctorPtr
( (
name, name,
size, size,
@ -98,16 +98,16 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New
{ {
DebugInFunction << "Constructing polyPatch" << endl; DebugInFunction << "Constructing polyPatch" << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchType); auto* ctorPtr = dictionaryConstructorTable(patchType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
if (!disallowGenericPolyPatch) if (!disallowGenericPolyPatch)
{ {
cstrIter = dictionaryConstructorTablePtr_->cfind("genericPatch"); ctorPtr = dictionaryConstructorTable("genericPatch");
} }
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -119,7 +119,7 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New
} }
} }
return autoPtr<polyPatch>(cstrIter()(name, dict, index, bm, patchType)); return autoPtr<polyPatch>(ctorPtr(name, dict, index, bm, patchType));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::cellZone> Foam::cellZone::New
const word zoneType(dict.get<word>("type")); const word zoneType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType); auto* ctorPtr = dictionaryConstructorTable(zoneType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -56,7 +56,7 @@ Foam::autoPtr<Foam::cellZone> Foam::cellZone::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<cellZone>(cstrIter()(name, dict, index, zm)); return autoPtr<cellZone>(ctorPtr(name, dict, index, zm));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::faceZone> Foam::faceZone::New
const word zoneType(dict.get<word>("type")); const word zoneType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType); auto* ctorPtr = dictionaryConstructorTable(zoneType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -56,7 +56,7 @@ Foam::autoPtr<Foam::faceZone> Foam::faceZone::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<faceZone>(cstrIter()(name, dict, index, zm)); return autoPtr<faceZone>(ctorPtr(name, dict, index, zm));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::pointZone> Foam::pointZone::New
const word zoneType(dict.get<word>("type")); const word zoneType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType); auto* ctorPtr = dictionaryConstructorTable(zoneType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -56,7 +56,7 @@ Foam::autoPtr<Foam::pointZone> Foam::pointZone::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<pointZone>(cstrIter()(name, dict, index, zm)); return autoPtr<pointZone>(ctorPtr(name, dict, index, zm));
} }

View File

@ -123,9 +123,9 @@ Foam::Function1<Type>::New
} }
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "Unknown Function1 type " << "Unknown Function1 type "
@ -135,7 +135,7 @@ Foam::Function1<Type>::New
<< exit(FatalIOError); << exit(FatalIOError);
} }
return cstrIter()(entryName, *coeffs); return ctorPtr(entryName, *coeffs);
} }

View File

@ -163,9 +163,9 @@ Foam::LESModel<BasicTurbulenceModel>::New
Info<< "Selecting LES turbulence model " << modelType << endl; Info<< "Selecting LES turbulence model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -178,7 +178,7 @@ Foam::LESModel<BasicTurbulenceModel>::New
return autoPtr<LESModel> return autoPtr<LESModel>
( (
cstrIter()(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName) ctorPtr(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName)
); );
} }

View File

@ -77,9 +77,9 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New
Info<< "Selecting LES " << lookupName << " type " << deltaType << endl; Info<< "Selecting LES " << lookupName << " type " << deltaType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(deltaType); auto* ctorPtr = dictionaryConstructorTable(deltaType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -90,7 +90,7 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<LESdelta>(cstrIter()(name, turbulence, dict)); return autoPtr<LESdelta>(ctorPtr(name, turbulence, dict));
} }
@ -107,16 +107,19 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New
Info<< "Selecting LES " << lookupName << " type " << deltaType << endl; Info<< "Selecting LES " << lookupName << " type " << deltaType << endl;
// Additional ones first // First any additional ones
auto cstrIter = additionalConstructors.cfind(deltaType);
// Regular ones
if (!cstrIter.found())
{ {
cstrIter = dictionaryConstructorTablePtr_->cfind(deltaType); auto ctorIter = additionalConstructors.cfind(deltaType);
if (ctorIter.found())
{
return autoPtr<LESdelta>(ctorIter.val()(name, turbulence, dict));
}
} }
if (!cstrIter.found()) auto* ctorPtr = dictionaryConstructorTable(deltaType);
if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -126,7 +129,7 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New
*dictionaryConstructorTablePtr_ *dictionaryConstructorTablePtr_
); );
if (additionalConstructors.size()) if (!additionalConstructors.empty())
{ {
FatalIOError FatalIOError
<< " and " << additionalConstructors.sortedToc() << nl; << " and " << additionalConstructors.sortedToc() << nl;
@ -136,7 +139,7 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New
<< exit(FatalIOError); << exit(FatalIOError);
} }
return autoPtr<LESdelta>(cstrIter()(name, turbulence, dict)); return autoPtr<LESdelta>(ctorPtr(name, turbulence, dict));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -49,9 +49,9 @@ Foam::autoPtr<Foam::LESfilter> Foam::LESfilter::New
{ {
const word filterType(dict.get<word>(filterDictName)); const word filterType(dict.get<word>(filterDictName));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(filterType); auto* ctorPtr = dictionaryConstructorTable(filterType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -62,7 +62,7 @@ Foam::autoPtr<Foam::LESfilter> Foam::LESfilter::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<LESfilter>(cstrIter()(mesh, dict)); return autoPtr<LESfilter>(ctorPtr(mesh, dict));
} }

View File

@ -145,9 +145,9 @@ Foam::RASModel<BasicTurbulenceModel>::New
Info<< "Selecting RAS turbulence model " << modelType << endl; Info<< "Selecting RAS turbulence model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -160,7 +160,7 @@ Foam::RASModel<BasicTurbulenceModel>::New
return autoPtr<RASModel> return autoPtr<RASModel>
( (
cstrIter()(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName) ctorPtr(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName)
); );
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -105,9 +105,9 @@ Foam::TurbulenceModel<Alpha, Rho, BasicTurbulenceModel, TransportModel>::New
Info<< "Selecting turbulence model type " << modelType << endl; Info<< "Selecting turbulence model type " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -120,7 +120,7 @@ Foam::TurbulenceModel<Alpha, Rho, BasicTurbulenceModel, TransportModel>::New
return autoPtr<TurbulenceModel> return autoPtr<TurbulenceModel>
( (
cstrIter()(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName) ctorPtr(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName)
); );
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd. Copyright (C) 2020-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -40,9 +40,9 @@ Foam::laminarModels::generalizedNewtonianViscosityModel::New
Info<< "Selecting generalized Newtonian model " << modelType << endl; Info<< "Selecting generalized Newtonian model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->find(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -53,7 +53,7 @@ Foam::laminarModels::generalizedNewtonianViscosityModel::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<generalizedNewtonianViscosityModel>(cstrIter()(dict)); return autoPtr<generalizedNewtonianViscosityModel>(ctorPtr(dict));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2017 OpenFOAM Foundation Copyright (C) 2016-2017 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -120,9 +120,9 @@ Foam::laminarModel<BasicTurbulenceModel>::New
Info<< "Selecting laminar stress model " << modelType << endl; Info<< "Selecting laminar stress model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -135,7 +135,7 @@ Foam::laminarModel<BasicTurbulenceModel>::New
return autoPtr<laminarModel> return autoPtr<laminarModel>
( (
cstrIter() ctorPtr
( (
alpha, alpha,
rho, rho,

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -45,9 +45,9 @@ Foam::autoPtr<Foam::reactionRateFlameArea> Foam::reactionRateFlameArea::New
Info<< "Selecting reaction rate flame area correlation " Info<< "Selecting reaction rate flame area correlation "
<< modelType << endl; << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -61,7 +61,7 @@ Foam::autoPtr<Foam::reactionRateFlameArea> Foam::reactionRateFlameArea::New
const word className = modelType.substr(0, modelType.find('<')); const word className = modelType.substr(0, modelType.find('<'));
return autoPtr<reactionRateFlameArea> return autoPtr<reactionRateFlameArea>
(cstrIter()(className, dict, mesh, combModel)); (ctorPtr(className, dict, mesh, combModel));
} }

View File

@ -186,7 +186,7 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New
return autoPtr<CombustionModel> return autoPtr<CombustionModel>
( (
ctorIter()(combModelName, thermo, turb, combustionProperties) ctorIter.val()(combModelName, thermo, turb, combustionProperties)
); );
} }

View File

@ -72,9 +72,8 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io)
<< exit(FatalError); << exit(FatalError);
} }
auto doInitCstrIter = doInitConstructorTablePtr_->cfind(modelType); auto* doInitCtor = doInitConstructorTable(modelType);
if (doInitCtor)
if (doInitCstrIter.found())
{ {
DebugInfo DebugInfo
<< "Constructing dynamicFvMesh with explicit initialisation" << "Constructing dynamicFvMesh with explicit initialisation"
@ -82,7 +81,7 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io)
// Two-step constructor // Two-step constructor
// 1. Construct mesh, do not initialise // 1. Construct mesh, do not initialise
autoPtr<dynamicFvMesh> meshPtr(doInitCstrIter()(io, false)); autoPtr<dynamicFvMesh> meshPtr(doInitCtor(io, false));
// 2. Initialise parents and itself // 2. Initialise parents and itself
meshPtr().init(true); meshPtr().init(true);
@ -90,9 +89,9 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io)
return meshPtr; return meshPtr;
} }
auto cstrIter = IOobjectConstructorTablePtr_->cfind(modelType); auto* ctorPtr = IOobjectConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -103,7 +102,7 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io)
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<dynamicFvMesh>(cstrIter()(io)); return autoPtr<dynamicFvMesh>(ctorPtr(io));
} }
DebugInfo DebugInfo

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2018 OpenCFD Ltd. Copyright (C) 2018-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -64,12 +64,12 @@ Foam::simplifiedMeshes::simplifiedDynamicFvMeshBase::New
const word modelType(dict.get<word>("dynamicFvMesh")); const word modelType(dict.get<word>("dynamicFvMesh"));
auto cstrIter = timeConstructorTablePtr_->cfind(modelType); auto* ctorPtr = timeConstructorTable(modelType);
if (cstrIter.found()) if (ctorPtr)
{ {
Info<< "Selecting simplified mesh model " << modelType << endl; Info<< "Selecting simplified mesh model " << modelType << endl;
return autoPtr<dynamicFvMesh>(cstrIter()(io.time(), io.name())); return autoPtr<dynamicFvMesh>(ctorPtr(io.time(), io.name()));
} }
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -48,9 +48,9 @@ Foam::autoPtr<Foam::cellLooper> Foam::cellLooper::New
const polyMesh& mesh const polyMesh& mesh
) )
{ {
auto cstrIter = wordConstructorTablePtr_->cfind(type); auto* ctorPtr = wordConstructorTable(type);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -60,7 +60,7 @@ Foam::autoPtr<Foam::cellLooper> Foam::cellLooper::New
) << exit(FatalError); ) << exit(FatalError);
} }
return autoPtr<cellLooper>(cstrIter()(mesh)); return autoPtr<cellLooper>(ctorPtr(mesh));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2016-2019 OpenCFD Ltd. Copyright (C) 2016-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -108,9 +108,9 @@ Foam::displacementMotionSolver::New
<< exit(FatalError); << exit(FatalError);
} }
auto cstrIter = displacementConstructorTablePtr_->cfind(solverTypeName); auto* ctorPtr = displacementConstructorTable(solverTypeName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -123,7 +123,7 @@ Foam::displacementMotionSolver::New
return autoPtr<displacementMotionSolver> return autoPtr<displacementMotionSolver>
( (
cstrIter() ctorPtr
( (
mesh, mesh,
solverDict, solverDict,

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -40,9 +40,9 @@ Foam::autoPtr<Foam::solidBodyMotionFunction> Foam::solidBodyMotionFunction::New
Info<< "Selecting solid-body motion function " << motionType << endl; Info<< "Selecting solid-body motion function " << motionType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(motionType); auto* ctorPtr = dictionaryConstructorTable(motionType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -53,7 +53,7 @@ Foam::autoPtr<Foam::solidBodyMotionFunction> Foam::solidBodyMotionFunction::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<solidBodyMotionFunction>(cstrIter()(dict, runTime)); return autoPtr<solidBodyMotionFunction>(ctorPtr(dict, runTime));
} }

View File

@ -130,9 +130,9 @@ Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New
<< exit(FatalError); << exit(FatalError);
} }
auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverName); auto* ctorPtr = dictionaryConstructorTable(solverName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -143,7 +143,7 @@ Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<motionSolver>(cstrIter()(mesh, solverDict)); return autoPtr<motionSolver>(ctorPtr(mesh, solverDict));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::polyMeshModifier> Foam::polyMeshModifier::New
const word modelType(dict.get<word>("type")); const word modelType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -56,7 +56,7 @@ Foam::autoPtr<Foam::polyMeshModifier> Foam::polyMeshModifier::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<polyMeshModifier>(cstrIter()(name, dict, index, mme)); return autoPtr<polyMeshModifier>(ctorPtr(name, dict, index, mme));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -50,9 +50,9 @@ Foam::autoPtr<Foam::engineMesh> Foam::engineMesh::New(const IOobject& io)
Info<< "Selecting engineMesh " << modelType << endl; Info<< "Selecting engineMesh " << modelType << endl;
auto cstrIter = IOobjectConstructorTablePtr_->cfind(modelType); auto* ctorPtr = IOobjectConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -63,7 +63,7 @@ Foam::autoPtr<Foam::engineMesh> Foam::engineMesh::New(const IOobject& io)
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<engineMesh>(cstrIter()(io)); return autoPtr<engineMesh>(ctorPtr(io));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -52,9 +52,9 @@ Foam::autoPtr<Foam::engineTime> Foam::engineTime::New
Info<< "Selecting engine type " << engineType << endl; Info<< "Selecting engine type " << engineType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(engineType); auto* ctorPtr = dictionaryConstructorTable(engineType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -67,7 +67,7 @@ Foam::autoPtr<Foam::engineTime> Foam::engineTime::New
return autoPtr<engineTime> return autoPtr<engineTime>
( (
cstrIter() ctorPtr
( (
name, name,
rootPath, rootPath,

View File

@ -98,9 +98,9 @@ Foam::autoPtr<Foam::fa::option> Foam::fa::option::New
dictionaryConstructorTablePtr_ dictionaryConstructorTablePtr_
); );
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unknown faOption model type " << "Unknown faOption model type "
@ -110,7 +110,7 @@ Foam::autoPtr<Foam::fa::option> Foam::fa::option::New
<< exit(FatalError); << exit(FatalError);
} }
return autoPtr<option>(cstrIter()(name, modelType, coeffs, patch)); return autoPtr<option>(ctorPtr(name, modelType, coeffs, patch));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -39,9 +39,9 @@ Foam::autoPtr<Foam::writer<Type>> Foam::writer<Type>::New
const word& writeType const word& writeType
) )
{ {
auto cstrIter = wordConstructorTablePtr_->cfind(writeType); auto* ctorPtr = wordConstructorTable(writeType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -51,7 +51,7 @@ Foam::autoPtr<Foam::writer<Type>> Foam::writer<Type>::New
) << exit(FatalError); ) << exit(FatalError);
} }
return autoPtr<writer<Type>>(cstrIter()()); return autoPtr<writer<Type>>(ctorPtr());
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::faPatch> Foam::faPatch::New
const word patchType(dict.get<word>("type")); const word patchType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchType); auto* ctorPtr = dictionaryConstructorTable(patchType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -56,7 +56,7 @@ Foam::autoPtr<Foam::faPatch> Foam::faPatch::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<faPatch>(cstrIter()(name, dict, index, bm)); return autoPtr<faPatch>(ctorPtr(name, dict, index, bm));
} }

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -103,12 +104,11 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::NewCalculatedType
const faPatchField<Type2>& pf const faPatchField<Type2>& pf
) )
{ {
auto patchTypeCstrIter = auto* patchTypeCtor = patchConstructorTable(pf.patch().type());
patchConstructorTablePtr_->cfind(pf.patch().type());
if (patchTypeCstrIter.found()) if (patchTypeCtor)
{ {
return patchTypeCstrIter() return patchTypeCtor
( (
pf.patch(), pf.patch(),
DimensionedField<Type, areaMesh>::null() DimensionedField<Type, areaMesh>::null()

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019-2020 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -44,9 +44,9 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
<< "p.Type():" << p.type() << "p.Type():" << p.type()
<< endl; << endl;
auto cstrIter = patchConstructorTablePtr_->cfind(patchFieldType); auto* ctorPtr = patchConstructorTable(patchFieldType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -56,7 +56,7 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
) << exit(FatalError); ) << exit(FatalError);
} }
auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type()); auto* patchTypeCtor = patchConstructorTable(p.type());
if if
( (
@ -64,21 +64,21 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
|| actualPatchType != p.type() || actualPatchType != p.type()
) )
{ {
if (patchTypeCstrIter.found()) if (patchTypeCtor)
{ {
return patchTypeCstrIter()(p, iF); return patchTypeCtor(p, iF);
} }
else else
{ {
return cstrIter()(p, iF); return ctorPtr(p, iF);
} }
} }
tmp<faPatchField<Type>> tfap = cstrIter()(p, iF); tmp<faPatchField<Type>> tfap = ctorPtr(p, iF);
// Check if constraint type override and store patchType if so // Check if constraint type override and store patchType if so
if (patchTypeCstrIter.found()) if (patchTypeCtor)
{ {
tfap.ref().patchType() = actualPatchType; tfap.ref().patchType() = actualPatchType;
} }
@ -110,16 +110,16 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
const word patchFieldType(dict.get<word>("type")); const word patchFieldType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType); auto* ctorPtr = dictionaryConstructorTable(patchFieldType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
if (!disallowGenericFaPatchField) if (!disallowGenericFaPatchField)
{ {
cstrIter = dictionaryConstructorTablePtr_->cfind("generic"); ctorPtr = dictionaryConstructorTable("generic");
} }
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "Unknown patchField type " << patchFieldType << "Unknown patchField type " << patchFieldType
@ -130,9 +130,9 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
} }
} }
auto patchTypeCstrIter = dictionaryConstructorTablePtr_->cfind(p.type()); auto* patchTypeCtor = dictionaryConstructorTable(p.type());
if (patchTypeCstrIter.found() && *patchTypeCstrIter != *cstrIter) if (patchTypeCtor && patchTypeCtor != ctorPtr)
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "inconsistent patch and patchField types for \n" << "inconsistent patch and patchField types for \n"
@ -141,7 +141,7 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
<< exit(FatalIOError); << exit(FatalIOError);
} }
return cstrIter()(p, iF, dict); return ctorPtr(p, iF, dict);
} }
@ -156,9 +156,9 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
{ {
DebugInFunction << "Constructing faPatchField<Type>" << endl; DebugInFunction << "Constructing faPatchField<Type>" << endl;
auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type()); auto* ctorPtr = patchMapperConstructorTable(ptf.type());
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -168,14 +168,14 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
) << exit(FatalError); ) << exit(FatalError);
} }
auto patchTypeCstrIter = patchMapperConstructorTablePtr_->cfind(p.type()); auto* patchTypeCtor = patchMapperConstructorTable(p.type());
if (patchTypeCstrIter.found()) if (patchTypeCtor)
{ {
return patchTypeCstrIter()(ptf, p, iF, pfMapper); return patchTypeCtor(ptf, p, iF, pfMapper);
} }
return cstrIter()(ptf, p, iF, pfMapper); return ctorPtr(ptf, p, iF, pfMapper);
} }

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -103,12 +104,11 @@ Foam::faePatchField<Type>::NewCalculatedType
const faePatchField<Type2>& pf const faePatchField<Type2>& pf
) )
{ {
auto patchTypeCstrIter = auto* patchTypeCtor = patchConstructorTable(pf.patch().type());
patchConstructorTablePtr_->cfind(pf.patch().type());
if (patchTypeCstrIter.found()) if (patchTypeCtor)
{ {
return patchTypeCstrIter() return patchTypeCtor
( (
pf.patch(), pf.patch(),
DimensionedField<Type, edgeMesh>::null() DimensionedField<Type, edgeMesh>::null()

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -38,9 +38,9 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New
{ {
DebugInFunction << "Constructing faePatchField" << endl; DebugInFunction << "Constructing faePatchField" << endl;
auto cstrIter = patchConstructorTablePtr_->cfind(patchFieldType); auto* ctorPtr = patchConstructorTable(patchFieldType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -50,15 +50,15 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New
) << exit(FatalError); ) << exit(FatalError);
} }
auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type()); auto* patchTypeCtor = patchConstructorTable(p.type());
if (patchTypeCstrIter.found()) if (patchTypeCtor)
{ {
return patchTypeCstrIter()(p, iF); return patchTypeCtor(p, iF);
} }
else else
{ {
return cstrIter()(p, iF); return ctorPtr(p, iF);
} }
} }
@ -75,16 +75,16 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New
const word patchFieldType(dict.get<word>("type")); const word patchFieldType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType); auto* ctorPtr = dictionaryConstructorTable(patchFieldType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
if (!disallowGenericFaePatchField) if (!disallowGenericFaePatchField)
{ {
cstrIter = dictionaryConstructorTablePtr_->cfind("generic"); ctorPtr = dictionaryConstructorTable("generic");
} }
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "Unknown patchField type " << patchFieldType << "Unknown patchField type " << patchFieldType
@ -95,9 +95,9 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New
} }
} }
auto patchTypeCstrIter = dictionaryConstructorTablePtr_->cfind(p.type()); auto* patchTypeCtor = dictionaryConstructorTable(p.type());
if (patchTypeCstrIter.found() && *patchTypeCstrIter != *cstrIter) if (patchTypeCtor && patchTypeCtor != ctorPtr)
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "inconsistent patch and patchField types for \n" << "inconsistent patch and patchField types for \n"
@ -106,7 +106,7 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New
<< exit(FatalIOError); << exit(FatalIOError);
} }
return cstrIter()(p, iF, dict); return ctorPtr(p, iF, dict);
} }
@ -121,9 +121,9 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New
{ {
DebugInFunction << "Constructing faePatchField<Type>" << endl; DebugInFunction << "Constructing faePatchField<Type>" << endl;
auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type()); auto* ctorPtr = patchMapperConstructorTable(ptf.type());
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -133,14 +133,14 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New
) << exit(FatalError); ) << exit(FatalError);
} }
auto patchTypeCstrIter = patchMapperConstructorTablePtr_->cfind(p.type()); auto* patchTypeCtor = patchMapperConstructorTable(p.type());
if (patchTypeCstrIter.found()) if (patchTypeCtor)
{ {
return patchTypeCstrIter()(ptf, p, iF, pfMapper); return patchTypeCtor(ptf, p, iF, pfMapper);
} }
return cstrIter()(ptf, p, iF, pfMapper); return ctorPtr(ptf, p, iF, pfMapper);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -58,9 +58,9 @@ Foam::fa::convectionScheme<Type>::New
const word schemeName(schemeData); const word schemeName(schemeData);
auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); auto* ctorPtr = IstreamConstructorTable(schemeName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -71,7 +71,7 @@ Foam::fa::convectionScheme<Type>::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return cstrIter()(mesh, faceFlux, schemeData); return ctorPtr(mesh, faceFlux, schemeData);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017 Volkswagen AG Copyright (C) 2017 Volkswagen AG
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -68,9 +68,9 @@ tmp<faD2dt2Scheme<Type>> faD2dt2Scheme<Type>::New
const word schemeName(schemeData); const word schemeName(schemeData);
auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); auto* ctorPtr = IstreamConstructorTable(schemeName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -81,7 +81,7 @@ tmp<faD2dt2Scheme<Type>> faD2dt2Scheme<Type>::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return cstrIter()(mesh, schemeData); return ctorPtr(mesh, schemeData);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -66,9 +66,9 @@ tmp<faDdtScheme<Type>> faDdtScheme<Type>::New
const word schemeName(schemeData); const word schemeName(schemeData);
auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); auto* ctorPtr = IstreamConstructorTable(schemeName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -79,7 +79,7 @@ tmp<faDdtScheme<Type>> faDdtScheme<Type>::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return cstrIter()(mesh, schemeData); return ctorPtr(mesh, schemeData);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -67,9 +67,9 @@ tmp<divScheme<Type>> divScheme<Type>::New
const word schemeName(schemeData); const word schemeName(schemeData);
auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); auto* ctorPtr = IstreamConstructorTable(schemeName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -80,7 +80,7 @@ tmp<divScheme<Type>> divScheme<Type>::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return cstrIter()(mesh, schemeData); return ctorPtr(mesh, schemeData);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -66,9 +66,9 @@ tmp<gradScheme<Type>> gradScheme<Type>::New
const word schemeName(schemeData); const word schemeName(schemeData);
auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); auto* ctorPtr = IstreamConstructorTable(schemeName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -79,7 +79,7 @@ tmp<gradScheme<Type>> gradScheme<Type>::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return cstrIter()(mesh, schemeData); return ctorPtr(mesh, schemeData);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -67,9 +67,9 @@ tmp<laplacianScheme<Type>> laplacianScheme<Type>::New
const word schemeName(schemeData); const word schemeName(schemeData);
auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); auto* ctorPtr = IstreamConstructorTable(schemeName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -80,7 +80,7 @@ tmp<laplacianScheme<Type>> laplacianScheme<Type>::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return cstrIter()(mesh, schemeData); return ctorPtr(mesh, schemeData);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -69,9 +69,9 @@ tmp<lnGradScheme<Type>> lnGradScheme<Type>::New
const word schemeName(schemeData); const word schemeName(schemeData);
auto cstrIter = MeshConstructorTablePtr_->cfind(schemeName); auto* ctorPtr = MeshConstructorTable(schemeName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -82,7 +82,7 @@ tmp<lnGradScheme<Type>> lnGradScheme<Type>::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return cstrIter()(mesh, schemeData); return ctorPtr(mesh, schemeData);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -61,9 +61,9 @@ Foam::edgeInterpolationScheme<Type>::New
const word schemeName(schemeData); const word schemeName(schemeData);
auto cstrIter = MeshConstructorTablePtr_->cfind(schemeName); auto* ctorPtr = MeshConstructorTable(schemeName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -74,7 +74,7 @@ Foam::edgeInterpolationScheme<Type>::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return cstrIter()(mesh, schemeData); return ctorPtr(mesh, schemeData);
} }
@ -106,9 +106,9 @@ Foam::edgeInterpolationScheme<Type>::New
const word schemeName(schemeData); const word schemeName(schemeData);
auto cstrIter = MeshFluxConstructorTablePtr_->cfind(schemeName); auto* ctorPtr = MeshFluxConstructorTable(schemeName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -119,7 +119,7 @@ Foam::edgeInterpolationScheme<Type>::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return cstrIter()(mesh, faceFlux, schemeData); return ctorPtr(mesh, faceFlux, schemeData);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -52,9 +52,9 @@ Foam::autoPtr<Foam::SRF::SRFModel> Foam::SRF::SRFModel::New
Info<< "Selecting SRFModel " << modelType << endl; Info<< "Selecting SRFModel " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -65,7 +65,7 @@ Foam::autoPtr<Foam::SRF::SRFModel> Foam::SRF::SRFModel::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<SRFModel>(cstrIter()(Urel)); return autoPtr<SRFModel>(ctorPtr(Urel));
} }

View File

@ -97,9 +97,9 @@ Foam::autoPtr<Foam::fv::option> Foam::fv::option::New
dictionaryConstructorTablePtr_ dictionaryConstructorTablePtr_
); );
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -110,7 +110,7 @@ Foam::autoPtr<Foam::fv::option> Foam::fv::option::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return autoPtr<fv::option>(cstrIter()(name, modelType, coeffs, mesh)); return autoPtr<fv::option>(ctorPtr(name, modelType, coeffs, mesh));
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2015 OpenFOAM Foundation Copyright (C) 2012-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::porosityModel> Foam::porosityModel::New
Info<< "Porosity region " << name << ":" << nl Info<< "Porosity region " << name << ":" << nl
<< " selecting model: " << modelType << endl; << " selecting model: " << modelType << endl;
auto cstrIter = meshConstructorTablePtr_->cfind(modelType); auto* ctorPtr = meshConstructorTable(modelType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -58,7 +58,7 @@ Foam::autoPtr<Foam::porosityModel> Foam::porosityModel::New
return autoPtr<porosityModel> return autoPtr<porosityModel>
( (
cstrIter() ctorPtr
( (
name, name,
modelType, modelType,

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2010-2018 Bernhard Gschaider Copyright (C) 2010-2018 Bernhard Gschaider
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -53,9 +53,9 @@ Foam::expressions::fvExprDriver::New
{ {
const word driverType(dict.get<word>("valueType")); const word driverType(dict.get<word>("valueType"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(driverType); auto* ctorPtr = dictionaryConstructorTable(driverType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -70,7 +70,7 @@ Foam::expressions::fvExprDriver::New
resetDefaultMesh(mesh, false); // lazy resetDefaultMesh(mesh, false); // lazy
return autoPtr<fvExprDriver>(cstrIter()(dict, mesh)); return autoPtr<fvExprDriver>(ctorPtr(dict, mesh));
} }
@ -82,9 +82,9 @@ Foam::expressions::fvExprDriver::New
const fvMesh& mesh const fvMesh& mesh
) )
{ {
auto cstrIter = idNameConstructorTablePtr_->cfind(driverType); auto* ctorPtr = idNameConstructorTable(driverType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -98,7 +98,7 @@ Foam::expressions::fvExprDriver::New
resetDefaultMesh(mesh, false); // lazy resetDefaultMesh(mesh, false); // lazy
return autoPtr<fvExprDriver>(cstrIter()(id, mesh)); return autoPtr<fvExprDriver>(ctorPtr(id, mesh));
} }

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -104,11 +105,11 @@ Foam::fvPatchField<Type>::NewCalculatedType
const fvPatch& p const fvPatch& p
) )
{ {
auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type()); auto* patchTypeCtor = patchConstructorTable(p.type());
if (patchTypeCstrIter.found()) if (patchTypeCtor)
{ {
return patchTypeCstrIter() return patchTypeCtor
( (
p, p,
DimensionedField<Type, volMesh>::null() DimensionedField<Type, volMesh>::null()

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -41,9 +41,9 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
<< "patchFieldType = " << patchFieldType << "patchFieldType = " << patchFieldType
<< " : " << p.type() << nl; << " : " << p.type() << nl;
auto cstrIter = patchConstructorTablePtr_->cfind(patchFieldType); auto* ctorPtr = patchConstructorTable(patchFieldType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -53,7 +53,7 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
) << exit(FatalError); ) << exit(FatalError);
} }
auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type()); auto* patchTypeCtor = patchConstructorTable(p.type());
if if
( (
@ -61,21 +61,21 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
|| actualPatchType != p.type() || actualPatchType != p.type()
) )
{ {
if (patchTypeCstrIter.found()) if (patchTypeCtor)
{ {
return patchTypeCstrIter()(p, iF); return patchTypeCtor(p, iF);
} }
else else
{ {
return cstrIter()(p, iF); return ctorPtr(p, iF);
} }
} }
tmp<fvPatchField<Type>> tfvp = cstrIter()(p, iF); tmp<fvPatchField<Type>> tfvp = ctorPtr(p, iF);
// Check if constraint type override and store patchType if so // Check if constraint type override and store patchType if so
if (patchTypeCstrIter.found()) if (patchTypeCtor)
{ {
tfvp.ref().patchType() = actualPatchType; tfvp.ref().patchType() = actualPatchType;
} }
@ -108,16 +108,16 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
DebugInFunction DebugInFunction
<< "patchFieldType = " << patchFieldType << nl; << "patchFieldType = " << patchFieldType << nl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType); auto* ctorPtr = dictionaryConstructorTable(patchFieldType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
if (!disallowGenericFvPatchField) if (!disallowGenericFvPatchField)
{ {
cstrIter = dictionaryConstructorTablePtr_->cfind("generic"); ctorPtr = dictionaryConstructorTable("generic");
} }
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "Unknown patchField type " << patchFieldType << "Unknown patchField type " << patchFieldType
@ -134,10 +134,9 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
|| dict.get<word>("patchType") != p.type() || dict.get<word>("patchType") != p.type()
) )
{ {
auto patchTypeCstrIter auto* patchTypeCtor = dictionaryConstructorTable(p.type());
= dictionaryConstructorTablePtr_->cfind(p.type());
if (patchTypeCstrIter.found() && patchTypeCstrIter() != cstrIter()) if (patchTypeCtor && patchTypeCtor != ctorPtr)
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "inconsistent patch and patchField types for\n" << "inconsistent patch and patchField types for\n"
@ -147,7 +146,7 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
} }
} }
return cstrIter()(p, iF, dict); return ctorPtr(p, iF, dict);
} }
@ -163,9 +162,9 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
DebugInFunction DebugInFunction
<< "Constructing fvPatchField<Type>" << nl; << "Constructing fvPatchField<Type>" << nl;
auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type()); auto* ctorPtr = patchMapperConstructorTable(ptf.type());
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -175,7 +174,7 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
) << exit(FatalError); ) << exit(FatalError);
} }
return cstrIter()(ptf, p, iF, pfMapper); return ctorPtr(ptf, p, iF, pfMapper);
} }

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -102,11 +103,11 @@ Foam::fvsPatchField<Type>::NewCalculatedType
const fvPatch& p const fvPatch& p
) )
{ {
auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type()); auto* patchTypeCtor = patchConstructorTable(p.type());
if (patchTypeCstrIter.found()) if (patchTypeCtor)
{ {
return patchTypeCstrIter() return patchTypeCtor
( (
p, p,
DimensionedField<Type, surfaceMesh>::null() DimensionedField<Type, surfaceMesh>::null()

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -39,9 +39,9 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
{ {
DebugInFunction << "Constructing fvsPatchField" << endl; DebugInFunction << "Constructing fvsPatchField" << endl;
auto cstrIter = patchConstructorTablePtr_->cfind(patchFieldType); auto* ctorPtr = patchConstructorTable(patchFieldType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -57,15 +57,15 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
|| actualPatchType != p.type() || actualPatchType != p.type()
) )
{ {
auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type()); auto* patchTypeCtor = patchConstructorTable(p.type());
if (patchTypeCstrIter.found()) if (patchTypeCtor)
{ {
return patchTypeCstrIter()(p, iF); return patchTypeCtor(p, iF);
} }
} }
return cstrIter()(p, iF); return ctorPtr(p, iF);
} }
@ -93,16 +93,16 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
const word patchFieldType(dict.get<word>("type")); const word patchFieldType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType); auto* ctorPtr = dictionaryConstructorTable(patchFieldType);
if (!cstrIter.found()) if (!ctorPtr)
{ {
if (!disallowGenericFvsPatchField) if (!disallowGenericFvsPatchField)
{ {
cstrIter = dictionaryConstructorTablePtr_->cfind("generic"); ctorPtr = dictionaryConstructorTable("generic");
} }
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "Unknown patchField type " << patchFieldType << "Unknown patchField type " << patchFieldType
@ -119,10 +119,9 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
|| dict.get<word>("patchType") != p.type() || dict.get<word>("patchType") != p.type()
) )
{ {
auto patchTypeCstrIter auto* patchTypeCtor = dictionaryConstructorTable(p.type());
= dictionaryConstructorTablePtr_->cfind(p.type());
if (patchTypeCstrIter.found() && patchTypeCstrIter() != cstrIter()) if (patchTypeCtor && patchTypeCtor != ctorPtr)
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "inconsistent patch and patchField types for\n" << "inconsistent patch and patchField types for\n"
@ -132,7 +131,7 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
} }
} }
return cstrIter()(p, iF, dict); return ctorPtr(p, iF, dict);
} }
@ -147,9 +146,9 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
{ {
DebugInFunction << "Constructing fvsPatchField" << endl; DebugInFunction << "Constructing fvsPatchField" << endl;
auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type()); auto* ctorPtr = patchMapperConstructorTable(ptf.type());
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalErrorInLookup FatalErrorInLookup
( (
@ -159,14 +158,14 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
) << exit(FatalError); ) << exit(FatalError);
} }
auto patchTypeCstrIter = patchMapperConstructorTablePtr_->cfind(p.type()); auto* patchTypeCtor = patchMapperConstructorTable(p.type());
if (patchTypeCstrIter.found()) if (patchTypeCtor)
{ {
return patchTypeCstrIter()(ptf, p, iF, pfMapper); return patchTypeCtor(ptf, p, iF, pfMapper);
} }
return cstrIter()(ptf, p, iF, pfMapper); return ctorPtr(ptf, p, iF, pfMapper);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -85,9 +85,9 @@ tmp<convectionScheme<Type>> convectionScheme<Type>::New
InfoInFunction << "schemeName:" << schemeName << endl; InfoInFunction << "schemeName:" << schemeName << endl;
} }
auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); auto* ctorPtr = IstreamConstructorTable(schemeName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -98,7 +98,7 @@ tmp<convectionScheme<Type>> convectionScheme<Type>::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return cstrIter()(mesh, faceFlux, schemeData); return ctorPtr(mesh, faceFlux, schemeData);
} }
@ -128,9 +128,9 @@ tmp<convectionScheme<Type>> convectionScheme<Type>::New
const word schemeName(schemeData); const word schemeName(schemeData);
auto cstrIter = MultivariateConstructorTablePtr_->cfind(schemeName); auto* ctorPtr = MultivariateConstructorTable(schemeName);
if (!cstrIter.found()) if (!ctorPtr)
{ {
FatalIOErrorInLookup FatalIOErrorInLookup
( (
@ -141,7 +141,7 @@ tmp<convectionScheme<Type>> convectionScheme<Type>::New
) << exit(FatalIOError); ) << exit(FatalIOError);
} }
return cstrIter()(mesh, fields, faceFlux, schemeData); return ctorPtr(mesh, fields, faceFlux, schemeData);
} }

Some files were not shown because too many files have changed in this diff Show More