Salome HOME
Merge remote branch 'origin/gdd/translations'
[modules/smesh.git] / src / SMESH_SWIG / SMESH_Partition1_tetra.py
index e0f284a96f45075eaad5bd9aff50a7c5c1471077..f6d4d1b7ea4aba747606b1a6e9fb86a35cb8422a 100644 (file)
@@ -1,32 +1,40 @@
-#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # Tetrahedrization of the geometry generated by the Python script GEOM_Partition1.py
 # Hypothesis and algorithms for the mesh generation are global
-#
-#%Make geometry (like CEA script (A1)) using Partition algorithm% from OCC
 # -- Rayon de la bariere
-
+#
 import salome
-import geompy
-import smesh
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
+
 from math import sqrt
 
 
@@ -87,7 +95,7 @@ print "number of Edges  in alveole : ", len(subEdgeList)
 
 subshapes = geompy.SubShapeAll(alveole, geompy.ShapeType["SHAPE"])
 
-## there are 9 subshapes
+## there are 9 sub-shapes
 
 comp1 = geompy.MakeCompound( [ subshapes[0], subshapes[1] ] )
 comp2 = geompy.MakeCompound( [ subshapes[2], subshapes[3] ] )
@@ -118,7 +126,6 @@ print "number of Edges  in alveole : ", len(subEdgeList)
 status = geompy.CheckShape(alveole)
 print " check status ", status
 
-# ---- launch SMESH
 
 # ---- init a Mesh with the alveole
 shape_mesh = salome.IDToObject( idalveole )
@@ -153,7 +160,7 @@ print "-------------------------- MaxElementVolume"
 
 maxElementVolume = 0.5
 
-netgen3D = mesh.Tetrahedron(smesh.NETGEN)
+netgen3D = mesh.Tetrahedron(smeshBuilder.NETGEN)
 hypVolume = netgen3D.MaxElementVolume(maxElementVolume)
 print hypVolume.GetName()
 print hypVolume.GetId()