diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index afc00fd8..05126945 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -2530,10 +2530,10 @@ namespace netgen { if (el.GetNP() == 4) { - INDEX_4 i4(el[0], el[1], el[2], el[3]); + PointIndices<4> i4(el[0], el[1], el[2], el[3]); i4.Sort(); - table.Add (PointIndex(i4.I1()), ei); - table.Add (PointIndex(i4.I2()), ei); + table.Add (i4.I1(), ei); + table.Add (i4.I2(), ei); } else { @@ -3127,7 +3127,7 @@ namespace netgen for (int i = 1; i <= faceht.GetNBags(); i++) for (int j = 1; j <= faceht.GetBagSize(i); j++) { - INDEX_3 i2; + PointIndices<3> i2; int data; faceht.GetData (i, j, i2, data); if (data) // surfnr @@ -4178,7 +4178,7 @@ namespace netgen { Array hpoints; - int npi = PointIndex::BASE; + PointIndex npi = IndexBASE(); for (PointIndex pi : points.Range()) if (pused[pi]) { @@ -4932,8 +4932,7 @@ namespace netgen // make minimal node to node 1 int minpi=0; - PointIndex minpnum; - minpnum = GetNP() + 1; + PointIndex minpnum = IndexBASE()+GetNP(); for (int j = 1; j <= 6; j++) { @@ -4953,10 +4952,9 @@ namespace netgen while (minpi > 1) { - int hi = 0; for (int j = 0; j <= 3; j+= 3) { - hi = el.PNum(1+j); + PointIndex hi = el.PNum(1+j); el.PNum(1+j) = el.PNum(2+j); el.PNum(2+j) = el.PNum(3+j); el.PNum(3+j) = hi; @@ -5028,8 +5026,7 @@ namespace netgen // make minimal node to node 1 int minpi=0; - PointIndex minpnum; - minpnum = GetNP() + 1; + PointIndex minpnum = GetNP() + IndexBASE(); for (int j = 1; j <= 8; j++) { @@ -5049,10 +5046,9 @@ namespace netgen while (minpi > 1) { - int hi = 0; for (int j = 0; j <= 4; j+= 4) { - hi = el.PNum(1+j); + PointIndex hi = el.PNum(1+j); el.PNum(1+j) = el.PNum(2+j); el.PNum(2+j) = el.PNum(3+j); el.PNum(3+j) = el.PNum(4+j); @@ -7007,8 +7003,8 @@ namespace netgen int mlold = mlbetweennodes.Size(); mlbetweennodes.SetSize(np); if (np > mlold) - for (int i = mlold+PointIndex::BASE; - i < np+PointIndex::BASE; i++) + for (PointIndex i = mlold+IndexBASE(); + i < np+IndexBASE(); i++) { mlbetweennodes[i][0].Invalidate(); mlbetweennodes[i][1].Invalidate(); diff --git a/libsrc/meshing/meshfunc.cpp b/libsrc/meshing/meshfunc.cpp index 8fae3dc8..20eaa6a0 100644 --- a/libsrc/meshing/meshfunc.cpp +++ b/libsrc/meshing/meshfunc.cpp @@ -562,7 +562,7 @@ namespace netgen auto first_new_pi = m_.pmap.Range().Next(); auto & m = *m_.mesh; Array pmap(m.Points().Size()); - for(auto pi : Range(PointIndex(PointIndex::BASE), first_new_pi)) + for(auto pi : Range(IndexBASE(), first_new_pi)) pmap[pi] = m_.pmap[pi]; for (auto pi : Range(first_new_pi, m.Points().Range().Next())) @@ -594,7 +594,7 @@ namespace netgen for(auto & m : meshes) { Array pmap(m.Points().Size()); - for(auto pi : Range(PointIndex(PointIndex::BASE), first_new_pi)) + for(auto pi : Range(IndexBASE(), first_new_pi)) pmap[pi] = pi; for (auto pi : Range(first_new_pi, m.Points().Range().Next())) diff --git a/libsrc/meshing/meshing3.cpp b/libsrc/meshing/meshing3.cpp index 65c7edb4..80ed0225 100644 --- a/libsrc/meshing/meshing3.cpp +++ b/libsrc/meshing/meshing3.cpp @@ -389,10 +389,9 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp) delfaces.SetSize (0); - INDEX npi; Element newel(TET); - npi = mesh.AddPoint (inp); + PointIndex npi = mesh.AddPoint (inp); newel.SetNP(4); newel.PNum(4) = npi; diff --git a/libsrc/meshing/meshtype.hpp b/libsrc/meshing/meshtype.hpp index 1d41d938..49a17725 100644 --- a/libsrc/meshing/meshtype.hpp +++ b/libsrc/meshing/meshtype.hpp @@ -858,7 +858,7 @@ namespace netgen bool IsDeleted () const { #ifdef DEBUG - if (pnum[0] < PointIndex::BASE && !deleted) + if ((pnum[0]-IndexBASE() < 0) && !deleted) cerr << "Surfelement has illegal pnum, but not marked as deleted" << endl; #endif return deleted; @@ -1238,7 +1238,7 @@ namespace netgen bool IsDeleted () const { #ifdef DEBUG - if (pnum[0] < PointIndex::BASE && !flags.deleted) + if (pnum[0]-IndexBASE() < 0 && !flags.deleted) cerr << "Volelement has illegal pnum, but not marked as deleted" << endl; #endif