Go to the documentation of this file.
28 #include "primitiveMesh.H"
61 <<
"Illegal face label " << faceI
65 if (faceI >=
mesh().nInternalFaces())
67 label cellI = getBoundaryCell(faceI);
69 if (!
mesh().pointInCell(sample, cellI, searchEngine_.decompMode()))
72 <<
"Found cell " << cellI <<
" using face " << faceI
73 <<
". But cell does not contain point " << sample
84 if (
mesh().pointInCell(sample, cellI, searchEngine_.decompMode()))
92 if (
mesh().pointInCell(sample, cellI, searchEngine_.decompMode()))
99 <<
"None of the neighbours of face "
100 << faceI <<
" contains point " << sample
118 scalar magVec =
mag(vec);
130 n /=
mag(
n) + VSMALL;
141 const scalar smallDist
163 if (dist < smallDist)
165 return myFaces[myFaceI];
183 point newPosition = facePt;
190 if (tetFaceI == -1 || tetPtI == -1)
192 newPosition = facePt;
212 }
while (tetFaceI < 0 && iterNo <= trap);
218 <<
"After pushing " << facePt <<
" to " << newPosition
219 <<
" it is still outside face " << faceI
221 <<
" of cell " << cellI
222 <<
" at " << cC <<
endl
223 <<
"Please change your starting point"
240 const point& samplePt,
249 const scalar smallDist =
mag(tol*offset);
251 bool isGoodSample =
false;
256 trackCellI =
mesh().
findCell(samplePt, searchEngine_.decompMode());
261 || !
mesh().pointInCell
265 searchEngine_.decompMode()
278 isGoodSample =
false;
294 else if (
mag(samplePt - bPoint) < smallDist)
301 trackPt = pushIn(bPoint, bFaceI);
303 trackCellI = getBoundaryCell(trackFaceI);
309 scalar
sign = calcSign(bFaceI, samplePt);
316 trackCellI =
mesh().
findCell(trackPt, searchEngine_.decompMode());
323 trackPt = pushIn(bPoint, bFaceI);
325 trackCellI = getBoundaryCell(trackFaceI);
327 isGoodSample =
false;
333 Info<<
"sampledSet::getTrackingPoint :"
334 <<
" offset:" << offset
335 <<
" samplePt:" << samplePt
336 <<
" bPoint:" << bPoint
337 <<
" bFaceI:" << bFaceI
338 <<
endl <<
" Calculated first tracking point :"
339 <<
" trackPt:" << trackPt
340 <<
" trackCellI:" << trackCellI
341 <<
" trackFaceI:" << trackFaceI
342 <<
" isGoodSample:" << isGoodSample
360 cells_.setSize(samplingCells.
size());
361 faces_.setSize(samplingFaces.
size());
362 segments_.setSize(samplingSegments.
size());
363 curveDist_.setSize(samplingCurveDist.
size());
367 (cells_.size() != size())
368 || (faces_.size() != size())
369 || (segments_.size() != size())
370 || (curveDist_.size() != size())
374 <<
"sizes not equal : "
375 <<
" points:" << size()
376 <<
" cells:" << cells_.size()
377 <<
" faces:" << faces_.size()
378 <<
" segments:" << segments_.size()
379 <<
" curveDist:" << curveDist_.size()
383 forAll(samplingPts, sampleI)
385 operator[](sampleI) = samplingPts[sampleI];
387 curveDist_ = samplingCurveDist;
389 cells_ = samplingCells;
390 faces_ = samplingFaces;
391 segments_ = samplingSegments;
407 searchEngine_(searchEngine),
424 searchEngine_(searchEngine),
449 wordConstructorTable::iterator cstrIter =
450 wordConstructorTablePtr_->find(sampleType);
452 if (cstrIter == wordConstructorTablePtr_->end())
455 <<
"Unknown sample type "
456 << sampleType <<
nl <<
nl
457 <<
"Valid sample types : " <<
endl
458 << wordConstructorTablePtr_->sortedToc()
479 os <<
endl <<
"\t(cellI)\t(faceI)" <<
endl;
483 os <<
'\t' << cells_[sampleI]
484 <<
'\t' << faces_[sampleI]
static autoPtr< sampledSet > New(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Return a reference to the selected sampledSet.
points setSize(newPointi)
Ostream & write(Ostream &) const
Output for debugging.
bool hit() const
Is there a hit.
A class for handling words, derived from string.
label getCell(const label faceI, const point &sample) const
Returns cell using face and containing sample.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
#define forAll(list, i)
Loop across all elements in list.
This class describes the interaction of a face and a point. It carries the info of a successful hit a...
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const cellList & cells() const
point pushIn(const point &sample, const label faceI) const
Moves sample in direction of -n to it is 'inside' of faceI.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual ~sampledSet()
Destructor.
dimensioned< scalar > mag(const dimensioned< Type > &)
dimensionedScalar sign(const dimensionedScalar &ds)
Mesh consisting of general polyhedral cells.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
sampledSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis)
Construct from components.
virtual const labelList & faceOwner() const
Return face owner.
bool getTrackingPoint(const vector &offset, const point &samplePt, const point &bPoint, const label bFaceI, point &trackPt, label &trackCellI, label &trackFaceI) const
Calculates start of tracking given samplePt and first boundary.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Holds list of sampling positions.
static const scalar trackingCorrectionTol
Fraction of distance to tet centre to move a particle to.
label findNearFace(const label cellI, const point &sample, const scalar smallDist) const
Returns face label (or -1) of face which is close to sample.
errorManip< error > abort(error &err)
const double e
Elementary charge.
label getBoundaryCell(const label) const
Returns cell next to boundary face.
errorManipArg< error, int > exit(error &err, const int errNo=1)
scalar calcSign(const label faceI, const point &sample) const
Calculates inproduct of face normal and vector sample-face centre.
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
const vectorField & cellCentres() const
virtual const faceList & faces() const
Return raw faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const polyMesh & mesh() const
void setSamples(const List< point > &samplingPts, const labelList &samplingCells, const labelList &samplingFaces, const labelList &samplingSegments, const scalarList &samplingCurveDist)
Sets sample data.
Ostream & write(Ostream &os) const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const vectorField & faceCentres() const
static const scalar tol
Tolerance when comparing points. Usually relative to difference.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const Point & missPoint() const
Return miss point.
void findTetFacePt(const label celli, const point &p, label &tetFacei, label &tetPti) const
Find the tetFacei and tetPti for point p in celli.
defineTypeNameAndDebug(combustionModel, 0)
A cell is defined as a list of faces with extra functionality.
const Point & hitPoint() const
Return hit point.
word name(const complex &)
Return a string representation of a complex.
virtual const labelList & faceNeighbour() const
Return face neighbour.
const vectorField & faceAreas() const