added localSize member function

This commit is contained in:
mattijs
2009-05-29 15:28:26 +01:00
parent feb846bd43
commit 1589afb960
2 changed files with 14 additions and 0 deletions

View File

@ -84,6 +84,9 @@ public:
//- Start of procI+1 data
inline const labelList& offsets() const;
//- my local size
inline label localSize() const;
//- Global sum of localSizes
inline label size() const;

View File

@ -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
{
return offsets_[Pstream::nProcs()-1];