Use Mesh::CreatePoint2ElementTable() in SplitImprove()

This commit is contained in:
Matthias Hochsteger 2019-10-01 15:15:46 +02:00
parent f42ee7b02d
commit a3ccb6432c

View File

@ -599,7 +599,8 @@ void MeshOptimize3d :: SplitImprove (Mesh & mesh,
int np = mesh.GetNP(); int np = mesh.GetNP();
int ne = mesh.GetNE(); int ne = mesh.GetNE();
TABLE<ElementIndex,PointIndex::BASE> elementsonnode(np); auto elementsonnode = mesh.CreatePoint2ElementTable();
NgArray<ElementIndex> hasbothpoints; NgArray<ElementIndex> hasbothpoints;
NgBitArray origpoint(np+1), boundp(np+1); // big enough for 0 and 1-based NgBitArray origpoint(np+1), boundp(np+1); // big enough for 0 and 1-based
@ -645,10 +646,6 @@ void MeshOptimize3d :: SplitImprove (Mesh & mesh,
(*testout) << "Total badness = " << bad1 << endl; (*testout) << "Total badness = " << bad1 << endl;
} }
for (ElementIndex ei : mesh.VolumeElements().Range())
for (PointIndex pi : mesh[ei].PNums())
elementsonnode.Add (pi, ei);
mesh.MarkIllegalElements(); mesh.MarkIllegalElements();
if (goal == OPT_QUALITY || goal == OPT_LEGAL) if (goal == OPT_QUALITY || goal == OPT_LEGAL)
{ {