36 template<
class CloudType>
39 this->writeCommented(
os,
"Time");
40 os <<
' ' <<
"currentProc";
53 template<
class CloudType>
62 functionObjects::writeFile
68 collector_(this->coeffDict(), owner.
mesh()),
69 maxStoredParcels_(this->coeffDict().getScalar(
"maxStoredParcels")),
79 if (maxStoredParcels_ <= 0)
82 <<
"maxStoredParcels = " << maxStoredParcels_
83 <<
", cannot be equal to or less than zero" 87 const label sz = collector_.
size();
93 template<
class CloudType>
101 collector_(ppp.collector_),
102 maxStoredParcels_(ppp.maxStoredParcels_),
103 header_(ppp.header_),
104 fields_(ppp.fields_),
112 template<
class CloudType>
117 const typename parcelType::trackingData&
td 120 if (!collector_.isPatch())
125 const label patchi =
pp.index();
126 const label localPatchi = collector_.IDs().find(patchi);
131 p.writeProperties(data, fields_,
" ",
true);
132 header_ = data.str();
135 if (localPatchi != -1 && data_[localPatchi].size() < maxStoredParcels_)
137 times_[localPatchi].
append(this->owner().time().value());
141 p.writeProperties(data, fields_,
" ",
false);
143 data_[localPatchi].
append(data.str());
150 template<
class CloudType>
154 const typename parcelType::trackingData&
td 157 if (collector_.isPatch())
163 const List<boundBox>& BBs = collector_.BBs();
169 p.writeProperties(data, fields_,
" ",
true);
170 header_ = data.str();
175 if (!BBs[i].contains(
p.position()))
181 const label zonei = IDs[i];
182 const label localFacei = fzm[zonei].find(
p.face());
184 if (localFacei != -1 && data_[localFacei].size() < maxStoredParcels_)
186 times_[i].append(this->owner().time().value());
190 p.writeProperties(data, fields_,
" ",
false);
192 data_[i].
append(data.str());
200 template<
class CloudType>
218 [](
string&
x,
const string&
y)
220 if (
y.size() >
x.size())
229 List<string> globalData;
230 globalData = ListListOps::combine<List<string>>
233 accessOp<List<string>>()
237 globalTimes = ListListOps::combine<scalarList>
240 accessOp<scalarList>()
243 if (this->writeToFile())
245 autoPtr<OFstream> osPtr = this->newFileAtTime
248 this->owner().time().value()
250 OFstream&
os = osPtr.ref();
257 const label datai = indices[j];
259 os << globalTimes[datai] <<
tab 260 << globalData[datai].c_str()
266 times_[i].clearStorage();
267 data_[i].clearStorage();
List< scalar > scalarList
List of scalar.
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.
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void gatherList(const UList< commsStruct > &comms, UList< T > &values, const int tag, const label comm)
Gather data, but keep individual values separate. Uses the specified communication schedule...
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...
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. ...
virtual bool postPatch(const parcelType &p, const polyPatch &pp, const typename parcelType::trackingData &td)
Post-patch hook.
A class for handling words, derived from Foam::string.
static void combineReduce(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...
const dictionary & coeffDict() const
Return const access to the coefficients dictionary.
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.
virtual void write()
Write post-processing info.
virtual bool postFace(const parcelType &p, const typename parcelType::trackingData &td)
Post-face hook.
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 ...