diff --git a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C index 9239b81a5dba69f9c8a8e3eaed8c17fd2e72a2c8..d66e43344b8f8c93ab94c391531cfebb426300fd 100644 --- a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C +++ b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C @@ -924,8 +924,8 @@ int main(int argc, char *argv[]) } } - HashTable<labelList,word> cellZones; - HashTable<labelList,word> faceZones; + HashTable<labelList> cellZones; + HashTable<labelList> faceZones; List<bool> isAPatch(patchNames.size(),true); if (dofVertIndices.size()) diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C index 41855ddd7b5d86d6b7e74483653a334a72e45ee0..52030e9c81028cc99803b5967695cb830f5094ab 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C @@ -233,21 +233,16 @@ void Foam::vtkPVFoam::updateInfoPatches if (meshPtr_) { const polyBoundaryMesh& patches = meshPtr_->boundaryMesh(); - const HashTable<labelList, word>& groups = patches.groupPatchIDs(); + const HashTable<labelList>& groups = patches.groupPatchIDs(); const wordList allPatchNames = patches.names(); // Add patch groups // ~~~~~~~~~~~~~~~~ - for - ( - HashTable<labelList, word>::const_iterator iter = groups.begin(); - iter != groups.end(); - ++iter - ) + forAllConstIters(groups, iter) { const word& groupName = iter.key(); - const labelList& patchIDs = iter(); + const labelList& patchIDs = iter.object(); label nFaces = 0; forAll(patchIDs, i) @@ -349,7 +344,7 @@ void Foam::vtkPVFoam::updateInfoPatches // Add (non-zero) patch groups to the list of mesh parts // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - HashTable<labelList, word> groups(patchEntries.size()); + HashTable<labelList> groups(patchEntries.size()); forAll(patchEntries, patchi) { @@ -360,7 +355,7 @@ void Foam::vtkPVFoam::updateInfoPatches forAll(groupNames, groupI) { - HashTable<labelList, word>::iterator iter = groups.find + HashTable<labelList>::iterator iter = groups.find ( groupNames[groupI] ); @@ -375,16 +370,10 @@ void Foam::vtkPVFoam::updateInfoPatches } } - for - ( - HashTable<labelList, word>::const_iterator iter = - groups.begin(); - iter != groups.end(); - ++iter - ) + forAllConstIters(groups, iter) { const word& groupName = iter.key(); - const labelList& patchIDs = iter(); + const labelList& patchIDs = iter.object(); label nFaces = 0; forAll(patchIDs, i) diff --git a/doc/codingStyleGuide.org b/doc/codingStyleGuide.org index 3cde03d85da57228690ffb68dfceccb69b0702e3..b8d1b0d98aa89c36cecc401b823e2af02ead82d4 100644 --- a/doc/codingStyleGuide.org +++ b/doc/codingStyleGuide.org @@ -22,7 +22,7 @@ + Stream output + =<<= is always four characters after the start of the stream, so that the =<<= symbols align, i.e. - #+begin_src c++ + #+begin_src C++ Info<< ... os << ... #+end_src @@ -215,7 +215,7 @@ *** =for= and =while= Loops #+begin_src C++ - for (i = 0; i < maxI; i++) + for (i = 0; i < maxI; ++i) { code; } @@ -226,7 +226,7 @@ ( i = 0; i < maxI; - i++ + ++i ) { code; @@ -234,15 +234,22 @@ #+end_src *not* this (no space between =for= and =(= used) #+begin_src C++ - for(i = 0; i < maxI; i++) + for(i = 0; i < maxI; ++i) + { + code; + } + #+end_src + Range-base for should have a space surrounding the ':' + #+begin_src C++ + for (auto i : range) { code; } #+end_src - Note that when indexing through iterators, it is often slightly more - efficient to use the pre-increment form. Eg, =++iter= instead of =iter++= + Note that when indexing through iterators, it is often more efficient + to use the pre-increment form. Eg, =++iter= instead of =iter++= -*** =forAll=, =forAllIter=, =forAllConstIter=, /etc./ loops +*** =forAll=, =forAllIters=, =forAllConstIters=, /etc./ loops Like =for= loops, but #+begin_src C++ forAll( @@ -251,15 +258,22 @@ #+begin_src C++ forAll ( #+end_src - Using the =forAllIter= and =forAllConstIter= macros is generally - advantageous - less typing, easier to find later. However, since - they are macros, they will fail if the iterated object contains - any commas /e.g./ following will FAIL!: + In many cases, the new =forAllIters= and =forAllConstIters= macros + provide a good means of cycling through iterators (when a range-base + for doesn't apply). These use the C++11 decltype and work without + explicitly specifying the container class: + #+begin_src C++ + forAllIters(myEdgeHash, iter) + #+end_src + Using the older =forAllIter= and =forAllConstIter= macros will + still be seen. However, since they are macros, they will fail if + the iterated object contains any commas /e.g./ following will FAIL!: #+begin_src C++ - forAllIter(HashTable<labelPair, edge, Hash<edge>>, foo, iter) + forAllIter(HashTable<labelPair, edge, Hash<edge>>, myEdgeHash, iter) #+end_src These convenience macros are also generally avoided in other container classes and OpenFOAM primitive classes. + In certain cases, the range-based for can also be used. *** Splitting Over Multiple Lines ***** Splitting return type and function name diff --git a/src/OpenFOAM/db/dictionary/dictionary.C b/src/OpenFOAM/db/dictionary/dictionary.C index 08c702fee3baeb78724778afae6314da0d863ecd..8fb2751378dc7d0de6f7ec5e6fc4729d836ed321 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.C +++ b/src/OpenFOAM/db/dictionary/dictionary.C @@ -743,6 +743,24 @@ Foam::dictionary Foam::dictionary::subOrEmptyDict } +const Foam::dictionary& Foam::dictionary::optionalSubDict +( + const word& keyword +) const +{ + const entry* entryPtr = lookupEntryPtr(keyword, false, true); + + if (entryPtr) + { + return entryPtr->dict(); + } + else + { + return *this; + } +} + + Foam::wordList Foam::dictionary::toc() const { wordList keys(size()); diff --git a/src/OpenFOAM/db/dictionary/dictionary.H b/src/OpenFOAM/db/dictionary/dictionary.H index a2031ede037c13586c28d658af516bfd43488f62..e00353b9867f0a8fc542c4dc461c8e505dd1419c 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.H +++ b/src/OpenFOAM/db/dictionary/dictionary.H @@ -436,6 +436,10 @@ public: const bool mustRead = false ) const; + //- Find and return a sub-dictionary if found + // otherwise return this dictionary + const dictionary& optionalSubDict(const word& keyword) const; + //- Return the table of contents wordList toc() const; diff --git a/src/OpenFOAM/meshes/Identifiers/patch/coupleGroupIdentifier.C b/src/OpenFOAM/meshes/Identifiers/patch/coupleGroupIdentifier.C index bf01fe7be95df41b848ebf7929faadebe9aeefc8..9b7fc8a548d93335410f3091d10e427fad0d62af 100644 --- a/src/OpenFOAM/meshes/Identifiers/patch/coupleGroupIdentifier.C +++ b/src/OpenFOAM/meshes/Identifiers/patch/coupleGroupIdentifier.C @@ -46,10 +46,10 @@ Foam::label Foam::coupleGroupIdentifier::findOtherPatchID << exit(FatalError); } - HashTable<labelList, word>::const_iterator fnd = + HashTable<labelList>::const_iterator fnd = pbm.groupPatchIDs().find(name()); - if (fnd == pbm.groupPatchIDs().end()) + if (!fnd.found()) { if (&mesh == &thisPatch.boundaryMesh().mesh()) { @@ -65,7 +65,7 @@ Foam::label Foam::coupleGroupIdentifier::findOtherPatchID } // Mesh has patch group - const labelList& patchIDs = fnd(); + const labelList& patchIDs = fnd.object(); if (&mesh == &thisPatch.boundaryMesh().mesh()) { diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C index edb37c727bfc5424f691a678221689847f9f4f83..f7068f4249033117ac57d5244b06f8815494816b 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C @@ -32,6 +32,7 @@ License #include "lduSchedule.H" #include "globalMeshData.H" #include "stringListOps.H" +#include "EdgeMap.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -287,7 +288,7 @@ Foam::polyBoundaryMesh::neighbourEdges() const // From mesh edge (expressed as a point pair so as not to construct // point addressing) to patch + relative edge index. - HashTable<labelPair, edge, Hash<edge>> pointsToEdge(nEdgePairs); + EdgeMap<labelPair> pointsToEdge(nEdgePairs); forAll(*this, patchi) { @@ -308,10 +309,9 @@ Foam::polyBoundaryMesh::neighbourEdges() const // Edge in mesh points. edge meshEdge(pp.meshPoints()[e[0]], pp.meshPoints()[e[1]]); - HashTable<labelPair, edge, Hash<edge>>::iterator fnd = - pointsToEdge.find(meshEdge); + EdgeMap<labelPair>::iterator fnd = pointsToEdge.find(meshEdge); - if (fnd == pointsToEdge.end()) + if (!fnd.found()) { // First occurrence of mesh edge. Store patch and my // local index. @@ -328,7 +328,7 @@ Foam::polyBoundaryMesh::neighbourEdges() const else { // Second occurrence. Store. - const labelPair& edgeInfo = fnd(); + const labelPair& edgeInfo = fnd.object(); neighbourEdges[patchi][edgei - pp.nInternalEdges()] = edgeInfo; @@ -413,13 +413,13 @@ const Foam::labelList& Foam::polyBoundaryMesh::patchID() const } -const Foam::HashTable<Foam::labelList, Foam::word>& +const Foam::HashTable<Foam::labelList>& Foam::polyBoundaryMesh::groupPatchIDs() const { if (!groupPatchIDsPtr_.valid()) { - groupPatchIDsPtr_.reset(new HashTable<labelList, word>(10)); - HashTable<labelList, word>& groupPatchIDs = groupPatchIDsPtr_(); + groupPatchIDsPtr_.reset(new HashTable<labelList>(10)); + HashTable<labelList>& groupPatchIDs = groupPatchIDsPtr_(); const polyBoundaryMesh& bm = *this; @@ -431,7 +431,7 @@ Foam::polyBoundaryMesh::groupPatchIDs() const { const word& name = groups[i]; - HashTable<labelList, word>::iterator iter = groupPatchIDs.find + HashTable<labelList>::iterator iter = groupPatchIDs.find ( name ); @@ -612,10 +612,10 @@ Foam::labelList Foam::polyBoundaryMesh::findIndices if (usePatchGroups && groupPatchIDs().size()) { - const HashTable<labelList, word>::const_iterator iter = + const HashTable<labelList>::const_iterator iter = groupPatchIDs().find(key); - if (iter != groupPatchIDs().end()) + if (iter.found()) { labelHashSet indexSet(indices); @@ -815,14 +815,8 @@ void Foam::polyBoundaryMesh::matchGroups // Current set of unmatched patches nonGroupPatches = labelHashSet(patchIDs); - const HashTable<labelList, word>& groupPatchIDs = this->groupPatchIDs(); - for - ( - HashTable<labelList,word>::const_iterator iter = - groupPatchIDs.begin(); - iter != groupPatchIDs.end(); - ++iter - ) + const HashTable<labelList>& groupPatchIDs = this->groupPatchIDs(); + forAllConstIters(groupPatchIDs, iter) { // Store currently unmatched patches so we can restore labelHashSet oldNonGroupPatches(nonGroupPatches); diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H index 114fc231689348e9c249bb61d609f60423be6fb4..6193b98f4505fae884c0444e726510d99d6084b5 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H @@ -70,7 +70,7 @@ class polyBoundaryMesh mutable autoPtr<labelList> patchIDPtr_; - mutable autoPtr<HashTable<labelList, word>> groupPatchIDsPtr_; + mutable autoPtr<HashTable<labelList>> groupPatchIDsPtr_; //- Edges of neighbouring patches mutable autoPtr<List<labelPairList>> neighbourEdgesPtr_; @@ -183,8 +183,8 @@ public: //- Per boundary face label the patch index const labelList& patchID() const; - //- Per patch group the patch indices - const HashTable<labelList, word>& groupPatchIDs() const; + //- The patch indices per patch group + const HashTable<labelList>& groupPatchIDs() const; //- Set/add group with patches void setGroup(const word& groupName, const labelList& patchIDs); diff --git a/src/OpenFOAM/primitives/strings/lists/hashedWordList.H b/src/OpenFOAM/primitives/strings/lists/hashedWordList.H index 733d012b92bbc506930ec638f871518fd1fb6f1d..9ecab0f382553b239cdd9caa4ceae20aece676cc 100644 --- a/src/OpenFOAM/primitives/strings/lists/hashedWordList.H +++ b/src/OpenFOAM/primitives/strings/lists/hashedWordList.H @@ -62,7 +62,7 @@ class hashedWordList // Private data //- Hash of words/indices - mutable HashTable<label,word> indices_; + mutable HashTable<label> indices_; // Private Member Functions @@ -141,7 +141,7 @@ public: inline bool contains(const word& name) const; //- Return the hash of words/indices for inspection - inline const HashTable<label,word>& lookup() const; + inline const HashTable<label>& lookup() const; //- Transfer the contents of the argument List into this list // and annul the argument list, diff --git a/src/OpenFOAM/primitives/strings/lists/hashedWordListI.H b/src/OpenFOAM/primitives/strings/lists/hashedWordListI.H index b011b26ecd7b4112215d8d011b138f00bf3cf0e9..80f8d28be0841295f8363ce9745fcb42c9fb92b7 100644 --- a/src/OpenFOAM/primitives/strings/lists/hashedWordListI.H +++ b/src/OpenFOAM/primitives/strings/lists/hashedWordListI.H @@ -134,7 +134,7 @@ inline void Foam::hashedWordList::append } -inline const Foam::HashTable<Foam::label,Foam::word>& +inline const Foam::HashTable<Foam::label>& Foam::hashedWordList::lookup() const { return indices_; diff --git a/src/dynamicMesh/meshCut/meshModifiers/boundaryCutter/boundaryCutter.C b/src/dynamicMesh/meshCut/meshModifiers/boundaryCutter/boundaryCutter.C index 0b2da048ddc2bb58bc18f01bee900ca7e911e0f3..8a0f2a16052f016e76c1b20bc1cfb32a99628fda 100644 --- a/src/dynamicMesh/meshCut/meshModifiers/boundaryCutter/boundaryCutter.C +++ b/src/dynamicMesh/meshCut/meshModifiers/boundaryCutter/boundaryCutter.C @@ -869,16 +869,9 @@ void Foam::boundaryCutter::updateMesh(const mapPolyMesh& morphMap) { // Create copy since we're deleting entries - HashTable<labelList, edge, Hash<edge>> - newEdgeAddedPoints(edgeAddedPoints_.size()); + EdgeMap<labelList> newEdgeAddedPoints(edgeAddedPoints_.size()); - for - ( - HashTable<labelList, edge, Hash<edge>>::const_iterator iter = - edgeAddedPoints_.begin(); - iter != edgeAddedPoints_.end(); - ++iter - ) + forAllConstIters(edgeAddedPoints_, iter) { const edge& e = iter.key(); @@ -888,7 +881,7 @@ void Foam::boundaryCutter::updateMesh(const mapPolyMesh& morphMap) if (newStart >= 0 && newEnd >= 0) { - const labelList& addedPoints = iter(); + const labelList& addedPoints = iter.object(); labelList newAddedPoints(addedPoints.size()); label newI = 0; diff --git a/src/dynamicMesh/meshCut/meshModifiers/boundaryCutter/boundaryCutter.H b/src/dynamicMesh/meshCut/meshModifiers/boundaryCutter/boundaryCutter.H index 9088b04cf927bd11f098ec8a10fe27cc2e63e0e2..e3c75c5511c176afd35bbc3678ed4e8c8c204fa2 100644 --- a/src/dynamicMesh/meshCut/meshModifiers/boundaryCutter/boundaryCutter.H +++ b/src/dynamicMesh/meshCut/meshModifiers/boundaryCutter/boundaryCutter.H @@ -44,7 +44,7 @@ SourceFiles #include "Map.H" #include "labelList.H" -#include "edge.H" +#include "EdgeMap.H" #include "typeInfo.H" #include "labelPair.H" @@ -71,7 +71,7 @@ class boundaryCutter const polyMesh& mesh_; //- Per edge sorted (start to end) list of points added. - HashTable<labelList, edge, Hash<edge>> edgeAddedPoints_; + EdgeMap<labelList> edgeAddedPoints_; //- Per face the mid point added. Map<label> faceAddedPoint_; @@ -159,8 +159,7 @@ public: // Access //- Per edge a sorted list (start to end) of added points. - const HashTable<labelList, edge, Hash<edge>>& edgeAddedPoints() - const + const EdgeMap<labelList>& edgeAddedPoints() const { return edgeAddedPoints_; } diff --git a/src/dynamicMesh/meshCut/meshModifiers/meshCutAndRemove/meshCutAndRemove.C b/src/dynamicMesh/meshCut/meshModifiers/meshCutAndRemove/meshCutAndRemove.C index 4ac1f6485a10d85134718b31f7efa6a95a3f6ebe..d169c6e56ab54b174a99de913d9c65f22541a056 100644 --- a/src/dynamicMesh/meshCut/meshModifiers/meshCutAndRemove/meshCutAndRemove.C +++ b/src/dynamicMesh/meshCut/meshModifiers/meshCutAndRemove/meshCutAndRemove.C @@ -479,13 +479,13 @@ Foam::face Foam::meshCutAndRemove::addEdgeCutsToFace(const label facei) const // Check if edge has been cut. label fp1 = f.fcIndex(fp); - HashTable<label, edge, Hash<edge>>::const_iterator fnd = + EdgeMap<label>::const_iterator fnd = addedPoints_.find(edge(f[fp], f[fp1])); - if (fnd != addedPoints_.end()) + if (fnd.found()) { // edge has been cut. Introduce new vertex. - newFace[newFp++] = fnd(); + newFace[newFp++] = fnd.object(); } } @@ -541,12 +541,12 @@ Foam::face Foam::meshCutAndRemove::loopToFace if (edgeI != -1) { // Existing edge. Insert split-edge point if any. - HashTable<label, edge, Hash<edge>>::const_iterator fnd = + EdgeMap<label>::const_iterator fnd = addedPoints_.find(mesh().edges()[edgeI]); - if (fnd != addedPoints_.end()) + if (fnd.found()) { - newFace[newFacei++] = fnd(); + newFace[newFacei++] = fnd.object(); } } } @@ -1302,24 +1302,17 @@ void Foam::meshCutAndRemove::updateMesh(const mapPolyMesh& map) } { - HashTable<label, edge, Hash<edge>> newAddedPoints(addedPoints_.size()); + EdgeMap<label> newAddedPoints(addedPoints_.size()); - for - ( - HashTable<label, edge, Hash<edge>>::const_iterator iter = - addedPoints_.begin(); - iter != addedPoints_.end(); - ++iter - ) + forAllConstIters(addedPoints_, iter) { const edge& e = iter.key(); + const label addedPointi = iter.object(); label newStart = map.reversePointMap()[e.start()]; label newEnd = map.reversePointMap()[e.end()]; - label addedPointi = iter(); - label newAddedPointi = map.reversePointMap()[addedPointi]; if ((newStart >= 0) && (newEnd >= 0) && (newAddedPointi >= 0)) diff --git a/src/dynamicMesh/meshCut/meshModifiers/meshCutAndRemove/meshCutAndRemove.H b/src/dynamicMesh/meshCut/meshModifiers/meshCutAndRemove/meshCutAndRemove.H index cbd569f146793e19c80797710c59222212bff2ec..a73123c5db2d7e3b46956b0766cbd6123f7f54ed 100644 --- a/src/dynamicMesh/meshCut/meshModifiers/meshCutAndRemove/meshCutAndRemove.H +++ b/src/dynamicMesh/meshCut/meshModifiers/meshCutAndRemove/meshCutAndRemove.H @@ -40,6 +40,7 @@ SourceFiles #include "labelList.H" #include "typeInfo.H" #include "Map.H" +#include "EdgeMap.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -70,7 +71,7 @@ class meshCutAndRemove //- Points added in last setRefinement. Per split edge label of added // point - HashTable<label, edge, Hash<edge>> addedPoints_; + EdgeMap<label> addedPoints_; // Private Static Functions @@ -225,7 +226,7 @@ public: //- Points added. Per split edge label of added point. // (note: fairly useless across topology changes since one of the // points of the edge will probably disappear) - const HashTable<label, edge, Hash<edge>>& addedPoints() const + const EdgeMap<label>& addedPoints() const { return addedPoints_; } diff --git a/src/dynamicMesh/meshCut/meshModifiers/meshCutter/meshCutter.C b/src/dynamicMesh/meshCut/meshModifiers/meshCutter/meshCutter.C index 903e1c60a9e71f4630ccaac1093b9255309a029f..6486908275751e31c5feacbc9592e0813c653c21 100644 --- a/src/dynamicMesh/meshCut/meshModifiers/meshCutter/meshCutter.C +++ b/src/dynamicMesh/meshCut/meshModifiers/meshCutter/meshCutter.C @@ -424,13 +424,13 @@ Foam::face Foam::meshCutter::addEdgeCutsToFace(const label facei) const // Check if edge has been cut. label fp1 = f.fcIndex(fp); - HashTable<label, edge, Hash<edge>>::const_iterator fnd = + EdgeMap<label>::const_iterator fnd = addedPoints_.find(edge(f[fp], f[fp1])); - if (fnd != addedPoints_.end()) + if (fnd.found()) { // edge has been cut. Introduce new vertex. - newFace[newFp++] = fnd(); + newFace[newFp++] = fnd.object(); } } @@ -483,12 +483,12 @@ Foam::face Foam::meshCutter::loopToFace if (edgeI != -1) { // Existing edge. Insert split-edge point if any. - HashTable<label, edge, Hash<edge>>::const_iterator fnd = + EdgeMap<label>::const_iterator fnd = addedPoints_.find(mesh().edges()[edgeI]); - if (fnd != addedPoints_.end()) + if (fnd.found()) { - newFace[newFacei++] = fnd(); + newFace[newFacei++] = fnd.object(); } } } @@ -1043,24 +1043,17 @@ void Foam::meshCutter::updateMesh(const mapPolyMesh& morphMap) } { - HashTable<label, edge, Hash<edge>> newAddedPoints(addedPoints_.size()); + EdgeMap<label> newAddedPoints(addedPoints_.size()); - for - ( - HashTable<label, edge, Hash<edge>>::const_iterator iter = - addedPoints_.begin(); - iter != addedPoints_.end(); - ++iter - ) + forAllConstIters(addedPoints_, iter) { const edge& e = iter.key(); + const label addedPointi = iter.object(); label newStart = morphMap.reversePointMap()[e.start()]; label newEnd = morphMap.reversePointMap()[e.end()]; - label addedPointi = iter(); - label newAddedPointi = morphMap.reversePointMap()[addedPointi]; if ((newStart >= 0) && (newEnd >= 0) && (newAddedPointi >= 0)) diff --git a/src/dynamicMesh/meshCut/meshModifiers/meshCutter/meshCutter.H b/src/dynamicMesh/meshCut/meshModifiers/meshCutter/meshCutter.H index b244e72367a081deda60e0f9d6a693eb33ffaaf7..b48d57d260299ba4af48fcb40a3e0cf472c484c5 100644 --- a/src/dynamicMesh/meshCut/meshModifiers/meshCutter/meshCutter.H +++ b/src/dynamicMesh/meshCut/meshModifiers/meshCutter/meshCutter.H @@ -115,6 +115,7 @@ SourceFiles #include "labelList.H" #include "typeInfo.H" #include "Map.H" +#include "EdgeMap.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -148,7 +149,7 @@ class meshCutter //- Points added in last setRefinement. Per split edge label of added // point - HashTable<label, edge, Hash<edge>> addedPoints_; + EdgeMap<label> addedPoints_; // Private Static Functions @@ -307,7 +308,7 @@ public: } //- Points added. Per split edge label of added point - const HashTable<label, edge, Hash<edge>>& addedPoints() const + const EdgeMap<label>& addedPoints() const { return addedPoints_; }