STYLE: use auto and cfind to simplify selector usage (issue #512)

This commit is contained in:
Mark Olesen
2017-07-03 10:36:03 +02:00
parent a09815fae2
commit bc1f2fa97e
246 changed files with 1109 additions and 1481 deletions

View File

@ -25,34 +25,27 @@ License
#include "tabulatedWallFunction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace tabulatedWallFunctions
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
autoPtr<tabulatedWallFunction> tabulatedWallFunction::New
Foam::autoPtr<Foam::tabulatedWallFunctions::tabulatedWallFunction>
Foam::tabulatedWallFunctions::tabulatedWallFunction::New
(
const dictionary& dict,
const polyMesh& mesh
)
{
word twfTypeName = dict.lookup("tabulatedWallFunction");
const word functionName = dict.lookup("tabulatedWallFunction");
Info<< "Selecting tabulatedWallFunction " << twfTypeName << endl;
Info<< "Selecting tabulatedWallFunction " << functionName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(twfTypeName);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionName);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown tabulatedWallFunction type " << twfTypeName
<< "Unknown tabulatedWallFunction type " << functionName
<< nl << nl << "Valid tabulatedWallFunction types are:" << nl
<< dictionaryConstructorTablePtr_->toc()
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -60,9 +53,4 @@ autoPtr<tabulatedWallFunction> tabulatedWallFunction::New
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace tabulatedWallFunctions
} // End namespace Foam
// ************************************************************************* //