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());
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);
475 searchEngine_(searchEngine),
492 searchEngine_(searchEngine),
509 searchEngine_(searchEngine),
528 auto* ctorPtr = wordConstructorTable(sampleType);
537 *wordConstructorTablePtr_
558 os <<
nl <<
"\t(celli)\t(facei)" <<
nl;
562 os <<
'\t' << cells_[samplei]
563 <<
'\t' << faces_[samplei]
int debug
Static debugging option.
static autoPtr< sampledSet > New(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Return a reference to the selected sampledSet.
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
void checkDimensions() const
Check for consistent sizing.
Ostream & write(Ostream &) const
Output for debugging.
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
Helper: gather onto master and sort.
label getNeighbourCell(const label) const
Returns the neighbour cell or the owner if face in on the boundary.
Describes the interaction of a face and a point. It carries the info of a successful hit and (if succ...
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
coordFormat
Enumeration defining the output format for coordinates.
scalar calcSign(const label facei, const point &sample) const
Calculates inproduct of face normal and vector sample-face centre.
const cellList & cells() const
static bool master(const label communicator=worldComm)
Am I the master process.
label findNearFace(const label celli, const point &sample, const scalar smallDist) const
Returns face label (or -1) of face which is close to sample.
const point_type & hitPoint() const
Return the hit point. Fatal if not hit.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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)
Construct from components.
bool pointInCell(const point &p, label celli, const cellDecomposition=CELL_TETS) const
Test if point p is in the celli.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
const point_type & missPoint() const
Return the miss point. Fatal if hit.
#define DebugInFunction
Report an information message using Foam::Info.
virtual const labelList & faceOwner() const
Return face owner.
labelList segments_
Segment numbers.
static void gatherOp(const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking)
Collect data in processor order on master.
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
Returns cell next to boundary face.
point pushIn(const point &sample, const label facei) const
Moves sample in direction of -n to it is 'inside' of facei.
labelList cells_
Cell numbers.
errorManipArg< error, int > exit(error &err, const int errNo=1)
VectorSpace< Form, Cmpt, Ncmpts > normalised(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
scalarList curveDist_
Cumulative distance "distance" write specifier.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
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.
void setSamples(const List< point > &samplingPts, const labelList &samplingCells, const labelList &samplingFaces, const labelList &samplingSegments, const scalarList &samplingCurveDist)
Set sample data. Copy list contents.
Ostream & write(Ostream &os) const
Write to stream.
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
Calculates start of tracking given samplePt and first boundary.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const vectorField & faceCentres() const
const dimensionedScalar e
Elementary charge.
const dictionary & optionalSubDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary, otherwise return this dictionary.
labelList faces_
Face numbers (-1 if not known)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A List with indirect addressing.
A face is a list of labels corresponding to mesh vertices.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
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)
bool hit() const noexcept
Is there a hit.
#define WarningInFunction
Report a warning using Foam::Warning.
A cell is defined as a list of faces with extra functionality.
label pointInCell(const point &p, const label samplei) const
Return the cell in which the point on the sample line.
virtual const labelList & faceNeighbour() const
Return face neighbour.
Minimal example by using system/controlDict.functions: