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
128 template<
class TrackCloudType>
131 TrackCloudType&
cloud,
137 if (isA<processorPolyPatch>(pp))
139 correctAfterProcessorTransfer(td);
141 else if (isA<nonConformalCyclicPolyPatch>(pp))
148 <<
"Transfer patch type not recognised"
154 template<
class TrackCloudType>
157 const vector& displacement,
158 const scalar fraction,
159 TrackCloudType&
cloud,
168 typename TrackCloudType::particleType&
p =
169 static_cast<typename TrackCloudType::particleType&
>(*this);
170 typename TrackCloudType::particleType::trackingData& ttd =
171 static_cast<typename TrackCloudType::particleType::trackingData&
>(td);
177 else if (onInternalFace(td.
mesh))
181 else if (onBoundaryFace(td.
mesh))
187 p.hitNonConformalCyclicPatch
191 cloud.patchNonConformalCyclicPatches()[
p.patch(td.
mesh)][i],
201 if (!
p.hitPatch(
cloud, ttd))
205 if (isA<wedgePolyPatch>(patch))
207 p.hitWedgePatch(
cloud, ttd);
209 else if (isA<symmetryPlanePolyPatch>(patch))
211 p.hitSymmetryPlanePatch(
cloud, ttd);
213 else if (isA<symmetryPolyPatch>(patch))
215 p.hitSymmetryPatch(
cloud, ttd);
217 else if (isA<cyclicPolyPatch>(patch))
219 p.hitCyclicPatch(
cloud, ttd);
221 else if (isA<processorPolyPatch>(patch))
223 p.hitProcessorPatch(
cloud, ttd);
225 else if (isA<wallPolyPatch>(patch))
227 p.hitWallPatch(
cloud, ttd);
231 p.hitBasicPatch(
cloud, ttd);
238 template<
class TrackCloudType>
241 const vector& displacement,
242 const scalar fraction,
243 TrackCloudType&
cloud,
252 const scalar
f = trackToFace(td.
mesh, displacement, fraction);
254 hitFace(displacement, fraction,
cloud, td);
260 template<
class TrackCloudType>
267 template<
class TrackCloudType>
271 <<
"Hitting a wedge patch should not be possible."
274 hitSymmetryPatch(
cloud, td);
278 template<
class TrackCloudType>
281 TrackCloudType&
cloud,
285 hitSymmetryPatch(
cloud, td);
289 template<
class TrackCloudType>
297 template<
class TrackCloudType>
320 transformProperties(receiveCpp.
transform());
325 template<
class TrackCloudType>
328 const vector& displacement,
329 const scalar fraction,
331 TrackCloudType&
cloud,
342 vector sendNormal, sendDisplacement;
343 patchData(td.
mesh, sendNormal, sendDisplacement);
347 const remote receiveProcFace =
353 displacement - fraction*sendDisplacement,
360 if (receiveProcFace.
proci == -1)
return false;
375 prepareForNonConformalCyclicTransfer
381 correctAfterNonConformalCyclicTransfer
391 template<
class TrackCloudType>
402 template<
class TrackCloudType>
407 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 nbrPatchID() 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.
label sendToProc
Processor to send the particle to. -1 indicates that this.
label sendFromPatch
Patch from which to send the particle.
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