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