1 # -*- coding: utf-8 -*-
4 from .geomsmesh import smesh
8 from .creeZoneDefautMaillage import creeZoneDefautMaillage
9 from .peauInterne import peauInterne
10 from .quadranglesToShapeNoCorner import quadranglesToShapeNoCorner
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 geometrieSaine = geometriesSaines[0]
26 maillageSain = maillagesSains[0]
27 isHexa = maillagesSains[1]
28 shapeDefaut = shapesFissure[0]
29 tailleDefaut = shapesFissure[2]
30 coordsNoeudsFissure = shapesFissure[3]
33 if 'elliptique' in shapeFissureParams:
34 isElliptique = shapeFissureParams['elliptique']
36 if 'demiGrandAxe' in shapeFissureParams:
37 demiGrandAxe = shapeFissureParams['demiGrandAxe']
39 demiGrandAxe = shapeFissureParams['longueur']
40 lgExtrusion = 2.0*demiGrandAxe
44 nomRep = maillageFissureParams['nomRep']
45 nomFicSain = maillageFissureParams['nomFicSain']
47 fichierMaillageSain = nomRep + '/' + nomFicSain + '.med'
49 # --- centre de fond de fissure et tangente
51 edgeFondExt, centreFondFiss, tgtCentre = getCentreFondFiss(shapesFissure)
55 nomZones = "zoneDefaut"
57 [origShapes, verticesShapes, dmoyen] = \
58 creeZoneDefautMaillage(maillagesSains, shapeDefaut, tailleDefaut, nomZones, coordsNoeudsFissure)
60 maillageSain.ExportMED(fichierMaillageSain)
61 logging.debug("fichier maillage sain %s", fichierMaillageSain)
62 [maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges] = \
63 peauInterne(fichierMaillageSain, shapeDefaut, nomZones)
70 if isHexa and not isPlane:
71 meshQuad = smesh.CopyMesh( zoneDefaut_skin, 'meshQuad', 0, 0)
73 fillings, noeuds_bords, bordsPartages, fillconts, idFilToCont = quadranglesToShapeNoCorner(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 = list(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]