40 template<
class TrackCloudType>
53 c.checkFieldIOobject(
c, origProcId);
66 p.origProc_ = origProcId[i];
73 template<
class TrackCloudType>
95 origProc[i] = iter().origProc_;
96 origId[i] = iter().origId_;
100 origProc.
write(np > 0);
101 origId.
write(np > 0);
105 template<
class TrackCloudType>
108 TrackCloudType&
cloud,
114 prepareForProcessorTransfer(td);
118 prepareForNonConformalCyclicTransfer
129 template<
class TrackCloudType>
132 TrackCloudType&
cloud,
138 if (isA<processorPolyPatch>(pp))
140 correctAfterProcessorTransfer(td);
142 else if (isA<nonConformalCyclicPolyPatch>(pp))
144 correctAfterNonConformalCyclicTransfer
154 <<
"Transfer patch type not recognised"
160 template<
class TrackCloudType>
163 const vector& displacement,
164 const scalar fraction,
165 TrackCloudType&
cloud,
174 typename TrackCloudType::particleType&
p =
175 static_cast<typename TrackCloudType::particleType&
>(*this);
176 typename TrackCloudType::particleType::trackingData& ttd =
177 static_cast<typename TrackCloudType::particleType::trackingData&
>(td);
183 else if (onInternalFace(td.
mesh))
187 else if (onBoundaryFace(td.
mesh))
193 p.hitNonConformalCyclicPatch
197 cloud.patchNonConformalCyclicPatches()[
p.patch(td.
mesh)][i],
207 if (!
p.hitPatch(
cloud, ttd))
211 if (isA<wedgePolyPatch>(patch))
213 p.hitWedgePatch(
cloud, ttd);
215 else if (isA<symmetryPlanePolyPatch>(patch))
217 p.hitSymmetryPlanePatch(
cloud, ttd);
219 else if (isA<symmetryPolyPatch>(patch))
221 p.hitSymmetryPatch(
cloud, ttd);
223 else if (isA<cyclicPolyPatch>(patch))
225 p.hitCyclicPatch(
cloud, ttd);
227 else if (isA<processorPolyPatch>(patch))
229 p.hitProcessorPatch(
cloud, ttd);
231 else if (isA<wallPolyPatch>(patch))
233 p.hitWallPatch(
cloud, ttd);
237 p.hitBasicPatch(
cloud, ttd);
244 template<
class TrackCloudType>
247 const vector& displacement,
248 const scalar fraction,
249 TrackCloudType&
cloud,
258 const scalar
f = trackToFace(td.
mesh, displacement, fraction);
260 hitFace(displacement, fraction,
cloud, td);
266 template<
class TrackCloudType>
273 template<
class TrackCloudType>
277 <<
"Hitting a wedge patch should not be possible."
280 hitSymmetryPatch(
cloud, td);
284 template<
class TrackCloudType>
287 TrackCloudType&
cloud,
291 hitSymmetryPatch(
cloud, td);
295 template<
class TrackCloudType>
303 template<
class TrackCloudType>
326 transformProperties(receiveCpp.
transform());
331 template<
class TrackCloudType>
334 const vector& displacement,
335 const scalar fraction,
337 TrackCloudType&
cloud,
348 vector sendNormal, sendDisplacement;
349 patchData(td.
mesh, sendNormal, sendDisplacement);
353 const remote receiveProcFace =
359 displacement - fraction*sendDisplacement,
366 if (receiveProcFace.
proci == -1)
return false;
382 prepareForNonConformalCyclicTransfer
389 correctAfterNonConformalCyclicTransfer
400 template<
class TrackCloudType>
411 template<
class TrackCloudType>
416 template<
class TrackCloudType>
#define forAll(list, i)
Loop across all elements in list.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
A primitive field of type <Type> with automated input and output.
Helper IO class to read and write particle positions.
virtual bool write(const bool write=true) const
Write using setting from DB.
void size(const label)
Override size to be inconsistent with allocated storage.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
A cloud is a collection of lagrangian particles.
const cyclicPolyPatch & nbrPatch() const
virtual const transformer & transform() const
Return transformation between the coupled patches.
virtual label nbrPatchIndex() const
Neighbour patchID.
label transformGlobalFace(const label facei) const
For a given patch face index, return the corresponding index of the.
A face is a list of labels corresponding to mesh vertices.
labelList patchNLocateBoundaryHits
Number of boundary hits that occurred during locate executions.
label sendToProc
Processor to send the particle to. -1 indicates that this.
label sendFromPatch
Patch from which to send the particle.
vector sendToPosition
Position to which to send.
bool keepParticle
Flag to indicate whether to keep particle (false = delete)
label sendToPatch
Patch to which to send the particle.
const polyMesh & mesh
Reference to the mesh.
label sendToPatchFace
Patch face to which to send the particle.
void prepareForParallelTransfer(TrackCloudType &, trackingData &)
Make changes prior to a parallel transfer. Runs either.
void hitBasicPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a basic.
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
void hitCyclicPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a.
void hitProcessorPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a.
scalar trackToAndHitFace(const vector &displacement, const scalar fraction, TrackCloudType &cloud, trackingData &td)
Convenience function. Combines trackToFace and hitFace.
bool hitPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a patch.
void hitFace(const vector &displacement, const scalar fraction, TrackCloudType &cloud, trackingData &td)
Hit the current face. If the current face is internal than this.
void hitSymmetryPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a.
void hitSymmetryPlanePatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a.
void hitWedgePatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a wedgePatch.
void correctAfterParallelTransfer(TrackCloudType &, trackingData &)
Make changes following a parallel transfer. Runs either.
bool hitNonConformalCyclicPatch(const vector &displacement, const scalar fraction, const label patchi, TrackCloudType &cloud, trackingData &td)
Overridable function to handle the particle hitting an.
label origId() const
Return the particle ID on the originating processor.
void hitWallPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a wallPatch.
static void writeFields(const TrackCloudType &c)
Write the fields associated with the owner cloud.
label index() const
Return the index of this patch in the boundaryMesh.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
A patch is a list of labels that address the faces in the global face list.
label whichFace(const label l) const
Return label of face in patch from global face label.
virtual bool write(const bool write=true) const
Write using setting from DB.
Struct for keeping processor, element (cell, face, point) index.
label elementi
Element index.
label proci
Processor index.
Templated form of IOobject providing type information for file reading and header type checking.
bool headerOk()
Read header (uses typeGlobalFile to find file) and check.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool valid(const PtrList< ModelType > &l)
const dimensionedScalar c
Speed of light in a vacuum.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
static const Identity< scalar > I