X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTools%2FblocFissure%2Fgmu%2FmailleFacesPeau.py;h=f3486985ea094fcff4880e3ed5ea50aeb53f29c7;hb=29bbad62170237fc335c66099a41f2a81ef7cd51;hp=a9e18c38420330f2cc83911f236d368180616e89;hpb=6d32f944a0a115b6419184c50b57bf7c4eef5786;p=modules%2Fsmesh.git diff --git a/src/Tools/blocFissure/gmu/mailleFacesPeau.py b/src/Tools/blocFissure/gmu/mailleFacesPeau.py index a9e18c384..f3486985e 100644 --- a/src/Tools/blocFissure/gmu/mailleFacesPeau.py +++ b/src/Tools/blocFissure/gmu/mailleFacesPeau.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2014-2019 CEA/DEN, EDF R&D +# 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 @@ -18,6 +18,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +"""maillage faces de peau""" + import logging from .geomsmesh import geompy @@ -34,18 +36,17 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad): - """ - maillage faces de peau - """ + """maillage faces de peau""" logging.info('start') nbFacesFilling = len(partitionsPeauFissFond) boutFromIfil = [None for i in range(nbFacesFilling)] if idFillingFromBout[0] != idFillingFromBout[1]: # repérage des extremites du pipe quand elles débouchent sur des faces différentes boutFromIfil[idFillingFromBout[0]] = 0 boutFromIfil[idFillingFromBout[1]] = 1 - - logging.debug("---------------------------- maillage faces de peau --------------") - meshesFacesPeau = [] + + logging.info("---------------------------- maillage faces de peau --------------") + logging.info("nbFacesFilling = %d", nbFacesFilling) + meshesFacesPeau = list() for ifil in range(nbFacesFilling): meshFacePeau = None if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte @@ -57,18 +58,18 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"]) geompy.UnionList(groupEdgesBordPeau, edgesFilling) geomPublishInFather(initLog.debug,filling, groupEdgesBordPeau , "EdgesBords") - + meshFacePeau = smesh.Mesh(facesDefaut[ifil]) - + algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) putName(algo1d.GetSubMesh(), "bordsLibres", ifil) putName(algo1d, "algo1d_bordsLibres", ifil) putName(hypo1d, "hypo1d_bordsLibres", ifil) - + else: - - logging.debug("meshFacePeau %d coupée par la fissure", ifil) + + logging.info("meshFacePeau %d coupée par la fissure", ifil) facePeau = facesPeaux[ifil] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes) edgesCircPeau = edCircPeau[ifil] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe] verticesCircPeau = ptCircPeau[ifil] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe] @@ -76,28 +77,32 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, bordsVifs = gpedgeVifs[ifil] # pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives edgesFissurePeau = edFissPeau[ifil] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes] + print ("a") meshFacePeau = smesh.Mesh(facePeau) - + algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) putName(algo1d.GetSubMesh(), "bordsLibres", ifil) putName(algo1d, "algo1d_bordsLibres", ifil) putName(hypo1d, "hypo1d_bordsLibres", ifil) - + + print ("b") algo1d = meshFacePeau.UseExisting1DElements(geom=geompy.MakeCompound(edgesFissurePeau)) hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0) putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil) putName(algo1d, "algo1d_edgePeauFiss", ifil) putName(hypo1d, "hypo1d_edgePeauFiss", ifil) - + + print ("bordsVifs = {}".format(bordsVifs)) if bordsVifs is not None: algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs) hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0) putName(algo1d.GetSubMesh(), "bordsVifs", ifil) putName(algo1d, "algo1d_bordsVifs", ifil) putName(hypo1d, "hypo1d_bordsVifs", ifil) - + for i, edgeCirc in enumerate(edgesCircPeau): + print ("i = {}".format(i)) if edgeCirc is not None: algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc) if boutFromIfil[ifil] is None: @@ -108,7 +113,8 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, putName(algo1d.GetSubMesh(), name, ifil) putName(algo1d, "algo1d_" + name, ifil) putName(hypo1d, "hypo1d_" + name, ifil) - + + print ("c") algo2d = meshFacePeau.Triangle(algo=smeshBuilder.NETGEN_1D2D) hypo2d = algo2d.Parameters() hypo2d.SetMaxSize( dmoyen ) @@ -116,14 +122,22 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, hypo2d.SetFineness( 2 ) hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) hypo2d.SetQuadAllowed( 0 ) + print ("d") putName(algo2d.GetSubMesh(), "facePeau", ifil) putName(algo2d, "algo2d_facePeau", ifil) putName(hypo2d, "hypo2d_facePeau", ifil) - - isDone = meshFacePeau.Compute() - logging.info("meshFacePeau %d fini", ifil) + + is_done = meshFacePeau.Compute() + text = "meshFacePeau {} .Compute".format(ifil) + if is_done: + logging.info(text+" OK") + else: + text = "Erreur au calcul du maillage.\n" + text + logging.info(text) + raise Exception(text) + GroupFaces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil ) nbAdd = GroupFaces.AddFrom( meshFacePeau.GetMesh() ) meshesFacesPeau.append(meshFacePeau) - return meshesFacesPeau \ No newline at end of file + return meshesFacesPeau