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

@ -34,22 +34,21 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New
const phaseModel& phase2
)
{
word dragModelType(interfaceDict.lookup("type"));
const word modelType(interfaceDict.lookup("type"));
Info << "Selecting dragModel for phase "
<< phase1.name()
<< ": "
<< dragModelType << endl;
<< modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(dragModelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown dragModelType type "
<< dragModelType << endl << endl
<< "Valid dragModel types are : " << endl
<< "Unknown dragModel type "
<< modelType << nl << nl
<< "Valid dragModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}