37 template<
class CloudType>
40 this->writeCommented(
os,
"Time");
41 os <<
' ' <<
"currentProc";
54 template<
class CloudType>
63 functionObjects::writeFile
69 collector_(this->coeffDict(), owner.
mesh()),
70 maxStoredParcels_(this->coeffDict().getScalar(
"maxStoredParcels")),
80 if (maxStoredParcels_ <= 0)
83 <<
"maxStoredParcels = " << maxStoredParcels_
84 <<
", cannot be equal to or less than zero" 88 const label sz = collector_.
size();
94 template<
class CloudType>
102 collector_(ppp.collector_),
103 maxStoredParcels_(ppp.maxStoredParcels_),
104 header_(ppp.header_),
105 fields_(ppp.fields_),
113 template<
class CloudType>
121 if (!collector_.isPatch())
126 const label patchi =
pp.index();
127 const label localPatchi = collector_.IDs().find(patchi);
132 p.writeProperties(data, fields_,
" ",
true);
133 header_ = data.str();
136 if (localPatchi != -1 && data_[localPatchi].size() < maxStoredParcels_)
138 times_[localPatchi].
append(this->owner().time().value());
142 p.writeProperties(data, fields_,
" ",
false);
149 template<
class CloudType>
156 if (collector_.isPatch())
162 const List<boundBox>& BBs = collector_.BBs();
168 p.writeProperties(data, fields_,
" ",
true);
169 header_ = data.str();
174 if (!BBs[i].contains(
p.position()))
180 const label zonei = IDs[i];
181 const label localFacei = fzm[zonei].find(
p.face());
183 if (localFacei != -1 && data_[localFacei].size() < maxStoredParcels_)
185 times_[i].append(this->owner().time().value());
189 p.writeProperties(data, fields_,
" ",
false);
197 template<
class CloudType>
215 [](
string&
x,
const string&
y)
217 if (
y.size() >
x.size())
226 List<string> globalData;
227 globalData = ListListOps::combine<List<string>>
230 accessOp<List<string>>()
234 globalTimes = ListListOps::combine<scalarList>
237 accessOp<scalarList>()
240 if (this->writeToFile())
242 autoPtr<OFstream> osPtr = this->newFileAtTime
245 this->owner().time().value()
247 OFstream&
os = osPtr.ref();
254 const label datai = indices[j];
256 os << globalTimes[datai] <<
tab 257 << globalData[datai].c_str()
263 times_[i].clearStorage();
264 data_[i].clearStorage();
List< scalar > scalarList
List of scalar.
virtual void postPatch(const parcelType &p, const polyPatch &pp, bool &keepParticle)
Post-patch hook.
ZoneMesh< faceZone, polyMesh > faceZoneMesh
A ZoneMesh with the type faceZone.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
void append(const T &val)
Append an element at the end of the list.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
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)
Operations on lists of strings.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
virtual void postFace(const parcelType &p, bool &keepParticle)
Post-face hook.
ParticlePostProcessing(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Various functions to operate on Lists.
#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...
A class for handling words, derived from Foam::string.
const dictionary & coeffDict() const
Return const access to the coefficients dictionary.
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...
Writes out various standard Lagrangian data elements of particles hitting on a given list of patches ...
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
OBJstream os(runTime.globalPath()/outputName)
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
Database for solution data, solver performance and other reduced data.
virtual void write()
Write post-processing info.
List< word > wordList
List of word.
const fvMesh & mesh() const
Return reference to the mesh.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
List< label > labelList
A List of labels.
A patch is a list of labels that address the faces in the global face list.
Templated base class for dsmc cloud.
Templated cloud function object base class.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...