fix GetSurfaceElementOfPoint with indices

This commit is contained in:
Christopher Lackner 2021-09-22 17:52:04 +02:00
parent 286f63f002
commit 6bbaa6bc69

View File

@ -5779,6 +5779,9 @@ namespace netgen
{
if(faces[i] == 0)
continue;
auto sel = SurfaceElement(faces[i]);
if(indices && indices->Size() != 0 && !indices->Contains(sel.GetIndex()))
continue;
auto & el = VolumeElement(velement);
@ -5790,8 +5793,6 @@ namespace netgen
{
// found volume point very close to a face -> use barycentric coordinates directly
lami[2] = 0.0;
auto sel = SurfaceElement(faces[i]);
for(auto j : Range(1,3))
for(auto k : Range(4))
if(sel[j] == el[k])
@ -5800,23 +5801,10 @@ namespace netgen
}
}
if(indices && indices->Size() != 0)
{
if(indices->Contains(SurfaceElement(faces[i]).GetIndex()) &&
PointContainedIn2DElement(p,lami,faces[i],true))
return faces[i];
}
else
{
if(PointContainedIn2DElement(p,lami,faces[i],true))
{
//(*testout) << "found point " << p << " in sel " << faces[i]
// << ", lam " << lami[0] << ", " << lami[1] << ", " << lami[2] << endl;
return faces[i];
}
}
}
}
// Did't find any matching face of a volume element, search 2d elements directly
int ne;