38 #ifndef Foam_particleTracksSampler_H 39 #define Foam_particleTracksSampler_H 70 label maxPositions_ = 10000;
98 return origParcelAddr_;
116 origParcelAddr_.
reset(origParcelCounts);
126 const label sampleFreq,
133 stride_ =
max(1, sampleFreq);
135 nTracks_ = (origParcelAddr_.
totalSize()/stride_);
161 const UList<Type>&
values,
162 List<DynamicList<Type>>& trackValues
labelField origProcIds_
The originating processor ids.
void reset(const label localSize, const label comm=UPstream::worldComm, const bool parallel=UPstream::parRun())
Reset from local size, using gather/broadcast with default/specified communicator if parallel...
labelField origParcelIds_
The originating parcel ids.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Dispatch tag: Construct 'one-sided' from local sizes, using gather but no broadcast.
void gatherInplace(List< Type > &fld) const
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
void reset(const labelUList &origParcelCounts)
Define the orig parcel mappings.
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.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
label totalSize() const noexcept
The total addressed size, which corresponds to the end offset and also the sum of all localSizes...
label setSampleRate(const label sampleFreq, const label maxPositions, const label maxTracks=-1)
Set the sampling stride, upper limits.
void clear()
Clear the list, i.e. set size to zero.
Helper class when generating particle tracks. The interface is fairly rudimentary.
label nParticle() const
Total number of particles.
label maxPositions(propsDict.get< label >("maxPositions"))
A HashTable similar to std::unordered_map.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
label nTracks() const noexcept
Number of tracks to generate.
const globalIndex & parcelAddr() const noexcept
The original parcel addressing.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
label maxTracks(propsDict.getOrDefault< label >("maxTracks", -1))
void createTrackField(const UList< Type > &values, List< DynamicList< Type >> &trackValues) const
void resetCloud(const label localCloudSize)
void gatherInplace(List< Type > &fld, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) const
Inplace collect data in processor order on master (in serial: a no-op).
Registry of regIOobjects.