Salome HOME
Python message when groups of nodes are missing
authorPaul RASCLE <paul.rascle@edf.fr>
Mon, 8 Feb 2016 13:14:37 +0000 (14:14 +0100)
committerPaul RASCLE <paul.rascle@edf.fr>
Mon, 8 Feb 2016 13:14:37 +0000 (14:14 +0100)
src/HYDROTools/interpolZ.py

index d803355bc49c057f5a8325e2bea57168e0e54213..268c0e350cf57ad4f65061f7b565d51340f4d2f0 100644 (file)
@@ -190,6 +190,13 @@ def interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef):
   ([maillagePlat], status) = smesh.CreateMeshesFromMED(fichierMaillage)
   groups = maillagePlat.GetGroups()
   
+  grpns = [grp for grp in groups if grp.GetType() == SMESH.NODE]
+  if len(grpns) == 0:
+    print "Problem! There are no groups of nodes in the mesh!"
+    print "Please create at least the groups of nodes corresponding to each region of the HYDRO case" 
+    return {}
+    
+  
   for grp in groups:
     if grp.GetType() == SMESH.NODE:
       grpName = grp.GetName()