X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTools%2FblocFissure%2Fgmu%2FconstruitFissureGenerale.py;h=9637bab8d020ad5d95923c9d107cf7bb1681b1bb;hb=0fc0831670e27a5611b941c52dc152fd63964515;hp=f6858132f469a8aaec7bb8b1a8e771f69bf1b61e;hpb=106415d543316ec2bcd80c173da165c9b8baa084;p=modules%2Fsmesh.git diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale.py b/src/Tools/blocFissure/gmu/construitFissureGenerale.py index f6858132f..9637bab8d 100644 --- a/src/Tools/blocFissure/gmu/construitFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/construitFissureGenerale.py @@ -1,14 +1,36 @@ # -*- coding: utf-8 -*- +# Copyright (C) 2014-2020 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# import logging import salome -from geomsmesh import geompy +from .geomsmesh import geompy +from .geomsmesh import geomPublish +from .geomsmesh import geomPublishInFather +from . import initLog import GEOM -from geomsmesh import smesh +from .geomsmesh import smesh from salome.smesh import smeshBuilder import SMESH import math import bisect +import traceback # from extractionOrientee import extractionOrientee # from extractionOrienteeMulti import extractionOrienteeMulti @@ -19,35 +41,36 @@ import bisect # from produitMixte import produitMixte # from findWireEndVertices import findWireEndVertices #from findWireIntermediateVertices import findWireIntermediateVertices -from orderEdgesFromWire import orderEdgesFromWire +from .orderEdgesFromWire import orderEdgesFromWire # from getSubshapeIds import getSubshapeIds -from putName import putName +from .putName import putName # from distance2 import distance2 -from enleveDefaut import enleveDefaut -from shapeSurFissure import shapeSurFissure -from regroupeSainEtDefaut import RegroupeSainEtDefaut -from triedreBase import triedreBase +from .enleveDefaut import enleveDefaut +from .shapeSurFissure import shapeSurFissure +from .regroupeSainEtDefaut import RegroupeSainEtDefaut +from .triedreBase import triedreBase # from checkDecoupePartition import checkDecoupePartition # from whichSide import whichSide # from whichSideMulti import whichSideMulti #from whichSideVertex import whichSideVertex #from projettePointSurCourbe import projettePointSurCourbe # from prolongeWire import prolongeWire -from restreintFaceFissure import restreintFaceFissure -from partitionneFissureParPipe import partitionneFissureParPipe -from construitPartitionsPeauFissure import construitPartitionsPeauFissure -from compoundFromList import compoundFromList -from identifieElementsGeometriquesPeau import identifieElementsGeometriquesPeau -from identifieFacesEdgesFissureExterne import identifieFacesEdgesFissureExterne -from calculePointsAxiauxPipe import calculePointsAxiauxPipe -from elimineExtremitesPipe import elimineExtremitesPipe -from construitEdgesRadialesDebouchantes import construitEdgesRadialesDebouchantes -from creePointsPipePeau import creePointsPipePeau -from ajustePointsEdgePipeFissure import ajustePointsEdgePipeFissure -from construitMaillagePipe import construitMaillagePipe -from mailleAretesEtJonction import mailleAretesEtJonction -from mailleFacesFissure import mailleFacesFissure -from mailleFacesPeau import mailleFacesPeau +from .restreintFaceFissure import restreintFaceFissure +from .partitionneFissureParPipe import partitionneFissureParPipe +from .construitPartitionsPeauFissure import construitPartitionsPeauFissure +from .compoundFromList import compoundFromList +from .identifieElementsGeometriquesPeau import identifieElementsGeometriquesPeau +from .identifieFacesEdgesFissureExterne import identifieFacesEdgesFissureExterne +from .calculePointsAxiauxPipe import calculePointsAxiauxPipe +from .elimineExtremitesPipe import elimineExtremitesPipe +from .construitEdgesRadialesDebouchantes import construitEdgesRadialesDebouchantes +from .creePointsPipePeau import creePointsPipePeau +from .ajustePointsEdgePipeFissure import ajustePointsEdgePipeFissure +from .construitMaillagePipe import construitMaillagePipe +from .mailleAretesEtJonction import mailleAretesEtJonction +from .mailleFacesFissure import mailleFacesFissure +from .mailleFacesPeau import mailleFacesPeau +from .fissError import fissError # ----------------------------------------------------------------------------- # --- procédure complète fissure générale @@ -64,7 +87,7 @@ def construitFissureGenerale(maillagesSains, fondFiss = shapesFissure[4] # groupe d'edges de fond de fissure rayonPipe = shapeFissureParams['rayonPipe'] - if shapeFissureParams.has_key('lenSegPipe'): + if 'lenSegPipe' in shapeFissureParams: lenSegPipe = shapeFissureParams['lenSegPipe'] else: lenSegPipe = rayonPipe @@ -76,18 +99,21 @@ def construitFissureGenerale(maillagesSains, nbsegRad = maillageFissureParams['nbsegRad'] # nombre de couches selon un rayon du pipe nbsegCercle = maillageFissureParams['nbsegCercle'] # nombre de secteur dans un cercle du pipe areteFaceFissure = maillageFissureParams['areteFaceFissure'] + lgAretesVives = 0 + if 'aretesVives' in maillageFissureParams: + lgAretesVives = maillageFissureParams['aretesVives'] pointIn_x = 0.0 pointIn_y = 0.0 pointIn_z = 0.0 isPointInterne = False - if shapeFissureParams.has_key('pointIn_x'): + if 'pointIn_x' in shapeFissureParams: pointIn_x = shapeFissureParams['pointIn_x'] isPointInterne = True - if shapeFissureParams.has_key('pointIn_y'): + if 'pointIn_y' in shapeFissureParams: pointIn_y = shapeFissureParams['pointIn_y'] isPointInterne = True - if shapeFissureParams.has_key('pointIn_z'): + if 'pointIn_z' in shapeFissureParams: pointIn_z = shapeFissureParams['pointIn_z'] isPointInterne = True if isPointInterne: @@ -116,6 +142,9 @@ def construitFissureGenerale(maillagesSains, #edgeFondExt = elementsDefaut[14] centreFondFiss = elementsDefaut[15] #tgtCentre = elementsDefaut[16] + if lgAretesVives == 0: + lgAretesVives = dmoyen + O, OX, OY, OZ = triedreBase() @@ -130,7 +159,7 @@ def construitFissureGenerale(maillagesSains, (fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss) = partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe) edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss) for i,edge in enumerate(edgesFondFiss): - geompy.addToStudyInFather(wireFondFiss, edge, "edgeFondFiss%d"%i) + geomPublishInFather(initLog.debug, wireFondFiss, edge, "edgeFondFiss%d"%i) # --- peau et face de fissure # @@ -154,8 +183,8 @@ def construitFissureGenerale(maillagesSains, nbFacesFilling = len(partitionsPeauFissFond) ptEdgeFond = [ [] for i in range(nbFacesFilling)] # pour chaque face [points edge fond de fissure aux débouchés du pipe] - facesPipePeau = [ [] for i in range(nbFacesFilling)] # pour chaque face [faces du pipe débouchantes] - edgeRadFacePipePeau = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge radiale des faces du pipe débouchantes ] + fsPipePeau = [ [] for i in range(nbFacesFilling)] # pour chaque face [faces du pipe débouchantes] + edRadFPiPo = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge radiale des faces du pipe débouchantes ] fsFissuExt = [ [] for i in range(nbFacesFilling)] # pour chaque face [faces de fissure externes au pipe] edFisExtPe = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge en peau des faces de fissure externes (pas subshape facePeau)] edFisExtPi = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge commun au pipe des faces de fissure externes] @@ -174,8 +203,8 @@ def construitFissureGenerale(maillagesSains, facesDefaut, centreFondFiss, rayonPipe, aretesVivesCoupees) ptEdgeFond[ifil] = dataPPFF['endsEdgeFond'] - facesPipePeau[ifil] = dataPPFF['facesPipePeau'] - edgeRadFacePipePeau[ifil] = dataPPFF['edgeRadFacePipePeau'] + fsPipePeau[ifil] = dataPPFF['facesPipePeau'] + edRadFPiPo[ifil] = dataPPFF['edgeRadFacePipePeau'] fsFissuExt[ifil] = dataPPFF['facesFissExt'] edFisExtPe[ifil] = dataPPFF['edgesFissExtPeau'] edFisExtPi[ifil] = dataPPFF['edgesFissExtPipe'] @@ -187,10 +216,15 @@ def construitFissureGenerale(maillagesSains, edFissPeau[ifil] = dataPPFF['edgesFissurePeau'] ptFisExtPi[ifil] = dataPPFF['verticesPipePeau'] + facesPipePeau = [] + edgeRadFacePipePeau = [] + for ifil in range(nbFacesFilling): + facesPipePeau += fsPipePeau[ifil] + edgeRadFacePipePeau += edRadFPiPo[ifil] for i, avc in enumerate(aretesVivesCoupees): name = "areteViveCoupee%d"%i - geompy.addToStudy(avc, name) + geomPublish(initLog.debug, avc, name) # --- identification des faces et edges de fissure externe pour maillage @@ -236,7 +270,7 @@ def construitFissureGenerale(maillagesSains, # --- edges de bord, faces défaut à respecter - (internalBoundary, bordsLibres, grpAretesVives) = mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, dmoyen) + (internalBoundary, bordsLibres, grpAretesVives) = mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, lgAretesVives) # --- maillage faces de fissure @@ -312,12 +346,12 @@ def construitFissureGenerale(maillagesSains, fond = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FACE2' ) logging.info("export maillage fini") - maillageComplet.ExportMED( fichierMaillageFissure, 0, SMESH.MED_V2_2, 1 ) + maillageComplet.ExportMED(fichierMaillageFissure) putName(maillageComplet, nomFicFissure) logging.info("fichier maillage fissure %s", fichierMaillageFissure) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() logging.info("maillage fissure fini")