From 1584da69ae88845ec3d55e9f783669a96553928a Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Wed, 28 Aug 2019 14:00:49 +0200 Subject: [PATCH] Rename BitArray to NgBitArray --- libsrc/csg/edgeflw.cpp | 4 +-- libsrc/csg/specpoin.cpp | 4 +-- libsrc/csg/triapprox.cpp | 2 +- libsrc/csg/zrefine.cpp | 2 +- libsrc/general/CMakeLists.txt | 4 +-- libsrc/general/myadt.hpp | 2 +- .../general/{bitarray.cpp => ngbitarray.cpp} | 20 +++++------ .../general/{bitarray.hpp => ngbitarray.hpp} | 34 +++++++++---------- libsrc/general/seti.hpp | 2 +- libsrc/interface/writeabaqus.cpp | 4 +-- libsrc/interface/writeuser.cpp | 2 +- libsrc/meshing/bisect.cpp | 4 +-- libsrc/meshing/boundarylayer.cpp | 6 ++-- libsrc/meshing/classifyhpel.hpp | 16 ++++----- libsrc/meshing/delaunay.cpp | 4 +-- libsrc/meshing/hprefinement.cpp | 8 ++--- libsrc/meshing/improve3.cpp | 10 +++--- libsrc/meshing/improve3.hpp | 4 +-- libsrc/meshing/meshclass.cpp | 16 ++++----- libsrc/meshing/meshclass.hpp | 6 ++-- libsrc/meshing/refine.cpp | 4 +-- libsrc/meshing/secondorder.cpp | 4 +-- libsrc/meshing/smoothing2.5.cpp | 2 +- libsrc/meshing/smoothing3.cpp | 8 ++--- libsrc/meshing/specials.cpp | 4 +-- libsrc/meshing/validate.cpp | 14 ++++---- libsrc/meshing/validate.hpp | 4 +-- libsrc/visualization/vsmesh.cpp | 2 +- 28 files changed, 98 insertions(+), 98 deletions(-) rename libsrc/general/{bitarray.cpp => ngbitarray.cpp} (77%) rename libsrc/general/{bitarray.hpp => ngbitarray.hpp} (74%) diff --git a/libsrc/csg/edgeflw.cpp b/libsrc/csg/edgeflw.cpp index 1e8b06d4..ab736f91 100644 --- a/libsrc/csg/edgeflw.cpp +++ b/libsrc/csg/edgeflw.cpp @@ -1233,7 +1233,7 @@ namespace netgen *testout << "inv: " << endl << refedgesinv << endl; } - BitArray todelete(refedges.Size()); + NgBitArray todelete(refedges.Size()); todelete.Clear(); @@ -1748,7 +1748,7 @@ namespace netgen int nsol = geometry.GetNTopLevelObjects(); - BitArray pointatsurface (nsurf); + NgBitArray pointatsurface (nsurf); pointatsurface.Clear(); for (int i = 1; i <= mesh.GetNSeg(); i++) diff --git a/libsrc/csg/specpoin.cpp b/libsrc/csg/specpoin.cpp index 9069f36c..1855508c 100644 --- a/libsrc/csg/specpoin.cpp +++ b/libsrc/csg/specpoin.cpp @@ -2060,7 +2060,7 @@ namespace netgen } /* - BitArray testuncond (specpoints.Size()); + NgBitArray testuncond (specpoints.Size()); testuncond.Clear(); for(int i = 0; i map (GetNP()); int i, j; int cnt = 0; diff --git a/libsrc/csg/zrefine.cpp b/libsrc/csg/zrefine.cpp index 10091520..30594d5b 100644 --- a/libsrc/csg/zrefine.cpp +++ b/libsrc/csg/zrefine.cpp @@ -255,7 +255,7 @@ namespace netgen NgArray ref_singular; NgArray ref_slices; - BitArray first_id(geom->identifications.Size()); + NgBitArray first_id(geom->identifications.Size()); first_id.Set(); diff --git a/libsrc/general/CMakeLists.txt b/libsrc/general/CMakeLists.txt index a7410f16..50cd53ce 100644 --- a/libsrc/general/CMakeLists.txt +++ b/libsrc/general/CMakeLists.txt @@ -2,14 +2,14 @@ add_definitions(-DNGINTERFACE_EXPORTS) add_library(gen INTERFACE) set(sdir ${CMAKE_CURRENT_SOURCE_DIR}) target_sources(gen INTERFACE - ${sdir}/ngarray.cpp ${sdir}/bitarray.cpp ${sdir}/dynamicmem.cpp + ${sdir}/ngarray.cpp ${sdir}/ngbitarray.cpp ${sdir}/dynamicmem.cpp ${sdir}/hashtabl.cpp ${sdir}/mystring.cpp ${sdir}/optmem.cpp ${sdir}/parthreads.cpp ${sdir}/seti.cpp ${sdir}/sort.cpp ${sdir}/spbita2d.cpp ${sdir}/table.cpp ${sdir}/mpi_interface.cpp ${sdir}/gzstream.cpp ) install(FILES - ngarray.hpp autodiff.hpp autoptr.hpp bitarray.hpp + ngarray.hpp autodiff.hpp autoptr.hpp ngbitarray.hpp dynamicmem.hpp hashtabl.hpp mpi_interface.hpp myadt.hpp ngsimd.hpp mystring.hpp netgenout.hpp ngpython.hpp optmem.hpp parthreads.hpp seti.hpp sort.hpp diff --git a/libsrc/general/myadt.hpp b/libsrc/general/myadt.hpp index 8d290e88..123bd04c 100644 --- a/libsrc/general/myadt.hpp +++ b/libsrc/general/myadt.hpp @@ -33,7 +33,7 @@ namespace netgen #include "hashtabl.hpp" -#include "bitarray.hpp" +#include "ngbitarray.hpp" #include "spbita2d.hpp" #include "seti.hpp" diff --git a/libsrc/general/bitarray.cpp b/libsrc/general/ngbitarray.cpp similarity index 77% rename from libsrc/general/bitarray.cpp rename to libsrc/general/ngbitarray.cpp index af2dae2a..279a819d 100644 --- a/libsrc/general/bitarray.cpp +++ b/libsrc/general/ngbitarray.cpp @@ -5,7 +5,7 @@ /**************************************************************************/ /* - data type BitArray + data type NgBitArray */ #include @@ -16,25 +16,25 @@ namespace netgen { //using namespace netgen; - BitArray :: BitArray () + NgBitArray :: NgBitArray () { size = 0; data = NULL; } - BitArray :: BitArray (int asize) + NgBitArray :: NgBitArray (int asize) { size = 0; data = NULL; SetSize (asize); } - BitArray :: ~BitArray () + NgBitArray :: ~NgBitArray () { delete [] data; } - void BitArray :: SetSize (int asize) + void NgBitArray :: SetSize (int asize) { if (size == asize) return; delete [] data; @@ -43,14 +43,14 @@ namespace netgen data = new unsigned char [Addr (size)+1]; } - void BitArray :: Set () + void NgBitArray :: Set () { if (!size) return; for (int i = 0; i <= Addr (size); i++) data[i] = UCHAR_MAX; } - void BitArray :: Clear () + void NgBitArray :: Clear () { if (!size) return; for (int i = 0; i <= Addr (size); i++) @@ -59,14 +59,14 @@ namespace netgen - void BitArray :: Invert () + void NgBitArray :: Invert () { if (!size) return; for (int i = 0; i <= Addr (size); i++) data[i] ^= 255; } - void BitArray :: And (const BitArray & ba2) + void NgBitArray :: And (const NgBitArray & ba2) { if (!size) return; for (int i = 0; i <= Addr (size); i++) @@ -74,7 +74,7 @@ namespace netgen } - void BitArray :: Or (const BitArray & ba2) + void NgBitArray :: Or (const NgBitArray & ba2) { if (!size) return; for (int i = 0; i <= Addr (size); i++) diff --git a/libsrc/general/bitarray.hpp b/libsrc/general/ngbitarray.hpp similarity index 74% rename from libsrc/general/bitarray.hpp rename to libsrc/general/ngbitarray.hpp index 95dc5fad..77e07f17 100644 --- a/libsrc/general/bitarray.hpp +++ b/libsrc/general/ngbitarray.hpp @@ -14,26 +14,26 @@ namespace netgen /** - data type BitArray + data type NgBitArray - BitArray is a compressed array of Boolean information. By Set and Clear + NgBitArray is a compressed array of Boolean information. By Set and Clear the whole array or one bit can be set or reset, respectively. Test returns the state of the occurring bit. No range checking is done. index ranges from 0 to size-1 */ -class BitArray +class NgBitArray { INDEX size; unsigned char * data; public: - BitArray (); + NgBitArray (); /// - BitArray (INDEX asize); + NgBitArray (INDEX asize); /// - ~BitArray (); + ~NgBitArray (); /// void SetSize (INDEX asize); @@ -67,9 +67,9 @@ public: /// void Invert (); /// - void And (const BitArray & ba2); + void And (const NgBitArray & ba2); /// - void Or (const BitArray & ba2); + void Or (const NgBitArray & ba2); private: /// inline unsigned char Mask (INDEX i) const @@ -83,15 +83,15 @@ private: } /// - BitArray & operator= (BitArray &); + NgBitArray & operator= (NgBitArray &); /// - BitArray (const BitArray &); + NgBitArray (const NgBitArray &); }; // print bitarray -inline ostream & operator<< (ostream & s, const BitArray & a) +inline ostream & operator<< (ostream & s, const NgBitArray & a) { for (int i = 1; i <= a.Size(); i++) { @@ -105,37 +105,37 @@ inline ostream & operator<< (ostream & s, const BitArray & a) /* inline -INDEX BitArray :: Size () const +INDEX NgBitArray :: Size () const { return size; } inline -unsigned char BitArray :: Mask (INDEX i) const +unsigned char NgBitArray :: Mask (INDEX i) const { return char(1) << (i % CHAR_BIT); } inline -INDEX BitArray :: Addr (INDEX i) const +INDEX NgBitArray :: Addr (INDEX i) const { return (i / CHAR_BIT); } inline -void BitArray :: Set (INDEX i) +void NgBitArray :: Set (INDEX i) { data[Addr(i)] |= Mask(i); } inline -void BitArray :: Clear (INDEX i) +void NgBitArray :: Clear (INDEX i) { data[Addr(i)] &= ~Mask(i); } inline -int BitArray :: Test (INDEX i) const +int NgBitArray :: Test (INDEX i) const { return (data[i / CHAR_BIT] & (char(1) << (i % CHAR_BIT) ) ) ? 1 : 0; } diff --git a/libsrc/general/seti.hpp b/libsrc/general/seti.hpp index 56d1754a..1f576de3 100644 --- a/libsrc/general/seti.hpp +++ b/libsrc/general/seti.hpp @@ -17,7 +17,7 @@ namespace netgen class IndexSet { NgArray set; - BitArray flags; + NgBitArray flags; public: IndexSet (int maxind); diff --git a/libsrc/interface/writeabaqus.cpp b/libsrc/interface/writeabaqus.cpp index 04c84ff0..916600af 100644 --- a/libsrc/interface/writeabaqus.cpp +++ b/libsrc/interface/writeabaqus.cpp @@ -140,7 +140,7 @@ void WriteAbaqusFormat (const Mesh & mesh, int masternode(0); NgArray pairs; - BitArray master(np), help(np); + NgBitArray master(np), help(np); master.Set(); for (i = 1; i <= 3; i++) { @@ -205,7 +205,7 @@ void WriteAbaqusFormat (const Mesh & mesh, << "*EQUATION, INPUT=" << mpcfilename << endl; - BitArray eliminated(np); + NgBitArray eliminated(np); eliminated.Clear(); for (i = 1; i <= mesh.GetIdentifications().GetMaxNr(); i++) { diff --git a/libsrc/interface/writeuser.cpp b/libsrc/interface/writeuser.cpp index 204c4262..56f61fec 100644 --- a/libsrc/interface/writeuser.cpp +++ b/libsrc/interface/writeuser.cpp @@ -938,7 +938,7 @@ void WriteFile (int typ, NgArray edgelist; // edge (point) on boundary ? - BitArray bedge, bpoint(mesh.GetNP()); + NgBitArray bedge, bpoint(mesh.GetNP()); static int eledges[6][2] = { { 1, 2 } , { 1, 3 } , { 1, 4 }, { 2, 3 } , { 2, 4 } , { 3, 4 } }; diff --git a/libsrc/meshing/bisect.cpp b/libsrc/meshing/bisect.cpp index 198f87b5..72bbd56a 100644 --- a/libsrc/meshing/bisect.cpp +++ b/libsrc/meshing/bisect.cpp @@ -3159,7 +3159,7 @@ namespace netgen if (opt.refine_hp) { PrintMessage(3,"refine hp"); - BitArray singv(np); + NgBitArray singv(np); singv.Clear(); if (mesh.GetDimension() == 3) @@ -3833,7 +3833,7 @@ namespace netgen } */ - BitArray isnewpoint(np); + NgBitArray isnewpoint(np); isnewpoint.Clear(); for (int i = 0; i < cutedges.Size(); i++) diff --git a/libsrc/meshing/boundarylayer.cpp b/libsrc/meshing/boundarylayer.cpp index fd857268..4d132615 100644 --- a/libsrc/meshing/boundarylayer.cpp +++ b/libsrc/meshing/boundarylayer.cpp @@ -19,7 +19,7 @@ namespace netgen cout << "Old NP: " << mesh.GetNP() << endl; cout << "Trigs: " << mesh.GetNSE() << endl; - BitArray bndnodes(np); + NgBitArray bndnodes(np); NgArray mapto(np); bndnodes.Clear(); @@ -210,7 +210,7 @@ namespace netgen int nseg = mesh.GetNSeg(); // Indicate which points need to be remapped - BitArray bndnodes(np+1); // big enough for 1-based array + NgBitArray bndnodes(np+1); // big enough for 1-based array // Map of the old points to the new points NgArray mapto(np); @@ -286,7 +286,7 @@ namespace netgen // don't have boundary layers // Bit array to keep track of segments already processed - BitArray segsel(nseg); + NgBitArray segsel(nseg); // Set them all to "1" to initially activate all segments segsel.Set(); diff --git a/libsrc/meshing/classifyhpel.hpp b/libsrc/meshing/classifyhpel.hpp index 00bf6c0d..9eaea354 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, - BitArray & cornerpoint, BitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + NgBitArray & cornerpoint, NgBitArray & 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; @@ -423,7 +423,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, - BitArray & cornerpoint, BitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + NgBitArray & cornerpoint, NgBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, INDEX_2_HASHTABLE & surf_edges, NgArray & facepoint) { @@ -660,7 +660,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, - BitArray & cornerpoint, BitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + NgBitArray & cornerpoint, NgBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, INDEX_2_HASHTABLE & surf_edges, NgArray & facepoint, int dim, const FaceDescriptor & fd) { @@ -875,7 +875,7 @@ HPREF_ELEMENT_TYPE ClassifyTrig(HPRefElement & el, INDEX_2_HASHTABLE & edge } #ifdef HPREF_OLD HPREF_ELEMENT_TYPE ClassifyTrig(HPRefElement & el, INDEX_2_HASHTABLE & edges, INDEX_2_HASHTABLE & edgepoint_dom, - BitArray & cornerpoint, BitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + NgBitArray & cornerpoint, NgBitArray & 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; @@ -1136,7 +1136,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, - BitArray & cornerpoint, BitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + NgBitArray & cornerpoint, NgBitArray & 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; @@ -1486,7 +1486,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, - BitArray & cornerpoint, BitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + NgBitArray & cornerpoint, NgBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, INDEX_2_HASHTABLE & surf_edges, NgArray & facepoint) { HPREF_ELEMENT_TYPE type = HP_NONE; @@ -1586,7 +1586,7 @@ HPREF_ELEMENT_TYPE ClassifyHex(HPRefElement & el, INDEX_2_HASHTABLE & edges } HPREF_ELEMENT_TYPE ClassifySegm(HPRefElement & hpel, INDEX_2_HASHTABLE & edges, INDEX_2_HASHTABLE & edgepoint_dom, - BitArray & cornerpoint, BitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + NgBitArray & cornerpoint, NgBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, INDEX_2_HASHTABLE & surf_edges, NgArray & facepoint) { @@ -1629,7 +1629,7 @@ 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, - BitArray & cornerpoint, BitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + NgBitArray & cornerpoint, NgBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, INDEX_2_HASHTABLE & surf_edges, NgArray & facepoint) { HPREF_ELEMENT_TYPE type = HP_NONE; diff --git a/libsrc/meshing/delaunay.cpp b/libsrc/meshing/delaunay.cpp index 082246d1..9ebacaca 100644 --- a/libsrc/meshing/delaunay.cpp +++ b/libsrc/meshing/delaunay.cpp @@ -805,7 +805,7 @@ namespace netgen // remove degenerated - BitArray badnode(mesh.GetNP()); + NgBitArray badnode(mesh.GetNP()); badnode.Clear(); int ndeg = 0; for (int i = 1; i <= tempels.Size(); i++) @@ -1320,7 +1320,7 @@ namespace netgen ne = tempels.Size(); - BitArray inner(ne), outer(ne); + NgBitArray inner(ne), outer(ne); inner.Clear(); outer.Clear(); NgArray elstack; diff --git a/libsrc/meshing/hprefinement.cpp b/libsrc/meshing/hprefinement.cpp index 8cbc2b1b..8d046c01 100644 --- a/libsrc/meshing/hprefinement.cpp +++ b/libsrc/meshing/hprefinement.cpp @@ -551,7 +551,7 @@ namespace netgen } bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE & edges, INDEX_2_HASHTABLE & edgepoiclt_dom, - BitArray & cornerpoint, BitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + NgBitArray & cornerpoint, NgBitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, INDEX_2_HASHTABLE & surf_edges, NgArray & facepoint, int & levels, int & act_ref); bool ClassifyHPElements (Mesh & mesh, NgArray & elements, int & act_ref, int & levels); @@ -1558,7 +1558,7 @@ namespace netgen } bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE & edges, INDEX_2_HASHTABLE & edgepoint_dom, - BitArray & cornerpoint, BitArray & edgepoint, INDEX_3_HASHTABLE & faces, INDEX_2_HASHTABLE & face_edges, + NgBitArray & cornerpoint, NgBitArray & 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; @@ -1812,11 +1812,11 @@ bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE & edges, INDEX_2_HAS bool ClassifyHPElements (Mesh & mesh, NgArray & elements, int & act_ref, int & levels) { INDEX_2_HASHTABLE edges(mesh.GetNSeg()+1); - BitArray edgepoint(mesh.GetNP()); + NgBitArray edgepoint(mesh.GetNP()); INDEX_2_HASHTABLE edgepoint_dom(mesh.GetNSeg()+1); edgepoint.Clear(); - BitArray cornerpoint(mesh.GetNP()); + NgBitArray 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 4e354f05..7eb121db 100644 --- a/libsrc/meshing/improve3.cpp +++ b/libsrc/meshing/improve3.cpp @@ -607,11 +607,11 @@ void MeshOptimize3d :: SplitImprove (Mesh & mesh, TABLE elementsonnode(np); NgArray hasbothpoints; - BitArray 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 origpoint.Set(); NgArray elerrs(ne); - BitArray illegaltet(ne); + NgBitArray illegaltet(ne); illegaltet.Clear(); const char * savetask = multithread.task; @@ -891,7 +891,7 @@ void MeshOptimize3d :: SplitImprove (Mesh & mesh, void MeshOptimize3d :: SwapImprove (Mesh & mesh, OPTIMIZEGOAL goal, - const BitArray * working_elements) + const NgBitArray * working_elements) { static Timer t("MeshOptimize3d::SwapImprove"); RegionTimer reg(t); static Timer tloop("MeshOptimize3d::SwapImprove loop"); @@ -1769,7 +1769,7 @@ void MeshOptimize3d :: SwapImprove (Mesh & mesh, OPTIMIZEGOAL goal, void MeshOptimize3d :: SwapImproveSurface (Mesh & mesh, OPTIMIZEGOAL goal, - const BitArray * working_elements, + const NgBitArray * working_elements, const NgArray< NgArray* > * idmaps) { NgArray< NgArray* > locidmaps; @@ -2970,7 +2970,7 @@ void MeshOptimize3d :: SwapImprove2 (Mesh & mesh, OPTIMIZEGOAL goal) } } - BitArray original(GetNE()); + NgBitArray original(GetNE()); original.Set(); for (i = 1; i <= GetNSE(); i++) diff --git a/libsrc/meshing/improve3.hpp b/libsrc/meshing/improve3.hpp index 35ab2ae2..f7d5d188 100644 --- a/libsrc/meshing/improve3.hpp +++ b/libsrc/meshing/improve3.hpp @@ -24,9 +24,9 @@ public: void SplitImprove (Mesh & mesh, OPTIMIZEGOAL goal = OPT_QUALITY); void SwapImprove (Mesh & mesh, OPTIMIZEGOAL goal = OPT_QUALITY, - const BitArray * working_elements = NULL); + const NgBitArray * working_elements = NULL); void SwapImproveSurface (Mesh & mesh, OPTIMIZEGOAL goal = OPT_QUALITY, - const BitArray * working_elements = NULL, + const NgBitArray * working_elements = NULL, const NgArray< NgArray* > * idmaps = NULL); void SwapImprove2 (Mesh & mesh, OPTIMIZEGOAL goal = OPT_QUALITY); diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index 5734bbab..03ded882 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -1824,8 +1824,8 @@ namespace netgen } } - // BitArray base is PointIndex::BASE ... - void Mesh :: FixPoints (const BitArray & fixpoints) + // NgBitArray base is PointIndex::BASE ... + void Mesh :: FixPoints (const NgBitArray & fixpoints) { if (fixpoints.Size() != GetNP()) { @@ -2469,7 +2469,7 @@ namespace netgen int np = GetNP(); FindOpenSegments(); - BitArray frontpoints(np+1); // for 0- and 1-based + NgBitArray frontpoints(np+1); // for 0- and 1-based frontpoints.Clear(); for (int i = 1; i <= GetNOpenSegments(); i++) @@ -2994,7 +2994,7 @@ namespace netgen int nse = GetNSE(); NgArray normals(np); - BitArray linepoint(np); + NgBitArray linepoint(np); linepoint.Clear(); for (i = 1; i <= nseg; i++) @@ -3899,7 +3899,7 @@ namespace netgen int i, j; int nse = GetNSE(); - BitArray used(nse); + NgBitArray used(nse); used.Clear(); INDEX_2_HASHTABLE edges(nse+1); @@ -5289,8 +5289,8 @@ namespace netgen int np = GetNP(); int nse = GetNSE(); - BitArray surfused(nse); - BitArray pused (np); + NgBitArray surfused(nse); + NgBitArray pused (np); surfused.Clear(); @@ -5401,7 +5401,7 @@ namespace netgen int fdi; int np = GetNP(); - BitArray usedp(np); + NgBitArray usedp(np); Array els_of_face; fdi = 1; diff --git a/libsrc/meshing/meshclass.hpp b/libsrc/meshing/meshclass.hpp index aaf1346c..e8871e11 100644 --- a/libsrc/meshing/meshclass.hpp +++ b/libsrc/meshing/meshclass.hpp @@ -381,7 +381,7 @@ namespace netgen DLL_HEADER void CalcSurfacesOfNode (); /// additional (temporarily) fix points - void FixPoints (const BitArray & fixpoints); + void FixPoints (const NgBitArray & fixpoints); /** finds elements without neighbour and @@ -544,10 +544,10 @@ namespace netgen DLL_HEADER void ImproveMesh (const MeshingParameters & mp, OPTIMIZEGOAL goal = OPT_QUALITY); /// - void ImproveMeshJacobian (const MeshingParameters & mp, OPTIMIZEGOAL goal = OPT_QUALITY, const BitArray * usepoint = NULL); + void ImproveMeshJacobian (const MeshingParameters & mp, OPTIMIZEGOAL goal = OPT_QUALITY, const NgBitArray * usepoint = NULL); /// void ImproveMeshJacobianOnSurface (const MeshingParameters & mp, - const BitArray & usepoint, + const NgBitArray & usepoint, const NgArray< Vec<3>* > & nv, OPTIMIZEGOAL goal = OPT_QUALITY, const NgArray< NgArray* > * idmaps = NULL); diff --git a/libsrc/meshing/refine.cpp b/libsrc/meshing/refine.cpp index b15b53bf..ef99ff0a 100644 --- a/libsrc/meshing/refine.cpp +++ b/libsrc/meshing/refine.cpp @@ -770,7 +770,7 @@ namespace netgen can.Elem(parent.I2())); } - BitArray boundp(np); + NgBitArray boundp(np); boundp.Clear(); for (auto & sel : mesh.SurfaceElements()) for (auto pi : sel.PNums()) @@ -801,7 +801,7 @@ namespace netgen mesh.Point(i) = can.Get(i); - BitArray free (mesh.GetNP()), fhelp(mesh.GetNP()); + NgBitArray free (mesh.GetNP()), fhelp(mesh.GetNP()); free.Clear(); for (int i = 1; i <= mesh.GetNE(); i++) { diff --git a/libsrc/meshing/secondorder.cpp b/libsrc/meshing/secondorder.cpp index cc694136..14fc43d4 100644 --- a/libsrc/meshing/secondorder.cpp +++ b/libsrc/meshing/secondorder.cpp @@ -480,7 +480,7 @@ namespace netgen double facok = 0; double factry; - BitArray illegalels(ne); + NgBitArray illegalels(ne); illegalels.Clear(); @@ -504,7 +504,7 @@ namespace netgen can.Elem(parents.Get(i).I2())); } - BitArray boundp(np); + NgBitArray boundp(np); boundp.Clear(); for (int i = 1; i <= mesh.GetNSE(); i++) { diff --git a/libsrc/meshing/smoothing2.5.cpp b/libsrc/meshing/smoothing2.5.cpp index c14fb341..3bcefee8 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(); - BitArray badnodes(np); + NgBitArray badnodes(np); badnodes.Clear(); for (i = 1; i <= ne; i++) diff --git a/libsrc/meshing/smoothing3.cpp b/libsrc/meshing/smoothing3.cpp index e6e2ab2d..1c8adec1 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 BitArray * usepoint) + OPTIMIZEGOAL goal, const NgBitArray * usepoint) { // int i, j; @@ -1507,7 +1507,7 @@ void Mesh :: ImproveMeshJacobian (const MeshingParameters & mp, par.maxit_linsearch = 20; par.maxit_bfgs = 20; - BitArray badnodes(np); + NgBitArray badnodes(np); badnodes.Clear(); for (int i = 1; i <= ne; i++) @@ -1608,7 +1608,7 @@ void Mesh :: ImproveMeshJacobian (const MeshingParameters & mp, // Improve Condition number of Jacobian, any elements void Mesh :: ImproveMeshJacobianOnSurface (const MeshingParameters & mp, - const BitArray & usepoint, + const NgBitArray & usepoint, const NgArray< Vec<3>* > & nv, OPTIMIZEGOAL goal, const NgArray< NgArray* > * idmaps) @@ -1664,7 +1664,7 @@ void Mesh :: ImproveMeshJacobianOnSurface (const MeshingParameters & mp, par.maxit_linsearch = 20; par.maxit_bfgs = 20; - BitArray badnodes(np); + NgBitArray badnodes(np); badnodes.Clear(); for (int i = 1; i <= ne; i++) diff --git a/libsrc/meshing/specials.cpp b/libsrc/meshing/specials.cpp index 1d993a2c..a391ee94 100644 --- a/libsrc/meshing/specials.cpp +++ b/libsrc/meshing/specials.cpp @@ -62,7 +62,7 @@ void CutOffAndCombine (Mesh & mesh, const Mesh & othermesh) } cout << endl; - BitArray connected(mesh.GetNP()); + NgBitArray connected(mesh.GetNP()); connected.Clear(); for (i = 1; i <= mesh.GetNSE(); i++) { @@ -120,7 +120,7 @@ void CutOffAndCombine (Mesh & mesh, const Mesh & othermesh) mesh.Compress(); mesh.FindOpenElements(); - BitArray locked(mesh.GetNP()); + NgBitArray 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 743f5b74..06122ce9 100644 --- a/libsrc/meshing/validate.cpp +++ b/libsrc/meshing/validate.cpp @@ -6,7 +6,7 @@ namespace netgen { void GetPureBadness(Mesh & mesh, NgArray & pure_badness, - const BitArray & isnewpoint) + const NgBitArray & isnewpoint) { //const int ne = mesh.GetNE(); const int np = mesh.GetNP(); @@ -104,7 +104,7 @@ namespace netgen } - void GetWorkingArea(BitArray & working_elements, BitArray & working_points, + void GetWorkingArea(NgBitArray & working_elements, NgBitArray & working_points, const Mesh & mesh, const NgArray & bad_elements, const int width) { @@ -152,7 +152,7 @@ namespace netgen void RepairBisection(Mesh & mesh, NgArray & bad_elements, - const BitArray & isnewpoint, const Refinement & refinement, + const NgBitArray & isnewpoint, const Refinement & refinement, const NgArray & pure_badness, double max_worsening, const bool uselocalworsening, const NgArray< NgArray* > & idmaps) @@ -185,7 +185,7 @@ namespace netgen can[i] = new Point<3>; } - BitArray isboundarypoint(np),isedgepoint(np); + NgBitArray isboundarypoint(np),isedgepoint(np); isboundarypoint.Clear(); isedgepoint.Clear(); @@ -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 - BitArray working_elements(ne); - BitArray working_points(np); + NgBitArray working_elements(ne); + NgBitArray working_points(np); GetWorkingArea(working_elements,working_points,mesh,bad_elements,numbadneighbours); //working_elements.Set(); @@ -240,7 +240,7 @@ namespace netgen PrintMessage(5,ostrstr.str()); - BitArray isworkingboundary(np); + NgBitArray isworkingboundary(np); for(int i=1; i<=np; i++) if(working_points.Test(i) && isboundarypoint.Test(i)) isworkingboundary.Set(i); diff --git a/libsrc/meshing/validate.hpp b/libsrc/meshing/validate.hpp index 86201f3c..5e646d5d 100644 --- a/libsrc/meshing/validate.hpp +++ b/libsrc/meshing/validate.hpp @@ -5,13 +5,13 @@ namespace netgen { void GetPureBadness(Mesh & mesh, NgArray & pure_badness, - const BitArray & isnewpoint); + const NgBitArray & isnewpoint); double Validate(const Mesh & mesh, NgArray & bad_elements, const NgArray & pure_badness, double max_worsening, const bool uselocalworsening, NgArray * quality_loss = NULL); void RepairBisection(Mesh & mesh, NgArray & bad_elements, - const BitArray & isnewpoint, const Refinement & refinement, + const NgBitArray & isnewpoint, const Refinement & refinement, const NgArray & pure_badness, double max_worsening, const bool uselocalworsening, const NgArray< NgArray* > & idmaps); diff --git a/libsrc/visualization/vsmesh.cpp b/libsrc/visualization/vsmesh.cpp index c3949e03..2e0ff9a7 100644 --- a/libsrc/visualization/vsmesh.cpp +++ b/libsrc/visualization/vsmesh.cpp @@ -1819,7 +1819,7 @@ namespace netgen NgArray faces; - BitArray shownode(mesh->GetNP()); + NgBitArray shownode(mesh->GetNP()); if (vispar.clipping.enable) { shownode.Clear();