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 vis_1(fissureGenerique):
27 problème de fissure non plane, débouchante non normale
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/visSain.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 = 0.6,
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/visFiss.brep"), "BREP")
61 fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
62 geompy.UnionIDs(fondFiss, [6, 8])
63 geompy.addToStudy( shellFiss, 'shellFiss' )
64 geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
67 coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 0.1 ,0.2)
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 = 0.1)
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 = 1284,
98 Entity_Quad_Triangle = 2336,
99 Entity_Quad_Edge = 758,
100 Entity_Quad_Penta = 984,
101 Entity_Quad_Hexa = 6416,
103 Entity_Quad_Tetra = 35990,
104 Entity_Quad_Quadrangle = 4285)