36 template<
class ParticleType>
52 template<
class ParticleType>
60 cloud(pMesh, cloudName),
71 template<
class ParticleType>
74 label
id = particleCount_++;
78 WarningIn(
"Cloud<ParticleType>::getNewParticleID() const")
79 <<
"Particle counter has overflowed. This might cause problems"
80 <<
" when reconstructing particle tracks." <<
endl;
86 template<
class ParticleType>
93 template<
class ParticleType>
96 delete(this->
remove(&
p));
123 template<
class ParticleType>
124 template<
class TrackingData>
130 const labelList& processorPatchNeighbours =
136 pIter().stepFraction() = 0;
140 bool transfered =
true;
152 ParticleType&
p = pIter();
155 bool keepParticle = p.move(td);
163 if (Pstream::parRun() && p.facei_ >= pMesh().nInternalFaces())
166 label n = processorPatchIndices[
patchi];
172 p.prepareForParallelTransfer(patchi, td);
173 transferList[n].
append(this->
remove(&p));
183 if (Pstream::parRun())
187 labelList nsTransPs(transferList.size());
191 nsTransPs[i] = transferList[i].size();
197 allNTrans[Pstream::myProcNo()] = nsTransPs;
221 if (transferList[i].size())
226 refCast<const processorPolyPatch>
232 particleStream << transferList[i];
236 forAll(processorPatches, i)
238 label
patchi = processorPatches[i];
241 refCast<const processorPolyPatch>
247 label neighbProcPatchi = processorPatchNeighbours[
patchi];
249 label nRecPs = allNTrans[neighbProci][neighbProcPatchi];
261 typename ParticleType::iNew(*
this)
271 ParticleType& newp = newpIter();
272 newp.correctAfterParallelTransfer(patchi, td);
273 addParticle(newParticles.remove(&newp));
286 template<
class ParticleType>
291 Info<<
"Cloud<ParticleType>::autoMap(const morphFieldMapper& map) "
300 if (reverseCellMap[pIter().celli_] >= 0)
302 pIter().celli_ = reverseCellMap[pIter().celli_];
304 if (pIter().facei_ >= 0 && reverseFaceMap[pIter().facei_] >= 0)
306 pIter().facei_ = reverseFaceMap[pIter().facei_];
315 label trackStartCell = mapper.
mergedCell(pIter().celli_);
317 if (trackStartCell < 0)
323 const_cast<vector&
>(pIter().position()) =
324 polyMesh_.cellCentres()[trackStartCell];
325 pIter().stepFraction() = 0;
332 template<
class ParticleType>
337 this->db().time().path()/this->
name() +
"_positions.obj"
342 const ParticleType&
p = pIter();
343 pObj<<
"v " << p.position().x() <<
" " << p.position().y() <<
" "
344 << p.position().z() <<
nl;