diff --git a/Geo/GEdgeLoop.cpp b/Geo/GEdgeLoop.cpp index 45ef1471887f6542eb33d4cddb13015531ec55c3..0d77a5ae9b3ccf6135d0242590cf19fe9da4b050 100644 --- a/Geo/GEdgeLoop.cpp +++ b/Geo/GEdgeLoop.cpp @@ -105,6 +105,18 @@ GEdgeLoop::GEdgeLoop(const std::list<GEdge*> &cwire) GEdgeSigned *prevOne = 0; + // Sometimes OCC puts a nasty degenerated edge in the middle of the wire ... + // pushing it to front fixes the problem as it concerns gmsh + for (std::list<GEdge*>::iterator it = wire.begin(); it != wire.end() ; ++it){ // TEST + GEdge *ed = *it; + if (ed->degenerate(0)){ + wire.erase(it); + wire.push_front(ed); + break; + } + } + + GEdgeSigned ges(0,0); while(wire.size()){ ges = nextOne(prevOne, wire); @@ -116,7 +128,7 @@ GEdgeLoop::GEdgeLoop(const std::list<GEdge*> &cwire) break; } prevOne = ⩾ - // ges.print(); + // ges.print(); loop.push_back(ges); } } diff --git a/Mesh/meshGEdge.cpp b/Mesh/meshGEdge.cpp index 31797c86685930945a37cc0b4785855e7582d653..101935c14e3d2229f928d04f38ed21f0bf9feed4 100644 --- a/Mesh/meshGEdge.cpp +++ b/Mesh/meshGEdge.cpp @@ -12,6 +12,7 @@ #include "GmshMessage.h" #include "Context.h" #include "STensor3.h" +#include "Field.h" #define SQU(a) ((a)*(a)) @@ -245,6 +246,15 @@ static void printFandPrimitive(int tag, std::vector<IntPoint> &Points) void meshGEdge::operator() (GEdge *ge) { + + FieldManager *fields = ge->model()->getFields(); + BoundaryLayerField *blf = 0; + if(fields->background_field > 0){ + Field *bl_field = fields->get(fields->background_field); + blf = dynamic_cast<BoundaryLayerField*> (bl_field); + } + + ge->model()->setCurrentMeshEntity(ge); if(ge->geomType() == GEntity::DiscreteCurve) return; @@ -309,10 +319,11 @@ void meshGEdge::operator() (GEdge *ge) N = ge->meshAttributes.nbPointsTransfinite; } else{ - if (CTX::instance()->mesh.algo2d == ALGO_2D_BAMG /*|| 1 || // FIXME - CTX::instance()->mesh.algo2d == ALGO_2D_FRONTAL_QUAD */) + if (CTX::instance()->mesh.algo2d == ALGO_2D_BAMG || blf/*|| 1 || // FIXME + CTX::instance()->mesh.algo2d == ALGO_2D_FRONTAL_QUAD */) { a = Integration(ge, t_begin, t_end, F_Lc_aniso, Points, CTX::instance()->mesh.lcIntegrationPrecision); + } else a = Integration(ge, t_begin, t_end, F_Lc, Points, CTX::instance()->mesh.lcIntegrationPrecision); diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index 74774d09576fe7adb2cf5a8734fca1535121cb4f..a3d8790ba1283fbb246511a5f8c9d8286b39d4d8 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -1135,7 +1135,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, delete m; if((CTX::instance()->mesh.recombineAll || gf->meshAttributes.recombine) && - !CTX::instance()->mesh.optimizeLloyd) + !CTX::instance()->mesh.optimizeLloyd && !onlyInitialMesh) recombineIntoQuadsIterative(gf); computeElementShapes(gf, gf->meshStatistics.worst_element_shape, diff --git a/benchmarks/2d/wing-splines.geo b/benchmarks/2d/wing-splines.geo index 1bb082ea43c2a4f79d8b56ec895b13fe1cacd5ca..839e8b4f9995d6e19e915464f7f59cd4bab4767d 100644 --- a/benchmarks/2d/wing-splines.geo +++ b/benchmarks/2d/wing-splines.geo @@ -605,8 +605,8 @@ Circle(408) = {4355,4351,4354}; Circle(409) = {4354,4351,4353}; Circle(410) = {4353,4351,4352}; */ -//Recombine Surface {406}; -//Mesh.RecombinationAlgorithm=1; +Recombine Surface {406}; +Mesh.RecombinationAlgorithm=1; Field[2] = BoundaryLayer; Field[2].EdgesList = {12,1,2,3,4,5,6,11,10};