STYLE: use forAllIter, forAllConstIter in more places

ENH: change some iterator -> const_iterator access

BUG: found some places with forAllIter and ::iterator !
This commit is contained in:
Mark Olesen
2010-04-13 09:10:36 +02:00
parent 5636df2b5a
commit 874120350c
37 changed files with 139 additions and 338 deletions

View File

@ -51,12 +51,7 @@ int main(int argc, char *argv[])
Info<< nl << "And again using STL iterator: " << nl << endl;
for
(
DLList<scalar>::iterator iter = myList.begin();
iter != myList.end();
++iter
)
forAllIter(DLList<scalar>, myList, iter)
{
Info<< "element:" << *iter << endl;
}
@ -64,12 +59,7 @@ int main(int argc, char *argv[])
Info<< nl << "And again using the same STL iterator: " << nl << endl;
for
(
DLList<scalar>::iterator iter = myList.begin();
iter != myList.end();
++iter
)
forAllIter(DLList<scalar>, myList, iter)
{
Info<< "Removing " << myList.remove(iter) << endl;
}
@ -82,12 +72,7 @@ int main(int argc, char *argv[])
const DLList<scalar>& const_myList = myList;
for
(
DLList<scalar>::const_iterator iter = const_myList.begin();
iter != const_myList.end();
++iter
)
forAllConstIter(DLList<scalar>, const_myList, iter)
{
Info<< "element:" << *iter << endl;
}
@ -95,12 +80,7 @@ int main(int argc, char *argv[])
myList.swapUp(myList.DLListBase::first());
myList.swapUp(myList.DLListBase::last());
for
(
DLList<scalar>::const_iterator iter = const_myList.begin();
iter != const_myList.end();
++iter
)
forAllConstIter(DLList<scalar>, const_myList, iter)
{
Info<< "element:" << *iter << endl;
}
@ -108,19 +88,14 @@ int main(int argc, char *argv[])
myList.swapDown(myList.DLListBase::first());
myList.swapDown(myList.DLListBase::last());
for
(
DLList<scalar>::const_iterator iter = const_myList.begin();
iter != const_myList.end();
++iter
)
forAllConstIter(DLList<scalar>, const_myList, iter)
{
Info<< "element:" << *iter << endl;
}
Info<< nl << "Testing transfer: " << nl << endl;
Info<< "original: " << myList << endl;
Info<< nl << "Testing transfer: " << nl << nl
<< "original: " << myList << endl;
DLList<scalar> newList;
newList.transfer(myList);

View File

@ -114,12 +114,7 @@ int main(int argc, char *argv[])
dict.swapDown(dict.first());
for
(
Dictionary<ent>::const_iterator iter = dict.begin();
iter != dict.end();
++iter
)
forAllConstIter(Dictionary<ent>, dict, iter)
{
Info<< "element : " << *iter;
}
@ -159,12 +154,7 @@ int main(int argc, char *argv[])
}
Info<< nl << "scalarDict1: " << endl;
for
(
PtrDictionary<Scalar>::const_iterator iter = scalarDict.begin();
iter != scalarDict.end();
++iter
)
forAllConstIter(PtrDictionary<Scalar>, scalarDict, iter)
{
Info<< " = " << iter() << endl;
}
@ -176,12 +166,7 @@ int main(int argc, char *argv[])
scalarDict2.insert(key, new Scalar(1.3*i));
}
Info<< nl << "scalarDict2: " << endl;
for
(
PtrDictionary<Scalar>::const_iterator iter = scalarDict2.begin();
iter != scalarDict2.end();
++iter
)
forAllConstIter(PtrDictionary<Scalar>, scalarDict2, iter)
{
Info<< "elem = " << *iter << endl;
}

View File

@ -78,12 +78,7 @@ int main(int argc, char *argv[])
Info<< nl << "And again using STL iterator: " << nl << endl;
for
(
SLList<scalar>::iterator iter = myList.begin();
iter != myList.end();
++iter
)
forAllIter(SLList<scalar>, myList, iter)
{
Info<< "element:" << *iter << endl;
}
@ -92,14 +87,9 @@ int main(int argc, char *argv[])
const ISLList<Scalar>& const_myList = myList;
for
(
SLList<scalar>::const_iterator iter2 = const_myList.begin();
iter2 != const_myList.end();
++iter2
)
forAllConstIter(SLList<scalar>, const_myList, iter)
{
Info<< "element:" << *iter2 << endl;
Info<< "element:" << *iter << endl;
}

