X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FTools%2FZCracksPlug%2FgenereCrack.py;h=6889d304bd678d7a0a8c4b11efbf0f8085ac6154;hp=0f434a30e44b49c7de6266eb1adc59144a284d73;hb=d9f4b53e489dd5857db264ede6acded7b076c9f1;hpb=c5866a318c33c102961070f0a5076cbb76401d1f diff --git a/src/Tools/ZCracksPlug/genereCrack.py b/src/Tools/ZCracksPlug/genereCrack.py index 0f434a30e..6889d304b 100644 --- a/src/Tools/ZCracksPlug/genereCrack.py +++ b/src/Tools/ZCracksPlug/genereCrack.py @@ -1,3 +1,22 @@ +# Copyright (C) 2016-2022 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 os, shutil from . import sphere, ellipse, rectangle from . import utilityFunctions as uF @@ -212,13 +231,12 @@ def generateCustom(crack, outFile): import salome salome.salome_init() - theStudy = salome.myStudy import salome_notebook - notebook = salome_notebook.NoteBook(theStudy) + notebook = salome_notebook.NoteBook() import SMESH, SALOMEDS from salome.smesh import smeshBuilder - smesh = smeshBuilder.New(theStudy) + smesh = smeshBuilder.New() ([Maillage_1], status) = smesh.CreateMeshesFromMED(crack['med file']) isCrack=False for group in Maillage_1.GetGroups(): @@ -228,7 +246,7 @@ def generateCustom(crack, outFile): else: Group_1 = Maillage_1.CreateEmptyGroup( SMESH.NODE, 'crack' ) nbAdd = Group_1.AddFrom( Maillage_1.GetMesh() ) - Maillage_1.ExportMED( outFile, 0, SMESH.MED_V2_2, 1, None ,1) + Maillage_1.ExportMED(outFile) return(True)