45 const scalar surfaceFeatures::parallelTolerance =
sin(
degToRad(1.0));
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()))
76 const linePointRef& line,
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;
145 const List<edgeStatus>& edgeStat,
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);
206void Foam::surfaceFeatures::calcFeatPoints
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)
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);
267void Foam::surfaceFeatures::classifyFeatureAngles
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)
312 surf_[face1].centre(
points)
313 - surf_[face0].centre(
points);
315 if ((f0Tof1 & faceNormals[face0]) >= 0.0)
317 edgeStat[edgeI] = INTERNAL;
321 edgeStat[edgeI] = EXTERNAL;
330Foam::label Foam::surfaceFeatures::nextFeatEdge
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
378Foam::surfaceFeatures::labelScalar Foam::surfaceFeatures::walkSegment
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);
481Foam::surfaceFeatures::surfaceFeatures::checkFlatRegionEdge
484 const scalar includedAngle,
486 const point& leftPoint
491 const edge&
e = surf.edges()[edgeI];
492 const labelList& eFaces = surf.edgeFaces()[edgeI];
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]]];
595 regionAndNormal[i] = t.region()+1;
604 regionAndNormal[i] = -(t.region()+1);
613 const labelledTri& t = surf.localFaces()[eFaces[bin1[i]]];
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)
949 const triSurface& surf,
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];
1029 dynFeatEdges.
insert(surfEdges[sEdge], count++);
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();
1067 surf_(sf.surface()),
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
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]);
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;
1308 const bool removeInside
1311 const edgeList& surfEdges = surf_.edges();
1312 const pointField& surfLocalPoints = surf_.localPoints();
1316 const point eMid = surfEdges[edgei].centre(surfLocalPoints);
1328 List<edgeStatus>& edgeStat,
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()]];
1345 scalar intersect = cutPlane.lineIntersect(line);
1347 point featPoint = intersect * (p1 -
p0) +
p0;
1349 if (!onLine(featPoint, line))
1359 List<edgeStatus>& edgeStat
1364 if (surf_.edgeFaces()[edgei].size() == 1)
1374 List<edgeStatus>& edgeStat
1379 if (surf_.edgeFaces()[edgei].size() > 2)
1391void 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
1497 <<
" of which" <<
nl
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();
1807 label sampleEdgeI = ppTree.
shapes().objectIndex(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);
2026 const auto& treeData = ppTree.
shapes();
2028 const edgeList& surfEdges = surf_.edges();
2029 const pointField& surfLocalPoints = surf_.localPoints();
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;
2069 if (&surf_ != &
rhs.surface())
2072 <<
"Operating on different surfaces"
2076 featurePoints_ =
rhs.featurePoints();
2077 featureEdges_ =
rhs.featureEdges();
2078 externalStart_ =
rhs.externalStart();
2079 internalStart_ =
rhs.internalStart();
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void reserve_exact(const label len)
Reserve allocation space for at least this size, allocating new space if required and retaining old c...
void append(const T &val)
Copy append an element to the end of this list.
Map from edge (expressed as its endpoints) to value. Hashing (and ==) on an edge is symmetric.
Minimal example by using system/controlDict.functions:
const_iterator cfind(const Key &key) const
Find and return an const_iterator set at the hashed entry.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
label size() const noexcept
The number of elements in table.
void clear()
Remove all entries from table.
Input from file stream as an ISstream, normally using std::ifstream for the actual input.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
void setSize(label n)
Alias for resize().
void clear()
Clear the list, i.e. set size to zero.
A HashTable to objects of type <T> with a label key.
Output to file stream as an OSstream, normally using std::ofstream for the actual output.
virtual const fileName & name() const override
Read/write access to the name of the stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
label index() const noexcept
Return the hit index.
bool hit() const noexcept
Is there a hit?
const point_type & point() const noexcept
Return point, no checks.
label nEdges() const
Number of edges in patch.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
const labelListList & edgeFaces() const
Return edge-face addressing.
void size(const label n)
Older name for setAddressableSize.
const Cmpt & x() const noexcept
Access to the vector x component.
const Cmpt & z() const noexcept
Access to the vector z component.
scalar distSqr(const Vector< Cmpt > &v2) const
The L2-norm distance squared from another vector. The magSqr() of the difference.
const Cmpt & y() const noexcept
Access to the vector y component.
void inflate(const scalar factor)
Expand box by factor*mag(span) in all dimensions.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
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,...
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
void write(Ostream &os, const bool subDict=true) const
Write dictionary, normally with sub-dictionary formatting.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
point centre(const UList< point > &pts) const
Return centre point (centroid) of the edge.
scalar mag(const UList< point > &pts) const
The length (L2-norm) of the edge vector.
A class for handling file names.
Non-pointer based hierarchical recursive searching.
const Type & shapes() const noexcept
Reference to shape.
const treeBoundBox & bb() const
Top bounding box.
A triFace with additional (region) index.
PointRef end() const noexcept
The end (second) point.
Point centre() const
Return centre (centroid).
PointRef start() const noexcept
The start (first) point.
Mid-point interpolation (weighting factors = 0.5) scheme class.
Geometric class that creates a 3D plane and can return the intersection point between a line and the ...
scalar lineIntersect(const line< PointType, PointRef > &l) const
Return the cutting point between the plane and a line passing through the supplied points.
Lookup type of boundary radiation properties.
Holds feature edges/points of surface.
void findFeatures(const scalar includedAngle, const bool geometricTestOnly)
Find feature edges using provided included angle.
labelList selectFeatureEdges(const bool regionEdges, const bool externalEdges, const bool internalEdges) const
Helper function: select a subset of featureEdges_.
void excludeNonManifold(List< edgeStatus > &edgeStat) const
Mark edges with >2 connected faces as 'NONE'.
void setFromStatus(const List< edgeStatus > &edgeStat, const scalar includedAngle)
Set from status per edge.
void write(const fileName &fName) const
Write as dictionary to file.
const triSurface & surface() const
void excludeOpen(List< edgeStatus > &edgeStat) const
Mark edges with a single connected face as 'NONE'.
void subsetPlane(List< edgeStatus > &edgeStat, const plane &cutPlane) const
If edge does not intersect the plane, mark as 'NONE'.
label nRegionEdges() const
Return number of region edges.
label nExternalEdges() const
Return number of external edges.
void operator=(const surfaceFeatures &rhs)
void writeObj(const fileName &prefix) const
Write to separate OBJ files (region, external, internal edges,.
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.
List< edgeStatus > toStatus() const
From member feature edges to status per edge.
void subsetBox(List< edgeStatus > &edgeStat, const treeBoundBox &bb) const
Mark edge status outside box as 'NONE'.
@ NONE
Not a classified feature edge.
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.
void deleteBox(List< edgeStatus > &edgeStat, const treeBoundBox &bb, const bool removeInside) const
Mark edge status as 'NONE' for edges inside/outside box.
void writeDict(Ostream &os) const
Write as dictionary.
label internalStart() const
Start of internal edges.
label externalStart() const
Start of external edges.
void writeStats(Ostream &os) const
Write some information.
Map< label > nearestSamples(const labelList &selectedPoints, const pointField &samples, const scalarField &maxDistSqr) const
Find nearest sample for selected surface points.
void nearestFeatEdge(const edgeList &edges, const pointField &points, scalar searchSpanSqr, labelList &edgeLabel) const
Find nearest feature edge to each surface edge. Uses the.
label nInternalEdges() const
Return number of internal edges.
const labelList & featureEdges() const
Return feature edge list.
surfaceFeatures(const triSurface &surf)
Construct from surface.
const labelList & featurePoints() const
Return feature point list.
labelList trimFeatures(const scalar minLen, const label minElems, const scalar includedAngle)
Delete small sets of edges. Edges are stringed up and any.
void excludeBox(List< edgeStatus > &edgeStat, const treeBoundBox &bb) const
Mark edge status inside box as 'NONE'.
Standard boundBox with extra functionality for use in octree.
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
Holds data for octree to work on an edges subset.
Holds (reference to) pointField. Encapsulation of data needed for octree searches....
int edgeDirection(const Foam::edge &e) const
Test the edge direction on the face.
Triangulated surface description with patch information.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const volScalarField & p0
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
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))
Namespace for handling debugging switches.
List< edge > edgeList
List of edge.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< labelList > labelListList
List of labelList.
PointHit< point > pointHit
A PointHit with a 3D point.
List< label > labelList
A List of labels.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sin(const dimensionedScalar &ds)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr scalar degToRad() noexcept
Multiplication factor for degrees to radians conversion.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
line< point, const point & > linePointRef
A line using referred points.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
vectorField pointField
pointField is a vectorField.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensionedScalar cos(const dimensionedScalar &ds)
messageStream Warning
Warning stream (stdout output on master, null elsewhere), with additional 'FOAM Warning' header text.
constexpr char nl
The newline '\n' character (0x0a).
labelList pointLabels(nPoints, -1)
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
Unit conversion functions.
scalarField samples(nIntervals, Zero)