Commit 45d6dd4b authored by Christoph Grueninger's avatar Christoph Grueninger
Browse files

[decoupled] Fix use of wrong abs function.

abs() is for integers. C offers fabs(), C++ std::abs.
(reviewed by natalies)


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@13404 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 0d6abf38
......@@ -19,8 +19,10 @@
#ifndef DUMUX_FVPRESSURECOMPOSITIONAL_HH
#define DUMUX_FVPRESSURECOMPOSITIONAL_HH
#include <cmath>
// dumux environment
#include "dumux/common/math.hh"
#include <dumux/common/math.hh>
#include <dumux/decoupled/common/fv/fvpressure.hh>
#include <dumux/material/constraintsolvers/compositionalflash.hh>
#include <dumux/decoupled/2p2c/2p2cproperties.hh>
......@@ -646,7 +648,7 @@ void FVPressureCompositional<TypeTag>::initialMaterialLaws(bool compositional)
fluidState.saturation(wPhaseIdx));
// TODO: get right criterion, do output for evaluation
//converge criterion
if (abs(oldPc-pc)<10)
if (std::abs(oldPc - pc) < 10.0)
iter = maxiter;
pc = MaterialLaw::pc(problem_.spatialParams().materialLawParams(*eIt),
......
......@@ -19,12 +19,14 @@
#ifndef DUMUX_FVTRANSPORT2P2C_HH
#define DUMUX_FVTRANSPORT2P2C_HH
#include <cmath>
#include <unordered_map>
#include <dune/grid/common/gridenums.hh>
#include <dumux/decoupled/2p2c/2p2cproperties.hh>
#include <dumux/material/constraintsolvers/compositionalflash.hh>
#include <dumux/common/math.hh>
#include <dumux/linear/vectorexchange.hh>
#include <unordered_map>
/**
* @file
......@@ -1170,7 +1172,7 @@ void FVTransport2P2C<TypeTag>::evalBoundary(GlobalPosition globalPosFace,
BCfluidState.saturation(wPhaseIdx));
// TODO: get right criterion, do output for evaluation
//converge criterion
if (abs(oldPc-pcBound)<10)
if (std::abs(oldPc - pcBound) < 10.0)
iter = maxiter;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment