Go to the documentation of this file.
63 const vector offset = sampleCoords_[sampleI+1] - sampleCoords_[sampleI];
64 const scalar smallDist =
mag(tol*offset);
66 point oldPos = trackPt;
71 singleParticle.
track(sampleCoords_[sampleI+1], trackData);
76 && (
mag(trackPt - oldPos) < smallDist)
85 mag(trackPt - sampleCoords_[sampleI+1])
93 samplingPts.
append(trackPt);
95 samplingFaces.
append(facei);
98 samplingCurveDist.
append(1.0*(sampleI+1));
104 samplingPts.
append(trackPt);
110 mag(trackPt - sampleCoords_[sampleI])
111 /
mag(sampleCoords_[sampleI+1] - sampleCoords_[sampleI]);
112 samplingCurveDist.
append(sampleI + dist);
117 if (sampleI == sampleCoords_.size() - 1)
138 if (sampleCoords_.size() < 2)
141 <<
"Incorrect sample specification. Too few points:"
144 point oldPoint = sampleCoords_[0];
145 for (
label sampleI = 1; sampleI < sampleCoords_.size(); sampleI++)
147 if (
mag(sampleCoords_[sampleI] - oldPoint) < SMALL)
150 <<
"Incorrect sample specification."
151 <<
" Point " << sampleCoords_[sampleI-1]
152 <<
" at position " << sampleI-1
153 <<
" and point " << sampleCoords_[sampleI]
154 <<
" at position " << sampleI
157 oldPoint = sampleCoords_[sampleI];
161 const bool oldMoving =
const_cast<polyMesh&
>(
mesh()).moving(
false);
168 label startSegmentI = 0;
172 point lastSample(GREAT, GREAT, GREAT);
177 label trackCellI = -1;
178 label trackFaceI = -1;
183 sampleCoords_[sampleI+1] - sampleCoords_[sampleI];
184 const scalar smallDist =
mag(tol*offset);
190 sampleCoords_[sampleI],
191 sampleCoords_[sampleI+1]
194 point bPoint(GREAT, GREAT, GREAT);
199 bPoint = bHits[0].hitPoint();
200 bFaceI = bHits[0].index();
208 sampleCoords_[sampleI+1] - sampleCoords_[sampleI],
209 sampleCoords_[sampleI],
218 if (isSample && (
mag(lastSample - trackPt) > smallDist))
228 samplingPts.
append(trackPt);
229 samplingCells.
append(trackCellI);
230 samplingFaces.
append(trackFaceI);
235 mag(trackPt - sampleCoords_[sampleI])
236 /
mag(sampleCoords_[sampleI+1] - sampleCoords_[sampleI]);
237 samplingCurveDist.
append(sampleI + dist);
239 lastSample = trackPt;
242 if (trackCellI == -1)
247 }
while ((trackCellI == -1) && (sampleI < sampleCoords_.size() - 1));
249 if (sampleI == sampleCoords_.size() - 1)
269 bool bReached = trackToBoundary
281 for (
label i = samplingPts.size() - 1; i >= startSegmentI; --i)
283 samplingSegments.
append(segmentI);
293 lastSample = singleParticle.
position();
299 if (sampleI == sampleCoords_.size() - 1)
309 startSegmentI = samplingPts.size();
337 samplingSegments.
shrink();
338 samplingCurveDist.
shrink();
363 sampleCoords_(sampleCoords)
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)?
A class for handling words, derived from string.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
void calcSamples(DynamicList< point > &samplingPts, DynamicList< label > &samplingCells, DynamicList< label > &samplingFaces, DynamicList< label > &samplingSegments, DynamicList< scalar > &samplingCurveDist) const
Samples all point in sampleCoords_.
scalar & stepFraction()
Return the fraction of time-step completed.
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.
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.
bool trackToBoundary(passiveParticleCloud &particleCloud, passiveParticle &singleParticle, label &sampleI, DynamicList< point > &samplingPts, DynamicList< label > &samplingCells, DynamicList< label > &samplingFaces, DynamicList< scalar > &samplingCurveDist) const
Sample till hits boundary. Called with singleParticle at position.
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.
polyLineSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const List< point > &samplePoints)
Construct from components.
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)
void genSamples()
Uses calcSamples to obtain samples. Copies them into *this.
#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.
virtual ~polyLineSet()
Destructor.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label track(const vector &endPosition, TrackData &td)
Track particle to end of trajectory.
const vector & position() const
Return current particle position.
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.