Salome HOME
Copyright update 2020
[modules/smesh.git] / src / Tools / MacMesh / MacMesh / Cylinder.py
index 7042e212f62657ab5259e1135e6bb81e3eb7ee09..e66bf92bcacd46b6cc9ac50214b6a88b796a12ca 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2016  EDF R&D
+# Copyright (C) 2014-2020  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
@@ -25,8 +25,8 @@
 # This functions can take a groups input containing the group names of 4 sides in addition to the internal circular boundary
 # in the following order : [South,North,West,East,Internal].
 
-import sys, math, commands
-CWD = commands.getoutput('pwd')
+import sys, math, subprocess
+CWD = subprocess.getoutput('pwd')
 sys.path.append(CWD)
 
 
@@ -39,11 +39,11 @@ def Cylinder (X0 , Y0 , D , DX , DY , LocalMeshing , **args) :
 
     # K is the pitch ratio
     K = float(D)/(DLocal-D)
-    print "A local pitch ratio of K =", K ," will be used.  "
+    print("A local pitch ratio of K =", K ," will be used.  ")
     NumCuts =  2*GenFunctions.QuarCylParam(K)
     InternalMeshing = int(math.ceil(math.pi*D/(4*NumCuts*LocalMeshing)))
     if InternalMeshing == 0 : InternalMeshing = 1           # This sets a minimum meshing condition in order to avoid an error. The user is notified of the value considered for the local meshing
-    print "Possible Local meshing is :", math.pi*D/(4*NumCuts*InternalMeshing), "\nThis value is returned by this function for your convenience.\n"
+    print("Possible Local meshing is :", math.pi*D/(4*NumCuts*InternalMeshing), "\nThis value is returned by this function for your convenience.\n")
     if args.__contains__('groups') :
         GroupNames = args['groups']
     else : GroupNames = [None, None, None, None, None]