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