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 cylindre(fissureGenerique):
27 problème de fissure plane sur cylindre, grand fond de fissure en arc de cercle
30 nomProbleme = "cylindre"
32 # ---------------------------------------------------------------------------
33 def genereMaillageSain(self, geometriesSaines, meshParams):
35 génère le maillage de l'objet sain, par chargement d'un fichier med
36 ici, les paramètres de géométrie et de maillage ne sont pas utiles
38 logging.info("genereMaillageSain %s", self.nomCas)
40 ([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests/CylindreSain.med"))
41 smesh.SetName(objetSain.GetMesh(), 'objetSain')
43 return [objetSain, True] # True : maillage hexa
45 # ---------------------------------------------------------------------------
46 def setParamShapeFissure(self):
48 paramètres de la fissure pour méthode construitFissureGenerale
49 lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
50 rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
52 logging.info("setParamShapeFissure %s", self.nomCas)
53 self.shapeFissureParams = dict(lgInfluence = 20,
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/FissInCylindre2.brep"), "BREP")
63 fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
64 geompy.UnionIDs(fondFiss, [6])
65 geompy.addToStudy( shellFiss, 'shellFiss' )
66 geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
69 coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,15)
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 = 20)
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 = 1270,
100 Entity_Quad_Triangle = 1260,
101 Entity_Quad_Edge = 758,
102 Entity_Quad_Penta = 496,
103 Entity_Quad_Hexa = 18814,
104 Entity_Node = 113313,
105 Entity_Quad_Tetra = 20469,
106 Entity_Quad_Quadrangle = 7280)