Incremental update: Pstream

This commit is contained in:
Hrvoje Jasak 2016-05-11 13:43:24 +01:00
parent 8d2bae6e31
commit 81dcaddb22

View file

@ -72,6 +72,8 @@ public:
static const NamedEnum<commsTypes, 3> commsTypeNames;
// Public classes
//- Structure for communicating between processors
class commsStruct
{
@ -86,8 +88,8 @@ public:
//- procIDs of all processors below (so not just directly below)
labelList allBelow_;
//- procIDs of all processors not below. (inverse set of allBelow_
// and minus myProcNo)
//- procIDs of all processors not below. (inverse set of
// allBelow_ and minus myProcNo)
labelList allNotBelow_;
@ -155,18 +157,45 @@ public:
friend Ostream& operator<<(Ostream&, const commsStruct&);
};
//- combineReduce operator for lists. Used for counting.
class listEq
{
public:
template<class T>
void operator()(T& x, const T& y) const
{
forAll(y, i)
{
if (y[i].size())
{
x[i] = y[i];
}
}
}
};
private:
// Private data
static int myProcNo_;
//- Is this a parallel run?
static bool parRun_;
//- My processor index
static int myProcNo_;
//- Process IDs
static List<int> procIDs_;
//- Default message type
static const int msgType_;
//- Structure for linear communications
static List<commsStruct> linearCommunication_;
//- Structure for tree communications
static List<commsStruct> treeCommunication_;
@ -270,7 +299,7 @@ public:
static bool init(int& argc, char**& argv);
//- Is this a parallel run?
static bool parRun()
static bool& parRun()
{
return parRun_;
}