mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
added localSize for procI
This commit is contained in:
@ -83,30 +83,41 @@ public:
|
||||
|
||||
////- 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;
|
||||
|
||||
//- Global sum of localSizes
|
||||
inline label size() const;
|
||||
// Queries relating to my processor
|
||||
|
||||
//- From local to global
|
||||
inline label toGlobal(const label i) const;
|
||||
//- my local size
|
||||
inline label localSize() const;
|
||||
|
||||
//- Is on local processor
|
||||
inline bool isLocal(const label i) const;
|
||||
//- From local to global
|
||||
inline label toGlobal(const label i) const;
|
||||
|
||||
//- From global to local on procI
|
||||
inline label toLocal(const label procI, const label i) const;
|
||||
//- Is on local processor
|
||||
inline bool isLocal(const label i) const;
|
||||
|
||||
//- From global to local on current processor.
|
||||
// FatalError if not on local processor.
|
||||
inline label toLocal(const label i) const;
|
||||
//- From global to local on current processor.
|
||||
// FatalError if not on local processor.
|
||||
inline label toLocal(const label i) const;
|
||||
|
||||
|
||||
// Global queries
|
||||
|
||||
//- Global sum of localSizes
|
||||
inline label size() const;
|
||||
|
||||
//- From global to local on procI
|
||||
inline label toLocal(const label procI, const label i) const;
|
||||
|
||||
//- Which processor does global come from? Binary search.
|
||||
inline label whichProcID(const label i) const;
|
||||
|
||||
//- Start of procI data
|
||||
inline label offset(const label procI) const;
|
||||
|
||||
//- Size of procI data
|
||||
inline label localSize(const label procI) const;
|
||||
|
||||
//- Which processor does global come from?
|
||||
inline label whichProcID(const label i) const;
|
||||
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
@ -40,17 +40,23 @@ inline Foam::label Foam::globalIndex::offset(const label procI) const
|
||||
}
|
||||
|
||||
|
||||
inline Foam::label Foam::globalIndex::localSize() const
|
||||
inline Foam::label Foam::globalIndex::localSize(const label procI) const
|
||||
{
|
||||
return
|
||||
(
|
||||
Pstream::myProcNo() == 0
|
||||
? offsets_[Pstream::myProcNo()]
|
||||
: offsets_[Pstream::myProcNo()] - offsets_[Pstream::myProcNo()-1]
|
||||
procI == 0
|
||||
? offsets_[procI]
|
||||
: offsets_[procI] - offsets_[procI-1]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
inline Foam::label Foam::globalIndex::localSize() const
|
||||
{
|
||||
return localSize(Pstream::myProcNo());
|
||||
}
|
||||
|
||||
|
||||
inline Foam::label Foam::globalIndex::size() const
|
||||
{
|
||||
return offsets_[Pstream::nProcs()-1];
|
||||
|
||||
Reference in New Issue
Block a user