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) 2013-2015 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -39,9 +39,9 @@ Foam::autoPtr<Foam::meshToMeshMethod> Foam::meshToMeshMethod::New
{
DebugInfo << "Selecting AMIMethod " << methodName << endl;
auto cstrIter = componentsConstructorTablePtr_->cfind(methodName);
auto* ctorPtr = componentsConstructorTable(methodName);
if (!cstrIter.found())
if (!ctorPtr)
{
FatalErrorInLookup
(
@ -51,7 +51,7 @@ Foam::autoPtr<Foam::meshToMeshMethod> Foam::meshToMeshMethod::New
) << exit(FatalError);
}
return autoPtr<meshToMeshMethod>(cstrIter()(src, tgt));
return autoPtr<meshToMeshMethod>(ctorPtr(src, tgt));
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -525,9 +525,9 @@ Foam::autoPtr<Foam::sampledSet> Foam::sampledSet::New
{
const word sampleType(dict.get<word>("type"));
auto cstrIter = wordConstructorTablePtr_->cfind(sampleType);
auto* ctorPtr = wordConstructorTable(sampleType);
if (!cstrIter.found())
if (!ctorPtr)
{
FatalIOErrorInLookup
(
@ -540,7 +540,7 @@ Foam::autoPtr<Foam::sampledSet> Foam::sampledSet::New
return autoPtr<sampledSet>
(
cstrIter()
ctorPtr
(
name,
mesh,

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015-2019 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -35,9 +35,9 @@ Foam::autoPtr<Foam::surfaceReader> Foam::surfaceReader::New
const fileName& fName
)
{
auto cstrIter = fileNameConstructorTablePtr_->cfind(readerType);
auto* ctorPtr = fileNameConstructorTable(readerType);
if (!cstrIter.found())
if (!ctorPtr)
{
FatalErrorInLookup
(
@ -47,7 +47,7 @@ Foam::autoPtr<Foam::surfaceReader> Foam::surfaceReader::New
) << exit(FatalError);
}
return autoPtr<surfaceReader>(cstrIter()(fName));
return autoPtr<surfaceReader>(ctorPtr(fName));
}

View File

@ -70,9 +70,9 @@ Foam::autoPtr<Foam::sampledSurface> Foam::sampledSurface::New
DebugInfo
<< "Selecting sampledType " << sampleType << endl;
auto cstrIter = wordConstructorTablePtr_->cfind(sampleType);
auto* ctorPtr = wordConstructorTable(sampleType);
if (!cstrIter.found())
if (!ctorPtr)
{
FatalIOErrorInLookup
(
@ -83,7 +83,7 @@ Foam::autoPtr<Foam::sampledSurface> Foam::sampledSurface::New
) << exit(FatalIOError);
}
return autoPtr<sampledSurface>(cstrIter()(name, mesh, dict));
return autoPtr<sampledSurface>(ctorPtr(name, mesh, dict));
}