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

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

View File

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

View File

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

View File

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

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2020 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -78,9 +78,9 @@ Foam::phaseModel::New
Info<< "Selecting phaseModel for "
<< phaseName << ": " << modelType << endl;
const auto cstrIter = phaseSystemConstructorTablePtr_->cfind(modelType);
auto* ctorPtr = phaseSystemConstructorTable(modelType);
if (!cstrIter.found())
if (!ctorPtr)
{
FatalIOErrorInLookup
(
@ -91,7 +91,7 @@ Foam::phaseModel::New
) << exit(FatalIOError);
}
return cstrIter()(fluid, phaseName);
return ctorPtr(fluid, phaseName);
}