Salome HOME
23245: [CEA 1696] Patch for HYBRIDPLUGIN
authoreap <eap@opencascade.com>
Mon, 29 Feb 2016 12:12:59 +0000 (15:12 +0300)
committereap <eap@opencascade.com>
Mon, 29 Feb 2016 12:12:59 +0000 (15:12 +0300)
HYBRIDPLUGIN uses an old version of MG-Hybrid. This patch modifies the script to use the last version available in the prerequisite base. Since the parameters are quite different between the two versions, I also updated the hybridplugin documentation.

bin/mg-hybrid.bash
doc/salome/gui/HYBRIDPLUGIN/input/hybrid_hypo.doc
doc/salome/gui/HYBRIDPLUGIN/input/index.doc
src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx

index 0094743e2e0e36c6bfb8247fe26451c089e4ace6..5ade12618def133eaf96caddc4e49b96722f79fb 100755 (executable)
@@ -31,42 +31,16 @@ resFindOutFile="None"
 echo "mg-hybrid.bash initial parameters are:" $*
 #$0 is ignored
 
-if [[ $HOSTNAME == *hpcspot* ]]
-  then
-    HOST="hpcspot"
-  else
-    HOST="STANDART_CentOs6" #CentOs6 default
-fi
-echo "HOST" $HOST
-
-#we need to licence for mg-hybrid.exe
-#for example, have to be set
-#if [ $HOST == "hpcspot" ]
-#  then
-#    #env openmpi centos6.5 hpcspot.com
-#    export DISTENE_LICENSE_FILE="Use global envvar: DLIM8VAR"
-#    export DLIM8VAR="dlim8 1:1:29030@10.27.51.1/002590c96d98::8fbdc02cde090ca0369ad028e839065b97709e3c33e640eb6a3c2c7e40fe3985"
-#  else
-#    export DISTENE_LICENSE_FILE="Use global envvar: DLIM8VAR"
-#    export DLIM8VAR="dlim8 1:1:29030@132.166.151.49/84c419b8::87af196ab2a936ab31363624539bff8096fbe1f3c83028c8f6b399b0a904ef85"
-#fi
-
 echo "mg-hybrid.bash assume licence file set:"
 env | grep DLIM
 
 findOutFile $*
 echo "result output File is:" $resFindOutFile
 
-#mg-hybrid.exe_Linux_64_avril2014 --help
-#mg-hybrid.exe_Linux_64_avril2014 $*
-mg-hybrid.exe_Linux_64_juillet2014 $*
+$MESHGEMS_ROOT_DIR/bin/run_mg-hybrid.sh $*
+
+#$MESHGEMS_ROOT_DIR/bin/Linux_64/mg-hybrid.exe $*
 
 #to EZ and direct debug visualization (with gui salome load script createGroupsOnEntitiesFromGMFFile.py)
 cp -f $resFindOutFile /tmp/tmp.mesh
 
-#ldd `which mg-hybrid.exe_Linux_64_avril2014`
-#      linux-vdso.so.1 =>  (0x00007fff3bfff000)
-#      libpthread.so.0 => /lib64/libpthread.so.0 (0x000000358b400000)
-#      libm.so.6 => /lib64/libm.so.6 (0x000000358a800000)
-#      libc.so.6 => /lib64/libc.so.6 (0x000000358ac00000)
-#      /lib64/ld-linux-x86-64.so.2 (0x000000358a400000)
index bc7937bb91cc3b0b154c1fd03d5362aff0d201b7..c9995ccf505aecff8a45c236c8938d538f5ad5cd 100644 (file)
@@ -14,16 +14,16 @@ To get a licence, visit http://www.distene.com and http://www.meshgems.com/
 
 \image html hybrid_hypothesis_arguments.png
 
-- <b>hybrid parameters</b> - MeshGems-Hybrid is actually a project, waiting for a distene documentation.
-See MeshGems-Hybrid help command:
+- <b>Hybrid parameters</b> - See distene documentation or MeshGems-Hybrid help command:
 
 \verbatim
 
