36 template<
class CloudType>
39 const label globalPatchi
42 return patchIDs_.find(globalPatchi);
48 template<
class CloudType>
54 procTimes[Pstream::myProcNo()] = times_[i];
55 Pstream::gatherList(procTimes);
58 procDiameters[Pstream::myProcNo()] = patchDiameters_[i];
59 Pstream::gatherList(procDiameters);
62 procParticles[Pstream::myProcNo()] = patchParticles_[i];
63 Pstream::gatherList(procParticles);
65 if (Pstream::master())
69 mkDir(this->writeTimeDir());
71 const word& patchName =
mesh.boundaryMesh()[patchIDs_[i]].name();
75 this->writeTimeDir()/patchName +
".post",
77 IOstream::currentVersion,
78 mesh.time().writeCompression()
82 globalTimes = ListListOps::combine<List<scalar>>
89 globalDiameters = ListListOps::combine<List<scalar>>
96 globalParticles = ListListOps::combine<List<scalar>>
104 forAll(globalDiameters, j)
106 const label bini = (globalDiameters[j] - min_)/delta_;
107 if (bini >= 0 && bini < nBins_)
109 nParticles[bini] += globalParticles[j];
110 nParticlesCumulative_[i][bini] += globalParticles[j];
115 <<
"# nBin=" << nBins_
117 <<
"; max=" << max_ <<
nl
118 <<
"# dEdge1 dEdge2 nParticles nParticlesCumulative"
130 << nParticlesCumulative_[i][j]
135 times_[i].clearStorage();
136 patchDiameters_[i].clearStorage();
137 patchParticles_[i].clearStorage();
144 template<
class CloudType>
149 const word& modelName
153 nBins_(
dict.getCheck<label>(
"nBins", labelMinMax::ge(1))),
154 min_(
dict.getScalar(
"min")),
155 max_(
dict.getScalar(
"max")),
156 delta_((max_ - min_)/scalar(nBins_)),
157 maxStoredParcels_(
dict.getScalar(
"maxStoredParcels")),
158 binEdges_(nBins_ + 1),
160 nParticlesCumulative_(),
168 <<
"Histogram minimum = " << min_
169 <<
", cannot be larger than histogram maximum = " << max_
173 if (maxStoredParcels_ <= 0)
176 <<
"maxStoredParcels = " << maxStoredParcels_
177 <<
", cannot be equal to or less than zero"
183 for (label i = 0; i < nBins_; ++i)
185 const scalar next = min_ + (i+1)*delta_;
186 binEdges_[i+1] = next;
194 if (patchIDs_.empty())
197 <<
"No matching patches found: "
202 nParticlesCumulative_ =
205 times_.
setSize(patchIDs_.size());
206 patchDiameters_.setSize(patchIDs_.size());
207 patchParticles_.setSize(patchIDs_.size());
211 template<
class CloudType>
222 maxStoredParcels_(ppm.maxStoredParcels_),
223 binEdges_(ppm.binEdges_),
224 patchIDs_(ppm.patchIDs_),
225 nParticlesCumulative_(ppm.nParticlesCumulative_),
227 patchDiameters_(ppm.patchDiameters_),
228 patchParticles_(ppm.patchParticles_)
234 template<
class CloudType>
242 const label patchi = pp.
index();
243 const label localPatchi = applyToPatch(patchi);
245 if (localPatchi != -1 && times_[localPatchi].size() < maxStoredParcels_)
247 times_[localPatchi].append(this->owner().time().value());
248 patchDiameters_[localPatchi].append(
p.d());
249 patchParticles_[localPatchi].append(
p.nParticle());