45 const scalar surfaceFeatures::parallelTolerance =
sin(
degToRad(1.0));
52 const point& a = line.start();
53 const point&
b = line.end();
57 (
p.x() <
min(a.x(),
b.x()) ||
p.x() >
max(a.x(),
b.x()))
58 || (
p.y() <
min(a.y(),
b.y()) ||
p.y() >
max(a.y(),
b.y()))
59 || (
p.z() <
min(a.z(),
b.z()) ||
p.z() >
max(a.z(),
b.z()))
80 pointHit eHit = line.nearestDist(sample);
98 eHit.point().distSqr(line.start())
99 < eHit.point().distSqr(line.end())
118 List<edgeStatus> edgeStat(surf_.nEdges(), NONE);
121 for (label i = 0; i < externalStart_; i++)
123 edgeStat[featureEdges_[i]] = REGION;
127 for (label i = externalStart_; i < internalStart_; i++)
129 edgeStat[featureEdges_[i]] = EXTERNAL;
133 for (label i = internalStart_; i < featureEdges_.size(); i++)
135 edgeStat[featureEdges_[i]] = INTERNAL;
146 const scalar includedAngle
157 if (edgeStat[edgeI] == REGION)
161 else if (edgeStat[edgeI] == EXTERNAL)
165 else if (edgeStat[edgeI] == INTERNAL)
171 externalStart_ = nRegion;
172 internalStart_ = externalStart_ + nExternal;
177 featureEdges_.setSize(internalStart_ + nInternal);
180 label externalI = externalStart_;
181 label internalI = internalStart_;
185 if (edgeStat[edgeI] == REGION)
187 featureEdges_[regionI++] = edgeI;
189 else if (edgeStat[edgeI] == EXTERNAL)
191 featureEdges_[externalI++] = edgeI;
193 else if (edgeStat[edgeI] == INTERNAL)
195 featureEdges_[internalI++] = edgeI;
201 calcFeatPoints(edgeStat, minCos);
206 void Foam::surfaceFeatures::calcFeatPoints
208 const List<edgeStatus>& edgeStat,
212 DynamicList<label> featurePoints(surf_.nPoints()/1000);
215 const edgeList& edges = surf_.edges();
216 const pointField& localPoints = surf_.localPoints();
218 forAll(pointEdges, pointi)
220 const labelList& pEdges = pointEdges[pointi];
222 label nFeatEdges = 0;
226 if (edgeStat[pEdges[i]] != NONE)
234 featurePoints.
append(pointi);
236 else if (nFeatEdges == 2)
239 DynamicList<vector> edgeVecs(2);
243 const label edgeI = pEdges[i];
245 if (edgeStat[edgeI] != NONE)
247 vector vec = edges[edgeI].vec(localPoints);
248 scalar magVec =
mag(vec);
251 edgeVecs.append(vec/magVec);
256 if (edgeVecs.size() == 2 &&
mag(edgeVecs[0] & edgeVecs[1]) < minCos)
258 featurePoints.
append(pointi);
263 featurePoints_.transfer(featurePoints);
267 void Foam::surfaceFeatures::classifyFeatureAngles
270 List<edgeStatus>& edgeStat,
272 const bool geometricTestOnly
275 const vectorField& faceNormals = surf_.faceNormals();
279 bool selectAll = (
mag(minCos-1.0) < SMALL);
283 const labelList& eFaces = edgeFaces[edgeI];
285 if (eFaces.size() != 2)
288 edgeStat[edgeI] = REGION;
292 label face0 = eFaces[0];
293 label face1 = eFaces[1];
298 && surf_[face0].region() != surf_[face1].region()
301 edgeStat[edgeI] = REGION;
306 || ((faceNormals[face0] & faceNormals[face1]) < minCos)
315 if ((f0Tof1 & faceNormals[face0]) >= 0.0)
317 edgeStat[edgeI] = INTERNAL;
321 edgeStat[edgeI] = EXTERNAL;
330 Foam::label Foam::surfaceFeatures::nextFeatEdge
332 const List<edgeStatus>& edgeStat,
334 const label unsetVal,
335 const label prevEdgeI,
339 const labelList& pEdges = surf_.pointEdges()[vertI];
341 label nextEdgeI = -1;
345 label edgeI = pEdges[i];
350 && edgeStat[edgeI] != NONE
351 && featVisited[edgeI] == unsetVal
378 Foam::surfaceFeatures::labelScalar Foam::surfaceFeatures::walkSegment
381 const List<edgeStatus>& edgeStat,
382 const label startEdgeI,
383 const label startPointi,
384 const label currentFeatI,
388 label edgeI = startEdgeI;
390 label vertI = startPointi;
392 scalar visitedLength = 0.0;
396 if (featurePoints_.found(startPointi))
400 return labelScalar(nVisited, visitedLength);
420 unsetVal = currentFeatI;
426 edgeI = nextFeatEdge(edgeStat, featVisited, unsetVal, edgeI, vertI);
428 if (edgeI == -1 || edgeI == startEdgeI)
437 featVisited[edgeI] = currentFeatI;
441 featVisited[edgeI] = -2;
446 const edge&
e = surf_.edges()[edgeI];
448 vertI =
e.otherVertex(vertI);
452 visitedLength +=
e.mag(surf_.localPoints());
456 if (nVisited > surf_.nEdges())
458 Warning<<
"walkSegment : reached iteration limit in walking " 459 <<
"feature edges on surface from edge:" << startEdgeI
460 <<
" vertex:" << startPointi <<
nl 461 <<
"Returning with large length" <<
endl;
463 return labelScalar(nVisited, GREAT);
468 return labelScalar(nVisited, visitedLength);
481 Foam::surfaceFeatures::surfaceFeatures::checkFlatRegionEdge
484 const scalar includedAngle,
486 const point& leftPoint
489 const triSurface& surf = surf_;
491 const edge&
e = surf.edges()[edgeI];
492 const labelList& eFaces = surf.edgeFaces()[edgeI];
496 DynamicList<vector> normals(2);
497 DynamicList<labelList> bins(2);
501 const vector&
n = surf.faceNormals()[eFaces[eFacei]];
507 if (
mag(
n & normals[normalI]) > (1-tol))
516 bins[index].append(eFacei);
518 else if (normals.size() >= 2)
536 if (bins.size() == 1)
558 if (includedAngle >= 0)
564 const vector& ni = surf.faceNormals()[eFaces[i]];
565 for (label j=i+1; j<eFaces.size(); j++)
567 const vector& nj = surf.faceNormals()[eFaces[j]];
568 if (
mag(ni & nj) < minCos)
590 const labelledTri& t = surf.localFaces()[eFaces[bin0[i]]];
591 const auto dir = t.edgeDirection(
e);
595 regionAndNormal[i] = t.region()+1;
604 regionAndNormal[i] = -(t.region()+1);
613 const labelledTri& t = surf.localFaces()[eFaces[bin1[i]]];
614 const auto dir = t.edgeDirection(
e);
616 label myRegionAndNormal;
619 myRegionAndNormal = t.region()+1;
623 myRegionAndNormal = -(t.region()+1);
626 regionAndNormal1[i] = myRegionAndNormal;
628 label index = regionAndNormal.find(-myRegionAndNormal);
910 const label externalStart,
911 const label internalStart
915 featurePoints_(featurePoints),
916 featureEdges_(featureEdges),
917 externalStart_(externalStart),
918 internalStart_(externalStart)
926 const scalar includedAngle,
928 const label minElems,
929 const bool geometricTestOnly
940 if (minLen > 0 || minElems > 0)
954 featurePoints_(featInfoDict.
lookup(
"featurePoints")),
955 featureEdges_(featInfoDict.
lookup(
"featureEdges")),
956 externalStart_(featInfoDict.
get<label>(
"externalStart")),
957 internalStart_(featInfoDict.
get<label>(
"internalStart"))
977 featInfoDict.
readEntry(
"featureEdges", featureEdges_);
978 featInfoDict.
readEntry(
"featurePoints", featurePoints_);
979 featInfoDict.
readEntry(
"externalStart", externalStart_);
980 featInfoDict.
readEntry(
"internalStart", internalStart_);
989 const scalar mergeTol,
990 const bool geometricTestOnly
1004 scalar mergeTolSqr =
sqr(mergeTol);
1020 forAll(edgeLabel, sEdgeI)
1022 const label sEdge = edgeLabel[sEdgeI];
1030 dynFeatureEdgeFaces.append(surfEdgeFaces[sEdge]);
1034 List<edgeStatus> edgeStat(dynFeatEdges.size(),
NONE);
1036 classifyFeatureAngles
1038 dynFeatureEdgeFaces,
1046 List<edgeStatus> allEdgeStat(surf_.
nEdges(),
NONE);
1050 const auto iter = dynFeatEdges.cfind(surfEdges[eI]);
1054 allEdgeStat[eI] = edgeStat[iter.val()];
1059 dynFeatEdges.clear();
1068 featurePoints_(sf.featurePoints()),
1069 featureEdges_(sf.featureEdges()),
1070 externalStart_(sf.externalStart()),
1071 internalStart_(sf.internalStart())
1079 const bool regionEdges,
1080 const bool externalEdges,
1081 const bool internalEdges
1090 if (regionEdges)
count += nRegionEdges();
1091 if (externalEdges)
count += nExternalEdges();
1092 if (internalEdges)
count += nInternalEdges();
1099 for (label i = 0; i < externalStart_; i++)
1101 selectedEdges.
append(featureEdges_[i]);
1107 for (label i = externalStart_; i < internalStart_; i++)
1109 selectedEdges.
append(featureEdges_[i]);
1115 for (label i = internalStart_; i < featureEdges_.size(); i++)
1117 selectedEdges.
append(featureEdges_[i]);
1121 return labelList(std::move(selectedEdges));
1127 const scalar includedAngle,
1128 const bool geometricTestOnly
1136 classifyFeatureAngles
1144 setFromStatus(edgeStat, includedAngle);
1152 const scalar minLen,
1153 const label minElems,
1154 const scalar includedAngle
1165 labelList featLines(surf_.nEdges(), -1);
1171 label startEdgeI = 0;
1176 for (; startEdgeI < edgeStat.
size(); startEdgeI++)
1180 edgeStat[startEdgeI] != NONE
1181 && featLines[startEdgeI] == -1
1189 if (startEdgeI == edgeStat.
size())
1196 featLines[startEdgeI] = featI;
1198 const edge& startEdge = surf_.edges()[startEdgeI];
1201 labelScalar leftPath =
1212 labelScalar rightPath =
1228 + startEdge.
mag(surf_.localPoints())
1231 || (leftPath.n_ + rightPath.n_ + 1 < minElems)
1237 featLines[startEdgeI] = -2;
1269 label edgeI = featureEdges_[i];
1271 if (featLines[edgeI] == -2)
1273 edgeStat[edgeI] = NONE;
1278 setFromStatus(edgeStat, includedAngle);
1290 deleteBox(edgeStat, bb,
true);
1300 deleteBox(edgeStat, bb,
false);
1308 const bool removeInside
1311 const edgeList& surfEdges = surf_.edges();
1312 const pointField& surfLocalPoints = surf_.localPoints();
1316 const point eMid = surfEdges[edgei].centre(surfLocalPoints);
1329 const plane& cutPlane
1332 const edgeList& surfEdges = surf_.edges();
1334 const labelList& meshPoints = surf_.meshPoints();
1338 const edge&
e = surfEdges[edgei];
1341 const point& p1 =
pts[meshPoints[
e.end()]];
1347 point featPoint = intersect * (p1 -
p0) +
p0;
1349 if (!onLine(featPoint,
line))
1364 if (surf_.edgeFaces()[edgei].size() == 1)
1379 if (surf_.edgeFaces()[edgei].size() > 2)
1391 void Foam::surfaceFeatures::checkFlatRegionEdge
1395 const scalar includedAngle
1402 const labelList& eFaces = surf_.edgeFaces()[edgei];
1404 if (eFaces.
size() > 2 && (eFaces.
size() % 2) == 0)
1406 const point& leftPoint = surf_.faceCentres()[eFaces[0]];
1408 edgeStat[edgei] = checkFlatRegionEdge
1424 featInfoDict.
add(
"externalStart", externalStart_);
1425 featInfoDict.
add(
"internalStart", internalStart_);
1426 featInfoDict.
add(
"featureEdges", featureEdges_);
1427 featInfoDict.
add(
"featurePoints", featurePoints_);
1442 OFstream regionStr(prefix +
"_regionEdges.obj");
1443 Pout<<
"Writing region edges to " << regionStr.
name() <<
endl;
1446 for (label i = 0; i < externalStart_; i++)
1448 const edge&
e = surf_.edges()[featureEdges_[i]];
1452 regionStr <<
"l " << verti-1 <<
' ' << verti <<
endl;
1456 OFstream externalStr(prefix +
"_externalEdges.obj");
1457 Pout<<
"Writing external edges to " << externalStr.
name() <<
endl;
1460 for (label i = externalStart_; i < internalStart_; i++)
1462 const edge&
e = surf_.edges()[featureEdges_[i]];
1466 externalStr <<
"l " << verti-1 <<
' ' << verti <<
endl;
1469 OFstream internalStr(prefix +
"_internalEdges.obj");
1470 Pout<<
"Writing internal edges to " << internalStr.
name() <<
endl;
1473 for (label i = internalStart_; i < featureEdges_.size(); i++)
1475 const edge&
e = surf_.edges()[featureEdges_[i]];
1479 internalStr <<
"l " << verti-1 <<
' ' << verti <<
endl;
1482 OFstream pointStr(prefix +
"_points.obj");
1483 Pout<<
"Writing feature points to " << pointStr.
name() <<
endl;
1485 for (
const label pointi : featurePoints_)
1494 os <<
"Feature set:" <<
nl 1495 <<
" points : " << this->featurePoints().
size() <<
nl 1496 <<
" edges : " << this->featureEdges().
size() <<
nl 1497 <<
" of which" <<
nl 1498 <<
" region edges : " << this->nRegionEdges() <<
nl 1499 <<
" external edges : " << this->nExternalEdges() <<
nl 1500 <<
" internal edges : " << this->nInternalEdges() <<
endl;
1525 const auto& treeData = ppTree.
shapes();
1530 const pointField& surfPoints = surf_.localPoints();
1536 const point& surfPt = surfPoints[surfPointi];
1547 <<
"Problem for point " 1548 << surfPointi <<
" in tree " << ppTree.
bb()
1552 label sampleI = info.
index();
1554 if (treeData.centre(sampleI).distSqr(surfPt) < maxDistSqr[sampleI])
1556 nearest.insert(sampleI, surfPointi);
1567 Pout<<
"Dumping nearest surface feature points to nearestSamples.obj" 1570 OFstream objStream(
"nearestSamples.obj");
1577 objStream<<
"l " << vertI-1 <<
' ' << vertI <<
endl;
1593 const scalar minSampleDist
1596 const pointField& surfPoints = surf_.localPoints();
1597 const edgeList& surfEdges = surf_.edges();
1599 scalar maxSearchSqr =
max(maxDistSqr);
1618 label surfEdgeI = selectedEdges[i];
1620 const edge&
e = surfEdges[surfEdgeI];
1622 if (
debug && (i % 1000) == 0)
1624 Pout<<
"looking at surface feature edge " << surfEdgeI
1625 <<
" verts:" <<
e <<
" points:" << surfPoints[
e[0]]
1626 <<
' ' << surfPoints[
e[1]] <<
endl;
1630 vector eVec =
e.vec(surfPoints);
1631 scalar eMag =
mag(eVec);
1646 point edgePoint(surfPoints[
e.start()] +
s*eVec);
1660 label sampleI = info.index();
1662 if (info.point().distSqr(edgePoint) < maxDistSqr[sampleI])
1664 nearest.insert(sampleI, surfEdgeI);
1674 s +=
max(minSampleDist*eMag, sampleDist[sampleI]);
1676 if (
s >= (1-minSampleDist)*eMag)
1691 Pout<<
"Dumping nearest surface edges to nearestEdges.obj" 1694 OFstream objStream(
"nearestEdges.obj");
1699 const label sampleI = iter.key();
1701 const edge&
e = surfEdges[iter.val()];
1706 e.line(surfPoints).nearestDist(
samples[sampleI]).point();
1710 objStream<<
"l " << vertI-1 <<
' ' << vertI <<
endl;
1731 const scalar minSampleDist
1749 const pointField& surfPoints = surf_.localPoints();
1750 const edgeList& surfEdges = surf_.edges();
1752 scalar maxSearchSqr =
max(maxDistSqr);
1763 label surfEdgeI = selectedEdges[i];
1765 const edge&
e = surfEdges[surfEdgeI];
1767 if (
debug && (i % 1000) == 0)
1769 Pout<<
"looking at surface feature edge " << surfEdgeI
1770 <<
" verts:" <<
e <<
" points:" << surfPoints[
e[0]]
1771 <<
' ' << surfPoints[
e[1]] <<
endl;
1775 vector eVec =
e.vec(surfPoints);
1776 scalar eMag =
mag(eVec);
1791 point edgePoint(surfPoints[
e.start()] +
s*eVec);
1805 label index = info.index();
1809 const edge&
e = sampleEdges[sampleEdgeI];
1811 if (info.point().distSqr(edgePoint) < maxDistSqr[
e.start()])
1830 if (
s >= (1-minSampleDist)*eMag)
1844 Pout<<
"Dumping nearest surface feature edges to nearestEdges.obj" 1847 OFstream objStream(
"nearestEdges.obj");
1852 const label sampleEdgeI = iter.key();
1854 const edge& sampleEdge = sampleEdges[sampleEdgeI];
1863 objStream<<
"l " << vertI-1 <<
' ' << vertI <<
endl;
1877 scalar searchSpanSqr,
1887 const pointField& localPoints = surf_.localPoints();
1905 const auto& treeData = ppTree.
shapes();
1926 treeData.line(info.
index()),
1930 edgeLabel[i] = treeData.objectIndex(info.
index());
1931 edgePoint[i] = pHit.
point();
1932 edgeEndPoint[i] = pHit.
index();
1947 const vector& searchSpan,
1955 pointOnFeature.
setSize(selectedSampleEdges.
size());
1964 surf_.localPoints(),
1972 const auto& treeData = ppTree.shapes();
1974 forAll(selectedSampleEdges, i)
1976 const edge&
e = sampleEdges[selectedSampleEdges[i]];
1982 treeBoundBox tightest(eMid - searchSpan, eMid + searchSpan);
1997 edgeLabel[i] = treeData.objectIndex(info.
index());
1998 pointOnFeature[i] = info.
point();
2008 scalar searchSpanSqr,
2012 edgeLabel =
labelList(surf_.nEdges(), -1);
2015 searchDomain.inflate(0.1);
2026 const auto& treeData = ppTree.
shapes();
2028 const edgeList& surfEdges = surf_.edges();
2029 const pointField& surfLocalPoints = surf_.localPoints();
2033 const edge& sample = surfEdges[edgeI];
2035 const point& startPoint = surfLocalPoints[sample.
start()];
2048 const vector featEdgeDir = treeData.line(infoMid.
index()).vec();
2051 if (
mag(surfEdgeDir ^ featEdgeDir) < parallelTolerance)
2053 edgeLabel[edgeI] = edgeI;
2072 <<
"Operating on different surfaces" List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
void size(const label n)
Older name for setAddressableSize.
A class for handling file names.
Holds (reference to) pointField. Encapsulation of data needed for octree searches. Used for searching for nearest point. No bounding boxes around points. Only overlaps and calcNearest are implemented, rest makes little sense.
void deleteBox(List< edgeStatus > &edgeStat, const treeBoundBox &bb, const bool removeInside) const
Mark edge status as 'NONE' for edges inside/outside box.
scalar mag(const UList< point > &pts) const
The length (L2-norm) of the edge vector.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
labelList pointLabels(nPoints, -1)
void write(const fileName &fName) const
Write as dictionary to file.
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...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void append(const T &val)
Append an element at the end of the list.
const Type & shapes() const noexcept
Reference to shape.
List< edge > edgeList
List of edge.
virtual const fileName & name() const override
Read/write access to the name of the stream.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void inflate(const scalar factor)
Expand box by factor*mag(span) in all dimensions.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Unit conversion functions.
Output to file stream as an OSstream, normally using std::ofstream for the actual output...
constexpr char nl
The newline '\n' character (0x0a)
scalarField samples(nIntervals, Zero)
Ostream & endl(Ostream &os)
Add newline and flush stream.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
Holds data for octree to work on an edges subset.
label externalStart() const
Start of external edges.
Map< label > nearestSamples(const labelList &selectedPoints, const pointField &samples, const scalarField &maxDistSqr) const
Find nearest sample for selected surface points.
void subsetBox(List< edgeStatus > &edgeStat, const treeBoundBox &bb) const
Mark edge status outside box as 'NONE'.
Map< pointIndexHit > nearestEdges(const labelList &selectedEdges, const edgeList &sampleEdges, const labelList &selectedSampleEdges, const pointField &samplePoints, const scalarField &sampleDist, const scalarField &maxDistSqr, const scalar minSampleDist=0.1) const
Like nearestSamples but now gets nearest point on.
This class describes the interaction of an object (often a face) and a point. It carries the info of ...
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
const labelList & featureEdges() const
Return feature edge list.
Geometric class that creates a 3D plane and can return the intersection point between a line and the ...
label objectIndex(const label index) const
Map from shape index to original (non-subset) edge label.
Lookup type of boundary radiation properties.
List< labelList > labelListList
List of labelList.
void writeObj(const fileName &prefix) const
Write to separate OBJ files (region, external, internal edges,.
scalar lineIntersect(const line< PointType, PointRef > &l) const
Return the cutting point between the plane and a line passing through the supplied points...
labelList selectFeatureEdges(const bool regionEdges, const bool externalEdges, const bool internalEdges) const
Helper function: select a subset of featureEdges_.
#define forAll(list, i)
Loop across all elements in list.
void excludeNonManifold(List< edgeStatus > &edgeStat) const
Mark edges with >2 connected faces as 'NONE'.
List< edgeStatus > toStatus() const
From member feature edges to status per edge.
bool insert(const edge &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
label start() const noexcept
The start (first) vertex label.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect...
Not a classified feature edge.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
const point_type & point() const noexcept
Return point, no checks.
labelList trimFeatures(const scalar minLen, const label minElems, const scalar includedAngle)
Delete small sets of edges. Edges are stringed up and any.
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
void setSize(const label n)
Alias for resize()
dimensionedScalar cos(const dimensionedScalar &ds)
line< point, const point & > linePointRef
A line using referred points.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Mid-point interpolation (weighting factors = 0.5) scheme class.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
void setFromStatus(const List< edgeStatus > &edgeStat, const scalar includedAngle)
Set from status per edge.
void operator=(const surfaceFeatures &rhs)
void writeStats(Ostream &os) const
Write some information.
const triSurface & surface() const
void excludeBox(List< edgeStatus > &edgeStat, const treeBoundBox &bb) const
Mark edge status inside box as 'NONE'.
const labelListList & edgeFaces() const
Return edge-face addressing.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
void append(const T &val)
Copy append an element to the end of this list.
const treeBoundBox & bb() const
Top bounding box.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
label index() const noexcept
Return the hit index.
errorManip< error > abort(error &err)
const wordList surface
Standard surface field types (scalar, vector, tensor, etc)
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
dimensionedScalar sin(const dimensionedScalar &ds)
label nEdges() const
Number of edges in patch.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
int debug
Static debugging option.
const labelList & featurePoints() const
Return feature point list.
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
Input from file stream as an ISstream, normally using std::ifstream for the actual input...
const Vector< Cmpt > & centre(const Foam::UList< Vector< Cmpt >> &) const noexcept
Return this (for point which is a typedef to Vector<scalar>)
messageStream Warning
Warning stream (stdout output on master, null elsewhere), with additional 'FOAM Warning' header text...
Point centre() const
Return centre (centroid)
void subsetPlane(List< edgeStatus > &edgeStat, const plane &cutPlane) const
If edge does not intersect the plane, mark as 'NONE'.
void write(Ostream &os, const bool subDict=true) const
Write dictionary, normally with sub-dictionary formatting.
bool hit() const noexcept
Is there a hit?
vector point
Point is a vector.
Non-pointer based hierarchical recursive searching.
void findFeatures(const scalar includedAngle, const bool geometricTestOnly)
Find feature edges using provided included angle.
void nearestSurfEdge(const labelList &selectedEdges, const pointField &samples, scalar searchSpanSqr, labelList &edgeLabel, labelList &edgeEndPoint, pointField &edgePoint) const
Find nearest surface edge (out of selectedEdges) for.
surfaceFeatures(const triSurface &surf)
Construct from surface.
void excludeOpen(List< edgeStatus > &edgeStat) const
Mark edges with a single connected face as 'NONE'.
void nearestFeatEdge(const edgeList &edges, const pointField &points, scalar searchSpanSqr, labelList &edgeLabel) const
Find nearest feature edge to each surface edge. Uses the.
point centre(const UList< point > &pts) const
Return centre point (centroid) of the edge.
Standard boundBox with extra functionality for use in octree.
void writeDict(Ostream &os) const
Write as dictionary.
void reserve_exact(const label len)
Reserve allocation space for at least this size, allocating new space if required and retaining old c...
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< label > labelList
A List of labels.
label internalStart() const
Start of internal edges.
Triangulated surface description with patch information.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
const volScalarField & p0
Holds feature edges/points of surface.
PointHit< point > pointHit
A PointHit with a 3D point.
forAllConstIters(mixture.phases(), phase)
A HashTable to objects of type <T> with a label key.