Salome HOME
IMP: SMESH/Yams plug-in: Update to use Meshgems-SurfOpt 1.1 (new name of Yams)
authorrnc <rnc@opencascade.com>
Fri, 30 Aug 2013 15:35:06 +0000 (15:35 +0000)
committerrnc <rnc@opencascade.com>
Fri, 30 Aug 2013 15:35:06 +0000 (15:35 +0000)
resources/SalomeApp.xml.in
src/Tools/YamsPlug/doc/Advanced_params.rst
src/Tools/YamsPlug/doc/Generics_params.rst
src/Tools/YamsPlug/doc/conf.py.in
src/Tools/YamsPlug/doc/editHypo.rst
src/Tools/YamsPlug/doc/index.rst
src/Tools/YamsPlug/doc/lct.rst
src/Tools/YamsPlug/monYamsPlugDialog.py
src/Tools/smesh_plugins.py

index 7f3e3c14eead0b784a7e584e886c62c1ca825c3c..18ab16368bca111eddc10f873a29a9d1e8fa5f52 100644 (file)
   <section name="smesh_help" >
     <parameter name="sub_menu"          value="%1 module"/>
     <parameter name="User's Guide"      value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/index.html"/>
   <section name="smesh_help" >
     <parameter name="sub_menu"          value="%1 module"/>
     <parameter name="User's Guide"      value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/index.html"/>
-    <parameter name="Plug-ins/Yams plugin User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/yams/index.html"/>
+    <parameter name="Plug-ins/MGSurfOpt plugin User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/yams/index.html"/>
     <parameter name="Plug-ins/MGCleaner plugin User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/MGCleaner/index.html"/>
     <parameter name="Developer's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/tui/SMESH/index.html"/>
   </section>
     <parameter name="Plug-ins/MGCleaner plugin User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/MGCleaner/index.html"/>
     <parameter name="Developer's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/tui/SMESH/index.html"/>
   </section>
index 3c83be1d65de67c99787105b99eacb96bc2b9874..f76a749ddb2714847eecf2eadec1d0f98ca4c27d 100644 (file)
@@ -4,11 +4,11 @@ Advanced Remeshing Options
 ** be aware that no control of coherency is done when you set these parameters : for instance, geometrical approximation is only allowed when yams compute a mesh for finite elements but the GUI will let you choose geometrical approximation and compute a visualisation mesh. read DISTENE documentation **
 
   - **Ridge detection**
 ** be aware that no control of coherency is done when you set these parameters : for instance, geometrical approximation is only allowed when yams compute a mesh for finite elements but the GUI will let you choose geometrical approximation and compute a visualisation mesh. read DISTENE documentation **
 
   - **Ridge detection**
-if not set (ridge detection disabled ), Yams will not try to detect any new ridge edge by its own mechanism : 
+if not set (ridge detection disabled ), MeshGems-SurfOpt will not try to detect any new ridge edge by its own mechanism : 
 it will consider as ridge only the ridges given in the mesh.  All non-ridge edges that would have been detected as ridge by the Ridge angle paramaeter (see below split edge)  will be considered as part of the same continuous patch.  This option should not be checked when all the known ridges of the mesh are given and when all other possible ridges are not geometric ridges to take into account.
 
   - **Point smoothing**
 it will consider as ridge only the ridges given in the mesh.  All non-ridge edges that would have been detected as ridge by the Ridge angle paramaeter (see below split edge)  will be considered as part of the same continuous patch.  This option should not be checked when all the known ridges of the mesh are given and when all other possible ridges are not geometric ridges to take into account.
 
   - **Point smoothing**
-When not set (point smoothing is disabled), Yams will not try to move the initial given vertices (along an edge, a ridge or onto the surface), hence Yams will only swap edges, remove vertices or add vertices (refines) to change the mesh.
+When not set (point smoothing is disabled), MeshGems-SurfOpt will not try to move the initial given vertices (along an edge, a ridge or onto the surface), hence MeshGems-SurfOpt will only swap edges, remove vertices or add vertices (refines) to change the mesh.
 
   - **Geometrical  approximation**
 this field as well as the Chordal deviation tolerance parameter,enables the user to bound the maximal chordal deviation allowed. it avoids having sharp angles. , that is, the maximal distance allowed between the detected curve and the plane of the corresponding mesh face. It avoids having faces too far away from the curve they represent.
 
   - **Geometrical  approximation**
 this field as well as the Chordal deviation tolerance parameter,enables the user to bound the maximal chordal deviation allowed. it avoids having sharp angles. , that is, the maximal distance allowed between the detected curve and the plane of the corresponding mesh face. It avoids having faces too far away from the curve they represent.
