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):
elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, \
self.numeroCas)
return elementsDefaut
# ---------------------------------------------------------------------------

View File

@ -96,7 +96,8 @@ class cylindre(fissureGenerique):
# ---------------------------------------------------------------------------
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
# ---------------------------------------------------------------------------

View File

@ -107,7 +107,8 @@ class ellipse_1(fissureGenerique):
# ---------------------------------------------------------------------------
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
# ---------------------------------------------------------------------------

View File

@ -101,7 +101,8 @@ class eprouvetteCourbe(fissureGenerique):
# ---------------------------------------------------------------------------
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
# ---------------------------------------------------------------------------

View File

@ -101,7 +101,8 @@ class eprouvetteDroite(fissureGenerique):
# ---------------------------------------------------------------------------
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
# ---------------------------------------------------------------------------

View File

@ -99,7 +99,8 @@ class faceGauche(fissureGenerique):
# ---------------------------------------------------------------------------
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
# ---------------------------------------------------------------------------

View File

@ -101,7 +101,8 @@ class faceGauche_2(fissureGenerique):
# ---------------------------------------------------------------------------
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
# ---------------------------------------------------------------------------

View File

@ -498,7 +498,8 @@ class fissure_Coude(fissureGenerique):
# ---------------------------------------------------------------------------
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
# ---------------------------------------------------------------------------

View File

@ -103,7 +103,8 @@ class tube(fissureGenerique):
# ---------------------------------------------------------------------------
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
# ---------------------------------------------------------------------------

View File

@ -104,7 +104,8 @@ class vis_1(fissureGenerique):
# ---------------------------------------------------------------------------
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
# ---------------------------------------------------------------------------

View File

@ -167,7 +167,8 @@ class casStandard(fissureGenerique):
# ---------------------------------------------------------------------------
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
# ---------------------------------------------------------------------------

View File

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

View File

@ -671,7 +671,8 @@ class fissureCoude(fissureGenerique):
# ---------------------------------------------------------------------------
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
# ---------------------------------------------------------------------------

View File

@ -95,116 +95,122 @@ def insereFissureElliptique(geometriesSaines, maillagesSains, \
zoneDefaut_internalFaces = elementsDefaut[12]
zoneDefaut_internalEdges = elementsDefaut[13]
## --- ellipse incomplete : generatrice
#if step == 5:
#return None
maillageComplet = None
#allonge = demiGrandAxe/demiPetitAxe
#rayonTore = demiPetitAxe/5.0
#generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part = self.toreFissure(demiPetitAxe, allonge, rayonTore)
#ellipsoide = self.ellipsoideDefaut(demiPetitAxe, allonge)
while True:
## --- positionnement sur le bloc defaut de generatrice, tore et plan fissure
#if step == 6:
#return None
## --- ellipse incomplete : generatrice
#if step == 5:
#break
#pipe0 = self.rotTrans(Pipe_1, orientation, centreDefaut, normalDefaut)
#gener1 = self.rotTrans(generatrice, orientation, centreDefaut, normalDefaut)
#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)
#allonge = demiGrandAxe/demiPetitAxe
#rayonTore = demiPetitAxe/5.0
#generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part = self.toreFissure(demiPetitAxe, allonge, rayonTore)
#ellipsoide = self.ellipsoideDefaut(demiPetitAxe, allonge)
#geomPublish(initLog.debug, pipe0, 'pipe0' )
#geomPublish(initLog.debug, gener1, 'gener1' )
#geomPublish(initLog.debug, pipe1, 'pipe1' )
#geomPublish(initLog.debug, facefis1, 'facefis1' )
#geomPublish(initLog.debug, plane1, 'plane1' )
#geomPublish(initLog.debug, ellipsoide1, 'ellipsoide1' )
## --- positionnement sur le bloc defaut de generatrice, tore et plan fissure
#if step == 6:
#break
# --- partition du bloc défaut par génératrice, tore et plan fissure
if step == 7:
return None
#pipe0 = self.rotTrans(Pipe_1, orientation, centreDefaut, normalDefaut)
#gener1 = self.rotTrans(generatrice, orientation, centreDefaut, normalDefaut)
#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, \
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
#geomPublish(initLog.debug, pipe0, 'pipe0' )
#geomPublish(initLog.debug, gener1, 'gener1' )
#geomPublish(initLog.debug, pipe1, 'pipe1' )
#geomPublish(initLog.debug, facefis1, 'facefis1' )
#geomPublish(initLog.debug, plane1, 'plane1' )
#geomPublish(initLog.debug, ellipsoide1, 'ellipsoide1' )
# --- TORE
# --- faces toriques du tore
if step == 8:
return None
# --- partition du bloc défaut par génératrice, tore et plan fissure
if step == 7:
break
[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
if step == 9:
return None
# --- TORE
# --- faces toriques du tore
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
if step == 10:
return None
# --- faces 1/2 circulaires et edges dans le plan de fissure
if step == 9:
break
[diams, circles, geners] = propagateTore(tore)
[faces, centres, edges, reverses] = facesCirculaires(extrusionDefaut, tore)
# --- tri par longueur des 3 génératrices
if step == 11:
return None
# --- recherche et classement des edges du tore par propagate
if step == 10:
break
[_, genint, gencnt] = sortGeneratrices(tore, geners)
[diams, circles, geners] = propagateTore(tore)
# --- faces fissure dans et hors tore, et edges face hors tore
if step == 12:
return None
# --- tri par longueur des 3 génératrices
if step == 11:
break
[_, facefissoutore, _, edgeext, reverext] = \
facesFissure(ellipsoidep, faceFissure, extrusionDefaut, genint)
[_, genint, gencnt] = sortGeneratrices(tore, geners)
# --- identification des faces tore et fissure dans le solide hors tore
if step == 13:
return None
# --- faces fissure dans et hors tore, et edges face hors tore
if step == 12:
break
[_, _, _] = \
facesToreInBloc(ellipsoidep, facefissoutore, facetore1, facetore2)
[_, facefissoutore, _, edgeext, reverext] = \
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:
return None
[_, _, _] = \
facesToreInBloc(ellipsoidep, facefissoutore, facetore1, facetore2)
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:
return None
extrusionFaceFissure, _ = shapeSurFissure(plane1)
[_, blocComplet] = \
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) \
# --- maillage du bloc partitionne
if step == 16:
return None
maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges)
if step == 15:
break
if step == 17:
return None
maillageComplet = RegroupeSainEtDefaut(maillageSain, blocComplet, extrusionFaceFissure, faceFissure, 'VOLUMES')
[_, blocComplet] = \
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:
break
if step == 18:
return None
maillageComplet.ExportMED(fichierMaillageFissure)
putName(maillageComplet, nomFicFissure)
logging.info("fichier maillage fissure : %s", fichierMaillageFissure)
maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges)
if step == 17:
break
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():
salome.sg.updateObjBrowser()

View File

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

View File

@ -29,8 +29,10 @@ from .geomsmesh import smesh
from .fissError import fissError
from .listOfExtraFunctions import lookForCorner
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)
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)
maillageDefautCible = smesh.CopyMesh(zoneDefaut_skin, 'maillageCible', 0, 0)
putName(maillageDefautCible, "maillageCible", i_pref=nro_cas)
listOfCorner = lookForCorner(maillageDefautCible)
texte = "listOfCorner = {}".format(listOfCorner)
logging.debug(texte)