diff --git a/Geo/discreteDiskFace.cpp b/Geo/discreteDiskFace.cpp index 20df1506e0937acb2647163de8c2e0e58c64c280..c5f62c5bfc68cda651342c895fcef362c5733be8 100644 --- a/Geo/discreteDiskFace.cpp +++ b/Geo/discreteDiskFace.cpp @@ -102,6 +102,7 @@ static bool orderVertices(const double &tot_length, const std::vector<MVertex*> discreteDiskFace::discreteDiskFace(GFace *gf, std::vector<MTriangle*> &mesh) : GFace(gf->model(),123), _parent (gf) { + if (mesh.empty())return; std::map<MVertex*,MVertex*> v2v; for (unsigned int i=0;i<mesh.size();i++){ MVertex *vs[3] = {NULL, NULL, NULL}; diff --git a/Mesh/delaunay3d.cpp b/Mesh/delaunay3d.cpp index a009f20dec673f18face933aea0f1cf50701ef08..7562bb79c5f0731bf0a760fb641a8d3869d2727b 100644 --- a/Mesh/delaunay3d.cpp +++ b/Mesh/delaunay3d.cpp @@ -1225,14 +1225,15 @@ void delaunayTriangulation (const int numThreads, Vertex *box[8]; delaunayTriangulation (numThreads, nptsatonce, _vertices, box, allocator); + __print ("finalTetrahedrization.pos",0, allocator); + MVertex *VV[8]; for (int i=0;i<8;i++){ Vertex *v = box[i]; v->setNum(N+i+1); - MVertex *mv = new MVertex (v->x(),v->y(),v->z(),NULL,N+i+1); - // printf("%d %g %g %g\n",v->getNum(),v->x(),v->y(),v->z()); - _temp [v->getNum()] = mv; - S.push_back(mv); + VV[i]= new MVertex (v->x(),v->y(),v->z(),NULL,N+(i+1)); + _temp [v->getNum()] = VV[i]; + S.push_back(VV[i]); } for (int myThread=0; myThread < numThreads; myThread++) { diff --git a/Mesh/meshGRegion.cpp b/Mesh/meshGRegion.cpp index 17f41d8c0a634040efa23bcf6859f86b3f5adbbf..7c53d7fb9ccbe68163a562377ee18041a305dd80 100644 --- a/Mesh/meshGRegion.cpp +++ b/Mesh/meshGRegion.cpp @@ -581,6 +581,16 @@ static void MeshDelaunayVolumeNewCode(std::vector<GRegion*> ®ions) try{ meshGRegionBoundaryRecovery(gr); + FILE *fp = Fopen("debug.pos", "w"); + if(fp){ + fprintf(fp, "View \"debug\" {\n"); + for(unsigned int i = 0; i < gr->tetrahedra.size(); i++) + gr->tetrahedra[i]->writePOS(fp, 1., gr->tag(),false,false,false,1,1); + fprintf(fp, "};\n"); + fclose(fp); + } + + } catch(int err){ if(err == 3){ diff --git a/Mesh/meshGRegionBoundaryRecovery.cpp b/Mesh/meshGRegionBoundaryRecovery.cpp index aa04ce938bd42e0adb21c5f3fda18d683db6a6b5..01802c7527cd7ad5fea2cdcd946efc49628e25a7 100644 --- a/Mesh/meshGRegionBoundaryRecovery.cpp +++ b/Mesh/meshGRegionBoundaryRecovery.cpp @@ -486,7 +486,7 @@ bool tetgenmesh::reconstructmesh(void *p) insegments = subsegs->items; if (0) { - outsurfacemesh("dump"); + outmesh2medit("dump2"); } } // meshsurface() @@ -512,7 +512,7 @@ bool tetgenmesh::reconstructmesh(void *p) if ((dupverts > 0l) || (unuverts > 0l)) { // Remove hanging nodes. - jettisonnodes(); + // jettisonnodes(); } long tetnumber, facenumber; @@ -574,7 +574,7 @@ bool tetgenmesh::reconstructmesh(void *p) // Debug if (0) { - //outmesh2medit("dump"); + outmesh2medit("dump"); } //////////////////////////////////////////////////////// @@ -803,11 +803,13 @@ bool tetgenmesh::reconstructmesh(void *p) tetloop.ver = 11; tetrahedrons->traversalinit(); tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { p[0] = org(tetloop); p[1] = dest(tetloop); p[2] = apex(tetloop); p[3] = oppo(tetloop); + MVertex *v1 = _vertices[pointmark(p[0])]; MVertex *v2 = _vertices[pointmark(p[1])]; MVertex *v3 = _vertices[pointmark(p[2])]; diff --git a/Mesh/meshGRegionDelaunayInsertion.cpp b/Mesh/meshGRegionDelaunayInsertion.cpp index 3014ccefb87cef1d00ebad163dd8df3b2fc9f790..caf7cf59735c3dd034d868226ccdb67b44df5fef 100644 --- a/Mesh/meshGRegionDelaunayInsertion.cpp +++ b/Mesh/meshGRegionDelaunayInsertion.cpp @@ -602,7 +602,7 @@ void non_recursive_classify(MTet4 *t, std::list<MTet4*> &theRegion, t = _stackounette.top(); _stackounette.pop(); if (!t) { - // Msg::Fatal("a tet is not connected by a boundary face"); + Msg::Error("a tet is not connected by a boundary face"); touchesOutsideBox = true; } else if (!t->onWhat()) { @@ -1145,7 +1145,6 @@ void insertVerticesInRegion (GRegion *gr, int maxVert, bool _classify) buildFaceSearchStructure(gr->model(), search); for(MTet4Factory::iterator it = allTets.begin(); it != allTets.end(); ++it){ if(!(*it)->onWhat()){ - // printf("I'm in coucou\n"); std::list<MTet4*> theRegion; std::set<GFace *> faces_bound; GRegion *bidon = (GRegion*)123; @@ -1161,9 +1160,13 @@ void insertVerticesInRegion (GRegion *gr, int maxVert, bool _classify) for(std::list<MTet4*>::iterator it2 = theRegion.begin(); it2 != theRegion.end(); ++it2) (*it2)->setOnWhat(myGRegion); } - else // the tets are in the void + else { + // the tets are in the void + Msg::Info("Found void region"); for(std::list<MTet4*>::iterator it2 = theRegion.begin(); it2 != theRegion.end(); ++it2)(*it2)->setDeleted(true); + + } } } search.clear();