@@ -31,12 +31,12 @@ These two parameters allow the user to prescribe a Maximal/Minimal size for the
 
 
   - **Mesh gradation**
 
 
   - **Mesh gradation**
-This paramater P controls the element size variation : Yams will avoid having two adjacent egdes which sizes vary more than th given gradation. a size correction is applied to the size map : if two adjacent edges are respectively e1 and e2 long and e2 > Pxe1, then, the new size for the second edge will be set to P x e1.
+This paramater P controls the element size variation : MeshGems-SurfOpt will avoid having two adjacent egdes which sizes vary more than th given gradation. a size correction is applied to the size map : if two adjacent edges are respectively e1 and e2 long and e2 > Pxe1, then, the new size for the second edge will be set to P x e1.
 **This procedure is desactived if P=-1***
 
 
 
   - **Split edge**
 **This procedure is desactived if P=-1***
 
 
 
   - **Split edge**
-If this option is activated, Yams creates new vertices placed on the curved surface and adds them to elements.
+If this option is activated, MeshGems-SurfOpt creates new vertices placed on the curved surface and adds them to elements.
 It may be used to obtain higher order elements.
 
 It may be used to obtain higher order elements.
 
index 046e688c91ff570d9b4ff84fbbf50716f4fb91e4..761f26fe3b340c778df9d28dd03b3cf230dbc56f 100644 (file)
@@ -1,16 +1,16 @@
 Generic  Options
 =================
 
 Generic  Options
 =================
 
-These options are not meshing options but allow the user to configure control parameters for yams.
+These options are not meshing options but allow the user to configure control parameters for MeshGems-SurfOpt.
 
 
 - **Verbosity Level**
 
 
 
 - **Verbosity Level**
 
-This parameter (between 0 and 10) indicates the amount of information that Yams prints during the run.
+This parameter (between 0 and 10) indicates the amount of information that MeshGems-SurfOpt prints during the run.
 
 
 - **Memory Size**
 
 
 - **Memory Size**
-You usually don't have to set this parameter but you can choose to limit the amount of memory used by Yams. - It requires 370 bytes per node -. Or, if you try to enrich a already big mesh (up to 2 millions nodes), you exceptionally, need to allocate more memory.
+You usually don't have to set this parameter but you can choose to limit the amount of memory used by MeshGems-SurfOpt. - It requires 370 bytes per node -. Or, if you try to enrich a already big mesh (up to 2 millions nodes), you exceptionally, need to allocate more memory.
     
     
 - **File** 
     
     
 - **File** 
index 6f0e3636c4e0c6a1851d98d1072673bfb0509316..0541580ddf9e79433a4d9eca223ffaf112274a25 100644 (file)
@@ -35,8 +35,8 @@ source_suffix = '.rst'
 master_doc = 'index'
 
 # General substitutions.
 master_doc = 'index'
 
 # General substitutions.
-project = 'YAMS Plug-in'
-copyright = '2011, Pascale Noyret'
+project = 'MeshGems-SurfOpt Plug-in'
+copyright = '2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE'
 
 # The default replacements for |version| and |release|, also used in various
 # other places throughout the built documents.
 
 # The default replacements for |version| and |release|, also used in various
 # other places throughout the built documents.
index 75b8eb76ad778cb6bd0f6cb5431626bf3e815437..5a53da35517d8a80b947e13c64048df43e430c3f 100644 (file)
@@ -1,10 +1,10 @@
 .. _hypothesis-label:
 
 ===========================
 .. _hypothesis-label:
 
 ===========================
-How to save Yams Parameters 
+How to save MeshGems-SurfOpt Parameters 
 ===========================
 
 ===========================
 
-Yams hypothesis is not meshing hypothesis for Salome, but hypothesis for yams.
+MeshGems-SurfOpt hypothesis is not meshing hypothesis for Salome, but hypothesis for yams.
 The current set of parameters is automatically written in the salome study object browser when you run computation.
 
 Theses parameters could also be stored in a special file.
 The current set of parameters is automatically written in the salome study object browser when you run computation.
 
 Theses parameters could also be stored in a special file.
index 45442f9aec195a92fbf8259903eff19e67193089..e58f86526b5de93336d96cb51cf36b5a3f25aafe 100644 (file)
@@ -2,17 +2,17 @@
    You can adapt this file completely to your liking, but it should at least
    contain the root `toctree` directive.
 
    You can adapt this file completely to your liking, but it should at least
    contain the root `toctree` directive.
 
