Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
dumux-repositories
dumux
Commits
6e512196
Commit
6e512196
authored
3 years ago
by
Timo Koch
Committed by
Kilian Weishaupt
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[distance] Precompute distance p->a
parent
8bb64a6f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2723
[distance] Precompute distance p->a
Pipeline
#6229
waiting for manual action
Stage: trigger
Stage: downstream modules
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/geometry/distance.hh
+3
-2
3 additions, 2 deletions
dumux/geometry/distance.hh
with
3 additions
and
2 deletions
dumux/geometry/distance.hh
+
3
−
2
View file @
6e512196
...
@@ -84,10 +84,11 @@ inline typename Point::value_type
...
@@ -84,10 +84,11 @@ inline typename Point::value_type
distancePointSegment
(
const
Point
&
p
,
const
Point
&
a
,
const
Point
&
b
)
distancePointSegment
(
const
Point
&
p
,
const
Point
&
a
,
const
Point
&
b
)
{
{
const
auto
ab
=
b
-
a
;
const
auto
ab
=
b
-
a
;
auto
t
=
(
p
-
a
)
*
ab
;
const
auto
ap
=
p
-
a
;
const
auto
t
=
ap
*
ab
;
if
(
t
<=
0.0
)
if
(
t
<=
0.0
)
return
(
a
-
p
)
.
two_norm
();
return
ap
.
two_norm
();
const
auto
lengthSq
=
ab
.
two_norm2
();
const
auto
lengthSq
=
ab
.
two_norm2
();
if
(
t
>=
lengthSq
)
if
(
t
>=
lengthSq
)
...
...
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