41 template<
class TrackCloudType>
54 c.checkFieldIOobject(
c, origProcId);
67 p.origProc_ = origProcId[i];
74 template<
class TrackCloudType>
96 origProc[i] = iter().origProc_;
97 origId[i] = iter().origId_;
101 origProc.
write(np > 0);
102 origId.
write(np > 0);
106 template<
class TrackCloudType>
109 TrackCloudType&
cloud,
115 prepareForProcessorTransfer(td);
119 prepareForNonConformalCyclicTransfer
130 template<
class TrackCloudType>
133 TrackCloudType&
cloud,
139 if (isA<processorPolyPatch>(pp))
141 correctAfterProcessorTransfer(td);
143 else if (isA<nonConformalCyclicPolyPatch>(pp))
145 correctAfterNonConformalCyclicTransfer
155 <<
"Transfer patch type not recognised"
161 template<
class TrackCloudType>
164 const vector& displacement,
165 const scalar fraction,
166 TrackCloudType&
cloud,
170 typename TrackCloudType::particleType&
p =
171 static_cast<typename TrackCloudType::particleType&
>(*this);
172 typename TrackCloudType::particleType::trackingData& ttd =
173 static_cast<typename TrackCloudType::particleType::trackingData&
>(td);
190 else if (onBoundaryFace(td.
mesh))
196 p.hitNonConformalCyclicPatch
200 cloud.patchNonConformalCyclicPatches()[
p.patch(td.
mesh)][i],
210 if (!
p.hitPatch(
cloud, ttd))
214 if (isA<wedgePolyPatch>(patch))
216 p.hitWedgePatch(
cloud, ttd);
218 else if (isA<symmetryPlanePolyPatch>(patch))
220 p.hitSymmetryPlanePatch(
cloud, ttd);
222 else if (isA<symmetryPolyPatch>(patch))
224 p.hitSymmetryPatch(
cloud, ttd);
226 else if (isA<cyclicPolyPatch>(patch))
228 p.hitCyclicPatch(
cloud, ttd);
230 else if (isA<processorPolyPatch>(patch))
232 p.hitProcessorPatch(
cloud, ttd);
234 else if (isA<wallPolyPatch>(patch))
236 p.hitWallPatch(
cloud, ttd);
240 p.hitBasicPatch(
cloud, ttd);
247 template<
class TrackCloudType>
250 const vector& displacement,
251 const scalar fraction,
252 TrackCloudType&
cloud,
256 const scalar
f = trackToFace(td.
mesh, displacement, fraction);
258 hitFace(displacement, fraction,
cloud, td);
264 template<
class TrackCloudType>
271 template<
class TrackCloudType>
275 <<
"Hitting a wedge patch should not be possible."
278 hitSymmetryPatch(
cloud, td);
282 template<
class TrackCloudType>
285 TrackCloudType&
cloud,
289 hitSymmetryPatch(
cloud, td);
293 template<
class TrackCloudType>
301 template<
class TrackCloudType>
319 transformProperties(receiveCpp.
transform());
324 template<
class TrackCloudType>
327 const vector& displacement,
328 const scalar fraction,
330 TrackCloudType&
cloud,
341 vector sendNormal, sendDisplacement;
342 patchData(td.
mesh, sendNormal, sendDisplacement);
346 const remote receiveProcFace =
352 displacement - fraction*sendDisplacement,
359 if (receiveProcFace.
proci == -1)
return false;
375 prepareForNonConformalCyclicTransfer
382 correctAfterNonConformalCyclicTransfer
393 template<
class TrackCloudType>
404 template<
class TrackCloudType>
409 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.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Base class for clouds. Provides a basic evolution algorithm, models, and a database for caching deriv...
const cyclicPolyPatch & nbrPatch() const
virtual const transformer & transform() const
Return transformation between the coupled patches.
virtual label nbrPatchIndex() const
Neighbour patchID.
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.
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.
void crossInternalFace(const polyMesh &mesh, barycentric &coordinates, label &celli, label &facei, label &faceTrii)
Cross an internal face.
void crossCyclic(const cyclicPolyPatch &inPatch, barycentric &coordinates, label &celli, label &facei, label &faceTrii)
Cross a cyclic patch.
point position(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label facei, const label faceTrii, const scalar stepFraction)
Return the position given the coordinates and tet topology.
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.
errorManip< error > abort(error &err)
static const Identity< scalar > I