From d9727fad1cb3c9be906d1d75158e4fea605a2688 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 28 Sep 2023 16:23:10 +0200 Subject: [PATCH] ENH: use updated HashTable methods --- .../mesh/advanced/modifyMesh/cellSplitter.C | 4 ++-- .../ensightToFoam/ensightMeshReader.C | 2 +- .../fluent3DMeshToFoam/fluent3DMeshToFoam.L | 12 ++++++------ .../DelaunayMesh/DelaunayMeshIO.C | 2 +- .../manipulation/checkMesh/checkGeometry.C | 8 ++++---- .../mesh/manipulation/setSet/setSet.C | 2 +- .../dynamicIndexedOctree.C | 18 ++++++------------ .../algorithms/indexedOctree/indexedOctree.C | 18 ++++++------------ .../exprDriver/exprDriverFunctions.C | 5 +++-- .../polyMesh/globalMeshData/globalPoints.C | 4 ++-- .../mapDistribute/mapDistributeBase.C | 4 ++-- .../polyBoundaryMesh/polyBoundaryMesh.C | 6 +++--- .../polyMesh/polyMeshCheck/polyMeshCheck.C | 6 +++--- .../polyMesh/syncTools/syncToolsTemplates.C | 2 +- .../meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C | 6 +++--- .../PrimitivePatch/PrimitivePatchBdryPoints.C | 4 ++-- .../primitiveMeshCheck/primitiveMeshCheck.C | 2 +- .../processorTopology/processorTopologyNew.H | 2 +- .../primitives/strings/lists/hashedWordList.C | 4 ++-- .../dynamicRefineFvMesh/dynamicRefineFvMesh.C | 2 +- .../boundaryCutter/boundaryCutter.C | 8 ++++---- .../meshCutAndRemove/meshCutAndRemove.C | 4 ++-- .../meshModifiers/meshCutter/meshCutter.C | 6 +++--- src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C | 4 ++-- .../polyTopoChange/addPatchCellLayer.C | 2 +- .../polyTopoChange/edgeCollapser.C | 2 +- .../polyTopoChange/hexRef8/hexRef8.C | 4 ++-- .../polyTopoChange/removePoints.C | 4 ++-- .../faMesh/faBoundaryMesh/faBoundaryMesh.C | 6 +++--- .../globalIndexStencils/CECCellToCellStencil.C | 2 +- .../globalIndexStencils/CPCCellToCellStencil.C | 2 +- .../globalIndexStencils/FECCellToFaceStencil.C | 2 +- .../wallDistAddressing/wallDistAddressing.C | 2 +- .../zoneStencils/zoneCPCStencil.C | 2 +- .../field/nearWallFields/nearWallFields.C | 4 ++-- .../MGridGenGAMGAgglomeration.C | 2 +- .../pairPatchAgglomeration.C | 2 +- .../semiImplicitSource/SemiImplicitSource.C | 12 ++++++------ src/meshTools/regionSplit/localPointRegion.C | 4 ++-- src/meshTools/regionSplit/regionSplit.C | 9 ++++----- .../triSurfaceMesh/triSurfaceMesh.C | 2 +- src/meshTools/topoSet/topoSets/cellSet.C | 2 +- src/meshTools/topoSet/topoSets/cellZoneSet.C | 2 +- src/meshTools/topoSet/topoSets/faceSet.C | 2 +- src/meshTools/topoSet/topoSets/faceZoneSet.C | 2 +- src/meshTools/topoSet/topoSets/pointSet.C | 2 +- src/meshTools/topoSet/topoSets/pointZoneSet.C | 2 +- src/meshTools/topoSet/topoSets/topoSet.C | 2 +- .../inverseDistanceCellCellStencil.C | 2 +- .../faDecompose/faMeshDecomposition.C | 4 ++-- .../cutting/cuttingSurfaceBaseTemplates.C | 4 ++-- .../surface/isoSurface/isoSurfaceTopo.C | 4 ++-- 52 files changed, 107 insertions(+), 119 deletions(-) diff --git a/applications/utilities/mesh/advanced/modifyMesh/cellSplitter.C b/applications/utilities/mesh/advanced/modifyMesh/cellSplitter.C index 037e3a18b2..356617bd60 100644 --- a/applications/utilities/mesh/advanced/modifyMesh/cellSplitter.C +++ b/applications/utilities/mesh/advanced/modifyMesh/cellSplitter.C @@ -148,7 +148,7 @@ void Foam::cellSplitter::setRefinement ) { addedPoints_.clear(); - addedPoints_.resize(cellToMidPoint.size()); + addedPoints_.reserve(cellToMidPoint.size()); // @@ -184,7 +184,7 @@ void Foam::cellSplitter::setRefinement // Add cells (first one is modified original cell) // - Map cellToCells(cellToMidPoint.size()); + Map cellToCells(2*cellToMidPoint.size()); forAllConstIters(cellToMidPoint, iter) { diff --git a/applications/utilities/mesh/conversion/ensightToFoam/ensightMeshReader.C b/applications/utilities/mesh/conversion/ensightToFoam/ensightMeshReader.C index 39c0f2e7e6..91be645d68 100644 --- a/applications/utilities/mesh/conversion/ensightToFoam/ensightMeshReader.C +++ b/applications/utilities/mesh/conversion/ensightToFoam/ensightMeshReader.C @@ -102,7 +102,7 @@ void Foam::fileFormats::ensightMeshReader::readIDs foamToElem.resize(sz+nShapes); if (doRead) { - elemToFoam.resize(sz+nShapes); + elemToFoam.reserve(elemToFoam.size()+nShapes); for (label shapei = 0; shapei < nShapes; shapei++) { label elemi; diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index 0fdc03b2c7..f46d9c2b86 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -76,14 +76,14 @@ label nCells = 0; bool hangingNodes = false; -pointField points(0); -faceList faces(0); -labelList owner(0); -labelList neighbour(0); +pointField points; +faceList faces; +labelList owner; +labelList neighbour; // Group type and name -Map groupType(128); -Map groupName(128); +Map groupType; +Map groupName; // Point groups DynamicList