-$> mg-hybrid.exe_Linux_64_juillet2014 --help
+$> mg-hybrid.exe --help
 
-    =============================================
-    MG-Hybrid (b8) -- MeshGems 1.3-5 (July, 2014)
-    =============================================
+
+    ==============================================
+    MG-Hybrid -- MeshGems 2.1-11 (September, 2015)
+    ==============================================
 
         Distene SAS
            Campus Teratec
@@ -33,28 +33,32 @@ $> mg-hybrid.exe_Linux_64_juillet2014 --help
         Phone: +33(0)970-650-219   Fax: +33(0)169-269-033
         EMail: <support@distene.com>
 
-        Running MG-Hybrid (b8) (Copyright 2014 by Distene SAS)
-           date of run: 10-Jul-2014 AT 13:46:28
-           running on : Linux 2.6.32-431.11.2.el6.centos.plus.x86_64 x86_64
+        Running MG-Hybrid (Copyright 2014-2015 by Distene SAS)
+           date of run: 26-Jan-2016 AT 12:24:16
+           running on : Linux 3.6.10-4.fc18.x86_64 x86_64
            using modules: 
-                MeshGems-Core 1.3-4
+                MeshGems-Core 2.1-11
 
         MeshGems is a Registered Trademark of Distene SAS
 
 
 
-MeshGems-Hybrid USAGE
-    mg-hybrid.exe_Linux_64_juillet2014 [-h] [-v <verbose>] [-i <filein>] \
-        [-o <fileout>] [--max_number_of_threads <maxthreads>] \
-        [--boundary_layers_surface_ids <list>] \
-        [--boundary_layers_imprint_ids <list>] \
-        [--boundary_layers_subdomain_direction <dir>] \
-        [--height_of_the_first_layer <height>] \
+MG-HYBRID USAGE
+    mg-hybrid.exe [-h] [-v <verbose>] [-i <filein>] [-o <fileout>] \
+        [--global_physical_size <size>] \
+        [--max_number_of_threads <maxthreads>] \
+        [--boundary_layer_size_mode <mode>] \
         [--number_of_boundary_layers <number>] \
-        [--boundary_layers_geometric_progression <real>] [--gradation <real>] \
+        [--boundary_layer_global_initial_height <height>] \
+        [--boundary_layer_surface_tags <list>] \
+        [--boundary_layer_initial_height_on_surface_tags <list>] \
+        [--boundary_layer_imprint_tags <list>] \
+        [--boundary_layer_geometric_progression <real>] \
+        [--boundary_layer_max_element_angle <size>] \
+        [--normal_direction <dir>] [--gradation <real>] \
         [--element_generation <type>] [--collision_mode <mode>] \
-        [--add_multinormals <yes|no>] \
-        [--multinormals_angle_threshold <angle>] [--smooth_normals <yes|no>]
+        [--add_multinormals <yes|no>] [--multinormal_angle_threshold <angle>] \
+        [--smooth_normals <yes|no>] [--optimisation <type>]
 
   -h --help
           prints this help.
@@ -76,84 +80,126 @@ MeshGems-Hybrid USAGE
           Using an existing file is forbidden.
           Using the same file as --in is forbidden.
 
+     --global_physical_size <size>
+          Sets the global physical size.
+          Default: no default.
+
      --max_number_of_threads <maxthreads>
           Sets the maximum number of threads to be used in parallel.
           Default: 4
 
-     --boundary_layers_surface_ids <list>
-          Comma separated list of surface references to be used to grow layer.
+     --boundary_layer_size_mode <mode>
+          Sets the behavior for the boundary layer sizes.
+          If <mode> is:
+            global: the boundary_layer_global_initial_height is used to compute
+             the layer heights
+            local: the boundary_layer_surface_tags and
+             boundary_layer_initial_height_on_surface_tags are used to compute
+             the layer heights
+          Default: global
+
+     --number_of_boundary_layers <number>
+          Sets the number of boundary layers.
+          Default: 0
+
+     --boundary_layer_global_initial_height <height>
+          Sets the height of the first layer.
+
+     --boundary_layer_surface_tags <list>
+          Comma separated list of surface references to be used to grow
+          boundary layers.
+
+     --boundary_layer_initial_height_on_surface_tags <list>
+          Comma separated list of initial heights to be used to grow boundary
+          layers.
 
