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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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