diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp index fe00a1721e3159cd4ce852f2ed7854668e5b51ea..87a3be7480f1353e1ba6c986d5f8eda311098042 100644 --- a/Geo/GModel.cpp +++ b/Geo/GModel.cpp @@ -1333,6 +1333,7 @@ void GModel::_createGeometryOfDiscreteEntities(bool force) { if (CTX::instance()->meshDiscrete){ createTopologyFromMeshNew (); + exportDiscreteGEOInternals(); } if (force || CTX::instance()->meshDiscrete){ @@ -2277,13 +2278,15 @@ void GModel::createTopologyFromMesh(int ignoreHoles) makeDiscreteRegionsSimplyConnected(); makeDiscreteFacesSimplyConnected(); - // TEST !!!!!!!! - if (0){ - createTopologyFromMeshNew (); - double t2 = Cpu(); - Msg::StatusBar(true, "Done creating topology from mesh (%g s)", t2 - t1); - return; - } + // // TEST !!!!!!!! + if (1) + { + createTopologyFromMeshNew (); + exportDiscreteGEOInternals(); + double t2 = Cpu(); + Msg::StatusBar(true, "Done creating topology from mesh (%g s)", t2 - t1); + return; + } // create topology for all discrete regions std::vector<discreteRegion*> discRegions; diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp index 75e590304407900f9be79dac03c9758afaee421f..9b260c36ceae7c8a82a51e00b1eab95d7a9346ac 100644 --- a/Geo/Geo.cpp +++ b/Geo/Geo.cpp @@ -603,7 +603,7 @@ Curve *Create_Curve(int Num, int Typ, int Order, List_T *Liste, if((v = FindPoint(iPnt))) List_Add(pC->Control_Points, &v); else{ - Msg::Error("Unknown control point %d in Curve %d", iPnt, pC->Num); + Msg::Error("Unknown control point %d in Curve %d (a)", iPnt, pC->Num); } } if(p1 < 0) { @@ -619,14 +619,14 @@ Curve *Create_Curve(int Num, int Typ, int Order, List_T *Liste, pC->beg = v; } else { - Msg::Error("Unknown control point %d in Curve %d", p1, pC->Num); + Msg::Error("Unknown control point %d in Curve %d (b)", p1, pC->Num); } if((v = FindPoint(p2))) { Msg::Info("Curve %d first control point %d ", pC->Num, v->Num); pC->end = v; } else { - Msg::Error("Unknown control point %d in Curve %d", p2, pC->Num); + Msg::Error("Unknown control point %d in Curve %d (c)", p2, pC->Num); } } End_Curve(pC); diff --git a/Mesh/meshGFaceDelaunayInsertion.cpp b/Mesh/meshGFaceDelaunayInsertion.cpp index f2c8ca206edd4afcee68ac2a10403427bebbb45c..aaf0b545242998633ce7abf7a5ce7ae215f917f0 100644 --- a/Mesh/meshGFaceDelaunayInsertion.cpp +++ b/Mesh/meshGFaceDelaunayInsertion.cpp @@ -747,7 +747,7 @@ bool insertVertexB (std::list<edgeXface> &shell, // avoid angles that are too obtuse double cosv = ((d1*d1+d2*d2-d3*d3)/(2.*d1*d2)); - if ((d1 < LL * .25 || d2 < LL * .25 || cosv < -.9999) && !force) { + if ((d1 < LL * .35 || d2 < LL * .35 || cosv < -.9999) && !force) { onePointIsTooClose = true; // printf("%12.5E %12.5E %12.5E %12.5E \n",d1,d2,LL,cosv); } @@ -1330,7 +1330,7 @@ bool optimalPointFrontalB (GFace *gf, if (gf->geomType() == GEntity::CompoundSurface){ GFaceCompound *gfc = dynamic_cast<GFaceCompound*> (gf); if (gfc){ - GPoint gp = gfc->intersectionWithCircle(n1,n2,middle,d,newPoint); + GPoint gp = gfc->intersectionWithCircle(n2,n1,middle,d,newPoint); if (gp.succeeded()){ newPoint[0] = gp.u(); newPoint[1] = gp.v(); @@ -1340,7 +1340,7 @@ bool optimalPointFrontalB (GFace *gf, } double uvt[3] = {newPoint[0],newPoint[1],0.0}; - curveFunctorCircle cc (n1,n2,middle,d); + curveFunctorCircle cc (n2,n1,middle,d); surfaceFunctorGFace ss (gf); if (intersectCurveSurface (cc,ss,uvt,d*1.e-8)){ @@ -1350,6 +1350,7 @@ bool optimalPointFrontalB (GFace *gf, else { Msg::Debug("--- Non optimal point found -----------"); return false; + return true; // Msg::Info("--- Non optimal point found -----------"); } return true; diff --git a/benchmarks/2d/hybrid_discrete.geo b/benchmarks/2d/hybrid_discrete.geo index 6ea310743192df5fc3e8e6e0d61192e28aa697f1..11b8a47767611870a386056c7fc260b426fa4619 100644 --- a/benchmarks/2d/hybrid_discrete.geo +++ b/benchmarks/2d/hybrid_discrete.geo @@ -1,15 +1,15 @@ +General.MeshDiscrete = 1; Merge "hybrid_part.msh"; -CreateTopology; lc = 1e-2; +Mesh.CharacteristicLengthMax = lc; Point(1) = {0, 0, 0, lc}; Point(4) = {0, .3, 0, lc} ; -//Line(1) = {1,11} ; +Line(1) = {1,11} ; Line(3) = {14,4} ; Line(4) = {4,1} ; -//Line Loop(5) = {-4,-1,-14,-3} ; -//Plane Surface(6) = {5} ; -//+ -//Line(17) = {4, 14}; +Line Loop(5) = {-4,-1,-14,-3} ; +Plane Surface(6) = {5} ; +MeshAlgorithm Surface {6} =6;