-     --boundary_layers_imprint_ids <list>
+     --boundary_layer_imprint_tags <list>
           Comma separated list of surface references that are imprinted by
           boundary layers.
 
-     --boundary_layers_subdomain_direction <dir>
-          Describes whether the layers grow inwards or outwards.
-          if <dir> is:
-           1 : means the layers grow inward
-          -1 : means the layers grow outward
-          Default: 1
+     --boundary_layer_geometric_progression <real>
+          Sets the geometric progression for all the boundary layer growths
+          (position of layer number i is h * g^(i-1)).
+          Default: 1.0
 
-     --height_of_the_first_layer <height>
-          Sets the height of the first layer.
+     --boundary_layer_max_element_angle <size>
+          Sets the maximum internal angles of elements (in degree). This
+          setting applies to the boundary layer elements only.
+          Default: 165.
 
-     --number_of_boundary_layers <number>
-          Sets the number of boundary layers.
+     --normal_direction <dir>
+          Specifies whether mg-hybrid should use the surface normals or the
+          inverse of the surface normals.
+          if <dir> is:
+             1 : means the layers grow in the same direction as the normals to
+             the surface
+            -1 : means the layers grow in the opposite direction to the normals
+             of the surface
           Default: 1
 
-     --boundary_layers_geometric_progression <real>
-          Sets the geometric progression for the boundary layer growth (layer
-          number i position is i * h * g^i).
-          Default: 1.0
-
      --gradation <real>
-          Sets the gradation for the boundary layer height.
+          Sets the desired maximum ratio between 2 adjacent edges. It applies
+          only to the edges which belong to the tetrahedra.
           Default: 2.0
 
      --element_generation <type>
           Sets the element type for the mesh generation.
           If <type> is:
-          tetra-dominant : prismatic or hexahedral elements in the boundary
-          layers, tetrahedra in the remaining volume
-          hexa-dominant : prismatic or hexahedral elements in the boundary
-          layers, hexcore in the remaining volume
-          Default: tetra-dominant
+            tetra_dominant : prismatic or hexahedral elements in the boundary
+             layers, tetrahedra in the remaining volume
+            hexa_dominant : prismatic or hexahedral elements in the boundary
+             layers, mixture of hexahedra and tetrahedra in the remaining
+             volume
+            cartesian_core : cartesian hexa core with tetrahedra and pyramids
+             in the remaining volume
+            extrusion_only : only prismatic or hexahedral elements near the
+             boundary are generated. The remaining volume is not filled.
+          Default: tetra_dominant
 
      --collision_mode <mode>
           Sets the behavior in case of collision between layers.
           If <mode> is:
-          decrease : keep the number of desired layer but decrease the height
-          of the layers to avoid collision
-          stop : stop locally the layers generation; the number of desired
-          layer may not be respected
-          Default: skip
+            decrease : keeps the number of desired layer but decreases the
+             height of the layers to avoid any collision
+            stop : stops locally the generation of layers to avoid collisions;
+             the number of generated layers may differ from the specified
+             desired number
+          Default: stop
 
      --add_multinormals <yes|no>
           Add extra normals at opening ridges and corners.
           Default: no
 
-     --multinormals_angle_threshold <angle>
-          Set the maximum angle between the multiple normals at opening ridges
-          .
+     --multinormal_angle_threshold <angle>
+          Set the maximum angle between the multiple normals at opening ridges.
           Default: 30
 
      --smooth_normals <yes|no>
           Smooth normals at closed ridges and corners.
           Default: no
 
