Nommage des maillags intermédiaires

This commit is contained in:
GERALD NICOLAS 2021-04-02 18:33:09 +02:00
parent 3f3ca40e45
commit 1a2209c281
16 changed files with 122 additions and 98 deletions

View File

@ -99,7 +99,8 @@ class cubeAngle(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams): def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams) elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, \
self.numeroCas)
return elementsDefaut return elementsDefaut
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -96,7 +96,8 @@ class cylindre(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams): def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams) elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, \
self.numeroCas)
return elementsDefaut return elementsDefaut
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -107,7 +107,8 @@ class ellipse_1(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams): def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams) elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, \
self.numeroCas)
return elementsDefaut return elementsDefaut
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -101,7 +101,8 @@ class eprouvetteCourbe(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams): def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams) elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, \
self.numeroCas)
return elementsDefaut return elementsDefaut
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -101,7 +101,8 @@ class eprouvetteDroite(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams): def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams) elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, \
self.numeroCas)
return elementsDefaut return elementsDefaut
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -99,7 +99,8 @@ class faceGauche(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams): def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams) elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, \
self.numeroCas)
return elementsDefaut return elementsDefaut
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -101,7 +101,8 @@ class faceGauche_2(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams): def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams) elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, \
self.numeroCas)
return elementsDefaut return elementsDefaut
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -498,7 +498,8 @@ class fissure_Coude(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams): def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams) elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, \
self.numeroCas)
return elementsDefaut return elementsDefaut
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -103,7 +103,8 @@ class tube(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams): def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams) elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, \
self.numeroCas)
return elementsDefaut return elementsDefaut
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -104,7 +104,8 @@ class vis_1(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams): def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams) elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, \
self.numeroCas)
return elementsDefaut return elementsDefaut
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -167,7 +167,8 @@ class casStandard(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams): def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams) elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, \
self.numeroCas)
return elementsDefaut return elementsDefaut
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -35,7 +35,8 @@ from .creeZoneDefautGeom import creeZoneDefautGeom
from .getCentreFondFiss import getCentreFondFiss from .getCentreFondFiss import getCentreFondFiss
def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, \ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, \
shapeFissureParams, maillageFissureParams): shapeFissureParams, maillageFissureParams, \
nro_cas=-1):
""" """
#TODO: a compléter #TODO: a compléter
""" """
@ -78,7 +79,8 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure,
maillageSain.ExportMED(fichierMaillageSain) maillageSain.ExportMED(fichierMaillageSain)
logging.debug("fichier maillage sain %s", fichierMaillageSain) logging.debug("fichier maillage sain %s", fichierMaillageSain)
[maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges] = \ [maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges] = \
peauInterne(fichierMaillageSain, shapeDefaut, nomZones) peauInterne(fichierMaillageSain, shapeDefaut, nomZones, \
nro_cas)
facesDefaut = list() facesDefaut = list()
centresDefaut = list() centresDefaut = list()

View File

