From fbb7669b109b7ffcdf030f203ae348a761313e8b Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 26 Dec 2015 15:30:47 +0000 Subject: [PATCH] fix compile --- Mesh/delaunay_refinement.cpp | 8 +-- Mesh/meshGFaceDelaunayInsertion.cpp | 4 +- Mesh/meshGRegionBoundaryRecovery.cpp | 81 ++++++++++++++-------------- Mesh/meshGRegionBoundaryRecovery.h | 4 +- 4 files changed, 48 insertions(+), 49 deletions(-) diff --git a/Mesh/delaunay_refinement.cpp b/Mesh/delaunay_refinement.cpp index 76f0d4de74..fa24adf655 100644 --- a/Mesh/delaunay_refinement.cpp +++ b/Mesh/delaunay_refinement.cpp @@ -350,7 +350,7 @@ void edgeBasedRefinement (const int numThreads, } T.clear(); } - + // do not allow to saturate boundary edges { for (unsigned int i=0;i<_tets.size();i++) { @@ -407,9 +407,9 @@ void edgeBasedRefinement (const int numThreads, double t4 = Cpu(); // sprintf(name,"PointsFiltered%d.pos",iter); // _print (name,add); - delaunayTrgl (1,1,add.size(), _tets, &add); + delaunayTrgl (1,1,add.size(), _tets, &add); add_all.insert (add_all.end(), add.begin(), add.end()); - clock_t t5 = clock(); + double t5 = Cpu(); Msg::Info("IT %3d %6d points added, timings %5.2f %5.2f %5.2f %5.2f %5.2f %5d",iter,add.size(), (t2-t1), (t3-t2), @@ -427,7 +427,7 @@ void edgeBasedRefinement (const int numThreads, MVertex *mvs[4]; - if (_tets[i]->V[0]){ + if (_tets[i]->V[0]){ for (int j=0;j<6;j++){ Edge e = _tets[i]->getEdge(j); std::map<Edge,double>::iterator it = _sizes.find(e); diff --git a/Mesh/meshGFaceDelaunayInsertion.cpp b/Mesh/meshGFaceDelaunayInsertion.cpp index 106365a53a..4a951a99d5 100644 --- a/Mesh/meshGFaceDelaunayInsertion.cpp +++ b/Mesh/meshGFaceDelaunayInsertion.cpp @@ -1890,8 +1890,8 @@ void bowyerWatsonParallelogramsConstrained(GFace *gf, } std::cout<<"out of for packed"<<std::endl; // printf("%d vertices \n",(int)packed.size()); - //clock_t t2 = clock(); - //double DT = (double)(t2-t1)/CLOCKS_PER_SEC; + //double t2 = Cpu(); + //double DT = t2-t1; //if (packed.size())printf("points inserted DT %12.5E points per minut : %12.5E %d global searchs %d seachs per insertion\n",DT,60.*packed.size()/DT,N_GLOBAL_SEARCH,N_SEARCH / packed.size()); transferDataStructure(gf, AllTris, DATA); std::cout<<"out of transferDataStructure"<<std::endl; diff --git a/Mesh/meshGRegionBoundaryRecovery.cpp b/Mesh/meshGRegionBoundaryRecovery.cpp index b68cb60096..c13f8c033f 100644 --- a/Mesh/meshGRegionBoundaryRecovery.cpp +++ b/Mesh/meshGRegionBoundaryRecovery.cpp @@ -11844,7 +11844,7 @@ int meshGRegionBoundaryRecovery::suppresssteinerpoints() return 1; } -void meshGRegionBoundaryRecovery::recoverboundary(clock_t&) +void meshGRegionBoundaryRecovery::recoverboundary() { arraypool *misseglist, *misshlist; arraypool *bdrysteinerptlist; @@ -14471,18 +14471,18 @@ void meshGRegionBoundaryRecovery::reconstructmesh(GRegion *_gr) } _vertices.insert(_vertices.begin(), all.begin(), all.end()); } - + initializepools(); - + std::vector<MTetrahedron*> tets; - + delaunayMeshIn3D(_vertices, tets, false); - + { //transfernodes(); point pointloop; REAL x, y, z; int i; - + // Read the points. for (i = 0; i < _vertices.size(); i++) { makepoint(&pointloop, UNUSEDVERTEX); @@ -14504,7 +14504,7 @@ void meshGRegionBoundaryRecovery::reconstructmesh(GRegion *_gr) zmax = (z > zmax) ? z : zmax; } } - + // 'longest' is the largest possible edge length formed by input vertices. x = xmax - xmin; y = ymax - ymin; @@ -14514,15 +14514,15 @@ void meshGRegionBoundaryRecovery::reconstructmesh(GRegion *_gr) Msg::Warning("Error: The point set is trivial.\n"); return; } - + // Two identical points are distinguished by 'lengthlimit'. if (b->minedgelength == 0.0) { b->minedgelength = longest * b->epsilon; } } // transfernodes(); - + point *idx2verlist; - + // Create a map from indices to vertices. makeindex2pointmap(idx2verlist); // 'idx2verlist' has length 'in->numberofpoints + 1'. @@ -14535,7 +14535,7 @@ void meshGRegionBoundaryRecovery::reconstructmesh(GRegion *_gr) for (unsigned int i = 0; i < _vertices.size(); i++){ _vertices[i]->setIndex(i); } - + tetrahedron *ver2tetarray; //point *idx2verlist; triface tetloop, checktet, prevchktet; @@ -14546,9 +14546,9 @@ void meshGRegionBoundaryRecovery::reconstructmesh(GRegion *_gr) int bondflag; int t1ver; int idx, i, j, k; - + Msg::Info("Reconstructing mesh ..."); - + // Allocate an array that maps each vertex to its adjacent tets. ver2tetarray = new tetrahedron[_vertices.size() + 1]; //for (i = 0; i < in->numberofpoints + 1; i++) { @@ -14556,7 +14556,7 @@ void meshGRegionBoundaryRecovery::reconstructmesh(GRegion *_gr) setpointtype(idx2verlist[i], VOLVERTEX); // initial type. ver2tetarray[i] = NULL; } - + // Create the tetrahedra and connect those that share a common face. for (i = 0; i < tets.size(); i++) { // Get the four vertices. @@ -14649,14 +14649,14 @@ void meshGRegionBoundaryRecovery::reconstructmesh(GRegion *_gr) } // if (checktet.tet != NULL) } // for (tetloop.ver = 0; ... } // i - + // Remember a tet of the mesh. recenttet = tetloop; - + // Create hull tets, create the point-to-tet map, and clean up the // temporary spaces used in each tet. hullsize = tetrahedrons->items; - + tetrahedrons->traversalinit(); tetloop.tet = tetrahedrontraverse(); while (tetloop.tet != (tetrahedron *) NULL) { @@ -14696,23 +14696,23 @@ void meshGRegionBoundaryRecovery::reconstructmesh(GRegion *_gr) } tetloop.tet = tetrahedrontraverse(); } - + hullsize = tetrahedrons->items - hullsize; - + delete [] ver2tetarray; tets.clear(); // Release all memory in this vector. } - + std::list<GFace*> f_list = _gr->faces(); std::list<GEdge*> e_list = _gr->edges(); - + { Msg::Info(" --> Creating surface mesh ..."); face newsh; face newseg; point p[4]; int idx, i, j; - + for (std::list<GFace*>::iterator it = f_list.begin(); it != f_list.end(); ++it){ GFace *gf = *it; for (i = 0;i< gf->triangles.size(); i++) { @@ -14740,7 +14740,7 @@ void meshGRegionBoundaryRecovery::reconstructmesh(GRegion *_gr) // Connecting triangles, removing redundant segments. unifysegments(); - + Msg::Info(" --> Identifying boundary edges ..."); face* shperverlist; @@ -14748,10 +14748,10 @@ void meshGRegionBoundaryRecovery::reconstructmesh(GRegion *_gr) face searchsh, neighsh; face segloop, checkseg; point checkpt; - + // Construct a map from points to subfaces. makepoint2submap(subfaces, idx2shlist, shperverlist); - + // Process the set of PSC edges. // Remeber that all segments have default marker '-1'. for (std::list<GEdge*>::iterator it = e_list.begin(); it != e_list.end(); @@ -14825,38 +14825,37 @@ void meshGRegionBoundaryRecovery::reconstructmesh(GRegion *_gr) setshellmark(newseg, ge->tag()); } // i } // e_list - + delete [] shperverlist; delete [] idx2shlist; - + Msg::Debug(" %ld (%ld) subfaces (segments).", subfaces->items, subsegs->items); - + // The total number of iunput segments. insegments = subsegs->items; - + if (0) { outsurfacemesh("dump"); } - + } // meshsurface() - + delete [] idx2verlist; - + //////////////////////////////////////////////////////// // Boundary recovery. - clock_t t_tmp; - - recoverboundary(t_tmp); - + + recoverboundary(); + carveholes(); - + if (subvertstack->objects > 0l) { suppresssteinerpoints(); } - + recoverdelaunay(); - + optimizemesh(); if ((dupverts > 0l) || (unuverts > 0l)) { @@ -14929,7 +14928,7 @@ void meshGRegionBoundaryRecovery::reconstructmesh(GRegion *_gr) //////////////////////////////////////////////////////// // Write mesh into to GRegion. - Msg::Info(" --> Write to GRegion ..."); + Msg::Info(" --> Write to GRegion ..."); point p[4]; int i; @@ -15161,7 +15160,7 @@ void meshGRegionBoundaryRecovery::reconstructmesh(GRegion *_gr) tetloop.tet = tetrahedrontraverse(); } } // mesh output - Msg::Info("Reconstruct time : %g sec",Cpu()-t_start); + Msg::Info("Reconstruct time : %g sec",Cpu()-t_start); } void terminateBoundaryRecovery(void *, int exitcode) diff --git a/Mesh/meshGRegionBoundaryRecovery.h b/Mesh/meshGRegionBoundaryRecovery.h index 7b76035a71..4544cf5927 100644 --- a/Mesh/meshGRegionBoundaryRecovery.h +++ b/Mesh/meshGRegionBoundaryRecovery.h @@ -705,7 +705,7 @@ class meshGRegionBoundaryRecovery { // Incremental Delaunay construction. void initialdelaunay(point pa, point pb, point pc, point pd); - void incrementaldelaunay(clock_t&); + void incrementaldelaunay(); // Surface meshing. void flipshpush(face*); @@ -736,7 +736,7 @@ class meshGRegionBoundaryRecovery { int removevertexbyflips(point steinerpt); int suppressbdrysteinerpoint(point steinerpt); int suppresssteinerpoints(); - void recoverboundary(clock_t&); + void recoverboundary(); // Mesh reconstruct void carveholes(); -- GitLab