Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
e6437d63
Commit
e6437d63
authored
Nov 02, 2021
by
Timo Koch
Browse files
[geom][2d-2d-in-3d] Compute epsilons when they are needed
parent
57f85464
Changes
1
Hide whitespace changes
Inline
Side-by-side
dumux/geometry/geometryintersection.hh
View file @
e6437d63
...
...
@@ -877,15 +877,13 @@ public:
const
auto
b2
=
geo2
.
corner
(
2
)
-
geo2
.
corner
(
0
);
const
auto
n2
=
crossProduct
(
a2
,
b2
);
using
std
::
max
;
using
std
::
sqrt
;
// compute an epsilon scaled with larger edge length
const
auto
a1Norm2
=
a1
.
two_norm2
();
const
auto
b1Norm2
=
b1
.
two_norm2
();
using
std
::
max
;
const
auto
maxNorm2
=
max
(
a1Norm2
,
b1Norm2
);
const
auto
maxNorm
=
sqrt
(
maxNorm2
);
const
auto
eps2
=
maxNorm2
*
eps_
;
const
auto
eps
=
maxNorm
*
eps_
;
const
auto
eps3
=
maxNorm
*
eps2
;
// early exit if polygons are not parallel
using
std
::
abs
;
...
...
@@ -897,6 +895,10 @@ public:
if
(
d1
.
two_norm2
()
<
eps2
)
d1
=
geo2
.
corner
(
1
)
-
geo1
.
corner
(
0
);
using
std
::
sqrt
;
const
auto
maxNorm
=
sqrt
(
maxNorm2
);
const
auto
eps3
=
maxNorm
*
eps2
;
if
(
abs
(
d1
*
n2
)
>
eps3
)
return
false
;
...
...
@@ -961,6 +963,7 @@ public:
return
false
;
// remove duplicates
const
auto
eps
=
maxNorm
*
eps_
;
std
::
sort
(
points
.
begin
(),
points
.
end
(),
[
eps
]
(
const
auto
&
a
,
const
auto
&
b
)
->
bool
{
using
std
::
abs
;
...
...
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