From 2cf6435f1492b63b9adf4e8256d88968638ed9bf Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 15 Apr 2021 16:05:00 +0200 Subject: [PATCH] simplification --- .../gmu/construitFissureGenerale.py | 4 +-- .../blocFissure/gmu/construitMaillagePipe.py | 26 ++++--------------- .../gmu/construitMaillagePipe_b.py | 12 ++++++--- .../gmu/construitMaillagePipe_c.py | 11 +++++--- .../blocFissure/gmu/mailleFacesFissure.py | 4 +-- 5 files changed, 25 insertions(+), 32 deletions(-) diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale.py b/src/Tools/blocFissure/gmu/construitFissureGenerale.py index 71df308c8..a2aa580c4 100644 --- a/src/Tools/blocFissure/gmu/construitFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/construitFissureGenerale.py @@ -180,7 +180,7 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \ # --- maillage effectif du pipe - (meshPipe, meshPipeGroups, edgesCircPipeGroup) = \ + (meshPipe, edgeFaceFissGroup, edgesCircPipeGroup) = \ construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \ nro_cas) @@ -195,7 +195,7 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \ (meshFaceFiss, _, grpEdgesPeauFissureExterne, _) = \ mailleFacesFissure(faceFissureExterne, \ edgesPipeFissureExterneC, edgesPeauFissureExterneC, \ - meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad, \ + edgeFaceFissGroup, areteFaceFissure, rayonPipe, nbsegRad, \ mailleur, nro_cas) # --- maillage faces de peau diff --git a/src/Tools/blocFissure/gmu/construitMaillagePipe.py b/src/Tools/blocFissure/gmu/construitMaillagePipe.py index 17b570594..77403b4e1 100644 --- a/src/Tools/blocFissure/gmu/construitMaillagePipe.py +++ b/src/Tools/blocFissure/gmu/construitMaillagePipe.py @@ -41,14 +41,12 @@ def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \ meshPipe = smesh.Mesh(None, "meshPipe") putName(meshPipe, "meshPipe", i_pref=nro_cas) + edgesCircPipeGroup = list() + fondFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "FONDFISS") nodesFondFissGroup = meshPipe.CreateEmptyGroup(SMESH.NODE, "nfondfis") faceFissGroup = meshPipe.CreateEmptyGroup(SMESH.FACE, "fisInPi") edgeFaceFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeFaceFiss") - edgeCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe0") - edgeCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe1") - faceCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe0") - faceCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe1") mptdsk = list() # vertices de chaque disque au fur et à mesure mptsdisks = list() # vertices maillage de tous les disques @@ -75,7 +73,7 @@ def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \ construitMaillagePipe_b(idisk, \ idisklim, nbsegCercle, \ meshPipe, mptdsk, \ - edgeCircPipe0Group, edgeCircPipe1Group) + edgesCircPipeGroup) # ----------------------------------------------------------------------- # --- Les groupes des faces débouchantes @@ -83,8 +81,7 @@ def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \ if idisk in (idisklim[0],idisklim[1]): construitMaillagePipe_c(idisk, \ idisklim, nbsegCercle, \ - meshPipe, mptdsk, nbsegRad, \ - faceCircPipe0Group, faceCircPipe1Group) + meshPipe, mptdsk, nbsegRad) # ----------------------------------------------------------------------- # --- mailles volumiques, groupes noeuds et edges de fond de fissure, groupe de face de fissure @@ -100,23 +97,10 @@ def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \ _ = pipeFissGroup.AddFrom( meshPipe.GetMesh() ) _, _, _ = meshPipe.MakeBoundaryElements(SMESH.BND_2DFROM3D, "pipeBoundaries") - edgesCircPipeGroup = [edgeCircPipe0Group, edgeCircPipe1Group] - - meshPipeGroups = dict(fondFissGroup = fondFissGroup, \ - nodesFondFissGroup = nodesFondFissGroup, \ - faceFissGroup = faceFissGroup, \ - edgeFaceFissGroup = edgeFaceFissGroup, \ - edgeCircPipe0Group = edgeCircPipe0Group, \ - edgeCircPipe1Group = edgeCircPipe1Group, \ - faceCircPipe0Group = faceCircPipe0Group, \ - faceCircPipe1Group = faceCircPipe1Group, \ - pipeFissGroup = pipeFissGroup, \ - edgesCircPipeGroup = edgesCircPipeGroup \ - ) #if meshPipe: #text = "Arrêt rapide.\n" #logging.info(text) #raise Exception(text) - return (meshPipe, meshPipeGroups, edgesCircPipeGroup) + return (meshPipe, edgeFaceFissGroup, edgesCircPipeGroup) diff --git a/src/Tools/blocFissure/gmu/construitMaillagePipe_b.py b/src/Tools/blocFissure/gmu/construitMaillagePipe_b.py index b874c493b..76f1d5216 100644 --- a/src/Tools/blocFissure/gmu/construitMaillagePipe_b.py +++ b/src/Tools/blocFissure/gmu/construitMaillagePipe_b.py @@ -19,16 +19,19 @@ # """Les groupes des edges des cercles débouchants""" +import SMESH + def construitMaillagePipe_b(idisk, \ idisklim, nbsegCercle, \ meshPipe, mptdsk, \ - edgeCircPipe0Group, edgeCircPipe1Group): + edgesCircPipeGroup): """Les groupes des edges des cercles débouchants""" #logging.info('start') pts = list() for n_cercle in range(nbsegCercle): pts.append(mptdsk[n_cercle][-1]) + edges = list() nb_pts = len(pts) for n_cercle in range(nb_pts): @@ -37,8 +40,11 @@ def construitMaillagePipe_b(idisk, \ edges.append(id_edge) if idisk == idisklim[0]: - edgeCircPipe0Group.Add(edges) + groupe = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe0") else: - edgeCircPipe1Group.Add(edges) + groupe = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe1") + + groupe.Add(edges) + edgesCircPipeGroup.append(groupe) return diff --git a/src/Tools/blocFissure/gmu/construitMaillagePipe_c.py b/src/Tools/blocFissure/gmu/construitMaillagePipe_c.py index 15eec0e4a..342fbfd79 100644 --- a/src/Tools/blocFissure/gmu/construitMaillagePipe_c.py +++ b/src/Tools/blocFissure/gmu/construitMaillagePipe_c.py @@ -19,10 +19,11 @@ # """Les groupes des faces débouchantes""" +import SMESH + def construitMaillagePipe_c(idisk, \ idisklim, nbsegCercle, \ - meshPipe, mptdsk, nbsegRad, \ - faceCircPipe0Group, faceCircPipe1Group): + meshPipe, mptdsk, nbsegRad): """Les groupes des faces débouchantes""" #logging.info('start') @@ -39,8 +40,10 @@ def construitMaillagePipe_c(idisk, \ faces.append(id_face) if idisk == idisklim[0]: - faceCircPipe0Group.Add(faces) + groupe = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe0") else: - faceCircPipe1Group.Add(faces) + groupe = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe1") + + groupe.Add(faces) return diff --git a/src/Tools/blocFissure/gmu/mailleFacesFissure.py b/src/Tools/blocFissure/gmu/mailleFacesFissure.py index ca14afbd5..0b63cfa9d 100644 --- a/src/Tools/blocFissure/gmu/mailleFacesFissure.py +++ b/src/Tools/blocFissure/gmu/mailleFacesFissure.py @@ -30,7 +30,7 @@ from .putName import putName def mailleFacesFissure(faceFissureExterne, \ edgesPipeFissureExterneC, edgesPeauFissureExterneC, \ - meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad, \ + edgeFaceFissGroup, areteFaceFissure, rayonPipe, nbsegRad, \ mailleur="MeshGems", nro_cas=None): """maillage faces de fissure""" logging.info('start') @@ -62,7 +62,7 @@ def mailleFacesFissure(faceFissureExterne, \ logging.info("UseExisting1DElements depuis '%s'", edgesPipeFissureExterneC.GetName()) algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC) - hypo1d = algo1d.SourceEdges([ meshPipeGroups['edgeFaceFissGroup'] ],0,0) + hypo1d = algo1d.SourceEdges([ edgeFaceFissGroup ],0,0) putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas) putName(algo1d, "algo1d_edgeFissPeau", i_pref=nro_cas) putName(hypo1d, "hypo1d_edgeFissPeau", i_pref=nro_cas) -- 2.39.2