22#ifndef DUMUX_BOUNDING_BOX_TREE_INTERSECTION_HH
23#define DUMUX_BOUNDING_BOX_TREE_INTERSECTION_HH
25#include <dune/common/fvector.hh>
26#include <dune/common/promotiontraits.hh>
39template<
class EntitySet0,
class EntitySet1>
42 enum { dimworld = EntitySet0::dimensionworld };
43 using ctype =
typename Dune::PromotionTraits<typename EntitySet0::ctype, typename EntitySet1::ctype>::PromotedType;
44 using GlobalPosition = Dune::FieldVector<ctype, dimworld>;
47 template<
class Corners>
53 , corners_(c.begin(), c.end())
55 static_assert(int(EntitySet0::dimensionworld) == int(EntitySet1::dimensionworld),
56 "Can only store intersections of entity sets with the same world dimension");
68 std::vector<GlobalPosition>
corners()
const
75 bool cornersMatch(
const std::vector<GlobalPosition>& otherCorners)
const
77 if (otherCorners.size() != corners_.size())
80 const auto eps = 1.5e-7*(corners_[1] - corners_[0]).two_norm();
81 for (
int i = 0; i < corners_.size(); ++i)
82 if ((corners_[i] - otherCorners[i]).two_norm() >
eps)
90 std::vector<GlobalPosition> corners_;
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
constexpr double eps
epsilon for checking direction of scvf normals
Definition: test_tpfafvgeometry_nonconforming.cc:44
An intersection object resulting from the intersection of two bounding box tree primitives.
Definition: boundingboxtreeintersection.hh:41
std::vector< GlobalPosition > corners() const
Get the corners of the intersection geometry.
Definition: boundingboxtreeintersection.hh:68
std::size_t first() const
Get the index of the intersecting entity belonging to this grid.
Definition: boundingboxtreeintersection.hh:60
std::size_t second() const
Get the index of the intersecting entity belonging to the other grid.
Definition: boundingboxtreeintersection.hh:64
bool cornersMatch(const std::vector< GlobalPosition > &otherCorners) const
Check if the corners of this intersection match with the given corners.
Definition: boundingboxtreeintersection.hh:75
BoundingBoxTreeIntersection(std::size_t a, std::size_t b, Corners &&c)
Definition: boundingboxtreeintersection.hh:48