-YAMS plugin documentation
-==========================
+MeshGems-SurfOpt plugin documentation
+=====================================
 
 
-This documentation covers the usage of Yams as plug-in in Salome that can be used within the Salome
+This documentation covers the usage of MeshGems-SurfOpt as plug-in in Salome that can be used within the Salome
 Mesh module for remeshing 2D Surface. 
 
 Mesh module for remeshing 2D Surface. 
 
-Yams plug-in uses Distene commercial software Yams, which is an **automatic surface remeshing tool**.
-This plug_in offers only the most common functionnalities of the tool.
+MeshGems-SurfOpt plug-in uses Distene commercial software MeshGems-SurfOpt, which is an **automatic surface remeshing tool**.
+This plug-in offers only the most common functionnalities of the tool.
 
 .. note::
 
 .. note::
-  for a complete documentation, see :download:`Yams whitepaper <files/YamsWhitePaper_3.2.pdf>`.
+  for a complete documentation, see :download:`MeshGems-SurfOpt: The automatic surface remeshing tool of the MeshGems Suite <files/mg-surfopt_user_manual.pdf>`.
 
 Contents:
 
 
 Contents:
 
index c264926025001748ebd83aa0bf45ad02f200d34a..0f1a012d276af4587a3ede1db84e92a7924091e1 100644 (file)
@@ -1,11 +1,11 @@
-Running Yams Plug-in 
+Running MeshGems-SurfOpt Plug-in 
 =====================
 
 =====================
 
-Yams plug-in can be invoked via SMESH Plugin item in Mesh menu bar 
+MeshGems-SurfOpt plug-in can be invoked via SMESH Plugin item in Mesh menu bar 
 
 .. image:: images/AppelYams.png
    :align: center
 
 
 
 .. image:: images/AppelYams.png
    :align: center
 
 
-This plug-in works only with the commercial software Yams. To obtain a license,
+This plug-in works only with the commercial software MeshGems-SurfOpt. To obtain a license,
 visit www.distene.comm
 visit www.distene.comm
index d8ec10244e0363a90a57134d75ce0dcb82512d41..5ea623eb52a7fc7998ec0f121de7a5d1dbe391a0 100644 (file)
@@ -107,7 +107,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     except Exception:
       QMessageBox.warning(self, "Help", "Help unavailable $SMESH_ROOT_DIR not found")
       return
     except Exception:
       QMessageBox.warning(self, "Help", "Help unavailable $SMESH_ROOT_DIR not found")
       return
-    maDoc=mydir+"/share/doc/salome/gui/SMESH/yams/_downloads/YamsWhitePaper_3.2.pdf"
+    maDoc=mydir+"/share/doc/salome/gui/SMESH/yams/_downloads/mg-surfopt_user_manual.pdf"
     command="xdg-open "+maDoc+";"
     subprocess.call(command, shell=True)
 
     command="xdg-open "+maDoc+";"
     subprocess.call(command, shell=True)
 
@@ -420,7 +420,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     self.fichierIn=""
 
   def prepareFichier(self):
     self.fichierIn=""
 
   def prepareFichier(self):
-    self.fichierIn="/tmp/ForYams_"+str(self.num)+".mesh"
+    self.fichierIn="/tmp/ForYams_"+str(self.num)+".meshb"
     self.__selectedMesh.ExportGMF(self.__selectedMesh, self.fichierIn, True)
 
   def PrepareLigneCommande(self):
     self.__selectedMesh.ExportGMF(self.__selectedMesh, self.fichierIn, True)
 
   def PrepareLigneCommande(self):
@@ -432,9 +432,8 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
       QMessageBox.critical(self, "File", "unable to read GMF Mesh in "+str(self.fichierIn))
       return False
     
       QMessageBox.critical(self, "File", "unable to read GMF Mesh in "+str(self.fichierIn))
       return False
     
-    self.commande="yams"
-    verbosity=str(self.SP_Verbosity.value())
-    self.commande+=" -v "+verbosity
+    self.commande="mg-surfopt.exe"
+    
     for obj in self.GBOptim.findChildren(QRadioButton,):
       try:
         if obj.isChecked():
     for obj in self.GBOptim.findChildren(QRadioButton,):
       try:
         if obj.isChecked():
@@ -443,31 +442,45 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
           break
       except:
         pass
           break
       except:
         pass
