diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellPoints.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellPoints.C index 9748e8f9a1..a0e1f3d7e6 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellPoints.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellPoints.C @@ -29,6 +29,7 @@ License #include "primitiveMesh.H" #include "cell.H" #include "bitSet.H" +#include "DynamicList.H" #include "ListOps.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -67,52 +68,40 @@ void Foam::primitiveMesh::calcCellPoints() const { // Calculate cell-point topology - const cellList& cL = cells(); - const faceList& fL = faces(); - cpPtr_ = new labelListList(nCells()); - labelListList& cellPoints = *cpPtr_; + auto& cellPointAddr = *cpPtr_; - // Mark points we have found as to not count them twice for the same cell - Foam::bitSet foundPoint(nPoints(), false); + const cellList& cellLst = cells(); + const faceList& faceLst = faces(); - forAll (cL, cellIdx) + // For tracking (only use each point id once) + bitSet usedPoints(nPoints()); + + // Vertex labels for the current cell + DynamicList