mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 05:20:34 +05:00
fix GetSurfaceElementOfPoint with indices
This commit is contained in:
parent
286f63f002
commit
6bbaa6bc69
@ -5779,6 +5779,9 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
if(faces[i] == 0)
|
if(faces[i] == 0)
|
||||||
continue;
|
continue;
|
||||||
|
auto sel = SurfaceElement(faces[i]);
|
||||||
|
if(indices && indices->Size() != 0 && !indices->Contains(sel.GetIndex()))
|
||||||
|
continue;
|
||||||
|
|
||||||
auto & el = VolumeElement(velement);
|
auto & el = VolumeElement(velement);
|
||||||
|
|
||||||
@ -5790,8 +5793,6 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
// found volume point very close to a face -> use barycentric coordinates directly
|
// found volume point very close to a face -> use barycentric coordinates directly
|
||||||
lami[2] = 0.0;
|
lami[2] = 0.0;
|
||||||
auto sel = SurfaceElement(faces[i]);
|
|
||||||
|
|
||||||
for(auto j : Range(1,3))
|
for(auto j : Range(1,3))
|
||||||
for(auto k : Range(4))
|
for(auto k : Range(4))
|
||||||
if(sel[j] == el[k])
|
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))
|
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];
|
return faces[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Did't find any matching face of a volume element, search 2d elements directly
|
// Did't find any matching face of a volume element, search 2d elements directly
|
||||||
int ne;
|
int ne;
|
||||||
|
Loading…
Reference in New Issue
Block a user