Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
004a1a8c
Commit
004a1a8c
authored
Nov 19, 2009
by
mattijs
Browse files
added triangulate argument
parent
dcc53875
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/sampling/cuttingPlane/cuttingPlane.C
View file @
004a1a8c
...
...
@@ -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
);
}
...
...
src/sampling/cuttingPlane/cuttingPlane.H
View file @
004a1a8c
...
...
@@ -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
()
);
...
...
src/sampling/sampledSurface/sampledPlane/sampledPlane.C
View file @
004a1a8c
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment