Go to the documentation of this file.
38 template<
class ParticleType>
45 if (isA<cyclicAMIPolyPatch>(pbm[patchI]))
48 refCast<const cyclicAMIPolyPatch>(pbm[patchI]);
60 <<
"Particle tracking across AMI patches is only currently "
61 <<
"supported for cases where the AMI patches reside on a "
67 template<
class ParticleType>
70 cellWallFacesPtr_.reset(
new PackedBoolList(pMesh().nCells(),
false));
78 if (isA<wallPolyPatch>(
patches[patchI]))
86 cellWallFaces[pFaceCells[pFCI]] =
true;
95 template<
class ParticleType>
114 polyMesh_.tetBasePtIs();
120 template<
class ParticleType>
123 const polyMesh& pMesh,
125 const IDLList<ParticleType>& particles
129 IDLList<ParticleType>(),
140 polyMesh_.tetBasePtIs();
142 IDLList<ParticleType>::operator=(particles);
148 template<
class ParticleType>
152 if (!cellWallFacesPtr_.valid())
157 return cellWallFacesPtr_();
161 template<
class ParticleType>
168 template<
class ParticleType>
171 delete(this->remove(&
p));
175 template<
class ParticleType>
180 ParticleType::particleCount_ = 0;
185 template<
class ParticleType>
186 template<
class TrackData>
203 const labelList& neighbourProcs = pData[Pstream::myProcNo()];
206 labelList neighbourProcIndices(Pstream::nProcs(), -1);
210 neighbourProcIndices[neighbourProcs[i]] = i;
216 pIter().stepFraction() = 0;
220 nTrackingRescues_ = 0;
227 neighbourProcs.
size()
234 neighbourProcs.
size()
245 forAll(patchIndexTransferLists, i)
247 patchIndexTransferLists[i].
clear();
253 ParticleType&
p = pIter();
256 bool keepParticle =
p.move(td, trackTime);
264 if (Pstream::parRun() &&
p.face() >= pMesh().nInternalFaces())
270 if (procPatchIndices[patchI] != -1)
272 label n = neighbourProcIndices
274 refCast<const processorPolyPatch>
280 p.prepareForParallelTransfer(patchI, td);
282 particleTransferLists[
n].
append(this->remove(&
p));
284 patchIndexTransferLists[
n].
append
286 procPatchNeighbours[patchI]
297 if (!Pstream::parRun())
307 forAll(particleTransferLists, i)
309 if (particleTransferLists[i].size())
318 << patchIndexTransferLists[i]
319 << particleTransferLists[i];
329 bool transfered =
false;
351 label neighbProci = neighbourProcs[i];
353 label nRec = allNTrans[neighbProci][Pstream::myProcNo()];
357 UIPstream particleStream(neighbProci, pBufs);
359 labelList receivePatchIndex(particleStream);
364 typename ParticleType::iNew(polyMesh_)
371 ParticleType& newp = newpIter();
373 label patchI = procPatches[receivePatchIndex[pI++]];
375 newp.correctAfterParallelTransfer(patchI, td);
377 addParticle(newParticles.remove(&newp));
387 if (nTrackingRescues_ > 0)
389 Info<< nTrackingRescues_ <<
" tracking rescue corrections" <<
endl;
395 template<
class ParticleType>
396 template<
class TrackData>
405 Info<<
"Cloud<ParticleType>::autoMap(TrackData&, const mapPolyMesh&) "
414 cellWallFacesPtr_.
clear();
419 polyMesh_.tetBasePtIs();
424 ParticleType&
p = pIter();
426 if (reverseCellMap[
p.cell()] >= 0)
428 p.cell() = reverseCellMap[
p.cell()];
430 if (
p.face() >= 0 && reverseFaceMap[
p.face()] >= 0)
432 p.face() = reverseFaceMap[
p.face()];
445 if (trackStartCell < 0)
452 p.cell() = trackStartCell;
457 const_cast<vector&
>(
p.position()) =
458 polyMesh_.cellCentres()[trackStartCell];
460 p.stepFraction() = 0;
470 template<
class ParticleType>
475 this->db().time().
path()/this->
name() +
"_positions.obj"
480 const ParticleType&
p = pIter();
481 pObj<<
"v " <<
p.position().x() <<
" " <<
p.position().y() <<
" "
482 <<
p.position().z() <<
nl;
void addParticle(ParticleType *pPtr)
Transfer particle to cloud.
void calcCellWallFaces() const
Find all cells which have wall faces.
virtual bool owner() const
Does this side own the patch?
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
Output inter-processor communications stream operating on external buffer.
#define forAll(list, i)
Loop across all elements in list.
const labelList & processorPatches() const
Return list of processor patch labels.
void writePositions() const
Write positions to <cloudName>_positions.obj file.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Ostream & endl(Ostream &os)
Add newline and flush stream.
const labelList & processorPatchIndices() const
Return list of indices into processorPatches_ for each patch.
void clear()
Clear storage and reset.
label mergedCell(const label oldCellI) const
If cell is removed return cell (on new mesh) it merged into.
Mesh consisting of general polyhedral cells.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Combination-Reduction operation for a parallel run. The information from all nodes is collected on th...
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Intrusive doubly-linked list.
void append(const T &)
Append an element at the end of the list.
A patch is a list of labels that address the faces in the global face list.
void deleteParticle(ParticleType &)
Remove particle from cloud and delete.
const PackedBoolList & cellHasWallFaces() const
Whether each cell has any wall faces (demand driven data)
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
void finishedSends(const bool block=true)
Mark all sends as having been done. This will start receives.
label singlePatchProc() const
Set to -1, or the processor holding all faces (both sides) of.
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
errorManip< error > abort(error &err)
const labelUList & faceCells() const
Return face-cell addressing.
const labelList & processorPatchNeighbours() const
Return processorPatchIndices of the neighbours.
void cloudReset(const Cloud< ParticleType > &c)
Reset the particles.
const labelList & reverseFaceMap() const
Reverse face map.
A cloud is a collection of lagrangian particles.
const labelList & reverseCellMap() const
Reverse cell map.
const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void clear()
Clear the list, i.e. set size to zero.
Cloud(const polyMesh &mesh, const IDLList< ParticleType > &particles)
Construct from mesh and a list of particles.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
const word cloudName(propsDict.lookup("cloudName"))
void autoMap(TrackData &td, const mapPolyMesh &)
Remap the cells of particles corresponding to the.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const dimensionedScalar c
Speed of light in a vacuum.
void size(const label)
Override size to be inconsistent with allocated storage.
Input inter-processor communications stream operating on external buffer.
void checkPatches() const
Check patches.
word name(const complex &)
Return a string representation of a complex.
virtual void flush()
Flush stream.
void move(TrackData &td, const scalar trackTime)
Move the particles.
dimensionedScalar pos(const dimensionedScalar &ds)
Cyclic patch for Arbitrary Mesh Interface (AMI)