Commit 9098621f authored by Happel, Lea's avatar Happel, Lea Committed by Praetorius, Simon
Browse files

Changed the checkInside Method

parent 113b86d1
...@@ -41,8 +41,10 @@ public: ...@@ -41,8 +41,10 @@ public:
/// \brief Type of the grid element the LocalFunction can be bound to /// \brief Type of the grid element the LocalFunction can be bound to
using Element = typename EntitySet::Element; using Element = typename EntitySet::Element;
using Grid = typename GV::Grid;
using Geometry = typename Element::Geometry;
template <class ES, class LF> template <class ES, class LF>
class CoarsenedLocalFunction class CoarsenedLocalFunction
{ {
...@@ -107,13 +109,17 @@ public: ...@@ -107,13 +109,17 @@ public:
{ {
if (childs_.empty()) if (childs_.empty())
return localFct_(x); return localFct_(x);
for (auto const& child : childs_) { // calculate checkInsideTolerance
auto refElem = referenceElement(*child.it); typename Grid::ctype const checkInsideTolerance = std::sqrt(std::numeric_limits<typename Grid::ctype>::epsilon());
auto local = child.local(x); for (auto const& child : childs_) {
if (refElem.checkInside(local)) { auto refElem = referenceElement(*child.it);
localFct_.bind(*child.it); auto local = child.local(x);
return localFct_(local); auto refTypeId = refElem.type().id();
bool isInside = Dune::Geo::Impl::checkInside(refTypeId, Geometry::mydimension, local, checkInsideTolerance);
if (isInside) {
localFct_.bind(*child.it);
return localFct_(local);
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment