From c5c00b64ba8599f0dcf7077eea85f83cd87c4cc6 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 23 Jun 2009 13:15:19 +0100 Subject: [PATCH] removed access to offsets from globalIndex --- .../meshes/polyMesh/globalMeshData/globalIndex.H | 6 ++++-- .../meshes/polyMesh/globalMeshData/globalIndexI.H | 10 ++++++++-- .../searchableSurface/distributedTriSurfaceMesh.H | 3 +-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H index c74d82b182..dce4faca22 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H @@ -81,8 +81,10 @@ public: // Member Functions - //- Start of procI+1 data - inline const labelList& offsets() const; + ////- Start of procI+1 data + //inline const labelList& offsets() const; + //- Start of procI data + inline label offset(const label procI) const; //- my local size inline label localSize() const; diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H index 65f5d2d9d0..a286046841 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H @@ -28,9 +28,15 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline const Foam::labelList& Foam::globalIndex::offsets() const +//inline const Foam::labelList& Foam::globalIndex::offsets() const +//{ +// return offsets_; +//} + + +inline Foam::label Foam::globalIndex::offset(const label procI) const { - return offsets_; + return (procI == 0 ? 0 : offsets_[procI-1]); } diff --git a/src/meshTools/searchableSurface/distributedTriSurfaceMesh.H b/src/meshTools/searchableSurface/distributedTriSurfaceMesh.H index 4d5f7dfd17..dba72d2abf 100644 --- a/src/meshTools/searchableSurface/distributedTriSurfaceMesh.H +++ b/src/meshTools/searchableSurface/distributedTriSurfaceMesh.H @@ -354,8 +354,7 @@ public: //- Range of global indices that can be returned. virtual label globalSize() const { - const labelList& offsets = globalTris().offsets(); - return offsets[offsets.size()-1]; + return globalTris().size(); } virtual void findNearest