X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FTools%2FZCracksPlug%2FutilityFunctions.py;h=bd62b567a8ebbba2f833508fecdcf28421d3daa5;hp=997f02f7c7f3c1856c711843997c7a57a0b18750;hb=6d32f944a0a115b6419184c50b57bf7c4eef5786;hpb=d5029840731bccaa1718e65f0abf3b19198c7293 diff --git a/src/Tools/ZCracksPlug/utilityFunctions.py b/src/Tools/ZCracksPlug/utilityFunctions.py index 997f02f7c..bd62b567a 100644 --- a/src/Tools/ZCracksPlug/utilityFunctions.py +++ b/src/Tools/ZCracksPlug/utilityFunctions.py @@ -1,3 +1,22 @@ +# Copyright (C) 2016-2019 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 +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# 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. +# +# 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 +# + #import sys #sys.path.append('/home/I60976/00_PROJETS/2015_INTEGRATION_ZCRACKS/zcracks_salome/zcracks') @@ -131,11 +150,10 @@ def meshCrack(geomObject, minSize, maxSize, chordal, dim): import salome salome.salome_init() - theStudy = salome.myStudy import SMESH, SALOMEDS from salome.smesh import smeshBuilder - smesh = smeshBuilder.New(theStudy) + smesh = smeshBuilder.New() Maillage = smesh.Mesh(geomObject) if dim==3: @@ -173,9 +191,8 @@ def extendElsets(meshFile, outFile=None): import SMESH, salome #salome.salome_init() - theStudy = salome.myStudy from salome.smesh import smeshBuilder - smesh = smeshBuilder.New(theStudy) + smesh = smeshBuilder.New() ([mesh], status) = smesh.CreateMeshesFromMED(meshFile) @@ -233,7 +250,7 @@ def extendElsets(meshFile, outFile=None): if len(front)==0: crackOnly=False if crackOnly: - mesh.ExportMED(outFile, 0, SMESH.MED_V2_2, 1, None ,1) + mesh.ExportMED(outFile) return('crack') # Propagates color using elem connectivity @@ -304,7 +321,7 @@ def extendElsets(meshFile, outFile=None): mesh.MakeGroupByIds('Extended_side%d' %n ,SMESH.EDGE,grElemList[2][n]) if outFile==None: outFile=meshFile - mesh.ExportMED(outFile, 0, SMESH.MED_V2_2, 1, None ,1) + mesh.ExportMED(outFile) return(True)