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

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

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -141,7 +141,7 @@ namespace Foam
// *PatchFunction1<Type>::dictionaryConstructorTablePtr_;
//
// // Get the UniformValueField constructor
// auto cstrIter = PF1Table.cfind
// auto ctorIter = PF1Table.cfind
// (
// PatchFunction1Types::UniformValueField<Type>::typeName
// );
@ -149,7 +149,7 @@ namespace Foam
// // Add the UniformValueField under the Function1 name
// forAllConstIters(F1Table, iter)
// {
// PF1Table.insert(iter.key(), cstrIter());
// PF1Table.insert(iter.key(), ctorIter.val());
// }
// }
//};