Salome HOME
Simplification
[modules/smesh.git] / src / Tools / blocFissure / gmu / mailleAretesEtJonction.py
index 101b06d4f03fe99b664a84917fa4d9bbf6b92723..e35e5af3eecb76b195a6af98f826e05336ba157f 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Copyright (C) 2014-2020  EDF R&D
+# Copyright (C) 2014-2021  EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+"""edges de bord, faces défaut à respecter"""
 
 import logging
 
+import SMESH
+
 from .geomsmesh import geompy
 from .geomsmesh import smesh
-import SMESH
 
 from .putName import putName
 
-def mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, lgAretesVives):
-  """
-  edges de bord, faces défaut à respecter
-  """
+def mailleAretesEtJonction (internalBoundary, aretesVivesCoupees, lgAretesVives, \
+                            nro_cas=-1):
+  """edges de bord, faces défaut à respecter"""
   logging.info('start')
+  logging.info("Pour le cas n°%d", nro_cas)
 
-  aFilterManager = smesh.CreateFilterManager()
-  nbAdded, internalBoundary, _NoneGroup = internalBoundary.MakeBoundaryElements( SMESH.BND_1DFROM2D, '', '', 0, [  ])
-  criteres = []
+  _ = smesh.CreateFilterManager()
+  _, internalBoundary, _NoneGroup = internalBoundary.MakeBoundaryElements( SMESH.BND_1DFROM2D, '', '', 0, [  ])
+  criteres = list()
   unCritere = smesh.GetCriterion(SMESH.EDGE,SMESH.FT_FreeBorders,SMESH.FT_Undefined,0)
   criteres.append(unCritere)
   filtre = smesh.GetFilterFromCriteria(criteres)
   bordsLibres = internalBoundary.MakeGroupByFilter( 'bords', filtre )
-  smesh.SetName(bordsLibres, 'bordsLibres')
+  putName(bordsLibres, 'bordsLibres', i_pref=nro_cas)
 
   # --- pour aider l'algo hexa-tetra à ne pas mettre de pyramides à l'exterieur des volumes repliés sur eux-mêmes
   #     on désigne les faces de peau en quadrangles par le groupe "skinFaces"
 
   skinFaces = internalBoundary.CreateEmptyGroup( SMESH.FACE, 'skinFaces' )
-  nbAdd = skinFaces.AddFrom( internalBoundary.GetMesh() )
+  _ = skinFaces.AddFrom( internalBoundary.GetMesh() )
 
   # --- maillage des éventuelles arêtes vives entre faces reconstruites
 
@@ -56,9 +58,9 @@ def mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, lgAretesVives):
     meshAretesVives = smesh.Mesh(aretesVivesC)
     algo1d = meshAretesVives.Segment()
     hypo1d = algo1d.LocalLength(lgAretesVives,[],1e-07)
-    putName(algo1d.GetSubMesh(), "aretesVives")
-    putName(algo1d, "algo1d_aretesVives")
-    putName(hypo1d, "hypo1d_aretesVives")
+    putName(algo1d.GetSubMesh(), "aretesVives", i_pref=nro_cas)
+    putName(algo1d, "algo1d_aretesVives", i_pref=nro_cas)
+    putName(hypo1d, "hypo1d_aretesVives", i_pref=nro_cas)
 
     is_done = meshAretesVives.Compute()
     text = "meshAretesVives.Compute"
@@ -70,6 +72,6 @@ def mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, lgAretesVives):
       raise Exception(text)
 
     grpAretesVives = meshAretesVives.CreateEmptyGroup( SMESH.EDGE, 'grpAretesVives' )
-    nbAdd = grpAretesVives.AddFrom( meshAretesVives.GetMesh() )
+    _ = grpAretesVives.AddFrom( meshAretesVives.GetMesh() )
 
   return (internalBoundary, bordsLibres, grpAretesVives)