12#ifndef DUMUX_GEOMETRY_INTERSECTS_POINT_GEOMETRY_HH
13#define DUMUX_GEOMETRY_INTERSECTS_POINT_GEOMETRY_HH
16#include <dune/common/exceptions.hh>
17#include <dune/common/fvector.hh>
27template <
class ctype,
int dimworld,
class Geometry,
typename std::enable_if_t<(Geometry::mydimension == 3),
int> = 0>
31 const auto type = g.type();
34 if (type.isTetrahedron())
38 else if (type.isHexahedron())
49 else if (type.isPyramid())
57 else if (type.isPrism())
66 DUNE_THROW(Dune::NotImplemented,
67 "Intersection for point and geometry type "
68 << type <<
" in " << dimworld <<
"-dimensional world.");
75template <
class ctype,
int dimworld,
class Geometry,
typename std::enable_if_t<(Geometry::mydimension == 2),
int> = 0>
79 const auto type = g.type();
82 if (type.isTriangle())
86 else if (type.isQuadrilateral())
94 DUNE_THROW(Dune::NotImplemented,
95 "Intersection for point and geometry type "
96 << type <<
" in " << dimworld <<
"-dimensional world.");
103template <
class ctype,
int dimworld,
class Geometry,
typename std::enable_if_t<(Geometry::mydimension == 1),
int> = 0>
bool intersectsPointGeometry(const Dune::FieldVector< ctype, dimworld > &point, const Geometry &g)
Find out whether a point is inside a three-dimensional geometry.
Definition: intersectspointgeometry.hh:28
bool intersectsPointSimplex(const Dune::FieldVector< ctype, dimworld > &point, const Dune::FieldVector< ctype, dimworld > &p0, const Dune::FieldVector< ctype, dimworld > &p1, const Dune::FieldVector< ctype, dimworld > &p2, const Dune::FieldVector< ctype, dimworld > &p3)
Find out whether a point is inside the tetrahedron (p0, p1, p2, p3) (dimworld is 3)
Definition: intersectspointsimplex.hh:26
Detect if a point intersects a simplex (including boundary)