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
Merge requests
!639
Fixes in box finite volume geometry
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fixes in box finite volume geometry
fix/minor-and-major-changes-in-box
into
next
Overview
0
Commits
4
Pipelines
0
Changes
1
Merged
Dennis Gläser
requested to merge
fix/minor-and-major-changes-in-box
into
next
7 years ago
Overview
0
Commits
4
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
1dbd052b
Prev
Next
Show latest version
1 file
+
13
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
1dbd052b
[box][geomhelper] use correct normals and positive volumes
· 1dbd052b
Dennis Gläser
authored
7 years ago
dumux/discretization/box/boxgeometryhelper.hh
+
13
−
2
Options
@@ -268,7 +268,7 @@ public:
GlobalPosition
normal
=
Dumux
::
crossProduct
(
v3
,
t
);
normal
/=
normal
.
two_norm
();
//
TODO can this be done easier?, e.g. always
ensure the right direction
?
//
!
ensure the right direction
of the normal
const
auto
v
=
elementGeometry_
.
corner
(
scvIndices
[
1
])
-
elementGeometry_
.
corner
(
scvIndices
[
0
]);
const
auto
s
=
v
*
normal
;
if
(
std
::
signbit
(
s
))
@@ -283,9 +283,17 @@ public:
normal
(
const
ScvfCornerStorage
&
scvfCorners
,
const
std
::
vector
<
unsigned
int
>&
scvIndices
)
const
{
//! obtain normal vector by 90° counter-clockwise rotation of t
const
auto
t
=
scvfCorners
[
1
]
-
scvfCorners
[
0
];
GlobalPosition
normal
({
-
t
[
1
],
t
[
0
]});
normal
/=
normal
.
two_norm
();
//! ensure the right direction of the normal
const
auto
v
=
elementGeometry_
.
corner
(
scvIndices
[
1
])
-
elementGeometry_
.
corner
(
scvIndices
[
0
]);
const
auto
s
=
v
*
normal
;
if
(
std
::
signbit
(
s
))
normal
*=
-
1
;
return
normal
;
}
@@ -302,7 +310,10 @@ public:
typename
std
::
enable_if
<
w
==
2
,
Scalar
>::
type
scvVolume
(
const
ScvCornerStorage
&
p
)
const
{
return
0.5
*
Dumux
::
crossProduct
(
p
[
3
]
-
p
[
0
],
p
[
2
]
-
p
[
1
]);
//! make sure we are using positive volumes
//! Cross product of diagonals might be negative, depending on element orientation
using
std
::
abs
;
return
0.5
*
abs
(
Dumux
::
crossProduct
(
p
[
3
]
-
p
[
0
],
p
[
2
]
-
p
[
1
]));
}
//! get scvf area
Loading