@ -671,7 +671,8 @@ class fissureCoude(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams): def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams) elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, \
self.numeroCas)
return elementsDefaut return elementsDefaut
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -95,116 +95,122 @@ def insereFissureElliptique(geometriesSaines, maillagesSains, \
zoneDefaut_internalFaces = elementsDefaut[12] zoneDefaut_internalFaces = elementsDefaut[12]
zoneDefaut_internalEdges = elementsDefaut[13] zoneDefaut_internalEdges = elementsDefaut[13]
## --- ellipse incomplete : generatrice maillageComplet = None
#if step == 5:
#return None
#allonge = demiGrandAxe/demiPetitAxe while True:
#rayonTore = demiPetitAxe/5.0
#generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part = self.toreFissure(demiPetitAxe, allonge, rayonTore)
#ellipsoide = self.ellipsoideDefaut(demiPetitAxe, allonge)
## --- positionnement sur le bloc defaut de generatrice, tore et plan fissure ## --- ellipse incomplete : generatrice
#if step == 6: #if step == 5:
#return None #break
#pipe0 = self.rotTrans(Pipe_1, orientation, centreDefaut, normalDefaut) #allonge = demiGrandAxe/demiPetitAxe
#gener1 = self.rotTrans(generatrice, orientation, centreDefaut, normalDefaut) #rayonTore = demiPetitAxe/5.0
#pipe1 = self.rotTrans(Pipe1Part, orientation, centreDefaut, normalDefaut) #generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part = self.toreFissure(demiPetitAxe, allonge, rayonTore)
#facefis1 = self.rotTrans(FaceFissure, orientation, centreDefaut, normalDefaut) #ellipsoide = self.ellipsoideDefaut(demiPetitAxe, allonge)
#plane1 = self.rotTrans(Plane_1, orientation, centreDefaut, normalDefaut)
#ellipsoide1 = self.rotTrans(ellipsoide, orientation, centreDefaut, normalDefaut)
#geomPublish(initLog.debug, pipe0, 'pipe0' ) ## --- positionnement sur le bloc defaut de generatrice, tore et plan fissure
#geomPublish(initLog.debug, gener1, 'gener1' ) #if step == 6:
#geomPublish(initLog.debug, pipe1, 'pipe1' ) #break
#geomPublish(initLog.debug, facefis1, 'facefis1' )
#geomPublish(initLog.debug, plane1, 'plane1' )
#geomPublish(initLog.debug, ellipsoide1, 'ellipsoide1' )
# --- partition du bloc défaut par génératrice, tore et plan fissure #pipe0 = self.rotTrans(Pipe_1, orientation, centreDefaut, normalDefaut)
if step == 7: #gener1 = self.rotTrans(generatrice, orientation, centreDefaut, normalDefaut)
return None #pipe1 = self.rotTrans(Pipe1Part, orientation, centreDefaut, normalDefaut)
#facefis1 = self.rotTrans(FaceFissure, orientation, centreDefaut, normalDefaut)
#plane1 = self.rotTrans(Plane_1, orientation, centreDefaut, normalDefaut)
#ellipsoide1 = self.rotTrans(ellipsoide, orientation, centreDefaut, normalDefaut)
[ blocPartition, _, tore, \ #geomPublish(initLog.debug, pipe0, 'pipe0' )
faceFissure, facesExternes, facesExtBloc, facesExtElli, #geomPublish(initLog.debug, gener1, 'gener1' )
aretesInternes, ellipsoidep, sharedFaces, sharedEdges, edgesBords] = \ #geomPublish(initLog.debug, pipe1, 'pipe1' )
partitionBlocDefaut(extrusionDefaut, facesDefaut, gener1, pipe1, facefis1, ellipsoide1) #geomPublish(initLog.debug, facefis1, 'facefis1' )
if not isHexa: #geomPublish(initLog.debug, plane1, 'plane1' )
edgesBords = None # maillage sain hexa ==> filling, et maillage edges Bords imposés du maillage sain #geomPublish(initLog.debug, ellipsoide1, 'ellipsoide1' )
# --- TORE # --- partition du bloc défaut par génératrice, tore et plan fissure
# --- faces toriques du tore if step == 7:
if step == 8: break
return None
[facetore1, facetore2, _, _] = facesVolumesToriques(tore, plane1, facesDefaut) [ blocPartition, _, tore, \
faceFissure, facesExternes, facesExtBloc, facesExtElli,
aretesInternes, ellipsoidep, sharedFaces, sharedEdges, edgesBords] = \
partitionBlocDefaut(extrusionDefaut, facesDefaut, gener1, pipe1, facefis1, ellipsoide1)
if not isHexa:
edgesBords = None # maillage sain hexa ==> filling, et maillage edges Bords imposés du maillage sain
# --- faces 1/2 circulaires et edges dans le plan de fissure # --- TORE
if step == 9: # --- faces toriques du tore
return None if step == 8:
break
[faces, centres, edges, reverses] = facesCirculaires(extrusionDefaut, tore) [facetore1, facetore2, _, _] = facesVolumesToriques(tore, plane1, facesDefaut)
# --- recherche et classement des edges du tore par propagate # --- faces 1/2 circulaires et edges dans le plan de fissure
if step == 10: if step == 9:
return None break
[diams, circles, geners] = propagateTore(tore) [faces, centres, edges, reverses] = facesCirculaires(extrusionDefaut, tore)
# --- tri par longueur des 3 génératrices # --- recherche et classement des edges du tore par propagate
if step == 11: if step == 10:
return None break
[_, genint, gencnt] = sortGeneratrices(tore, geners) [diams, circles, geners] = propagateTore(tore)
# --- faces fissure dans et hors tore, et edges face hors tore # --- tri par longueur des 3 génératrices
if step == 12: if step == 11:
return None break
[_, facefissoutore, _, edgeext, reverext] = \ [_, genint, gencnt] = sortGeneratrices(tore, geners)
facesFissure(ellipsoidep, faceFissure, extrusionDefaut, genint)
# --- identification des faces tore et fissure dans le solide hors tore # --- faces fissure dans et hors tore, et edges face hors tore
if step == 13: if step == 12:
return None break
[_, _, _] = \ [_, facefissoutore, _, edgeext, reverext] = \
facesToreInBloc(ellipsoidep, facefissoutore, facetore1, facetore2) facesFissure(ellipsoidep, faceFissure, extrusionDefaut, genint)
# --- identification des shapes modifiées par la duplication des noeuds de la face fissure (d'un coté de la face) # --- identification des faces tore et fissure dans le solide hors tore
if step == 13:
break
#shapesAModifier = self.shapesSurFissure(blocPartition, plane1 faceFissure, gencnt) [_, _, _] = \
if step == 14: facesToreInBloc(ellipsoidep, facefissoutore, facetore1, facetore2)
return None
extrusionFaceFissure, _ = shapeSurFissure(plane1) # --- identification des shapes modifiées par la duplication des noeuds de la face fissure (d'un coté de la face)
# --- maillage du bloc partitionne #shapesAModifier = self.shapesSurFissure(blocPartition, plane1 faceFissure, gencnt)
if step == 14:
break
if step == 15: extrusionFaceFissure, _ = shapeSurFissure(plane1)
return None
[_, blocComplet] = \ # --- maillage du bloc partitionne
meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circles, faces, \
gencnt, facefissoutore, edgeext, facesExternes, facesExtBloc, facesExtElli, \
aretesInternes, internalBoundary, ellipsoidep, sharedFaces, sharedEdges, edgesBords, \
nbsegExt, nbsegGen, nbsegRad, scaleRad, reverses, reverext, nbsegCercle,
nbsegFis, dmoyen, lensegEllipsoide) \
if step == 16: if step == 15:
return None break
maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges)
if step == 17: [_, blocComplet] = \
return None meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circles, faces, \
maillageComplet = RegroupeSainEtDefaut(maillageSain, blocComplet, extrusionFaceFissure, faceFissure, 'VOLUMES') gencnt, facefissoutore, edgeext, facesExternes, facesExtBloc, facesExtElli, \
aretesInternes, internalBoundary, ellipsoidep, sharedFaces, sharedEdges, edgesBords, \
nbsegExt, nbsegGen, nbsegRad, scaleRad, reverses, reverext, nbsegCercle, \
nbsegFis, dmoyen, lensegEllipsoide)
if step == 16:
break
if step == 18: maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges)
return None if step == 17:
maillageComplet.ExportMED(fichierMaillageFissure) break
putName(maillageComplet, nomFicFissure)
logging.info("fichier maillage fissure : %s", fichierMaillageFissure) maillageComplet = RegroupeSainEtDefaut(maillageSain, blocComplet, extrusionFaceFissure, faceFissure, 'VOLUMES')
if step == 18:
break
maillageComplet.ExportMED(fichierMaillageFissure)
putName(maillageComplet, nomFicFissure)
logging.info("fichier maillage fissure : %s", fichierMaillageFissure)
break
if salome.sg.hasDesktop(): if salome.sg.hasDesktop():
salome.sg.updateObjBrowser() salome.sg.updateObjBrowser()

