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