diff --git a/libsrc/general/ngbitarray.hpp b/libsrc/general/ngbitarray.hpp index 637d1814..e4f145b5 100644 --- a/libsrc/general/ngbitarray.hpp +++ b/libsrc/general/ngbitarray.hpp @@ -12,7 +12,6 @@ namespace netgen { - /** data type NgBitArray @@ -29,8 +28,12 @@ class NgBitArray unsigned char * data; public: + + [[ deprecated ("use BitArray instead")]] DLL_HEADER NgBitArray (); /// + [[ deprecated ("use BitArray instead")]] + DLL_HEADER NgBitArray (INDEX asize); /// DLL_HEADER ~NgBitArray (); diff --git a/libsrc/meshing/classifyhpel.hpp b/libsrc/meshing/classifyhpel.hpp index def1c67c..ae66fe02 100644 --- a/libsrc/meshing/classifyhpel.hpp +++ b/libsrc/meshing/classifyhpel.hpp @@ -1,5 +1,5 @@ HPREF_ELEMENT_TYPE ClassifyTet(HPRefElement & el, INDEX_2_HASHTABLE & edges, INDEX_2_HASHTABLE & edgepoint_dom, - NgBitArray & cornerpoint, NgBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + TBitArray & cornerpoint, TBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, INDEX_2_HASHTABLE & surf_edges, NgArray & facepoint) { int ep1(0), ep2(0), ep3(0), ep4(0), cp1(0), cp2(0), cp3(0), cp4(0), fp1, fp2, fp3, fp4; @@ -587,7 +587,7 @@ HPREF_ELEMENT_TYPE ClassifyTet(HPRefElement & el, INDEX_2_HASHTABLE & edges HPREF_ELEMENT_TYPE ClassifyPrism(HPRefElement & el, INDEX_2_HASHTABLE & edges, INDEX_2_HASHTABLE & edgepoint_dom, - NgBitArray & cornerpoint, NgBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + TBitArray & cornerpoint, TBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, INDEX_2_HASHTABLE & surf_edges, NgArray & facepoint) { @@ -824,7 +824,7 @@ HPREF_ELEMENT_TYPE ClassifyPrism(HPRefElement & el, INDEX_2_HASHTABLE & edg // #ifdef SABINE HPREF_ELEMENT_TYPE ClassifyTrig(HPRefElement & el, INDEX_2_HASHTABLE & edges, INDEX_2_HASHTABLE & edgepoint_dom, - NgBitArray & cornerpoint, NgBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + TBitArray & cornerpoint, TBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, INDEX_2_HASHTABLE & surf_edges, NgArray & facepoint, int dim, const FaceDescriptor & fd) { @@ -1301,7 +1301,7 @@ HPREF_ELEMENT_TYPE ClassifyTrig(HPRefElement & el, INDEX_2_HASHTABLE & edge } #endif HPREF_ELEMENT_TYPE ClassifyQuad(HPRefElement & el, INDEX_2_HASHTABLE & edges, INDEX_2_HASHTABLE & edgepoint_dom, - NgBitArray & cornerpoint, NgBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + TBitArray & cornerpoint, TBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, INDEX_2_HASHTABLE & surf_edges, NgArray & facepoint, int dim, const FaceDescriptor & fd) { HPREF_ELEMENT_TYPE type = HP_NONE; @@ -1651,7 +1651,7 @@ HPREF_ELEMENT_TYPE ClassifyQuad(HPRefElement & el, INDEX_2_HASHTABLE & edge HPREF_ELEMENT_TYPE ClassifyHex(HPRefElement & el, INDEX_2_HASHTABLE & edges, INDEX_2_HASHTABLE & edgepoint_dom, - NgBitArray & cornerpoint, NgBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + TBitArray & cornerpoint, TBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, INDEX_2_HASHTABLE & surf_edges, NgArray & facepoint) { HPREF_ELEMENT_TYPE type = HP_NONE; @@ -1756,7 +1756,8 @@ HPREF_ELEMENT_TYPE ClassifyHex(HPRefElement & el, INDEX_2_HASHTABLE & edges HPREF_ELEMENT_TYPE ClassifyHex7 (HPRefElement & el, INDEX_2_HASHTABLE & edges, INDEX_2_HASHTABLE & edgepoint_dom, - NgBitArray & cornerpoint, NgBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + TBitArray & cornerpoint, TBitArray & edgepoint, + INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, INDEX_2_HASHTABLE & surf_edges, NgArray & facepoint) { // HPREF_ELEMENT_TYPE type = HP_NONE; @@ -1795,7 +1796,8 @@ HPREF_ELEMENT_TYPE ClassifyHex7 (HPRefElement & el, INDEX_2_HASHTABLE & edg HPREF_ELEMENT_TYPE ClassifySegm(HPRefElement & hpel, INDEX_2_HASHTABLE & edges, INDEX_2_HASHTABLE & edgepoint_dom, - NgBitArray & cornerpoint, NgBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + TBitArray & cornerpoint, TBitArray & edgepoint, + INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, INDEX_2_HASHTABLE & surf_edges, NgArray & facepoint) { @@ -1838,7 +1840,8 @@ HPREF_ELEMENT_TYPE ClassifySegm(HPRefElement & hpel, INDEX_2_HASHTABLE & ed HPREF_ELEMENT_TYPE ClassifyPyramid(HPRefElement & el, INDEX_2_HASHTABLE & edges, INDEX_2_HASHTABLE & edgepoint_dom, - NgBitArray & cornerpoint, NgBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + TBitArray & cornerpoint, TBitArray & edgepoint, + INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, INDEX_2_HASHTABLE & surf_edges, NgArray & facepoint) { // *testout << "classify pyramid, pnums = "; diff --git a/libsrc/meshing/delaunay.cpp b/libsrc/meshing/delaunay.cpp index 3e42ca32..1f583abd 100644 --- a/libsrc/meshing/delaunay.cpp +++ b/libsrc/meshing/delaunay.cpp @@ -1281,7 +1281,7 @@ namespace netgen auto ne = tempels.Size(); - NgBitArray inner(ne), outer(ne); + BitArray inner(ne+1), outer(ne+1); inner.Clear(); outer.Clear(); NgArray elstack; @@ -1346,9 +1346,9 @@ namespace netgen if (!inner.Test(ei) && !outer.Test(ei)) { if (inside) - inner.Set(ei); + inner.SetBit(ei); else - outer.Set(ei); + outer.SetBit(ei); for (int j = 1; j <= 4; j++) @@ -1439,7 +1439,7 @@ namespace netgen if (adfront->Inside(ci)) outer.Clear(i); else - outer.Set(i); + outer.SetBit(i); } } diff --git a/libsrc/meshing/hprefinement.cpp b/libsrc/meshing/hprefinement.cpp index 6afabfb2..5b3e4152 100644 --- a/libsrc/meshing/hprefinement.cpp +++ b/libsrc/meshing/hprefinement.cpp @@ -1632,8 +1632,8 @@ namespace netgen } } -bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE & edges, INDEX_2_HASHTABLE & edgepoint_dom, - NgBitArray & cornerpoint, NgBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE & edges, INDEX_2_HASHTABLE & edgepoint_dom, + TBitArray & cornerpoint, TBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, INDEX_2_HASHTABLE & surf_edges, NgArray & facepoint, int & levels, int & act_ref) { bool sing = 0; @@ -1670,7 +1670,7 @@ bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE & edges, INDEX_2_HAS { if (mesh.Point(i).Singularity() * levels >= act_ref) { - cornerpoint.Set(i); + cornerpoint.SetBit(i); sing = 1; } } @@ -1695,8 +1695,8 @@ bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE & edges, INDEX_2_HAS edges.Set (i2s, 1); - edgepoint.Set (i2.I1()); - edgepoint.Set (i2.I2()); + edgepoint.SetBit (i2.I1()); + edgepoint.SetBit (i2.I2()); sing = 1; } @@ -1718,10 +1718,10 @@ bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE & edges, INDEX_2_HAS ek.Sort(); if (edges.Used(ej) && edges.Used(ek)) { - if (ej.I1() == ek.I1()) cornerpoint.Set (ek.I1()); - if (ej.I1() == ek.I2()) cornerpoint.Set (ek.I2()); - if (ej.I2() == ek.I1()) cornerpoint.Set (ek.I1()); - if (ej.I2() == ek.I2()) cornerpoint.Set (ek.I2()); + if (ej.I1() == ek.I1()) cornerpoint.SetBit (ek.I1()); + if (ej.I1() == ek.I2()) cornerpoint.SetBit (ek.I2()); + if (ej.I2() == ek.I1()) cornerpoint.SetBit (ek.I1()); + if (ej.I2() == ek.I2()) cornerpoint.SetBit (ek.I2()); } } } @@ -1801,10 +1801,10 @@ bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE & edges, INDEX_2_HAS if (seg.singedge_left * levels >= act_ref) { INDEX_2 i2 = INDEX_2::Sort(mesh.LineSegment(i)[0], - mesh.LineSegment(i)[1]); + mesh.LineSegment(i)[1]); edges.Set(i2,1); - edgepoint.Set(i2.I1()); - edgepoint.Set(i2.I2()); + edgepoint.SetBit(i2.I1()); + edgepoint.SetBit(i2.I2()); *testout << " singleft " << endl; *testout << " mesh.LineSegment(i).domout " << mesh.LineSegment(i).domout << endl; *testout << " mesh.LineSegment(i).domin " << mesh.LineSegment(i).domin << endl; @@ -1819,8 +1819,8 @@ bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE & edges, INDEX_2_HAS INDEX_2 i2 = INDEX_2::Sort(mesh.LineSegment(i)[1], mesh.LineSegment(i)[0]); edges.Set (i2, 1); - edgepoint.Set(i2.I1()); - edgepoint.Set(i2.I2()); + edgepoint.SetBit(i2.I1()); + edgepoint.SetBit(i2.I2()); *testout << " singright " << endl; *testout << " mesh.LineSegment(i).domout " << mesh.LineSegment(i).domout << endl; @@ -1858,14 +1858,14 @@ bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE & edges, INDEX_2_HAS if (surfonpoint.Get(i).I1()) { // cornerpoint.Set(i); // disabled by JS, Aug 2009 - edgepoint.Set(i); + edgepoint.SetBit(i); } // mark points for refinement that are explicitly specified in input file if (mesh.Point(i).Singularity()*levels >= act_ref) { - cornerpoint.Set(i); - edgepoint.Set(i); + cornerpoint.SetBit(i); + edgepoint.SetBit(i); sing = 1; } } @@ -1890,11 +1890,11 @@ bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE & edges, INDEX_2_HAS bool ClassifyHPElements (Mesh & mesh, NgArray & elements, SplittingType split, int & act_ref, int & levels) { INDEX_2_HASHTABLE edges(mesh.GetNSeg()+1); - NgBitArray edgepoint(mesh.GetNP()); + TBitArray edgepoint(mesh.GetNP()); INDEX_2_HASHTABLE edgepoint_dom(mesh.GetNSeg()+1); edgepoint.Clear(); - NgBitArray cornerpoint(mesh.GetNP()); + TBitArray cornerpoint(mesh.GetNP()); cornerpoint.Clear(); // value = nr > 0 ... refine elements in domain nr diff --git a/libsrc/meshing/improve3.cpp b/libsrc/meshing/improve3.cpp index 53a409c9..13c90f1f 100644 --- a/libsrc/meshing/improve3.cpp +++ b/libsrc/meshing/improve3.cpp @@ -704,7 +704,7 @@ void MeshOptimize3d :: SplitImprove () double MeshOptimize3d :: SwapImproveEdge ( - const NgBitArray * working_elements, + const BitArray * working_elements, Table & elementsonnode, INDEX_3_HASHTABLE & faces, PointIndex pi1, PointIndex pi2, bool check_only) @@ -1328,7 +1328,7 @@ double MeshOptimize3d :: SwapImproveEdge ( return d_badness; } -void MeshOptimize3d :: SwapImprove (const NgBitArray * working_elements) +void MeshOptimize3d :: SwapImprove (const BitArray * working_elements) { static Timer t("MeshOptimize3d::SwapImprove"); RegionTimer reg(t); static Timer tloop("MeshOptimize3d::SwapImprove loop"); @@ -1466,7 +1466,7 @@ void MeshOptimize3d :: SwapImprove (const NgBitArray * working_elements) void MeshOptimize3d :: SwapImproveSurface ( - const NgBitArray * working_elements, + const BitArray * working_elements, const NgArray< idmap_type* > * idmaps) { NgArray< idmap_type* > locidmaps; diff --git a/libsrc/meshing/improve3.hpp b/libsrc/meshing/improve3.hpp index 1123a99d..1f02df22 100644 --- a/libsrc/meshing/improve3.hpp +++ b/libsrc/meshing/improve3.hpp @@ -41,9 +41,9 @@ public: double SplitImprove2Element (ElementIndex ei, const Table & elements_of_point, bool check_only); - double SwapImproveEdge (const NgBitArray * working_elements, Table & elementsonnode, INDEX_3_HASHTABLE & faces, PointIndex pi1, PointIndex pi2, bool check_only=false); - void SwapImprove (const NgBitArray * working_elements = NULL); - void SwapImproveSurface (const NgBitArray * working_elements = NULL, + double SwapImproveEdge (const BitArray * working_elements, Table & elementsonnode, INDEX_3_HASHTABLE & faces, PointIndex pi1, PointIndex pi2, bool check_only=false); + void SwapImprove (const BitArray * working_elements = NULL); + void SwapImproveSurface (const BitArray * working_elements = NULL, const NgArray< idmap_type* > * idmaps = NULL); void SwapImprove2 (); double SwapImprove2 (ElementIndex eli1, int face, Table & elementsonnode, TABLE & belementsonnode, bool check_only=false ); diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index 060512b2..aa54fe3d 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -2457,7 +2457,7 @@ namespace netgen } // NgBitArray base is PointIndex::BASE ... - void Mesh :: FixPoints (const NgBitArray & fixpoints) + void Mesh :: FixPoints (const TBitArray & fixpoints) { if (fixpoints.Size() != GetNP()) { @@ -3219,14 +3219,14 @@ namespace netgen int np = GetNP(); FindOpenSegments(); - NgBitArray frontpoints(np+1); // for 0- and 1-based + TBitArray frontpoints(np); // for 0- and 1-based frontpoints.Clear(); for (int i = 1; i <= GetNOpenSegments(); i++) { const Segment & seg = GetOpenSegment(i); - frontpoints.Set (seg[0]); - frontpoints.Set (seg[1]); + frontpoints.SetBit (seg[0]); + frontpoints.SetBit (seg[1]); } for (int i = 1; i <= GetNSE(); i++) @@ -4799,10 +4799,10 @@ namespace netgen void Mesh :: SurfaceMeshOrientation () { - int i, j; + // int i, j; int nse = GetNSE(); - NgBitArray used(nse); + BitArray used(nse+1); used.Clear(); INDEX_2_HASHTABLE edges(nse+1); @@ -4810,12 +4810,12 @@ namespace netgen const Element2d & tri = SurfaceElement(1); - for (j = 1; j <= 3; j++) + for (int j = 1; j <= 3; j++) { INDEX_2 i2(tri.PNumMod(j), tri.PNumMod(j+1)); edges.Set (i2, 1); } - used.Set(1); + used.SetBit(1); bool unused; do @@ -4824,12 +4824,12 @@ namespace netgen do { changed = 0; - for (i = 1; i <= nse; i++) + for (int i = 1; i <= nse; i++) if (!used.Test(i)) { Element2d & el = surfelements[i-1]; int found = 0, foundrev = 0; - for (j = 1; j <= 3; j++) + for (int j = 1; j <= 3; j++) { INDEX_2 i2(el.PNumMod(j), el.PNumMod(j+1)); if (edges.Used(i2)) @@ -4845,12 +4845,12 @@ namespace netgen swap (el.PNum(2), el.PNum(3)); changed = 1; - for (j = 1; j <= 3; j++) + for (int j = 1; j <= 3; j++) { INDEX_2 i2(el.PNumMod(j), el.PNumMod(j+1)); edges.Set (i2, 1); } - used.Set (i); + used.SetBit (i); } } if (changed) @@ -4860,17 +4860,17 @@ namespace netgen unused = 0; - for (i = 1; i <= nse; i++) + for (int i = 1; i <= nse; i++) if (!used.Test(i)) { unused = 1; const Element2d & tri = SurfaceElement(i); - for (j = 1; j <= 3; j++) + for (int j = 1; j <= 3; j++) { INDEX_2 i2(tri.PNumMod(j), tri.PNumMod(j+1)); edges.Set (i2, 1); } - used.Set(i); + used.SetBit(i); break; } } @@ -6105,17 +6105,17 @@ namespace netgen void Mesh :: SplitIntoParts() { - int i, j, dom; + // int i, j, dom; int ne = GetNE(); int np = GetNP(); int nse = GetNSE(); - NgBitArray surfused(nse); - NgBitArray pused (np); + BitArray surfused(nse+1); + TBitArray pused (np); surfused.Clear(); - dom = 0; + int dom = 0; while (1) { @@ -6126,15 +6126,15 @@ namespace netgen pused.Clear(); int found = 0; - for (i = 1; i <= nse; i++) + for (int i = 1; i <= nse; i++) if (!surfused.Test(i)) { SurfaceElement(i).SetIndex (dom); - for (j = 1; j <= 3; j++) - pused.Set (SurfaceElement(i).PNum(j)); + for (int j = 1; j <= 3; j++) + pused.SetBit (SurfaceElement(i).PNum(j)); found = 1; cntd = 1; - surfused.Set(i); + surfused.SetBit(i); break; } @@ -6145,10 +6145,10 @@ namespace netgen do { change = 0; - for (i = 1; i <= nse; i++) + for (int i = 1; i <= nse; i++) { int is = 0, isnot = 0; - for (j = 1; j <= 3; j++) + for (int j = 1; j <= 3; j++) if (pused.Test(SurfaceElement(i).PNum(j))) is = 1; else @@ -6157,15 +6157,15 @@ namespace netgen if (is && isnot) { change = 1; - for (j = 1; j <= 3; j++) - pused.Set (SurfaceElement(i).PNum(j)); + for (int j = 1; j <= 3; j++) + pused.SetBit (SurfaceElement(i).PNum(j)); } if (is) { if (!surfused.Test(i)) { - surfused.Set(i); + surfused.SetBit(i); SurfaceElement(i).SetIndex (dom); cntd++; } @@ -6173,10 +6173,10 @@ namespace netgen } - for (i = 1; i <= ne; i++) + for (int i = 1; i <= ne; i++) { int is = 0, isnot = 0; - for (j = 1; j <= 4; j++) + for (int j = 1; j <= 4; j++) if (pused.Test(VolumeElement(i).PNum(j))) is = 1; else @@ -6185,8 +6185,8 @@ namespace netgen if (is && isnot) { change = 1; - for (j = 1; j <= 4; j++) - pused.Set (VolumeElement(i).PNum(j)); + for (int j = 1; j <= 4; j++) + pused.SetBit (VolumeElement(i).PNum(j)); } if (is) @@ -6210,7 +6210,7 @@ namespace netgen } */ ClearFaceDescriptors(); - for (i = 1; i <= dom; i++) + for (int i = 1; i <= dom; i++) AddFaceDescriptor (FaceDescriptor (0, i, 0, 0)); CalcSurfacesOfNode(); timestamp = NextTimeStamp(); @@ -6222,7 +6222,7 @@ namespace netgen int fdi; int np = GetNP(); - NgBitArray usedp(np); + TBitArray usedp(np); Array els_of_face; fdi = 1; @@ -6240,7 +6240,7 @@ namespace netgen usedp.Clear(); for (int j = 1; j <= SurfaceElement(firstel).GetNP(); j++) - usedp.Set (SurfaceElement(firstel).PNum(j)); + usedp.SetBit (SurfaceElement(firstel).PNum(j)); bool changed; do @@ -6266,7 +6266,7 @@ namespace netgen if (has) for (int j = 0; j < el.GetNP(); j++) - usedp.Set (el[j]); + usedp.SetBit (el[j]); } } while (changed); diff --git a/libsrc/meshing/meshclass.hpp b/libsrc/meshing/meshclass.hpp index 87bd6f99..7a244a3d 100644 --- a/libsrc/meshing/meshclass.hpp +++ b/libsrc/meshing/meshclass.hpp @@ -425,7 +425,7 @@ namespace netgen DLL_HEADER void CalcSurfacesOfNode (); /// additional (temporarily) fix points - void FixPoints (const NgBitArray & fixpoints); + void FixPoints (const TBitArray & fixpoints); /** finds elements without neighbour and @@ -606,10 +606,11 @@ namespace netgen DLL_HEADER void ImproveMesh (const MeshingParameters & mp, OPTIMIZEGOAL goal = OPT_QUALITY); /// - void ImproveMeshJacobian (const MeshingParameters & mp, OPTIMIZEGOAL goal = OPT_QUALITY, const NgBitArray * usepoint = NULL); + void ImproveMeshJacobian (const MeshingParameters & mp, OPTIMIZEGOAL goal = OPT_QUALITY, + const TBitArray * usepoint = NULL); /// void ImproveMeshJacobianOnSurface (const MeshingParameters & mp, - const NgBitArray & usepoint, + const TBitArray & usepoint, const NgArray< Vec<3>* > & nv, OPTIMIZEGOAL goal = OPT_QUALITY, const NgArray< idmap_type* > * idmaps = NULL); diff --git a/libsrc/meshing/refine.cpp b/libsrc/meshing/refine.cpp index e3779598..6c45efe7 100644 --- a/libsrc/meshing/refine.cpp +++ b/libsrc/meshing/refine.cpp @@ -820,11 +820,11 @@ namespace netgen can.Elem(parent.I2())); } - NgBitArray boundp(np); + TBitArray boundp(np); boundp.Clear(); for (auto & sel : mesh.SurfaceElements()) for (auto pi : sel.PNums()) - boundp.Set(pi); + boundp.SetBit(pi); double lam = 0.5; @@ -851,14 +851,14 @@ namespace netgen mesh.Point(i) = can.Get(i); - NgBitArray free (mesh.GetNP()), fhelp(mesh.GetNP()); + TBitArray free (mesh.GetNP()), fhelp(mesh.GetNP()); free.Clear(); for (int i = 1; i <= mesh.GetNE(); i++) { const Element & el = mesh.VolumeElement(i); if (el.Volume(mesh.Points()) < 0) for (int j = 1; j <= el.GetNP(); j++) - free.Set (el.PNum(j)); + free.SetBit (el.PNum(j)); } for (int k = 1; k <= 3; k++) { @@ -872,7 +872,7 @@ namespace netgen freeel = 1; if (freeel) for (int j = 1; j <= el.GetNP(); j++) - fhelp.Set (el.PNum(j)); + fhelp.SetBit (el.PNum(j)); } free.Or (fhelp); } diff --git a/libsrc/meshing/secondorder.cpp b/libsrc/meshing/secondorder.cpp index a0b8e468..7734f237 100644 --- a/libsrc/meshing/secondorder.cpp +++ b/libsrc/meshing/secondorder.cpp @@ -481,7 +481,7 @@ namespace netgen double facok = 0; double factry; - NgBitArray illegalels(ne); + BitArray illegalels(ne+1); illegalels.Clear(); @@ -505,13 +505,13 @@ namespace netgen can.Elem(parents.Get(i).I2())); } - NgBitArray boundp(np); + TBitArray boundp(np); boundp.Clear(); for (int i = 1; i <= mesh.GetNSE(); i++) { const Element2d & sel = mesh.SurfaceElement(i); for (int j = 1; j <= sel.GetNP(); j++) - boundp.Set(sel.PNum(j)); + boundp.SetBit(sel.PNum(j)); } @@ -563,7 +563,7 @@ namespace netgen if (lam < 1e-4) - illegalels.Set(i); + illegalels.SetBit(i); /* diff --git a/libsrc/meshing/smoothing2.5.cpp b/libsrc/meshing/smoothing2.5.cpp index 587c8d47..7f175882 100644 --- a/libsrc/meshing/smoothing2.5.cpp +++ b/libsrc/meshing/smoothing2.5.cpp @@ -110,7 +110,7 @@ namespace netgen int np = mesh.GetNP(); int ne = mesh.GetNE(); - NgBitArray badnodes(np); + TBitArray badnodes(np); badnodes.Clear(); for (i = 1; i <= ne; i++) @@ -119,7 +119,7 @@ namespace netgen double bad = el.CalcJacobianBadness (mesh.Points()); if (bad > 1) for (j = 1; j <= el.GetNP(); j++) - badnodes.Set (el.PNum(j)); + badnodes.SetBit (el.PNum(j)); } diff --git a/libsrc/meshing/smoothing3.cpp b/libsrc/meshing/smoothing3.cpp index 74370a05..0d8a1c5e 100644 --- a/libsrc/meshing/smoothing3.cpp +++ b/libsrc/meshing/smoothing3.cpp @@ -1485,7 +1485,7 @@ void Mesh :: ImproveMesh (const MeshingParameters & mp, OPTIMIZEGOAL goal) // Improve Condition number of Jacobian, any elements void Mesh :: ImproveMeshJacobian (const MeshingParameters & mp, - OPTIMIZEGOAL goal, const NgBitArray * usepoint) + OPTIMIZEGOAL goal, const TBitArray * usepoint) { // int i, j; @@ -1507,7 +1507,7 @@ void Mesh :: ImproveMeshJacobian (const MeshingParameters & mp, par.maxit_linsearch = 20; par.maxit_bfgs = 20; - NgBitArray badnodes(np); + TBitArray badnodes(np); badnodes.Clear(); for (int i = 1; i <= ne; i++) @@ -1516,7 +1516,7 @@ void Mesh :: ImproveMeshJacobian (const MeshingParameters & mp, double bad = el.CalcJacobianBadness (Points()); if (bad > 1) for (int j = 1; j <= el.GetNP(); j++) - badnodes.Set (el.PNum(j)); + badnodes.SetBit (el.PNum(j)); } NgArray pointh (points.Size()); @@ -1608,7 +1608,7 @@ void Mesh :: ImproveMeshJacobian (const MeshingParameters & mp, // Improve Condition number of Jacobian, any elements void Mesh :: ImproveMeshJacobianOnSurface (const MeshingParameters & mp, - const NgBitArray & usepoint, + const TBitArray & usepoint, const NgArray< Vec<3>* > & nv, OPTIMIZEGOAL goal, const NgArray< idmap_type* > * idmaps) @@ -1664,7 +1664,7 @@ void Mesh :: ImproveMeshJacobianOnSurface (const MeshingParameters & mp, par.maxit_linsearch = 20; par.maxit_bfgs = 20; - NgBitArray badnodes(np); + TBitArray badnodes(np); badnodes.Clear(); for (int i = 1; i <= ne; i++) @@ -1673,7 +1673,7 @@ void Mesh :: ImproveMeshJacobianOnSurface (const MeshingParameters & mp, double bad = el.CalcJacobianBadness (Points()); if (bad > 1) for (int j = 1; j <= el.GetNP(); j++) - badnodes.Set (el.PNum(j)); + badnodes.SetBit (el.PNum(j)); } NgArray pointh (points.Size()); diff --git a/libsrc/meshing/specials.cpp b/libsrc/meshing/specials.cpp index a391ee94..574c748c 100644 --- a/libsrc/meshing/specials.cpp +++ b/libsrc/meshing/specials.cpp @@ -62,13 +62,13 @@ void CutOffAndCombine (Mesh & mesh, const Mesh & othermesh) } cout << endl; - NgBitArray connected(mesh.GetNP()); + TBitArray connected(mesh.GetNP()); connected.Clear(); for (i = 1; i <= mesh.GetNSE(); i++) { const Element2d & el = mesh.SurfaceElement(i); for (j = 1; j <= 3; j++) - connected.Set(el.PNum(j)); + connected.SetBit(el.PNum(j)); } bool changed; @@ -92,7 +92,7 @@ void CutOffAndCombine (Mesh & mesh, const Mesh & othermesh) { changed = 1; for (j = 0; j < 4; j++) - connected.Set (el[j]); + connected.SetBit (el[j]); } } } @@ -120,7 +120,7 @@ void CutOffAndCombine (Mesh & mesh, const Mesh & othermesh) mesh.Compress(); mesh.FindOpenElements(); - NgBitArray locked(mesh.GetNP()); + TBitArray locked(mesh.GetNP()); locked.Set(); for (i = 1; i <= mesh.GetNOpenElements(); i++) for (j = 1; j <= 3; j++) diff --git a/libsrc/meshing/validate.cpp b/libsrc/meshing/validate.cpp index 781e6cd0..f3c254a1 100644 --- a/libsrc/meshing/validate.cpp +++ b/libsrc/meshing/validate.cpp @@ -104,7 +104,7 @@ namespace netgen } - void GetWorkingArea(NgBitArray & working_elements, NgBitArray & working_points, + void GetWorkingArea(BitArray & working_elements, TBitArray & working_points, const Mesh & mesh, const NgArray & bad_elements, const int width) { @@ -113,10 +113,10 @@ namespace netgen for(int i=0; i; } - NgBitArray isboundarypoint(np),isedgepoint(np); + TBitArray isboundarypoint(np),isedgepoint(np); isboundarypoint.Clear(); isedgepoint.Clear(); for(int i = 1; i <= mesh.GetNSeg(); i++) { const Segment & seg = mesh.LineSegment(i); - isedgepoint.Set(seg[0]); - isedgepoint.Set(seg[1]); + isedgepoint.SetBit(seg[0]); + isedgepoint.SetBit(seg[1]); } NgArray surfaceindex(np); @@ -205,7 +205,7 @@ namespace netgen for (int j = 1; j <= sel.GetNP(); j++) if(!isedgepoint.Test(sel.PNum(j))) { - isboundarypoint.Set(sel.PNum(j)); + isboundarypoint.SetBit(sel.PNum(j)); surfaceindex[sel.PNum(j) - PointIndex::BASE] = mesh.GetFaceDescriptor(sel.GetIndex()).SurfNr(); } @@ -216,8 +216,8 @@ namespace netgen Validate(mesh,bad_elements,pure_badness, ((uselocalworsening) ? (0.8*(max_worsening-1.) + 1.) : (0.1*(max_worsening-1.) + 1.)), uselocalworsening); // -> larger working area - NgBitArray working_elements(ne); - NgBitArray working_points(np); + BitArray working_elements(ne+1); + TBitArray working_points(np); GetWorkingArea(working_elements,working_points,mesh,bad_elements,numbadneighbours); //working_elements.Set(); @@ -240,10 +240,10 @@ namespace netgen PrintMessage(5,ostrstr.str()); - NgBitArray isworkingboundary(np); + TBitArray isworkingboundary(np); for(int i=1; i<=np; i++) if(working_points.Test(i) && isboundarypoint.Test(i)) - isworkingboundary.Set(i); + isworkingboundary.SetBit(i); else isworkingboundary.Clear(i); @@ -497,7 +497,7 @@ namespace netgen GetWorkingArea(working_elements,working_points,mesh,bad_elements,numbadneighbours); for(int i=1; i<=np; i++) if(working_points.Test(i) && isboundarypoint.Test(i)) - isworkingboundary.Set(i); + isworkingboundary.SetBit(i); else isworkingboundary.Clear(i); auxnum=0;