From 0940378b4a973137093a388055271e55ec0b11e6 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Wed, 27 Jan 2021 11:49:35 +0100 Subject: [PATCH] groupongeom avant compute --- .../blocFissure/CasTests/fissure_Coude.py | 4 ++-- .../blocFissure/gmu/insereFissureGenerale.py | 15 ++++++++---- src/Tools/blocFissure/gmu/meshBlocPart.py | 24 +++++++++---------- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/fissure_Coude.py b/src/Tools/blocFissure/CasTests/fissure_Coude.py index d9e368428..56cdbe4b7 100644 --- a/src/Tools/blocFissure/CasTests/fissure_Coude.py +++ b/src/Tools/blocFissure/CasTests/fissure_Coude.py @@ -258,8 +258,6 @@ class fissure_Coude(fissureGenerique): smesh.SetName(algo1d_long_p2, "algo1d_long_p2") smesh.SetName(hypo1d_long_p2, "hypo1d_long_p2") - isDone = maillageSain.Compute() - mp1 = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE) mp2 = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE) ext = maillageSain.GroupOnGeom(EXTUBE,'EXTUBE',SMESH.FACE) @@ -269,6 +267,8 @@ class fissure_Coude(fissureGenerique): pex = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE) cou = maillageSain.GroupOnGeom(COUDE,'COUDSAIN',SMESH.VOLUME) + isDone = maillageSain.Compute() + return [maillageSain, True] # True : maillage hexa # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/gmu/insereFissureGenerale.py b/src/Tools/blocFissure/gmu/insereFissureGenerale.py index 3c12d89b7..b65478d75 100644 --- a/src/Tools/blocFissure/gmu/insereFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/insereFissureGenerale.py @@ -721,6 +721,7 @@ def insereFissureGenerale(maillagesSains, meshFondExt = smesh.Mesh(wireFondFiss) algo1d = meshFondExt.Segment() hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure + is_done = meshFondExt.Compute() text = "meshFondExt.Compute" if is_done: @@ -1205,7 +1206,8 @@ def insereFissureGenerale(maillagesSains, # --- maillage des éventuelles arêtes vives entre faces reconstruites - if len(aretesVivesCoupees) > 0: + if aretesVivesCoupees: + aretesVivesC = geompy.MakeCompound(aretesVivesCoupees) meshAretesVives = smesh.Mesh(aretesVivesC) algo1d = meshAretesVives.Segment() @@ -1213,6 +1215,7 @@ def insereFissureGenerale(maillagesSains, putName(algo1d.GetSubMesh(), "aretesVives") putName(algo1d, "algo1d_aretesVives") putName(hypo1d, "hypo1d_aretesVives") + is_done = meshAretesVives.Compute() text = "meshAretesVives.Compute" if is_done: @@ -1248,6 +1251,10 @@ def insereFissureGenerale(maillagesSains, putName(algo1d, "algo1d_edgeFissPeau") putName(hypo1d, "hypo1d_edgeFissPeau") + grpFaceFissureExterne = meshFaceFiss.GroupOnGeom(faceFissureExterne, "fisOutPi", SMESH.FACE) + grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE) + grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE) + is_done = meshFaceFiss.Compute() text = "meshFaceFiss.Compute" if is_done: @@ -1257,10 +1264,6 @@ def insereFissureGenerale(maillagesSains, logging.info(text) raise Exception(text) - grpFaceFissureExterne = meshFaceFiss.GroupOnGeom(faceFissureExterne, "fisOutPi", SMESH.FACE) - grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE) - grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE) - # --- maillage faces de peau boutFromIfil = [None for i in range(nbFacesFilling)] @@ -1350,6 +1353,7 @@ def insereFissureGenerale(maillagesSains, text = "Erreur au calcul du maillage.\n" + text logging.info(text) raise Exception(text) + GroupFaces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil ) nbAdd = GroupFaces.AddFrom( meshFacePeau.GetMesh() ) meshesFacesPeau.append(meshFacePeau) @@ -1387,6 +1391,7 @@ def insereFissureGenerale(maillagesSains, putName(algo3d.GetSubMesh(), "boiteDefaut") putName(algo3d, "algo3d_boiteDefaut") putName(meshBoiteDefaut, "boiteDefaut") + is_done = meshBoiteDefaut.Compute() text = "meshBoiteDefaut.Compute" if is_done: diff --git a/src/Tools/blocFissure/gmu/meshBlocPart.py b/src/Tools/blocFissure/gmu/meshBlocPart.py index a273b4916..1a6cf33e4 100644 --- a/src/Tools/blocFissure/gmu/meshBlocPart.py +++ b/src/Tools/blocFissure/gmu/meshBlocPart.py @@ -185,8 +185,6 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle putName(algo1d, "algo1d_bordsLibres") putName(hypo1d, "hypo1d_bordsLibres") - #isDone = bloc1.Compute() - if not declareAlgoEllipsoideFirst: algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep) hypo3d = algo3d.MaxElementVolume(1000.0) @@ -194,17 +192,6 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle putName(algo3d, "algo3d_ellipsoide") putName(hypo3d, "hypo3d_ellipsoide") - is_done = bloc1.Compute() - text = "bloc1.Compute" - if is_done: - logging.info(text+" OK") - else: - text = "Erreur au calcul du maillage.\n" + text - logging.info(text) - raise Exception(text) - - nbRemoved = bloc1.RemoveOrphanNodes() - faceFissure1 = bloc1.GroupOnGeom(faceFissure,'FACE1',SMESH.FACE) noeudsFondFissure = bloc1.GroupOnGeom(gencnt,'nfondfis',SMESH.NODE) @@ -217,6 +204,17 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle name = "faceExterneBloc_%d"%i groups_faceExterneBloc.append(bloc1.GroupOnGeom(facesExtBloc_i, name, SMESH.FACE)) + is_done = bloc1.Compute() + text = "bloc1.Compute" + if is_done: + logging.info(text+" OK") + else: + text = "Erreur au calcul du maillage.\n" + text + logging.info(text) + raise Exception(text) + + nbRemoved = bloc1.RemoveOrphanNodes() + skinBlocMeshes = list() for i, groups_faceCommuneEllipsoideBloc_i in enumerate(groups_faceCommuneEllipsoideBloc): name = "faceCommuneEllipsoideBloc_%d"%i -- 2.39.2