mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
bug fix for surface-element lists
This commit is contained in:
parent
44ac64f85a
commit
dd50309393
@ -1381,12 +1381,13 @@ namespace netgen
|
||||
|
||||
if (!apoints.Size()) return;
|
||||
|
||||
|
||||
#define VERTSORT
|
||||
|
||||
#ifdef VERTSORT
|
||||
Vec<3> dir(1.2, 1.7, 0.9);
|
||||
for (int i = 0; i < apoints.Size(); i++)
|
||||
for (int j = 0; j < apoints.Size()-1; j++)
|
||||
if (apoints[j](2) > apoints[j+1](2))
|
||||
if ( (dir * Vec<3> (apoints[j])) > (dir * Vec<3> (apoints[j+1])))
|
||||
swap (apoints[j], apoints[j+1]);
|
||||
#endif
|
||||
|
||||
|
@ -3786,7 +3786,7 @@ namespace netgen
|
||||
|
||||
|
||||
mesh.ComputeNVertices();
|
||||
|
||||
mesh.RebuildSurfaceElementLists();
|
||||
|
||||
|
||||
// update identification tables
|
||||
|
@ -2297,6 +2297,8 @@ namespace netgen
|
||||
}
|
||||
}
|
||||
|
||||
RebuildSurfaceElementLists ();
|
||||
/*
|
||||
for (int i = 0; i < facedecoding.Size(); i++)
|
||||
facedecoding[i].firstelement = -1;
|
||||
for (int i = surfelements.Size()-1; i >= 0; i--)
|
||||
@ -2305,7 +2307,7 @@ namespace netgen
|
||||
surfelements[i].next = facedecoding[ind-1].firstelement;
|
||||
facedecoding[ind-1].firstelement = i;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
timestamp = NextTimeStamp();
|
||||
// Compress();
|
||||
@ -4978,6 +4980,19 @@ namespace netgen
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Mesh :: RebuildSurfaceElementLists ()
|
||||
{
|
||||
for (int i = 0; i < facedecoding.Size(); i++)
|
||||
facedecoding[i].firstelement = -1;
|
||||
for (int i = surfelements.Size()-1; i >= 0; i--)
|
||||
{
|
||||
int ind = surfelements[i].GetIndex();
|
||||
surfelements[i].next = facedecoding[ind-1].firstelement;
|
||||
facedecoding[ind-1].firstelement = i;
|
||||
}
|
||||
}
|
||||
|
||||
void Mesh :: GetSurfaceElementsOfFace (int facenr, Array<SurfaceElementIndex> & sei) const
|
||||
{
|
||||
static int timer = NgProfiler::CreateTimer ("GetSurfaceElementsOfFace");
|
||||
|
@ -290,6 +290,7 @@ public:
|
||||
{ return surfelements[ei]; }
|
||||
|
||||
|
||||
void RebuildSurfaceElementLists ();
|
||||
void GetSurfaceElementsOfFace (int facenr, Array<SurfaceElementIndex> & sei) const;
|
||||
|
||||
ElementIndex AddVolumeElement (const Element & el);
|
||||
|
@ -610,6 +610,7 @@ namespace netgen
|
||||
}
|
||||
|
||||
mesh.ComputeNVertices();
|
||||
mesh.RebuildSurfaceElementLists();
|
||||
return;
|
||||
|
||||
int cnttrials = 10;
|
||||
|
@ -287,7 +287,7 @@ namespace netgen
|
||||
}
|
||||
|
||||
mesh.ComputeNVertices();
|
||||
|
||||
mesh.RebuildSurfaceElementLists();
|
||||
// ValidateSecondOrder (mesh);
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,6 @@ namespace netgen
|
||||
|
||||
|
||||
|
||||
|
||||
using netgen::parameters;
|
||||
using netgen::ngdir;
|
||||
using netgen::verbose;
|
||||
@ -348,7 +347,6 @@ extern "C" int Ng_Vis_Init (Tcl_Interp * interp);
|
||||
|
||||
// extern Tcl_PackageInitProc * Tk_SafeInit;
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Initialize packages
|
||||
|
Loading…
Reference in New Issue
Block a user