From 6fd3118dfdf9c32ca4d5b0a50d95e209f7e73756 Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Mon, 6 Oct 2014 18:54:47 +0200 Subject: [PATCH] [Cleanup] Improve readability --- src/sand-wedge-data/twopiece.hh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/sand-wedge-data/twopiece.hh b/src/sand-wedge-data/twopiece.hh index 02872d66..0454d6fc 100644 --- a/src/sand-wedge-data/twopiece.hh +++ b/src/sand-wedge-data/twopiece.hh @@ -14,21 +14,17 @@ class TwoPieceFunction bool liesBelow(Dune::FieldVector<double, MY_DIM> const &x, Dune::FieldVector<double, MY_DIM> const &y, Dune::FieldVector<double, MY_DIM> const &z) const { - return (z[0] - x[0]) * (y[1] - x[1]) / (y[0] - x[0]) >= z[1] - x[1]; + return x[1] + (z[0] - x[0]) * (y[1] - x[1]) / (y[0] - x[0]) >= z[1]; }; bool insideRegion2(Dune::FieldVector<double, MY_DIM> const &z) const { - return liesBelow(_K, _M, z); + return liesBelow(MyGeometry::K, MyGeometry::M, z); }; - Dune::FieldVector<double, MY_DIM> const &_K; - Dune::FieldVector<double, MY_DIM> const &_M; - double const _v1; double const _v2; public: - TwoPieceFunction(double v1, double v2) - : _K(MyGeometry::K), _M(MyGeometry::M), _v1(v1), _v2(v2) {} + TwoPieceFunction(double v1, double v2) : _v1(v1), _v2(v2) {} void evaluate(Dune::FieldVector<double, MY_DIM> const &x, Dune::FieldVector<double, 1> &y) const { -- GitLab