mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: direct iteration over dictionary entries
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -111,11 +111,8 @@ bool Foam::loopControl::checkConverged() const
|
||||
const fvMesh& regionMesh = *(meshIter.val());
|
||||
|
||||
const dictionary& solverDict = regionMesh.solverPerformanceDict();
|
||||
|
||||
forAllConstIters(solverDict, iter)
|
||||
for (const entry& dataDictEntry : solverDict)
|
||||
{
|
||||
const entry& dataDictEntry = *iter;
|
||||
|
||||
const word& variableName = dataDictEntry.keyword();
|
||||
|
||||
const scalar absTol =
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -73,10 +73,8 @@ bool Foam::pimpleControl::criteriaSatisfied()
|
||||
bool checked = false; // safety that some checks were indeed performed
|
||||
|
||||
const dictionary& solverDict = mesh_.solverPerformanceDict();
|
||||
forAllConstIters(solverDict, iter)
|
||||
for (const entry& solverPerfDictEntry : solverDict)
|
||||
{
|
||||
const entry& solverPerfDictEntry = *iter;
|
||||
|
||||
const word& fieldName = solverPerfDictEntry.keyword();
|
||||
const label fieldi = applyToField(fieldName);
|
||||
|
||||
|
||||
@ -57,10 +57,8 @@ bool Foam::simpleControl::criteriaSatisfied()
|
||||
bool checked = false; // safety that some checks were indeed performed
|
||||
|
||||
const dictionary& solverDict = mesh_.solverPerformanceDict();
|
||||
forAllConstIters(solverDict, iter)
|
||||
for (const entry& solverPerfDictEntry : solverDict)
|
||||
{
|
||||
const entry& solverPerfDictEntry = *iter;
|
||||
|
||||
const word& fieldName = solverPerfDictEntry.keyword();
|
||||
const label fieldi = applyToField(fieldName);
|
||||
|
||||
|
||||
@ -236,19 +236,18 @@ electrostaticDepositionFvPatchScalarField
|
||||
sigmas_.setSize(phasesDict_.size());
|
||||
|
||||
label phasei = 0;
|
||||
forAllConstIters(phasesDict_, iter)
|
||||
for (const entry& dEntry : phasesDict_)
|
||||
{
|
||||
const word& key = iter().keyword();
|
||||
const word& key = dEntry.keyword();
|
||||
|
||||
if (!phasesDict_.isDict(key))
|
||||
if (!dEntry.isDict())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Found non-dictionary entry " << iter()
|
||||
<< " in top-level dictionary " << phasesDict_
|
||||
<< exit(FatalError);
|
||||
FatalIOErrorInFunction(phasesDict_)
|
||||
<< "Entry " << key << " is not a dictionary" << nl
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
const dictionary& subDict = phasesDict_.subDict(key);
|
||||
const dictionary& subDict = dEntry.dict();
|
||||
|
||||
phaseNames_[phasei] = key;
|
||||
|
||||
|
||||
@ -243,19 +243,18 @@ bool Foam::functionObjects::electricPotential::read(const dictionary& dict)
|
||||
}
|
||||
|
||||
label phasei = 0;
|
||||
forAllConstIters(phasesDict_, iter)
|
||||
for (const entry& dEntry : phasesDict_)
|
||||
{
|
||||
const word& key = iter().keyword();
|
||||
const word& key = dEntry.keyword();
|
||||
|
||||
if (!phasesDict_.isDict(key))
|
||||
if (!dEntry.isDict())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Found non-dictionary entry " << iter()
|
||||
<< " in top-level dictionary " << phasesDict_
|
||||
<< exit(FatalError);
|
||||
FatalIOErrorInFunction(phasesDict_)
|
||||
<< "Entry " << key << " is not a dictionary" << nl
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
const dictionary& subDict = phasesDict_.subDict(key);
|
||||
const dictionary& subDict = dEntry.dict();
|
||||
|
||||
phaseNames_[phasei] = key;
|
||||
|
||||
|
||||
@ -1982,7 +1982,7 @@ void Foam::snappyLayerDriver::getPatchDisplacement
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// forAllConstIter(Map<labelList>, cellToFaces, iter)
|
||||
// forAllConstIters(cellToFaces, iter)
|
||||
// {
|
||||
// if (iter().size() == 2)
|
||||
// {
|
||||
|
||||
Reference in New Issue
Block a user