1 # -*- coding: utf-8 -*-
4 from blocFissure import gmu
5 from blocFissure.gmu.geomsmesh import geompy, smesh
16 from blocFissure.gmu.fissureGenerique import fissureGenerique
18 from blocFissure.gmu.triedreBase import triedreBase
19 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
20 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
21 from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
23 O, OX, OY, OZ = triedreBase()
25 class eprouvetteCourbe(fissureGenerique):
27 problème de fissure plane coupant 3 faces (éprouvette), faces au débouché non planes, incidence presque normale
30 nomProbleme = "eprouvetteCourbe"
32 # ---------------------------------------------------------------------------
33 def genereMaillageSain(self, geometriesSaines, meshParams):
34 logging.info("genereMaillageSain %s", self.nomCas)
36 ([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteCourbe.med"))
37 smesh.SetName(objetSain.GetMesh(), 'objetSain')
39 return [objetSain, True] # True : maillage hexa
41 # ---------------------------------------------------------------------------
42 def setParamShapeFissure(self):
44 paramètres de la fissure pour méthode construitFissureGenerale
45 lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
46 rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
47 convexe : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
48 pointIn_x : optionnel coordonnée x d'un point dans le solide sain (pour orienter la face)
50 logging.info("setParamShapeFissure %s", self.nomCas)
51 self.shapeFissureParams = dict(lgInfluence = 30,
54 # ---------------------------------------------------------------------------
55 def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
56 logging.info("genereShapeFissure %s", self.nomCas)
58 lgInfluence = shapeFissureParams['lgInfluence']
60 shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteCourbeFiss.brep"), "BREP")
61 fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
62 geompy.UnionIDs(fondFiss, [8])
63 geompy.addToStudy( shellFiss, 'shellFiss' )
64 geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
67 coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10)
70 return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
72 # ---------------------------------------------------------------------------
73 def setParamMaillageFissure(self):
74 self.maillageFissureParams = dict(nomRep = '.',
75 nomFicSain = self.nomCas,
76 nomFicFissure = 'fissure_' + self.nomCas,
79 areteFaceFissure = 15)
81 # ---------------------------------------------------------------------------
82 def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
83 elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
86 # ---------------------------------------------------------------------------
87 def genereMaillageFissure(self, geometriesSaines, maillagesSains,
88 shapesFissure, shapeFissureParams,
89 maillageFissureParams, elementsDefaut, step):
90 maillageFissure = construitFissureGenerale(maillagesSains,
91 shapesFissure, shapeFissureParams,
92 maillageFissureParams, elementsDefaut, step)
93 return maillageFissure
95 # ---------------------------------------------------------------------------
96 def setReferencesMaillageFissure(self):
97 self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 618,
98 Entity_Quad_Triangle = 1224,
99 Entity_Quad_Edge = 578,
100 Entity_Quad_Penta = 168,
101 Entity_Quad_Hexa = 18342,
103 Entity_Quad_Tetra = 10809,
104 Entity_Quad_Quadrangle = 5408)