fixes for surface element point search

This commit is contained in:
Joachim Schöberl 2016-05-09 05:45:09 +02:00
parent f07a7a95d0
commit 1337786e73

View File

@ -739,9 +739,18 @@ namespace netgen
for (int i = 0; i < numind; i++) dummy[i] = indices[i]+1; for (int i = 0; i < numind; i++) dummy[i] = indices[i]+1;
double lam3[3]; double lam3[3];
int ind;
if (mesh->GetDimension() == 2)
{
Point<3> p2d(p[0], p[1], 0); Point<3> p2d(p[0], p[1], 0);
int ind = ind = mesh->GetElementOfPoint(p2d, lam3, &dummy, build_searchtree);
mesh->GetElementOfPoint(p2d, lam3, &dummy, build_searchtree); }
else
{
Point3d p3d(p[0], p[1], p[2]);
ind = mesh->GetSurfaceElementOfPoint(p3d, lam3, &dummy, build_searchtree);
}
if (ind > 0) if (ind > 0)
{ {