mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
use tolerance in GetElementOfPoint when using a search tree
This commit is contained in:
parent
9987116703
commit
60768cf9c5
@ -4720,6 +4720,9 @@ namespace netgen
|
|||||||
bool build_searchtree,
|
bool build_searchtree,
|
||||||
const bool allowindex) const
|
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)
|
if (dimension == 2)
|
||||||
{
|
{
|
||||||
int ne;
|
int ne;
|
||||||
@ -4733,7 +4736,7 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
// update if necessary:
|
// update if necessary:
|
||||||
const_cast<Mesh&>(*this).BuildElementSearchTree ();
|
const_cast<Mesh&>(*this).BuildElementSearchTree ();
|
||||||
elementsearchtree->GetIntersecting (p, p, locels);
|
elementsearchtree->GetIntersecting (pmin, pmax, locels);
|
||||||
ne = locels.Size();
|
ne = locels.Size();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4776,7 +4779,7 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
// update if necessary:
|
// update if necessary:
|
||||||
const_cast<Mesh&>(*this).BuildElementSearchTree ();
|
const_cast<Mesh&>(*this).BuildElementSearchTree ();
|
||||||
elementsearchtree->GetIntersecting (p, p, locels);
|
elementsearchtree->GetIntersecting (pmin, pmax, locels);
|
||||||
ne = locels.Size();
|
ne = locels.Size();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user