Commit 9e039e3f authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'ChangedCheckInsideCoarsenedGridFunction' into 'master'

Changed the checkInside Method

See merge request amdis/amdis!78
parents 86b56012 9098621f
......@@ -41,8 +41,10 @@ public:
/// \brief Type of the grid element the LocalFunction can be bound to
using Element = typename EntitySet::Element;
using Grid = typename GV::Grid;
using Geometry = typename Element::Geometry;
template <class ES, class LF>
class CoarsenedLocalFunction
{
......@@ -107,13 +109,17 @@ public:
{
if (childs_.empty())
return localFct_(x);
for (auto const& child : childs_) {
auto refElem = referenceElement(*child.it);
auto local = child.local(x);
if (refElem.checkInside(local)) {
localFct_.bind(*child.it);
return localFct_(local);
// calculate checkInsideTolerance
typename Grid::ctype const checkInsideTolerance = std::sqrt(std::numeric_limits<typename Grid::ctype>::epsilon());
for (auto const& child : childs_) {
auto refElem = referenceElement(*child.it);
auto local = child.local(x);
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