-
- ==============================================================================
-                   MeshGems-Hybrid SOFTWARE 1.3-5 (July, 2014) 
-                      compiled Jul  4 2014 14:33:45 GMT
-                                 END OF SESSION
-           Copyright 2014 by Distene SAS  All Rights Reserved
- ==============================================================================
-      ( Distene SAS
-       Phone: +33(0)164-908-596     Fax: +33(0)169-269-033
-       EMail: <support@distene.com> )
+     --optimisation <type>
+          sets the optimisation type.
+          If <type> is:
+              no : no optimisation is applied
+             yes : optimisation is performed upon mesh generation 
+            only : only optimisation is performed to an existing volume mesh.
+          Default: yes.
+
+
+================================================================================
+                 MG-Hybrid -- MeshGems 2.1-11 (September, 2015)
+        END OF SESSION - MG-Hybrid (Copyright 2014-2015 by Distene SAS)
+                   compiled Sep  3 2015 13:52:38 on Linux_64
+               MeshGems is a Registered Trademark of Distene SAS
+================================================================================
+       ( Distene SAS
+        Phone: +33(0)970-650-219   Fax: +33(0)169-269-033
+        EMail: <support@distene.com> )
 
 \endverbatim
 \n
+- <b>Limitations</b> - Some of the MG-Hybrid parameters can not be changed in SALOME and are set to their default values. The parameters concerned are the following : global_physical_size, boundary_layer_size_mode, boundary_layer_initial_height_on_surface_tags, boundary_layer_max_element_angle and optimisation.
 
 \ref hybrid_top "Back to top"
 
index 3a8175121fb7d255ad3b4146ae17c57efef7231e..9096b1fb19637fceb1611435e3141464b0d5752a 100644 (file)
@@ -8,8 +8,7 @@ pyramids, prisms and hexahedra elements.
 - Generating 3D meshes from 2D meshes of a wrap (triangles and quadrangles), 
 working with geometrical objects for setting and meshing layers.
 
-\note HYBRIDPLUGIN plugin used MeshGems-Hybrid commercial mesher, 
-which is a project in 2014, and require a 
+\note HYBRIDPLUGIN plugin used MeshGems-Hybrid commercial mesher and require a 
 license to be used within the Mesh module.
 
 To manage parameters of the HYBRIDPLUGIN use \subpage hybrid_hypo_page and \subpage additional_hypo_page
