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 ellipse_1(fissureGenerique):
27 problème de fissure non plane, débouchante non normale
30 nomProbleme = "ellipse1"
32 # # ---------------------------------------------------------------------------
33 # def genereGeometrieSaine(self, geomParams):
34 # logging.info("genereGeometrieSaine %s", self.nomCas)
35 # box = geompy.MakeBox(0, -500, 0, 400, 500, 800, "boiteSaine")
38 # ---------------------------------------------------------------------------
39 def genereMaillageSain(self, geometriesSaines, meshParams):
40 logging.info("genereMaillageSain %s", self.nomCas)
42 ([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests/boiteSaine.med"))
43 smesh.SetName(objetSain.GetMesh(), 'objetSain')
45 return [objetSain, True] # True : maillage hexa
47 # ---------------------------------------------------------------------------
48 def setParamShapeFissure(self):
50 paramètres de la fissure pour méthode construitFissureGenerale
51 lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
52 rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
53 convexe : optionnel, True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
54 pointIn_x : optionnel, coordonnée x d'un point dans le solide sain (pour orienter la face)
56 logging.info("setParamShapeFissure %s", self.nomCas)
57 self.shapeFissureParams = dict(lgInfluence = 50,
60 # ---------------------------------------------------------------------------
61 def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
62 logging.info("genereShapeFissure %s", self.nomCas)
64 lgInfluence = shapeFissureParams['lgInfluence']
66 shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/ellipse1.brep"), "BREP")
67 fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
68 geompy.UnionIDs(fondFiss, [3])
69 geompy.addToStudy( shellFiss, 'shellFiss' )
70 geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
73 coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25)
76 return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
78 # ---------------------------------------------------------------------------
79 def setParamMaillageFissure(self):
80 self.maillageFissureParams = dict(nomRep = '.',
81 nomFicSain = self.nomCas,
82 nomFicFissure = 'fissure_' + self.nomCas,
85 areteFaceFissure = 1000)
87 # ---------------------------------------------------------------------------
88 def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
89 elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
92 # ---------------------------------------------------------------------------
93 def genereMaillageFissure(self, geometriesSaines, maillagesSains,
94 shapesFissure, shapeFissureParams,
95 maillageFissureParams, elementsDefaut, step):
96 maillageFissure = construitFissureGenerale(maillagesSains,
97 shapesFissure, shapeFissureParams,
98 maillageFissureParams, elementsDefaut, step)
99 return maillageFissure
101 # ---------------------------------------------------------------------------
102 def setReferencesMaillageFissure(self):
103 self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 175,
104 Entity_Quad_Triangle = 298,
105 Entity_Quad_Edge = 248,
106 Entity_Quad_Penta = 96,
107 Entity_Quad_Hexa = 3699,
109 Entity_Quad_Tetra = 1979,
110 Entity_Quad_Quadrangle = 1694)