41template<
class ParticleType>
45 for (
const polyPatch& pp : polyMesh_.boundaryMesh())
47 const auto* camipp = isA<cyclicAMIPolyPatch>(pp);
49 if (camipp && camipp->owner())
51 ok = (camipp->AMI().singlePatchProc() != -1);
62 <<
"Particle tracking across AMI patches is only currently "
63 <<
"supported for cases where the AMI patches reside on a "
64 <<
"single processor" <<
abort(FatalError);
71template<
class ParticleType>
83 globalPositionsPtr_(),
103template<
class ParticleType>
110template<
class ParticleType>
113 delete(this->remove(&
p));
117template<
class ParticleType>
120 for (ParticleType&
p : *
this)
125 <<
"deleting lost particle at position " <<
p.position()
134template<
class ParticleType>
139 ParticleType::particleCount_ = 0;
144template<
class ParticleType>
145template<
class TrackCloudType>
148 TrackCloudType&
cloud,
149 typename ParticleType::trackingData& td,
150 const scalar trackTime
168 for (ParticleType&
p : *
this)
174 globalPositionsPtr_.
clear();
204 auto* osptr = UOPstreamPtrs.get(proci);
212 for (ParticleType&
p : *
this)
215 const bool keepParticle =
p.move(
cloud, td, trackTime);
221 if (td.switchProcessor)
227 || !
p.onBoundaryFace()
228 || procPatchNeighbours[
p.patch()] < 0
232 <<
"Switch processor flag is true when no parallel "
233 <<
"transfer is possible. This is a bug."
238 const label patchi =
p.patch();
240 const label toProci =
242 refCast<const processorPolyPatch>(pbm[patchi])
247 auto* osptr = UOPstreamPtrs.
get(toProci);
251 UOPstreamPtrs.set(toProci, osptr);
254 p.prepareForParallelTransfer();
257 (*osptr) << procPatchNeighbours[patchi] <<
p;
283 for (
const label proci : neighbourProcs)
293 auto* newp =
new ParticleType(polyMesh_, is);
296 patchi = procPatches[patchi];
298 (*newp).correctAfterParallelTransfer(patchi, td);
307template<
class ParticleType>
310 if (!globalPositionsPtr_)
313 <<
"Global positions are not available. "
314 <<
"Cloud::storeGlobalPositions has not been called."
320 cellWallFacesPtr_.clear();
325 polyMesh_.tetBasePtIs();
326 polyMesh_.oldCellCentres();
328 const vectorField& positions = globalPositionsPtr_();
331 for (ParticleType&
p : *
this)
339template<
class ParticleType>
344 this->db().time().
path()/this->
name() +
"_positions.obj"
347 for (
const ParticleType&
p : *
this)
349 const point position(
p.position());
351 << position.
x() <<
' '
352 << position.
y() <<
' '
353 << position.
z() <<
nl;
358template<
class ParticleType>
366 globalPositionsPtr_.reset(
new vectorField(this->size()));
370 for (
const ParticleType&
p : *
this)
372 positions[i] =
p.position();
Base cloud calls templated on particle type.
void writePositions() const
Write positions to <cloudName>_positions.obj file.
void deleteParticle(ParticleType &p)
Remove particle from cloud and delete.
void deleteLostParticles()
Remove lost particles from cloud and delete.
void autoMap(const mapPolyMesh &)
Remap the cells of particles corresponding to the.
void cloudReset(const Cloud< ParticleType > &c)
Reset the particles.
void storeGlobalPositions() const
Call this before a topology change.
void addParticle(ParticleType *pPtr)
Transfer particle to cloud.
void autoMap(const FieldMapper &map, const bool applyFlip=true)
Map from self.
Template class for intrusive linked lists.
void operator=(const ILList< LListBase, T > &lst)
Copy assignment using the 'clone()' method for each element.
bool eof() const noexcept
True if end of input seen.
void clear()
Clear the list, i.e. set size to zero.
Output to file stream, using an OSstream.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
bool allowClearRecv() const noexcept
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
label recvDataCount(const label proci) const
void clear()
Clear individual buffers and reset states.
void finishedNeighbourSends(const labelUList &neighProcs, const bool wait=true)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type get(const label i) const
@ nonBlocking
"nonBlocking"
static bool & parRun() noexcept
Test if this a parallel run.
const Cmpt & z() const
Access to the vector z component.
const Cmpt & y() const
Access to the vector y component.
const Cmpt & x() const
Access to the vector x component.
A cloud is a registry collection of lagrangian particles.
geometryType
Cloud geometry type (internal or IO representations)
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
const labelList & processorPatches() const noexcept
Return list of processor patch labels.
const labelList & processorPatchNeighbours() const noexcept
const processorTopology & topology() const noexcept
The processor to processor topology.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A traits class, which is primarily used for primitives.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Mesh consisting of general polyhedral cells.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
virtual const pointField & oldCellCentres() const
Return old cellCentres (mesh motion)
int myProcNo() const noexcept
Return processor number.
const labelListList & procNeighbours() const noexcept
A class for handling words, derived from Foam::string.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
Field< vector > vectorField
Specialisation of Field<T> for vector.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
const word cloudName(propsDict.get< word >("cloud"))