index 7d70c42ec9234c4dfe5b652ea4957c759ac0e06e..ae8843560f2939bed53b52af80676f15e5211fb8 100644 (file)
@@ -1768,18 +1768,24 @@ std::string HYBRIDPlugin_Hypothesis::CommandToRun(const HYBRIDPlugin_Hypothesis*
   //bool p_i     = ( hyp->myTextOption.find("-i")  != std::string::npos );
   //bool p_o     = ( hyp->myTextOption.find("-o")  != std::string::npos );
   bool p_mnot  = ( hyp->myTextOption.find("--max_number_of_threads ")  != std::string::npos );
-  bool p_blsi  = ( hyp->myTextOption.find("--boundary_layers_surface_ids ")  != std::string::npos );
-  bool p_blii  = ( hyp->myTextOption.find("--boundary_layers_imprint_ids ")  != std::string::npos );
-  bool p_blsd  = ( hyp->myTextOption.find("--boundary_layers_subdomain_direction ")  != std::string::npos );
-  bool p_hotfl = ( hyp->myTextOption.find("--height_of_the_first_layer ")  != std::string::npos );
+  bool p_blsi  = ( hyp->myTextOption.find("--boundary_layer_surface_tags ")  != std::string::npos );
+  bool p_blii  = ( hyp->myTextOption.find("--boundary_layer_imprint_tags ")  != std::string::npos );
+  bool p_blsd  = ( hyp->myTextOption.find("--normal_direction ")  != std::string::npos );
+  bool p_hotfl = ( hyp->myTextOption.find("--boundary_layer_global_initial_height ")  != std::string::npos );
   bool p_nobl  = ( hyp->myTextOption.find("--number_of_boundary_layers ")  != std::string::npos );
-  bool p_blgp  = ( hyp->myTextOption.find("--boundary_layers_geometric_progression ")  != std::string::npos );
+  bool p_blgp  = ( hyp->myTextOption.find("--boundary_layer_geometric_progression ")  != std::string::npos );
   bool p_eg    = ( hyp->myTextOption.find("--element_generation ")  != std::string::npos );
   bool p_cm    = ( hyp->myTextOption.find("--collision_mode ")  != std::string::npos );
   bool p_am    = ( hyp->myTextOption.find("--add_multinormals ")  != std::string::npos );
-  bool p_mat   = ( hyp->myTextOption.find("--multinormals_angle_threshold ")  != std::string::npos );
+  bool p_mat   = ( hyp->myTextOption.find("--multinormal_angle_threshold ")  != std::string::npos );
   bool p_sn    = ( hyp->myTextOption.find("--smooth_normals ")  != std::string::npos );
 
+//missing options :
+//- global_physical_size
+//- boundary_layer_size_mode
+//- boundary_layer_initial_height_on_surface_tags
+//- boundary_layer_max_element_angle
+
   bool nolayers = false;
   bool layersOnAllWrap = hyp->myLayersOnAllWrap;
   
@@ -1824,13 +1830,13 @@ std::string HYBRIDPlugin_Hypothesis::CommandToRun(const HYBRIDPlugin_Hypothesis*
   if ( !p_blsd && hyp ) {
     if ( hyp->myBoundaryLayersGrowth >= 0 && hyp->myBoundaryLayersGrowth <= 1 ) {
       const char* value[] = { "1" , "-1" };
-      cmd += " --boundary_layers_subdomain_direction ";
+      cmd += " --normal_direction ";
       cmd += value[ hyp->myBoundaryLayersGrowth ];
     }
   }
   
   if ( !p_hotfl && hyp ) {
-    cmd += " --height_of_the_first_layer ";
+    cmd += " --boundary_layer_global_initial_height ";
     cmd += hyp->myHeightFirstLayer;
   }
   
@@ -1843,7 +1849,7 @@ std::string HYBRIDPlugin_Hypothesis::CommandToRun(const HYBRIDPlugin_Hypothesis*
   }
   
   if ( !p_blgp && hyp ) {
-    cmd += " --boundary_layers_geometric_progression ";
+    cmd += " --boundary_layer_geometric_progression ";
     cmd += hyp->myBoundaryLayersProgression;
   }
 
@@ -1852,9 +1858,9 @@ std::string HYBRIDPlugin_Hypothesis::CommandToRun(const HYBRIDPlugin_Hypothesis*
   //TODO? if ( !nolayers ) cmd += " --boundary_layers_surface_ids 5,6 "; //as all wrap shell and triangles of enforced mesh
   if ( !nolayers ) {
     if (layersOnAllWrap)
-      cmd += " --boundary_layers_surface_ids 5 "; //as triangles of all wrap
+      cmd += " --boundary_layer_surface_tags 5 "; //as triangles of all wrap
     else
-      cmd += " --boundary_layers_surface_ids 6 "; //as triangles of enforced mesh
+      cmd += " --boundary_layer_surface_tags 6 "; //as triangles of enforced mesh
   }
 
   if ( !p_eg && hyp ) {
@@ -1881,7 +1887,7 @@ std::string HYBRIDPlugin_Hypothesis::CommandToRun(const HYBRIDPlugin_Hypothesis*
   }
   
   if ( !p_mat && hyp ) {
-    cmd += " --multinormals_angle_threshold ";
+    cmd += " --multinormal_angle_threshold ";
     cmd += hyp->myMultinormalsAngle;
   }
   
@@ -1933,7 +1939,7 @@ std::string HYBRIDPlugin_Hypothesis::GetFileName(const HYBRIDPlugin_Hypothesis*
 
 std::string HYBRIDPlugin_Hypothesis::GetExeName()
 {
-  //call mg-hybrid.bash is script which assumes new project version(s) mg-hybrid.exe_Linux_64_avril2014 and special? licence.
+  //call mg-hybrid.bash is script which assumes new project version(s) mg-hybrid.exe in the prerequisite base and special? licence.
   return "mg-hybrid.bash";
 }