22#ifndef DUMUX_GEOMETRY_INTERSECTS_POINT_GEOMETRY_HH
23#define DUMUX_GEOMETRY_INTERSECTS_POINT_GEOMETRY_HH
26#include <dune/common/exceptions.hh>
27#include <dune/common/fvector.hh>
37template <
class ctype,
int dimworld,
class Geometry,
typename std::enable_if_t<(Geometry::mydimension == 3),
int> = 0>
41 const auto type = g.type();
44 if (type.isTetrahedron())
48 else if (type.isHexahedron())
59 else if (type.isPyramid())
67 else if (type.isPrism())
76 DUNE_THROW(Dune::NotImplemented,
77 "Intersection for point and geometry type "
78 << type <<
" in " << dimworld <<
"-dimensional world.");
85template <
class ctype,
int dimworld,
class Geometry,
typename std::enable_if_t<(Geometry::mydimension == 2),
int> = 0>
89 const auto type = g.type();
92 if (type.isTriangle())
96 else if (type.isQuadrilateral())
104 DUNE_THROW(Dune::NotImplemented,
105 "Intersection for point and geometry type "
106 << type <<
" in " << dimworld <<
"-dimensional world.");
113template <
class ctype,
int dimworld,
class Geometry,
typename std::enable_if_t<(Geometry::mydimension == 1),
int> = 0>
Detect if a point intersects a simplex (including boundary)
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:38
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:36