diff --git a/Common/Options.cpp b/Common/Options.cpp index 9220b17473a57deaad49bf447897bc83c0f39328..c3eff4c33af217fe95f2ed9df62c50afc1e7b9ee 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -5072,6 +5072,11 @@ double opt_mesh_lloyd(OPT_ARGS_NUM) { if(action & GMSH_SET) CTX::instance()->mesh.optimizeLloyd = (int)val; +#if defined(HAVE_FLTK) + if(FlGui::available() && (action & GMSH_GUI)) + FlGui::instance()->options->mesh.value[27]->value + (CTX::instance()->mesh.optimizeLloyd); +#endif return CTX::instance()->mesh.optimizeLloyd; } @@ -5167,20 +5172,12 @@ double opt_mesh_recombine3d_all(OPT_ARGS_NUM) #if defined(HAVE_FLTK) if(action & GMSH_SET){ CTX::instance()->mesh.recombine3DAll = (int)val; - //if recombine3D, then we should have 2D and 3D R-tree algo - if(CTX::instance()->mesh.recombine3DAll){ - FlGui::instance()->options->mesh.choice[2]->value(4); - FlGui::instance()->options->mesh.choice[3]->value(5); - } +#if defined(HAVE_FLTK) +#endif } if(FlGui::available() && (action & GMSH_GUI)){ FlGui::instance()->options->mesh.butt[22]->value (CTX::instance()->mesh.recombine3DAll); - //if recombine3D, then we should have 2D and 3D R-tree algo - if(CTX::instance()->mesh.recombine3DAll){ - FlGui::instance()->options->mesh.choice[2]->value(4); - FlGui::instance()->options->mesh.choice[3]->value(5); - } } #endif return CTX::instance()->mesh.recombine3DAll; diff --git a/Fltk/optionWindow.cpp b/Fltk/optionWindow.cpp index d694b7051c2fd95e5f6b1308ac2cd69c37bfd130..be6ce018d2ccd8a8de0e094ee067bad6a3d5b9cf 100644 --- a/Fltk/optionWindow.cpp +++ b/Fltk/optionWindow.cpp @@ -476,6 +476,7 @@ static void mesh_options_ok_cb(Fl_Widget *w, void *data) opt_mesh_smooth_normals(0, GMSH_SET, o->mesh.butt[19]->value()); opt_mesh_light_lines(0, GMSH_SET, o->mesh.butt[20]->value()); opt_mesh_nb_smoothing(0, GMSH_SET, o->mesh.value[0]->value()); + opt_mesh_lloyd(0, GMSH_SET, o->mesh.value[27]->value()); opt_mesh_lc_factor(0, GMSH_SET, o->mesh.value[2]->value()); opt_mesh_lc_min(0, GMSH_SET, o->mesh.value[25]->value()); opt_mesh_lc_max(0, GMSH_SET, o->mesh.value[26]->value()); @@ -492,9 +493,8 @@ static void mesh_options_ok_cb(Fl_Widget *w, void *data) opt_mesh_label_sampling(0, GMSH_SET, o->mesh.value[12]->value()); opt_mesh_angle_smooth_normals(0, GMSH_SET, o->mesh.value[18]->value()); - opt_mesh_point_type(0, GMSH_SET, o->mesh.choice[0]->value()); opt_mesh_recombine3d_all(0, GMSH_SET, o->mesh.butt[22]->value()); - opt_mesh_algo2d(0, GMSH_SET, + opt_mesh_point_type(0, GMSH_SET, o->mesh.choice[0]->value()); opt_mesh_algo2d(0, GMSH_SET, (o->mesh.choice[2]->value() == 1) ? ALGO_2D_MESHADAPT : (o->mesh.choice[2]->value() == 2) ? ALGO_2D_DELAUNAY : (o->mesh.choice[2]->value() == 3) ? ALGO_2D_FRONTAL : @@ -1283,7 +1283,7 @@ optionWindow::optionWindow(int deltaFontSize) FL_NORMAL_SIZE -= deltaFontSize; int width = 34 * FL_NORMAL_SIZE + WB; - int height = 13 * BH + 4 * WB; + int height = 14 * BH + 4 * WB; int L = 7 * FL_NORMAL_SIZE; win = new paletteWindow @@ -2215,8 +2215,16 @@ optionWindow::optionWindow(int deltaFontSize) mesh.value[0]->align(FL_ALIGN_RIGHT); mesh.value[0]->callback(mesh_options_ok_cb); + mesh.value[27] = new Fl_Value_Input + (L + 2 * WB, 2 * WB + 10 * BH, IW, BH, "LLoyd Smoothing steps"); + mesh.value[27]->minimum(0); + mesh.value[27]->maximum(100); + mesh.value[27]->step(1); + mesh.value[27]->align(FL_ALIGN_RIGHT); + mesh.value[27]->callback(mesh_options_ok_cb); + mesh.value[2] = new Fl_Value_Input - (L + 2 * WB, 2 * WB + 10 * BH, IW, BH, "Element size factor"); + (L + 2 * WB, 2 * WB + 11 * BH, IW, BH, "Element size factor"); mesh.value[2]->minimum(0.001); mesh.value[2]->maximum(1000); mesh.value[2]->step(0.01); @@ -2224,17 +2232,17 @@ optionWindow::optionWindow(int deltaFontSize) mesh.value[2]->callback(mesh_options_ok_cb); mesh.value[25] = new Fl_Value_Input - (L + 2 * WB, 2 * WB + 11 * BH, IW/2, BH); + (L + 2 * WB, 2 * WB + 12 * BH, IW/2, BH); mesh.value[25]->align(FL_ALIGN_RIGHT); mesh.value[25]->callback(mesh_options_ok_cb); mesh.value[26] = new Fl_Value_Input - (L + 2 * WB + IW/2, 2 * WB + 11 * BH, IW/2, BH, "Min/Max element size"); + (L + 2 * WB + IW/2, 2 * WB + 12 * BH, IW/2, BH, "Min/Max element size"); mesh.value[26]->align(FL_ALIGN_RIGHT); mesh.value[26]->callback(mesh_options_ok_cb); mesh.value[3] = new Fl_Value_Input - (L + 2 * WB, 2 * WB + 12 * BH, IW / 3, BH, "Element order"); + (L + 2 * WB, 2 * WB + 13 * BH, IW / 3, BH, "Element order"); mesh.value[3]->minimum(1); mesh.value[3]->maximum(2); mesh.value[3]->step(1); @@ -2242,7 +2250,7 @@ optionWindow::optionWindow(int deltaFontSize) mesh.value[3]->callback(mesh_options_ok_cb); mesh.butt[4] = new Fl_Check_Button - (L + 2 * WB + IW + WB / 2, 2 * WB + 12 * BH, BW, BH, "Use incomplete elements"); + (L + 2 * WB + IW + WB / 2, 2 * WB + 13 * BH, BW, BH, "Use incomplete elements"); mesh.butt[4]->type(FL_TOGGLE_BUTTON); mesh.butt[4]->callback(mesh_options_ok_cb); diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp index a7bd69269e4f2f67776f44a84ea9833f81081223..f40b386be7c21e77a0116cc7bc99148449cfff5f 100644 --- a/Mesh/Generator.cpp +++ b/Mesh/Generator.cpp @@ -579,28 +579,26 @@ static void Mesh3D(GModel *m) FindConnectedRegions(delaunay, connected); for(unsigned int i = 0; i < connected.size(); i++){ MeshDelaunayVolume(connected[i]); + //Additional code for hex mesh begin - unsigned int j; - if(CTX::instance()->mesh.algo3d == ALGO_3D_RTREE){ - for(j=0;j<connected[i].size();j++){ + for(unsigned j=0;j<connected[i].size();j++){ + GRegion *gr = connected[i][j]; + //R-tree + if(CTX::instance()->mesh.algo3d == ALGO_3D_RTREE){ Filler f; - GRegion *gr = connected[i][j]; f.treat_region(gr); - - //recombine into hex - if(CTX::instance()->mesh.recombine3DAll || gr->meshAttributes.recombine3D){ - Recombinator rec; - rec.execute(); - Supplementary sup; - sup.execute(); - PostOp post; - post.execute(0); - } - + } + //Recombine3D into hex + if(CTX::instance()->mesh.recombine3DAll || gr->meshAttributes.recombine3D){ + Recombinator rec; + rec.execute(); + Supplementary sup; + sup.execute(); + PostOp post; + post.execute(0); } } - //Additional code for hex mesh end - + } double t2 = Cpu(); diff --git a/benchmarks/hex/cube.geo b/benchmarks/hex/cube.geo index 83c4c1299c884c8cc31d38e610553e13f87a9a85..783217c2d181a007b1a63e344d19c96b8c41c553 100644 --- a/benchmarks/hex/cube.geo +++ b/benchmarks/hex/cube.geo @@ -1,6 +1,6 @@ -//Mesh.Algorithm = 8; //8 = delquad or 9= 2D R-tree -//Mesh.Algorithm3D = 9; // 3D R-tree -//Mesh.Recombine3DAll = 1; +Mesh.Algorithm = 8; //8 = delquad or 9= 2D R-tree +Mesh.Algorithm3D = 9; // 3D R-tree +Mesh.Recombine3DAll = 1; c1 = 0.125; c2 = 0.25; diff --git a/benchmarks/hex/quartCyl.geo b/benchmarks/hex/quartCyl.geo index e97cd43e6c40b796158baa1f6efeffb0fa0f161b..51522e3de818a1dc1e6d0352b304c579053a39af 100644 --- a/benchmarks/hex/quartCyl.geo +++ b/benchmarks/hex/quartCyl.geo @@ -1,7 +1,7 @@ Mesh.Algorithm = 8; //8 = delquad or 9= 2D R-tree Mesh.Algorithm3D = 9; // 3D R-tree Mesh.Recombine3DAll = 1; -Mesh.Lloyd = 10; +//Mesh.Lloyd = 10; c1 = 0.1; c2 = 0.05;