1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2023 EDF
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 """Fissure dans un coude"""
29 from blocFissure.gmu.geomsmesh import geompy
30 from blocFissure.gmu.geomsmesh import smesh
31 from blocFissure.gmu.geomsmesh import geomPublish
32 from blocFissure.gmu.geomsmesh import geomPublishInFather
34 from blocFissure.gmu import initLog
35 from blocFissure.gmu.putName import putName
36 from blocFissure.gmu.fissureGenerique import fissureGenerique
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
42 O, OX, OY, OZ = triedreBase()
44 class fissure_Coude(fissureGenerique):
45 """problème de fissure du Coude : version de base
50 nomProbleme = "fissure_Coude"
53 shapeFissureParams = dict()
54 maillageFissureParams = dict()
55 referencesMaillageFissure = dict()
56 circonferentielle = False
59 # ---------------------------------------------------------------------------
60 def setParamGeometrieSaine(self):
62 Paramètres géométriques du tuyau coudé sain:
70 self.geomParams = dict(angleCoude = 60,
77 # ---------------------------------------------------------------------------
78 def genereGeometrieSaine(self, geomParams):
80 logging.info("genereGeometrieSaine %s", self.nomCas)
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']
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 geomPublish(initLog.debug, Plane_1, "Plane_1" )
101 geomPublish(initLog.debug, Extrusion_1, "Extrusion_1" )
102 geomPublish(initLog.debug, Revolution_1, "Revolution_1" )
103 geomPublish(initLog.debug, Extrusion_2, "Extrusion_2" )
106 geomPublish(initLog.always, P1, "P1", self.numeroCas )
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 geomPublish(initLog.always, P2, "P2", self.numeroCas )
112 # --- tube coude sain
114 geometrieSaine = geompy.MakePartition([Extrusion_1, Revolution_1, Extrusion_2, P1, P2], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
115 geomPublish(initLog.always, geometrieSaine, self.nomCas, self.numeroCas )
116 [P1, P2] = geompy.RestoreGivenSubShapes(geometrieSaine, [P1, P2], GEOM.FSM_GetInPlaceByHistory, False, True)
118 [ep, circ_g, circ_d, long_p2, long_coude, long_p1] = geompy.Propagate(geometrieSaine)
119 geomPublishInFather(initLog.always, geometrieSaine, long_p1, 'long_p1' )
120 geomPublishInFather(initLog.always, geometrieSaine, ep, 'ep' )
121 geomPublishInFather(initLog.always, geometrieSaine, long_coude, 'long_coude' )
122 geomPublishInFather(initLog.always, geometrieSaine, circ_g, 'circ_g' )
123 geomPublishInFather(initLog.always, geometrieSaine, circ_d, 'circ_d' )
124 geomPublishInFather(initLog.always, geometrieSaine, long_p2, 'long_p2' )
126 # --- face extremite tube (EXTUBE)
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 geomPublishInFather(initLog.always, geometrieSaine, EXTUBE, 'EXTUBE' )
133 # --- edge bord extremite tube (BORDTU)
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)
138 for edge in edge1Ids:
140 edgesIds.append(edge)
141 BORDTU = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"])
142 geompy.UnionIDs(BORDTU, edgesIds)
143 geomPublishInFather(initLog.always, geometrieSaine, BORDTU, 'BORDTU' )
145 # --- face origine tube (CLGV)
147 pp2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, 10)
148 vec2 = geompy.MakeVector(P2, pp2)
149 #geomPublish(initLog.debug, vec2, 'vec2', self.numeroCas)
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 geomPublishInFather(initLog.always, geometrieSaine, CLGV, 'CLGV' )
155 # --- peau tube interieur (PEAUINT)
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 geomPublish(initLog.debug, interne, 'interne', self.numeroCas)
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 geomPublishInFather(initLog.always, geometrieSaine, PEAUINT, 'PEAUINT' )
169 # --- peau tube exterieur (PEAUEXT)
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 geomPublish(initLog.debug, externe, 'externe', self.numeroCas)
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 geomPublishInFather(initLog.always, geometrieSaine, PEAUEXT, 'PEAUEXT' )
187 volIds = geompy.SubShapeAllIDs(geometrieSaine, geompy.ShapeType["SOLID"])
188 COUDE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["SOLID"])
189 geompy.UnionIDs(COUDE, volIds)
190 geomPublishInFather(initLog.always, geometrieSaine, COUDE, 'COUDSAIN' )
192 geometriesSaines = [geometrieSaine, long_p1, ep, long_coude, circ_g, circ_d, long_p2, P1, P2, EXTUBE, BORDTU, CLGV, PEAUINT, PEAUEXT, COUDE]
194 return geometriesSaines
196 # ---------------------------------------------------------------------------
197 def setParamMaillageSain(self):
198 self.meshParams = dict(n_long_p1 = 16,
205 # ---------------------------------------------------------------------------
206 def genereMaillageSain(self, geometriesSaines, meshParams):
207 logging.info("genereMaillageSain %s", self.nomCas)
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]
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']
232 maillageSain = smesh.Mesh(geometrieSaine)
233 putName(maillageSain, "maillageSain", i_pref=self.numeroCas)
235 algo3d = maillageSain.Hexahedron()
236 algo2d = maillageSain.Quadrangle()
238 algo1d_long_p1 = maillageSain.Segment(geom=long_p1)
239 hypo1d_long_p1 = algo1d_long_p1.NumberOfSegments(n_long_p1)
240 putName(hypo1d_long_p1, "n_long_p1={}".format(n_long_p1), i_pref=self.numeroCas)
242 algo1d_ep = maillageSain.Segment(geom=ep)
243 hypo1d_ep = algo1d_ep.NumberOfSegments(n_ep)
244 putName(hypo1d_ep, "n_ep={}".format(n_ep), i_pref=self.numeroCas)
246 algo1d_long_coude = maillageSain.Segment(geom=long_coude)
247 hypo1d_long_coude = algo1d_long_coude.NumberOfSegments(n_long_coude)
248 putName(hypo1d_long_coude, "n_long_coude={}".format(n_long_coude), i_pref=self.numeroCas)
250 algo1d_circ_g = maillageSain.Segment(geom=circ_g)
251 hypo1d_circ_g = algo1d_circ_g.NumberOfSegments(n_circ_g)
252 putName(hypo1d_circ_g, "n_circ_g={}".format(n_circ_g), i_pref=self.numeroCas)
254 algo1d_circ_d = maillageSain.Segment(geom=circ_d)
255 hypo1d_circ_d = algo1d_circ_d.NumberOfSegments(n_circ_d)
256 putName(hypo1d_circ_d, "n_circ_d={}".format(n_circ_d), i_pref=self.numeroCas)
258 algo1d_long_p2 = maillageSain.Segment(geom=long_p2)
259 hypo1d_long_p2 = algo1d_long_p2.NumberOfSegments(n_long_p2)
260 putName(hypo1d_long_p2, "n_long_p2={}".format(n_long_p2), i_pref=self.numeroCas)
262 _ = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE)
263 _ = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE)
264 _ = maillageSain.GroupOnGeom(EXTUBE,'EXTUBE',SMESH.FACE)
265 _ = maillageSain.GroupOnGeom(BORDTU,'BORDTU',SMESH.EDGE)
266 _ = maillageSain.GroupOnGeom(CLGV,'CLGV',SMESH.FACE)
267 _ = maillageSain.GroupOnGeom(PEAUINT,'PEAUINT',SMESH.FACE)
268 _ = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE)
269 _ = maillageSain.GroupOnGeom(COUDE,'COUDSAIN',SMESH.VOLUME)
271 is_done = maillageSain.Compute()
272 text = "maillageSain.Compute"
274 logging.info(text+" OK")
276 text = "Erreur au calcul du maillage.\n" + text
278 raise Exception(text)
280 return [maillageSain, True] # True : maillage hexa
282 # ---------------------------------------------------------------------------
283 def setParamShapeFissure(self):
285 paramètres de la fissure pour le tuyau coude
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
294 logging.info("setParamShapeFissure %s", self.nomCas)
295 self.shapeFissureParams = dict(profondeur = 10,
304 # ---------------------------------------------------------------------------
305 def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \
306 mailleur="MeshGems"):
307 logging.info("genereShapeFissure %s", self.nomCas)
308 logging.info("shapeFissureParams %s", shapeFissureParams)
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']
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']
325 azimut = -azimut # axe inverse / ASCOUF
326 axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
329 lgInfluence = profondeur
331 self.fissureLongue = bool(longueur > 2*profondeur)
333 if self.fissureLongue and (abs(orientation) < 45.) :
334 self.longitudinale = True
335 elif self.fissureLongue:
336 self.circonferentielle = True
337 #logging.info("longitudinale %s", self.longitudinale)
338 #logging.info("circonferentielle %s", self.circonferentielle)
340 if self.circonferentielle:
343 rayint = raybor - profondeur
344 rayext = raybor + profondeur
346 rayext = de/2. - epais
347 rayint = raybor + profondeur
348 rayext = raybor - profondeur
349 lgfond = longueur -2*profondeur
350 angle = lgfond/(2*raybor)
351 pb = geompy.MakeVertex(raybor, 0, 0)
352 pi = geompy.MakeVertex(rayint, 0, 0)
353 pe = geompy.MakeVertex(rayext, 0, 0)
354 pl = geompy.MakeVertex(raybor, profondeur, 0)
355 pr = geompy.MakeVertex(raybor, -profondeur, 0)
356 pil = geompy.MakeRotation(pi, OZ, angle)
357 pll = geompy.MakeRotation(pl, OZ, angle)
358 pel = geompy.MakeRotation(pe, OZ, angle)
359 pir = geompy.MakeRotation(pi, OZ, -angle)
360 prr = geompy.MakeRotation(pr, OZ, -angle)
361 per = geompy.MakeRotation(pe, OZ, -angle)
362 arcl = geompy.MakeArc(pil, pll, pel)
363 arcr = geompy.MakeArc(pir, prr, per)
364 arci = geompy.MakeArc(pil, pi, pir)
365 arce = geompy.MakeArc(pel, pe, per)
366 wire0 = geompy.MakeWire([arcr, arci, arcl])
367 cercle0 = geompy.MakeCircle(O, OY, profondeur/4.0)
368 cercle0 = geompy.MakeRotation(cercle0, OY, math.pi/2.0)
369 cercle0 = geompy.MakeTranslationTwoPoints(cercle0, O, pi)
370 facetube0 = geompy.MakeFaceWires([cercle0], 1)
371 facetubel = geompy.MakeRotation(facetube0, OZ, angle)
372 facetuber = geompy.MakeRotation(facetube0, OZ, -angle)
373 face0 = geompy.MakeFaceWires([arcl,arci, arce, arcr], 1)
374 plan0 = geompy.MakePlane(O, OZ, 10000)
375 geomPublish(initLog.debug, face0, 'facefissOrig' )
376 face1 = geompy.MakeRotation(face0, OZ, azimut*math.pi/180.)
377 face2 = geompy.MakeTranslation(face1, 0, 0, -l_tube_p1)
378 facefiss = geompy.MakeRotation(face2, axe, alpha*math.pi/180.)
379 geomPublish(initLog.always, facefiss, "facefissPlace", self.numeroCas )
380 centre = geompy.MakeRotation(pb, OZ, azimut*math.pi/180.)
381 centre = geompy.MakeTranslation(centre, 0, 0, -l_tube_p1)
382 centre = geompy.MakeRotation(centre, axe, alpha*math.pi/180.)
383 geomPublish(initLog.always, centre, "centrefissPlace", self.numeroCas )
384 arcr = geompy.MakeRotation(arcr, OZ, azimut*math.pi/180.)
385 arcr = geompy.MakeTranslation(arcr, 0, 0, -l_tube_p1)
386 arcr = geompy.MakeRotation(arcr, axe, alpha*math.pi/180.)
387 arci = geompy.MakeRotation(arci, OZ, azimut*math.pi/180.)
388 arci = geompy.MakeTranslation(arci, 0, 0, -l_tube_p1)
389 arci = geompy.MakeRotation(arci, axe, alpha*math.pi/180.)
390 arcl = geompy.MakeRotation(arcl, OZ, azimut*math.pi/180.)
391 arcl = geompy.MakeTranslation(arcl, 0, 0, -l_tube_p1)
392 arcl = geompy.MakeRotation(arcl, axe, alpha*math.pi/180.)
393 wiretube = geompy.MakeRotation(wire0, OZ, azimut*math.pi/180.)
394 wiretube = geompy.MakeTranslation(wiretube, 0, 0, -l_tube_p1)
395 wiretube = geompy.MakeRotation(wiretube, axe, alpha*math.pi/180.)
396 geomPublish(initLog.always,wiretube, "wiretubePlace", self.numeroCas )
397 facetubel = geompy.MakeRotation(facetubel, OZ, azimut*math.pi/180.)
398 facetubel = geompy.MakeTranslation(facetubel, 0, 0, -l_tube_p1)
399 facetubel = geompy.MakeRotation(facetubel, axe, alpha*math.pi/180.)
400 geomPublish(initLog.debug,facetubel, 'facetubeGauche' )
401 facetuber = geompy.MakeRotation(facetuber, OZ, azimut*math.pi/180.)
402 facetuber = geompy.MakeTranslation(facetuber, 0, 0, -l_tube_p1)
403 facetuber = geompy.MakeRotation(facetuber, axe, alpha*math.pi/180.)
404 geomPublish(initLog.debug,facetuber, 'facetubeDroit' )
405 planfiss = geompy.MakeRotation(plan0, OZ, azimut*math.pi/180.)
406 planfiss = geompy.MakeTranslation(planfiss, 0, 0, -l_tube_p1)
407 planfiss = geompy.MakeRotation(planfiss, axe, alpha*math.pi/180.)
408 geomPublish(initLog.always,planfiss, "planfissPlace", self.numeroCas )
409 pipefissl = geompy.MakePipe(facetubel, arcl)
410 pipefissi = geompy.MakePipe(facetubel, arci)
411 pipefissr = geompy.MakePipe(facetuber, arcr)
412 pipefiss = geompy.MakePartition([pipefissl, pipefissi, pipefissr], [planfiss, wiretube], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
413 geomPublish(initLog.always,pipefiss, "pipefissPlace", self.numeroCas )
416 elif self.longitudinale:
418 raybor = r_cintr + de/2.
419 rayint = raybor - profondeur
420 rayext = raybor + profondeur
422 rayext = r_cintr + de/2. - epais
423 rayint = raybor + profondeur
424 rayext = raybor - profondeur
425 lgfond = longueur -2*profondeur
426 angle = lgfond/(2*raybor)
427 pb = geompy.MakeVertex(-raybor, 0, 0)
428 pi = geompy.MakeVertex(-rayint, 0, 0)
429 pe = geompy.MakeVertex(-rayext, 0, 0)
430 pl = geompy.MakeVertex(-raybor, 0, -profondeur)
431 pr = geompy.MakeVertex(-raybor, 0, profondeur)
432 pil = geompy.MakeRotation(pi, OY, -angle)
433 pll = geompy.MakeRotation(pl, OY, -angle)
434 pel = geompy.MakeRotation(pe, OY, -angle)
435 pir = geompy.MakeRotation(pi, OY, angle)
436 prr = geompy.MakeRotation(pr, OY, angle)
437 per = geompy.MakeRotation(pe, OY, angle)
438 arcl = geompy.MakeArc(pil, pll, pel)
439 arcr = geompy.MakeArc(pir, prr, per)
440 arci = geompy.MakeArc(pil, pi, pir)
441 arce = geompy.MakeArc(pel, pe, per)
442 geomPublish(initLog.debug, arcl, 'arcl' )
443 geomPublish(initLog.debug, arcr, 'arcr' )
444 geomPublish(initLog.debug, arci, 'arci' )
445 geomPublish(initLog.debug, arce, 'arce' )
446 wire0 = geompy.MakeWire([arcr, arci, arcl])
447 cercle0 = geompy.MakeCircle(O, OZ, profondeur/4.0)
448 #cercle0 = geompy.MakeRotation(cercle0, OZ, math.pi/2.0)
449 cercle0 = geompy.MakeTranslationTwoPoints(cercle0, O, pi)
450 geomPublish(initLog.debug, cercle0, 'cercle0' )
451 facetube0 = geompy.MakeFaceWires([cercle0], 1)
452 facetubel = geompy.MakeRotation(facetube0, OY, -angle)
453 facetuber = geompy.MakeRotation(facetube0, OY, angle)
454 geomPublish(initLog.debug,facetubel , 'facetubel' )
455 geomPublish(initLog.debug, facetuber, 'facetuber' )
456 face0 = geompy.MakeFaceWires([arcl,arci, arce, arcr], 1)
457 plan0 = geompy.MakePlane(O, OY, 10000)
458 geomPublish(initLog.debug, face0, 'facefissOrig' )
459 facefiss = geompy.MakeRotation(face0, OY, alpha*math.pi/180.)
460 geomPublish(initLog.always, facefiss, "facefissPlace", self.numeroCas )
461 centre = geompy.MakeRotation(pb, OY, alpha*math.pi/180.)
462 geomPublish(initLog.always, centre, "centrefissPlace", self.numeroCas )
463 arcr = geompy.MakeRotation(arcr, OY, alpha*math.pi/180.)
464 arci = geompy.MakeRotation(arci, OY, alpha*math.pi/180.)
465 arcl = geompy.MakeRotation(arcl, OY, alpha*math.pi/180.)
466 wiretube = geompy.MakeRotation(wire0, OY, alpha*math.pi/180.)
467 geomPublish(initLog.always,wiretube, "wiretubePlace", self.numeroCas )
468 facetubel = geompy.MakeRotation(facetubel, OY, alpha*math.pi/180.)
469 geomPublish(initLog.debug,facetubel, 'facetubeGauche' )
470 facetuber = geompy.MakeRotation(facetuber, OY, alpha*math.pi/180.)
471 geomPublish(initLog.debug,facetubel, 'facetubeDroit' )
472 planfiss = geompy.MakeRotation(plan0, OY, alpha*math.pi/180.)
473 geomPublish(initLog.always,planfiss, "planfissPlace", self.numeroCas )
474 pipefissl = geompy.MakePipe(facetubel, arcl)
475 pipefissi = geompy.MakePipe(facetubel, arci)
476 pipefissr = geompy.MakePipe(facetuber, arcr)
477 pipefiss = geompy.MakePartition([pipefissl, pipefissi, pipefissr], [planfiss, wiretube], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
478 geomPublish(initLog.always,pipefiss, "pipefissPlace", self.numeroCas )
482 mailleur = self.mailleur2d3d()
483 coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefiss, 5 ,10, mailleur, self.numeroCas)
485 return [facefiss, centre, lgInfluence, coordsNoeudsFissure, wiretube, facetubel, facetuber, planfiss, pipefiss]
487 # ---------------------------------------------------------------------------
488 def setParamMaillageFissure(self):
489 self.maillageFissureParams = dict(nomRep = os.curdir,
490 nomFicSain = self.nomProbleme,
491 nomFicFissure = self.nomProbleme + "_fissure",
500 # ---------------------------------------------------------------------------
501 def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
502 elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, \
504 return elementsDefaut
506 # ---------------------------------------------------------------------------
507 def genereMaillageFissure(self, geometriesSaines, maillagesSains, \
508 shapesFissure, shapeFissureParams, \
509 maillageFissureParams, elementsDefaut, step, \
510 mailleur="MeshGems"):
512 mailleur = self.mailleur2d3d()
513 maillageFissure = insereFissureLongue(shapesFissure, shapeFissureParams, \
514 maillageFissureParams, elementsDefaut, \
515 mailleur, self.numeroCas)
516 return maillageFissure
518 # ---------------------------------------------------------------------------
519 def setReferencesMaillageFissure(self):
520 from salome.smesh import smeshBuilder
521 if smeshBuilder.NETGEN_VERSION_MAJOR < 6:
522 self.referencesMaillageFissure = dict( \
523 Entity_Quad_Quadrangle = 6710, \
524 Entity_Quad_Hexa = 8656, \
525 Entity_Node = 70896, \
526 Entity_Quad_Edge = 1006, \
527 Entity_Quad_Triangle = 2342, \
528 Entity_Quad_Tetra = 15963, \
529 Entity_Quad_Pyramid = 1232, \
530 Entity_Quad_Penta = 1176 \
533 self.referencesMaillageFissure = dict( \
534 Entity_Quad_Quadrangle = 6710, \
535 Entity_Quad_Hexa = 8656, \
536 Entity_Node = 71784, \
537 Entity_Quad_Edge = 1006, \
538 Entity_Quad_Triangle = 2496, \
539 Entity_Quad_Tetra = 16504, \
540 Entity_Quad_Pyramid = 1232, \
541 Entity_Quad_Penta = 1176 \