44 bool Foam::particle::locate
57 coordinates_, celli_, tetFacei_, tetPti_, 1,
59 ?
static_cast<const string&
>(
string(
"Particle " +
name(
origId())))
60 : NullObjectRef<string>()
83 stepFractionBehind_(0),
86 origId_(getNewParticleIndex())
95 label& nLocateBoundaryHits
98 coordinates_(- vGreat, - vGreat, - vGreat, - vGreat),
104 stepFractionBehind_(0),
106 origProc_(
Pstream::myProcNo()),
107 origId_(getNewParticleIndex())
109 if (!locate(searchEngine,
position, celli))
111 nLocateBoundaryHits ++;
118 coordinates_(
p.coordinates_),
120 tetFacei_(
p.tetFacei_),
123 stepFraction_(
p.stepFraction_),
124 stepFractionBehind_(
p.stepFractionBehind_),
125 nTracksBehind_(
p.nTracksBehind_),
126 origProc_(
p.origProc_),
133 bool Foam::particle::locate
146 coordinates_, celli_, tetFacei_, tetPti_, 1,
148 ?
static_cast<const string&
>(
string(
"Particle " +
name(origId())))
149 : NullObjectRef<string>()
157 const vector& displacement,
165 coordinates_, celli_, tetFacei_, tetPti_, stepFraction_,
166 stepFractionBehind_, nTracksBehind_,
168 ?
static_cast<const string&
>(
string(
"Particle " +
name(origId())))
169 : NullObjectRef<string>()
172 facei_ = onBoundaryAndF.
first() ? tetFacei_ : -1;
174 return onBoundaryAndF.
second();
181 const vector& displacement,
189 coordinates_, celli_, tetFacei_, tetPti_, stepFraction_,
190 stepFractionBehind_, nTracksBehind_,
192 ?
static_cast<const string&
>(
string(
"Particle " +
name(origId())))
193 : NullObjectRef<string>()
196 facei_ = inNextCellAndF.
first() ? tetFacei_ : -1;
198 return inNextCellAndF.
second();
205 const vector& displacement,
213 coordinates_, celli_, tetFacei_, tetPti_, stepFraction_,
214 stepFractionBehind_, nTracksBehind_,
216 ?
static_cast<const string&
>(
string(
"Particle " +
name(origId())))
217 : NullObjectRef<string>()
220 facei_ = onFaceAndF.
first() ? tetFacei_ : -1;
222 return onFaceAndF.
second();
251 refCast<const processorPolyPatch>
263 refCast<const processorPolyPatch>
284 const label sendFromPatch,
285 const label sendToPatchFace,
286 const vector& sendToPosition
311 facei_ = sendToPatchFace;
324 const label sendToPatch,
346 patchNLocateBoundaryHits[sendToPatch] ++;
387 const vector pos(coordinates_.b(), coordinates_.c(), coordinates_.d());
404 celli_, tetFacei_, tetPti_, stepFraction_
413 const label procCell,
414 const label procTetFace
424 == (procMesh.
faceOwner()[procTetFace] == procCell)
431 return procMesh.
faces()[procTetFace].
size() - 1 - tetPti_;
void size(const label)
Override size to be inconsistent with allocated storage.
Inter-processor communications stream.
A 2-tuple for storing two objects of different types.
const Type2 & second() const
Return second.
const Type1 & first() const
Return first.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Mesh object that implements searches within the local cells and faces.
label sendFromPatch
Patch from which to send the particle.
label sendToPatch
Patch to which to send the particle.
const polyMesh & mesh
Reference to the mesh.
label origProc() const
Return the originating processor ID.
void prepareForNonConformalCyclicTransfer(const polyMesh &mesh, const label sendToPatch, const label sendToPatchFace, const vector &sendToPosition)
Make changes prior to a transfer across a non conformal cyclic.
scalar trackToCell(const polyMesh &mesh, const vector &displacement, const scalar fraction)
As particle::track, but stops when a new cell is reached.
void prepareForProcessorTransfer(trackingData &td)
Make changes prior to a transfer across a processor boundary.
particle(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti, const label facei)
Construct from components.
void correctAfterInteractionListReferral(const polyMesh &mesh, const label celli)
Correct the topology after referral. Locates the particle.
void correctAfterNonConformalCyclicTransfer(const polyMesh &mesh, const label sendToPatch, labelList &patchNLocateBoundaryHits)
Make changes following a transfer across a non conformal cyclic.
scalar track(const polyMesh &mesh, const vector &displacement, const scalar fraction)
Track along the displacement for a given fraction of the overall.
scalar trackToFace(const polyMesh &mesh, const vector &displacement, const scalar fraction)
As particle::track, but stops when a face is hit.
void prepareForInteractionListReferral(const polyMesh &mesh, const transformer &transform)
Break the topology and store the cartesian position so that the.
vector deviationFromMeshCentre(const polyMesh &mesh) const
Get the displacement from the mesh centre. Used to correct the.
void correctAfterProcessorTransfer(trackingData &td)
Make changes following a transfer across a processor boundary.
label procTetPt(const polyMesh &mesh, const polyMesh &procMesh, const label procCell, const label procTetFace) const
Return the tet point appropriate for decomposition or.
vector position(const polyMesh &mesh) const
Return current particle position.
virtual void transformProperties(const transformer &)
Transform the physical properties of the particle.
label origId() const
Return the particle ID on the originating processor.
static label particleCount
Cumulative particle counter - used to provide unique ID.
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundary() const
Return boundary mesh.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
const Vector< label > & geometricD() const
Return the vector of geometric directions in mesh.
label start() const
Return start label of this patch in the polyMesh face list.
const cellList & cells() const
Neighbour processor patch.
virtual const transformer & transform() const
Return null transform between processor patches.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
barycentric coordinates(const polyMesh &mesh, const point &position, const label celli, const label facei, const label faceTrii, const scalar stepFraction)
Return the coordinates given the position and tet topology.
Tuple2< bool, scalar > toCell(const polyMesh &mesh, const Displacement &displacement, const scalar fraction, barycentric &coordinates, label &celli, label &facei, label &faceTrii, scalar &stepFraction, scalar &stepFractionBehind, label &nTracksBehind, const string &debugPrefix=NullObjectRef< string >())
As toFace, except that if the track ends on an internal face then this.
Tuple2< bool, scalar > toBoundary(const polyMesh &mesh, const Displacement &displacement, const scalar fraction, barycentric &coordinates, label &celli, label &facei, label &faceTrii, scalar &stepFraction, scalar &stepFractionBehind, label &nTracksBehind, const string &debugPrefix=NullObjectRef< string >())
As toFace, except that the track continues across multiple cells until.
void outProcessor(const processorPolyPatch &outPatch, barycentric &coordinates, label &celli, label &facei, label &faceTrii)
Complete crossing of a processor patch. Restore the topology.
void inProcessor(const processorPolyPatch &inPatch, label &celli, label &facei)
Initialise crossing of a processor patch. Breaks the topology in order.
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.
Tuple2< bool, scalar > toFace(const polyMesh &mesh, const Displacement &displacement, const scalar fraction, barycentric &coordinates, label &celli, label &facei, label &faceTrii, scalar &stepFraction, scalar &stepFractionBehind, label &nTracksBehind, const string &debugPrefix=NullObjectRef< string >())
Track along the displacement for a given fraction of the overall.
bool locate(const polyMesh &mesh, const point &position, barycentric &coordinates, label &celli, label &facei, label &faceTrii, const scalar stepFraction, const string &debugPrefix=NullObjectRef< string >())
Initialise the location at the given position. Returns whether or not a.
dimensionedScalar pos(const dimensionedScalar &ds)
bool operator!=(const particle &, const particle &)
Barycentric< scalar > barycentric
A scalar version of the templated Barycentric.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
void transform(GeometricField< Type, GeoMesh > &rtf, const GeometricField< tensor, GeoMesh > &trf, const GeometricField< Type, GeoMesh > &tf)
Vector< scalar > vector
A scalar version of the templated Vector.
void inv(pointPatchField< tensor > &, const pointPatchField< tensor > &)
void cmptMin(Field< typename Field< Type >::cmptType > &res, const UList< Type > &f)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Cmpt cmptSum(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)