convert NgArrays

This commit is contained in:
Joachim Schoeberl 2024-12-29 18:57:47 +01:00
parent 100279be6c
commit bb37ae1987
6 changed files with 39 additions and 36 deletions

View File

@ -282,7 +282,7 @@ namespace netgen
NgArray<INDEX> & lindex,
double xh)
{
static Timer timer("adfront2::GetLocals"); RegionTimer reg (timer);
// static Timer timer("adfront2::GetLocals"); RegionTimer reg (timer);
int pstind;
Point<3> midp, p0;

View File

@ -171,21 +171,21 @@ class AdFront2
{
///
NgArray<FrontPoint2> points; /// front points
NgArray<FrontLine> lines; /// front lines
Array<FrontPoint2> points; /// front points
Array<FrontLine> lines; /// front lines
Box3d boundingbox;
BoxTree<3> linesearchtree; /// search tree for lines
Point3dTree pointsearchtree; /// search tree for points
Point3dTree cpointsearchtree; /// search tree for cone points (not used ???)
NgArray<int> delpointl; /// list of deleted front points
NgArray<int> dellinel; /// list of deleted front lines
Array<int> delpointl; /// list of deleted front points
Array<int> dellinel; /// list of deleted front lines
int nfl; /// number of front lines;
INDEX_2_HASHTABLE<int> * allflines; /// all front lines ever have been
NgArray<int> invpindex;
Array<int> invpindex;
int minval;
int starti;

View File

@ -184,7 +184,8 @@ class AdFront3
{
///
// NgArray<FrontPoint3, PointIndex::BASE, PointIndex> points;
Array<FrontPoint3, PointIndex> points;
Array<FrontPoint3, PointIndex> points
;
///
NgArray<FrontFace> faces;
///

View File

@ -246,8 +246,8 @@ namespace netgen
{
static Timer timer("surface meshing"); RegionTimer reg(timer);
static int timer1 = NgProfiler::CreateTimer ("surface meshing1");
static int timer2 = NgProfiler::CreateTimer ("surface meshing2");
static Timer timer1("surface meshing1");
static Timer timer2("surface meshing2");
static int timer3 = NgProfiler::CreateTimer ("surface meshing3");
static int ts1 = NgProfiler::CreateTimer ("surface meshing start 1");
@ -408,7 +408,7 @@ namespace netgen
RegionTimer rloop(tloop);
while (!adfront.Empty() && !multithread.terminate)
{
NgProfiler::RegionTimer reg1 (timer1);
// RegionTimer reg1 (timer1);
if (multithread.terminate)
throw NgException ("Meshing stopped");
@ -487,8 +487,7 @@ namespace netgen
pindex, lindex, 2*hinner);
// tgetlocals.Stop();
NgProfiler::RegionTimer reg2 (timer2);
// RegionTimer reg2 (timer2);
//(*testout) << "h for locals: " << 2*hinner << endl;
@ -574,7 +573,8 @@ namespace netgen
*testout << "3d points: " << endl << locpoints << endl;
}
{
// RegionTimer reg2 (timer2);
for (size_t i = 0; i < locpoints.Size(); i++)
{
Point<2> pp;
@ -582,7 +582,7 @@ namespace netgen
pp, h, plainzones[i]);
plainpoints[i] = pp;
}
}
/*
for (int i = 1; i <= locpoints.Size(); i++)
{
@ -634,7 +634,6 @@ namespace netgen
*/
for (int i = 2; i <= loclines.Size(); i++) // don't remove first line
{
// (*testout) << "loclines(i) = " << loclines.Get(i).I1() << " - " << loclines.Get(i).I2() << endl;

View File

@ -102,30 +102,30 @@ namespace netgen
[[deprecated("Use GetDistantPNums(locnum).Size() instead!")]]
// [[deprecated("Use GetDistantPNums(locnum).Size() instead!")]]
int GetNDistantPNums (int locpnum) const { return loc2distvert[locpnum-1].Size(); }
[[deprecated("Use GetDistantFaceNums(locnum).Size() instead!")]]
// [[deprecated("Use GetDistantFaceNums(locnum).Size() instead!")]]
int GetNDistantFaceNums (int locfacenum) const { return loc2distface[locfacenum-1].Size(); }
[[deprecated("Use GetDistantEdgeNums(locnum).Size() instead!")]]
// [[deprecated("Use GetDistantEdgeNums(locnum).Size() instead!")]]
int GetNDistantEdgeNums ( int locedgenum) const { return loc2distedge[locedgenum-1].Size(); }
[[deprecated("Use GetDistantPNums(locnum) -> FlatArray instead!")]]
// [[deprecated("Use GetDistantPNums(locnum) -> FlatArray instead!")]]
void GetDistantPNums (int locpnum, int * distpnums ) const
{
for (int i = 0; i < loc2distvert[locpnum-1].Size(); i++ )
distpnums[i] = loc2distvert[locpnum-1][i];
}
[[deprecated("Use GetDistantFaceNums(locnum) -> FlatArray instead!")]]
// [[deprecated("Use GetDistantFaceNums(locnum) -> FlatArray instead!")]]
void GetDistantFaceNums (int locfacenum, int * distfacenums ) const
{
for ( int i = 0; i < loc2distface[locfacenum-1].Size(); i++ )
distfacenums[i] = loc2distface[locfacenum-1][i];
}
[[deprecated("Use GetDistantFaceNums(locnum) -> FlatArray instead!")]]
// [[deprecated("Use GetDistantFaceNums(locnum) -> FlatArray instead!")]]
void GetDistantFaceNums (int locfacenum, NgArray<int> & distfacenums ) const
{
// distfacenums = loc2distface[locfacenum-1];
@ -135,14 +135,14 @@ namespace netgen
distfacenums[i] = loc[i];
}
[[deprecated("Use GetDistantEdgeNums(locnum) -> FlatArray instead!")]]
// [[deprecated("Use GetDistantEdgeNums(locnum) -> FlatArray instead!")]]
void GetDistantEdgeNums (int locedgenum, int * distedgenums ) const
{
for (int i = 0; i < loc2distedge[locedgenum-1].Size(); i++ )
distedgenums[i] = loc2distedge[locedgenum-1][i];
}
[[deprecated("Use GetDistantEdgeNums(locnum) -> FlatArray instead!")]]
// [[deprecated("Use GetDistantEdgeNums(locnum) -> FlatArray instead!")]]
void GetDistantEdgeNums (int locedgenum, NgArray<int> & distedgenums ) const
{
// distedgenums = loc2distedge[locedgenum-1];

View File

@ -296,6 +296,8 @@ namespace netgen
Point<2> & pplane,
double h, int & zone) const
{
// static Timer t("ToPlane"); RegionTimer reg(t);
if (projecttype == PLANESPACE)
{
Vec<3> p1p, n;
@ -338,7 +340,7 @@ namespace netgen
PointGeomInfo & gi,
double h)
{
static Timer t("FromPlane"); RegionTimer reg(t);
// static Timer t("FromPlane"); RegionTimer reg(t);
if (projecttype == PLANESPACE)
{
@ -364,8 +366,8 @@ namespace netgen
void OCCSurface :: Project (Point<3> & ap, PointGeomInfo & gi)
{
static Timer t("OccSurface::Project"); RegionTimer reg(t);
static Timer t2("OccSurface::Project actual");
// static Timer t("OccSurface::Project"); RegionTimer reg(t);
// static Timer t2("OccSurface::Project actual");
// try Newton's method ...
@ -470,13 +472,14 @@ namespace netgen
*/
// double u,v;
// JS : shouldn't we move these 2 lines to the constructor ?
Handle( ShapeAnalysis_Surface ) su = new ShapeAnalysis_Surface( occface );
auto toltool = BRep_Tool::Tolerance( topods_face );
// gp_Pnt2d suval = su->ValueOfUV ( pnt, toltool);
t2.Start();
// t2.Start();
gp_Pnt2d suval = su->NextValueOfUV (gp_Pnt2d(u,v), pnt, toltool);
t2.Stop();
// t2.Stop();
suval.Coord( u, v);
pnt = occface->Value( u, v );