diff --git a/dumux/geometry/intersectspointsimplex.hh b/dumux/geometry/intersectspointsimplex.hh index 4f62a05419a3c2d31713496b79c7fc15cdcc2105..ac758e8b43cf967efb530599e17196f26e4690e7 100644 --- a/dumux/geometry/intersectspointsimplex.hh +++ b/dumux/geometry/intersectspointsimplex.hh @@ -159,7 +159,7 @@ bool intersectsPointSimplex(const Dune::FieldVector<ctype, dimworld>& point, /*! * \ingroup Geometry - * \brief Find out whether a point is inside a interval (p0, p1, p2, p3) (dimworld is 3) + * \brief Find out whether a point is inside a interval (p0, p1) (dimworld is 2 or 3) * \note We assume the given interval has non-zero length and use it to scale the epsilon */ template<class ctype, int dimworld, typename std::enable_if_t<(dimworld == 3 || dimworld == 2), int> = 0> @@ -186,7 +186,7 @@ bool intersectsPointSimplex(const Dune::FieldVector<ctype, dimworld>& point, /*! * \ingroup Geometry - * \brief Find out whether a point is inside a interval (p0, p1, p2, p3) (dimworld is 1) + * \brief Find out whether a point is inside a interval (p0, p1) (dimworld is 1) */ template<class ctype, int dimworld, typename std::enable_if_t<(dimworld == 1), int> = 0> bool intersectsPointSimplex(const Dune::FieldVector<ctype, dimworld>& point, diff --git a/test/geometry/test_0d1d_intersection.cc b/test/geometry/test_0d1d_intersection.cc index 68286011de8e303e9f9171d311c3389a9355a15b..964ab83319d86da19102e7bd4587478cbd5dae6e 100644 --- a/test/geometry/test_0d1d_intersection.cc +++ b/test/geometry/test_0d1d_intersection.cc @@ -68,6 +68,14 @@ void testIntersections(std::vector<bool>& returns) returns.push_back(testIntersection(a, b, p8)); returns.push_back(testIntersection(a, b, p9, true)); returns.push_back(testIntersection(a, b, p10, true)); + + // test segment that is not axis-parallel + const GlobalPosition a2(scaling); + const GlobalPosition b2(scaling*2.0); + + GlobalPosition p11 = a2; + p11[dimWorld-1] += (b2-a2).two_norm()*1.5e-7; + returns.push_back(testIntersection(a2, b2, p11)); } }