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