STYLE: use HashTable iterator 'val()' method instead of 'object()'

This commit is contained in:
Mark Olesen
2019-01-18 16:26:50 +01:00
parent 53efb24a8d
commit ed94a2714d
57 changed files with 134 additions and 139 deletions

View File

@ -142,7 +142,7 @@ void Foam::radiation::laserDTRM::initialiseReflection()
key, key,
reflectionModel::New reflectionModel::New
( (
iter.object(), iter.val(),
mesh_ mesh_
) )
); );

View File

@ -46,7 +46,7 @@ void Foam::phaseSystem::createSubModels
key, key,
modelType::New modelType::New
( (
iter.object(), iter.val(),
phasePairs_[key] phasePairs_[key]
) )
); );
@ -76,7 +76,7 @@ void Foam::phaseSystem::createSubModels
key, key,
modelType::New modelType::New
( (
iter.object(), iter.val(),
mesh mesh
) )
); );

View File

@ -61,7 +61,7 @@ HeatAndMassTransferPhaseSystem
forAllConstIters(this->phasePairs_, phasePairIter) forAllConstIters(this->phasePairs_, phasePairIter)
{ {
const phasePair& pair = *(phasePairIter.object()); const phasePair& pair = *(phasePairIter.val());
if (pair.ordered()) if (pair.ordered())
{ {
@ -194,7 +194,7 @@ Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::dmdt
forAllConstIters(this->phasePairs_, phasePairIter) forAllConstIters(this->phasePairs_, phasePairIter)
{ {
const phasePair& pair = *(phasePairIter.object()); const phasePair& pair = *(phasePairIter.val());
if (pair.ordered()) if (pair.ordered())
{ {
@ -231,7 +231,7 @@ Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::momentumTransfer() const
// Source term due to mass transfer // Source term due to mass transfer
forAllConstIters(this->phasePairs_, phasePairIter) forAllConstIters(this->phasePairs_, phasePairIter)
{ {
const phasePair& pair = *(phasePairIter.object()); const phasePair& pair = *(phasePairIter.val());
if (pair.ordered()) if (pair.ordered())
{ {
@ -318,7 +318,7 @@ Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::heatTransfer() const
// Source term due to mass transfer // Source term due to mass transfer
forAllConstIters(this->phasePairs_, phasePairIter) forAllConstIters(this->phasePairs_, phasePairIter)
{ {
const phasePair& pair = *(phasePairIter.object()); const phasePair& pair = *(phasePairIter.val());
if (pair.ordered()) if (pair.ordered())
{ {

View File

@ -82,7 +82,7 @@ massTransfer() const
// Reset the interfacial mass flow rates // Reset the interfacial mass flow rates
forAllConstIters(this->phasePairs_, phasePairIter) forAllConstIters(this->phasePairs_, phasePairIter)
{ {
const phasePair& pair = *(phasePairIter.object()); const phasePair& pair = *(phasePairIter.val());
if (pair.ordered()) if (pair.ordered())
{ {
@ -99,11 +99,9 @@ massTransfer() const
// Sum up the contribution from each interface composition model // Sum up the contribution from each interface composition model
forAllConstIters(interfaceCompositionModels_, modelIter) forAllConstIters(interfaceCompositionModels_, modelIter)
{ {
const phasePair& pair = const phasePair& pair = *(this->phasePairs_[modelIter.key()]);
*(this->phasePairs_[modelIter.key()]);
const interfaceCompositionModel& compositionModel = const interfaceCompositionModel& compositionModel = *(modelIter.val());
*(modelIter.object());
const phaseModel& phase = pair.phase1(); const phaseModel& phase = pair.phase1();
const phaseModel& otherPhase = pair.phase2(); const phaseModel& otherPhase = pair.phase2();
@ -185,7 +183,7 @@ correctThermo()
forAllConstIters(this->phasePairs_, phasePairIter) forAllConstIters(this->phasePairs_, phasePairIter)
{ {
const phasePair& pair = *(phasePairIter.object()); const phasePair& pair = *(phasePairIter.val());
if (pair.ordered()) if (pair.ordered())
{ {

View File

@ -44,7 +44,7 @@ ThermalPhaseChangePhaseSystem
forAllConstIters(this->phasePairs_, phasePairIter) forAllConstIters(this->phasePairs_, phasePairIter)
{ {
const phasePair& pair = *(phasePairIter.object()); const phasePair& pair = *(phasePairIter.val());
if (pair.ordered()) if (pair.ordered())
{ {
@ -106,7 +106,7 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::heatTransfer() const
// Accumulate mDotL contributions from boundaries // Accumulate mDotL contributions from boundaries
forAllConstIters(this->phasePairs_, phasePairIter) forAllConstIters(this->phasePairs_, phasePairIter)
{ {
const phasePair& pair = *(phasePairIter.object()); const phasePair& pair = *(phasePairIter.val());
if (pair.ordered()) if (pair.ordered())
{ {
@ -201,7 +201,7 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::massTransfer() const
forAllConstIters(this->phasePairs_, phasePairIter) forAllConstIters(this->phasePairs_, phasePairIter)
{ {
const phasePair& pair = *(phasePairIter.object()); const phasePair& pair = *(phasePairIter.val());
if (pair.ordered()) if (pair.ordered())
{ {
@ -270,7 +270,7 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::iDmdt
forAllConstIters(this->phasePairs_, phasePairIter) forAllConstIters(this->phasePairs_, phasePairIter)
{ {
const phasePair& pair = *(phasePairIter.object()); const phasePair& pair = *(phasePairIter.val());
if (pair.ordered()) if (pair.ordered())
{ {
@ -305,7 +305,7 @@ void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
forAllConstIters(this->phasePairs_, phasePairIter) forAllConstIters(this->phasePairs_, phasePairIter)
{ {
const phasePair& pair = *(phasePairIter.object()); const phasePair& pair = *(phasePairIter.val());
if (pair.ordered()) if (pair.ordered())
{ {

View File

@ -48,7 +48,7 @@ void Foam::phaseSystem::createSubModels
key, key,
modelType::New modelType::New
( (
iter.object(), iter.val(),
phasePairs_[key]() phasePairs_[key]()
) )
); );

View File

@ -39,7 +39,7 @@ void printTable(const HashPtrTable<T>& table)
forAllConstIters(table, iter) forAllConstIters(table, iter)
{ {
const T* ptr = iter.object(); const T* ptr = iter.val();
Info<< iter.key() << " = "; Info<< iter.key() << " = ";
if (ptr) if (ptr)
{ {

View File

@ -112,7 +112,7 @@ int main()
Info<< "\nerase table2 by iterator" << nl; Info<< "\nerase table2 by iterator" << nl;
forAllIters(table2, iter) forAllIters(table2, iter)
{ {
Info<< "erasing " << iter.key() << " => " << iter.object() << " ... "; Info<< "erasing " << iter.key() << " => " << iter.val() << " ... ";
table2.erase(iter); table2.erase(iter);
Info<< "erased" << endl; Info<< "erased" << endl;
} }

View File

@ -38,7 +38,7 @@ void printTable(const PtrMap<T>& table)
forAllConstIters(table, iter) forAllConstIters(table, iter)
{ {
const T* ptr = iter.object(); const T* ptr = iter.val();
Info<< iter.key() << " = "; Info<< iter.key() << " = ";
if (ptr) if (ptr)
{ {

View File

@ -652,6 +652,7 @@ protected:
} }
//- The object (value) associated with the iterator //- The object (value) associated with the iterator
// \deprecated(2019-01) use val() method
inline mapped_type& object() const inline mapped_type& object() const
{ {
return entry_->mapped(); return entry_->mapped();

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2016-2019 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -194,7 +194,7 @@ Foam::label Foam::IOobjectList::append(const IOobjectList& other)
InfoInFunction << "Copy append " << iter.key() << nl; InfoInFunction << "Copy append " << iter.key() << nl;
} }
set(iter.key(), new IOobject(*(iter.object()))); set(iter.key(), new IOobject(*(iter.val())));
++count; ++count;
} }
} }
@ -253,7 +253,7 @@ const Foam::IOobject* Foam::IOobjectList::cfindObject
InfoInFunction << "Found " << objName << endl; InfoInFunction << "Found " << objName << endl;
} }
return iter.object(); return iter.val();
} }
else if (IOobject::debug) else if (IOobject::debug)
{ {
@ -422,9 +422,10 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const IOobjectList& list)
{ {
os << nl << list.size() << nl << token::BEGIN_LIST << nl; os << nl << list.size() << nl << token::BEGIN_LIST << nl;
forAllConstIters(list, it) forAllConstIters(list, iter)
{ {
os << it.key() << token::SPACE << it.object()->headerClassName() << nl; os << iter.key() << token::SPACE
<< iter.val()->headerClassName() << nl;
} }
os << token::END_LIST; os << token::END_LIST;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd. \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -42,7 +42,7 @@ Foam::HashTable<Foam::wordHashSet> Foam::IOobjectList::classesImpl
forAllConstIters(list, iter) forAllConstIters(list, iter)
{ {
const word& key = iter.key(); const word& key = iter.key();
const IOobject* io = iter.object(); const IOobject* io = iter.val();
if (matchName(key)) if (matchName(key))
{ {
@ -68,7 +68,7 @@ Foam::label Foam::IOobjectList::countImpl
forAllConstIters(list, iter) forAllConstIters(list, iter)
{ {
const IOobject* io = iter.object(); const IOobject* io = iter.val();
if (matchClass(io->headerClassName()) && matchName(io->name())) if (matchClass(io->headerClassName()) && matchName(io->name()))
{ {
@ -92,7 +92,7 @@ Foam::label Foam::IOobjectList::countTypeImpl
forAllConstIters(list, iter) forAllConstIters(list, iter)
{ {
const IOobject* io = iter.object(); const IOobject* io = iter.val();
if (io->isHeaderClassName<Type>() && matchName(io->name())) if (io->isHeaderClassName<Type>() && matchName(io->name()))
{ {
@ -120,7 +120,7 @@ Foam::wordList Foam::IOobjectList::namesImpl
forAllConstIters(list, iter) forAllConstIters(list, iter)
{ {
const word& key = iter.key(); const word& key = iter.key();
const IOobject* io = iter.object(); const IOobject* io = iter.val();
if (matchClass(io->headerClassName()) && matchName(key)) if (matchClass(io->headerClassName()) && matchName(key))
{ {
@ -155,7 +155,7 @@ Foam::wordList Foam::IOobjectList::namesTypeImpl
forAllConstIters(list, iter) forAllConstIters(list, iter)
{ {
const word& key = iter.key(); const word& key = iter.key();
const IOobject* io = iter.object(); const IOobject* io = iter.val();
if (io->isHeaderClassName<Type>() && matchName(key)) if (io->isHeaderClassName<Type>() && matchName(key))
{ {
@ -188,7 +188,7 @@ Foam::IOobjectList Foam::IOobjectList::lookupImpl
forAllConstIters(list, iter) forAllConstIters(list, iter)
{ {
const word& key = iter.key(); const word& key = iter.key();
const IOobject* io = iter.object(); const IOobject* io = iter.val();
if (matchName(key)) if (matchName(key))
{ {
@ -219,7 +219,7 @@ Foam::IOobjectList Foam::IOobjectList::lookupClassImpl
forAllConstIters(list, iter) forAllConstIters(list, iter)
{ {
const word& key = iter.key(); const word& key = iter.key();
const IOobject* io = iter.object(); const IOobject* io = iter.val();
if (matchClass(io->headerClassName()) && matchName(key)) if (matchClass(io->headerClassName()) && matchName(key))
{ {
@ -249,7 +249,7 @@ Foam::IOobjectList Foam::IOobjectList::lookupClassTypeImpl
forAllConstIters(list, iter) forAllConstIters(list, iter)
{ {
const word& key = iter.key(); const word& key = iter.key();
const IOobject* io = iter.object(); const IOobject* io = iter.val();
if (io->isHeaderClassName<Type>() && matchName(key)) if (io->isHeaderClassName<Type>() && matchName(key))
{ {
@ -278,7 +278,7 @@ const Foam::IOobject* Foam::IOobjectList::cfindObject
if (iter.found()) if (iter.found())
{ {
const IOobject* io = iter.object(); const IOobject* io = iter.val();
if (io->isHeaderClassName<Type>()) if (io->isHeaderClassName<Type>())
{ {
@ -635,7 +635,7 @@ Foam::label Foam::IOobjectList::filterClasses
// Matches? either prune (pruning) or keep (!pruning) // Matches? either prune (pruning) or keep (!pruning)
if if
( (
(pred(iter.object()->headerClassName()) ? pruning : !pruning) (pred(iter.val()->headerClassName()) ? pruning : !pruning)
&& erase(iter) && erase(iter)
) )
{ {

View File

@ -271,7 +271,7 @@ Foam::dictionary::const_searcher Foam::dictionary::csearch
if (iter.found()) if (iter.found())
{ {
finder.set(iter.object()); finder.set(iter.val());
return finder; return finder;
} }
@ -427,7 +427,7 @@ const Foam::dictionary* Foam::dictionary::cfindScopedDict
if (iter.found()) if (iter.found())
{ {
const entry *eptr = iter.object(); const entry *eptr = iter.val();
if (eptr->isDict()) if (eptr->isDict())
{ {
@ -534,7 +534,7 @@ Foam::dictionary* Foam::dictionary::makeScopedDict(const fileName& dictPath)
if (iter.found()) if (iter.found())
{ {
entry *eptr = iter.object(); entry *eptr = iter.val();
if (eptr->isDict()) if (eptr->isDict())
{ {

View File

@ -90,9 +90,9 @@ Foam::objectRegistry::~objectRegistry()
for (iterator iter = begin(); iter != end(); ++iter) for (iterator iter = begin(); iter != end(); ++iter)
{ {
if (iter.object()->ownedByRegistry()) if (iter.val()->ownedByRegistry())
{ {
myObjects[nObjects++] = iter.object(); myObjects[nObjects++] = iter.val();
} }
} }

View File

@ -42,12 +42,12 @@ Foam::HashTable<Foam::wordHashSet> Foam::objectRegistry::classesImpl
// Summary (key,val) = (class-name, object-names) // Summary (key,val) = (class-name, object-names)
forAllConstIters(list, iter) forAllConstIters(list, iter)
{ {
const regIOobject* obj = iter.object(); const regIOobject* obj = iter.val();
if (matchName(obj->name())) if (matchName(obj->name()))
{ {
// Create entry (if needed) and insert // Create entry (if needed) and insert
summary(iter.object()->type()).insert(obj->name()); summary(iter.val()->type()).insert(obj->name());
} }
} }
@ -68,7 +68,7 @@ Foam::label Foam::objectRegistry::countImpl
forAllConstIters(list, iter) forAllConstIters(list, iter)
{ {
const regIOobject* obj = iter.object(); const regIOobject* obj = iter.val();
if (matchClass(obj->type()) && matchName(obj->name())) if (matchClass(obj->type()) && matchName(obj->name()))
{ {
@ -92,7 +92,7 @@ Foam::label Foam::objectRegistry::countTypeImpl
forAllConstIters(list, iter) forAllConstIters(list, iter)
{ {
const regIOobject* obj = iter.object(); const regIOobject* obj = iter.val();
if if
( (
@ -123,7 +123,7 @@ Foam::wordList Foam::objectRegistry::namesImpl
label count=0; label count=0;
forAllConstIters(list, iter) forAllConstIters(list, iter)
{ {
const regIOobject* obj = iter.object(); const regIOobject* obj = iter.val();
if (matchClass(obj->type()) && matchName(obj->name())) if (matchClass(obj->type()) && matchName(obj->name()))
{ {
@ -157,7 +157,7 @@ Foam::wordList Foam::objectRegistry::namesTypeImpl
label count = 0; label count = 0;
forAllConstIters(list, iter) forAllConstIters(list, iter)
{ {
const regIOobject* obj = iter.object(); const regIOobject* obj = iter.val();
if if
( (
@ -235,7 +235,7 @@ Foam::label Foam::objectRegistry::count
forAllConstIters(*this, iter) forAllConstIters(*this, iter)
{ {
const regIOobject* obj = iter.object(); const regIOobject* obj = iter.val();
if if
( (
@ -337,7 +337,7 @@ Foam::HashTable<const Type*> Foam::objectRegistry::lookupClass
forAllConstIters(*this, iter) forAllConstIters(*this, iter)
{ {
const regIOobject* obj = iter.object(); const regIOobject* obj = iter.val();
if (strict ? isType<Type>(*obj) : bool(isA<Type>(*obj))) if (strict ? isType<Type>(*obj) : bool(isA<Type>(*obj)))
{ {
@ -359,7 +359,7 @@ Foam::HashTable<Type*> Foam::objectRegistry::lookupClass
forAllIters(*this, iter) forAllIters(*this, iter)
{ {
regIOobject* obj = iter.object(); regIOobject* obj = iter.val();
if (strict ? isType<Type>(*obj) : bool(isA<Type>(*obj))) if (strict ? isType<Type>(*obj) : bool(isA<Type>(*obj)))
{ {

View File

@ -84,7 +84,7 @@ void Foam::transformList(const tensor& rotTensor, Map<T>& field)
{ {
forAllIters(field, iter) forAllIters(field, iter)
{ {
T& value = iter.object(); T& value = iter.val();
value = transform(rotTensor, value); value = transform(rotTensor, value);
} }
} }
@ -112,7 +112,7 @@ void Foam::transformList(const tensor& rotTensor, EdgeMap<T>& field)
{ {
forAllIters(field, iter) forAllIters(field, iter)
{ {
T& value = iter.object(); T& value = iter.val();
value = transform(rotTensor, value); value = transform(rotTensor, value);
} }
} }

View File

@ -646,7 +646,7 @@ void Foam::argList::setCasePaths()
if (optIter.found()) if (optIter.found())
{ {
caseDir = optIter.object(); caseDir = optIter.val();
caseDir.clean(); caseDir.clean();
if (caseDir.empty() || caseDir == ".") if (caseDir.empty() || caseDir == ".")

View File

@ -65,7 +65,7 @@ Foam::label Foam::coupleGroupIdentifier::findOtherPatchID
} }
// Mesh has patch group // Mesh has patch group
const labelList& patchIDs = fnd.object(); const labelList& patchIDs = fnd.val();
if (&mesh == &thisPatch.boundaryMesh().mesh()) if (&mesh == &thisPatch.boundaryMesh().mesh())
{ {

View File

@ -739,7 +739,7 @@ void Foam::globalPoints::remove
forAllConstIters(oldMeshToProcPoint, iter) forAllConstIters(oldMeshToProcPoint, iter)
{ {
const label localPointi = iter.key(); const label localPointi = iter.key();
const labelPairList& pointInfo = oldProcPoints[iter.object()]; const labelPairList& pointInfo = oldProcPoints[iter.val()];
if (pointInfo.size() == 2) if (pointInfo.size() == 2)
{ {

View File

@ -390,7 +390,7 @@ Foam::polyBoundaryMesh::neighbourEdges() const
else else
{ {
// Second occurrence. Store. // Second occurrence. Store.
const labelPair& edgeInfo = fnd.object(); const labelPair& edgeInfo = fnd.val();
neighbourEdges[patchi][edgei - pp.nInternalEdges()] = neighbourEdges[patchi][edgei - pp.nInternalEdges()] =
edgeInfo; edgeInfo;
@ -704,7 +704,7 @@ Foam::labelList Foam::polyBoundaryMesh::indices
if (iter.found()) if (iter.found())
{ {
// Hash the patch ids for the group // Hash the patch ids for the group
labelHashSet groupIndices(iter.object()); labelHashSet groupIndices(iter.val());
groupIndices.erase(patchIndices); // Skip existing groupIndices.erase(patchIndices); // Skip existing
patchIndices.append(groupIndices.sortedToc()); patchIndices.append(groupIndices.sortedToc());

View File

@ -189,7 +189,7 @@ void Foam::syncTools::syncPointMap
pointValues, pointValues,
cop, cop,
meshPts[nbrIter.key()], meshPts[nbrIter.key()],
nbrIter.object() nbrIter.val()
); );
} }
} }
@ -307,7 +307,7 @@ void Foam::syncTools::syncPointMap
sharedPointValues, sharedPointValues,
cop, cop,
iter.key(), // edge iter.key(), // edge
iter.object() // value iter.val() // value
); );
} }
} }
@ -465,7 +465,7 @@ void Foam::syncTools::syncEdgeMap
edgeValues, edgeValues,
cop, cop,
meshEdge, // edge meshEdge, // edge
nbrIter.object() // value nbrIter.val() // value
); );
} }
} }
@ -672,7 +672,7 @@ void Foam::syncTools::syncEdgeMap
sharedEdgeValues, sharedEdgeValues,
cop, cop,
iter.key(), // edge iter.key(), // edge
iter.object() // value iter.val() // value
); );
} }
} }
@ -721,7 +721,7 @@ void Foam::syncTools::syncEdgeMap
forAllConstIters(potentialSharedEdge, iter) forAllConstIters(potentialSharedEdge, iter)
{ {
const edge& sharedEdge = iter.key(); const edge& sharedEdge = iter.key();
const edge& meshEdge = iter.object(); const edge& meshEdge = iter.val();
// Do I have a value for the shared edge? // Do I have a value for the shared edge?
const auto sharedFnd = sharedEdgeValues.cfind(sharedEdge); const auto sharedFnd = sharedEdgeValues.cfind(sharedEdge);

View File

@ -96,7 +96,7 @@ Foam::List<int> Foam::NamedEnum<EnumType, nEnum>::values() const
if (iter.found()) if (iter.found())
{ {
lst[count++] = iter.object(); lst[count++] = iter.val();
} }
} }
} }
@ -113,7 +113,7 @@ bool Foam::NamedEnum<EnumType, nEnum>::hasName(const EnumType e) const
forAllConstIters(lookup_, iter) forAllConstIters(lookup_, iter)
{ {
if (iter.object() == enumValue) if (iter.val() == enumValue)
{ {
return true; return true;
} }
@ -140,7 +140,7 @@ EnumType Foam::NamedEnum<EnumType, nEnum>::lookup
<< exit(FatalIOError); << exit(FatalIOError);
} }
return EnumType(iter.object()); return EnumType(iter.val());
} }
@ -177,7 +177,7 @@ EnumType Foam::NamedEnum<EnumType, nEnum>::read(Istream& is) const
<< exit(FatalIOError); << exit(FatalIOError);
} }
return EnumType(iter.object()); return EnumType(iter.val());
} }

View File

@ -224,7 +224,7 @@ public:
{ {
forAllConstIters(map(), iter) forAllConstIters(map(), iter)
{ {
if (iter.object().inInterface(bndId)) if (iter.val().inInterface(bndId))
{ {
return true; return true;
} }
@ -240,7 +240,7 @@ public:
word ifname; word ifname;
forAllConstIters(map(), iter) forAllConstIters(map(), iter)
{ {
ifname = iter.object().canonicalName(bndId); ifname = iter.val().canonicalName(bndId);
if (!ifname.empty()) if (!ifname.empty())
{ {
break; break;

View File

@ -94,7 +94,7 @@ void Foam::ccm::reader::warnDuplicates
Info << nl << "WARNING: " << context << " with identical names:"; Info << nl << "WARNING: " << context << " with identical names:";
forAllConstIters(hashed, iter) forAllConstIters(hashed, iter)
{ {
if (iter.object() > 1) if (iter.val() > 1)
{ {
Info << " " << iter.key(); Info << " " << iter.key();
} }

View File

@ -480,7 +480,7 @@ void Foam::ccm::reader::readCells
auto dictIter = boundaryRegion_.find(info.ccmIndex); auto dictIter = boundaryRegion_.find(info.ccmIndex);
if (dictIter.found()) if (dictIter.found())
{ {
dictionary& dict = dictIter.object(); dictionary& dict = dictIter.val();
const word patchName(dict.get<word>("Label")); const word patchName(dict.get<word>("Label"));
const word patchType(dict.get<word>("BoundaryType")); const word patchType(dict.get<word>("BoundaryType"));
@ -1263,7 +1263,7 @@ void Foam::ccm::reader::removeUnwanted()
forAllConstIters(removeMap, iter) forAllConstIters(removeMap, iter)
{ {
Info<< " zone " Info<< " zone "
<< iter.key() << " : " << iter.object() << nl; << iter.key() << " : " << iter.val() << nl;
} }
Info<<"retain "<< (nCells_ - nRemove) << " cells in " Info<<"retain "<< (nCells_ - nRemove) << " cells in "
@ -1272,7 +1272,7 @@ void Foam::ccm::reader::removeUnwanted()
forAllConstIters(keepMap, iter) forAllConstIters(keepMap, iter)
{ {
Info<< " zone " Info<< " zone "
<< iter.key() << " : " << iter.object() << nl; << iter.key() << " : " << iter.val() << nl;
} }
} }
} }
@ -1826,7 +1826,7 @@ void Foam::ccm::reader::mergeInplaceInterfaces()
forAllConstIters(interfaceDefinitions_, iter) forAllConstIters(interfaceDefinitions_, iter)
{ {
const interfaceEntry& ifentry = iter.object(); const interfaceEntry& ifentry = iter.val();
labelPair patchPair labelPair patchPair
( (
@ -2366,7 +2366,7 @@ void Foam::ccm::reader::reorderMesh()
forAllIters(monitoringSets_, iter) forAllIters(monitoringSets_, iter)
{ {
labelList& lst = iter.object(); labelList& lst = iter.val();
inplaceRenumber(oldToNew, lst); inplaceRenumber(oldToNew, lst);
// disallow monitoring on boundaries // disallow monitoring on boundaries

View File

@ -239,7 +239,7 @@ Foam::Map<Foam::word> Foam::cellTable::selectType(const word& matl) const
forAllConstIter(Map<dictionary>, *this, iter) forAllConstIter(Map<dictionary>, *this, iter)
{ {
const label index = iter.key(); const label index = iter.key();
const dictionary& dict = iter.object(); const dictionary& dict = iter.val();
if if
( (

View File

@ -589,7 +589,7 @@ Foam::dynamicRefineFvMesh::unrefine
forAllConstIters(faceToSplitPoint, iter) forAllConstIters(faceToSplitPoint, iter)
{ {
const label oldFacei = iter.key(); const label oldFacei = iter.key();
const label oldPointi = iter.object(); const label oldPointi = iter.val();
if (reversePointMap[oldPointi] < 0) if (reversePointMap[oldPointi] < 0)
{ {

View File

@ -42,9 +42,6 @@ defineTypeNameAndDebug(boundaryCutter, 0);
} }
// * * * * * * * * * * * * * Private Static Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::boundaryCutter::getFaceInfo void Foam::boundaryCutter::getFaceInfo
@ -874,10 +871,10 @@ void Foam::boundaryCutter::updateMesh(const mapPolyMesh& morphMap)
forAllConstIters(edgeAddedPoints_, iter) forAllConstIters(edgeAddedPoints_, iter)
{ {
const edge& e = iter.key(); const edge& e = iter.key();
const labelList& addedPoints = iter.val();
label newStart = morphMap.reversePointMap()[e.start()]; const label newStart = morphMap.reversePointMap()[e.start()];
const label newEnd = morphMap.reversePointMap()[e.end()];
label newEnd = morphMap.reversePointMap()[e.end()];
if (newStart >= 0 && newEnd >= 0) if (newStart >= 0 && newEnd >= 0)
{ {

View File

@ -485,7 +485,7 @@ Foam::face Foam::meshCutAndRemove::addEdgeCutsToFace(const label facei) const
if (fnd.found()) if (fnd.found())
{ {
// edge has been cut. Introduce new vertex. // edge has been cut. Introduce new vertex.
newFace[newFp++] = fnd.object(); newFace[newFp++] = fnd.val();
} }
} }
@ -546,7 +546,7 @@ Foam::face Foam::meshCutAndRemove::loopToFace
if (fnd.found()) if (fnd.found())
{ {
newFace[newFacei++] = fnd.object(); newFace[newFacei++] = fnd.val();
} }
} }
} }
@ -1307,7 +1307,7 @@ void Foam::meshCutAndRemove::updateMesh(const mapPolyMesh& map)
forAllConstIters(addedPoints_, iter) forAllConstIters(addedPoints_, iter)
{ {
const edge& e = iter.key(); const edge& e = iter.key();
const label addedPointi = iter.object(); const label addedPointi = iter.val();
label newStart = map.reversePointMap()[e.start()]; label newStart = map.reversePointMap()[e.start()];

View File

@ -431,7 +431,7 @@ Foam::face Foam::meshCutter::addEdgeCutsToFace(const label facei) const
if (fnd.found()) if (fnd.found())
{ {
// edge has been cut. Introduce new vertex. // edge has been cut. Introduce new vertex.
newFace[newFp++] = fnd.object(); newFace[newFp++] = fnd.val();
} }
} }
@ -489,7 +489,7 @@ Foam::face Foam::meshCutter::loopToFace
if (fnd.found()) if (fnd.found())
{ {
newFace[newFacei++] = fnd.object(); newFace[newFacei++] = fnd.val();
} }
} }
} }
@ -1074,7 +1074,7 @@ void Foam::meshCutter::updateMesh(const mapPolyMesh& morphMap)
forAllConstIters(addedPoints_, iter) forAllConstIters(addedPoints_, iter)
{ {
const edge& e = iter.key(); const edge& e = iter.key();
const label addedPointi = iter.object(); const label addedPointi = iter.val();
label newStart = morphMap.reversePointMap()[e.start()]; label newStart = morphMap.reversePointMap()[e.start()];

View File

@ -237,12 +237,10 @@ void Foam::undoableMeshCutter::setRefinement
if (undoable_) if (undoable_)
{ {
// Use cells cut in this iteration to update splitCell tree. // Use cells cut in this iteration to update splitCell tree.
forAllConstIter(Map<label>, addedCells(), iter) forAllConstIters(addedCells(), iter)
{ {
label celli = iter.key(); const label celli = iter.key();
const label addedCelli = iter.val();
label addedCelli = iter();
// Newly created split cell. (celli -> celli + addedCelli) // Newly created split cell. (celli -> celli + addedCelli)

View File

@ -1363,7 +1363,7 @@ void Foam::polyTopoChange::calcFaceInflationMaps
forAllConstIters(faceFromPoint_, iter) forAllConstIters(faceFromPoint_, iter)
{ {
const label facei = iter.key(); const label facei = iter.key();
const label pointi = iter.object(); const label pointi = iter.val();
// Get internal or patch faces using point on old mesh // Get internal or patch faces using point on old mesh
const bool internal = (region_[facei] == -1); const bool internal = (region_[facei] == -1);
@ -1395,7 +1395,7 @@ void Foam::polyTopoChange::calcFaceInflationMaps
forAllConstIters(faceFromEdge_, iter) forAllConstIters(faceFromEdge_, iter)
{ {
const label facei = iter.key(); const label facei = iter.key();
const label edgei = iter.object(); const label edgei = iter.val();
// Get internal or patch faces using edge on old mesh // Get internal or patch faces using edge on old mesh
const bool internal = (region_[facei] == -1); const bool internal = (region_[facei] == -1);
@ -1445,7 +1445,7 @@ void Foam::polyTopoChange::calcCellInflationMaps
forAllConstIters(cellFromPoint_, iter) forAllConstIters(cellFromPoint_, iter)
{ {
const label celli = iter.key(); const label celli = iter.key();
const label pointi = iter.object(); const label pointi = iter.val();
cellsFromPoints[nCellsFromPoints++] = objectMap cellsFromPoints[nCellsFromPoints++] = objectMap
( (
@ -1466,7 +1466,7 @@ void Foam::polyTopoChange::calcCellInflationMaps
forAllConstIters(cellFromEdge_, iter) forAllConstIters(cellFromEdge_, iter)
{ {
const label celli = iter.key(); const label celli = iter.key();
const label edgei = iter.object(); const label edgei = iter.val();
cellsFromEdges[nCellsFromEdges++] = objectMap cellsFromEdges[nCellsFromEdges++] = objectMap
( (
@ -1489,7 +1489,7 @@ void Foam::polyTopoChange::calcCellInflationMaps
forAllConstIters(cellFromFace_, iter) forAllConstIters(cellFromFace_, iter)
{ {
const label celli = iter.key(); const label celli = iter.key();
const label oldFacei = iter.object(); const label oldFacei = iter.val();
if (mesh.isInternalFace(oldFacei)) if (mesh.isInternalFace(oldFacei))
{ {
@ -1548,7 +1548,7 @@ void Foam::polyTopoChange::resetZones
forAllConstIters(pointZone_, iter) forAllConstIters(pointZone_, iter)
{ {
const label pointi = iter.key(); const label pointi = iter.key();
const label zonei = iter.object(); const label zonei = iter.val();
if (zonei < 0 || zonei >= pointZones.size()) if (zonei < 0 || zonei >= pointZones.size())
{ {
@ -1572,7 +1572,7 @@ void Foam::polyTopoChange::resetZones
forAllConstIters(pointZone_, iter) forAllConstIters(pointZone_, iter)
{ {
const label pointi = iter.key(); const label pointi = iter.key();
const label zonei = iter.object(); const label zonei = iter.val();
addressing[zonei][nPoints[zonei]++] = pointi; addressing[zonei][nPoints[zonei]++] = pointi;
} }
@ -1634,7 +1634,7 @@ void Foam::polyTopoChange::resetZones
forAllConstIters(faceZone_, iter) forAllConstIters(faceZone_, iter)
{ {
const label facei = iter.key(); const label facei = iter.key();
const label zonei = iter.object(); const label zonei = iter.val();
if (zonei < 0 || zonei >= faceZones.size()) if (zonei < 0 || zonei >= faceZones.size())
{ {
@ -1659,7 +1659,7 @@ void Foam::polyTopoChange::resetZones
forAllConstIters(faceZone_, iter) forAllConstIters(faceZone_, iter)
{ {
const label facei = iter.key(); const label facei = iter.key();
const label zonei = iter.object(); const label zonei = iter.val();
const label index = nFaces[zonei]++; const label index = nFaces[zonei]++;

View File

@ -86,7 +86,7 @@ void Foam::polyTopoChange::renumberKey
if (newKey >= 0) if (newKey >= 0)
{ {
newMap.insert(newKey, iter.object()); newMap.insert(newKey, iter.val());
} }
} }

View File

@ -35,10 +35,10 @@ inline void Foam::Detail::STLAsciiParse::beginSolid(word solidName)
auto iter = nameLookup_.cfind(solidName); auto iter = nameLookup_.cfind(solidName);
if (iter.found()) if (iter.found())
{ {
if (groupId_ != iter.object()) if (groupId_ != iter.val())
{ {
sorted_ = false; // Group appeared out of order sorted_ = false; // Group appeared out of order
groupId_ = iter.object(); groupId_ = iter.val();
} }
} }
else else

View File

@ -106,7 +106,7 @@ bool Foam::loopControl::checkConverged() const
forAllConstIters(meshes, meshIter) forAllConstIters(meshes, meshIter)
{ {
const fvMesh& regionMesh = *(meshIter.object()); const fvMesh& regionMesh = *(meshIter.val());
const dictionary& solverDict = regionMesh.solverPerformanceDict(); const dictionary& solverDict = regionMesh.solverPerformanceDict();

View File

@ -39,7 +39,7 @@ void Foam::functionObjects::nearWallFields::createFields
forAllConstIters(flds, iter) forAllConstIters(flds, iter)
{ {
const VolFieldType& fld = *(iter.object()); const VolFieldType& fld = *(iter.val());
if (fieldMap_.found(fld.name())) if (fieldMap_.found(fld.name()))
{ {

View File

@ -358,7 +358,7 @@ void Foam::LocalInteraction<CloudType>::info(Ostream& os)
labelList indexToInjector(injIdToIndex_.size()); labelList indexToInjector(injIdToIndex_.size());
forAllConstIters(injIdToIndex_, iter) forAllConstIters(injIdToIndex_, iter)
{ {
indexToInjector[iter.object()] = iter.key(); indexToInjector[iter.val()] = iter.key();
} }
forAll(patchData_, i) forAll(patchData_, i)

View File

@ -271,7 +271,7 @@ void Foam::StandardWallInteraction<CloudType>::info(Ostream& os)
labelList indexToInjector(injIdToIndex_.size()); labelList indexToInjector(injIdToIndex_.size());
forAllConstIters(injIdToIndex_, iter) forAllConstIters(injIdToIndex_, iter)
{ {
indexToInjector[iter.object()] = iter.key(); indexToInjector[iter.val()] = iter.key();
} }
forAll(npe, i) forAll(npe, i)

View File

@ -2696,7 +2696,7 @@ void Foam::meshRefinement::updateMesh
if (newFacei >= 0) if (newFacei >= 0)
{ {
newFaceToPatch.insert(newFacei, iter.object()); newFaceToPatch.insert(newFacei, iter.val());
} }
} }
faceToCoupledPatch_.transfer(newFaceToPatch); faceToCoupledPatch_.transfer(newFaceToPatch);

View File

@ -2609,7 +2609,7 @@ void Foam::snappyRefineDriver::addFaceZones
forAllConstIters(faceZoneToPatches, iter) forAllConstIters(faceZoneToPatches, iter)
{ {
const word& fzName = iter.key(); const word& fzName = iter.key();
const Pair<word>& patchNames = iter.object(); const Pair<word>& patchNames = iter.val();
// Get any user-defined faceZone data // Get any user-defined faceZone data
surfaceZonesInfo::faceZoneType fzType; surfaceZonesInfo::faceZoneType fzType;

View File

@ -660,7 +660,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::reduceRegions
forAllConstIters(localToGlobal, iter) forAllConstIters(localToGlobal, iter)
{ {
const label regioni = iter.object(); const label regioni = iter.val();
if (globalRegions.isLocal(regioni)) if (globalRegions.isLocal(regioni))
{ {
@ -706,7 +706,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::reduceRegions
forAllConstIters(localToGlobal, iter) forAllConstIters(localToGlobal, iter)
{ {
const label regioni = iter.object(); const label regioni = iter.val();
if (globalRegions.isLocal(regioni)) if (globalRegions.isLocal(regioni))
{ {

View File

@ -219,7 +219,7 @@ bool Foam::triSurfaceMesh::isSurfaceClosed() const
// Check for any edges used only once. // Check for any edges used only once.
forAllConstIters(facesPerEdge, iter) forAllConstIters(facesPerEdge, iter)
{ {
if (iter.object() != 2) if (iter.val() != 2)
{ {
return false; return false;
} }

View File

@ -120,7 +120,7 @@ void Foam::faceToCell::combine
forAllConstIters(facesPerCell, iter) forAllConstIters(facesPerCell, iter)
{ {
const label celli = iter.key(); const label celli = iter.key();
const label count = iter.object(); const label count = iter.val();
if (count == mesh_.cells()[celli].size()) if (count == mesh_.cells()[celli].size())
{ {

View File

@ -126,7 +126,7 @@ void Foam::pointToFace::combine
forAllConstIters(numPoints, iter) forAllConstIters(numPoints, iter)
{ {
const label facei = iter.key(); const label facei = iter.key();
const label count = iter.object(); const label count = iter.val();
if (count == mesh_.faces()[facei].size()) if (count == mesh_.faces()[facei].size())
{ {

View File

@ -247,7 +247,7 @@ Foam::edgeSurface::edgeSurface
const label facei = iter.key()[isFirstSurface ? 0 : 1]; const label facei = iter.key()[isFirstSurface ? 0 : 1];
// Edge label in intersection // Edge label in intersection
const label edgeI = iter.object(); const label edgeI = iter.val();
// Store on face-edge addressing. (note: offset edge) // Store on face-edge addressing. (note: offset edge)
allFaceEdges[facei].append(edgeI + nSurfaceEdges_); allFaceEdges[facei].append(edgeI + nSurfaceEdges_);

View File

@ -982,7 +982,7 @@ void Foam::surfaceIntersection::joinDisconnected
forAllConstIters(facePairToEdge_, iter) forAllConstIters(facePairToEdge_, iter)
{ {
const labelPair& twoFaces = iter.key(); const labelPair& twoFaces = iter.key();
const edge& e = iter.object(); const edge& e = iter.val();
if (e.count() == 1) if (e.count() == 1)
{ {
@ -1012,7 +1012,7 @@ void Foam::surfaceIntersection::joinDisconnected
forAllConstIters(mapping, iter) forAllConstIters(mapping, iter)
{ {
const auto& connect = iter.object(); const auto& connect = iter.val();
if (connect.size() == 2) if (connect.size() == 2)
{ {
@ -1553,7 +1553,7 @@ void Foam::surfaceIntersection::mergeEdges()
// // Additional safety, in case the edge was replaced? // // Additional safety, in case the edge was replaced?
// forAllIters(facePairToEdge_, iter) // forAllIters(facePairToEdge_, iter)
// { // {
// iter.object() = edgeNumbering[iter.object()]; // iter.val() = edgeNumbering[iter.val()];
// } // }
// } // }

View File

@ -76,7 +76,7 @@ Foam::label Foam::regionProperties::count() const
forAllConstIters(props, iter) forAllConstIters(props, iter)
{ {
n += iter.object().size(); n += iter.val().size();
} }
return n; return n;
@ -114,7 +114,7 @@ Foam::wordList Foam::regionProperties::sortedNames() const
forAllConstIters(props, iter) forAllConstIters(props, iter)
{ {
for (const word& name : iter.object()) for (const word& name : iter.val())
{ {
list[n] = name; list[n] = name;
++n; ++n;

View File

@ -800,7 +800,7 @@ void Foam::meshToMesh::constructFromCuttingPatches
forAllConstIters(patchMap, iter) forAllConstIters(patchMap, iter)
{ {
const word& tgtPatchName = iter.key(); const word& tgtPatchName = iter.key();
const word& srcPatchName = iter.object(); const word& srcPatchName = iter.val();
const polyPatch& srcPatch = srcBm[srcPatchName]; const polyPatch& srcPatch = srcBm[srcPatchName];

View File

@ -62,7 +62,7 @@ Foam::label Foam::probes::classifyFields()
forAllConstIters(available, iter) forAllConstIters(available, iter)
{ {
const word& fieldType = iter.key(); const word& fieldType = iter.key();
const wordList fieldNames = iter.object().sortedToc(); const wordList fieldNames = iter.val().sortedToc();
const label count = fieldNames.size(); // pre-filtered, so non-empty const label count = fieldNames.size(); // pre-filtered, so non-empty

View File

@ -88,7 +88,7 @@ Foam::label Foam::sampledSets::classifyFields()
forAllConstIters(available, iter) forAllConstIters(available, iter)
{ {
const word& fieldType = iter.key(); const word& fieldType = iter.key();
const wordList fieldNames = iter.object().sortedToc(); const wordList fieldNames = iter.val().sortedToc();
const label count = fieldNames.size(); // pre-filtered, so non-empty const label count = fieldNames.size(); // pre-filtered, so non-empty

View File

@ -77,7 +77,7 @@ Foam::label Foam::sampledSurfaces::classifyFields()
// Total number selected // Total number selected
forAllConstIters(available, iter) forAllConstIters(available, iter)
{ {
nFields += iter.object().size(); nFields += iter.val().size();
} }
return nFields; return nFields;

View File

@ -257,7 +257,7 @@ void Foam::cuttingSurfaceBase::walkCellCuts
// they can also be used to determine the correct face orientation. // they can also be used to determine the correct face orientation.
const edge refEdge = localFaces.begin().key(); const edge refEdge = localFaces.begin().key();
label nextFace = localFaces.begin().object()[0]; label nextFace = localFaces.begin().val()[0];
DebugInfo DebugInfo
<< "search face " << nextFace << " IN " << localEdges << endl; << "search face " << nextFace << " IN " << localEdges << endl;
@ -274,23 +274,23 @@ void Foam::cuttingSurfaceBase::walkCellCuts
forAllIters(localFaces, iter) forAllIters(localFaces, iter)
{ {
DebugInfo DebugInfo
<< "lookup " << nextFace << " in " << iter.object() << nl; << "lookup " << nextFace << " in " << iter.val() << nl;
// Find local index (0,1) or -1 on failure // Find local index (0,1) or -1 on failure
const label got = iter.object().which(nextFace); const label got = iter.val().which(nextFace);
if (got != -1) if (got != -1)
{ {
ok = true; ok = true;
// The other face // The other face
nextFace = iter.object()[(got?0:1)]; nextFace = iter.val()[(got?0:1)];
// The edge -> cut point // The edge -> cut point
localFaceLoop.append(localEdges[iter.key()]); localFaceLoop.append(localEdges[iter.key()]);
DebugInfo DebugInfo
<<" faces " << iter.object() <<" faces " << iter.val()
<< " point " << localFaceLoop.last() << " point " << localFaceLoop.last()
<< " edge=" << iter.key() << " nextFace=" << nextFace << " edge=" << iter.key() << " nextFace=" << nextFace
<< nl; << nl;

View File

@ -1185,7 +1185,7 @@ Foam::label Foam::isoSurfaceCell::markDanglingTriangles
// with only one connected edge (= this edge) // with only one connected edge (= this edge)
const label edgeI = iter.key(); const label edgeI = iter.key();
const labelList& otherEdgeFaces = iter.object(); const labelList& otherEdgeFaces = iter.val();
// Remove all dangling triangles // Remove all dangling triangles
if (danglingTriangle(faceEdges[edgeFace0[edgeI]], edgeFace1)) if (danglingTriangle(faceEdges[edgeFace0[edgeI]], edgeFace1))

View File

@ -386,7 +386,7 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read
forAllConstIters(zoneLookup, iter) forAllConstIters(zoneLookup, iter)
{ {
const label groupId = iter.key(); const label groupId = iter.key();
const label zoneId = iter.object(); const label zoneId = iter.val();
const auto iterName = nameLookup.cfind(groupId); const auto iterName = nameLookup.cfind(groupId);
if (iterName.found()) if (iterName.found())

View File

@ -114,10 +114,10 @@ bool Foam::fileFormats::TRIReader::readFile(const fileName& filename)
const auto iter = lookup.cfind(name); const auto iter = lookup.cfind(name);
if (iter.found()) if (iter.found())
{ {
if (zoneI != iter.object()) if (zoneI != iter.val())
{ {
sorted_ = false; // Group appeared out of order sorted_ = false; // Group appeared out of order
zoneI = iter.object(); zoneI = iter.val();
} }
} }
else else

View File

@ -123,7 +123,7 @@ Foam::radiation::greyMeanAbsorptionEmission::greyMeanAbsorptionEmission
forAllConstIters(speciesNames_, iter) forAllConstIters(speciesNames_, iter)
{ {
const word& specieName = iter.key(); const word& specieName = iter.key();
const label index = iter.object(); const label index = iter.val();
volScalarField* fldPtr = mesh.getObjectPtr<volScalarField>(specieName); volScalarField* fldPtr = mesh.getObjectPtr<volScalarField>(specieName);

View File

@ -134,7 +134,7 @@ Foam::radiation::wideBandAbsorptionEmission::wideBandAbsorptionEmission
forAllConstIters(speciesNames_, iter) forAllConstIters(speciesNames_, iter)
{ {
const word& specieName = iter.key(); const word& specieName = iter.key();
const label index = iter.object(); const label index = iter.val();
volScalarField* fldPtr = mesh.getObjectPtr<volScalarField>(specieName); volScalarField* fldPtr = mesh.getObjectPtr<volScalarField>(specieName);