X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTools%2FblocFissure%2Fgmu%2FcreeZoneDefautDansObjetSain.py;h=d3ee3143786bf6eff02812df60fb937237fb1211;hb=8f0082e9d096c07207e1bf9d68488c195abf515a;hp=491b5337854ab2ed8343a953ad54f4b78eb1375f;hpb=385d4cede5f752d0eec26c306f3b5e14511e2a3d;p=modules%2Fsmesh.git diff --git a/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py b/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py index 491b53378..d3ee31437 100644 --- a/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py +++ b/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2014-2019 CEA/DEN, EDF R&D +# Copyright (C) 2014-2021 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 @@ -17,24 +17,27 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +"""TODO: a compléter""" + +import os import logging -from .geomsmesh import smesh import SMESH import SALOMEDS +from .geomsmesh import smesh + from .creeZoneDefautMaillage import creeZoneDefautMaillage from .peauInterne import peauInterne from .quadranglesToShapeNoCorner import quadranglesToShapeNoCorner from .creeZoneDefautFilling import creeZoneDefautFilling from .creeZoneDefautGeom import creeZoneDefautGeom from .getCentreFondFiss import getCentreFondFiss +from .putName import putName -# ----------------------------------------------------------------------------- -# --- - -def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, - shapeFissureParams, maillageFissureParams): +def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, \ + shapeFissureParams, maillageFissureParams, \ + nro_cas=None): """ #TODO: a compléter """ @@ -62,12 +65,11 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, nomRep = maillageFissureParams['nomRep'] nomFicSain = maillageFissureParams['nomFicSain'] - fichierMaillageSain = nomRep + '/' + nomFicSain + '.med' - + fichierMaillageSain = os.path.join (nomRep , '{}.med'.format(nomFicSain)) + # --- centre de fond de fissure et tangente - + edgeFondExt, centreFondFiss, tgtCentre = getCentreFondFiss(shapesFissure) - # --- zone de défaut nomZones = "zoneDefaut" @@ -78,18 +80,20 @@ 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 = [] - centresDefaut = [] - normalsDefaut =[] - extrusionsDefaut = [] + facesDefaut = list() + centresDefaut = list() + normalsDefaut = list() + extrusionsDefaut = list() isPlane = False if isHexa and not isPlane: meshQuad = smesh.CopyMesh( zoneDefaut_skin, 'meshQuad', 0, 0) - - fillings, noeuds_bords, bordsPartages, fillconts, idFilToCont = quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss) - + putName(meshQuad, "meshQuad", i_pref=nro_cas) + + fillings, _, bordsPartages, fillconts, idFilToCont = quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss) + for filling in fillings: [faceDefaut, centreDefaut, normalDefaut, extrusionDefaut] = \ creeZoneDefautFilling(filling, shapeDefaut, lgExtrusion) @@ -99,14 +103,15 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, extrusionsDefaut.append(extrusionDefaut) else: [facesDefaut, centreDefaut, normalDefaut, extrusionDefaut] = \ - creeZoneDefautGeom( geometrieSaine, shapeDefaut, origShapes, verticesShapes, dmoyen, lgExtrusion) - bordsPartages = [] - for face in facesDefaut: + creeZoneDefautGeom( geometrieSaine, shapeDefaut, origShapes, verticesShapes, lgExtrusion) + bordsPartages = list() + for _ in facesDefaut: bordsPartages.append([None,None]) # TODO : traitement des arêtes vives ? fillconts = facesDefaut idFilToCont = list(range(len(facesDefaut))) - return [facesDefaut, centresDefaut, normalsDefaut, extrusionsDefaut, dmoyen, bordsPartages, fillconts, idFilToCont, - maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges, + return [facesDefaut, centresDefaut, normalsDefaut, extrusionsDefaut, \ + dmoyen, bordsPartages, fillconts, idFilToCont, \ + maillageSain, internalBoundary, \ + zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges, \ edgeFondExt, centreFondFiss, tgtCentre] -