diff --git a/applications/test/DLList/DLListTest.C b/applications/test/DLList/DLListTest.C index 92db3b6651..4000dc90a1 100644 --- a/applications/test/DLList/DLListTest.C +++ b/applications/test/DLList/DLListTest.C @@ -51,12 +51,7 @@ int main(int argc, char *argv[]) Info<< nl << "And again using STL iterator: " << nl << endl; - for - ( - DLList::iterator iter = myList.begin(); - iter != myList.end(); - ++iter - ) + forAllIter(DLList, 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::iterator iter = myList.begin(); - iter != myList.end(); - ++iter - ) + forAllIter(DLList, myList, iter) { Info<< "Removing " << myList.remove(iter) << endl; } @@ -82,12 +72,7 @@ int main(int argc, char *argv[]) const DLList& const_myList = myList; - for - ( - DLList::const_iterator iter = const_myList.begin(); - iter != const_myList.end(); - ++iter - ) + forAllConstIter(DLList, 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::const_iterator iter = const_myList.begin(); - iter != const_myList.end(); - ++iter - ) + forAllConstIter(DLList, 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::const_iterator iter = const_myList.begin(); - iter != const_myList.end(); - ++iter - ) + forAllConstIter(DLList, 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 newList; newList.transfer(myList); diff --git a/applications/test/Dictionary/DictionaryTest.C b/applications/test/Dictionary/DictionaryTest.C index 138c185f4a..2844489f72 100644 --- a/applications/test/Dictionary/DictionaryTest.C +++ b/applications/test/Dictionary/DictionaryTest.C @@ -114,12 +114,7 @@ int main(int argc, char *argv[]) dict.swapDown(dict.first()); - for - ( - Dictionary::const_iterator iter = dict.begin(); - iter != dict.end(); - ++iter - ) + forAllConstIter(Dictionary, dict, iter) { Info<< "element : " << *iter; } @@ -159,12 +154,7 @@ int main(int argc, char *argv[]) } Info<< nl << "scalarDict1: " << endl; - for - ( - PtrDictionary::const_iterator iter = scalarDict.begin(); - iter != scalarDict.end(); - ++iter - ) + forAllConstIter(PtrDictionary, 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::const_iterator iter = scalarDict2.begin(); - iter != scalarDict2.end(); - ++iter - ) + forAllConstIter(PtrDictionary, scalarDict2, iter) { Info<< "elem = " << *iter << endl; } diff --git a/applications/test/ISLList/ISLListTest.C b/applications/test/ISLList/ISLListTest.C index bd390f38d3..1991aa4f24 100644 --- a/applications/test/ISLList/ISLListTest.C +++ b/applications/test/ISLList/ISLListTest.C @@ -78,12 +78,7 @@ int main(int argc, char *argv[]) Info<< nl << "And again using STL iterator: " << nl << endl; - for - ( - SLList::iterator iter = myList.begin(); - iter != myList.end(); - ++iter - ) + forAllIter(SLList, myList, iter) { Info<< "element:" << *iter << endl; } @@ -92,14 +87,9 @@ int main(int argc, char *argv[]) const ISLList& const_myList = myList; - for - ( - SLList::const_iterator iter2 = const_myList.begin(); - iter2 != const_myList.end(); - ++iter2 - ) + forAllConstIter(SLList, const_myList, iter) { - Info<< "element:" << *iter2 << endl; + Info<< "element:" << *iter << endl; } diff --git a/applications/test/PackedList2/PackedListTest2.C b/applications/test/PackedList2/PackedListTest2.C index 5a04ece832..362e5cd8d0 100644 --- a/applications/test/PackedList2/PackedListTest2.C +++ b/applications/test/PackedList2/PackedListTest2.C @@ -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; } diff --git a/applications/test/SLList/SLListTest.C b/applications/test/SLList/SLListTest.C index 3d40182df3..9a9e81c21f 100644 --- a/applications/test/SLList/SLListTest.C +++ b/applications/test/SLList/SLListTest.C @@ -51,12 +51,7 @@ int main(int argc, char *argv[]) Info<< nl << "And again using STL iterator: " << nl << endl; - for - ( - SLList::iterator iter = myList.begin(); - iter != myList.end(); - ++iter - ) + forAllIter(SLList, myList, iter) { Info<< "element:" << *iter << endl; } @@ -65,39 +60,23 @@ int main(int argc, char *argv[]) const SLList& const_myList = myList; - for - ( - SLList::const_iterator iter2 = const_myList.begin(); - iter2 != const_myList.end(); - ++iter2 - ) + forAllConstIter(SLList, const_myList, iter) { - Info<< "element:" << *iter2 << endl; + Info<< "element:" << *iter << endl; } - for - ( - SLList::iterator iter = myList.begin(); - iter != myList.end(); - ++iter - ) + forAllIter(SLList, myList, iter) { Info<< "Removing element:" << *iter << endl; myList.remove(iter); } - for - ( - SLList::const_iterator iter2 = const_myList.begin(); - iter2 != const_myList.end(); - ++iter2 - ) + forAllConstIter(SLList, const_myList, iter) { - Info<< "element:" << *iter2 << endl; + Info<< "element:" << *iter << endl; } - for (int i = 0; i<10; i++) { myList.append(1.3*i); diff --git a/applications/test/UDictionary/UDictionaryTest.C b/applications/test/UDictionary/UDictionaryTest.C index 13571ffab4..57fc55c0b3 100644 --- a/applications/test/UDictionary/UDictionaryTest.C +++ b/applications/test/UDictionary/UDictionaryTest.C @@ -81,12 +81,7 @@ int main(int argc, char *argv[]) dict.swapDown(dict.first()); - for - ( - UDictionary::const_iterator iter = dict.begin(); - iter != dict.end(); - ++iter - ) + forAllConstIter(UDictionary, dict, iter) { Info<< "element : " << *iter; } diff --git a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H index 7fd22cf88a..6c50c02fcd 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H +++ b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H @@ -441,12 +441,7 @@ if (pFaces[WEDGE].size() && pFaces[WEDGE][0].size()) { pFaces[CYCLIC].setSize(1); pFaces[CYCLIC][0] = pFaces[WEDGE][0]; - for - ( - SLList::iterator iterb = pFaces[WEDGE][1].begin(); - iterb != pFaces[WEDGE][1].end(); - ++iterb - ) + forAllIter(SLList, pFaces[WEDGE][1], iterb) { pFaces[CYCLIC][0].append(iterb()); } diff --git a/applications/utilities/mesh/generation/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrudeToRegionMesh/extrudeToRegionMesh.C index 5496835381..dfcfb91471 100644 --- a/applications/utilities/mesh/generation/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -143,12 +143,7 @@ void addPatchFields(fvMesh& mesh, const word& patchFieldType) mesh.objectRegistry::lookupClass() ); - for - ( - typename HashTable::const_iterator iter = flds.begin(); - iter != flds.end(); - ++iter - ) + forAllConstIter(typename HashTable, flds, iter) { const GeoField& fld = *iter(); @@ -183,12 +178,7 @@ void trimPatchFields(fvMesh& mesh, const label nPatches) mesh.objectRegistry::lookupClass() ); - for - ( - typename HashTable::const_iterator iter = flds.begin(); - iter != flds.end(); - ++iter - ) + forAllConstIter(typename HashTable, flds, iter) { const GeoField& fld = *iter(); @@ -209,12 +199,7 @@ void reorderPatchFields(fvMesh& mesh, const labelList& oldToNew) mesh.objectRegistry::lookupClass() ); - for - ( - typename HashTable::const_iterator iter = flds.begin(); - iter != flds.end(); - ++iter - ) + forAllConstIter(typename HashTable, flds, iter) { const GeoField& fld = *iter(); @@ -1461,7 +1446,7 @@ int main(int argc, char *argv[]) mesh.setInstance(meshInstance); } - + // Change master and slave boundary conditions on originating mesh diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C index 7da3c22269..1bac3a554b 100644 --- a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C +++ b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C @@ -99,12 +99,7 @@ void addPatchFields(fvMesh& mesh, const word& patchFieldType) mesh.objectRegistry::lookupClass() ); - for - ( - typename HashTable::const_iterator iter = flds.begin(); - iter != flds.end(); - ++iter - ) + forAllConstIter(typename HashTable, flds, iter) { const GeoField& fld = *iter(); @@ -139,12 +134,7 @@ void trimPatchFields(fvMesh& mesh, const label nPatches) mesh.objectRegistry::lookupClass() ); - for - ( - typename HashTable::const_iterator iter = flds.begin(); - iter != flds.end(); - ++iter - ) + forAllConstIter(typename HashTable, flds, iter) { const GeoField& fld = *iter(); @@ -165,12 +155,7 @@ void reorderPatchFields(fvMesh& mesh, const labelList& oldToNew) mesh.objectRegistry::lookupClass() ); - for - ( - typename HashTable::const_iterator iter = flds.begin(); - iter != flds.end(); - ++iter - ) + forAllConstIter(typename HashTable, flds, iter) { const GeoField& fld = *iter(); diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecompositionMesh.C b/applications/utilities/parallelProcessing/decomposePar/domainDecompositionMesh.C index 1a9bff5429..d7487dc58e 100644 --- a/applications/utilities/parallelProcessing/decomposePar/domainDecompositionMesh.C +++ b/applications/utilities/parallelProcessing/decomposePar/domainDecompositionMesh.C @@ -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