Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
e2d12e73
Commit
e2d12e73
authored
16 years ago
by
Mark Olesen
Browse files
Options
Downloads
Patches
Plain Diff
cuttingPlane : handle cutting planes that coincide with a mesh face
parent
a7d1ef36
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sampling/cuttingPlane/cuttingPlane.C
+26
-5
26 additions, 5 deletions
src/sampling/cuttingPlane/cuttingPlane.C
src/sampling/cuttingPlane/cuttingPlane.H
+4
-0
4 additions, 0 deletions
src/sampling/cuttingPlane/cuttingPlane.H
with
30 additions
and
5 deletions
src/sampling/cuttingPlane/cuttingPlane.C
+
26
−
5
View file @
e2d12e73
...
...
@@ -29,6 +29,15 @@ License
#include
"linePointRef.H"
#include
"meshTools.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// set values for what is close to zero and what is considered to
// be positive (and not just rounding noise)
//! @cond localScope
const
Foam
::
scalar
zeroish
=
Foam
::
SMALL
;
const
Foam
::
scalar
positive
=
Foam
::
SMALL
*
1E3
;
//! @endcond localScope
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Find cut cells
...
...
@@ -71,8 +80,8 @@ void Foam::cuttingPlane::calcCutCells
if
(
(
dotProducts
[
e
[
0
]]
<
0
&&
dotProducts
[
e
[
1
]]
>
0
)
||
(
dotProducts
[
e
[
1
]]
<
0
&&
dotProducts
[
e
[
0
]]
>
0
)
(
dotProducts
[
e
[
0
]]
<
zeroish
&&
dotProducts
[
e
[
1
]]
>
positive
)
||
(
dotProducts
[
e
[
1
]]
<
zeroish
&&
dotProducts
[
e
[
0
]]
>
positive
)
)
{
nCutEdges
++
;
...
...
@@ -116,8 +125,8 @@ Foam::labelList Foam::cuttingPlane::intersectEdges
if
(
(
dotProducts
[
e
[
0
]]
<
0
&&
dotProducts
[
e
[
1
]]
>
0
)
||
(
dotProducts
[
e
[
1
]]
<
0
&&
dotProducts
[
e
[
0
]]
>
0
)
(
dotProducts
[
e
[
0
]]
<
zeroish
&&
dotProducts
[
e
[
1
]]
>
positive
)
||
(
dotProducts
[
e
[
1
]]
<
zeroish
&&
dotProducts
[
e
[
0
]]
>
positive
)
)
{
// Edge is cut.
...
...
@@ -126,7 +135,19 @@ Foam::labelList Foam::cuttingPlane::intersectEdges
scalar
alpha
=
lineIntersect
(
linePointRef
(
p0
,
p1
));
dynCuttingPoints
.
append
((
1
-
alpha
)
*
p0
+
alpha
*
p1
);
if
(
alpha
<
zeroish
)
{
dynCuttingPoints
.
append
(
p0
);
}
else
if
(
alpha
>
1
.
0
)
{
dynCuttingPoints
.
append
(
p1
);
}
else
{
dynCuttingPoints
.
append
((
1
-
alpha
)
*
p0
+
alpha
*
p1
);
}
edgePoint
[
edgeI
]
=
dynCuttingPoints
.
size
()
-
1
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/sampling/cuttingPlane/cuttingPlane.H
+
4
−
0
View file @
e2d12e73
...
...
@@ -30,6 +30,10 @@ Description
No attempt at resolving degenerate cases.
Note
When the cutting plane coincides with a mesh face, the cell edge on the
positive side of the plane is taken.
SourceFiles
cuttingPlane.C
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment