MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / getTrackingPoint

Function getTrackingPoint

src/sampling/sampledSet/sampledSet/sampledSet.C:261–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259
260
261bool Foam::sampledSet::getTrackingPoint
262(
263 const point& samplePt,
264 const point& bPoint,
265 const label bFacei,
266 const scalar smallDist,
267
268 point& trackPt,
269 label& trackCelli,
270 label& trackFacei
271) const
272{
273 bool isGoodSample = false;
274
275 if (bFacei == -1)
276 {
277 // No boundary intersection. Try and find cell samplePt is in
278 trackCelli = mesh().findCell(samplePt, searchEngine_.decompMode());
279
280 if
281 (
282 (trackCelli == -1)
283 || !mesh().pointInCell
284 (
285 samplePt,
286 trackCelli,
287 searchEngine_.decompMode()
288 )
289 )
290 {
291 // Line samplePt - end_ does not intersect domain at all.
292 // (or is along edge)
293
294 trackCelli = -1;
295 trackFacei = -1;
296
297 isGoodSample = false;
298 }
299 else
300 {
301 // Start is inside. Use it as tracking point
302
303 trackPt = samplePt;
304 trackFacei = -1;
305
306 isGoodSample = true;
307 }
308 }
309 else if (mag(samplePt - bPoint) < smallDist)
310 {
311 // samplePt close to bPoint. Snap to it
312 trackPt = pushIn(bPoint, bFacei);
313 trackFacei = bFacei;
314 trackCelli = getBoundaryCell(trackFacei);
315
316 isGoodSample = true;
317 }
318 else

Callers 3

calcSamplesFunction · 0.85
calcSamplesFunction · 0.85
calcSamplesFunction · 0.85

Calls 3

meshFunction · 0.85
magClass · 0.50
decompModeMethod · 0.45

Tested by

no test coverage detected