View File

@ -217,6 +217,7 @@ def insereFissureLongue_b (edgesInside, centreFondFiss, tangentFondFiss, \
_ = smesh.CreateFilterManager() _ = smesh.CreateFilterManager()
_, internalBoundary, _ = internalBoundary.MakeBoundaryElements( SMESH.BND_1DFROM2D, '', '', 0, [ ]) _, internalBoundary, _ = internalBoundary.MakeBoundaryElements( SMESH.BND_1DFROM2D, '', '', 0, [ ])
putName(internalBoundary, 'internalBoundary', i_pref=nro_cas)
criteres = list() criteres = list()
un_critere = smesh.GetCriterion(SMESH.EDGE,SMESH.FT_FreeBorders,SMESH.FT_Undefined,0) un_critere = smesh.GetCriterion(SMESH.EDGE,SMESH.FT_FreeBorders,SMESH.FT_Undefined,0)
criteres.append(un_critere) criteres.append(un_critere)

View File

@ -29,8 +29,10 @@ from .geomsmesh import smesh
from .fissError import fissError from .fissError import fissError
from .listOfExtraFunctions import lookForCorner from .listOfExtraFunctions import lookForCorner
from .fusionMaillageAttributionDefaut import fusionMaillageDefaut from .fusionMaillageAttributionDefaut import fusionMaillageDefaut
from .putName import putName
def peauInterne(fichierMaillage, shapeDefaut, nomZones): def peauInterne(fichierMaillage, shapeDefaut, nomZones, \
nro_cas=-1):
"""Retrouve les groupes de défaut dans le maillage sain modifié par CreateHoleSkin (CreeZoneDefautMaillage) """Retrouve les groupes de défaut dans le maillage sain modifié par CreateHoleSkin (CreeZoneDefautMaillage)
On récupère le volume et la peau de la zone de défaut, les éventuelles faces et arêtes internes de cette zone. On récupère le volume et la peau de la zone de défaut, les éventuelles faces et arêtes internes de cette zone.
@ -97,6 +99,7 @@ def peauInterne(fichierMaillage, shapeDefaut, nomZones):
internalBoundary = smesh.CopyMesh( internal, 'internalBoundary', 0, 0) internalBoundary = smesh.CopyMesh( internal, 'internalBoundary', 0, 0)
maillageDefautCible = smesh.CopyMesh(zoneDefaut_skin, 'maillageCible', 0, 0) maillageDefautCible = smesh.CopyMesh(zoneDefaut_skin, 'maillageCible', 0, 0)
putName(maillageDefautCible, "maillageCible", i_pref=nro_cas)
listOfCorner = lookForCorner(maillageDefautCible) listOfCorner = lookForCorner(maillageDefautCible)
texte = "listOfCorner = {}".format(listOfCorner) texte = "listOfCorner = {}".format(listOfCorner)
logging.debug(texte) logging.debug(texte)