Salome HOME
Copyright update 2021
[modules/smesh.git] / src / Tools / blocFissure / CasTests / fissure_Coude.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2021  EDF R&D
3 #
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.
8 #
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.
13 #
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
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20
21 from blocFissure import gmu
22 from blocFissure.gmu.geomsmesh import geompy, smesh
23
24 import math
25 import GEOM
26 import SALOMEDS
27 import SMESH
28 #import StdMeshers
29 #import GHS3DPlugin
30 #import NETGENPlugin
31 import logging
32
33 from blocFissure.gmu.fissureGenerique import fissureGenerique
34
35 from blocFissure.gmu.triedreBase import triedreBase
36 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
37 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
38 from blocFissure.gmu.insereFissureLongue import insereFissureLongue
39
40 O, OX, OY, OZ = triedreBase()
41
42 class fissure_Coude(fissureGenerique):
43   """
44   problème de fissure du Coude : version de base
45   maillage hexa
46   """
47
48   nomProbleme = "tuyau_Coude"
49
50   # ---------------------------------------------------------------------------
51   def setParamGeometrieSaine(self):
52     """
53     Paramètres géométriques du tuyau coudé sain:
54     angleCoude
55     r_cintr
56     l_tube_p1
57     l_tube_p2
58     epais
59     de
60     """
61     self.geomParams = dict(angleCoude = 60,
62                            r_cintr    = 1200,
63                            l_tube_p1  = 1600,
64                            l_tube_p2  = 1200,
65                            epais      = 40,
66                            de         = 760)
67
68   # ---------------------------------------------------------------------------
69   def genereGeometrieSaine(self, geomParams):
70     logging.info("genereGeometrieSaine %s", self.nomCas)
71
72     angleCoude = geomParams['angleCoude']
73     r_cintr    = geomParams['r_cintr']
74     l_tube_p1  = geomParams['l_tube_p1']
75     l_tube_p2  = geomParams['l_tube_p2']
76     epais      = geomParams['epais']
77     de         = geomParams['de']
78
79     centre = geompy.MakeVertex(0, 0, -l_tube_p1)
80     Disk_1 = geompy.MakeDiskPntVecR(centre, OZ, de/2.)
81     Disk_2 = geompy.MakeDiskPntVecR(centre, OZ, de/2. -epais)
82     Cut_1 = geompy.MakeCut(Disk_1, Disk_2)
83     Extrusion_1 = geompy.MakePrismVecH(Cut_1, OZ, l_tube_p1)
84     axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
85     Revolution_1 = geompy.MakeRevolution(Cut_1, axe, angleCoude*math.pi/180.0)
86     Rotation_1 = geompy.MakeRotation(Cut_1, axe, angleCoude*math.pi/180.0)
87     Rotation_2 = geompy.MakeRotation(OZ, OY, angleCoude*math.pi/180.0)
88     Extrusion_2 = geompy.MakePrismVecH(Rotation_1, Rotation_2, -l_tube_p2)
89     Plane_1 = geompy.MakePlaneLCS(None, 100000, 3)
90     geompy.addToStudy( Plane_1, "Plane_1" )
91     geompy.addToStudy( Extrusion_1, "Extrusion_1" )
92     geompy.addToStudy( Revolution_1, "Revolution_1" )
93     geompy.addToStudy( Extrusion_2, "Extrusion_2" )
94
95     P1 = O
96     geompy.addToStudy( P1, "P1" )
97     op2 = geompy.MakeVertex(0, 0, -l_tube_p1)
98     P2 = geompy.MakeRotation(op2, axe, angleCoude*math.pi/180.0)
99     P2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, -l_tube_p2)
100     geompy.addToStudy( P2, "P2" )
101
102     # --- tube coude sain
103
104     geometrieSaine = geompy.MakePartition([Extrusion_1, Revolution_1, Extrusion_2, P1, P2], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
105     geompy.addToStudy( geometrieSaine, self.nomCas )
106     [P1, P2] = geompy.RestoreGivenSubShapes(geometrieSaine, [P1, P2], GEOM.FSM_GetInPlaceByHistory, False, True)
107
108     [ep, circ_g, circ_d, long_p2, long_coude, long_p1] = geompy.Propagate(geometrieSaine)
109     geompy.addToStudyInFather( geometrieSaine, long_p1, 'long_p1' )
110     geompy.addToStudyInFather( geometrieSaine, ep, 'ep' )
111     geompy.addToStudyInFather( geometrieSaine, long_coude, 'long_coude' )
112     geompy.addToStudyInFather( geometrieSaine, circ_g, 'circ_g' )
113     geompy.addToStudyInFather( geometrieSaine, circ_d, 'circ_d' )
114     geompy.addToStudyInFather( geometrieSaine, long_p2, 'long_p2' )
115
116     # --- face extremite tube (EXTUBE)
117
118     facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], OZ, GEOM.ST_ON)
119     EXTUBE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
120     geompy.UnionIDs(EXTUBE, facesIds)
121     geompy.addToStudyInFather( geometrieSaine, EXTUBE, 'EXTUBE' )
122
123     # --- edge bord extremite tube (BORDTU)
124
125     edge1Ids = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["EDGE"], OZ, GEOM.ST_ON)
126     edge2Ids = geompy.GetShapesOnCylinderIDs(geometrieSaine, geompy.ShapeType["EDGE"], OZ, de/2., GEOM.ST_ON)
127     edgesIds = []
128     for edge in edge1Ids:
129       if edge in edge2Ids:
130         edgesIds.append(edge)
131     BORDTU = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"])
132     geompy.UnionIDs(BORDTU, edgesIds)
133     geompy.addToStudyInFather( geometrieSaine, BORDTU, 'BORDTU' )
134
135     # --- face origine tube (CLGV)
136
137     pp2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, 10)
138     vec2 = geompy.MakeVector(P2, pp2)
139     #geompy.addToStudy(vec2, 'vec2')
140     facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], vec2, GEOM.ST_ON)
141     CLGV = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
142     geompy.UnionIDs(CLGV, facesIds)
143     geompy.addToStudyInFather( geometrieSaine, CLGV, 'CLGV' )
144
145     # --- peau tube interieur (PEAUINT)
146
147     extru1 = geompy.MakePrismVecH(Disk_2, OZ, l_tube_p1)
148     revol1 = geompy.MakeRevolution(Disk_2, axe, angleCoude*math.pi/180.0)
149     rot1 = geompy.MakeRotation(Disk_2, axe, angleCoude*math.pi/180.0)
150     extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
151     interne = geompy.MakeFuse(extru1, revol1)
152     interne = geompy.MakeFuse(extru2, interne)
153     geompy.addToStudy(interne, 'interne')
154     facesIds = geompy.GetShapesOnShapeIDs(interne, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ONIN)
155     PEAUINT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
156     geompy.UnionIDs(PEAUINT, facesIds)
157     geompy.addToStudyInFather( geometrieSaine, PEAUINT, 'PEAUINT' )
158
159     # --- peau tube exterieur (PEAUEXT)
160
161     Disk_3 = geompy.MakeDiskPntVecR(centre, OZ, de/2. +epais)
162     couronne1 = geompy.MakeCut(Disk_3, Disk_1)
163     extru1 = geompy.MakePrismVecH(couronne1, OZ, l_tube_p1)
164     revol1 = geompy.MakeRevolution(couronne1, axe, angleCoude*math.pi/180.0)
165     rot1 = geompy.MakeRotation(couronne1, axe, angleCoude*math.pi/180.0)
166     extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
167     externe = geompy.MakeFuse(extru1, revol1)
168     externe = geompy.MakeFuse(extru2, externe)
169     geompy.addToStudy(externe, 'externe')
170     facesIds = geompy.GetShapesOnShapeIDs(externe, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ON)
171     PEAUEXT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
172     geompy.UnionIDs(PEAUEXT, facesIds)
173     geompy.addToStudyInFather( geometrieSaine, PEAUEXT, 'PEAUEXT' )
174
175     # --- solide sain
176
177     volIds = geompy.SubShapeAllIDs(geometrieSaine, geompy.ShapeType["SOLID"])
178     COUDE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["SOLID"])
179     geompy.UnionIDs(COUDE, volIds)
180     geompy.addToStudyInFather( geometrieSaine, COUDE, 'COUDSAIN' )
181
182     geometriesSaines = [geometrieSaine, long_p1, ep, long_coude, circ_g, circ_d, long_p2, P1, P2, EXTUBE, BORDTU, CLGV, PEAUINT, PEAUEXT, COUDE]
183
184     return geometriesSaines
185
186   # ---------------------------------------------------------------------------
187   def setParamMaillageSain(self):
188     self.meshParams = dict(n_long_p1    = 16,
189                            n_ep         = 3,
190                            n_long_coude = 15,
191                            n_circ_g     = 20,
192                            n_circ_d     = 20,
193                            n_long_p2    = 12)
194
195   # ---------------------------------------------------------------------------
196   def genereMaillageSain(self, geometriesSaines, meshParams):
197     logging.info("genereMaillageSain %s", self.nomCas)
198
199     geometrieSaine = geometriesSaines[0]
200     long_p1        = geometriesSaines[1]
201     ep             = geometriesSaines[2]
202     long_coude     = geometriesSaines[3]
203     circ_g         = geometriesSaines[4]
204     circ_d         = geometriesSaines[5]
205     long_p2        = geometriesSaines[6]
206     P1             = geometriesSaines[7]
207     P2             = geometriesSaines[8]
208     EXTUBE         = geometriesSaines[9]
209     BORDTU         = geometriesSaines[10]
210     CLGV           = geometriesSaines[11]
211     PEAUINT        = geometriesSaines[12]
212     PEAUEXT        = geometriesSaines[13]
213     COUDE          = geometriesSaines[14]
214
215     n_long_p1    = meshParams['n_long_p1']
216     n_ep         = meshParams['n_ep']
217     n_long_coude = meshParams['n_long_coude']
218     n_circ_g     = meshParams['n_circ_g']
219     n_circ_d     = meshParams['n_circ_d']
220     n_long_p2    = meshParams['n_long_p2']
221
222     maillageSain = smesh.Mesh(geometrieSaine)
223
224     algo3d = maillageSain.Hexahedron()
225     algo2d = maillageSain.Quadrangle()
226     smesh.SetName(algo3d, "algo3d_maillageSain")
227     smesh.SetName(algo2d, "algo2d_maillageSain")
228
229     algo1d_long_p1 = maillageSain.Segment(geom=long_p1)
230     hypo1d_long_p1 = algo1d_long_p1.NumberOfSegments(n_long_p1)
231     smesh.SetName(algo1d_long_p1, "algo1d_long_p1")
232     smesh.SetName(hypo1d_long_p1, "hypo1d_long_p1")
233
234     algo1d_ep = maillageSain.Segment(geom=ep)
235     hypo1d_ep = algo1d_ep.NumberOfSegments(n_ep)
236     smesh.SetName(algo1d_ep, "algo1d_ep")
237     smesh.SetName(hypo1d_ep, "hypo1d_ep")
238
239     algo1d_long_coude = maillageSain.Segment(geom=long_coude)
240     hypo1d_long_coude = algo1d_long_coude.NumberOfSegments(n_long_coude)
241     smesh.SetName(algo1d_long_coude, "algo1d_long_coude")
242     smesh.SetName(hypo1d_long_coude, "hypo1d_long_coude")
243
244     algo1d_circ_g = maillageSain.Segment(geom=circ_g)
245     hypo1d_circ_g = algo1d_circ_g.NumberOfSegments(n_circ_g)
246     smesh.SetName(algo1d_circ_g, "algo1d_circ_g")
247     smesh.SetName(hypo1d_circ_g, "hypo1d_circ_g")
248
249     algo1d_circ_d = maillageSain.Segment(geom=circ_d)
250     hypo1d_circ_d = algo1d_circ_d.NumberOfSegments(n_circ_d)
251     smesh.SetName(algo1d_circ_d, "algo1d_circ_d")
252     smesh.SetName(hypo1d_circ_d, "hypo1d_circ_d")
253
254     algo1d_long_p2 = maillageSain.Segment(geom=long_p2)
255     hypo1d_long_p2 = algo1d_long_p2.NumberOfSegments(n_long_p2)
256     smesh.SetName(algo1d_long_p2, "algo1d_long_p2")
257     smesh.SetName(hypo1d_long_p2, "hypo1d_long_p2")
258
259     isDone = maillageSain.Compute()
260
261     mp1 = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE)
262     mp2 = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE)
263     ext = maillageSain.GroupOnGeom(EXTUBE,'EXTUBE',SMESH.FACE)
264     btu = maillageSain.GroupOnGeom(BORDTU,'BORDTU',SMESH.EDGE)
265     clg = maillageSain.GroupOnGeom(CLGV,'CLGV',SMESH.FACE)
266     pei = maillageSain.GroupOnGeom(PEAUINT,'PEAUINT',SMESH.FACE)
267     pex = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE)
268     cou = maillageSain.GroupOnGeom(COUDE,'COUDSAIN',SMESH.VOLUME)
269
270     return [maillageSain, True] # True : maillage hexa
271
272   # ---------------------------------------------------------------------------
273   def setParamShapeFissure(self):
274     """
275     paramètres de la fissure
276     profondeur  : 0 < profondeur <= épaisseur
277     azimut      : entre 0 et 360°
278     alpha       : 0 < alpha < angleCoude
279     longueur    : <=2*profondeur ==> ellipse, >2*profondeur = fissure longue
280     lgInfluence : distance autour de la shape de fissure a remailler (si 0, pris égal à profondeur. A ajuster selon le maillage)
281     orientation : 0° : longitudinale, 90° : circonférentielle, autre : uniquement fissures elliptiques
282     externe     : True : fissure face externe, False : fissure face interne
283     """
284     logging.info("setParamShapeFissure %s", self.nomCas)
285     self.shapeFissureParams = dict(profondeur  = 10,
286                                    azimut      = 160,
287                                    alpha       = 20,
288                                    longueur    = 400,
289                                    orientation = 90,
290                                    lgInfluence = 0,
291                                    elliptique  = False,
292                                    externe     = True)
293
294   # ---------------------------------------------------------------------------
295   def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
296     logging.info("genereShapeFissure %s", self.nomCas)
297     logging.info("shapeFissureParams %s", shapeFissureParams)
298
299     angleCoude = geomParams['angleCoude']
300     r_cintr    = geomParams['r_cintr']
301     l_tube_p1  = geomParams['l_tube_p1']
302     l_tube_p2  = geomParams['l_tube_p2']
303     epais      = geomParams['epais']
304     de         = geomParams['de']
305
306     profondeur  = shapeFissureParams['profondeur']
307     azimut      = shapeFissureParams['azimut']
308     alpha       = shapeFissureParams['alpha']
309     longueur    = shapeFissureParams['longueur']
310     orientation = shapeFissureParams['orientation']
311     externe     = shapeFissureParams['externe']
312     lgInfluence = shapeFissureParams['lgInfluence']
313
314     azimut = -azimut # axe inverse / ASCOUF
315     axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
316
317     if not lgInfluence:
318       lgInfluence = profondeur
319
320     if longueur > 2*profondeur:
321       self.fissureLongue=True
322     else:
323       self.fissureLongue=False
324
325     self.circonferentielle = False
326     self.longitudinale = False
327     if self.fissureLongue and (abs(orientation) < 45) :
328       self.longitudinale = True
329     elif self.fissureLongue:
330       self.circonferentielle = True
331
332     if self.circonferentielle:
333       if externe:
334         raybor = de/2.
335         rayint = raybor - profondeur
336         rayext = raybor + profondeur
337       else:
338         rayext = de/2. - epais
339         rayint = raybor + profondeur
340         rayext = raybor - profondeur
341       lgfond = longueur -2*profondeur
342       angle = lgfond/(2*raybor)
343       pb = geompy.MakeVertex(raybor, 0, 0)
344       pi = geompy.MakeVertex(rayint, 0, 0)
345       pe = geompy.MakeVertex(rayext, 0, 0)
346       pl = geompy.MakeVertex(raybor, profondeur, 0)
347       pr = geompy.MakeVertex(raybor, -profondeur, 0)
348       pil = geompy.MakeRotation(pi, OZ, angle)
349       pll = geompy.MakeRotation(pl, OZ, angle)
350       pel = geompy.MakeRotation(pe, OZ, angle)
351       pir = geompy.MakeRotation(pi, OZ, -angle)
352       prr = geompy.MakeRotation(pr, OZ, -angle)
353       per = geompy.MakeRotation(pe, OZ, -angle)
354       arcl = geompy.MakeArc(pil, pll, pel)
355       arcr = geompy.MakeArc(pir, prr, per)
356       arci = geompy.MakeArc(pil, pi, pir)
357       arce = geompy.MakeArc(pel, pe, per)
358       wire0 = geompy.MakeWire([arcr, arci, arcl])
359       cercle0 = geompy.MakeCircle(O, OY, profondeur/4.0)
360       cercle0 = geompy.MakeRotation(cercle0, OY, math.pi/2.0)
361       cercle0 = geompy.MakeTranslationTwoPoints(cercle0, O, pi)
362       facetube0 = geompy.MakeFaceWires([cercle0], 1)
363       facetubel = geompy.MakeRotation(facetube0, OZ, angle)
364       facetuber = geompy.MakeRotation(facetube0, OZ, -angle)
365       face0 = geompy.MakeFaceWires([arcl,arci, arce, arcr], 1)
366       plan0 = geompy.MakePlane(O, OZ, 10000)
367       geompy.addToStudy( face0, 'facefissOrig' )
368       face1 = geompy.MakeRotation(face0, OZ, azimut*math.pi/180.)
369       face2 = geompy.MakeTranslation(face1, 0, 0, -l_tube_p1)
370       facefiss = geompy.MakeRotation(face2, axe, alpha*math.pi/180.)
371       geompy.addToStudy( facefiss, 'facefissPlace' )
372       centre = geompy.MakeRotation(pb, OZ, azimut*math.pi/180.)
373       centre = geompy.MakeTranslation(centre, 0, 0, -l_tube_p1)
374       centre = geompy.MakeRotation(centre, axe, alpha*math.pi/180.)
375       geompy.addToStudy( centre, 'centrefissPlace' )
376       arcr = geompy.MakeRotation(arcr, OZ, azimut*math.pi/180.)
377       arcr = geompy.MakeTranslation(arcr, 0, 0, -l_tube_p1)
378       arcr = geompy.MakeRotation(arcr, axe, alpha*math.pi/180.)
379       arci = geompy.MakeRotation(arci, OZ, azimut*math.pi/180.)
380       arci = geompy.MakeTranslation(arci, 0, 0, -l_tube_p1)
381       arci = geompy.MakeRotation(arci, axe, alpha*math.pi/180.)
382       arcl = geompy.MakeRotation(arcl, OZ, azimut*math.pi/180.)
383       arcl = geompy.MakeTranslation(arcl, 0, 0, -l_tube_p1)
384       arcl = geompy.MakeRotation(arcl, axe, alpha*math.pi/180.)
385       wiretube = geompy.MakeRotation(wire0, OZ, azimut*math.pi/180.)
386       wiretube = geompy.MakeTranslation(wiretube, 0, 0, -l_tube_p1)
387       wiretube = geompy.MakeRotation(wiretube, axe, alpha*math.pi/180.)
388       geompy.addToStudy(wiretube, 'wiretubePlace' )
389       facetubel = geompy.MakeRotation(facetubel, OZ, azimut*math.pi/180.)
390       facetubel = geompy.MakeTranslation(facetubel, 0, 0, -l_tube_p1)
391       facetubel = geompy.MakeRotation(facetubel, axe, alpha*math.pi/180.)
392       geompy.addToStudy(facetubel, 'facetubeGauche' )
393       facetuber = geompy.MakeRotation(facetuber, OZ, azimut*math.pi/180.)
394       facetuber = geompy.MakeTranslation(facetuber, 0, 0, -l_tube_p1)
395       facetuber = geompy.MakeRotation(facetuber, axe, alpha*math.pi/180.)
396       geompy.addToStudy(facetuber, 'facetubeDroit' )
397       planfiss = geompy.MakeRotation(plan0, OZ, azimut*math.pi/180.)
398       planfiss = geompy.MakeTranslation(planfiss, 0, 0, -l_tube_p1)
399       planfiss = geompy.MakeRotation(planfiss, axe, alpha*math.pi/180.)
400       geompy.addToStudy(planfiss, 'planfissPlace' )
401       pipefissl = geompy.MakePipe(facetubel, arcl)
402       pipefissi = geompy.MakePipe(facetubel, arci)
403       pipefissr = geompy.MakePipe(facetuber, arcr)
404       pipefiss = geompy.MakePartition([pipefissl, pipefissi, pipefissr], [planfiss, wiretube], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
405       geompy.addToStudy(pipefiss, 'pipefissPlace' )
406
407
408     elif self.longitudinale:
409       if externe:
410         raybor = r_cintr + de/2.
411         rayint = raybor - profondeur
412         rayext = raybor + profondeur
413       else:
414         rayext = r_cintr + de/2. - epais
415         rayint = raybor + profondeur
416         rayext = raybor - profondeur
417       lgfond = longueur -2*profondeur
418       angle = lgfond/(2*raybor)
419       pb = geompy.MakeVertex(-raybor, 0, 0)
420       pi = geompy.MakeVertex(-rayint, 0, 0)
421       pe = geompy.MakeVertex(-rayext, 0, 0)
422       pl = geompy.MakeVertex(-raybor, 0, -profondeur)
423       pr = geompy.MakeVertex(-raybor, 0, profondeur)
424       pil = geompy.MakeRotation(pi, OY, -angle)
425       pll = geompy.MakeRotation(pl, OY, -angle)
426       pel = geompy.MakeRotation(pe, OY, -angle)
427       pir = geompy.MakeRotation(pi, OY, angle)
428       prr = geompy.MakeRotation(pr, OY, angle)
429       per = geompy.MakeRotation(pe, OY, angle)
430       arcl = geompy.MakeArc(pil, pll, pel)
431       arcr = geompy.MakeArc(pir, prr, per)
432       arci = geompy.MakeArc(pil, pi, pir)
433       arce = geompy.MakeArc(pel, pe, per)
434       geompy.addToStudy( arcl, 'arcl' )
435       geompy.addToStudy( arcr, 'arcr' )
436       geompy.addToStudy( arci, 'arci' )
437       geompy.addToStudy( arce, 'arce' )
438       wire0 = geompy.MakeWire([arcr, arci, arcl])
439       cercle0 = geompy.MakeCircle(O, OZ, profondeur/4.0)
440       #cercle0 = geompy.MakeRotation(cercle0, OZ, math.pi/2.0)
441       cercle0 = geompy.MakeTranslationTwoPoints(cercle0, O, pi)
442       geompy.addToStudy( cercle0, 'cercle0' )
443       facetube0 = geompy.MakeFaceWires([cercle0], 1)
444       facetubel = geompy.MakeRotation(facetube0, OY, -angle)
445       facetuber = geompy.MakeRotation(facetube0, OY, angle)
446       geompy.addToStudy(facetubel , 'facetubel' )
447       geompy.addToStudy( facetuber, 'facetuber' )
448       face0 = geompy.MakeFaceWires([arcl,arci, arce, arcr], 1)
449       plan0 = geompy.MakePlane(O, OY, 10000)
450       geompy.addToStudy( face0, 'facefissOrig' )
451       facefiss = geompy.MakeRotation(face0, OY, alpha*math.pi/180.)
452       geompy.addToStudy( facefiss, 'facefissPlace' )
453       centre = geompy.MakeRotation(pb, OY, alpha*math.pi/180.)
454       geompy.addToStudy( centre, 'centrefissPlace' )
455       arcr = geompy.MakeRotation(arcr, OY, alpha*math.pi/180.)
456       arci = geompy.MakeRotation(arci, OY, alpha*math.pi/180.)
457       arcl = geompy.MakeRotation(arcl, OY, alpha*math.pi/180.)
458       wiretube = geompy.MakeRotation(wire0, OY, alpha*math.pi/180.)
459       geompy.addToStudy(wiretube, 'wiretubePlace' )
460       facetubel = geompy.MakeRotation(facetubel, OY, alpha*math.pi/180.)
461       geompy.addToStudy(facetubel, 'facetubeGauche' )
462       facetuber = geompy.MakeRotation(facetuber, OY, alpha*math.pi/180.)
463       geompy.addToStudy(facetubel, 'facetubeDroit' )
464       planfiss = geompy.MakeRotation(plan0, OY, alpha*math.pi/180.)
465       geompy.addToStudy(planfiss, 'planfissPlace' )
466       pipefissl = geompy.MakePipe(facetubel, arcl)
467       pipefissi = geompy.MakePipe(facetubel, arci)
468       pipefissr = geompy.MakePipe(facetuber, arcr)
469       pipefiss = geompy.MakePartition([pipefissl, pipefissi, pipefissr], [planfiss, wiretube], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
470       geompy.addToStudy(pipefiss, 'pipefissPlace' )
471     else:
472       pass
473
474     coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefiss, 5 ,10)
475
476     return [facefiss, centre, lgInfluence, coordsNoeudsFissure, wiretube, facetubel, facetuber, planfiss, pipefiss]
477
478   # ---------------------------------------------------------------------------
479   def setParamMaillageFissure(self):
480     self.maillageFissureParams = dict(nomRep        = '.',
481                                       nomFicSain    = self.nomCas,
482                                       nomFicFissure = 'fissure_' + self.nomCas,
483                                       nbsegExt      = 5,
484                                       nbsegGen      = 25,
485                                       nbsegRad      = 5,
486                                       scaleRad      = 4,
487                                       nbsegCercle   = 6,
488                                       nbsegFis      = 20,
489                                       lensegEllipso = 1.0)
490
491   # ---------------------------------------------------------------------------
492   def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
493     elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
494     return elementsDefaut
495
496   # ---------------------------------------------------------------------------
497   def genereMaillageFissure(self, geometriesSaines, maillagesSains,
498                             shapesFissure, shapeFissureParams,
499                             maillageFissureParams, elementsDefaut, step):
500     maillageFissure = insereFissureLongue(geometriesSaines, maillagesSains,
501                                           shapesFissure, shapeFissureParams,
502                                           maillageFissureParams, elementsDefaut, step)
503     return maillageFissure
504
505   # ---------------------------------------------------------------------------
506   def setReferencesMaillageFissure(self):
507     self.referencesMaillageFissure = dict(Entity_Node            = 77491,
508                                           Entity_Quad_Edge       = 1006,
509                                           Entity_Quad_Triangle   = 2412,
510                                           Entity_Quad_Quadrangle = 6710,
511                                           Entity_Quad_Tetra      = 20853,
512                                           Entity_Quad_Hexa       = 8656,
513                                           Entity_Quad_Penta      = 1176,
514                                           Entity_Quad_Pyramid    = 1232)
515