Merge branch 'find_curved_element_of_point' into 'master'

Find curved element of point

See merge request jschoeberl/netgen!371
This commit is contained in:
Christopher Lackner 2021-03-18 07:16:55 +00:00
commit ab4359c343

View File

@ -4851,6 +4851,11 @@ namespace netgen
for (auto pi : volelements[ei].PNums())
box.Add (points[pi]);
auto & el = volelements[ei];
if(el.IsCurved())
box.Increase(1.2*box.Diam());
elementsearchtree -> Insert (box, ei+1);
}
}
@ -5707,6 +5712,26 @@ namespace netgen
if(faces[i] == 0)
continue;
auto & el = VolumeElement(velement);
if (el.GetType() == TET)
{
double lam4[4] = { vlam[0], vlam[1], vlam[2], 1.0-vlam[0]-vlam[1]-vlam[2] };
double face_lam = lam4[i];
if(face_lam < 1e-5)
{
// 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])
lami[j-1] = lam4[k]/(1.0-face_lam);
return faces[i];
}
}
if(indices && indices->Size() != 0)
{
if(indices->Contains(SurfaceElement(faces[i]).GetIndex()) &&