[bugfix] Set element index in CloseSurface()

This commit is contained in:
Matthias Hochsteger 2018-10-22 17:18:58 +02:00
parent f1dc069052
commit b0129d0473
2 changed files with 2 additions and 1 deletions

View File

@ -1274,6 +1274,7 @@ BuildSurfaceElements (Array<Segment> & segs,
if (nst1 * dvec < 0) continue;
Element2d el(s1[0], s1[1], s2[0], s2[1]);
el.SetIndex(s1.si);
Vec<3> n = Cross (mesh[el[1]] - mesh[el[0]],
mesh[el[3]] - mesh[el[0]]);

View File

@ -314,7 +314,7 @@ namespace netgen
SurfaceElementIndex si = surfelements.Size();
surfelements.Append (el);
if (el.index > facedecoding.Size())
if (el.index<=0 || el.index > facedecoding.Size())
cerr << "has no facedecoding: fd.size = " << facedecoding.Size() << ", ind = " << el.index << endl;
surfelements.Last().next = facedecoding[el.index-1].firstelement;