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
a8370118
Commit
a8370118
authored
4 years ago
by
Dennis Gläser
Browse files
Options
Downloads
Patches
Plain Diff
[geometry][distance] add specializations for 1d-0d computations
parent
afbd717a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2192
[geometry] Add header for distance helper functions
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/common/geometry/distance.hh
+23
-5
23 additions, 5 deletions
dumux/common/geometry/distance.hh
with
23 additions
and
5 deletions
dumux/common/geometry/distance.hh
+
23
−
5
View file @
a8370118
...
@@ -127,7 +127,7 @@ namespace Detail {
...
@@ -127,7 +127,7 @@ namespace Detail {
// helper struct to compute distance between two geometries, specialized below
// helper struct to compute distance between two geometries, specialized below
template
<
class
Geo1
,
class
Geo2
,
template
<
class
Geo1
,
class
Geo2
,
int
dim
w
orld
=
Geo1
::
coorddimension
,
int
dim
W
orld
=
Geo1
::
coorddimension
,
int
dim1
=
Geo1
::
mydimension
,
int
dim2
=
Geo2
::
mydimension
>
int
dim1
=
Geo1
::
mydimension
,
int
dim2
=
Geo2
::
mydimension
>
struct
GeometryDistance
struct
GeometryDistance
{
{
...
@@ -140,13 +140,31 @@ struct GeometryDistance
...
@@ -140,13 +140,31 @@ struct GeometryDistance
};
};
// distance point-point
// distance point-point
template
<
class
Geo1
,
class
Geo2
,
int
dim
w
orld
>
template
<
class
Geo1
,
class
Geo2
,
int
dim
W
orld
>
struct
GeometryDistance
<
Geo1
,
Geo2
,
dim
w
orld
,
0
,
0
>
struct
GeometryDistance
<
Geo1
,
Geo2
,
dim
W
orld
,
0
,
0
>
{
{
static_assert
(
Geo1
::
coorddimension
==
Geo2
::
coorddimension
,
"Geometries have to have the same coordinate dimensions"
);
static_assert
(
Geo1
::
coorddimension
==
Geo2
::
coorddimension
,
"Geometries have to have the same coordinate dimensions"
);
static
auto
distance
(
const
Geo1
&
geo1
,
const
Geo2
&
geo2
)
static
auto
distance
(
const
Geo1
&
geo1
,
const
Geo2
&
geo2
)
{
return
distance
(
geo1
.
corner
(
0
),
geo2
.
corner
(
0
));
}
{
return
Dumux
::
distance
(
geo1
.
corner
(
0
),
geo2
.
corner
(
0
));
}
}
};
// distance segment-point
template
<
class
Geo1
,
class
Geo2
,
int
dimWorld
>
struct
GeometryDistance
<
Geo1
,
Geo2
,
dimWorld
,
1
,
0
>
{
static_assert
(
Geo1
::
coorddimension
==
Geo2
::
coorddimension
,
"Geometries have to have the same coordinate dimensions"
);
static
auto
distance
(
const
Geo1
&
geo1
,
const
Geo2
&
geo2
)
{
return
distancePointSegment
(
geo2
.
corner
(
0
),
geo1
);
}
};
// distance point-segment
template
<
class
Geo1
,
class
Geo2
,
int
dimWorld
>
struct
GeometryDistance
<
Geo1
,
Geo2
,
dimWorld
,
0
,
1
>
{
static_assert
(
Geo1
::
coorddimension
==
Geo2
::
coorddimension
,
"Geometries have to have the same coordinate dimensions"
);
static
auto
distance
(
const
Geo1
&
geo1
,
const
Geo2
&
geo2
)
{
return
distancePointSegment
(
geo1
.
corner
(
0
),
geo2
);
}
};
}
// end namespace Detail
}
// end namespace Detail
...
...
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