View File

@ -188,12 +188,7 @@ int main(int argc, char *argv[])
sum = 0;
for (label iter = 0; iter < nIters; ++iter)
{
for
(
PackedBoolList::iterator it = packed.begin();
it != packed.end();
++it
)
forAllIter(PackedBoolList, packed, it)
{
sum += it;
}
@ -207,12 +202,7 @@ int main(int argc, char *argv[])
sum = 0;
for (label iter = 0; iter < nIters; ++iter)
{
for
(
PackedBoolList::const_iterator cit = packed.cbegin();
cit != packed.cend();
++cit
)
forAllConstIter(PackedBoolList, packed, cit)
{
sum += cit();
}
@ -333,12 +323,7 @@ int main(int argc, char *argv[])
// Write packed
for (label iter = 0; iter < nIters; ++iter)
{
for
(
PackedBoolList::iterator it = packed.begin();
it != packed.end();
++it
)
forAllIter(PackedBoolList, packed, it)
{
it() = 1;
}

View File

@ -51,12 +51,7 @@ int main(int argc, char *argv[])
Info<< nl << "And again using STL iterator: " << nl << endl;
for
(
SLList<scalar>::iterator iter = myList.begin();
iter != myList.end();
++iter
)
forAllIter(SLList<scalar>, myList, iter)
{
Info<< "element:" << *iter << endl;
}
@ -65,39 +60,23 @@ int main(int argc, char *argv[])
const SLList<scalar>& const_myList = myList;
for
(
SLList<scalar>::const_iterator iter2 = const_myList.begin();
iter2 != const_myList.end();
++iter2
)
forAllConstIter(SLList<scalar>, const_myList, iter)
{
Info<< "element:" << *iter2 << endl;
Info<< "element:" << *iter << endl;
}
for
(
SLList<scalar>::iterator iter = myList.begin();
iter != myList.end();
++iter
)
forAllIter(SLList<scalar>, myList, iter)
{
Info<< "Removing element:" << *iter << endl;
myList.remove(iter);
}
for
(
SLList<scalar>::const_iterator iter2 = const_myList.begin();
iter2 != const_myList.end();
++iter2
)
forAllConstIter(SLList<scalar>, const_myList, iter)
{
Info<< "element:" << *iter2 << endl;
Info<< "element:" << *iter << endl;
}
for (int i = 0; i<10; i++)
{
myList.append(1.3*i);

View File

@ -81,12 +81,7 @@ int main(int argc, char *argv[])
dict.swapDown(dict.first());
for
(
UDictionary<ent>::const_iterator iter = dict.begin();
iter != dict.end();
++iter
)
forAllConstIter(UDictionary<ent>, dict, iter)
{
Info<< "element : " << *iter;
}

View File

@ -441,12 +441,7 @@ if (pFaces[WEDGE].size() && pFaces[WEDGE][0].size())
{
pFaces[CYCLIC].setSize(1);
pFaces[CYCLIC][0] = pFaces[WEDGE][0];
for
(
SLList<face>::iterator iterb = pFaces[WEDGE][1].begin();
iterb != pFaces[WEDGE][1].end();
++iterb
)
forAllIter(SLList<face>, pFaces[WEDGE][1], iterb)
{
pFaces[CYCLIC][0].append(iterb());
}

View File

@ -143,12 +143,7 @@ void addPatchFields(fvMesh& mesh, const word& patchFieldType)
mesh.objectRegistry::lookupClass<GeoField>()
);
for
(
typename HashTable<const GeoField*>::const_iterator iter = flds.begin();
iter != flds.end();
++iter
)
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
@ -183,12 +178,7 @@ void trimPatchFields(fvMesh& mesh, const label nPatches)
mesh.objectRegistry::lookupClass<GeoField>()
);
for
(
typename HashTable<const GeoField*>::const_iterator iter = flds.begin();
iter != flds.end();
++iter
)
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
@ -209,12 +199,7 @@ void reorderPatchFields(fvMesh& mesh, const labelList& oldToNew)
mesh.objectRegistry::lookupClass<GeoField>()
);
for
(
typename HashTable<const GeoField*>::const_iterator iter = flds.begin();
iter != flds.end();
++iter
)
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
{
const GeoField& fld = *iter();

View File

@ -99,12 +99,7 @@ void addPatchFields(fvMesh& mesh, const word& patchFieldType)
mesh.objectRegistry::lookupClass<GeoField>()
);
for
(
typename HashTable<const GeoField*>::const_iterator iter = flds.begin();
iter != flds.end();
++iter
)
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
@ -139,12 +134,7 @@ void trimPatchFields(fvMesh& mesh, const label nPatches)
mesh.objectRegistry::lookupClass<GeoField>()
);
for
(
typename HashTable<const GeoField*>::const_iterator iter = flds.begin();
iter != flds.end();
++iter
)
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
@ -165,12 +155,7 @@ void reorderPatchFields(fvMesh& mesh, const labelList& oldToNew)
mesh.objectRegistry::lookupClass<GeoField>()
);
for
(
typename HashTable<const GeoField*>::const_iterator iter = flds.begin();
iter != flds.end();
++iter
)
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
{
const GeoField& fld = *iter();

View File

@ -506,7 +506,7 @@ void Foam::domainDecomposition::decomposeMesh()
// Add internal and boundary faces
// Remember to increment the index by one such that the
// turning index works properly.
forAllIter(SLList<label>, curProcFaces, curProcFacesIter)
forAllConstIter(SLList<label>, curProcFaces, curProcFacesIter)
{
curProcFaceAddressing[nFaces] = curProcFacesIter() + 1;
nFaces++;
@ -559,7 +559,7 @@ void Foam::domainDecomposition::decomposeMesh()
// add faces for this processor boundary
forAllIter
forAllConstIter
(
SLList<label>,
curInterProcBFacesIter(),

View File

@ -55,7 +55,7 @@ Foam::lagrangianFieldDecomposer::lagrangianFieldDecomposer
{
SLList<indexedParticle*>& particlePtrs = *cellParticles[celli];
forAllIter(SLList<indexedParticle*>, particlePtrs, iter)
forAllConstIter(SLList<indexedParticle*>, particlePtrs, iter)
{
const indexedParticle& ppi = *iter();
particleIndices_[pi++] = ppi.index();

View File

@ -50,7 +50,7 @@ void readFields
label nFields = fields.size();
fields.setSize(nFields + fieldObjects.size());
forAllIter(IOobjectList::iterator, fieldObjects, iter)
forAllIter(IOobjectList, fieldObjects, iter)
{
if (selectedFields.empty() || selectedFields.found(iter()->name()))
{

View File

@ -502,7 +502,7 @@ Foam::wordList Foam::dictionary::toc() const
wordList keys(size());
label nKeys = 0;
forAllConstIter(IDLList<entry>::const_iterator, *this, iter)
forAllConstIter(IDLList<entry>, *this, iter)
{
keys[nKeys++] = iter().keyword();
}

View File

@ -54,7 +54,7 @@ Foam::dlLibraryTable::readDlLibrary::readDlLibrary
Foam::dlLibraryTable::~dlLibraryTable()
{
forAllIter(dlLibraryTable, *this, iter)
forAllConstIter(dlLibraryTable, *this, iter)
{
dlclose(iter.key());
}

View File

@ -49,12 +49,7 @@ inline void mapClouds(const objectRegistry& db, const mapPolyMesh& mapper)
{
HashTable<const cloud*> clouds(db.lookupClass<cloud>());
for
(
HashTable<const cloud*>::iterator iter = clouds.begin();
iter != clouds.end();
++iter
)
forAllIter(HashTable<const cloud*>, clouds, iter)
{
cloud& c = const_cast<cloud&>(*iter());

View File

@ -163,7 +163,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
{
faceCells_[nCoarseFaces] = contents[masterI];
forAllIter(SLList<label>, faceFacesIter(), facesIter)
forAllConstIter(SLList<label>, faceFacesIter(), facesIter)
{
faceRestrictAddressing_[facesIter()] = nCoarseFaces;
}
@ -192,7 +192,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
{
faceCells_[nCoarseFaces] = nbrsIter();
forAllIter(SLList<label>, faceFacesIter(), facesIter)
forAllConstIter(SLList<label>, faceFacesIter(), facesIter)
{
faceRestrictAddressing_[facesIter() + sizeBy2] = nCoarseFaces;
}

View File

@ -180,7 +180,7 @@ Foam::processorGAMGInterface::processorGAMGInterface
{
faceCells_[nCoarseFaces] = contents[masterI];
forAllIter(SLList<label>, faceFacesIter(), facesIter)
forAllConstIter(SLList<label>, faceFacesIter(), facesIter)
{
faceRestrictAddressing_[facesIter()] = nCoarseFaces;
}
@ -213,7 +213,7 @@ Foam::processorGAMGInterface::processorGAMGInterface
{
faceCells_[nCoarseFaces] = nbrsIter();
forAllIter(SLList<label>, faceFacesIter(), facesIter)
forAllConstIter(SLList<label>, faceFacesIter(), facesIter)
{
faceRestrictAddressing_[facesIter()] = nCoarseFaces;
}

View File

@ -1411,7 +1411,7 @@ void Foam::globalPoints::calculateSharedPoints
// Sort procPoints in incremental order. This will make the master the
// first element.
forAllIter(Map<label>, meshToProcPoint_, iter)
forAllConstIter(Map<label>, meshToProcPoint_, iter)
{
sort(procPoints_[iter()]);
}

View File

@ -371,8 +371,8 @@ Foam::mapDistribute::mapDistribute
label i = 0;
forAllIter(Map<label>, compactMap[procI], iter)
{
const label compactI = compactStart[procI] + iter();
remoteElem[i] = iter.key();
label compactI = compactStart[procI]+iter();
localElem[i] = compactI;
iter() = compactI;
i++;
@ -525,8 +525,8 @@ Foam::mapDistribute::mapDistribute
label i = 0;
forAllIter(Map<label>, compactMap[procI], iter)
{
const label compactI = compactStart[procI] + iter();
remoteElem[i] = iter.key();
label compactI = compactStart[procI]+iter();
localElem[i] = compactI;
iter() = compactI;
i++;

View File

@ -201,12 +201,7 @@ void Foam::syncTools::syncPointMap
// Only update those values which come from neighbour
forAllConstIter
(
typename Map<T>,
nbrPatchInfo,
nbrIter
)
forAllConstIter(typename Map<T>, nbrPatchInfo, nbrIter)
{
combine
(
@ -550,12 +545,7 @@ void Foam::syncTools::syncEdgeMap
// Only update those values which come from neighbour
forAllConstIter
(
typename EdgeMap<T>,
nbrPatchInfo,
nbrIter
)
forAllConstIter(typename EdgeMap<T>, nbrPatchInfo, nbrIter)
{
const edge& e = nbrIter.key();
const edge meshEdge(meshPts[e[0]], meshPts[e[1]]);

View File

@ -80,12 +80,14 @@ calcPointEdges() const
forAll(pointEdges, pointI)
{
pe[pointI].setSize(pointEdges[pointI].size());
const SLList<label>& pEdge = pointEdges[pointI];
pe[pointI].setSize(pEdge.size());
label i = 0;
forAllIter(SLList<label>, pointEdges[pointI], curEdgesIter)
forAllConstIter(SLList<label>, pEdge, iter)
{
pe[pointI][i++] = curEdgesIter();
pe[pointI][i++] = iter();
}
}

View File

@ -35,12 +35,7 @@ void Foam::fvMeshDistribute::printFieldInfo(const fvMesh& mesh)
mesh.objectRegistry::lookupClass<GeoField>()
);
for
(
typename HashTable<const GeoField*>::const_iterator iter = flds.begin();
iter != flds.end();
++iter
)
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
@ -68,12 +63,7 @@ void Foam::fvMeshDistribute::addPatchFields(const word& patchFieldType)
mesh_.objectRegistry::lookupClass<GeoField>()
);
for
(
typename HashTable<const GeoField*>::const_iterator iter = flds.begin();
iter != flds.end();
++iter
)
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
@ -108,12 +98,7 @@ void Foam::fvMeshDistribute::deleteTrailingPatchFields()
mesh_.objectRegistry::lookupClass<GeoField>()
);
for
(
typename HashTable<const GeoField*>::const_iterator iter = flds.begin();
iter != flds.end();
++iter
)
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
@ -147,12 +132,7 @@ void Foam::fvMeshDistribute::saveBoundaryFields
label i = 0;
for
(
typename HashTable<const fldType*>::const_iterator iter = flds.begin();
iter != flds.end();
++iter
)
forAllConstIter(typename HashTable<const fldType*>, flds, iter)
{
const fldType& fld = *iter();
@ -189,12 +169,7 @@ void Foam::fvMeshDistribute::mapBoundaryFields
label fieldI = 0;
for
(
typename HashTable<const fldType*>::const_iterator iter = flds.begin();
iter != flds.end();
++iter
)
forAllConstIter(typename HashTable<const fldType*>, flds, iter)
{
const fldType& fld = *iter();
typename fldType::GeometricBoundaryField& bfld =
@ -245,12 +220,7 @@ void Foam::fvMeshDistribute::initPatchFields
mesh_.objectRegistry::lookupClass<GeoField>()
);
for
(
typename HashTable<const GeoField*>::const_iterator iter = flds.begin();
iter != flds.end();
++iter
)
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
{
const GeoField& fld = *iter();

View File

@ -36,12 +36,8 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(Foam::combineFaces, 0);
defineTypeNameAndDebug(combineFaces, 0);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -46,12 +46,7 @@ void setUpdater::updateSets(const mapPolyMesh& morphMap) const
HashTable<const Type*> memSets =
morphMap.mesh().objectRegistry::lookupClass<Type>();
for
(
typename HashTable<const Type*>::iterator iter = memSets.begin();
iter != memSets.end();
++iter
)
forAllIter(typename HashTable<const Type*>, memSets, iter)
{
Type& set = const_cast<Type&>(*iter());

View File

@ -461,7 +461,11 @@ Foam::genericFvPatchField<Type>::genericFvPatchField
iter
)
{
scalarFields_.insert(iter.key(), new scalarField(*iter(), mapper));
scalarFields_.insert
(
iter.key(),
new scalarField(*iter(), mapper)
);
}
forAllConstIter
@ -471,7 +475,11 @@ Foam::genericFvPatchField<Type>::genericFvPatchField
iter
)
{
vectorFields_.insert(iter.key(), new vectorField(*iter(), mapper));
vectorFields_.insert
(
iter.key(),
new vectorField(*iter(), mapper)
);
}
forAllConstIter
@ -509,7 +517,11 @@ Foam::genericFvPatchField<Type>::genericFvPatchField
iter
)
{
tensorFields_.insert(iter.key(), new tensorField(*iter(), mapper));
tensorFields_.insert
(
iter.key(),
new tensorField(*iter(), mapper)
);
}
}

View File

@ -352,14 +352,32 @@ genericPointPatchField<Type>::genericPointPatchField
actualTypeName_(ptf.actualTypeName_),
dict_(ptf.dict_)
{
forAllConstIter(HashPtrTable<scalarField>, ptf.scalarFields_, iter)
forAllConstIter
(
HashPtrTable<scalarField>,
ptf.scalarFields_,
iter
)
{
scalarFields_.insert(iter.key(), new scalarField(*iter(), mapper));
scalarFields_.insert
(
iter.key(),
new scalarField(*iter(), mapper)
);
}
forAllConstIter(HashPtrTable<vectorField>, ptf.vectorFields_, iter)
forAllConstIter
(
HashPtrTable<vectorField>,
ptf.vectorFields_,
iter
)
{
vectorFields_.insert(iter.key(), new vectorField(*iter(), mapper));
vectorFields_.insert
(
iter.key(),
new vectorField(*iter(), mapper)
);
}
forAllConstIter
@ -397,7 +415,11 @@ genericPointPatchField<Type>::genericPointPatchField
iter
)
{
tensorFields_.insert(iter.key(), new tensorField(*iter(), mapper));
tensorFields_.insert
(
iter.key(),
new tensorField(*iter(), mapper)
);
}
}

View File

@ -227,12 +227,7 @@ void Foam::Cloud<ParticleType>::move(TrackingData& td)
typename ParticleType::iNew(*this)
);
forAllIter
(
typename Cloud<ParticleType>,
newParticles,
newpIter
)
forAllIter(typename Cloud<ParticleType>, newParticles, newpIter)
{
ParticleType& newp = newpIter();
newp.correctAfterParallelTransfer(patchi, td);

View File

@ -33,12 +33,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void spray::evolve()
void Foam::spray::evolve()
{
sms_.setSize(rho_.size());
shs_.setSize(rho_.size());
@ -71,7 +66,7 @@ void spray::evolve()
}
void spray::move()
void Foam::spray::move()
{
// Reset Spray Source Terms
sms_ = vector::zero;
@ -85,9 +80,9 @@ void spray::move()
}
void spray::breakupLoop()
void Foam::spray::breakupLoop()
{
forAllIter(spray::iterator, *this, elmnt)
forAllIter(spray, *this, elmnt)
{
// interpolate...
vector velocity = UInterpolator().interpolate
@ -119,9 +114,9 @@ void spray::breakupLoop()
}
void spray::atomizationLoop()
void Foam::spray::atomizationLoop()
{
forAllIter(spray::iterator, *this, elmnt)
forAllIter(spray, *this, elmnt)
{
// interpolate...
vector velocity = UInterpolator().interpolate
@ -145,8 +140,4 @@ void spray::atomizationLoop()
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -29,8 +29,7 @@ if (mesh.time().timeIndex() % vacf.sampleSteps() == 0)
label uV = 0;
// or forAllConstIter
forAllIter(IDLList<molecule>, molecules, mol)
forAllConstIter(IDLList<molecule>, molecules, mol)
{
uVals[uV++] = mol().U();
}
@ -42,8 +41,7 @@ if (mesh.time().timeIndex() % pacf.sampleSteps() == 0)
{
vector p = vector::zero;
// or forAllConstIter
forAllIter(IDLList<molecule>, molecules, mol)
forAllConstIter(IDLList<molecule>, molecules, mol)
{
p.x() +=
mol().mass() * mol().U().y() * mol().U().z()
@ -65,8 +63,7 @@ if (mesh.time().timeIndex() % hfacf.sampleSteps() == 0)
{
vector s = vector::zero;
// or forAllConstIter
forAllIter(IDLList<molecule>, molecules, mol)
forAllConstIter(IDLList<molecule>, molecules, mol)
{
s +=
(

View File

@ -54,14 +54,9 @@ label singleStepNMols = molecules.size();
label singleStepDOFs = 0;
{
for
(
IDLList<molecule>::iterator mol = molecules.begin();
mol != molecules.end();
++mol
)
forAllConstIter(IDLList<molecule>, molecules, mol)
{
label molId = mol().id();
const label molId = mol().id();
scalar molMass(molecules.constProps(molId).mass());
@ -75,14 +70,9 @@ label singleStepDOFs = 0;
// singleStepCentreOfMass /= singleStepTotalMass;
// }
for
(
IDLList<molecule>::iterator mol = molecules.begin();
mol != molecules.end();
++mol
)
forAllConstIter(IDLList<molecule>, molecules, mol)
{
label molId = mol().id();
const label molId = mol().id();
const molecule::constantProperties cP(molecules.constProps(molId));

View File

@ -72,7 +72,7 @@ void Foam::solidParticle::readFields(Cloud<solidParticle>& c)
c.checkFieldIOobject(c, U);
label i = 0;
forAllIter(Cloud<solidParticle>::iterator, c, iter)
forAllIter(Cloud<solidParticle>, c, iter)
{
solidParticle& p = iter();

View File

@ -125,12 +125,7 @@ void meshRefinement::addPatchFields(fvMesh& mesh, const word& patchFieldType)
mesh.objectRegistry::lookupClass<GeoField>()
);
for
(
typename HashTable<const GeoField*>::const_iterator iter = flds.begin();
iter != flds.end();
++iter
)
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
@ -165,12 +160,7 @@ void meshRefinement::reorderPatchFields(fvMesh& mesh, const labelList& oldToNew)
mesh.objectRegistry::lookupClass<GeoField>()
);
for
(
typename HashTable<const GeoField*>::const_iterator iter = flds.begin();
iter != flds.end();
++iter
)
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
{
const GeoField& fld = *iter();

View File

@ -150,9 +150,9 @@ void Foam::normalToFace::applyToSet
DynamicList<label> toBeRemoved(set.size()/10);
forAllIter(topoSet, set, iter)
forAllConstIter(topoSet, set, iter)
{
label faceI = iter.key();
const label faceI = iter.key();
vector n = mesh_.faceAreas()[faceI];
n /= mag(n) + VSMALL;

View File

@ -329,12 +329,7 @@ Foam::intersectedSurface::calcPointEdgeAddressing
}
// Shrink it
for
(
Map<DynamicList<label> >::iterator iter = facePointEdges.begin();
iter != facePointEdges.end();
++iter
)
forAllIter(Map< DynamicList<label> >, facePointEdges, iter)
{
iter().shrink();
@ -358,17 +353,13 @@ Foam::intersectedSurface::calcPointEdgeAddressing
{
label edgeI = fEdges[i];
const edge& e = edges[edgeI];
Pout<< " " << edgeI << ' ' << e << points[e.start()]
Pout<< " " << edgeI << ' ' << e
<< points[e.start()]
<< points[e.end()] << endl;
}
Pout<< " Constructed point-edge adressing:" << endl;
for
(
Map<DynamicList<label> >::iterator iter = facePointEdges.begin();
iter != facePointEdges.end();
++iter
)
forAllConstIter(Map< DynamicList<label> >, facePointEdges, iter)
{
Pout<< " vertex " << iter.key() << " is connected to edges "
<< iter() << endl;

View File

@ -96,7 +96,7 @@ void Foam::reconstructLagrangianFields
const IOobjectList& objects
)
{
word fieldClassName(IOField<Type>::typeName);
const word fieldClassName(IOField<Type>::typeName);
IOobjectList fields = objects.lookupClass(fieldClassName);
@ -105,7 +105,7 @@ void Foam::reconstructLagrangianFields
Info<< " Reconstructing lagrangian "
<< fieldClassName << "s\n" << endl;
forAllIter(IOobjectList, fields, fieldIter)
forAllConstIter(IOobjectList, fields, fieldIter)
{
Info<< " " << fieldIter()->name() << endl;
reconstructLagrangianField<Type>

View File

@ -52,7 +52,7 @@ void Foam::reconstructLagrangianPositions
Cloud<passiveParticle> lpi(meshes[i], cloudName, false);
forAllIter(Cloud<passiveParticle>, lpi, iter)
forAllConstIter(Cloud<passiveParticle>, lpi, iter)
{
const passiveParticle& ppi = iter();

View File

@ -37,14 +37,9 @@ Description
#include "readHexLabel.H"
#include "stringList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool triSurface::readTRI(const fileName& TRIfileName)
bool Foam::triSurface::readTRI(const fileName& TRIfileName)
{
IFstream TRIfile(TRIfileName);
@ -113,12 +108,12 @@ bool triSurface::readTRI(const fileName& TRIfileName)
label region = -1;
HashTable<label, string>::const_iterator findName =
HashTable<label, string>::const_iterator fnd =
STLsolidNames.find(solidName);
if (findName != STLsolidNames.end())
if (fnd != STLsolidNames.end())
{
region = findName();
region = fnd();
}
else
{
@ -135,16 +130,16 @@ bool triSurface::readTRI(const fileName& TRIfileName)
pointField rawPoints(STLpoints.size());
label i = 0;
forAllIter(SLList<STLpoint>, STLpoints, iter)
label pointI = 0;
forAllConstIter(SLList<STLpoint>, STLpoints, iter)
{
rawPoints[i++] = *iter;
rawPoints[pointI++] = *iter;
}
setSize(STLlabels.size());
label pointI = 0;
SLList<label>::iterator iter = STLlabels.begin();
pointI = 0;
SLList<label>::const_iterator iter = STLlabels.begin();
forAll(*this, i)
{
operator[](i)[0] = pointI++;
@ -171,8 +166,4 @@ bool triSurface::readTRI(const fileName& TRIfileName)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //