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 cubeAngle(fissureGenerique):
27 problème de fissure plane coupant 2 faces (angle), débouches normaux, objet plan
30 nomProbleme = "cubeAngle"
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/CubeAngle.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
48 logging.info("setParamShapeFissure %s", self.nomCas)
49 self.shapeFissureParams = dict(lgInfluence = 20,
52 # ---------------------------------------------------------------------------
53 def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
54 logging.info("genereShapeFissure %s", self.nomCas)
56 lgInfluence = shapeFissureParams['lgInfluence']
58 shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/CubeAngleFiss.brep"), "BREP")
59 fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
60 geompy.UnionIDs(fondFiss, [3])
61 geompy.addToStudy( shellFiss, 'shellFiss' )
62 geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
65 coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10)
68 return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
70 # ---------------------------------------------------------------------------
71 def setParamMaillageFissure(self):
72 self.maillageFissureParams = dict(nomRep = '.',
73 nomFicSain = self.nomCas,
74 nomFicFissure = 'fissure_' + self.nomCas,
77 areteFaceFissure = 10)
79 # ---------------------------------------------------------------------------
80 def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
81 elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
84 # ---------------------------------------------------------------------------
85 def genereMaillageFissure(self, geometriesSaines, maillagesSains,
86 shapesFissure, shapeFissureParams,
87 maillageFissureParams, elementsDefaut, step):
88 maillageFissure = construitFissureGenerale(maillagesSains,
89 shapesFissure, shapeFissureParams,
90 maillageFissureParams, elementsDefaut, step)
91 return maillageFissure
93 # ---------------------------------------------------------------------------
94 def setReferencesMaillageFissure(self):
95 self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 204,
96 Entity_Quad_Triangle = 336,
97 Entity_Quad_Edge = 278,
98 Entity_Quad_Penta = 96,
99 Entity_Quad_Hexa = 3651,
101 Entity_Quad_Tetra = 1877,
102 Entity_Quad_Quadrangle = 1702)