Salome HOME
Affichage du diagnostic
authorGERALD NICOLAS <D68518@dsp0864451.atlas.edf.fr>
Thu, 15 Apr 2021 11:40:29 +0000 (13:40 +0200)
committerGERALD NICOLAS <D68518@dsp0864451.atlas.edf.fr>
Thu, 15 Apr 2021 11:40:29 +0000 (13:40 +0200)
src/Tools/blocFissure/CasTests/execution_Cas.py
src/Tools/blocFissure/gmu/getStatsMaillageFissure.py

index 3ca435e59bd2dbb2203742bcfb149f62d9717c92..553e3b1030f77dd736eb6f8de53ab30a5a912b59 100644 (file)
@@ -23,9 +23,7 @@ import traceback
 
 import logging
 
 
 import logging
 
-from blocFissure import gmu
 from blocFissure.gmu import initLog
 from blocFissure.gmu import initLog
-from blocFissure.gmu import geomsmesh
 from blocFissure.gmu.casStandard import casStandard
 
 # -----------------------------------------------------------------------------------------------
 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, 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
   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()
     ok_maillage = cas.executeProbleme()
   except:
     traceback.print_exc()
-    texte = "Problème avec le cas n° {}, '{}'\n".format(n_cas,nom)
     ok_maillage = False
     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
 #=============================================================
   print(ligne)
   return ok_maillage, texte
 #=============================================================
index 317b6c9353eb84ae228d77f7f708821db8c34fde..49a93052fc81a71cc91947d8557b24dc60aafc38 100644 (file)
@@ -51,7 +51,9 @@ def getStatsMaillageFissure(maillage, referencesMaillageFissure, maillageFissure
     text_2 = ""
     ok_maillage = True
     with open(fichierStatMaillageFissure, "w") as fic_stat :
     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
         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])
         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:
         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")
         text += ": {} reference: {} calcul: {}".format(key,referencesMaillageFissure[key],d_resu[key])
         logging.info(text)
         fic_stat.write(text+"\n")