1 # -*- coding: utf-8 -*-
4 from blocFissure import gmu
5 from blocFissure.gmu.geomsmesh import geompy, smesh
17 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 eprouvetteDroite(fissureGenerique):
28 problème de fissure plane coupant 3 faces (éprouvette), débouches normaux, objet plan
31 nomProbleme = "eprouvetteDroite"
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/eprouvetteDroite.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 = 30,
56 # ---------------------------------------------------------------------------
57 def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
58 logging.info("genereShapeFissure %s", self.nomCas)
60 lgInfluence = shapeFissureParams['lgInfluence']
62 shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss_1.brep"), "BREP")
63 fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
64 geompy.UnionIDs(fondFiss, [8])
65 geompy.addToStudy( shellFiss, 'shellFiss' )
66 geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
69 coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10)
72 return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
74 # ---------------------------------------------------------------------------
75 def setParamMaillageFissure(self):
76 self.maillageFissureParams = dict(nomRep = '.',
77 nomFicSain = self.nomCas,
78 nomFicFissure = 'fissure_' + self.nomCas,
81 areteFaceFissure = 15)
83 # ---------------------------------------------------------------------------
84 def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
85 elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
88 # ---------------------------------------------------------------------------
89 def genereMaillageFissure(self, geometriesSaines, maillagesSains,
90 shapesFissure, shapeFissureParams,
91 maillageFissureParams, elementsDefaut, step):
92 maillageFissure = construitFissureGenerale(maillagesSains,
93 shapesFissure, shapeFissureParams,
94 maillageFissureParams, elementsDefaut, step)
95 return maillageFissure
97 # ---------------------------------------------------------------------------
98 def setReferencesMaillageFissure(self):
99 self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 368,
100 Entity_Quad_Triangle = 798,
101 Entity_Quad_Edge = 491,
102 Entity_Quad_Penta = 88,
103 Entity_Quad_Hexa = 9692,
105 Entity_Quad_Tetra = 5093,
106 Entity_Quad_Quadrangle = 3750)