diff --git a/Fltk/highOrderToolsWindow.cpp b/Fltk/highOrderToolsWindow.cpp index 63b4feb5418706e3f5b5ba3f31431519af2dd036..d9410ed48ee18e04fa8a70296fe1c98e05fb323d 100644 --- a/Fltk/highOrderToolsWindow.cpp +++ b/Fltk/highOrderToolsWindow.cpp @@ -132,6 +132,12 @@ static void highordertools_runopti_cb(Fl_Widget *w, void *data) int nbLayers = (int) o->value[2]->value(); double threshold_max = o->value[8]->value(); + int NE = 0; + for (GModel::riter it = GModel::current()->firstRegion(); it != GModel::current()->lastRegion(); ++it){ + NE += (*it)->getNumMeshElements(); + } + + #if defined(HAVE_OPTHOM) switch(algo) { case 0: { // Optimization @@ -140,7 +146,9 @@ static void highordertools_runopti_cb(Fl_Widget *w, void *data) p.BARRIER_MIN = threshold_min; p.BARRIER_MAX = threshold_max; p.onlyVisible = onlyVisible; - p.dim = GModel::current()->getDim(); + // change dim if no 3D elements are there + p.dim = GModel::current()->getDim() == 3 ? ( NE ? 3 : 2 ) : GModel::current()->getDim(); + printf("%d %d\n",NE,p.dim); p.itMax = (int) o->value[3]->value(); p.optPassMax = (int) o->value[4]->value(); p.weightFixed = o->value[5]->value(); @@ -164,7 +172,7 @@ static void highordertools_runopti_cb(Fl_Widget *w, void *data) p.BARRIER_MIN = threshold_min; p.BARRIER_MAX = threshold_max; p.onlyVisible = onlyVisible; - p.dim = GModel::current()->getDim(); + p.dim = GModel::current()->getDim() == 3 ? ( NE ? 3 : 2 ) : GModel::current()->getDim(); p.distanceFactor = o->value[7]->value(); HighOrderMeshFastCurving(GModel::current(), p); break; diff --git a/Mesh/meshGFaceOptimize.cpp b/Mesh/meshGFaceOptimize.cpp index 71cfe766074ecb16a25d0c235302f7f263e45552..1196287ede5838d39e96fc3c85ac7fb74b2bdcaf 100644 --- a/Mesh/meshGFaceOptimize.cpp +++ b/Mesh/meshGFaceOptimize.cpp @@ -234,7 +234,10 @@ void transferDataStructure(GFace *gf, std::set<MTri3*, compareTri3Ptr> &AllTris, if(pp < 0) t->reverse(); } } + computeEquivalences(gf, data); +} +void computeEquivalences(GFace *gf, bidimMeshData & data){ if (data.equivalence){ std::vector<MTriangle*> newT; for (unsigned int i=0;i<gf->triangles.size();i++){ @@ -252,10 +255,13 @@ void transferDataStructure(GFace *gf, std::set<MTri3*, compareTri3Ptr> &AllTris, } gf->triangles = newT; } +} - +int splitEquivalentTriangles(GFace *gf, bidimMeshData & data){ + } + void buildVertexToTriangle(std::vector<MTriangle*> &eles, v2t_cont &adj) { adj.clear(); diff --git a/Mesh/meshGFaceOptimize.h b/Mesh/meshGFaceOptimize.h index 5d363c1917c73acd5051c23877f50862bebfdd8a..a866812ec0b8ea7177f8ad05976b5b527a5f44f9 100644 --- a/Mesh/meshGFaceOptimize.h +++ b/Mesh/meshGFaceOptimize.h @@ -80,6 +80,7 @@ void buildMeshGenerationDataStructures(GFace *gf, std::set<MTri3*, compareTri3Ptr> &AllTris, bidimMeshData & data); void transferDataStructure(GFace *gf, std::set<MTri3*, compareTri3Ptr> &AllTris,bidimMeshData &DATA); +void computeEquivalences(GFace *gf,bidimMeshData &DATA); void recombineIntoQuads(GFace *gf, bool topologicalOpti = true, bool nodeRepositioning = true);