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
6e16f901
Commit
6e16f901
authored
Aug 30, 2018
by
Melanie Lipp
Browse files
Remove warnings Wfloat-equal from dumux.
parent
62d7c28f
Changes
9
Hide whitespace changes
Inline
Side-by-side
dumux/common/math.hh
View file @
6e16f901
...
...
@@ -32,6 +32,7 @@
#include
<dune/common/fvector.hh>
#include
<dune/common/fmatrix.hh>
#include
<dune/common/dynmatrix.hh>
#include
<dune/common/float_cmp.hh>
namespace
Dumux
{
...
...
@@ -110,7 +111,7 @@ void harmonicMeanMatrix(Dune::FieldMatrix<Scalar, m, n> &K,
{
for
(
int
rowIdx
=
0
;
rowIdx
<
m
;
rowIdx
++
){
for
(
int
colIdx
=
0
;
colIdx
<
n
;
colIdx
++
){
if
(
Ki
[
rowIdx
][
colIdx
]
!=
Kj
[
rowIdx
][
colIdx
])
{
if
(
Dune
::
FloatCmp
::
ne
<
Scalar
>
(
Ki
[
rowIdx
][
colIdx
]
,
Kj
[
rowIdx
][
colIdx
])
)
{
K
[
rowIdx
][
colIdx
]
=
harmonicMean
(
Ki
[
rowIdx
][
colIdx
],
Kj
[
rowIdx
][
colIdx
]);
...
...
dumux/common/splinecommon_.hh
View file @
6e16f901
...
...
@@ -251,9 +251,9 @@ public:
}
// corner case where the whole spline is a constant
if
(
moment_
(
0
)
==
0
&&
moment_
(
1
)
==
0
&&
y_
(
0
)
==
y_
(
1
))
if
(
Dune
::
FloatCmp
::
eq
<
Scalar
>
(
moment_
(
0
)
,
0
)
&&
Dune
::
FloatCmp
::
eq
<
Scalar
>
(
moment_
(
1
)
,
0
)
&&
Dune
::
FloatCmp
::
eq
<
Scalar
>
(
y_
(
0
)
,
y_
(
1
))
)
{
// actually the is monotonically increasing as well as
// monotonously decreasing
...
...
@@ -562,9 +562,9 @@ protected:
Scalar
xE1
=
(
-
2
*
b
+
disc
)
/
(
6
*
a
);
Scalar
xE2
=
(
-
2
*
b
-
disc
)
/
(
6
*
a
);
if
(
disc
==
0
)
{
if
(
Dune
::
FloatCmp
::
eq
<
Scalar
>
(
disc
,
0
)
)
{
// saddle point -> no extrema
if
(
xE1
==
x0
)
if
(
Dune
::
FloatCmp
::
eq
<
Scalar
>
(
xE1
,
x0
)
)
// make sure that we're not picking the saddle point
// to determine whether we're monotonically increasing
// or decreasing
...
...
dumux/discretization/box/maxwellstefanslaw.hh
View file @
6e16f901
...
...
@@ -153,7 +153,7 @@ private:
const
auto
outsideScvIdx
=
scvf
.
outsideScvIdx
();
//this is to not devide by 0 if the saturation in 0 and the effectiveDiffusivity becomes zero due to that
if
(
insideVolVars
.
saturation
(
phaseIdx
)
==
0
||
outsideVolVars
.
saturation
(
phaseIdx
)
==
0
)
if
(
Dune
::
FloatCmp
::
eq
<
Scalar
>
(
insideVolVars
.
saturation
(
phaseIdx
)
,
0
)
||
Dune
::
FloatCmp
::
eq
<
Scalar
>
(
outsideVolVars
.
saturation
(
phaseIdx
)
,
0
)
)
return
reducedDiffusionMatrix
;
for
(
int
compIIdx
=
0
;
compIIdx
<
numComponents
-
1
;
compIIdx
++
)
...
...
dumux/discretization/cellcentered/tpfa/maxwellstefanslaw.hh
View file @
6e16f901
...
...
@@ -115,7 +115,7 @@ public:
}
//we cannot solve that if the matrix is 0 everywhere
if
(
!
(
insideVolVars
.
saturation
(
phaseIdx
)
==
0
||
outsideVolVars
.
saturation
(
phaseIdx
)
==
0
))
if
(
!
(
Dune
::
FloatCmp
::
eq
<
Scalar
>
(
insideVolVars
.
saturation
(
phaseIdx
)
,
0
)
||
Dune
::
FloatCmp
::
eq
<
Scalar
>
(
outsideVolVars
.
saturation
(
phaseIdx
)
,
0
))
)
{
const
auto
insideScvIdx
=
scvf
.
insideScvIdx
();
const
auto
&
insideScv
=
fvGeometry
.
scv
(
insideScvIdx
);
...
...
@@ -211,7 +211,7 @@ private:
ReducedComponentMatrix
reducedDiffusionMatrix
(
0.0
);
//this is to not devide by 0 if the saturation in 0 and the effectiveDiffusivity becomes zero due to that
if
(
volVars
.
saturation
(
phaseIdx
)
==
0
)
if
(
Dune
::
FloatCmp
::
eq
<
Scalar
>
(
volVars
.
saturation
(
phaseIdx
)
,
0
)
)
return
reducedDiffusionMatrix
;
for
(
int
compIIdx
=
0
;
compIIdx
<
numComponents
-
1
;
compIIdx
++
)
...
...
dumux/linear/amgparallelhelpers.hh
View file @
6e16f901
...
...
@@ -424,7 +424,7 @@ public:
}
// access to ghost vector
double
ghost
(
std
::
size_t
i
)
const
std
::
size_t
ghost
(
std
::
size_t
i
)
const
{
return
isGhost_
[
i
];
}
...
...
dumux/material/constraintsolvers/immiscibleflash.hh
View file @
6e16f901
...
...
@@ -295,7 +295,6 @@ protected:
Scalar
x_i
=
getQuantity_
(
fluidState
,
pvIdx
);
const
Scalar
eps
=
1e-10
/
quantityWeight_
(
fluidState
,
pvIdx
);
setQuantity_
<
MaterialLaw
>
(
fluidState
,
paramCache
,
matParams
,
pvIdx
,
x_i
+
eps
);
assert
(
getQuantity_
(
fluidState
,
pvIdx
)
==
x_i
+
eps
);
// compute derivative of the defect
calculateDefect_
(
tmp
,
origFluidState
,
fluidState
,
globalMolarities
);
...
...
dumux/material/constraintsolvers/ncpflash.hh
View file @
6e16f901
...
...
@@ -345,7 +345,6 @@ protected:
Scalar
x_i
=
getQuantity_
(
fluidState
,
pvIdx
);
const
Scalar
eps
=
1e-8
/
quantityWeight_
(
fluidState
,
pvIdx
);
setQuantity_
<
MaterialLaw
>
(
fluidState
,
paramCache
,
matParams
,
pvIdx
,
x_i
+
eps
);
assert
(
getQuantity_
(
fluidState
,
pvIdx
)
==
x_i
+
eps
);
// compute derivative of the defect
calculateDefect_
(
tmp
,
origFluidState
,
fluidState
,
globalMolarities
);
...
...
dumux/material/fluidsystems/h2oair.hh
View file @
6e16f901
...
...
@@ -266,7 +266,7 @@ public:
return
H2O
::
vaporPressure
(
t
);
else
{
const
auto
pc
=
(
fluidState
.
wettingPhase
()
==
H2OIdx
)
const
auto
pc
=
(
fluidState
.
wettingPhase
()
==
(
int
)
H2OIdx
)
?
fluidState
.
pressure
(
AirIdx
)
-
fluidState
.
pressure
(
H2OIdx
)
:
fluidState
.
pressure
(
H2OIdx
)
-
fluidState
.
pressure
(
AirIdx
);
return
H2O
::
vaporPressure
(
t
)
*
exp
(
-
pc
*
molarMass
(
H2OIdx
)
...
...
dumux/porousmediumflow/2p2c/sequential/fvpressure.hh
View file @
6e16f901
...
...
@@ -1026,7 +1026,7 @@ void FVPressure2P2C<TypeTag>::updateMaterialLawsInElement(const Element& element
Scalar
massw
=
sumConc
*
fluidState
.
phaseMassFraction
(
wPhaseIdx
);
Scalar
massn
=
sumConc
*
fluidState
.
phaseMassFraction
(
nPhaseIdx
);
if
((
cellData
.
density
(
wPhaseIdx
)
*
cellData
.
density
(
nPhaseIdx
))
==
0
)
if
(
Dune
::
FloatCmp
::
eq
<
Scalar
>
((
cellData
.
density
(
wPhaseIdx
)
*
cellData
.
density
(
nPhaseIdx
))
,
0
)
)
DUNE_THROW
(
Dune
::
MathError
,
"Sequential2p2c::postProcessUpdate: try to divide by 0 density"
);
Scalar
vol
=
massw
/
cellData
.
density
(
wPhaseIdx
)
+
massn
/
cellData
.
density
(
nPhaseIdx
);
if
(
Dune
::
FloatCmp
::
ne
<
Scalar
,
Dune
::
FloatCmp
::
absolute
>
(
problem
().
timeManager
().
timeStepSize
(),
0.0
,
1.0e-30
))
...
...
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