]> SALOME platform Git repositories - plugins/gmshplugin.git/commitdiff
Salome HOME
Fixes 3D meshing algorithm for gmsh [cf. spns 24634]
authorAfeef <afeef.badri@gmail.com>
Mon, 2 Aug 2021 13:56:43 +0000 (15:56 +0200)
committerAfeef <afeef.badri@gmail.com>
Mon, 2 Aug 2021 13:56:43 +0000 (15:56 +0200)
* 3D meshing is now possible via Delaunay, Frontal, MMG3D, and R-Tree
* Delaunay algorithm is now default for 3D meshing (as in gmsh)
* Removed Frontal-Delaunay and Forntal-Hex algo. as these were experimental

src/GMSHPlugin/GMSHPlugin_Hypothesis.cxx
src/GMSHPlugin/GMSHPlugin_Hypothesis.hxx
src/GMSHPlugin/GMSHPlugin_Mesher.cxx
src/GUI/GMSHPluginGUI_HypothesisCreator.cxx
src/GUI/GMSHPlugin_msg_en.ts
src/GUI/GMSHPlugin_msg_fr.ts

index 99634f64ce5256db83a51c583840e9993723b803..ccbabdedd9d155846c07eb860e7d883d8190fadc 100644 (file)
@@ -32,7 +32,7 @@ GMSHPlugin_Hypothesis::GMSHPlugin_Hypothesis (int hypId,
                                                   SMESH_Gen * gen)
   : SMESH_Hypothesis(hypId, gen),
     _algo2d         (automatic),
-    _algo3d         (frontal3),
+    _algo3d         (delaunay3),
     _recomb2DAlgo   (standard),
     _recombineAll   (false),
     _subdivAlgo     (none),
index ded2dbfe07aa3ba5b1d2ea8c3086c35d5af62542..75210e309ebb0f7dcc941664fdb2a78c4a58b23d 100644 (file)
@@ -52,6 +52,7 @@ public:
   
   enum Algo3D
   {
+   delaunay3,
    frontal3,
    frontaldelaunay,
    fontalhex,
index 9d21d3d2b7e2695e4d3f5e4f6d09320d9a1f4643..25264f8184de7a69244c540646ed6d9e565833d8 100644 (file)
@@ -241,16 +241,29 @@ void GMSHPlugin_Mesher::SetGmshOptions()
   //*/
 
   std::map <int,double> mapAlgo2d;
-  mapAlgo2d[0]=2; mapAlgo2d[1]=1; mapAlgo2d[2]=5; mapAlgo2d[3]=6; mapAlgo2d[4]=8; mapAlgo2d[5]=9;
+  mapAlgo2d[0]=2; // Automatic
+  mapAlgo2d[1]=1; // MeshAdapt
+  mapAlgo2d[2]=5; // Delaunay
+  mapAlgo2d[3]=6; // Frontal
+  mapAlgo2d[4]=8; // DelQuad
+  mapAlgo2d[5]=9; // Packing of parallelograms
+
   std::map <int,double> mapAlgo3d;
-  mapAlgo3d[0]=1; mapAlgo3d[1]=4; mapAlgo3d[2]=5; mapAlgo3d[3]=6; mapAlgo3d[4]=7; mapAlgo3d[5]=9;
+  mapAlgo3d[0]=1; // Delaunay
+  mapAlgo3d[1]=4; // Frontal
+  /*
+  mapAlgo3d[2]=5; // Frontal-Delaunay
+  mapAlgo3d[3]=6; // Frontal-Hex
+  */
+  mapAlgo3d[2]=7; // MMG3D
+  mapAlgo3d[3]=9; // R-tree
 
   int ok;
   ok = GmshSetOption("Mesh", "Algorithm"                , mapAlgo2d[_algo2d])    ;
   ASSERT(ok);
   if ( !_is2d)
   {
-    ok = GmshSetOption("Mesh", "Algorithm3D"            , mapAlgo2d[_algo3d])    ;
+    ok = GmshSetOption("Mesh", "Algorithm3D"            , mapAlgo3d[_algo3d])    ;
     ASSERT(ok);
   }
   ok = GmshSetOption("Mesh", "RecombinationAlgorithm"   , (double)_recomb2DAlgo) ;
@@ -942,7 +955,7 @@ void  GMSHPlugin_Mesher::mymsg::operator()(std::string level, std::string msg)
         throw oss.str();
     }
     else
-        printf(oss.str().c_str());
+      printf("%s\n", oss.str().c_str());
   }
 }
 
index 11227f003ec03e9847266a70b501a6b47f711bc9..e26b5846f49cded3029af3cf4f1f8afeb253b96f 100644 (file)
@@ -58,9 +58,12 @@ enum Algo2D
 
 enum Algo3D
   {
+   delaunay3,
    frontal3,
+   /*
    frontaldelaunay,
    fontalhex,
+   */
    mmg3d,
    rtree
   };
