32 template<
class KeyType,
class DataType>
40 template<
class KeyType,
class DataType>
48 template<
class KeyType,
class DataType>
51 const PrintTable<KeyType, DataType>& table
61 template<
class KeyType,
class DataType>
66 const bool printAverage
69 HashTable<Map<DataType>, KeyType> combinedTable;
79 label largestKeyLength = 6;
80 label largestDataLength = 0;
86 const HashTableData& procIData = procData[proci];
90 if (!combinedTable.found(iter.key()))
99 Map<DataType>&
key = combinedTable[iter.key()];
101 key.insert(proci, iter.val());
105 std::ostringstream buf;
106 buf << dataIter.val();
108 largestDataLength =
max 111 label(buf.str().length())
115 std::ostringstream buf;
118 largestKeyLength =
max 121 label(buf.str().length())
155 const List<KeyType> sortedTable(combinedTable.sortedToc());
159 const Map<DataType>& procDataList
160 = combinedTable[sortedTable[keyI]];
165 forAll(procDataList, elemI)
169 os << procDataList[elemI];
175 forAll(procDataList, elemI)
177 sum += procDataList[elemI];
PrintTable()
Null constructor.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
Ostream & indent(Ostream &os)
Indent stream.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr char tab
The tab '\t' character(0x09)
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
#define forAll(list, i)
Loop across all elements in list.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
static void gatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
Gather data, but keep individual values separate. Uses the specified communication schedule...
OBJstream os(runTime.globalPath()/outputName)
void print(Ostream &os, const bool printSum=false, const bool printAverage=false) const
Print the table.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
virtual int width() const override
Get width of output field.
List< label > labelList
A List of labels.
forAllConstIters(mixture.phases(), phase)
static constexpr const zero Zero
Global zero (0)