58 <<
"Sizes not equal : " 59 <<
" points:" <<
size()
77 if (facei <
mesh().nInternalFaces())
94 const label
cells[4] =
97 getNeighbourCell(faces_[samplei]),
99 getNeighbourCell(faces_[samplei+1])
120 <<
"Could not find mid-point " <<
p 121 <<
" cell " << cellm <<
endl;
129 for (label i=0; i<4; ++i)
140 <<
"Could not find cell for mid-point" <<
nl 141 <<
" samplei: " << samplei
142 <<
" pts[samplei]: " << operator[](samplei)
143 <<
" face[samplei]: " << faces_[samplei]
144 <<
" pts[samplei+1]: " << operator[](samplei+1)
145 <<
" face[samplei+1]: " << faces_[samplei+1]
146 <<
" cellio: " <<
cells[0]
147 <<
" cellin: " <<
cells[1]
148 <<
" celljo: " <<
cells[2]
149 <<
" celljn: " <<
cells[3]
166 scalar magVec =
mag(vec);
186 const scalar smallDist
197 scalar dist = inter.
point().dist(sample);
199 if (dist < smallDist)
201 return myFaces[myFacei];
217 point newPosition = facePt;
230 const scalar trackingCorrectionTol = 1
e-5;
232 if (tetFacei == -1 || tetPtI == -1)
234 newPosition = facePt;
236 label trap(1.0/trackingCorrectionTol + 1);
242 newPosition += trackingCorrectionTol*(cC - facePt);
254 }
while (tetFacei < 0 && iterNo <= trap);
260 <<
"After pushing " << facePt <<
" to " << newPosition
261 <<
" it is still outside face " << facei
263 <<
" of cell " << celli
264 <<
" at " << cC <<
endl 265 <<
"Please change your starting point" 275 const point& samplePt,
278 const scalar smallDist,
285 bool isGoodSample =
false;
290 trackCelli =
mesh().
findCell(samplePt, searchEngine_.decompMode());
299 searchEngine_.decompMode()
309 isGoodSample =
false;
321 else if (
mag(samplePt - bPoint) < smallDist)
324 trackPt = pushIn(bPoint, bFacei);
326 trackCelli = getBoundaryCell(trackFacei);
332 scalar
sign = calcSign(bFacei, samplePt);
339 trackCelli =
mesh().
findCell(trackPt, searchEngine_.decompMode());
346 trackPt = pushIn(bPoint, bFacei);
348 trackCelli = getBoundaryCell(trackFacei);
350 isGoodSample =
false;
355 <<
" samplePt:" << samplePt
356 <<
" bPoint:" << bPoint
357 <<
" bFacei:" << bFacei <<
nl 358 <<
" Calculated first tracking point :" 359 <<
" trackPt:" << trackPt
360 <<
" trackCelli:" << trackCelli
361 <<
" trackFacei:" << trackFacei
362 <<
" isGoodSample:" << isGoodSample
378 setPoints(samplingPts);
379 setDistance(samplingDistance,
false);
381 segments_ = samplingSegments;
382 cells_ = samplingCells;
383 faces_ = samplingFaces;
398 setPoints(std::move(samplingPts));
399 setDistance(std::move(samplingDistance),
false);
401 segments_ = std::move(samplingSegments);
402 cells_ = std::move(samplingCells);
403 faces_ = std::move(samplingFaces);
421 searchEngine_(searchEngine),
438 searchEngine_(searchEngine),
455 searchEngine_(searchEngine),
493 auto* ctorPtr = wordConstructorTable(sampleType);
502 *wordConstructorTablePtr_
523 os <<
nl <<
"\t(celli)\t(facei)" <<
nl;
527 os <<
'\t' << cells_[samplei]
528 <<
'\t' << faces_[samplei]
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
dimensionedScalar sign(const dimensionedScalar &ds)
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
void size(const label n)
Older name for setAddressableSize.
void checkDimensions() const
Check for consistent sizing.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A face is a list of labels corresponding to mesh vertices.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label findNearFace(const label celli, const point &sample, const scalar smallDist) const
Returns face label (or -1) of face which is close to sample.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
static autoPtr< sampledSet > New(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Return a reference to the selected sampledSet.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual const labelList & faceNeighbour() const
Return face neighbour.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label getNeighbourCell(const label) const
Returns the neighbour cell or the owner if face in on the boundary.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const cellList & cells() const
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
bool pointInCell(const point &p, label celli, const cellDecomposition=CELL_TETS) const
Test if point p is in the celli.
point pushIn(const point &sample, const label facei) const
Moves sample in direction of -n to it is 'inside' of facei.
#define forAll(list, i)
Loop across all elements in list.
const dictionary & optionalSubDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary, otherwise return this dictionary.
sampledSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const coordSet::coordFormat axisType)
Construct from components.
const dimensionedScalar e
Elementary charge.
Ostream & write(Ostream &) const
Output for debugging.
Holds list of sampling positions.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
A class for handling words, derived from Foam::string.
Ostream & write(Ostream &os) const
Write to stream.
scalarList distance_
Cumulative distance for "distance" write specifier.
#define DebugInFunction
Report an information message using Foam::Info.
virtual const labelList & faceOwner() const
Return face owner.
coordFormat
Enumeration defining the output format for coordinates.
Describes the interaction of a object and a (templated) point. It carries the info of a successful hi...
virtual const faceList & faces() const
Return raw faces.
const vectorField & cellCentres() const
errorManip< error > abort(error &err)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
labelList segments_
Segment numbers.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
label size() const noexcept
The number of elements in the container.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
int debug
Static debugging option.
OBJstream os(runTime.globalPath()/outputName)
label getBoundaryCell(const label) const
Returns cell next to boundary face.
defineTypeNameAndDebug(combustionModel, 0)
const vectorField & faceCentres() const
label pointInCell(const point &p, const label samplei) const
Return the cell in which the point on the sample line.
vector point
Point is a vector.
#define WarningInFunction
Report a warning using Foam::Warning.
A cell is defined as a list of faces with extra functionality.
scalar calcSign(const label facei, const point &sample) const
Calculates inproduct of face normal and vector sample-face centre.
void findTetFacePt(const label celli, const point &p, label &tetFacei, label &tetPti) const
Find the tetFacei and tetPti for point p in celli.
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
const point_type & point() const noexcept
Return the point, no checks.
void setSamples(const List< point > &samplingPts, const labelList &samplingCells, const labelList &samplingFaces, const labelList &samplingSegments, const scalarList &samplingDistance)
Set sample data. Copy list contents.
labelList cells_
Cell numbers.
Mesh consisting of general polyhedral cells.
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.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
labelList faces_
Face numbers (-1 if not known)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...