Go to the documentation of this file.
53 || (
faces_.size() != size())
59 <<
"sizes not equal : "
60 <<
" points:" << size()
61 <<
" cells:" <<
cells_.size()
62 <<
" faces:" <<
faces_.size()
78 if (facei >=
mesh().nInternalFaces())
97 const label
cells[4] =
100 getNeighbourCell(faces_[samplei]),
102 getNeighbourCell(faces_[samplei+1])
123 <<
"Could not find mid-point " <<
p
124 <<
" cell " << cellm <<
endl;
132 for (label i=0; i<4; ++i)
143 <<
"Could not find cell for mid-point" <<
nl
144 <<
" samplei: " << samplei
145 <<
" pts[samplei]: " << operator[](samplei)
146 <<
" face[samplei]: " << faces_[samplei]
147 <<
" pts[samplei+1]: " << operator[](samplei+1)
148 <<
" face[samplei+1]: " << faces_[samplei+1]
149 <<
" cellio: " <<
cells[0]
150 <<
" cellin: " <<
cells[1]
151 <<
" celljo: " <<
cells[2]
152 <<
" celljn: " <<
cells[3]
169 scalar magVec =
mag(vec);
189 const scalar smallDist
211 if (dist < smallDist)
213 return myFaces[myFacei];
229 point newPosition = facePt;
242 const scalar trackingCorrectionTol = 1
e-5;
244 if (tetFacei == -1 || tetPtI == -1)
246 newPosition = facePt;
248 label trap(1.0/trackingCorrectionTol + 1);
254 newPosition += trackingCorrectionTol*(cC - facePt);
266 }
while (tetFacei < 0 && iterNo <= trap);
272 <<
"After pushing " << facePt <<
" to " << newPosition
273 <<
" it is still outside face " << facei
275 <<
" of cell " << celli
276 <<
" at " << cC <<
endl
277 <<
"Please change your starting point"
287 const point& samplePt,
290 const scalar smallDist,
297 bool isGoodSample =
false;
302 trackCelli =
mesh().
findCell(samplePt, searchEngine_.decompMode());
307 || !
mesh().pointInCell
311 searchEngine_.decompMode()
321 isGoodSample =
false;
333 else if (
mag(samplePt - bPoint) < smallDist)
336 trackPt = pushIn(bPoint, bFacei);
338 trackCelli = getBoundaryCell(trackFacei);
344 scalar
sign = calcSign(bFacei, samplePt);
351 trackCelli =
mesh().
findCell(trackPt, searchEngine_.decompMode());
358 trackPt = pushIn(bPoint, bFacei);
360 trackCelli = getBoundaryCell(trackFacei);
362 isGoodSample =
false;
367 <<
" samplePt:" << samplePt
368 <<
" bPoint:" << bPoint
369 <<
" bFacei:" << bFacei <<
nl
370 <<
" Calculated first tracking point :"
371 <<
" trackPt:" << trackPt
372 <<
" trackCelli:" << trackCelli
373 <<
" trackFacei:" << trackFacei
374 <<
" isGoodSample:" << isGoodSample
390 setPoints(samplingPts);
391 curveDist_ = samplingCurveDist;
393 segments_ = samplingSegments;
394 cells_ = samplingCells;
395 faces_ = samplingFaces;
410 setPoints(std::move(samplingPts));
411 curveDist_ = std::move(samplingCurveDist);
413 segments_ = std::move(samplingSegments);
414 cells_ = std::move(samplingCells);
415 faces_ = std::move(samplingFaces);
443 <<
"Sample set " <<
name()
444 <<
" has zero points." <<
endl;
449 scalarList sortedDist(allCurveDist, indexSet);
451 allSegments = UIndirectList<label>(allSegments, indexSet)();
457 List<point>(UIndirectList<point>(allPts, indexSet)),
475 searchEngine_(searchEngine),
492 searchEngine_(searchEngine),
509 searchEngine_(searchEngine),
528 auto* ctorPtr = wordConstructorTable(sampleType);
537 *wordConstructorTablePtr_
541 return autoPtr<sampledSet>
558 os <<
nl <<
"\t(celli)\t(facei)" <<
nl;
562 os <<
'\t' << cells_[samplei]
563 <<
'\t' << faces_[samplei]
Holds list of sampling points which is filled at construction time. Various implementations of this b...
static autoPtr< sampledSet > New(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
static autoPtr< T > New(Args &&... args)
List< scalar > scalarList
A List of scalars.
void checkDimensions() const
Ostream & write(Ostream &) const
A class for handling words, derived from Foam::string.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
autoPtr< coordSet > gather(labelList &indexSet, labelList &allSegments) const
label getNeighbourCell(const label) const
Describes the interaction of a face and a point. It carries the info of a successful hit and (if succ...
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
scalar calcSign(const label facei, const point &sample) const
const cellList & cells() const
static bool master(const label communicator=worldComm)
label findNearFace(const label celli, const point &sample, const scalar smallDist) const
const point_type & hitPoint() const
Ostream & endl(Ostream &os)
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
dimensionedScalar sign(const dimensionedScalar &ds)
sampledSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const coordSet::coordFormat axisType)
bool pointInCell(const point &p, label celli, const cellDecomposition=CELL_TETS) const
Mesh consisting of general polyhedral cells.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
const point_type & missPoint() const
virtual const labelList & faceOwner() const
static void gatherOp(const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Holds list of sampling positions.
errorManip< error > abort(error &err)
label getBoundaryCell(const label) const
Vector< scalar > vector
A scalar version of the templated Vector.
point pushIn(const point &sample, const label facei) const
errorManipArg< error, int > exit(error &err, const int errNo=1)
VectorSpace< Form, Cmpt, Ncmpts > normalised(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
const vectorField & cellCentres() const
virtual const faceList & faces() const
#define FatalErrorInFunction
void setSamples(const List< point > &samplingPts, const labelList &samplingCells, const labelList &samplingFaces, const labelList &samplingSegments, const scalarList &samplingCurveDist)
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...
bool getTrackingPoint(const point &samplePt, const point &bPoint, const label bFacei, const scalar smallDist, point &trackPt, label &trackCelli, label &trackFacei) const
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const vectorField & faceCentres() const
const dimensionedScalar e
const dictionary & optionalSubDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
word name(const expressions::valueTypeCode typeCode)
A List with indirect addressing.
A face is a list of labels corresponding to mesh vertices.
labelList sortedOrder(const UList< T > &input)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
vector point
Point is a vector.
void findTetFacePt(const label celli, const point &p, label &tetFacei, label &tetPti) const
defineTypeNameAndDebug(combustionModel, 0)
bool hit() const noexcept
#define WarningInFunction
A cell is defined as a list of faces with extra functionality.
label pointInCell(const point &p, const label samplei) const
virtual const labelList & faceNeighbour() const
Minimal example by using system/controlDict.functions: