37 List<DynamicList<Type>>& trackValues
42 const label
nTracks = trackValues.size();
46 const label globalId =
49 if (globalId % stride_ == 0)
51 const label trackId = globalId/stride_;
56 && trackValues[trackId].size() < maxPositions_
59 trackValues[trackId].append(allValues[i]);
69 const objectRegistry& obr,
70 HashTable<List<DynamicList<Type>>>& fieldTable
74 if (fieldTable.empty())
76 wordList fieldNames = obr.names<IOField<Type>>();
80 for (
const word& fieldName : fieldNames)
82 fieldTable(fieldName).resize(nTracks());
87 for (
const word& fieldName : fieldTable.sortedToc())
89 auto&
output = fieldTable[fieldName];
91 const auto* ptr = obr.cfindObject<IOField<Type>>(fieldName);
93 this->createTrackField
100 return fieldTable.size();
labelField origProcIds_
The originating processor ids.
labelField origParcelIds_
The originating parcel ids.
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
label setTrackFields(const objectRegistry &obr, HashTable< List< DynamicList< Type >>> &fieldTable) const
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
static void combineReduce(const List< commsStruct > &comms, T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine value from different processors...
label nTracks() const noexcept
Number of tracks to generate.
static const UList< Type > & null()
Return a UList reference to a nullObject.
List< word > wordList
List of word.
label toGlobal(const label proci, const label i) const
From local to global on proci.
void createTrackField(const UList< Type > &values, List< DynamicList< Type >> &trackValues) const
static Ostream & output(Ostream &os, const IntRange< T > &range)
static void gather(const labelUList &offsets, const label comm, const ProcIDsContainer &procIDs, const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking)
Collect data in processor order on master (== procIDs[0]).