mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
added triangulate argument
This commit is contained in:
@ -258,6 +258,7 @@ bool Foam::cuttingPlane::walkCell
|
||||
void Foam::cuttingPlane::walkCellCuts
|
||||
(
|
||||
const primitiveMesh& mesh,
|
||||
const bool triangulate,
|
||||
const UList<label>& edgePoint
|
||||
)
|
||||
{
|
||||
@ -293,7 +294,7 @@ void Foam::cuttingPlane::walkCellCuts
|
||||
// Check for the unexpected ...
|
||||
if (startEdgeI == -1)
|
||||
{
|
||||
FatalErrorIn("Foam::cuttingPlane::walkCellCuts")
|
||||
FatalErrorIn("Foam::cuttingPlane::walkCellCuts(..)")
|
||||
<< "Cannot find cut edge for cut cell " << cellI
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -318,10 +319,18 @@ void Foam::cuttingPlane::walkCellCuts
|
||||
f = f.reverseFace();
|
||||
}
|
||||
|
||||
// the cut faces are usually quite ugly, so always triangulate
|
||||
label nTri = f.triangles(cutPoints, dynCutFaces);
|
||||
while (nTri--)
|
||||
// the cut faces are usually quite ugly, so optionally triangulate
|
||||
if (triangulate)
|
||||
{
|
||||
label nTri = f.triangles(cutPoints, dynCutFaces);
|
||||
while (nTri--)
|
||||
{
|
||||
dynCutCells.append(cellI);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dynCutFaces.append(f);
|
||||
dynCutCells.append(cellI);
|
||||
}
|
||||
}
|
||||
@ -346,12 +355,13 @@ Foam::cuttingPlane::cuttingPlane
|
||||
(
|
||||
const plane& pln,
|
||||
const primitiveMesh& mesh,
|
||||
const bool triangulate,
|
||||
const UList<label>& cellIdLabels
|
||||
)
|
||||
:
|
||||
plane(pln)
|
||||
{
|
||||
reCut(mesh, cellIdLabels);
|
||||
reCut(mesh, triangulate, cellIdLabels);
|
||||
}
|
||||
|
||||
|
||||
@ -362,6 +372,7 @@ Foam::cuttingPlane::cuttingPlane
|
||||
void Foam::cuttingPlane::reCut
|
||||
(
|
||||
const primitiveMesh& mesh,
|
||||
const bool triangulate,
|
||||
const UList<label>& cellIdLabels
|
||||
)
|
||||
{
|
||||
@ -379,7 +390,7 @@ void Foam::cuttingPlane::reCut
|
||||
intersectEdges(mesh, dotProducts, edgePoint);
|
||||
|
||||
// Do topological walk around cell to find closed loop.
|
||||
walkCellCuts(mesh, edgePoint);
|
||||
walkCellCuts(mesh, triangulate, edgePoint);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -105,6 +105,7 @@ class cuttingPlane
|
||||
void walkCellCuts
|
||||
(
|
||||
const primitiveMesh& mesh,
|
||||
const bool triangulate,
|
||||
const UList<label>& edgePoint
|
||||
);
|
||||
|
||||
@ -122,6 +123,7 @@ protected:
|
||||
void reCut
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const bool triangulate,
|
||||
const UList<label>& cellIdLabels = UList<label>::null()
|
||||
);
|
||||
|
||||
@ -138,6 +140,7 @@ public:
|
||||
(
|
||||
const plane&,
|
||||
const primitiveMesh&,
|
||||
const bool triangulate,
|
||||
const UList<label>& cellIdLabels = UList<label>::null()
|
||||
);
|
||||
|
||||
|
||||
@ -150,11 +150,11 @@ bool Foam::sampledPlane::update()
|
||||
|
||||
if (zoneId < 0)
|
||||
{
|
||||
reCut(mesh());
|
||||
reCut(mesh(), true); // always triangulate. Note:Make option?
|
||||
}
|
||||
else
|
||||
{
|
||||
reCut(mesh(), mesh().cellZones()[zoneId]);
|
||||
reCut(mesh(), true, mesh().cellZones()[zoneId]);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
|
||||
Reference in New Issue
Block a user