Go to the documentation of this file.
55 const vector offset = end_ - start_;
56 const vector smallVec = tol*offset;
57 const scalar smallDist =
mag(smallVec);
66 point oldPoint = trackPt;
70 if (singleParticle.
face() != -1 &&
mag(oldPoint - trackPt) > smallDist)
73 samplingPts.
append(trackPt);
76 samplingCurveDist.
append(
mag(trackPt - start_));
79 if (
mag(trackPt - end_) < smallDist)
103 if (
mag(end_ - start_) < SMALL)
106 <<
"Incorrect sample specification :"
107 <<
" start equals end point." <<
endl
108 <<
" start:" << start_
113 const vector offset = (end_ - start_);
114 const vector normOffset = offset/
mag(offset);
115 const vector smallVec = tol*offset;
116 const scalar smallDist =
mag(smallVec);
119 const bool oldMoving =
const_cast<polyMesh&
>(
mesh()).moving(
false);
129 point bPoint(GREAT, GREAT, GREAT);
134 bPoint = bHits[0].hitPoint();
135 bFaceI = bHits[0].index();
141 label trackCellI = -1;
142 label trackFaceI = -1;
165 if (trackCellI == -1)
177 if (trackFaceI == -1)
180 trackFaceI = findNearFace(trackCellI, trackPt, smallDist);
197 label startSegmentI = 0;
204 if (trackFaceI != -1)
207 samplingPts.
append(trackPt);
208 samplingCells.
append(trackCellI);
209 samplingFaces.
append(trackFaceI);
210 samplingCurveDist.
append(
mag(trackPt - start_));
221 bool reachedBoundary = trackToBoundary
232 for (
label i = samplingPts.size() - 1; i >= startSegmentI; --i)
234 samplingSegments.
append(segmentI);
238 if (!reachedBoundary)
251 bool foundValidB =
false;
253 while (bHitI < bHits.
size())
256 (bHits[bHitI].hitPoint() - singleParticle.
position())
265 if (dist > smallDist)
284 trackFaceI = bHits[bHitI].index();
285 trackPt = pushIn(bHits[bHitI].hitPoint(), trackFaceI);
286 trackCellI = getBoundaryCell(trackFaceI);
290 startSegmentI = samplingPts.size();
318 samplingSegments.
shrink();
319 samplingCurveDist.
shrink();
Holds list of sampling points which is filled at construction time. Various implementations of this b...
bool onBoundary() const
Is the particle on the boundary/(or outside the domain)?
label & face()
Return current face particle is on otherwise -1.
A class for handling words, derived from string.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
scalar trackToFace(const vector &endPosition, TrackData &td)
Track particle to a given position and returns 1.0 if the.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool trackToBoundary(passiveParticleCloud &particleCloud, passiveParticle &singleParticle, DynamicList< point > &samplingPts, DynamicList< label > &samplingCells, DynamicList< label > &samplingFaces, DynamicList< scalar > &samplingCurve) const
Samples from startTrackPt/CellI. Updates particle/samplePt/sampleI.
Ostream & endl(Ostream &os)
Add newline and flush stream.
faceOnlySet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const point &start, const point &end)
Construct from components.
dimensioned< scalar > mag(const dimensioned< Type > &)
List< pointIndexHit > intersections(const point &pStart, const point &pEnd) const
Find all intersections of boundary within segment pStart .. pEnd.
Mesh consisting of general polyhedral cells.
label & cell()
Return current cell particle is in.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
A Cloud of passive particles.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Macros for easy insertion into run-time selection tables.
void calcSamples(DynamicList< point > &samplingPts, DynamicList< label > &samplingCells, DynamicList< label > &samplingFaces, DynamicList< label > &samplingSegments, DynamicList< scalar > &samplingCurveDist) const
Samples from start_ to end_. samplingSegments contains segmentNo.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void setSamples(const List< point > &samplingPts, const labelList &samplingCells, const labelList &samplingFaces, const labelList &samplingSegments, const scalarList &samplingCurveDist)
Sets sample data.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const vector & position() const
Return current particle position.
void genSamples()
Uses calcSamples to obtain samples. Copies them into *this.
virtual ~faceOnlySet()
Destructor.
void size(const label)
Override size to be inconsistent with allocated storage.
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.