From a3c14d1977b0bc22c807f135866e6e8c7345b38f Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 8 Apr 2021 15:17:28 +0200 Subject: [PATCH 01/13] Noms des algorithmes --- .../blocFissure/CasTests/fissure_Coude.py | 4 ++-- .../gmu/construitFissureGenerale_c.py | 2 +- src/Tools/blocFissure/gmu/fissureCoude.py | 4 ++-- .../gmu/genereMeshCalculZoneDefaut.py | 2 +- .../blocFissure/gmu/insereFissureLongue_c.py | 6 +++--- .../blocFissure/gmu/insereFissureLongue_d.py | 2 +- .../blocFissure/gmu/insereFissureLongue_e.py | 2 +- .../blocFissure/gmu/insereFissureLongue_f.py | 2 +- .../blocFissure/gmu/mailleFacesFissure.py | 3 ++- src/Tools/blocFissure/gmu/meshBlocPart.py | 18 +++++++++--------- 10 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/fissure_Coude.py b/src/Tools/blocFissure/CasTests/fissure_Coude.py index 2201f1e39..52c6a6b2e 100644 --- a/src/Tools/blocFissure/CasTests/fissure_Coude.py +++ b/src/Tools/blocFissure/CasTests/fissure_Coude.py @@ -233,8 +233,8 @@ class fissure_Coude(fissureGenerique): algo3d = maillageSain.Hexahedron() algo2d = maillageSain.Quadrangle() - putName(algo3d, "algo3d_maillageSain", i_pref=self.numeroCas) - putName(algo2d, "algo2d_maillageSain", i_pref=self.numeroCas) + putName(algo3d, "{}_3d_maillageSain".format(self.mailleur), i_pref=self.numeroCas) + putName(algo2d, "{}_2d_maillageSain".format(self.mailleur), i_pref=self.numeroCas) algo1d_long_p1 = maillageSain.Segment(geom=long_p1) hypo1d_long_p1 = algo1d_long_p1.NumberOfSegments(n_long_p1) diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale_c.py b/src/Tools/blocFissure/gmu/construitFissureGenerale_c.py index 73824d621..4143dc3c1 100644 --- a/src/Tools/blocFissure/gmu/construitFissureGenerale_c.py +++ b/src/Tools/blocFissure/gmu/construitFissureGenerale_c.py @@ -78,7 +78,7 @@ def construitFissureGenerale_c(maillageSain, meshBoiteDefaut, \ hypo3d.SetStandardOutputLog( 0 ) hypo3d.SetRemoveLogOnSuccess( 1 ) putName(algo3d.GetSubMesh(), "boiteDefaut", i_pref=nro_cas) - putName(algo3d, "algo3d_boiteDefaut", i_pref=nro_cas) + putName(algo3d, "{}_3d_boiteDefaut".format(mailleur), i_pref=nro_cas) is_done = meshBoiteDefaut.Compute() text = "meshBoiteDefaut.Compute" diff --git a/src/Tools/blocFissure/gmu/fissureCoude.py b/src/Tools/blocFissure/gmu/fissureCoude.py index 00f7fb399..c8b70cf79 100644 --- a/src/Tools/blocFissure/gmu/fissureCoude.py +++ b/src/Tools/blocFissure/gmu/fissureCoude.py @@ -263,8 +263,8 @@ class fissureCoude(fissureGenerique): algo3d = maillageSain.Hexahedron() algo2d = maillageSain.Quadrangle() - putName(algo3d, "algo3d_maillageSain", i_pref=self.numeroCas) - putName(algo2d, "algo2d_maillageSain", i_pref=self.numeroCas) + putName(algo3d, "{}_3d_maillageSain".format(self.mailleur2d3d()), i_pref=self.numeroCas) + putName(algo2d, "{}_2d_maillageSain".format(self.mailleur2d3d()), i_pref=self.numeroCas) algo1d_long_p1 = maillageSain.Segment(geom=long_p1) hypo1d_long_p1 = algo1d_long_p1.NumberOfSegments(n_long_p1) diff --git a/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py b/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py index 729ace6c1..f245e9c8e 100644 --- a/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py +++ b/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py @@ -76,7 +76,7 @@ def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize, \ hypo2d.SetFineness( 2 ) hypo2d.SetMinSize( minSize ) hypo2d.SetQuadAllowed( 0 ) - putName(algo2d, "algo2d_zoneFiss", i_pref=nro_cas) + putName(algo2d, "{}_2d_zoneFiss".format(mailleur), i_pref=nro_cas) putName(hypo2d, "hypo1d_zoneFiss", i_pref=nro_cas) is_done = meshFissure.Compute() diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_c.py b/src/Tools/blocFissure/gmu/insereFissureLongue_c.py index 12680a089..040f5a12f 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_c.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_c.py @@ -48,13 +48,13 @@ def insereFissureLongue_c (pipeFondFiss, disques, rayons, demiCercles, demiCercl algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.QUADRANGLE) algo3d = meshFondFiss.Prism() putName(algo3d.GetSubMesh(), "pipe", i_pref=nro_cas) - putName(algo3d, "algo3d_pipe", i_pref=nro_cas) - putName(algo2d, "algo2d_pipe", i_pref=nro_cas) + putName(algo3d, "{}_3d_pipe".format(mailleur), i_pref=nro_cas) + putName(algo2d, "{}_2d_pipe".format(mailleur), i_pref=nro_cas) for i_aux, face in enumerate(disques): algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.RADIAL_QUAD,geom=face) putName(algo2d.GetSubMesh(), "disque", i_aux, nro_cas) - putName(algo2d, "algo2d_disque", i_aux, nro_cas) + putName(algo2d, "{}_2d_disque".format(mailleur), i_aux, nro_cas) for i_aux, edge in enumerate(rayons): algo1d = meshFondFiss.Segment(geom=edge) diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_d.py b/src/Tools/blocFissure/gmu/insereFissureLongue_d.py index 6a61f6f07..394012b7c 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_d.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_d.py @@ -58,7 +58,7 @@ def insereFissureLongue_d (facePeau, edgePeauFiss, groupEdgesBordPeau, bordsLibr hypo2d.SetMinSize( 2 ) hypo2d.SetQuadAllowed( 0 ) putName(algo2d.GetSubMesh(), "facePeau", i_pref=nro_cas) - putName(algo2d, "algo2d_facePeau", i_pref=nro_cas) + putName(algo2d, "{}_2d_facePeau".format(mailleur), i_pref=nro_cas) putName(hypo2d, "hypo2d_facePeau", i_pref=nro_cas) # lenEdgePeauFiss = geompy.BasicProperties(edgePeauFiss)[0] diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_e.py b/src/Tools/blocFissure/gmu/insereFissureLongue_e.py index bbc289ab7..34e9592b1 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_e.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_e.py @@ -58,7 +58,7 @@ def insereFissureLongue_e (faceFiss, edgePeauFiss, groupEdgesPeauFiss, group_gen hypo2d.SetMinSize( 2 ) hypo2d.SetQuadAllowed( 0 ) putName(algo2d.GetSubMesh(), "faceFiss", i_pref=nro_cas) - putName(algo2d, "algo2d_faceFiss", i_pref=nro_cas) + putName(algo2d, "{}_2d_faceFiss".format(mailleur), i_pref=nro_cas) putName(hypo2d, "hypo2d_faceFiss", i_pref=nro_cas) # algo1d = meshFaceFiss.UseExisting1DElements(geom=edgePeauFiss) diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_f.py b/src/Tools/blocFissure/gmu/insereFissureLongue_f.py index 564cc88b9..c2891d1f3 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_f.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_f.py @@ -66,7 +66,7 @@ def insereFissureLongue_f (internalBoundary, meshFondFiss, meshFacePeau, meshFac hypo3d.SetStandardOutputLog( 0 ) hypo3d.SetRemoveLogOnSuccess( 1 ) putName(algo3d.GetSubMesh(), "boiteDefaut", i_pref=nro_cas) - putName(algo3d, "algo3d_boiteDefaut", i_pref=nro_cas) + putName(algo3d, "{}_3d_boiteDefaut".format(mailleur), i_pref=nro_cas) putName(meshBoiteDefaut, "boiteDefaut", i_pref=nro_cas) is_done = meshBoiteDefaut.Compute() diff --git a/src/Tools/blocFissure/gmu/mailleFacesFissure.py b/src/Tools/blocFissure/gmu/mailleFacesFissure.py index 450309351..e4f86fcdd 100644 --- a/src/Tools/blocFissure/gmu/mailleFacesFissure.py +++ b/src/Tools/blocFissure/gmu/mailleFacesFissure.py @@ -54,9 +54,10 @@ def mailleFacesFissure(faceFissureExterne, \ hypo2d.SetOptimize( 1 ) hypo2d.SetFineness( 2 ) hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) + hypo2d.SetChordalError( areteFaceFissure*0.25 ) hypo2d.SetQuadAllowed( 0 ) putName(algo2d.GetSubMesh(), "faceFiss", i_pref=nro_cas) - putName(algo2d, "algo2d_faceFiss", i_pref=nro_cas) + putName(algo2d, "{}_2d_faceFiss".format(mailleur), i_pref=nro_cas) putName(hypo2d, "hypo2d_faceFiss", i_pref=nro_cas) texte = "Récupération des arêtes de '{}'".format(edgesPipeFissureExterneC.GetName()) diff --git a/src/Tools/blocFissure/gmu/meshBlocPart.py b/src/Tools/blocFissure/gmu/meshBlocPart.py index c97920cdd..9d399c60b 100644 --- a/src/Tools/blocFissure/gmu/meshBlocPart.py +++ b/src/Tools/blocFissure/gmu/meshBlocPart.py @@ -63,7 +63,7 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle hypo2d.LengthFromEdges() hypo2d.SetAllowQuadrangles(0) putName(algo2d.GetSubMesh(), "sharedFaces", i_aux, nro_cas) - putName(algo2d, "algo2d_sharedFaces", i_aux, nro_cas) + putName(algo2d, "{}_2d_sharedFaces".format(mailleur), i_aux, nro_cas) putName(hypo2d, "hypo2d_sharedFaces", i_aux, nro_cas) for i_aux, sharedEdges_i in enumerate(sharedEdges): @@ -78,7 +78,7 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep) hypo3d = algo3d.MaxElementVolume(1000.0) putName(algo3d.GetSubMesh(), "ellipsoide", i_pref=nro_cas) - putName(algo3d, "algo3d_ellipsoide", i_pref=nro_cas) + putName(algo3d, "{}_3d_ellipsoide".format(mailleur), i_pref=nro_cas) putName(hypo3d, "hypo3d_ellipsoide", i_pref=nro_cas) algo3d = bloc1.Prism(geom=tore) @@ -86,8 +86,8 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle algo1d = bloc1.Segment(geom=tore) hypo1d = algo1d.NumberOfSegments(nbsegGen) putName(algo3d.GetSubMesh(), "tore", i_pref=nro_cas) - putName(algo3d, "algo3d_tore", i_pref=nro_cas) - putName(algo2d, "algo2d_tore", i_pref=nro_cas) + putName(algo3d, "{}_3d_tore".format(mailleur), i_pref=nro_cas) + putName(algo2d, "{}_2d_tore".format(mailleur), i_pref=nro_cas) putName(algo1d, "algo1d_tore", i_pref=nro_cas) putName(hypo1d, "hypo1d_tore", i_pref=nro_cas) @@ -98,7 +98,7 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle hypo2d.SetQuadType( StdMeshersBuilder.QUAD_STANDARD ) _ = bloc1.AddHypothesis(hypo2d,faces_i) putName(algo2d.GetSubMesh(), "faces", i_aux, nro_cas) - putName(algo2d, "algo2d_faces", i_aux, nro_cas) + putName(algo2d, "{}_2d_faces".format(mailleur), i_aux, nro_cas) putName(hypo2d, "hypo2d_faces", i_aux, nro_cas) for i_aux, edges_i in enumerate(edges): @@ -152,7 +152,7 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN_2D, geom=facefissoutore) hypo2d = algo2d.LengthFromEdges() putName(algo2d.GetSubMesh(), "facefissoutore", i_pref=nro_cas) - putName(algo2d, "algo2d_facefissoutore", i_pref=nro_cas) + putName(algo2d, "{}_2d_facefissoutore".format(mailleur), i_pref=nro_cas) putName(hypo2d, "hypo2d_facefissoutore", i_pref=nro_cas) @@ -166,7 +166,7 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle algo1d = bloc1.Segment(geom=facesExternes_i) hypo1d = algo1d.NumberOfSegments(1) putName(algo2d.GetSubMesh(), "facesExternes", i_aux, nro_cas) - putName(algo2d, "algo2d_facesExternes", i_aux, nro_cas) + putName(algo2d, "{}2d_facesExternes".format(mailleur), i_aux, nro_cas) putName(hypo2d, "hypo2d_facesExternes", i_aux, nro_cas) if edgesBords is None: putName(algo1d, "algo1d_facesExternes", i_aux, nro_cas) @@ -190,7 +190,7 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep) hypo3d = algo3d.MaxElementVolume(1000.0) putName(algo3d.GetSubMesh(), "ellipsoide", i_pref=nro_cas) - putName(algo3d, "algo3d_ellipsoide", i_pref=nro_cas) + putName(algo3d, "{}_3d_ellipsoide".format(mailleur), i_pref=nro_cas) putName(hypo3d, "hypo3d_ellipsoide", i_pref=nro_cas) _ = bloc1.GroupOnGeom(faceFissure,'FACE1',SMESH.FACE) @@ -232,7 +232,7 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle algo3d = blocMesh.Tetrahedron(algo=smeshBuilder.NETGEN) hypo3d = algo3d.MaxElementVolume(1000.0) putName(algo3d.GetSubMesh(), "bloc", i_pref=nro_cas) - putName(algo3d, "algo3d_bloc", i_pref=nro_cas) + putName(algo3d, "{}_3d_bloc".format(mailleur), i_pref=nro_cas) putName(hypo3d, "hypo3d_bloc", i_pref=nro_cas) is_done = blocMesh.Compute() From a4dc6572e534f22848d62e9a739877ea25b9a050 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 8 Apr 2021 16:16:13 +0200 Subject: [PATCH 02/13] =?UTF-8?q?addtostudy=20syst=C3=A9matique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../blocFissure/gmu/identifieEdgesPeau.py | 9 +- .../blocFissure/gmu/identifieEdgesPeau_a.py | 11 +- .../blocFissure/gmu/identifieEdgesPeau_b.py | 11 +- .../gmu/identifieElementsGeometriquesPeau.py | 3 +- .../blocFissure/gmu/mailleFacesFissure.py | 3 +- src/Tools/blocFissure/gmu/mailleFacesPeau.py | 146 ++++++++++-------- 6 files changed, 100 insertions(+), 83 deletions(-) diff --git a/src/Tools/blocFissure/gmu/identifieEdgesPeau.py b/src/Tools/blocFissure/gmu/identifieEdgesPeau.py index 27b316ce2..ca1972af5 100644 --- a/src/Tools/blocFissure/gmu/identifieEdgesPeau.py +++ b/src/Tools/blocFissure/gmu/identifieEdgesPeau.py @@ -26,7 +26,8 @@ from .identifieEdgesPeau_b import identifieEdgesPeau_b from .identifieEdgesPeau_c import identifieEdgesPeau_c def identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSorted, \ - edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees): + edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees, \ + nro_cas=None): """Identification précise des edges et disques des faces de peau selon index extremité fissure""" logging.info('start') @@ -38,7 +39,8 @@ def identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSo if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau edgesCircPeau, verticesCircPeau = identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauFondIn, \ - endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesListees) + endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesListees, \ + nro_cas) else: edgesCircPeau = list() verticesCircPeau = list() @@ -47,7 +49,8 @@ def identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSo # --- edges de bord de la face de peau groupEdgesBordPeau, bordsVifs = identifieEdgesPeau_b(facePeau, edgesListees, \ - fillingFaceExterne, aretesVivesC, aretesVivesCoupees) + fillingFaceExterne, aretesVivesC, aretesVivesCoupees, \ + nro_cas) # --- edges de la face de peau partagées avec la face de fissure diff --git a/src/Tools/blocFissure/gmu/identifieEdgesPeau_a.py b/src/Tools/blocFissure/gmu/identifieEdgesPeau_a.py index fc872a45a..1f10ceb5e 100644 --- a/src/Tools/blocFissure/gmu/identifieEdgesPeau_a.py +++ b/src/Tools/blocFissure/gmu/identifieEdgesPeau_a.py @@ -28,7 +28,8 @@ from .geomsmesh import geomPublish from .geomsmesh import geomPublishInFather def identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauFondIn, \ - endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesListees): + endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesListees, \ + nro_cas=None): """Identification précise des edges et disques des faces de peau selon index extremité fissure""" logging.info('start') @@ -48,13 +49,13 @@ def identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauF nameEdge = "edgeRadFacePipePeau{}".format(i_aux) facesPipePeau[i_aux] = face endsEdgeFond[i_aux] = sharedVertices[0] - geomPublish(initLog.debug, face, nameFace) - geomPublish(initLog.debug, sharedVertices[0], nameVert) + geomPublish(initLog.debug, face, nameFace, nro_cas) + geomPublish(initLog.debug, sharedVertices[0], nameVert, nro_cas) edgesFace = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True) for edge in edgesFace: if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3: edgeRadFacePipePeau[i_aux] = edge - geomPublish(initLog.debug, edge, nameEdge) + geomPublish(initLog.debug, edge, nameEdge, nro_cas) break # --- edges circulaires de la face de peau et points de jonction de la face externe de fissure @@ -67,7 +68,7 @@ def identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauF geompy.UnionList(grpEdgesCirc, edges) edgesCircPeau[i_aux] = grpEdgesCirc name = "edgeCirc{}".format(i_aux) - geomPublishInFather(initLog.debug, facePeau, grpEdgesCirc, name) + geomPublishInFather(initLog.always, facePeau, grpEdgesCirc, name) edgesListees = edgesListees + edges vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"]) grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"]) diff --git a/src/Tools/blocFissure/gmu/identifieEdgesPeau_b.py b/src/Tools/blocFissure/gmu/identifieEdgesPeau_b.py index a166a7517..df79b8b1e 100644 --- a/src/Tools/blocFissure/gmu/identifieEdgesPeau_b.py +++ b/src/Tools/blocFissure/gmu/identifieEdgesPeau_b.py @@ -27,15 +27,16 @@ from .geomsmesh import geompy from .geomsmesh import geomPublishInFather def identifieEdgesPeau_b(facePeau, edgesListees, \ - fillingFaceExterne, aretesVivesC, aretesVivesCoupees): + fillingFaceExterne, aretesVivesC, aretesVivesCoupees, \ + nro_cas=None): """edges de bord de la face de peau""" logging.info('start') edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False) edgesBords = list() - for i, edge in enumerate(edgesFilling): + for i_aux, edge in enumerate(edgesFilling): edgepeau = geompy.GetInPlace(facePeau, edge) - name = "edgepeau%d"%i + name = "edgepeau{}".format(i_aux) geomPublishInFather(initLog.debug, facePeau,edgepeau, name) logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau)) if geompy.ShapeInfo(edgepeau)['EDGE'] > 1: @@ -74,7 +75,7 @@ def identifieEdgesPeau_b(facePeau, edgesListees, \ geompy.AddObject(bordsVifs, geompy.GetSubShapeID(facePeau, edge)) if bordsVifs is not None: - geomPublishInFather(initLog.debug, facePeau, bordsVifs, "bordsVifs") + geomPublishInFather(initLog.always, facePeau, bordsVifs, "bordsVifs") groupEdgesBordPeau = geompy.CutGroups(groupEdgesBordPeau, bordsVifs) grptmp = None if len(aretesVivesCoupees) > 0: @@ -89,6 +90,6 @@ def identifieEdgesPeau_b(facePeau, edgesListees, \ aretesVivesCoupees += edv logging.debug("aretesVivesCoupees %s",aretesVivesCoupees) - geomPublishInFather(initLog.debug, facePeau, groupEdgesBordPeau , "EdgesBords") + geomPublishInFather(initLog.always, facePeau, groupEdgesBordPeau , "EdgesBords") return groupEdgesBordPeau, bordsVifs diff --git a/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py b/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py index e507fa3ff..e585993b7 100644 --- a/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py +++ b/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py @@ -72,7 +72,8 @@ def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesCircPeau, verticesCircPeau, groupEdgesBordPeau, \ bordsVifs, edgesFissurePeau, aretesVivesCoupees) = \ identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSorted, \ - edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees) + edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees, \ + nro_cas) dataPPFF = dict(endsEdgeFond = endsEdgeFond, # pour chaque face [points edge fond de fissure aux débouchés du pipe] facesPipePeau = facesPipePeau, # pour chaque face [faces du pipe débouchantes] diff --git a/src/Tools/blocFissure/gmu/mailleFacesFissure.py b/src/Tools/blocFissure/gmu/mailleFacesFissure.py index e4f86fcdd..ca14afbd5 100644 --- a/src/Tools/blocFissure/gmu/mailleFacesFissure.py +++ b/src/Tools/blocFissure/gmu/mailleFacesFissure.py @@ -60,8 +60,7 @@ def mailleFacesFissure(faceFissureExterne, \ putName(algo2d, "{}_2d_faceFiss".format(mailleur), i_pref=nro_cas) putName(hypo2d, "hypo2d_faceFiss", i_pref=nro_cas) - texte = "Récupération des arêtes de '{}'".format(edgesPipeFissureExterneC.GetName()) - logging.info(texte) + logging.info("UseExisting1DElements depuis '%s'", edgesPipeFissureExterneC.GetName()) algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC) hypo1d = algo1d.SourceEdges([ meshPipeGroups['edgeFaceFissGroup'] ],0,0) putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas) diff --git a/src/Tools/blocFissure/gmu/mailleFacesPeau.py b/src/Tools/blocFissure/gmu/mailleFacesPeau.py index cb3aac04b..4da78f07f 100644 --- a/src/Tools/blocFissure/gmu/mailleFacesPeau.py +++ b/src/Tools/blocFissure/gmu/mailleFacesPeau.py @@ -44,7 +44,8 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \ nbFacesFilling = len(partitionsPeauFissFond) boutFromIfil = [None for _ in range(nbFacesFilling)] - if idFillingFromBout[0] != idFillingFromBout[1]: # repérage des extremites du pipe quand elles débouchent sur des faces différentes + # repérage des extremites du pipe quand elles débouchent sur des faces différentes : + if ( idFillingFromBout[0] != idFillingFromBout[1] ): boutFromIfil[idFillingFromBout[0]] = 0 boutFromIfil[idFillingFromBout[1]] = 1 @@ -52,71 +53,17 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \ 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 - - logging.debug("meshFacePeau %d intacte", ifil) - # --- edges de bord de la face de filling - filling = facesDefaut[ifil] - edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False) - 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, nro_cas) - putName(algo1d, "algo1d_bordsLibres", ifil, nro_cas) - putName(hypo1d, "hypo1d_bordsLibres", ifil, nro_cas) - + logging.info("face de peau %d intacte", ifil) + facePeau = facesDefaut[ifil] else: + logging.info("face de peau %d coupée par la fissure", ifil) + # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes) + facePeau = facesPeaux[ifil] + meshFacePeau = smesh.Mesh(facePeau) + putName(meshFacePeau.GetMesh(), "facePeau", ifil, nro_cas) - 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] - _ = ptCircPeau[ifil] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe] - groupEdgesBordPeau = gpedgeBord[ifil] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine - 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] - - meshFacePeau = smesh.Mesh(facePeau) - - algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) - hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) - putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas) - putName(algo1d, "algo1d_bordsLibres", ifil, nro_cas) - putName(hypo1d, "hypo1d_bordsLibres", ifil, nro_cas) - - algo1d = meshFacePeau.UseExisting1DElements(geom=geompy.MakeCompound(edgesFissurePeau)) - hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0) - putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil, nro_cas) - putName(algo1d, "algo1d_edgePeauFiss", ifil, nro_cas) - putName(hypo1d, "hypo1d_edgePeauFiss", ifil, nro_cas) - - if bordsVifs is not None: - algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs) - hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0) - putName(algo1d.GetSubMesh(), "bordsVifs", ifil, nro_cas) - putName(algo1d, "algo1d_bordsVifs", ifil, nro_cas) - putName(hypo1d, "hypo1d_bordsVifs", ifil, nro_cas) - - for i_aux, edgeCirc in enumerate(edgesCircPeau): - texte = "i_aux = {}".format(i_aux) - logging.info(texte) - if edgeCirc is not None: - algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc) # addToStudy() failed ? - if boutFromIfil[ifil] is None: - hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[i_aux] ],0,0) - else: - hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[boutFromIfil[ifil]] ],0,0) - name = "cercle{}".format(i_aux) - putName(algo1d.GetSubMesh(), name, ifil, nro_cas) - putName(algo1d, "algo1d_" + name, ifil, nro_cas) - putName(hypo1d, "hypo1d_" + name, ifil, nro_cas) - - logging.info("Maillage avec %s", mailleur) if ( mailleur == "MeshGems"): algo2d = meshFacePeau.Triangle(algo=smeshBuilder.MG_CADSurf) hypo2d = algo2d.Parameters() @@ -132,11 +79,76 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \ hypo2d.SetOptimize( 1 ) hypo2d.SetFineness( 2 ) hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) + hypo2d.SetChordalError( dmoyen*0.25 ) hypo2d.SetQuadAllowed( 0 ) - putName(algo2d.GetSubMesh(), "facePeau", ifil, nro_cas) - putName(algo2d, "algo2d_facePeau", ifil, nro_cas) + putName(algo2d, "{}_2d_facePeau".format(mailleur), ifil, nro_cas) putName(hypo2d, "hypo2d_facePeau", ifil, nro_cas) + if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte + + logging.debug("face de peau %d intacte", ifil) + # --- edges de bord de la face de filling + filling = facesDefaut[ifil] + edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False) + groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"]) + geompy.UnionList(groupEdgesBordPeau, edgesFilling) + geomPublishInFather(initLog.always, filling, groupEdgesBordPeau, "EdgesBords", nro_cas) + + logging.info("UseExisting1DElements depuis '%s'", groupEdgesBordPeau.GetName()) + algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) + hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) + putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas) + putName(algo1d, "algo1d_bordsLibres", ifil, nro_cas) + putName(hypo1d, "hypo1d_bordsLibres", ifil, nro_cas) + + else: + + logging.info("face de peau %d coupée par la fissure", ifil) + edgesCircPeau = edCircPeau[ifil] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe] + _ = ptCircPeau[ifil] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe] + groupEdgesBordPeau = gpedgeBord[ifil] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine + 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] + + logging.info("UseExisting1DElements depuis groupEdgesBordPeau = '%s'", groupEdgesBordPeau.GetName()) + algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) + hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) + putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas) + putName(algo1d, "algo1d_bordsLibres", ifil, nro_cas) + putName(hypo1d, "hypo1d_bordsLibres", ifil, nro_cas) + + objet = geompy.MakeCompound(edgesFissurePeau) + geomPublishInFather(initLog.always, facePeau, objet, "edgesFissurePeau") + logging.info("UseExisting1DElements depuis objet = '%s'", objet.GetName()) + algo1d = meshFacePeau.UseExisting1DElements(geom=objet) + hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0) + putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil, nro_cas) + putName(algo1d, "algo1d_edgePeauFiss", ifil, nro_cas) + putName(hypo1d, "hypo1d_edgePeauFiss", ifil, nro_cas) + + if bordsVifs is not None: + logging.info("UseExisting1DElements depuis bordsVifs = '%s'", bordsVifs.GetName()) + algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs) + hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0) + putName(algo1d.GetSubMesh(), "bordsVifs", ifil, nro_cas) + putName(algo1d, "algo1d_bordsVifs", ifil, nro_cas) + putName(hypo1d, "hypo1d_bordsVifs", ifil, nro_cas) + + for i_aux, edgeCirc in enumerate(edgesCircPeau): + texte = "i_aux = {}".format(i_aux) + logging.info(texte) + if edgeCirc is not None: + logging.info("UseExisting1DElements depuis edgeCirc ='%s'", edgeCirc.GetName()) + algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc) # addToStudy() failed ? + if boutFromIfil[ifil] is None: + hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[i_aux] ],0,0) + else: + hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[boutFromIfil[ifil]] ],0,0) + name = "cercle{}".format(i_aux) + putName(algo1d.GetSubMesh(), name, ifil, nro_cas) + putName(algo1d, "algo1d_" + name, ifil, nro_cas) + putName(hypo1d, "hypo1d_" + name, ifil, nro_cas) + is_done = meshFacePeau.Compute() text = "meshFacePeau {} .Compute".format(ifil) if is_done: @@ -146,8 +158,8 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \ logging.info(text) raise Exception(text) - GroupFaces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil ) - _ = GroupFaces.AddFrom( meshFacePeau.GetMesh() ) + groupe_des_faces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil ) + _ = groupe_des_faces.AddFrom( meshFacePeau.GetMesh() ) meshesFacesPeau.append(meshFacePeau) return meshesFacesPeau From 8f0082e9d096c07207e1bf9d68488c195abf515a Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 15 Apr 2021 13:39:45 +0200 Subject: [PATCH 03/13] SUppression de step dans construitFissureGenerale --- src/Tools/blocFissure/CasTests/cubeAngle.py | 6 +----- src/Tools/blocFissure/CasTests/cylindre.py | 6 +----- src/Tools/blocFissure/CasTests/cylindre_2.py | 7 ++----- src/Tools/blocFissure/CasTests/ellipse_1.py | 6 +----- src/Tools/blocFissure/CasTests/ellipse_2.py | 6 +----- .../blocFissure/CasTests/eprouvetteCourbe.py | 6 +----- .../blocFissure/CasTests/eprouvetteDroite.py | 13 ++++--------- .../blocFissure/CasTests/eprouvetteDroite_2.py | 12 ++++-------- src/Tools/blocFissure/CasTests/faceGauche_2.py | 15 +++------------ .../blocFissure/CasTests/fissure_Coude.py | 18 +++++++++--------- src/Tools/blocFissure/CasTests/tube.py | 7 ++----- src/Tools/blocFissure/CasTests/vis_1.py | 8 ++------ src/Tools/blocFissure/gmu/casStandard.py | 2 +- .../gmu/construitFissureGenerale.py | 2 +- src/Tools/blocFissure/gmu/fissureCoude.py | 2 +- 15 files changed, 34 insertions(+), 82 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/cubeAngle.py b/src/Tools/blocFissure/CasTests/cubeAngle.py index d91cdee85..ef04109da 100644 --- a/src/Tools/blocFissure/CasTests/cubeAngle.py +++ b/src/Tools/blocFissure/CasTests/cubeAngle.py @@ -31,10 +31,6 @@ from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetS from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale from blocFissure.gmu.putName import putName -import GEOM -import SALOMEDS -import SMESH - class cubeAngle(fissureGenerique): """problème de fissure plane coupant 2 faces (angle), débouches normaux, objet plan""" @@ -115,7 +111,7 @@ class cubeAngle(fissureGenerique): mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \ maillageFissureParams, elementsDefaut, \ - step, mailleur, self.numeroCas) + mailleur, self.numeroCas) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/cylindre.py b/src/Tools/blocFissure/CasTests/cylindre.py index b6c21c088..6aacd332f 100644 --- a/src/Tools/blocFissure/CasTests/cylindre.py +++ b/src/Tools/blocFissure/CasTests/cylindre.py @@ -31,10 +31,6 @@ from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetS from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale from blocFissure.gmu.putName import putName -import GEOM -import SALOMEDS -import SMESH - class cylindre(fissureGenerique): """problème de fissure plane sur cylindre, grand fond de fissure en arc de cercle""" @@ -110,7 +106,7 @@ class cylindre(fissureGenerique): mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \ maillageFissureParams, elementsDefaut, \ - step, mailleur, self.numeroCas) + mailleur, self.numeroCas) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/cylindre_2.py b/src/Tools/blocFissure/CasTests/cylindre_2.py index 329ed3491..05e6f22bc 100644 --- a/src/Tools/blocFissure/CasTests/cylindre_2.py +++ b/src/Tools/blocFissure/CasTests/cylindre_2.py @@ -24,12 +24,9 @@ import os import logging from blocFissure import gmu -from blocFissure.gmu.geomsmesh import geompy, smesh -from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut +from blocFissure.gmu.geomsmesh import geompy -import GEOM -import SALOMEDS -import SMESH +from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from .cylindre import cylindre diff --git a/src/Tools/blocFissure/CasTests/ellipse_1.py b/src/Tools/blocFissure/CasTests/ellipse_1.py index 5809e8bfe..fce709094 100644 --- a/src/Tools/blocFissure/CasTests/ellipse_1.py +++ b/src/Tools/blocFissure/CasTests/ellipse_1.py @@ -31,10 +31,6 @@ from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetS from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale from blocFissure.gmu.putName import putName -import GEOM -import SALOMEDS -import SMESH - class ellipse_1(fissureGenerique): """problème de fissure non plane, débouchante non normale""" @@ -124,7 +120,7 @@ class ellipse_1(fissureGenerique): mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \ maillageFissureParams, elementsDefaut, \ - step, mailleur, self.numeroCas) + mailleur, self.numeroCas) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/ellipse_2.py b/src/Tools/blocFissure/CasTests/ellipse_2.py index 19eebe03a..b1dd29490 100644 --- a/src/Tools/blocFissure/CasTests/ellipse_2.py +++ b/src/Tools/blocFissure/CasTests/ellipse_2.py @@ -24,13 +24,9 @@ import os import logging from blocFissure import gmu -from blocFissure.gmu.geomsmesh import geompy, smesh +from blocFissure.gmu.geomsmesh import geompy from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut -import GEOM -import SALOMEDS -import SMESH - from .ellipse_1 import ellipse_1 class ellipse_2(ellipse_1): diff --git a/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py b/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py index ff776f6db..f587b8cb3 100644 --- a/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py +++ b/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py @@ -31,10 +31,6 @@ from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetS from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale from blocFissure.gmu.putName import putName -import GEOM -import SALOMEDS -import SMESH - class eprouvetteCourbe(fissureGenerique): """problème de fissure plane coupant 3 faces (éprouvette), faces au débouché non planes, incidence presque normale""" @@ -118,7 +114,7 @@ class eprouvetteCourbe(fissureGenerique): mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \ maillageFissureParams, elementsDefaut, \ - step, mailleur, self.numeroCas) + mailleur, self.numeroCas) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/eprouvetteDroite.py b/src/Tools/blocFissure/CasTests/eprouvetteDroite.py index d4c1b29d7..7484c1da1 100644 --- a/src/Tools/blocFissure/CasTests/eprouvetteDroite.py +++ b/src/Tools/blocFissure/CasTests/eprouvetteDroite.py @@ -20,18 +20,13 @@ """problème de fissure plane coupant 3 faces (éprouvette), débouches normaux, objet plan""" import os + +import logging + from blocFissure import gmu from blocFissure.gmu.geomsmesh import geompy, smesh from blocFissure.gmu.putName import putName -import GEOM -import SALOMEDS -import SMESH -#import StdMeshers -#import GHS3DPlugin -#import NETGENPlugin -import logging - from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.triedreBase import triedreBase @@ -115,7 +110,7 @@ class eprouvetteDroite(fissureGenerique): mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \ maillageFissureParams, elementsDefaut, \ - step, mailleur, self.numeroCas) + mailleur, self.numeroCas) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/eprouvetteDroite_2.py b/src/Tools/blocFissure/CasTests/eprouvetteDroite_2.py index ffe43c6cc..bfcbb176a 100644 --- a/src/Tools/blocFissure/CasTests/eprouvetteDroite_2.py +++ b/src/Tools/blocFissure/CasTests/eprouvetteDroite_2.py @@ -20,18 +20,14 @@ """problème de fissure plane coupant 3 faces (éprouvette), débouches non normaux, objet plan""" import os -from blocFissure import gmu -from blocFissure.gmu.geomsmesh import geompy, smesh - -import GEOM -import SALOMEDS -import SMESH import logging -from .eprouvetteDroite import eprouvetteDroite - +from blocFissure import gmu +from blocFissure.gmu.geomsmesh import geompy from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut +from .eprouvetteDroite import eprouvetteDroite + class eprouvetteDroite_2(eprouvetteDroite): """problème de fissure plane coupant 3 faces (éprouvette), débouches non normaux, objet plan""" diff --git a/src/Tools/blocFissure/CasTests/faceGauche_2.py b/src/Tools/blocFissure/CasTests/faceGauche_2.py index 1cb43188f..abe51ca03 100644 --- a/src/Tools/blocFissure/CasTests/faceGauche_2.py +++ b/src/Tools/blocFissure/CasTests/faceGauche_2.py @@ -20,21 +20,12 @@ """problème de fissure non plane, débouchante non normale""" import os +import logging + from blocFissure import gmu from blocFissure.gmu.geomsmesh import geompy, smesh from blocFissure.gmu.putName import putName - -import GEOM -import SALOMEDS -import SMESH -#import StdMeshers -#import GHS3DPlugin -#import NETGENPlugin -import logging - from blocFissure.gmu.fissureGenerique import fissureGenerique - - from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain @@ -115,7 +106,7 @@ class faceGauche_2(fissureGenerique): mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \ maillageFissureParams, elementsDefaut, \ - step, mailleur, self.numeroCas) + mailleur, self.numeroCas) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/fissure_Coude.py b/src/Tools/blocFissure/CasTests/fissure_Coude.py index 52c6a6b2e..1ebf008ad 100644 --- a/src/Tools/blocFissure/CasTests/fissure_Coude.py +++ b/src/Tools/blocFissure/CasTests/fissure_Coude.py @@ -23,16 +23,16 @@ import logging import os import math -from blocFissure.gmu import initLog -from blocFissure.gmu.geomsmesh import geompy, smesh -from blocFissure.gmu.geomsmesh import geomPublish -from blocFissure.gmu.geomsmesh import geomPublishInFather -from blocFissure.gmu.putName import putName - import GEOM -import SALOMEDS import SMESH +from blocFissure.gmu.geomsmesh import geompy +from blocFissure.gmu.geomsmesh import smesh +from blocFissure.gmu.geomsmesh import geomPublish +from blocFissure.gmu.geomsmesh import geomPublishInFather + +from blocFissure.gmu import initLog +from blocFissure.gmu.putName import putName from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut @@ -233,8 +233,8 @@ class fissure_Coude(fissureGenerique): algo3d = maillageSain.Hexahedron() algo2d = maillageSain.Quadrangle() - putName(algo3d, "{}_3d_maillageSain".format(self.mailleur), i_pref=self.numeroCas) - putName(algo2d, "{}_2d_maillageSain".format(self.mailleur), i_pref=self.numeroCas) + putName(algo3d, "3d_maillageSain", i_pref=self.numeroCas) + putName(algo2d, "2d_maillageSain", i_pref=self.numeroCas) algo1d_long_p1 = maillageSain.Segment(geom=long_p1) hypo1d_long_p1 = algo1d_long_p1.NumberOfSegments(n_long_p1) diff --git a/src/Tools/blocFissure/CasTests/tube.py b/src/Tools/blocFissure/CasTests/tube.py index d71d98fe4..c1b22f369 100644 --- a/src/Tools/blocFissure/CasTests/tube.py +++ b/src/Tools/blocFissure/CasTests/tube.py @@ -28,16 +28,13 @@ from blocFissure.gmu import initLog from blocFissure.gmu.geomsmesh import geompy, smesh from blocFissure.gmu.geomsmesh import geomPublish from blocFissure.gmu.geomsmesh import geomPublishInFather + from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale from blocFissure.gmu.putName import putName -import GEOM -import SALOMEDS -import SMESH - class tube(fissureGenerique): """problème de fissure plane dans un tube""" @@ -123,7 +120,7 @@ class tube(fissureGenerique): mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \ maillageFissureParams, elementsDefaut, \ - step, mailleur, self.numeroCas) + mailleur, self.numeroCas) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/vis_1.py b/src/Tools/blocFissure/CasTests/vis_1.py index 08e561d36..6de374e88 100644 --- a/src/Tools/blocFissure/CasTests/vis_1.py +++ b/src/Tools/blocFissure/CasTests/vis_1.py @@ -27,12 +27,8 @@ from blocFissure.gmu import initLog from blocFissure.gmu.geomsmesh import geompy, smesh from blocFissure.gmu.geomsmesh import geomPublish from blocFissure.gmu.geomsmesh import geomPublishInFather + from blocFissure.gmu.putName import putName - -import GEOM -import SALOMEDS -import SMESH - from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut @@ -124,7 +120,7 @@ class vis_1(fissureGenerique): mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \ maillageFissureParams, elementsDefaut, \ - step, mailleur, self.numeroCas) + mailleur, self.numeroCas) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/gmu/casStandard.py b/src/Tools/blocFissure/gmu/casStandard.py index 5e433531d..f7f1ce7be 100644 --- a/src/Tools/blocFissure/gmu/casStandard.py +++ b/src/Tools/blocFissure/gmu/casStandard.py @@ -178,7 +178,7 @@ class casStandard(fissureGenerique): mailleur="MeshGems"): maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \ maillageFissureParams, elementsDefaut, \ - step, mailleur, self.numeroCas) + mailleur, self.numeroCas) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale.py b/src/Tools/blocFissure/gmu/construitFissureGenerale.py index eda66284a..060805323 100644 --- a/src/Tools/blocFissure/gmu/construitFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/construitFissureGenerale.py @@ -57,7 +57,7 @@ from .construitFissureGenerale_c import construitFissureGenerale_c def construitFissureGenerale(shapesFissure, shapeFissureParams, \ maillageFissureParams, elementsDefaut, \ - step=-1, mailleur="MeshGems", nro_cas=None): + mailleur="MeshGems", nro_cas=None): """procédure complète fissure générale""" logging.info('start') logging.info("Usage du mailleur %s pour le cas n°%s", mailleur, nro_cas) diff --git a/src/Tools/blocFissure/gmu/fissureCoude.py b/src/Tools/blocFissure/gmu/fissureCoude.py index c8b70cf79..47ebf1134 100644 --- a/src/Tools/blocFissure/gmu/fissureCoude.py +++ b/src/Tools/blocFissure/gmu/fissureCoude.py @@ -682,7 +682,7 @@ class fissureCoude(fissureGenerique): mailleur="MeshGems"): maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \ maillageFissureParams, elementsDefaut, \ - step, mailleur, self.numeroCas) + mailleur, self.numeroCas) return maillageFissure # --------------------------------------------------------------------------- From ff873c8b10f4cc15316f4ee7e1331ec1b4e0c1ab Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 15 Apr 2021 13:40:29 +0200 Subject: [PATCH 04/13] Affichage du diagnostic --- src/Tools/blocFissure/CasTests/execution_Cas.py | 7 +++---- src/Tools/blocFissure/gmu/getStatsMaillageFissure.py | 12 ++++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/execution_Cas.py b/src/Tools/blocFissure/CasTests/execution_Cas.py index 3ca435e59..553e3b103 100644 --- a/src/Tools/blocFissure/CasTests/execution_Cas.py +++ b/src/Tools/blocFissure/CasTests/execution_Cas.py @@ -23,9 +23,7 @@ import traceback import logging -from blocFissure import gmu from blocFissure.gmu import initLog -from blocFissure.gmu import geomsmesh from blocFissure.gmu.casStandard import casStandard # ----------------------------------------------------------------------------------------------- @@ -59,7 +57,7 @@ else: TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # eprouvetteCourbe TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # eprouvetteDroite TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # fissureGauche - TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # fissureGauche2 fissureGauche2 + TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # fissureGauche2 TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0] # vis TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] # tube # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28 @@ -244,8 +242,9 @@ def calcul_cas (n_cas, cas, d_aux, ligne): ok_maillage = cas.executeProbleme() except: traceback.print_exc() - texte = "Problème avec le cas n° {}, '{}'\n".format(n_cas,nom) ok_maillage = False + if not ok_maillage: + texte = "Problème avec le cas n° {}, '{}'\n".format(n_cas,nom) print(ligne) return ok_maillage, texte #============================================================= diff --git a/src/Tools/blocFissure/gmu/getStatsMaillageFissure.py b/src/Tools/blocFissure/gmu/getStatsMaillageFissure.py index 317b6c935..49a93052f 100644 --- a/src/Tools/blocFissure/gmu/getStatsMaillageFissure.py +++ b/src/Tools/blocFissure/gmu/getStatsMaillageFissure.py @@ -51,7 +51,9 @@ def getStatsMaillageFissure(maillage, referencesMaillageFissure, maillageFissure text_2 = "" ok_maillage = True with open(fichierStatMaillageFissure, "w") as fic_stat : - for key in ('Entity_Quad_Quadrangle', 'Entity_Quad_Hexa'): + + # Le nombre d'arêtes, de quadrangles ou d'hexaèdres doit être rigoureusement identique + for key in ('Entity_Quad_Edge', 'Entity_Quad_Quadrangle', 'Entity_Quad_Hexa'): if d_resu[key] != referencesMaillageFissure[key]: text = "Ecart" ok_maillage = False @@ -61,14 +63,16 @@ def getStatsMaillageFissure(maillage, referencesMaillageFissure, maillageFissure logging.info(text) fic_stat.write(text+"\n") text_2 += " {} = {}, \\\n".format(key,d_resu[key]) - tolerance = 0.05 - for key in ('Entity_Node', 'Entity_Quad_Edge', 'Entity_Quad_Triangle', 'Entity_Quad_Tetra', 'Entity_Quad_Pyramid', 'Entity_Quad_Penta'): + + # Le nombre de noeuds, de triangles, de tétarèdres ou de pyramides peut varier du fait des algorithmes. On tolère 1% d'écart. + tolerance = 0.01 + for key in ('Entity_Node', 'Entity_Quad_Triangle', 'Entity_Quad_Tetra', 'Entity_Quad_Pyramid', 'Entity_Quad_Penta'): if (d_resu[key] < (1.0 - tolerance)*referencesMaillageFissure[key]) \ or (d_resu[key] > (1.0 + tolerance)*referencesMaillageFissure[key]): text = "Ecart" ok_maillage = False else: - text = "Valeur_OK" + text = "Valeur_OK à moins de {}%".format(tolerance*100.) text += ": {} reference: {} calcul: {}".format(key,referencesMaillageFissure[key],d_resu[key]) logging.info(text) fic_stat.write(text+"\n") From 33b54215515d9881ee22f4503f1543653a9ce8d1 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 15 Apr 2021 13:40:42 +0200 Subject: [PATCH 05/13] correction des valeurs --- src/Tools/blocFissure/CasTests/faceGauche.py | 33 +++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/faceGauche.py b/src/Tools/blocFissure/CasTests/faceGauche.py index 939c90a5d..a63053ae7 100644 --- a/src/Tools/blocFissure/CasTests/faceGauche.py +++ b/src/Tools/blocFissure/CasTests/faceGauche.py @@ -20,19 +20,14 @@ """problème de fissure non plane, débouchante non normale""" import os -from blocFissure import gmu -from blocFissure.gmu.geomsmesh import geompy, smesh -from blocFissure.gmu.putName import putName - -import math -import GEOM -import SALOMEDS -import SMESH - import logging -from blocFissure.gmu.fissureGenerique import fissureGenerique +from blocFissure import gmu +from blocFissure.gmu.geomsmesh import geompy +from blocFissure.gmu.geomsmesh import smesh +from blocFissure.gmu.putName import putName +from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain @@ -113,18 +108,18 @@ class faceGauche(fissureGenerique): mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \ maillageFissureParams, elementsDefaut, \ - step, mailleur, self.numeroCas) + mailleur, self.numeroCas) return maillageFissure # --------------------------------------------------------------------------- def setReferencesMaillageFissure(self): self.referencesMaillageFissure = dict( \ - Entity_Quad_Quadrangle = 3997, \ - Entity_Quad_Hexa = 5904, \ - Entity_Node = 77735, \ - Entity_Quad_Edge = 725, \ - Entity_Quad_Triangle = 2176, \ - Entity_Quad_Tetra = 32320, \ - Entity_Quad_Pyramid = 1156, \ - Entity_Quad_Penta = 856 \ + Entity_Quad_Edge = 750, \ + Entity_Quad_Quadrangle = 4177, \ + Entity_Quad_Hexa = 6224, \ + Entity_Node = 81588, \ + Entity_Quad_Triangle = 2298, \ + Entity_Quad_Tetra = 33764, \ + Entity_Quad_Pyramid = 1236, \ + Entity_Quad_Penta = 936 \ ) From 01aad7a5040760744b3af81014bf50b505834d7a Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 15 Apr 2021 14:20:03 +0200 Subject: [PATCH 06/13] =?UTF-8?q?R=C3=A9f=C3=A9rence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Tools/blocFissure/CasTests/disquePerce.py | 10 +++++----- src/Tools/blocFissure/gmu/fissureCoude.py | 18 ++++++++++-------- .../blocFissure/gmu/getStatsMaillageFissure.py | 12 +++++++----- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/disquePerce.py b/src/Tools/blocFissure/CasTests/disquePerce.py index 7cb18872f..368cdc555 100644 --- a/src/Tools/blocFissure/CasTests/disquePerce.py +++ b/src/Tools/blocFissure/CasTests/disquePerce.py @@ -38,12 +38,12 @@ dicoParams = dict(nomCas = 'disque', # --------------------------------------------------------------------------- referencesMaillageFissure = dict ( \ + Entity_Quad_Edge = 376, \ Entity_Quad_Quadrangle = 2748, \ Entity_Quad_Hexa = 6232, \ - Entity_Node = 43889, \ - Entity_Quad_Edge = 376, \ - Entity_Quad_Triangle = 1366, \ - Entity_Quad_Tetra = 9112, \ + Entity_Node = 43479, \ + Entity_Quad_Triangle = 1340, \ + Entity_Quad_Tetra = 8821, \ Entity_Quad_Pyramid = 466, \ Entity_Quad_Penta = 448 \ - ) + ) diff --git a/src/Tools/blocFissure/gmu/fissureCoude.py b/src/Tools/blocFissure/gmu/fissureCoude.py index 47ebf1134..ad1154e5f 100644 --- a/src/Tools/blocFissure/gmu/fissureCoude.py +++ b/src/Tools/blocFissure/gmu/fissureCoude.py @@ -687,11 +687,13 @@ class fissureCoude(fissureGenerique): # --------------------------------------------------------------------------- def setReferencesMaillageFissure(self): - self.referencesMaillageFissure = dict(Entity_Node = 77917, - Entity_Quad_Edge = 975, - Entity_Quad_Triangle = 2182, - Entity_Quad_Quadrangle = 6842, - Entity_Quad_Tetra = 20135, - Entity_Quad_Hexa = 8994, - Entity_Quad_Penta = 972, - Entity_Quad_Pyramid = 1038) + self.referencesMaillageFissure = dict( \ + Entity_Quad_Edge = 975, \ + Entity_Quad_Quadrangle = 6842, \ + Entity_Quad_Hexa = 8994, \ + Entity_Node = 77917, \ + Entity_Quad_Triangle = 2182, \ + Entity_Quad_Tetra = 20135, \ + Entity_Quad_Pyramid = 1038, \ + Entity_Quad_Penta = 972 \ + ) diff --git a/src/Tools/blocFissure/gmu/getStatsMaillageFissure.py b/src/Tools/blocFissure/gmu/getStatsMaillageFissure.py index 49a93052f..3305bac0f 100644 --- a/src/Tools/blocFissure/gmu/getStatsMaillageFissure.py +++ b/src/Tools/blocFissure/gmu/getStatsMaillageFissure.py @@ -64,12 +64,14 @@ def getStatsMaillageFissure(maillage, referencesMaillageFissure, maillageFissure fic_stat.write(text+"\n") text_2 += " {} = {}, \\\n".format(key,d_resu[key]) - # Le nombre de noeuds, de triangles, de tétarèdres ou de pyramides peut varier du fait des algorithmes. On tolère 1% d'écart. - tolerance = 0.01 + # Le nombre de noeuds, de triangles, de tétraèdres ou de pyramides peut varier du fait des algorithmes. On tolère 5% d'écart. + tolerance = 0.05 for key in ('Entity_Node', 'Entity_Quad_Triangle', 'Entity_Quad_Tetra', 'Entity_Quad_Pyramid', 'Entity_Quad_Penta'): - if (d_resu[key] < (1.0 - tolerance)*referencesMaillageFissure[key]) \ - or (d_resu[key] > (1.0 + tolerance)*referencesMaillageFissure[key]): - text = "Ecart" + if d_resu[key] == referencesMaillageFissure[key]: + text = "Valeur_OK" + elif (d_resu[key] < (1.0 - tolerance)*referencesMaillageFissure[key]) \ + or (d_resu[key] > (1.0 + tolerance)*referencesMaillageFissure[key]): + text = "Ecart de plus de {}%".format(tolerance*100.) ok_maillage = False else: text = "Valeur_OK à moins de {}%".format(tolerance*100.) From 857a95f855b2c9ea4fa3d4ffa414caeb17d51237 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 15 Apr 2021 14:20:42 +0200 Subject: [PATCH 07/13] suppression de l'argument geometriesSaines --- src/Tools/blocFissure/CasTests/fissure_Coude.py | 5 ++--- src/Tools/blocFissure/gmu/insereFissureLongue.py | 10 ++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/fissure_Coude.py b/src/Tools/blocFissure/CasTests/fissure_Coude.py index 1ebf008ad..75f584c0c 100644 --- a/src/Tools/blocFissure/CasTests/fissure_Coude.py +++ b/src/Tools/blocFissure/CasTests/fissure_Coude.py @@ -510,10 +510,9 @@ class fissure_Coude(fissureGenerique): mailleur="MeshGems"): mailleur = self.mailleur2d3d() - maillageFissure = insereFissureLongue(geometriesSaines, \ - shapesFissure, shapeFissureParams, \ + maillageFissure = insereFissureLongue(shapesFissure, shapeFissureParams, \ maillageFissureParams, elementsDefaut, \ - step, mailleur, self.numeroCas) + mailleur, self.numeroCas) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue.py b/src/Tools/blocFissure/gmu/insereFissureLongue.py index 18b7f2861..acb3f8de2 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue.py @@ -17,7 +17,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -"""procédure complète de construction d'une fissure longue""" +"""Procédure complète de construction d'une fissure longue""" import os @@ -39,15 +39,13 @@ from .insereFissureLongue_g import insereFissureLongue_g # ----------------------------------------------------------------------------- -def insereFissureLongue(geometriesSaines, \ - shapesFissure, shapeFissureParams, \ +def insereFissureLongue(shapesFissure, shapeFissureParams, \ maillageFissureParams, elementsDefaut, \ - step=-1, mailleur="MeshGems", nro_cas=None): - """procedure complete fissure longue""" + mailleur="MeshGems", nro_cas=None): + """Procédure complète de construction d'une fissure longue""" logging.info('start') logging.info("Usage du mailleur %s pour le cas n°%s", mailleur, nro_cas) - #geometrieSaine = geometriesSaines[0] shapeDefaut = shapesFissure[0] # face de fissure, debordant #tailleDefaut = shapesFissure[2] wiretube = shapesFissure[4] # wire fond de fissure, debordant From 430da9254a6551c2da729b32a0aa4e41054285f7 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 15 Apr 2021 14:21:22 +0200 Subject: [PATCH 08/13] Nommage --- .../blocFissure/gmu/ajustePointsEdgePipeFissure.py | 12 +++++++----- src/Tools/blocFissure/gmu/insereFissureLongue_c.py | 9 +++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/Tools/blocFissure/gmu/ajustePointsEdgePipeFissure.py b/src/Tools/blocFissure/gmu/ajustePointsEdgePipeFissure.py index 41f23452d..a26c470e1 100644 --- a/src/Tools/blocFissure/gmu/ajustePointsEdgePipeFissure.py +++ b/src/Tools/blocFissure/gmu/ajustePointsEdgePipeFissure.py @@ -17,7 +17,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -"""Ajustement precis des points sur edgesPipeFissureExterneC""" +"""Ajustement précis des points sur edgesPipeFissureExterneC""" import logging @@ -26,16 +26,17 @@ from .findWireIntermediateVertices import findWireIntermediateVertices from .projettePointSurCourbe import projettePointSurCourbe def ajustePointsEdgePipeFissure(edgesPipeFissureExterneC, wirePipeFissureExterne, gptsdisks, idisklim): - """Ajustement precis des points sur edgesPipeFissureExterneC""" + """Ajustement précis des points sur edgesPipeFissureExterneC""" logging.info('start') edgesPFE = geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False) verticesPFE, _ = findWireIntermediateVertices(wirePipeFissureExterne) # vertices intermédiaires (des points en trop dans ptsInWireFissExtPipe) idiskmin = idisklim[0] + 1 # on ne prend pas le disque sur la peau, déjà ajusté - idiskmax = idisklim[1] # on ne prend pas le disque sur la peau, déjà ajusté - idiskint = [] + idiskmax = idisklim[1] + idiskint = list() + for vtx in verticesPFE: - distPtVt = [] + distPtVt = list() for idisk in range(idiskmin, idiskmax): gptdsk = gptsdisks[idisk] point = gptdsk[0][-1] # le point sur l'edge de la fissure externe au pipe @@ -44,6 +45,7 @@ def ajustePointsEdgePipeFissure(edgesPipeFissureExterneC, wirePipeFissureExterne idiskint.append(distPtVt[0][1]) gptsdisks[idiskint[-1]][0][-1] = vtx logging.debug("ajustement point sur edgePipeFissureExterne, vertex: %s %s", idiskint[-1], distPtVt[0][0]) + for idisk in range(idiskmin, idiskmax): if idisk in idiskint: break diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_c.py b/src/Tools/blocFissure/gmu/insereFissureLongue_c.py index 040f5a12f..1ddd26c58 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_c.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_c.py @@ -45,16 +45,17 @@ def insereFissureLongue_c (pipeFondFiss, disques, rayons, demiCercles, demiCercl meshFondFiss = smesh.Mesh(pipeFondFiss) putName(meshFondFiss, "pipeFondFiss", i_pref=nro_cas) - algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.QUADRANGLE) algo3d = meshFondFiss.Prism() putName(algo3d.GetSubMesh(), "pipe", i_pref=nro_cas) - putName(algo3d, "{}_3d_pipe".format(mailleur), i_pref=nro_cas) - putName(algo2d, "{}_2d_pipe".format(mailleur), i_pref=nro_cas) + putName(algo3d, "Prism", i_pref=nro_cas) + + algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.QUADRANGLE) + putName(algo2d, "QUADRANGLE", i_pref=nro_cas) for i_aux, face in enumerate(disques): algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.RADIAL_QUAD,geom=face) putName(algo2d.GetSubMesh(), "disque", i_aux, nro_cas) - putName(algo2d, "{}_2d_disque".format(mailleur), i_aux, nro_cas) + putName(algo2d, "RADIAL_QUAD", i_aux, nro_cas) for i_aux, edge in enumerate(rayons): algo1d = meshFondFiss.Segment(geom=edge) From 6cdcd4fb150ef14b95d677a7a8942ae2cfd2ac86 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 15 Apr 2021 14:47:43 +0200 Subject: [PATCH 09/13] =?UTF-8?q?M=C3=A9nage=20dans=20les=20imports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Tools/blocFissure/gmu/casStandard.py | 4 ---- .../blocFissure/gmu/construitEdgesRadialesDebouchantes.py | 3 --- .../blocFissure/gmu/construitEdgesRadialesDebouchantes_b.py | 6 +++--- .../blocFissure/gmu/construitEdgesRadialesDebouchantes_c.py | 3 ++- src/Tools/blocFissure/gmu/construitFissureGenerale.py | 2 -- src/Tools/blocFissure/gmu/construitFissureGenerale_c.py | 3 --- src/Tools/blocFissure/gmu/construitMaillagePipe_a.py | 2 -- src/Tools/blocFissure/gmu/construitMaillagePipe_b.py | 2 -- src/Tools/blocFissure/gmu/construitMaillagePipe_c.py | 2 -- src/Tools/blocFissure/gmu/construitMaillagePipe_d.py | 4 ---- src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py | 2 -- src/Tools/blocFissure/gmu/facesCirculaires.py | 2 ++ src/Tools/blocFissure/gmu/findWireEndVertices.py | 2 -- src/Tools/blocFissure/gmu/findWireIntermediateVertices.py | 2 -- src/Tools/blocFissure/gmu/fissureCoude.py | 1 - src/Tools/blocFissure/gmu/getStatsMaillageFissure.py | 2 -- src/Tools/blocFissure/gmu/initEtude.py | 2 -- src/Tools/blocFissure/gmu/insereFissureElliptique.py | 4 ---- src/Tools/blocFissure/gmu/insereFissureLongue_a.py | 2 -- src/Tools/blocFissure/gmu/insereFissureLongue_b.py | 2 -- src/Tools/blocFissure/gmu/insereFissureLongue_c.py | 1 - src/Tools/blocFissure/gmu/insereFissureLongue_d.py | 1 - src/Tools/blocFissure/gmu/insereFissureLongue_e.py | 1 - src/Tools/blocFissure/gmu/insereFissureLongue_f.py | 1 - src/Tools/blocFissure/gmu/insereFissureLongue_g.py | 1 - src/Tools/blocFissure/gmu/mailleFacesPeau.py | 2 +- src/Tools/blocFissure/gmu/partitionVolumeSain.py | 2 ++ 27 files changed, 10 insertions(+), 51 deletions(-) diff --git a/src/Tools/blocFissure/gmu/casStandard.py b/src/Tools/blocFissure/gmu/casStandard.py index f7f1ce7be..0243a84e9 100644 --- a/src/Tools/blocFissure/gmu/casStandard.py +++ b/src/Tools/blocFissure/gmu/casStandard.py @@ -22,10 +22,6 @@ import os import logging -import GEOM -import SALOMEDS -import SMESH - from .geomsmesh import geompy, smesh from .geomsmesh import geomPublish from .geomsmesh import geomPublishInFather diff --git a/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py b/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py index 03d1d1244..eaa260e8d 100644 --- a/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py +++ b/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py @@ -20,9 +20,6 @@ """Construit les arêtes débouchantes""" import logging -import GEOM - -from . import initLog from .construitEdgesRadialesDebouchantes_a import construitEdgesRadialesDebouchantes_a from .construitEdgesRadialesDebouchantes_b import construitEdgesRadialesDebouchantes_b diff --git a/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes_b.py b/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes_b.py index 4f7275dd9..3d35e934d 100644 --- a/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes_b.py +++ b/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes_b.py @@ -20,11 +20,11 @@ """Mise en correspondance avec les indices des faces disque débouchantes (facesPipePeau)""" import logging -import GEOM from .geomsmesh import geompy -from .geomsmesh import geomPublish -from . import initLog +#from .geomsmesh import geomPublish + +#from . import initLog def construitEdgesRadialesDebouchantes_b(facesPipePeau, facesDebouchantes, listNappes): """Mise en correspondance avec les indices des faces disque débouchantes (facesPipePeau)""" diff --git a/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes_c.py b/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes_c.py index 44f9525aa..6a4377079 100644 --- a/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes_c.py +++ b/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes_c.py @@ -20,11 +20,12 @@ """Construction des listes d'edges radiales sur chaque extrémité débouchante""" import logging -import GEOM from .geomsmesh import geompy from .geomsmesh import geomPublish + from . import initLog + from .sortEdges import sortEdges def construitEdgesRadialesDebouchantes_c(facesPipePeau, edgeRadFacePipePeau, \ diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale.py b/src/Tools/blocFissure/gmu/construitFissureGenerale.py index 060805323..3b0dd6767 100644 --- a/src/Tools/blocFissure/gmu/construitFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/construitFissureGenerale.py @@ -25,8 +25,6 @@ from . import initLog import salome from salome.smesh import smeshBuilder -import GEOM -import SMESH from .geomsmesh import geompy from .geomsmesh import geomPublishInFather diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale_c.py b/src/Tools/blocFissure/gmu/construitFissureGenerale_c.py index 4143dc3c1..e46ddf28d 100644 --- a/src/Tools/blocFissure/gmu/construitFissureGenerale_c.py +++ b/src/Tools/blocFissure/gmu/construitFissureGenerale_c.py @@ -23,13 +23,10 @@ import os import logging -import salome from salome.smesh import smeshBuilder -import GEOM import SMESH from .geomsmesh import geompy -from .geomsmesh import smesh from .putName import putName from .enleveDefaut import enleveDefaut diff --git a/src/Tools/blocFissure/gmu/construitMaillagePipe_a.py b/src/Tools/blocFissure/gmu/construitMaillagePipe_a.py index 1db8dd88f..596266968 100644 --- a/src/Tools/blocFissure/gmu/construitMaillagePipe_a.py +++ b/src/Tools/blocFissure/gmu/construitMaillagePipe_a.py @@ -19,8 +19,6 @@ # """Les points""" -import logging - from .geomsmesh import geompy def construitMaillagePipe_a(idisk, \ diff --git a/src/Tools/blocFissure/gmu/construitMaillagePipe_b.py b/src/Tools/blocFissure/gmu/construitMaillagePipe_b.py index 1b8bf7efe..b874c493b 100644 --- a/src/Tools/blocFissure/gmu/construitMaillagePipe_b.py +++ b/src/Tools/blocFissure/gmu/construitMaillagePipe_b.py @@ -19,8 +19,6 @@ # """Les groupes des edges des cercles débouchants""" -import logging - def construitMaillagePipe_b(idisk, \ idisklim, nbsegCercle, \ meshPipe, mptdsk, \ diff --git a/src/Tools/blocFissure/gmu/construitMaillagePipe_c.py b/src/Tools/blocFissure/gmu/construitMaillagePipe_c.py index 0c6fd1c9b..15eec0e4a 100644 --- a/src/Tools/blocFissure/gmu/construitMaillagePipe_c.py +++ b/src/Tools/blocFissure/gmu/construitMaillagePipe_c.py @@ -19,8 +19,6 @@ # """Les groupes des faces débouchantes""" -import logging - def construitMaillagePipe_c(idisk, \ idisklim, nbsegCercle, \ meshPipe, mptdsk, nbsegRad, \ diff --git a/src/Tools/blocFissure/gmu/construitMaillagePipe_d.py b/src/Tools/blocFissure/gmu/construitMaillagePipe_d.py index 722bd4903..5fbd170f1 100644 --- a/src/Tools/blocFissure/gmu/construitMaillagePipe_d.py +++ b/src/Tools/blocFissure/gmu/construitMaillagePipe_d.py @@ -19,10 +19,6 @@ # """Mailles volumiques, groupes noeuds et edges de fond de fissure, groupe de face de fissure""" -import logging - -import SMESH - def construitMaillagePipe_d(idisk, \ idisklim, nbsegCercle, nbsegRad, \ meshPipe, mptdsk, oldmpts, \ diff --git a/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py b/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py index d3ee31437..24bfeff6c 100644 --- a/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py +++ b/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py @@ -22,8 +22,6 @@ import os import logging -import SMESH -import SALOMEDS from .geomsmesh import smesh diff --git a/src/Tools/blocFissure/gmu/facesCirculaires.py b/src/Tools/blocFissure/gmu/facesCirculaires.py index 9af6c3c27..88636eb11 100644 --- a/src/Tools/blocFissure/gmu/facesCirculaires.py +++ b/src/Tools/blocFissure/gmu/facesCirculaires.py @@ -23,6 +23,8 @@ import logging from . import initLog +import GEOM + from .geomsmesh import geompy from .geomsmesh import geomPublishInFather diff --git a/src/Tools/blocFissure/gmu/findWireEndVertices.py b/src/Tools/blocFissure/gmu/findWireEndVertices.py index cf70523f0..e469f43b9 100644 --- a/src/Tools/blocFissure/gmu/findWireEndVertices.py +++ b/src/Tools/blocFissure/gmu/findWireEndVertices.py @@ -21,8 +21,6 @@ import logging -from . import initLog - from .geomsmesh import geompy from .findWireVertices import findWireVertices diff --git a/src/Tools/blocFissure/gmu/findWireIntermediateVertices.py b/src/Tools/blocFissure/gmu/findWireIntermediateVertices.py index 015f63667..1245e2345 100644 --- a/src/Tools/blocFissure/gmu/findWireIntermediateVertices.py +++ b/src/Tools/blocFissure/gmu/findWireIntermediateVertices.py @@ -21,8 +21,6 @@ import logging -from . import initLog - from .geomsmesh import geompy from .findWireVertices import findWireVertices diff --git a/src/Tools/blocFissure/gmu/fissureCoude.py b/src/Tools/blocFissure/gmu/fissureCoude.py index ad1154e5f..e5b22727d 100644 --- a/src/Tools/blocFissure/gmu/fissureCoude.py +++ b/src/Tools/blocFissure/gmu/fissureCoude.py @@ -24,7 +24,6 @@ import os import logging import math import GEOM -import SALOMEDS import SMESH from . import initLog diff --git a/src/Tools/blocFissure/gmu/getStatsMaillageFissure.py b/src/Tools/blocFissure/gmu/getStatsMaillageFissure.py index 3305bac0f..0633c3040 100644 --- a/src/Tools/blocFissure/gmu/getStatsMaillageFissure.py +++ b/src/Tools/blocFissure/gmu/getStatsMaillageFissure.py @@ -21,8 +21,6 @@ import os import logging -import SMESH - def getStatsMaillageFissure(maillage, referencesMaillageFissure, maillageFissureParams): """"Statistiques maillage""" diff --git a/src/Tools/blocFissure/gmu/initEtude.py b/src/Tools/blocFissure/gmu/initEtude.py index 58a9b68eb..f97fe16ce 100644 --- a/src/Tools/blocFissure/gmu/initEtude.py +++ b/src/Tools/blocFissure/gmu/initEtude.py @@ -19,8 +19,6 @@ # """Création d'une nouvelle étude""" -import logging - def initEtude(): """Création nouvelle etude salome""" from . import geomsmesh diff --git a/src/Tools/blocFissure/gmu/insereFissureElliptique.py b/src/Tools/blocFissure/gmu/insereFissureElliptique.py index aa0e945f7..bf7bef0d2 100644 --- a/src/Tools/blocFissure/gmu/insereFissureElliptique.py +++ b/src/Tools/blocFissure/gmu/insereFissureElliptique.py @@ -24,7 +24,6 @@ import os import logging import salome -import SMESH from .partitionBlocDefaut import partitionBlocDefaut from .facesVolumesToriques import facesVolumesToriques @@ -39,9 +38,6 @@ from .enleveDefaut import enleveDefaut from .regroupeSainEtDefaut import RegroupeSainEtDefaut from .putName import putName -# ----------------------------------------------------------------------------- -# --- procedure complete fissure elliptique - def insereFissureElliptique(geometriesSaines, maillagesSains, \ shapesFissure, shapeFissureParams, \ maillageFissureParams, elementsDefaut, step=-1): diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_a.py b/src/Tools/blocFissure/gmu/insereFissureLongue_a.py index cd8b719ed..6cff91ff6 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_a.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_a.py @@ -21,8 +21,6 @@ import logging -import salome - from .geomsmesh import geompy from .geomsmesh import geomPublish from .geomsmesh import geomPublishInFather diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_b.py b/src/Tools/blocFissure/gmu/insereFissureLongue_b.py index 247a38cf8..2cad3c053 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_b.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_b.py @@ -21,8 +21,6 @@ import logging -import salome -from salome.smesh import smeshBuilder import SMESH from .geomsmesh import geompy diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_c.py b/src/Tools/blocFissure/gmu/insereFissureLongue_c.py index 1ddd26c58..3d4fe3e0a 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_c.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_c.py @@ -22,7 +22,6 @@ import logging import math -import salome from salome.smesh import smeshBuilder import SMESH diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_d.py b/src/Tools/blocFissure/gmu/insereFissureLongue_d.py index 394012b7c..206b71c6b 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_d.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_d.py @@ -21,7 +21,6 @@ import logging -import salome from salome.smesh import smeshBuilder import SMESH diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_e.py b/src/Tools/blocFissure/gmu/insereFissureLongue_e.py index 34e9592b1..3a505845e 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_e.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_e.py @@ -24,7 +24,6 @@ import math import SMESH from salome.smesh import smeshBuilder -import salome from .geomsmesh import smesh diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_f.py b/src/Tools/blocFissure/gmu/insereFissureLongue_f.py index c2891d1f3..034d5b0ec 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_f.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_f.py @@ -21,7 +21,6 @@ import logging -import salome from salome.smesh import smeshBuilder import SMESH diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_g.py b/src/Tools/blocFissure/gmu/insereFissureLongue_g.py index ff534b01b..17847c0d2 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_g.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_g.py @@ -21,7 +21,6 @@ import logging -import salome import SMESH from .geomsmesh import geompy diff --git a/src/Tools/blocFissure/gmu/mailleFacesPeau.py b/src/Tools/blocFissure/gmu/mailleFacesPeau.py index 4da78f07f..e8289c22f 100644 --- a/src/Tools/blocFissure/gmu/mailleFacesPeau.py +++ b/src/Tools/blocFissure/gmu/mailleFacesPeau.py @@ -138,7 +138,7 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \ texte = "i_aux = {}".format(i_aux) logging.info(texte) if edgeCirc is not None: - logging.info("UseExisting1DElements depuis edgeCirc ='%s'", edgeCirc.GetName()) + logging.info("UseExisting1DElements depuis edgeCirc = '%s'", edgeCirc.GetName()) algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc) # addToStudy() failed ? if boutFromIfil[ifil] is None: hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[i_aux] ],0,0) diff --git a/src/Tools/blocFissure/gmu/partitionVolumeSain.py b/src/Tools/blocFissure/gmu/partitionVolumeSain.py index 5e3bf41f6..3d713249c 100644 --- a/src/Tools/blocFissure/gmu/partitionVolumeSain.py +++ b/src/Tools/blocFissure/gmu/partitionVolumeSain.py @@ -21,6 +21,8 @@ import logging +import GEOM + from .geomsmesh import geompy from .geomsmesh import geomPublish from .geomsmesh import geomPublishInFather From 19f671efb91ebb9fa8f4c1beb053d4dc059196fa Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 15 Apr 2021 15:22:19 +0200 Subject: [PATCH 10/13] arguments inutiles --- .../gmu/construitFissureGenerale.py | 8 +++----- .../blocFissure/gmu/construitMaillagePipe.py | 9 ++++++--- .../gmu/construitMaillagePipe_a.py | 2 +- .../blocFissure/gmu/creePointsPipePeau.py | 19 +++++++++++++------ 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale.py b/src/Tools/blocFissure/gmu/construitFissureGenerale.py index 3b0dd6767..71df308c8 100644 --- a/src/Tools/blocFissure/gmu/construitFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/construitFissureGenerale.py @@ -24,7 +24,6 @@ import logging from . import initLog import salome -from salome.smesh import smeshBuilder from .geomsmesh import geompy from .geomsmesh import geomPublishInFather @@ -160,8 +159,7 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \ # --- recherche des points en trop (externes au volume à remailler) # - on associe chaque extrémité du pipe à une face filling # - on part des disques aux extrémités du pipe - # - pour chaque disque, on prend les vertices de géométrie, - # on marque leur position relative à la face. + # - pour chaque disque, on prend les vertices de géométrie on marque leur position relative à la face. # - on s'arrete quand tous les noeuds sont dedans (idFillingFromBout, idisklim, idiskout) = elimineExtremitesPipe(ptEdgeFond, facesDefaut, centres, gptsdisks, nbsegCercle) @@ -173,8 +171,8 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \ # --- création des points du maillage du pipe sur la face de peau - (gptsdisks, idisklim) = creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, \ - ptEdgeFond, ptFisExtPi, edCircPeau, gptsdisks, idisklim, nbsegRad) + gptsdisks = creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, \ + ptEdgeFond, ptFisExtPi, edCircPeau, gptsdisks, idisklim, nbsegRad) # --- ajustement precis des points sur edgesPipeFissureExterneC diff --git a/src/Tools/blocFissure/gmu/construitMaillagePipe.py b/src/Tools/blocFissure/gmu/construitMaillagePipe.py index 13092be4d..17b570594 100644 --- a/src/Tools/blocFissure/gmu/construitMaillagePipe.py +++ b/src/Tools/blocFissure/gmu/construitMaillagePipe.py @@ -32,9 +32,12 @@ from .construitMaillagePipe_c import construitMaillagePipe_c from .construitMaillagePipe_d import construitMaillagePipe_d def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \ - nro_cas=None): + nro_cas=None): """maillage effectif du pipe""" logging.info('start') + logging.info("nbsegCercle = %d, nbsegRad = %d", nbsegCercle, nbsegRad) + logging.info("idisklim[0] = %d, idisklim[1] = %d", idisklim[0], idisklim[1]) + meshPipe = smesh.Mesh(None, "meshPipe") putName(meshPipe, "meshPipe", i_pref=nro_cas) @@ -55,14 +58,14 @@ def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \ mVols = list() # identifiants volumes maillage pipe for idisk in range(idisklim[0], idisklim[1]+1): # boucle sur les disques internes - #print ("\nidisk = {}".format(idisk)) + #logging.info(". Prise en compte du disque n°%d", idisk) # ----------------------------------------------------------------------- # --- Les points oldmpts = mptdsk mptdsk = construitMaillagePipe_a(idisk, \ - gptsdisks, idisklim, nbsegCercle, \ + gptsdisks, nbsegCercle, \ meshPipe, mptsdisks) # ----------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/gmu/construitMaillagePipe_a.py b/src/Tools/blocFissure/gmu/construitMaillagePipe_a.py index 596266968..087f882cf 100644 --- a/src/Tools/blocFissure/gmu/construitMaillagePipe_a.py +++ b/src/Tools/blocFissure/gmu/construitMaillagePipe_a.py @@ -22,7 +22,7 @@ from .geomsmesh import geompy def construitMaillagePipe_a(idisk, \ - gptsdisks, idisklim, nbsegCercle, \ + gptsdisks, nbsegCercle, \ meshPipe, mptsdisks): """Les points""" #logging.info('start') diff --git a/src/Tools/blocFissure/gmu/creePointsPipePeau.py b/src/Tools/blocFissure/gmu/creePointsPipePeau.py index e13105eb7..7936be3c7 100644 --- a/src/Tools/blocFissure/gmu/creePointsPipePeau.py +++ b/src/Tools/blocFissure/gmu/creePointsPipePeau.py @@ -33,33 +33,38 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, logging.info('start') for n_edges, edges in enumerate(listEdges): + idf = idFacesDebouchantes[n_edges] # indice de face débouchante (facesPipePeau) + logging.info("idf: %d", idf) if idf >= 0: gptdsk = list() if idf > 0: # idf vaut 0 ou 1 idf = -1 # si idf vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face) centre = ptEdgeFond[idFillingFromBout[n_edges]][idf] - name = "centre%d"%idf + name = "centre_{}".format(idf) geomPublish(initLog.debug, centre, name) vertPipePeau = ptFisExtPi[idFillingFromBout[n_edges]][idf] geomPublishInFather(initLog.debug, centre, vertPipePeau, "vertPipePeau") grpsEdgesCirc = edCircPeau[idFillingFromBout[n_edges]] # liste de groupes + edgesCirc = list() for grpEdgesCirc in grpsEdgesCirc: edgesCirc += geompy.ExtractShapes(grpEdgesCirc, geompy.ShapeType["EDGE"], False) - for k, edge in enumerate(edges): + logging.info("edgesCirc: %s", edgesCirc) + + for i_aux, edge in enumerate(edges): extrems = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], True) if geompy.MinDistance(centre, extrems[0]) < geompy.MinDistance(centre, extrems[1]): bout = extrems[1] else: bout = extrems[0] # ajustement du point extrémité (bout) sur l'edge circulaire en face de peau - logging.debug("edgesCirc: %s", edgesCirc) distEdgeCirc = [(geompy.MinDistance(bout, edgeCirc), k2, edgeCirc) for k2, edgeCirc in enumerate(edgesCirc)] distEdgeCirc.sort() logging.debug("distEdgeCirc: %s", distEdgeCirc) dist = projettePointSurCourbe(bout, distEdgeCirc[0][2]) - if (abs(dist) < 0.02) or (abs(1.-dist) < 0.02): # les points très proches d'une extrémité doivent y être mis précisément. + # les points très proches d'une extrémité doivent y être mis précisément. + if (abs(dist) < 0.02) or (abs(1.-dist) < 0.02): extrCircs = geompy.ExtractShapes(distEdgeCirc[0][2], geompy.ShapeType["VERTEX"], True) if geompy.MinDistance(bout, extrCircs[0]) < geompy.MinDistance(bout, extrCircs[1]): bout = extrCircs[0] @@ -67,7 +72,7 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, bout = extrCircs[1] else: bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], dist) - name ="bout%d"%k + name = "bout_{}";format(i_aux) geomPublishInFather(initLog.debug, centre, bout, name) # enregistrement des points dans la structure points = list() @@ -78,6 +83,8 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, points[0] = centre points[-1] = bout gptdsk.append(points) + + # Enregistrement des extrémités if n_edges == 0: gptsdisks[idisklim[0] -1] = gptdsk idisklim[0] = idisklim[0] -1 @@ -85,4 +92,4 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, gptsdisks[idisklim[1] +1] = gptdsk idisklim[1] = idisklim[1] +1 - return (gptsdisks, idisklim) + return gptsdisks From eb7885b577e8b570a49ff7e755b8a11302d8571e Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 15 Apr 2021 15:40:06 +0200 Subject: [PATCH 11/13] =?UTF-8?q?D=C3=A9coupage=20de=20claculePointsAxiaux?= =?UTF-8?q?Pipe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Tools/blocFissure/gmu/CMakeLists.txt | 3 + .../gmu/calculePointsAxiauxPipe.py | 133 +++--------------- .../gmu/calculePointsAxiauxPipe_a.py | 73 ++++++++++ .../gmu/calculePointsAxiauxPipe_b.py | 75 ++++++++++ .../gmu/calculePointsAxiauxPipe_c.py | 76 ++++++++++ .../blocFissure/gmu/creePointsPipePeau.py | 2 +- 6 files changed, 244 insertions(+), 118 deletions(-) create mode 100644 src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_a.py create mode 100644 src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_b.py create mode 100644 src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_c.py diff --git a/src/Tools/blocFissure/gmu/CMakeLists.txt b/src/Tools/blocFissure/gmu/CMakeLists.txt index 8fdcb3a6d..dfd9fc247 100644 --- a/src/Tools/blocFissure/gmu/CMakeLists.txt +++ b/src/Tools/blocFissure/gmu/CMakeLists.txt @@ -25,6 +25,9 @@ SET(plugin_SCRIPTS ajustePointsEdgePipeFissure.py blocDefaut.py calculePointsAxiauxPipe.py + calculePointsAxiauxPipe_a.py + calculePointsAxiauxPipe_b.py + calculePointsAxiauxPipe_c.py casStandard.py checkDecoupePartition.py commonSubShapes.py diff --git a/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe.py b/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe.py index f67262afc..5fdc48fb1 100644 --- a/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe.py +++ b/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe.py @@ -20,21 +20,18 @@ """Préparation maillage du pipe""" import logging -import math -from .geomsmesh import geompy -from .geomsmesh import smesh +from .calculePointsAxiauxPipe_a import calculePointsAxiauxPipe_a +from .calculePointsAxiauxPipe_b import calculePointsAxiauxPipe_b +from .calculePointsAxiauxPipe_c import calculePointsAxiauxPipe_c -from .putName import putName - -def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut, - centreFondFiss, wireFondFiss, wirePipeFiss, +def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut, \ + centreFondFiss, wireFondFiss, wirePipeFiss, \ lenSegPipe, rayonPipe, nbsegCercle, nbsegRad, \ nro_cas=None): """Préparation maillage du pipe : - - détections des points a respecter : jonction des edges/faces constituant - la face de fissure externe au pipe + - détections des points a respecter : jonction des edges/faces constituant la face de fissure externe au pipe - points sur les edges de fond de fissure et edges pipe/face fissure, - vecteurs tangents au fond de fissure (normal au disque maillé) """ @@ -42,117 +39,19 @@ def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut, logging.info('start') logging.info("Pour le cas n°%s", nro_cas) - # --- option de maillage selon le rayon de courbure du fond de fissure - lenEdgeFondExt = 0 - for edff in edgesFondFiss: - lenEdgeFondExt += geompy.BasicProperties(edff)[0] + # --- Maillage selon le rayon de courbure du fond de fissure - disfond = list() - for filling in facesDefaut: - disfond.append(geompy.MinDistance(centreFondFiss, filling)) - disfond.sort() - rcourb = disfond[0] - texte = "rcourb: {}, lenEdgeFondExt: {}, lenSegPipe: {}".format(rcourb, lenEdgeFondExt, lenSegPipe) - logging.info(texte) - nbSegQuart = 5 # on veut 5 segments min sur un quart de cercle - alpha = math.pi/(4*nbSegQuart) - deflexion = rcourb*(1.0 -math.cos(alpha)) - lgmin = lenSegPipe*0.25 - lgmax = lenSegPipe*1.5 - texte = "==> deflexion: {}, lgmin: {}, lgmax: {}".format(deflexion, lgmin, lgmax) - logging.info(texte) - - meshFondExt = smesh.Mesh(wireFondFiss) - putName(meshFondExt, "wireFondFiss", i_pref=nro_cas) - algo1d = meshFondExt.Segment() - hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure - putName(algo1d.GetSubMesh(), "wireFondFiss", i_pref=nro_cas) - putName(algo1d, "algo1d_wireFondFiss", i_pref=nro_cas) - putName(hypo1d, "hypo1d_wireFondFiss", i_pref=nro_cas) - - is_done = meshFondExt.Compute() - text = "calculePointsAxiauxPipe meshFondExt.Compute" - if is_done: - logging.info(text) - else: - text = "Erreur au calcul du maillage.\n" + text - logging.info(text) - raise Exception(text) - - ptGSdic = dict() # dictionnaire [paramètre sur la courbe] --> point géométrique - allNodeIds = meshFondExt.GetNodesId() - for nodeId in allNodeIds: - xyz = meshFondExt.GetNodeXYZ(nodeId) - #logging.debug("nodeId %s, coords %s", nodeId, str(xyz)) - point = geompy.MakeVertex(xyz[0], xyz[1], xyz[2]) - parametre, _, EdgeInWireIndex = geompy.MakeProjectionOnWire(point, wireFondFiss) # parametre compris entre 0 et 1 - edgeOrder = edgesIdByOrientation[EdgeInWireIndex] - ptGSdic[(edgeOrder, EdgeInWireIndex, parametre)] = point - #logging.debug("nodeId %s, parametre %s", nodeId, str(parametre)) - usort = sorted(ptGSdic) - logging.debug("nombre de points obtenus par deflexion %s",len(usort)) - - centres = list() - origins = list() - normals = list() - for edu in usort: - vertcx = ptGSdic[edu] - norm = geompy.MakeTangentOnCurve(edgesFondFiss[edu[1]], edu[2]) - plan = geompy.MakePlane(vertcx, norm, 3.*rayonPipe) - part = geompy.MakePartition([plan], [wirePipeFiss], list(), list(), geompy.ShapeType["VERTEX"], 0, list(), 0) - liste = geompy.ExtractShapes(part, geompy.ShapeType["VERTEX"], True) - if ( len(liste) == 5 ): # 4 coins du plan plus intersection recherchée - for point in liste: - if geompy.MinDistance(point, vertcx) < 1.1*rayonPipe: # les quatre coins sont plus loin - vertpx = point - break - centres.append(vertcx) - origins.append(vertpx) - normals.append(norm) -# name = "vertcx%d"%i -# geompy.addToStudyInFather(wireFondFiss, vertcx, name) -# name = "vertpx%d"%i -# geompy.addToStudyInFather(wireFondFiss, vertpx, name) -# name = "plan%d"%i -# geompy.addToStudyInFather(wireFondFiss, plan, name) - - # --- maillage du pipe étendu, sans tenir compte de l'intersection avec la face de peau - - logging.debug("nbsegCercle %s", nbsegCercle) - - # ----------------------------------------------------------------------- + meshFondFiss = calculePointsAxiauxPipe_a(facesDefaut, centreFondFiss, wireFondFiss, \ + lenSegPipe, \ + nro_cas) # --- points géométriques - gptsdisks = list() # vertices géométrie de tous les disques - raydisks = [list() for _ in range(nbsegCercle)] - for indice, centres_i in enumerate(centres): # boucle sur les disques - gptdsk = list() # vertices géométrie d'un disque - vertcx = centres_i - vertpx = origins[indice] - normal = normals[indice] - vec1 = geompy.MakeVector(vertcx, vertpx) + centres, origins, normals = calculePointsAxiauxPipe_b(meshFondFiss, \ + edgesFondFiss, edgesIdByOrientation, \ + wireFondFiss, wirePipeFiss, \ + rayonPipe) - points = [vertcx] # les points du rayon de référence - dist_0 = rayonPipe/float(nbsegRad) - for j_aux in range(nbsegRad): - point = geompy.MakeTranslationVectorDistance(vertcx, vec1, float(j_aux+1)*dist_0) - points.append(point) - gptdsk.append(points) - point = geompy.MakeTranslationVectorDistance(vertcx, vec1, 1.5*rayonPipe) - rayon = geompy.MakeLineTwoPnt(vertcx, point) - raydisks[0].append(rayon) - - angle_0 = 2.*math.pi/float(nbsegCercle) - for k_aux in range(nbsegCercle-1): - angle = float(k_aux+1)*angle_0 - pts = [vertcx] # les points d'un rayon obtenu par rotation - for j_aux in range(nbsegRad): - point = geompy.MakeRotation(points[j_aux+1], normal, angle) - pts.append(point) - gptdsk.append(pts) - ray = geompy.MakeRotation(rayon, normal, angle) - raydisks[k_aux+1].append(ray) - - gptsdisks.append(gptdsk) + gptsdisks, raydisks = calculePointsAxiauxPipe_c(centres, origins, normals, \ + rayonPipe, nbsegCercle, nbsegRad) return (centres, gptsdisks, raydisks) diff --git a/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_a.py b/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_a.py new file mode 100644 index 000000000..a0e07a1ef --- /dev/null +++ b/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_a.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +# 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 +# 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 +# +"""Maillage selon le rayon de courbure du fond de fissure""" + +import logging +import math + +from .geomsmesh import geompy +from .geomsmesh import smesh + +from .putName import putName + +def calculePointsAxiauxPipe_a(facesDefaut, centreFondFiss, wireFondFiss, \ + lenSegPipe, \ + nro_cas=None): + """Maillage selon le rayon de courbure du fond de fissure""" + + logging.info('start') + + # Rayon de courbure maximal + disfond = list() + for filling in facesDefaut: + disfond.append(geompy.MinDistance(centreFondFiss, filling)) + disfond.sort() + + texte = "rcourb: {}, lenSegPipe: {}".format(disfond[0], lenSegPipe) + logging.info(texte) + + # Maillage 1D + lgmin = lenSegPipe*0.25 + lgmax = lenSegPipe*1.5 + # la déflexion ets la distance maximale entre une arête du maillage et la courbe support + nbSegQuart = 5 # on veut 5 segments min sur un quart de cercle + alpha = math.pi/(4*nbSegQuart) + deflexion = disfond[0]*(1.0 -math.cos(alpha)) + texte = "==> lgmin: {}, lgmax: {}, deflexion: {}".format(deflexion, lgmin, lgmax) + logging.info(texte) + + meshFondFiss = smesh.Mesh(wireFondFiss) + putName(meshFondFiss, "wireFondFiss", i_pref=nro_cas) + algo1d = meshFondFiss.Segment() + hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure + putName(algo1d.GetSubMesh(), "wireFondFiss", i_pref=nro_cas) + putName(algo1d, "algo1d_wireFondFiss", i_pref=nro_cas) + putName(hypo1d, "hypo1d_wireFondFiss", i_pref=nro_cas) + + is_done = meshFondFiss.Compute() + text = "calculePointsAxiauxPipe meshFondFiss.Compute" + if is_done: + logging.info(text) + else: + text = "Erreur au calcul du maillage.\n" + text + logging.info(text) + raise Exception(text) + + return meshFondFiss diff --git a/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_b.py b/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_b.py new file mode 100644 index 000000000..3aa8c08ef --- /dev/null +++ b/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_b.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +# 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 +# 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 +# +"""Préparation maillage du pipe""" + +import logging + +from .geomsmesh import geompy +from .geomsmesh import geomPublishInFather + +from . import initLog + +def calculePointsAxiauxPipe_b(meshFondFiss, \ + edgesFondFiss, edgesIdByOrientation, \ + wireFondFiss, wirePipeFiss, \ + rayonPipe): + """Préparation maillage du pipe : + + - détections des points a respecter : jonction des edges/faces constituant la face de fissure externe au pipe + - points sur les edges de fond de fissure et edges pipe/face fissure, + - vecteurs tangents au fond de fissure (normal au disque maillé) + """ + + logging.info('start') + + ptGSdic = dict() # dictionnaire [paramètre sur la courbe] --> point géométrique + allNodeIds = meshFondFiss.GetNodesId() + for nodeId in allNodeIds: + xyz = meshFondFiss.GetNodeXYZ(nodeId) + #logging.debug("nodeId %s, coords %s", nodeId, str(xyz)) + point = geompy.MakeVertex(xyz[0], xyz[1], xyz[2]) + parametre, _, EdgeInWireIndex = geompy.MakeProjectionOnWire(point, wireFondFiss) # parametre compris entre 0 et 1 + edgeOrder = edgesIdByOrientation[EdgeInWireIndex] + ptGSdic[(edgeOrder, EdgeInWireIndex, parametre)] = point + #logging.debug("nodeId %s, parametre %s", nodeId, str(parametre)) + usort = sorted(ptGSdic) + logging.debug("nombre de points obtenus par deflexion : %s",len(usort)) + + centres = list() + origins = list() + normals = list() + for i_aux, edu in enumerate(usort): + vertcx = ptGSdic[edu] + geomPublishInFather(initLog.debug, wireFondFiss, vertcx, "vertcx_{}".format(i_aux)) + norm = geompy.MakeTangentOnCurve(edgesFondFiss[edu[1]], edu[2]) + plan = geompy.MakePlane(vertcx, norm, 3.*rayonPipe) + part = geompy.MakePartition([plan], [wirePipeFiss], list(), list(), geompy.ShapeType["VERTEX"], 0, list(), 0) + liste = geompy.ExtractShapes(part, geompy.ShapeType["VERTEX"], True) + if ( len(liste) == 5 ): # 4 coins du plan plus intersection recherchée + for point in liste: + if geompy.MinDistance(point, vertcx) < 1.1*rayonPipe: # les quatre coins sont plus loin + vertpx = point + geomPublishInFather(initLog.debug, wireFondFiss, vertpx, "vertpx_{}".format(i_aux)) + break + centres.append(vertcx) + origins.append(vertpx) + normals.append(norm) + + return centres, origins, normals diff --git a/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_c.py b/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_c.py new file mode 100644 index 000000000..182898999 --- /dev/null +++ b/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_c.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +# 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 +# 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 +# +"""Préparation maillage du pipe""" + +import logging +import math + +from .geomsmesh import geompy + +def calculePointsAxiauxPipe_c(centres, origins, normals, \ + rayonPipe, nbsegCercle, nbsegRad): + """Préparation maillage du pipe : + + - détections des points a respecter : jonction des edges/faces constituant la face de fissure externe au pipe + - points sur les edges de fond de fissure et edges pipe/face fissure, + - vecteurs tangents au fond de fissure (normal au disque maillé) + """ + + logging.info('start') + logging.debug("nbsegCercle = %d, nbsegRad = %d", nbsegCercle, nbsegRad) + + # ----------------------------------------------------------------------- + # --- points géométriques + + gptsdisks = list() # vertices géométrie de tous les disques + raydisks = [list() for _ in range(nbsegCercle)] + +# boucle sur les disques + for indice, centres_i in enumerate(centres): + gptdsk = list() # vertices géométrie d'un disque + vertcx = centres_i + vertpx = origins[indice] + normal = normals[indice] + vec1 = geompy.MakeVector(vertcx, vertpx) + + points = [vertcx] # les points du rayon de référence + dist_0 = rayonPipe/float(nbsegRad) + for j_aux in range(nbsegRad): + point = geompy.MakeTranslationVectorDistance(vertcx, vec1, float(j_aux+1)*dist_0) + points.append(point) + gptdsk.append(points) + point = geompy.MakeTranslationVectorDistance(vertcx, vec1, 1.5*rayonPipe) + rayon = geompy.MakeLineTwoPnt(vertcx, point) + raydisks[0].append(rayon) + + angle_0 = 2.*math.pi/float(nbsegCercle) + for k_aux in range(nbsegCercle-1): + angle = float(k_aux+1)*angle_0 + pts = [vertcx] # les points d'un rayon obtenu par rotation + for j_aux in range(nbsegRad): + point = geompy.MakeRotation(points[j_aux+1], normal, angle) + pts.append(point) + gptdsk.append(pts) + ray = geompy.MakeRotation(rayon, normal, angle) + raydisks[k_aux+1].append(ray) + + gptsdisks.append(gptdsk) + + return gptsdisks, raydisks diff --git a/src/Tools/blocFissure/gmu/creePointsPipePeau.py b/src/Tools/blocFissure/gmu/creePointsPipePeau.py index 7936be3c7..5d967dffb 100644 --- a/src/Tools/blocFissure/gmu/creePointsPipePeau.py +++ b/src/Tools/blocFissure/gmu/creePointsPipePeau.py @@ -72,7 +72,7 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, bout = extrCircs[1] else: bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], dist) - name = "bout_{}";format(i_aux) + name = "bout_{}".format(i_aux) geomPublishInFather(initLog.debug, centre, bout, name) # enregistrement des points dans la structure points = list() From 2cf6435f1492b63b9adf4e8256d88968638ed9bf Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 15 Apr 2021 16:05:00 +0200 Subject: [PATCH 12/13] 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) From 13469a2390c6d6061a023967950aa3b3a1196bb2 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 15 Apr 2021 20:30:17 +0200 Subject: [PATCH 13/13] pb du addToStudy() failed --- src/Tools/blocFissure/gmu/insereFissureLongue_c.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_c.py b/src/Tools/blocFissure/gmu/insereFissureLongue_c.py index 3d4fe3e0a..c8b8578d4 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_c.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_c.py @@ -52,6 +52,8 @@ def insereFissureLongue_c (pipeFondFiss, disques, rayons, demiCercles, demiCercl putName(algo2d, "QUADRANGLE", i_pref=nro_cas) for i_aux, face in enumerate(disques): + #print (i_aux) + # la commande suivante entraîne addToStudy() failed algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.RADIAL_QUAD,geom=face) putName(algo2d.GetSubMesh(), "disque", i_aux, nro_cas) putName(algo2d, "RADIAL_QUAD", i_aux, nro_cas)