1 # -*- coding: utf-8 -*-
4 from geomsmesh import smesh
8 from creeZoneDefautMaillage import creeZoneDefautMaillage
9 from peauInterne import peauInterne
10 from quadranglesToShape import quadranglesToShape
11 from creeZoneDefautFilling import creeZoneDefautFilling
12 from creeZoneDefautGeom import creeZoneDefautGeom
13 from getCentreFondFiss import getCentreFondFiss
15 # -----------------------------------------------------------------------------
18 def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure,
19 shapeFissureParams, maillageFissureParams):
25 #smesh.SetCurrentStudy(salome.myStudy)
27 geometrieSaine = geometriesSaines[0]
28 maillageSain = maillagesSains[0]
29 isHexa = maillagesSains[1]
30 shapeDefaut = shapesFissure[0]
31 tailleDefaut = shapesFissure[2]
32 coordsNoeudsFissure = shapesFissure[3]
35 if shapeFissureParams.has_key('elliptique'):
36 isElliptique = shapeFissureParams['elliptique']
38 if shapeFissureParams.has_key('demiGrandAxe'):
39 demiGrandAxe = shapeFissureParams['demiGrandAxe']
41 demiGrandAxe = shapeFissureParams['longueur']
42 lgExtrusion = 2.0*demiGrandAxe
46 nomRep = maillageFissureParams['nomRep']
47 nomFicSain = maillageFissureParams['nomFicSain']
49 fichierMaillageSain = nomRep + '/' + nomFicSain + '.med'
51 # --- centre de fond de fissure et tangente
53 edgeFondExt, centreFondFiss, tgtCentre = getCentreFondFiss(shapesFissure)
57 nomZones = "zoneDefaut"
59 [origShapes, verticesShapes, dmoyen] = \
60 creeZoneDefautMaillage(maillagesSains, shapeDefaut, tailleDefaut, nomZones, coordsNoeudsFissure)
62 maillageSain.ExportMED( fichierMaillageSain, 0, SMESH.MED_V2_2, 1 )
63 logging.debug("fichier maillage sain %s", fichierMaillageSain)
64 [maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges] = \
65 peauInterne(fichierMaillageSain, nomZones)
72 if isHexa and not isPlane:
73 meshQuad = smesh.CopyMesh( zoneDefaut_skin, 'meshQuad', 0, 0)
74 fillings, noeuds_bords, bordsPartages, fillconts, idFilToCont = quadranglesToShape(meshQuad, shapeFissureParams, centreFondFiss)
75 for filling in fillings:
76 [faceDefaut, centreDefaut, normalDefaut, extrusionDefaut] = \
77 creeZoneDefautFilling(filling, shapeDefaut, lgExtrusion)
78 facesDefaut.append(faceDefaut)
79 centresDefaut.append(centreDefaut)
80 normalsDefaut.append(normalDefaut)
81 extrusionsDefaut.append(extrusionDefaut)
83 [facesDefaut, centreDefaut, normalDefaut, extrusionDefaut] = \
84 creeZoneDefautGeom( geometrieSaine, shapeDefaut, origShapes, verticesShapes, dmoyen, lgExtrusion)
86 for face in facesDefaut:
87 bordsPartages.append([None,None]) # TODO : traitement des arêtes vives ?
88 fillconts = facesDefaut
89 idFilToCont = range(len(facesDefaut))
91 return [facesDefaut, centresDefaut, normalsDefaut, extrusionsDefaut, dmoyen, bordsPartages, fillconts, idFilToCont,
92 maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges,
93 edgeFondExt, centreFondFiss, tgtCentre]