ENH: globalIndex: work in local mode
This commit is contained in:
parent
d21091c788
commit
1f1d559e20
@ -27,14 +27,22 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::globalIndex::globalIndex(const label localSize, const int tag)
|
||||
Foam::globalIndex::globalIndex
|
||||
(
|
||||
const label localSize,
|
||||
const int tag,
|
||||
const bool parallel
|
||||
)
|
||||
:
|
||||
offsets_(Pstream::nProcs()+1)
|
||||
{
|
||||
labelList localSizes(Pstream::nProcs());
|
||||
localSizes[Pstream::myProcNo()] = localSize;
|
||||
Pstream::gatherList(localSizes, tag);
|
||||
Pstream::scatterList(localSizes, tag);
|
||||
if (parallel)
|
||||
{
|
||||
Pstream::gatherList(localSizes, tag);
|
||||
Pstream::scatterList(localSizes, tag);
|
||||
}
|
||||
|
||||
label offset = 0;
|
||||
offsets_[0] = 0;
|
||||
|
@ -72,7 +72,12 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from local max size
|
||||
globalIndex(const label localSize, const int tag = Pstream::msgType());
|
||||
globalIndex
|
||||
(
|
||||
const label localSize,
|
||||
const int tag = Pstream::msgType(),
|
||||
const bool parallel = true // use parallel comms
|
||||
);
|
||||
|
||||
//- Construct from Istream
|
||||
globalIndex(Istream& is);
|
||||
|
Loading…
Reference in New Issue
Block a user