@@ -149,8 +152,8 @@ QFrame* GMSHPluginGUI_HypothesisCreator::buildFrame()
   aGroupLayout->addWidget( new QLabel( tr( "GMSH_2D_ALGO" ), GroupC1 ), row, 0 );
   my2DAlgo = new QComboBox( GroupC1 );
   QStringList types2DAlgo;
-  types2DAlgo << tr( "GMSH_AUTOMATIC" ) << tr( "GMSH_MESH_ADAPT" )   << tr( "GMSH_DELAUNAY" ) <<
-                 tr( "GMSH_FRONTAL" )       << tr( "GMSH_DELAUNAY_FOR_QUAD" ) << tr( "GMSH_PACKING_OF_PARALLELOGRAMS" );
+  types2DAlgo << tr( "GMSH_AUTOMATIC" ) << tr( "GMSH_MESH_ADAPT" ) << tr( "GMSH_DELAUNAY" ) <<
+                 tr( "GMSH_FRONTAL" ) << tr( "GMSH_DELAUNAY_FOR_QUAD" ) << tr( "GMSH_PACKING_OF_PARALLELOGRAMS" );
   my2DAlgo->addItems( types2DAlgo );
   aGroupLayout->addWidget( my2DAlgo, row, 1 );
   row++;
@@ -161,8 +164,8 @@ QFrame* GMSHPluginGUI_HypothesisCreator::buildFrame()
     aGroupLayout->addWidget( new QLabel( tr( "GMSH_3D_ALGO" ), GroupC1 ), row, 0 );
     my3DAlgo = new QComboBox( GroupC1 );
     QStringList types3DAlgo;
-    types3DAlgo << tr( "GMSH_FRONTAL_DELAUNAY" ) << tr( "GMSH_FRONTAL_HEX" )   << tr( "GMSH_MMG3D" ) <<
-                   tr( "GMSH_R_TREE" );
+    types3DAlgo << tr( "GMSH_DELAUNAY3" ) << tr( "GMSH_FRONTAL3" )  /*<< tr( "GMSH_FRONTAL_DELAUNAY" ) <<
+                   tr( "GMSH_FRONTAL_HEX" )*/ << tr( "GMSH_MMG3D" ) << tr( "GMSH_R_TREE" );
     my3DAlgo->addItems( types3DAlgo );
     aGroupLayout->addWidget( my3DAlgo, row, 1 );
     row++;
index 98d0638be857ba171697cc2bdfff540aae1723b6..94e0387cf8960a74e8f62dbde78d4d47c39e1f66 100644 (file)
@@ -53,7 +53,7 @@
     </message>
     <message>
         <source>GMSH_2D_ALGO</source>
-        <translation>2D algorithm </translation>
+        <translation>2D algorithm</translation>
     </message>
     <message>
         <source>GMSH_AUTOMATIC</source>
         <translation>3D Algorithm</translation>
     </message>
     <message>
-        <source>GMSH_FRONTAL_DELAUNAY</source>
-        <translation>Frontal Delaunay</translation>
+        <source>GMSH_DELAUNAY3</source>
+        <translation>Delaunay</translation>
     </message>
     <message>
-        <source>GMSH_FRONTAL_HEX</source>
-        <translation>Frontal Hex</translation>
+        <source>GMSH_FRONTAL3</source>
+        <translation>Frontal</translation>
     </message>
+    <!--
+     !<message>
+     !   <source>GMSH_FRONTAL_DELAUNAY</source>
+     !   <translation>Frontal Delaunay</translation>
+     !</message>
+     !<message>
+     !   <source>GMSH_FRONTAL_HEX</source>
+     !   <translation>Frontal Hex</translation>
+     !</message>
+      -->
     <message>
         <source>GMSH_MMG3D</source>
         <translation>MMG3D</translation>
index b796525d4f015d14f662251bf2333e6b130c9ed2..08faed523b87f60268bf6c4675a2505e188719b0 100644 (file)
         <translation>Algorithme 3D</translation>
     </message>
     <message>
-        <source>GMSH_FRONTAL_DELAUNAY</source>
-        <translation>Frontal Delaunay</translation>
+        <source>GMSH_DELAUNAY3</source>
+        <translation>Delaunay</translation>
     </message>
     <message>
-        <source>GMSH_FRONTAL_HEX</source>
-        <translation>Frontal Hex</translation>
+        <source>GMSH_FRONTAL3</source>
+        <translation>Frontal</translation>
     </message>
+    <!--
+     !<message>
+     !   <source>GMSH_FRONTAL_DELAUNAY</source>
+     !   <translation>Frontal Delaunay</translation>
+     !</message>
+     !<message>
+     !   <source>GMSH_FRONTAL_HEX</source>
+     !   <translation>Frontal Hex</translation>
+     !</message>
+      -->
     <message>
         <source>GMSH_MMG3D</source>
         <translation>MMG3D</translation>