Salome HOME
Merge branch 'master' into gni/evolution
[modules/smesh.git] / src / Tools / blocFissure / gmu / mailleAretesEtJonction.py
index 6c249374059d8edd607f8118d7cf7d642595ce94..101b06d4f03fe99b664a84917fa4d9bbf6b92723 100644 (file)
@@ -1,4 +1,22 @@
 # -*- coding: utf-8 -*-
+# Copyright (C) 2014-2020  EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# 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
+#
 
 import logging
 
@@ -7,7 +25,7 @@ from .geomsmesh import smesh
 import SMESH
 
 from .putName import putName
-  
+
 def mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, lgAretesVives):
   """
   edges de bord, faces défaut à respecter
@@ -30,9 +48,10 @@ def mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, lgAretesVives):
   nbAdd = skinFaces.AddFrom( internalBoundary.GetMesh() )
 
   # --- maillage des éventuelles arêtes vives entre faces reconstruites
-  
+
   grpAretesVives = None
-  if len(aretesVivesCoupees) > 0:
+  if aretesVivesCoupees:
+
     aretesVivesC = geompy.MakeCompound(aretesVivesCoupees)
     meshAretesVives = smesh.Mesh(aretesVivesC)
     algo1d = meshAretesVives.Segment()
@@ -40,9 +59,17 @@ def mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, lgAretesVives):
     putName(algo1d.GetSubMesh(), "aretesVives")
     putName(algo1d, "algo1d_aretesVives")
     putName(hypo1d, "hypo1d_aretesVives")
-    isDone = meshAretesVives.Compute()
-    logging.info("aretesVives fini")
+
+    is_done = meshAretesVives.Compute()
+    text = "meshAretesVives.Compute"
+    if is_done:
+      logging.info(text+" OK")
+    else:
+      text = "Erreur au calcul du maillage.\n" + text
+      logging.info(text)
+      raise Exception(text)
+
     grpAretesVives = meshAretesVives.CreateEmptyGroup( SMESH.EDGE, 'grpAretesVives' )
     nbAdd = grpAretesVives.AddFrom( meshAretesVives.GetMesh() )
 
-  return (internalBoundary, bordsLibres, grpAretesVives)
\ No newline at end of file
+  return (internalBoundary, bordsLibres, grpAretesVives)