-    self.commande+=" -O "+self.style.toLatin1()
+      
+    style = self.style.toLatin1()
+    # Translation of old Yams options to new MG-SurfOpt options
+    if   style == "0" :
+      self.commande+= " --optimisation only"
+    elif style == "2" :
+      self.commande+= " --Hausdorff_like yes"
+    elif style == "-1":
+      self.commande+= " --enrich no"
+    elif style == "-2":
+      self.commande+= " --Hausdorff_like yes --enrich no"
+    elif style == "U" :
+      self.commande+= " --uniform_flat_subdivision yes"
+    elif style == "S" :
+      self.commande+= " --sand_paper yes"
 
     deb=os.path.splitext(self.fichierIn)
 
     deb=os.path.splitext(self.fichierIn)
-    self.fichierOut=deb[0] + ".d.meshb"
-
-    if self.RB_Absolute.isChecked()==True :
-        self.commande+=" -Dabsolute"
-    else :
-        self.commande+=" -Drelative"
+    self.fichierOut=deb[0] + "_surfopt.meshb"
     
     
-    v=self.SP_toStr(self.SP_Tolerance)
-    self.commande+=",tolerance="+v
-    if self.CB_Ridge.isChecked()==False : self.commande+=",-nr"
-    if self.CB_Point.isChecked()==False : self.commande+=",-ns"
-    if self.SP_Geomapp.value()!=0.04 : self.commande+=",geomapp=%f"%self.SP_Geomapp.value()
-    if self.SP_Ridge.value()!=45.0 : self.commande+=",ridge=%f"%self.SP_Ridge.value()
-    if self.SP_MaxSize.value()!=100 : self.commande+=",maxsize=%f"%self.SP_MaxSize.value()
-    if self.SP_MinSize.value()!=5 : self.commande+=",minsize=%f"%self.SP_MinSize.value()
-    if self.SP_Gradation.value()!=1.3 : self.commande+=",gradation=%f"%self.SP_MaxSize.value()
-    if self.CB_SplitEdge.isChecked()==True : self.commande+=",splitedge=1"
-
-    if self.SP_Verbosity.value()!=3 : self.commande+=" -v %d"%self.SP_Verbosity.value()
-    if self.SP_Memory.value()!=0 : self.commande+=" -m %d"%self.SP_Memory.value()
-
-    self.commande+=" "+self.fichierIn
+    tolerance=self.SP_toStr(self.SP_Tolerance)
+    if not self.RB_Absolute.isChecked():
+      tolerance+="r"  
+    self.commande+=" --chordal_error %s"%tolerance
+    
+    if self.CB_Ridge.isChecked()    == False : self.commande+=" --compute_ridges no"
+    if self.CB_Point.isChecked()    == False : self.commande+=" --optimisation no"
+    if self.CB_SplitEdge.isChecked()== True  : self.commande+=" --element_order quadratic"
+    if self.SP_Geomapp.value()      != 0.04  : self.commande+=" --geometric_approximation_angle %f"%self.SP_Geomapp.value()
+    if self.SP_Ridge.value()        != 45.0  : self.commande+=" --ridge_angle %f"%self.SP_Ridge.value()
+    if self.SP_MaxSize.value()      != 100   : self.commande+=" --max_size %f"   %self.SP_MaxSize.value()
+    if self.SP_MinSize.value()      != 5     : self.commande+=" --min_size %f"   %self.SP_MinSize.value()
+    if self.SP_Gradation.value()    != 1.3   : self.commande+=" --gradation %f"  %self.SP_MaxSize.value()
+    if self.SP_Memory.value()       != 0     : self.commande+=" --max_memory %d" %self.SP_Memory.value()
+    if self.SP_Verbosity.value()    != 3     : self.commande+=" --max_memory %d" %self.SP_Verbosity.value()
+
+    self.commande+=" --in "  + self.fichierIn
+    self.commande+=" --out " + self.fichierOut
+    
+    print self.commande
     return True
 
   def clean(self):
     return True
 
   def clean(self):
index e61dd16a73cd504e5b79f60a561c7acd57833bb6..f7ac148f450dc424b106d9fcebd50cff126c92e1 100644 (file)
@@ -34,7 +34,7 @@ salome_pluginsmanager.AddFunction('MeshCut',
                                   'Cut a tetrahedron mesh by a plane',
                                   MeshCut)
 
                                   'Cut a tetrahedron mesh by a plane',
                                   MeshCut)
 
-salome_pluginsmanager.AddFunction('ReMesh with Yams',
+salome_pluginsmanager.AddFunction('ReMesh with MGSurfOpt ( formerly Yams )',
                                   'Run Yams',
                                   YamsLct)
 
                                   'Run Yams',
                                   YamsLct)