Salome HOME
Merge branch 'V9_5_BR'
[plugins/hexoticplugin.git] / src / HexoticPlugin / HexoticPLUGINBuilder.py
index 7fd42cead0a8bb5f027e9851159de80cd5c30a1a..f9e748361cb1086622dea9224cf789d8869bb9e9 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2016  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2020  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -70,7 +70,7 @@ class Hexotic_Algorithm(Mesh_Algorithm):
     #              if it is @c 0 (default), the algorithm is assigned to the main shape
     def __init__(self, mesh, geom=0):
         Mesh_Algorithm.__init__(self)
-        if noHexoticPlugin: print "Warning: HexoticPlugin module unavailable"
+        if noHexoticPlugin: print("Warning: HexoticPlugin module unavailable")
         self.Create(mesh, geom, MG_Hexa, "libHexoticEngine.so")
         self.params = None
         pass
@@ -100,7 +100,7 @@ class Hexotic_Algorithm(Mesh_Algorithm):
     def SetSizeMap(self, theObject, theSize):
         AssureGeomPublished( self.mesh, theObject )
         if theSize <= 0:
-          raise ValueError, "The size must be > 0"
+          raise ValueError("The size must be > 0")
         self.Parameters().SetSizeMap(theObject, theSize)
         return self.Parameters()
       
@@ -125,9 +125,16 @@ class Hexotic_Algorithm(Mesh_Algorithm):
     #  @param quad not documented
     #  @return hypothesis object
     def MinMaxQuad(self, min=3, max=8, quad=True):
-        print "WARNING: Function MinMaxQuad is deprecated, use SetMinMaxHexes instead"
+        print("WARNING: Function MinMaxQuad is deprecated, use SetMinMaxHexes instead")
         return self.SetMinMaxHexes(min, max)
       
+    ## Set advanced option value
+    #  @param optionName option name
+    #  @param optionValue option value
+    def SetOptionValue(self, optionName, optionValue):
+        self.Parameters().SetOptionValue( optionName, optionValue )
+        pass
+
     ## Defines "ViscousLayers" hypothesis to give MG-Hexa parameters
     #  @param numberOfLayers number of boundary layers
     #  @param firstLayerSize height of the first layer
@@ -171,6 +178,28 @@ class Hexotic_Algorithm(Mesh_Algorithm):
         
         return self.Parameters()
 
+    ## To keep working files or remove them.
+    #  @param toKeep "keep working files" flag value
+    def SetKeepFiles(self, toKeep):
+        self.Parameters().SetKeepFiles(toKeep)
+        pass
+    
+    ## Remove or not the log file (if any) in case of successful computation.
+    #  The log file remains in case of errors anyway. If 
+    #  the "keep working files" flag is set to true, this option
+    #  has no effect.
+    #  @param toRemove "remove log on success" flag value
+    def SetRemoveLogOnSuccess(self, toRemove):
+        self.Parameters().SetRemoveLogOnSuccess(toRemove)
+        pass
+    
+    ## Print the the log in a file. If set to false, the
+    # log is printed on the standard output
+    #  @param toPrintLogInFile "print log in a file" flag value
+    def SetPrintLogInFile(self, toPrintLogInFile):
+        self.Parameters().SetStandardOutputLog(not toPrintLogInFile)
+        pass
+
     ## Defines hypothesis having several parameters
     #  @return hypothesis object
     def Parameters(self):