41 template<
class TrackCloudType>
44 bool valid = c.size();
51 c.checkFieldIOobject(c, origProcId);
57 c.checkFieldIOobject(c,
origId);
64 p.origProc_ = origProcId[i];
71 template<
class TrackCloudType>
94 origId[i] = iter().origId_;
103 template<
class TrackCloudType>
107 TrackCloudType& cloud,
111 typename TrackCloudType::particleType&
p =
112 static_cast<typename TrackCloudType::particleType&
>(*this);
113 typename TrackCloudType::particleType::trackingData& ttd =
114 static_cast<typename TrackCloudType::particleType::trackingData&
>(td);
126 changeToMasterPatch();
128 if (!p.hitPatch(cloud, ttd))
132 if (isA<wedgePolyPatch>(patch))
134 p.hitWedgePatch(cloud, ttd);
136 else if (isA<symmetryPlanePolyPatch>(patch))
138 p.hitSymmetryPlanePatch(cloud, ttd);
140 else if (isA<symmetryPolyPatch>(patch))
142 p.hitSymmetryPatch(cloud, ttd);
144 else if (isA<cyclicPolyPatch>(patch))
146 p.hitCyclicPatch(cloud, ttd);
148 else if (isA<cyclicACMIPolyPatch>(patch))
150 p.hitCyclicACMIPatch(cloud, ttd, direction);
152 else if (isA<cyclicAMIPolyPatch>(patch))
154 p.hitCyclicAMIPatch(cloud, ttd, direction);
156 else if (isA<cyclicRepeatAMIPolyPatch>(patch))
158 p.hitCyclicRepeatAMIPatch(cloud, ttd, direction);
160 else if (isA<processorPolyPatch>(patch))
162 p.hitProcessorPatch(cloud, ttd);
164 else if (isA<wallPolyPatch>(patch))
166 p.hitWallPatch(cloud, ttd);
177 template<
class TrackCloudType>
181 const scalar fraction,
182 TrackCloudType& cloud,
192 template<
class TrackCloudType>
199 template<
class TrackCloudType>
203 <<
"Hitting a wedge patch should not be possible." 210 template<
class TrackCloudType>
213 TrackCloudType& cloud,
221 template<
class TrackCloudType>
229 template<
class TrackCloudType>
241 tetPti_ = mesh_.
faces()[tetFacei_].
size() - 1 - tetPti_;
253 : receiveCpp.
forwardT()[receiveFacei]
270 template<
class TrackCloudType>
288 if (receiveFacei < 0)
294 <<
"Particle lost across " << cyclicAMIPolyPatch::typeName
295 <<
" patches " << cpp.
name() <<
" and " << receiveCpp.
name()
296 <<
" at position " << pos <<
endl;
301 facei_ = tetFacei_ = receiveFacei + receiveCpp.
start();
312 "Particle crossed between " + cyclicAMIPolyPatch::typeName +
313 " patches " + cpp.
name() +
" and " + receiveCpp.
name() +
314 " to a location outside of the mesh." 328 : receiveCpp.
forwardT()[receiveFacei]
357 template<
class TrackCloudType>
360 TrackCloudType& cloud,
372 const scalar mask = cpp.
mask()[localFacei];
373 bool couple = mask >= 1 - cpp.
tolerance();
374 bool nonOverlap = mask <= cpp.
tolerance();
379 if (!couple && !nonOverlap)
383 nonOverlap = !couple;
400 template<
class TrackCloudType>
403 TrackCloudType& cloud,
412 template<
class TrackCloudType>
417 template<
class TrackCloudType>
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
void hitCyclicACMIPatch(TrackCloudType &, trackingData &, const vector &)
Overridable function to handle the particle hitting a.
label origProc() const
Return the originating processor ID.
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
bool typeHeaderOk(const bool checkType=true)
Read header (uses typeFilePath to find file) and check header.
virtual bool separated() const
Are the planes separated.
bool onBoundaryFace() const
Is the particle on a boundary face?
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
scalar trackToFace(const vector &displacement, const scalar fraction)
As particle::track, but stops when a face is hit.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelPair pointAMIAndFace(const label facei, const vector &n, point &p) const
Return the transform and face indices on neighbour patch which.
void hitWallPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a wallPatch.
void hitSymmetryPlanePatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a.
virtual void reverseTransformDirection(vector &d, const label facei) const
Transform a patch-based direction from this side to nbr side.
virtual void transformProperties(const tensor &T)
Transform the physical properties of the particle.
void hitSymmetryPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a symmetryPatch.
virtual const vectorField & separation() const
If the planes are separated the separation vector.
virtual const tensorField & forwardT() const
Return face transformation tensor.
const polyPatch & nonOverlapPatch() const
Return a const reference to the non-overlapping patch.
const List< vectorTensorTransform > & AMITransforms() const
Return a reference to the AMI transforms.
vector normal() const
Return the normal of the tri on tetFacei_ for the.
virtual bool parallel() const
Are the cyclic planes parallel.
dimensionedScalar pos(const dimensionedScalar &ds)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
An ordered pair of two objects of type <T> with first() and second() elements.
void hitFace(const vector &direction, TrackCloudType &cloud, trackingData &td)
Hit the current face. If the current face is internal than this.
static const Identity< scalar > I
void hitProcessorPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a processorPatch.
virtual const labelList & faceOwner() const
Return face owner.
void hitCyclicPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a cyclicPatch.
Cyclic patch for Arbitrary Mesh Interface (AMI)
virtual const faceList & faces() const
Return raw faces.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
errorManip< error > abort(error &err)
void hitCyclicAMIPatch(TrackCloudType &, trackingData &, const vector &)
Overridable function to handle the particle hitting a cyclicAMIPatch.
label origId() const
Return the particle ID on the originating processor.
virtual bool write(const bool valid=true) const
Write using setting from DB.
bool onFace() const
Is the particle on a face?
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const Type & second() const
Return second.
void hitWedgePatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a wedgePatch.
const scalarField & mask() const
Mask field where 1 = overlap, 0 = no-overlap.
#define WarningInFunction
Report a warning using Foam::Warning.
bool keepParticle
Flag to indicate whether to keep particle (false = delete)
virtual const cyclicAMIPolyPatch & neighbPatch() const
Return a reference to the neighbour patch.
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
virtual bool owner() const
Does this side own the patch?
const dimensionedScalar c
Speed of light in a vacuum.
static void writeFields(const TrackCloudType &c)
Write the fields associated with the owner cloud.
label start() const
Return start label of this patch in the polyMesh face list.
bool hitPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a patch.
bool onInternalFace() const
Is the particle on an internal face?
label transformGlobalFace(const label facei) const
void trackToAndHitFace(const vector &direction, const scalar fraction, TrackCloudType &cloud, trackingData &td)
Convenience function. Cobines trackToFace and hitFace.
Helper IO class to read and write particle positions.
const cyclicPolyPatch & neighbPatch() const
A patch is a list of labels that address the faces in the global face list.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const Type & first() const
Return first.
A primitive field of type <T> with automated input and output.
vector position() const
Return current particle position.
void hitCyclicRepeatAMIPatch(TrackCloudType &, trackingData &, const vector &)
Overridable function to handle the particle hitting an.
static const Vector< scalar > zero
label patch() const
Return the index of patch that the particle is on.
static scalar tolerance()
Overlap tolerance.
label whichFace(const label l) const
Return label of face in patch from global face label.