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
745553c6
Commit
745553c6
authored
May 29, 2020
by
Timo Koch
Browse files
[fix][upwindscheme] Use using std::signbit to allow for ADL
parent
fa81e2b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
dumux/flux/upwindscheme.hh
View file @
745553c6
...
...
@@ -62,7 +62,8 @@ public:
const
auto
&
insideVolVars
=
elemVolVars
[
insideScv
];
const
auto
&
outsideVolVars
=
elemVolVars
[
outsideScv
];
if
(
std
::
signbit
(
flux
))
// if sign of flux is negative
using
std
::
signbit
;
if
(
signbit
(
flux
))
// if sign of flux is negative
return
flux
*
(
upwindWeight
*
upwindTerm
(
outsideVolVars
)
+
(
1.0
-
upwindWeight
)
*
upwindTerm
(
insideVolVars
));
else
...
...
@@ -87,6 +88,7 @@ public:
const
UpwindTermFunction
&
upwindTerm
,
Scalar
flux
,
int
phaseIdx
)
{
using
std
::
signbit
;
static
const
Scalar
upwindWeight
=
getParam
<
Scalar
>
(
"Flux.UpwindWeight"
);
// the volume variables of the inside sub-control volume
...
...
@@ -103,7 +105,7 @@ public:
Scalar
sumUpwindFluxes
=
0.0
;
// if the inside flux is positive (outflow) do fully upwind and return flux
if
(
!
std
::
signbit
(
flux
))
if
(
!
signbit
(
flux
))
return
upwindTerm
(
insideVolVars
)
*
flux
;
else
sumUpwindFluxes
+=
flux
;
...
...
@@ -125,7 +127,7 @@ public:
phaseIdx
,
fluxVars
.
elemFluxVarsCache
());
if
(
!
std
::
signbit
(
outsideFlux
))
if
(
!
signbit
(
outsideFlux
))
branchingPointUpwindTerm
+=
upwindTerm
(
elemVolVars
[
outsideScvIdx
])
*
outsideFlux
;
else
sumUpwindFluxes
+=
outsideFlux
;
...
...
@@ -140,7 +142,7 @@ public:
// upwind scheme (always do fully upwind at branching points)
// a weighting here would lead to an error since the derivation is based on a fully upwind scheme
// TODO How to implement a weight of e.g. 0.5
if
(
std
::
signbit
(
flux
))
if
(
signbit
(
flux
))
return
flux
*
branchingPointUpwindTerm
;
else
return
flux
*
upwindTerm
(
insideVolVars
);
...
...
@@ -150,7 +152,7 @@ public:
{
// upwind scheme
const
auto
&
outsideVolVars
=
elemVolVars
[
scvf
.
outsideScvIdx
()];
if
(
std
::
signbit
(
flux
))
if
(
signbit
(
flux
))
return
flux
*
(
upwindWeight
*
upwindTerm
(
outsideVolVars
)
+
(
1.0
-
upwindWeight
)
*
upwindTerm
(
insideVolVars
));
else
...
...
@@ -173,7 +175,8 @@ public:
const
auto
&
insideVolVars
=
elemVolVars
[
scvf
.
insideScvIdx
()];
const
auto
&
outsideVolVars
=
elemVolVars
[
scvf
.
outsideScvIdx
()];
if
(
std
::
signbit
(
flux
))
// if sign of flux is negative
using
std
::
signbit
;
if
(
signbit
(
flux
))
// if sign of flux is negative
return
flux
*
(
upwindWeight
*
upwindTerm
(
outsideVolVars
)
+
(
1.0
-
upwindWeight
)
*
upwindTerm
(
insideVolVars
));
else
...
...
Timo Koch
@timok
mentioned in commit
ad1f163f
·
Nov 17, 2020
mentioned in commit
ad1f163f
mentioned in commit ad1f163f76dff8268d9548822703e83fa334c665
Toggle commit list
Timo Koch
@timok
mentioned in merge request
!2402 (merged)
·
Nov 17, 2020
mentioned in merge request
!2402 (merged)
mentioned in merge request !2402
Toggle commit list
Write
Preview
Supports
Markdown
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