mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use auto and cfind to simplify selector usage (issue #512)
This commit is contained in:
@ -104,14 +104,14 @@ Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New
|
||||
const IOdictionary& solverDict
|
||||
)
|
||||
{
|
||||
const word solverTypeName
|
||||
const word solverName
|
||||
(
|
||||
solverDict.found("motionSolver")
|
||||
? solverDict.lookup("motionSolver")
|
||||
: solverDict.lookup("solver")
|
||||
);
|
||||
|
||||
Info<< "Selecting motion solver: " << solverTypeName << endl;
|
||||
Info<< "Selecting motion solver: " << solverName << endl;
|
||||
|
||||
const_cast<Time&>(mesh.time()).libs().open
|
||||
(
|
||||
@ -127,15 +127,14 @@ Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(solverTypeName);
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown solver type "
|
||||
<< solverTypeName << nl << nl
|
||||
<< "Valid solver types are:" << endl
|
||||
<< solverName << nl << nl
|
||||
<< "Valid solver types :" << endl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user