* Temporarily fixed bug: array "facedecoding" gets corrupted after converting a mesh to second order, subsequently causing a crash on using the function "GetSurfaceElementsOfFace"

-- Corrected by uncommenting a previous approach used to obtain the surface elements of a face, and commenting out the currently used code till further clarification
This commit is contained in:
Philippose Rajan 2009-10-04 15:15:57 +00:00
parent df79bea6bd
commit 0d1f18749d

View File

@ -4980,42 +4980,53 @@ namespace netgen
void Mesh :: GetSurfaceElementsOfFace (int facenr, Array<SurfaceElementIndex> & sei) const void Mesh :: GetSurfaceElementsOfFace (int facenr, Array<SurfaceElementIndex> & sei) const
{ {
static int timer = NgProfiler::CreateTimer ("GetSurfaceElementsOfFace"); static int timer = NgProfiler::CreateTimer ("GetSurfaceElementsOfFace");
NgProfiler::RegionTimer reg (timer); NgProfiler::RegionTimer reg (timer);
/*
sei.SetSize (0);
for (SurfaceElementIndex i = 0; i < GetNSE(); i++)
if ( (*this)[i].GetIndex () == facenr && (*this)[i][0] >= PointIndex::BASE &&
!(*this)[i].IsDeleted() )
sei.Append (i);
int size1 = sei.Size(); sei.SetSize (0);
*/ for (SurfaceElementIndex i = 0; i < GetNSE(); i++)
{
if ( (*this)[i].GetIndex () == facenr && (*this)[i][0] >= PointIndex::BASE &&
!(*this)[i].IsDeleted() )
{
sei.Append (i);
}
}
sei.SetSize(0);
SurfaceElementIndex si = facedecoding[facenr-1].firstelement; /* Philippose - 01/10/2009
while (si != -1) Commented out the following lines, and activated the originally
{ commented out lines above because of a bug which causes corruption
of the variable "facedecoding" when a mesh is converted to second order
*/
// int size1 = sei.Size();
/*
sei.SetSize(0);
SurfaceElementIndex si = facedecoding[facenr-1].firstelement;
while (si != -1)
{
if ( (*this)[si].GetIndex () == facenr && (*this)[si][0] >= PointIndex::BASE && if ( (*this)[si].GetIndex () == facenr && (*this)[si][0] >= PointIndex::BASE &&
!(*this)[si].IsDeleted() ) !(*this)[si].IsDeleted() )
{ {
sei.Append (si); sei.Append (si);
} }
si = (*this)[si].next; si = (*this)[si].next;
} }
*/
/*
// *testout << "with list = " << endl << sei << endl;
/* if (size1 != sei.Size())
// *testout << "with list = " << endl << sei << endl; {
cout << "size mismatch" << endl;
if (size1 != sei.Size()) exit(1);
{ }
cout << "size mismatch" << endl; */
exit(1);
}
*/
} }