Commit c0b3fa7b authored by Andreas Lauser's avatar Andreas Lauser

fix some warnings when additional flags are specified, clean up the .opt files

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@5151 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 2b94d6c2
# path to the dumux includes
DUMUXDIR=$(find $OLDPWD -name "dune.module" | xargs grep -El '[[:space:]]*Module:[[:space:]]*dumux[[:space:]]*$' | sed "s/dune.module//")
GXX_WARNING_OPTS=" \
-Wall \
-Wmissing-include-dirs \
-Wcast-align \
-Wno-sign-compare \
-Wno-packed-bitfield-compat \
-Wno-unused-parameter"
# configure flags
CONFIGURE_FLAGS="CXXFLAGS=\"-I$DUMUXDIR -Wall -Wno-sign-compare -Wno-packed-bitfield-compat -fno-strict-aliasing -g\" \
# additional -W flags for g++ which will lead to many warnings in
# other dune modules
# -Wextra \
# -Wfloat-equal \
# -Wstrict-overflow \
GXX_OPTS=" \
-fno-strict-aliasing \
-fstrict-overflow \
-g"
CONFIGURE_FLAGS="\
CXXFLAGS=\"$GXX_WARNING_OPTS $GXX_OPTS\" \
--enable-dunedevel \
--enable-documentation \
--disable-parallel \
--disable-mpiruntest"
# make all
MAKE_FLAGS=
......@@ -307,7 +307,7 @@ protected:
Scalar vNorm = velocity.two_norm();
dispersionTensor_ /= vNorm;
if (vNorm == 0)
if (vNorm < 1e-20)
dispersionTensor_ = 0;
//multiply with dispersivity difference: vv^T/||v||*(alphaL - alphaT), [m^2/s] --> alphaL = longitudinal disp., alphaT = transverse disp.
......
......@@ -187,7 +187,7 @@ private:
Scalar rhoJ = elemDat[face().j].density(phaseIdx);
Scalar fI = std::max(0.0, std::min(SI/1e-5, 0.5));
Scalar fJ = std::max(0.0, std::min(SJ/1e-5, 0.5));
if (fI + fJ == 0)
if (fI + fJ <= 0.0)
fI = fJ = 0.5; // doesn't matter because no phase is
// present in both cells!
Scalar density = (fI*rhoI + fJ*rhoJ)/(fI + fJ);
......
......@@ -167,7 +167,7 @@ private:
int j = face().j;
Scalar fI = rhoFactor_(phaseIdx, i, elemDat);
Scalar fJ = rhoFactor_(phaseIdx, j, elemDat);
if (fI + fJ == 0)
if (fI + fJ <= 0)
fI = fJ = 0.5; // doesn't matter because no phase is
// present in both cells!
densityAtIP_[phaseIdx] =
......
......@@ -122,36 +122,30 @@ public:
Valgrind::CheckDefined(fluidState_);
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
if (this->fluidState().saturation(phaseIdx) != 0.0) {
// Mobilities
const Scalar mu =
FluidSystem::phaseViscosity(phaseIdx,
fluidState().temperature(),
fluidState().phasePressure(lPhaseIdx),
fluidState());
Scalar kr;
if (phaseIdx == lPhaseIdx)
kr = MaterialLaw::krw(materialParams, saturation(lPhaseIdx));
else // ATTENTION: krn requires the liquid saturation
// as parameter!
kr = MaterialLaw::krn(materialParams, saturation(lPhaseIdx));
mobility_[phaseIdx] = kr / mu;
Valgrind::CheckDefined(mobility_[phaseIdx]);
// binary diffusion coefficents
diffCoeff_[phaseIdx] =
FluidSystem::diffCoeff(phaseIdx,
lCompIdx,
gCompIdx,
fluidState_.temperature(),
fluidState_.phasePressure(phaseIdx),
fluidState_);
Valgrind::CheckDefined(diffCoeff_[phaseIdx]);
}
else {
mobility_[phaseIdx] = 0;
diffCoeff_[phaseIdx] = 0;
}
// Mobilities
const Scalar mu =
FluidSystem::phaseViscosity(phaseIdx,
fluidState().temperature(),
fluidState().phasePressure(lPhaseIdx),
fluidState());
Scalar kr;
if (phaseIdx == lPhaseIdx)
kr = MaterialLaw::krw(materialParams, saturation(lPhaseIdx));
else // ATTENTION: krn requires the liquid saturation
// as parameter!
kr = MaterialLaw::krn(materialParams, saturation(lPhaseIdx));
mobility_[phaseIdx] = kr / mu;
Valgrind::CheckDefined(mobility_[phaseIdx]);
// binary diffusion coefficents
diffCoeff_[phaseIdx] =
FluidSystem::diffCoeff(phaseIdx,
lCompIdx,
gCompIdx,
fluidState_.temperature(),
fluidState_.phasePressure(phaseIdx),
fluidState_);
Valgrind::CheckDefined(diffCoeff_[phaseIdx]);
}
// porosity
......
......@@ -97,22 +97,16 @@ public:
// the internal energies and the enthalpies
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
if (this->fluidState().saturation(phaseIdx) != 0.0) {
enthalpy_[phaseIdx] =
FluidSystem::phaseEnthalpy(phaseIdx,
this->fluidState().temperature(),
this->fluidState().phasePressure(phaseIdx),
this->fluidState());
internalEnergy_[phaseIdx] =
FluidSystem::phaseInternalEnergy(phaseIdx,
this->fluidState().temperature(),
this->fluidState().phasePressure(phaseIdx),
this->fluidState());
}
else {
enthalpy_[phaseIdx] = 0;
internalEnergy_[phaseIdx] = 0;
}
enthalpy_[phaseIdx] =
FluidSystem::phaseEnthalpy(phaseIdx,
this->fluidState().temperature(),
this->fluidState().phasePressure(phaseIdx),
this->fluidState());
internalEnergy_[phaseIdx] =
FluidSystem::phaseInternalEnergy(phaseIdx,
this->fluidState().temperature(),
this->fluidState().phasePressure(phaseIdx),
this->fluidState());
}
Valgrind::CheckDefined(internalEnergy_);
Valgrind::CheckDefined(enthalpy_);
......
......@@ -522,8 +522,6 @@ void FVPressure2P2C<TypeTag>::assemble(bool first)
const Dune::FieldVector<Scalar, dim - 1>& faceLocal =
FaceReferenceElements::general(faceGT).position(0,0);
int isIndex = isIt->indexInInside();
// center of face inside volume reference element
const LocalPosition localPosFace(0);
......
......@@ -492,8 +492,6 @@ void FVPressure2P2CMultiPhysics<TypeTag>::assemble(bool first)
const Dune::FieldVector<Scalar, dim - 1>& faceLocal =
FaceReferenceElements::general(faceGT).position(0,0);
int isIndex = isIt->indexInInside();
// center of face inside volume reference element
const LocalPosition localPosFace(0);
......
# path to the dumux includes
DUMUXDIR=$(find $OLDPWD -name "dune.module" | xargs grep -El '[[:space:]]*Module:[[:space:]]*dumux[[:space:]]*$' | sed "s/dune.module//")
GXX_WARNING_OPTS=" \
-Wall \
-Wmissing-include-dirs \
-Wcast-align \
-Wno-sign-compare \
-Wno-packed-bitfield-compat \
-Wno-unused-parameter"
# additional -W flags for g++ which will lead to many warnings in
# other dune modules
# -Wextra \
# -Wfloat-equal \
# -Wstrict-overflow \
GXX_OPTS=" \
-fno-strict-aliasing \
-fstrict-overflow \
-O3 \
-march=native \
-DNDEBUG=1"
# configure flags
CONFIGURE_FLAGS="CXXFLAGS=\"-I$DUMUXDIR -Wall -Wno-sign-compare -Wno-packed-bitfield-compat -fno-strict-aliasing -O3 -march=native -DNDEBUG\" \
CONFIGURE_FLAGS=" \
CXXFLAGS=\"$GXX_WARNING_OPTS $GXX_OPTS\" \
--disable-dunedevel \
--disable-documentation \
--disable-parallel \
--disable-mpiruntest"
# make all
MAKE_FLAGS=
Markdown is supported
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