1 # -*- coding: utf-8 -*-
4 from blocFissure import gmu
5 from blocFissure.gmu.geomsmesh import geompy, smesh
16 from blocFissure.gmu.fissureGenerique import fissureGenerique
19 from blocFissure.gmu.triedreBase import triedreBase
20 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
21 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
22 from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
24 O, OX, OY, OZ = triedreBase()
26 class faceGauche_2(fissureGenerique):
28 problème de fissure non plane, débouchante non normale
31 nomProbleme = "faceGauche2"
33 # ---------------------------------------------------------------------------
34 def genereMaillageSain(self, geometriesSaines, meshParams):
35 logging.info("genereMaillageSain %s", self.nomCas)
37 ([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests/boiteSaine.med"))
38 smesh.SetName(objetSain.GetMesh(), 'objetSain')
40 return [objetSain, True] # True : maillage hexa
42 # ---------------------------------------------------------------------------
43 def setParamShapeFissure(self):
45 paramètres de la fissure pour méthode construitFissureGenerale
46 lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
47 rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
48 convexe : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
49 pointIn_x : optionnel coordonnée x d'un point dans le solide sain (pour orienter la face)
51 logging.info("setParamShapeFissure %s", self.nomCas)
52 self.shapeFissureParams = dict(lgInfluence = 100,
55 # ---------------------------------------------------------------------------
56 def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
57 logging.info("genereShapeFissure %s", self.nomCas)
59 lgInfluence = shapeFissureParams['lgInfluence']
61 shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2FissCoupe.brep"), "BREP")
62 fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
63 geompy.UnionIDs(fondFiss, [14, 9])
64 geompy.addToStudy( shellFiss, 'shellFiss' )
65 geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
68 coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25)
71 return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
73 # ---------------------------------------------------------------------------
74 def setParamMaillageFissure(self):
75 self.maillageFissureParams = dict(nomRep = '.',
76 nomFicSain = self.nomCas,
77 nomFicFissure = 'fissure_' + self.nomCas,
80 areteFaceFissure = 1000)
82 # ---------------------------------------------------------------------------
83 def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
84 elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
87 # ---------------------------------------------------------------------------
88 def genereMaillageFissure(self, geometriesSaines, maillagesSains,
89 shapesFissure, shapeFissureParams,
90 maillageFissureParams, elementsDefaut, step):
91 maillageFissure = construitFissureGenerale(maillagesSains,
92 shapesFissure, shapeFissureParams,
93 maillageFissureParams, elementsDefaut, step)
94 return maillageFissure
96 # ---------------------------------------------------------------------------
97 def setReferencesMaillageFissure(self):
98 self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 859,
99 Entity_Quad_Triangle = 634,
100 Entity_Quad_Edge = 323,
101 Entity_Quad_Penta = 288,
102 Entity_Quad_Hexa = 3435,
104 Entity_Quad_Tetra = 18400,
105 Entity_Quad_Quadrangle = 2542)