Skip to content
Snippets Groups Projects
Commit 1589afb9 authored by mattijs's avatar mattijs
Browse files

added localSize member function

parent feb846bd
No related branches found
No related tags found
No related merge requests found
...@@ -84,6 +84,9 @@ public: ...@@ -84,6 +84,9 @@ public:
//- Start of procI+1 data //- Start of procI+1 data
inline const labelList& offsets() const; inline const labelList& offsets() const;
//- my local size
inline label localSize() const;
//- Global sum of localSizes //- Global sum of localSizes
inline label size() const; inline label size() const;
......
...@@ -34,6 +34,17 @@ inline const Foam::labelList& Foam::globalIndex::offsets() const ...@@ -34,6 +34,17 @@ inline const Foam::labelList& Foam::globalIndex::offsets() const
} }
inline Foam::label Foam::globalIndex::localSize() const
{
return
(
Pstream::myProcNo() == 0
? offsets_[Pstream::myProcNo()]
: offsets_[Pstream::myProcNo()] - offsets_[Pstream::myProcNo()-1]
);
}
inline Foam::label Foam::globalIndex::size() const inline Foam::label Foam::globalIndex::size() const
{ {
return offsets_[Pstream::nProcs()-1]; return offsets_[Pstream::nProcs()-1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment