61 "sampledSet::getCell(const label, const point&)"
62 ) <<
"Illegal face label " << faceI
66 if (faceI >=
mesh().nInternalFaces())
68 label cellI = getBoundaryCell(faceI);
70 if (!
mesh().pointInCell(sample, cellI))
74 "sampledSet::getCell(const label, const point&)"
75 ) <<
"Found cell " << cellI <<
" using face " << faceI
76 <<
". But cell does not contain point " << sample
87 if (
mesh().pointInCell(sample, cellI))
95 if (
mesh().pointInCell(sample, cellI))
103 "sampledSet::getCell(const label, const point&)"
104 ) <<
"None of the neighbours of face "
105 << faceI <<
" contains point " << sample
123 scalar magVec =
mag(vec);
135 n /=
mag(n) + VSMALL;
146 const scalar smallDist
168 if (dist < smallDist)
170 return myFaces[myFaceI];
190 facePt + tol*(cellCtr - facePt);
192 if (!searchEngine().pointInCell(newSample, cellI))
196 "sampledSet::pushIn(const point&, const label)"
197 ) <<
"After pushing " << facePt <<
" to " << newSample
198 <<
" it is still outside faceI " << faceI <<
endl
199 <<
"Please change your starting point"
215 const point& samplePt,
224 const scalar smallDist =
mag(tol*offset);
226 bool isGoodSample =
false;
236 || !
mesh().pointInCell(samplePt, trackCellI)
248 isGoodSample =
false;
264 else if (
mag(samplePt - bPoint) < smallDist)
271 trackPt = pushIn(bPoint, bFaceI);
273 trackCellI = getBoundaryCell(trackFaceI);
279 scalar
sign = calcSign(bFaceI, samplePt);
293 trackPt = pushIn(bPoint, bFaceI);
295 trackCellI = getBoundaryCell(trackFaceI);
297 isGoodSample =
false;
303 Info<<
"sampledSet::getTrackingPoint :"
304 <<
" offset:" << offset
305 <<
" samplePt:" << samplePt
306 <<
" bPoint:" << bPoint
307 <<
" bFaceI:" << bFaceI
308 <<
endl <<
" Calculated first tracking point :"
309 <<
" trackPt:" << trackPt
310 <<
" trackCellI:" << trackCellI
311 <<
" trackFaceI:" << trackFaceI
312 <<
" isGoodSample:" << isGoodSample
330 cells_.setSize(samplingCells.
size());
331 faces_.setSize(samplingFaces.
size());
332 segments_.setSize(samplingSegments.
size());
333 curveDist_.setSize(samplingCurveDist.
size());
337 (cells_.size() != size())
338 || (faces_.size() != size())
339 || (segments_.size() != size())
340 || (curveDist_.size() != size())
344 <<
"sizes not equal : "
345 <<
" points:" << size()
346 <<
" cells:" << cells_.size()
347 <<
" faces:" << faces_.size()
348 <<
" segments:" << segments_.size()
349 <<
" curveDist:" << curveDist_.size()
353 forAll(samplingPts, sampleI)
355 operator[](sampleI) = samplingPts[sampleI];
357 cells_ = samplingCells;
358 faces_ = samplingFaces;
359 segments_ = samplingSegments;
360 curveDist_ = samplingCurveDist;
376 searchEngine_(searchEngine),
394 searchEngine_(searchEngine),
420 wordConstructorTable::iterator cstrIter =
421 wordConstructorTablePtr_->find(sampleType);
423 if (cstrIter == wordConstructorTablePtr_->end())
427 "sampledSet::New(const word&, "
428 "const polyMesh&, meshSearch&, const dictionary&)"
429 ) <<
"Unknown sample type " << sampleType
431 <<
"Valid sample types : " <<
nl
432 << wordConstructorTablePtr_->sortedToc()
453 os <<
endl <<
"\t(cellI)\t(faceI)" <<
endl;
457 os <<
'\t' << cells_[sampleI]
458 <<
'\t' << faces_[sampleI]