use tolerance in GetElementOfPoint when using a search tree

This commit is contained in:
Alexander Schlüter 2017-01-12 21:09:07 +01:00
parent 9987116703
commit 60768cf9c5

View File

@ -4720,6 +4720,9 @@ namespace netgen
bool build_searchtree,
const bool allowindex) const
{
const double pointtol = 1e-12;
netgen::Point<3> pmin = p - Vec<3> (pointtol, pointtol, pointtol);
netgen::Point<3> pmax = p + Vec<3> (pointtol, pointtol, pointtol);
if (dimension == 2)
{
int ne;
@ -4733,7 +4736,7 @@ namespace netgen
{
// update if necessary:
const_cast<Mesh&>(*this).BuildElementSearchTree ();
elementsearchtree->GetIntersecting (p, p, locels);
elementsearchtree->GetIntersecting (pmin, pmax, locels);
ne = locels.Size();
}
else
@ -4776,7 +4779,7 @@ namespace netgen
{
// update if necessary:
const_cast<Mesh&>(*this).BuildElementSearchTree ();
elementsearchtree->GetIntersecting (p, p, locels);
elementsearchtree->GetIntersecting (pmin, pmax, locels);
ne = locels.Size();
}
else