diff --git a/dumux/common/splinecommon_.hh b/dumux/common/splinecommon_.hh index e38a5859ad42ab6cc7d5836dfe7056bd1c33551b..872672fc2592686a6c3a7da387d3eaa3652d4bcc 100644 --- a/dumux/common/splinecommon_.hh +++ b/dumux/common/splinecommon_.hh @@ -85,7 +85,6 @@ public: const int n = numSamples_() - 1; for (int i = 0; i <= k; ++i) { double x = i*(x1 - x0)/k + x0; - double x_p1 = x + (x1 - x0)/k; double y; double dy_dx; double mono = 1; @@ -108,6 +107,7 @@ public: else { y = eval(x); dy_dx = evalDerivative(x); + double x_p1 = x + (x1 - x0)/k; mono = monotonic(max<Scalar>(x_(0), x), min<Scalar>(x_(n), x_p1)); } diff --git a/dumux/geometry/makegeometry.hh b/dumux/geometry/makegeometry.hh index a52258df1e6601f307e9c17d9186f1ec8cd81601..18e205c8f0797ed2ccb395e3bde6f3951cffdf7b 100644 --- a/dumux/geometry/makegeometry.hh +++ b/dumux/geometry/makegeometry.hh @@ -119,9 +119,9 @@ std::vector<Dune::FieldVector<CoordScalar, 3>> getReorderedPoints(const std::vec // the points do not conform with the dune ordering, re-order using GlobalPosition = Dune::FieldVector<CoordScalar, 3>; - if(!diagonalsIntersect && orientations[0] == 1) + if(orientations[0] == 1) return std::vector<GlobalPosition>{p1, p0, p2, p3}; - else if(!diagonalsIntersect && orientations[0] == -1) + else if(orientations[0] == -1) return std::vector<GlobalPosition>{p3, p1, p0, p2}; else DUNE_THROW(Dune::InvalidStateException, "Could not reorder points"); diff --git a/dumux/material/fluidsystems/h2oairxylene.hh b/dumux/material/fluidsystems/h2oairxylene.hh index 810d3601f425d58502921dc771b94faeb293b72f..e7fc270537b2fb39f6b9be38fb8569afa27e2062 100644 --- a/dumux/material/fluidsystems/h2oairxylene.hh +++ b/dumux/material/fluidsystems/h2oairxylene.hh @@ -372,8 +372,6 @@ public: int phaseIdx, int compIdx) { - Scalar diffCont; - Scalar temperature = fluidState.temperature(phaseIdx); Scalar pressure = fluidState.pressure(phaseIdx); if (phaseIdx==gPhaseIdx) { @@ -402,6 +400,8 @@ public: Scalar xww = fluidState.moleFraction(wPhaseIdx, H2OIdx); Scalar xwc = fluidState.moleFraction(wPhaseIdx, NAPLIdx); + Scalar diffCont; + switch (compIdx) { case NAPLIdx: diffCont = (1.- xww)/(xwa/diffAWl + xwc/diffWCl); diff --git a/test/common/functionfromstringexpression/test_functionfromstringexpression.cc b/test/common/functionfromstringexpression/test_functionfromstringexpression.cc index e97865af37d9f3942047517ade83793e3067ad39..9c75c93add0249dd84421f838f28415019355520 100644 --- a/test/common/functionfromstringexpression/test_functionfromstringexpression.cc +++ b/test/common/functionfromstringexpression/test_functionfromstringexpression.cc @@ -70,7 +70,7 @@ int main(int argc, char* argv[]) const std::string funcStr = "foo*sin(bar)*bla"; bool error = false; try { FunctionFromStringExpression<2> func(funcStr, std::array<std::string, 2>{{"foo" "bar"}}); } - catch (Dune::IOError& e) { error = true; } + catch (const Dune::IOError& e) { error = true; } if (!error) DUNE_THROW(Dune::Exception, "Faulty expression did not throw: " << funcStr); } diff --git a/test/common/spline/test_spline.cc b/test/common/spline/test_spline.cc index 30249beeb237ed030bfe2dca1aea8c79bebe46b4..10f8a086f19d0fd23d2348a497c359fe8e299a1a 100644 --- a/test/common/spline/test_spline.cc +++ b/test/common/spline/test_spline.cc @@ -240,8 +240,8 @@ void plot() double y_[] = { 10, 0, 10, 0, 10 }; double m1 = 10; double m2 = -10; - FV &xs = *reinterpret_cast<FV*>(x_); - FV &ys = *reinterpret_cast<FV*>(y_); + const FV &xs = *reinterpret_cast<FV*>(x_); + const FV &ys = *reinterpret_cast<FV*>(y_); Dumux::Spline<double, numSamples> spFull(xs, ys, m1, m2); Dumux::Spline<double, numSamples> spNatural(xs, ys); diff --git a/test/geometry/test_1d2d_intersection.cc b/test/geometry/test_1d2d_intersection.cc index d4cf483f194350337b9e38d21f4453f9b9709500..0deac74958710f914ddb1faf1f73def390d956c9 100644 --- a/test/geometry/test_1d2d_intersection.cc +++ b/test/geometry/test_1d2d_intersection.cc @@ -26,7 +26,7 @@ Dune::MultiLinearGeometry<double, 1, 3> makeLine(std::initializer_list<Dune::FieldVector<double, 2>>&& c, std::integral_constant<int, 3>) { std::vector<Dune::FieldVector<double, 3>> corners; - for (auto& corner : c) + for (const auto& corner : c) { Dune::FieldVector<double, 3> coord; coord[0] = corner[0];