1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2016-2022 EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 ### This file is generated automatically by SALOME v7.7.1 with dump python functionality
30 import salome_notebook
31 notebook = salome_notebook.NoteBook()
38 from salome.geom import geomBuilder
41 from . import utilityFunctions as uF
42 from .output import message
46 def generate(data_rayon,data_centre,outFile):
48 #data_centre = [1., 1., 01.]
50 geompy = geomBuilder.New()
52 O = geompy.MakeVertex(0, 0, 0)
53 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
54 OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
55 OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
57 SPHERE = geompy.MakeSphereR(data_rayon)
58 geompy.TranslateDXDYDZ(SPHERE, data_centre[0], data_centre[1], data_centre[2])
59 [FACE_FISSURE] = geompy.ExtractShapes(SPHERE, geompy.ShapeType["FACE"], True)
65 import SMESH, SALOMEDS
66 from salome.smesh import smeshBuilder
68 smesh = smeshBuilder.New()
71 chordal, minSize = uF.calcElemSize(A, data_rayon)
74 Maillage=uF.meshCrack(FACE_FISSURE, minSize, maxSize, chordal, dim=3)
77 Maillage.ExportMED(outFile)
78 smesh.SetName(Maillage.GetMesh(), 'MAILLAGE_FISSURE')
80 print('ExportMED() failed. Invalid file name?')
83 ## Set names of Mesh objects
86 if salome.sg.hasDesktop():
87 salome.sg.updateObjBrowser()