.. literalinclude:: ../files/tutorial_1.py
- :lines: 62-94
+ :lines: 52-85
.. note::
Download the files
One proceeds here to refinement according to zones. To pass from the initial mesh to the mesh 'M_1', one uses a box framing the z=1 plane and a sphere centered on the origin with radius 1.05. Then to pass from the mesh 'M_1' to the mesh 'M_2', one replaces the sphere by a box framing the cube on side 0.5, pointing on the origin and the meshes in the very first zone are unrefined.
.. literalinclude:: ../files/tutorial_2.py
- :lines: 62-104
+ :lines: 52-95
.. note::
Download the files
To adapt the H_1 mesh resulting from the Iter_1 iteration, two alternatives are applied. In the first, Iter_2, the field is a scalar field of indicators of error and one cuts out the 1.5% of elements where the error is largest. In the second alternative, Iter_2_bis, one is based on a vector field and one examines the jump of this vector between an element and its neighbors: one will cut out where the infinite standard of this jump is higher than the absolute threshold of 0.0001.
.. literalinclude:: ../files/tutorial_3.py
- :lines: 62-133
+ :lines: 52-124
.. note::
Download the files
Scheme YACS carrying out this adaptation is downloadable.
.. literalinclude:: ../files/tutorial_4.py
- :lines: 62-120
+ :lines: 52-111
.. note::
Download the files
In the case presented here, one for the first time refines all the elements contained in a bored disk, then in one second iteration, all the elements contained in a rectangle. One will note the use of the follow-up of the circular borders of the field.
.. literalinclude:: ../files/tutorial_5.py
- :lines: 62-104
+ :lines: 52-95
.. note::
Download the files
Exemple de couplage HOMARD-Salome
Copyright EDF-R&D 1996, 2010, 2014
"""
-__revision__ = "V1.8"
+__revision__ = "V1.9"
#
import os
import sys
#
# ==================================
-# Repertoire a personnaliser
-# Ce repertoire contiendra les fichiers de resultats : maill.01.med, maill.02.med, maill.03.med
-if os.environ.has_key("LOGNAME") :
- user = os.environ ["LOGNAME"]
-else :
- user = "anonymous"
-dircase = os.path.join( os.sep, "tmp", "HOMARD_"+user)
-if not os.path.isdir(dircase) :
- os.mkdir (dircase)
-dircase = os.path.join( dircase, "tutorial_1" )
-if not os.path.isdir(dircase) :
- os.mkdir (dircase)
-# ==================================
-# Ce repertoire contient les fichiers de donnees : tutorial_1.00.med
pathHomard = os.getenv('HOMARD_ROOT_DIR')
+# Repertoire des donnees du tutorial
data_dir = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
+data_dir = os.path.normpath(data_dir)
sys.path.append(data_dir)
from tutorial_util import gzip_gunzip
+from tutorial_util import creation_dircase
+# ==================================
+dircase = creation_dircase(1)
gzip_gunzip(data_dir, 1, -1)
# ==================================
#
Iter_1_1.SetMeshName('MESH')
Iter_1_1.SetMeshFile(dircase+'/maill.01.med')
Iter_1_1.AssociateHypo('Hypo_1')
-codret = Iter_1_1.Compute(1, 2)
+error = Iter_1_1.Compute(1, 2)
# Iteration "Iter_1_2"
Iter_1_2 = Iter_1_1.NextIteration('Iter_1_2')
Iter_1_2.SetMeshName('MESH')
Iter_1_2.SetMeshFile(dircase+'/maill.02.med')
Iter_1_2.AssociateHypo('Hypo_1')
-codret = Iter_1_2.Compute(1, 2)
+error = Iter_1_2.Compute(1, 2)
# Iteration "Iter_1_3"
Iter_1_3 = Iter_1_2.NextIteration('Iter_1_3')
Iter_1_3.SetMeshName('MESH')
Iter_1_3.SetMeshFile(dircase+'/maill.03.med')
Iter_1_3.AssociateHypo('Hypo_1')
-codret = Iter_1_3.Compute(1, 2)
+error = Iter_1_3.Compute(1, 2)
# ==================================
gzip_gunzip(data_dir, 1, 1)
Exemple de couplage HOMARD-Salome
Copyright EDF-R&D 1996, 2010, 2014
"""
-__revision__ = "V1.9"
+__revision__ = "V1.10"
#
import os
import sys
#
# ==================================
-# Repertoire a personnaliser
-# Ce repertoire contiendra les fichiers de resultats : maill.01.med, maill.02.med
-if os.environ.has_key("LOGNAME") :
- user = os.environ ["LOGNAME"]
-else :
- user = "anonymous"
-dircase = os.path.join( os.sep, "tmp", "HOMARD_"+user)
-if not os.path.isdir(dircase) :
- os.mkdir (dircase)
-dircase = os.path.join( dircase, "tutorial_2" )
-if not os.path.isdir(dircase) :
- os.mkdir (dircase)
-# ==================================
-# Ce repertoire contient les fichiers de donnees : tutorial_2.00.med
pathHomard = os.getenv('HOMARD_ROOT_DIR')
+# Repertoire des donnees du tutorial
data_dir = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
+data_dir = os.path.normpath(data_dir)
sys.path.append(data_dir)
from tutorial_util import gzip_gunzip
+from tutorial_util import creation_dircase
+# ==================================
+dircase = creation_dircase(2)
gzip_gunzip(data_dir, 2, -1)
# ==================================
#
Iter_2_1.SetMeshName('M_1')
Iter_2_1.SetMeshFile(dircase+'/maill.01.med')
Iter_2_1.AssociateHypo('Hypo_2')
-codret = Iter_2_1.Compute(1, 2)
+error = Iter_2_1.Compute(1, 2)
#
# Iteration "Iter_2_2"
# ====================
Iter_2_2.SetMeshName('M_2')
Iter_2_2.SetMeshFile(dircase+'/maill.02.med')
Iter_2_2.AssociateHypo('Hypo_2_bis')
-codret = Iter_2_2.Compute(1, 2)
+error = Iter_2_2.Compute(1, 2)
# ==================================
gzip_gunzip(data_dir, 2, 1)
Exemple de couplage HOMARD-Salome
Copyright EDF-R&D 1996, 2010, 2014
"""
-__revision__ = "V1.8"
+__revision__ = "V1.9"
#
import os
import sys
#
# ==================================
-# Repertoire a personnaliser
-# Ce repertoire contiendra les fichiers de resultats : maill.01.med, maill.02.med
-if os.environ.has_key("LOGNAME") :
- user = os.environ ["LOGNAME"]
-else :
- user = "anonymous"
-dircase = os.path.join( os.sep, "tmp", "HOMARD_"+user)
-if not os.path.isdir(dircase) :
- os.mkdir (dircase)
-dircase = os.path.join( dircase, "tutorial_3" )
-if not os.path.isdir(dircase) :
- os.mkdir (dircase)
-# ==================================
-# Ce repertoire contient les fichiers de donnees : tutorial_3.00.med, tutorial_3.01.med
pathHomard = os.getenv('HOMARD_ROOT_DIR')
+# Repertoire des donnees du tutorial
data_dir = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
+data_dir = os.path.normpath(data_dir)
sys.path.append(data_dir)
from tutorial_util import gzip_gunzip
+from tutorial_util import creation_dircase
+# ==================================
+dircase = creation_dircase(3)
gzip_gunzip(data_dir, 3, -1)
# ==================================
#
Iter_3_1.SetFieldFile(data_dir+'/tutorial_3.00.med')
Iter_3_1.SetTimeStepRank( 1, 1)
Iter_3_1.AssociateHypo('Hypo_0vers1')
-codret = Iter_3_1.Compute(1, 2)
+error = Iter_3_1.Compute(1, 2)
#
# Iteration "Iter_3_2"
# ====================
Iter_3_2.SetFieldFile(data_dir+'/tutorial_3.01.med')
Iter_3_2.SetTimeStepRank(1, 1)
Iter_3_2.AssociateHypo('Hypo_1vers2')
-codret = Iter_3_2.Compute(1, 2)
+error = Iter_3_2.Compute(1, 2)
#
# Iteration "Iter_3_2_bis"
# ========================
Iter_3_2_bis.SetFieldFile(data_dir+'/tutorial_3.01.med')
Iter_3_2_bis.SetTimeStepRank(1, 1)
Iter_3_2_bis.AssociateHypo('Hypo_1vers2_bis')
-codret = Iter_3_2_bis.Compute(1, 2)
+error = Iter_3_2_bis.Compute(1, 2)
# ==================================
gzip_gunzip(data_dir, 3, 1)
Exemple de couplage HOMARD-Salome
Copyright EDF-R&D 1996, 2011, 2014
"""
-__revision__ = "V2.4"
+__revision__ = "V2.5"
#
import os
import sys
#
# ==================================
-# Repertoire a personnaliser
-# Ce repertoire contiendra les fichiers de resultats : maill.01.med, maill.02.med, maill.03.med
-if os.environ.has_key("LOGNAME") :
- user = os.environ ["LOGNAME"]
-else :
- user = "anonymous"
-dircase = os.path.join( os.sep, "tmp", "HOMARD_"+user)
-if not os.path.isdir(dircase) :
- os.mkdir (dircase)
-dircase = os.path.join( dircase, "tutorial_4" )
-if not os.path.isdir(dircase) :
- os.mkdir (dircase)
-# ==================================
-# Ce repertoire contient les fichiers de donnees : tutorial_4.00.med, tutorial_4.fr.med
pathHomard = os.getenv('HOMARD_ROOT_DIR')
+# Repertoire des donnees du tutorial
data_dir = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
+data_dir = os.path.normpath(data_dir)
sys.path.append(data_dir)
from tutorial_util import gzip_gunzip
+from tutorial_util import creation_dircase
+# ==================================
+dircase = creation_dircase(4)
gzip_gunzip(data_dir, 4, -1)
# ==================================
#
Iter_4_1.SetMeshName('PIQUAGE_1')
Iter_4_1.SetMeshFile(dircase+'/maill.01.med')
Iter_4_1.AssociateHypo('Hypo_4')
-codret = Iter_4_1.Compute(1, 2)
+error = Iter_4_1.Compute(1, 2)
# Iteration Iter_4_2 : raffinement selon les faces externes
Iter_4_2 = Iter_4_1.NextIteration('Iter_4_2')
Iter_4_2.SetMeshName('PIQUAGE_2')
Iter_4_2.SetMeshFile(dircase+'/maill.02.med')
Iter_4_2.AssociateHypo('Hypo_4_bis')
-codret = Iter_4_2.Compute(1, 2)
+error = Iter_4_2.Compute(1, 2)
# Iteration Iter_4_3 : second raffinement selon les faces externes
Iter_4_3 = Iter_4_2.NextIteration('Iter_4_3')
Iter_4_3.SetMeshName('PIQUAGE_3')
Iter_4_3.SetMeshFile(dircase+'/maill.03.med')
Iter_4_3.AssociateHypo('Hypo_4_bis')
-codret = Iter_4_3.Compute(1, 2)
+error = Iter_4_3.Compute(1, 2)
# ==================================
gzip_gunzip(data_dir, 4, 1)
Exemple de couplage HOMARD-Salome
Copyright EDF-R&D 1996, 2010, 2014
"""
-__revision__ = "V1.7"
+__revision__ = "V1.8"
#
import os
import sys
#
# ==================================
-# Repertoire a personnaliser
-# Ce repertoire contiendra les fichiers de resultats : maill.01.med, maill.02.med
-if os.environ.has_key("LOGNAME") :
- user = os.environ ["LOGNAME"]
-else :
- user = "anonymous"
-dircase = os.path.join( os.sep, "tmp", "HOMARD_"+user)
-if not os.path.isdir(dircase) :
- os.mkdir (dircase)
-dircase = os.path.join( dircase, "tutorial_5" )
-if not os.path.isdir(dircase) :
- os.mkdir (dircase)
-# ==================================
-# Ce repertoire contient les fichiers de donnees : tutorial_5.00.med, tutorial_5.fr.med
pathHomard = os.getenv('HOMARD_ROOT_DIR')
+# Repertoire des donnees du tutorial
data_dir = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
+data_dir = os.path.normpath(data_dir)
sys.path.append(data_dir)
from tutorial_util import gzip_gunzip
+from tutorial_util import creation_dircase
+# ==================================
+dircase = creation_dircase(5)
gzip_gunzip(data_dir, 5, -1)
# ==================================
#
Iter_5_1.SetMeshName('COEUR_2D_01')
Iter_5_1.SetMeshFile(dircase+'/maill.01.med')
Iter_5_1.AssociateHypo('Hypo_5')
-codret = Iter_5_1.Compute(1, 2)
+error = Iter_5_1.Compute(1, 2)
#
# Iteration "Iter_5_2"
# ====================
Iter_5_2.SetMeshName('COEUR_2D_02')
Iter_5_2.SetMeshFile(dircase+'/maill.02.med')
Iter_5_2.AssociateHypo('Hypo_5_bis')
-codret = Iter_5_2.Compute(1, 2)
+error = Iter_5_2.Compute(1, 2)
# ==================================
gzip_gunzip(data_dir, 5, 1)
Python script for HOMARD
Copyright EDF-R&D 2014
"""
-__revision__ = "V1.0"
+__revision__ = "V1.1"
import os
import sys
+
+pathHomard = os.getenv('HOMARD_ROOT_DIR')
+# Repertoire des tests
+Rep_Test = os.path.join(pathHomard, "share", "salome", "resources", "homard")
+Rep_Test = os.path.normpath(Rep_Test)
+sys.path.append(Rep_Test)
+from test_util import remove_dir
+
#========================================================================
#========================================================================
def gzip_gunzip(data_dir, num_tuto, option) :
#
#========================================================================
#========================================================================
+def creation_dircase(num_tuto) :
+ """
+Creation of a directory for the results of tutorial_x
+num_tuto: number of the tutorial
+Copyright EDF-R&D 2014
+ """
+#
+ if os.environ.has_key("LOGNAME") :
+ user = os.environ ["LOGNAME"]
+ else :
+ user = "anonymous"
+ dircase = os.path.join( os.sep, "tmp", "HOMARD_"+user)
+ if not os.path.isdir(dircase) :
+ os.mkdir (dircase)
+ dirtuto_basis = "tutorial_%d" % num_tuto
+ dircase = os.path.join( dircase, dirtuto_basis )
+ if os.path.isdir(dircase) :
+ remove_dir(dircase)
+ os.mkdir (dircase)
+#
+ return dircase
+#========================================================================
+#========================================================================
+#
* le maillage produit porte toujours le même nom. Cela ne pose pas de problème car il est stocké dans des fichiers différents.
.. literalinclude:: ../files/tutorial_1.py
- :lines: 62-94
+ :lines: 52-85
.. note::
Téléchargement des fichiers
On procède ici au raffinement selon des zones. Pour passer du maillage initial au maillage 'M_1', on utilise une boîte encadrant le plan z=1 et une sphère centrée sur l'origine de rayon 1.05. Puis pour passer du maillage 'M_1' au maillage 'M_2', on remplace la sphère par une boîte encadrant le cube de côté 0.5, pointant sur l'origine et on déraffine les mailles contenues dans la toute première zone.
.. literalinclude:: ../files/tutorial_2.py
- :lines: 62-104
+ :lines: 52-95
.. note::
Téléchargement des fichiers
Pour adapter le maillage H_1 issu de l'itération Iter_1, deux variantes sont appliquées. Dans la première, Iter_2, le champ est un champ scalaire d'indicateurs d'erreur et on découpe les 1.5% de mailles où l'erreur est la plus grande. Dans la seconde variante, Iter_2_bis, on se base sur un champ vectoriel et on examine le saut de ce vecteur entre une maille et ses voisines : on découpera là où la norme infinie de ce saut est supérieure au seuil absolu de 0.0001.
.. literalinclude:: ../files/tutorial_3.py
- :lines: 62-133
+ :lines: 52-124
.. note::
Téléchargement des fichiers
Le schéma YACS réalisant cette adaptation est téléchargeable.
.. literalinclude:: ../files/tutorial_4.py
- :lines: 62-120
+ :lines: 52-111
.. note::
Téléchargement des fichiers
Dans le cas présenté ici, on raffine une première fois toutes les mailles contenues dans un disque percé, puis dans une seconde itération, toutes les mailles contenues dans un rectangle. On notera l'utilisation du suivi des frontières circulaires du domaine.
.. literalinclude:: ../files/tutorial_5.py
- :lines: 62-104
+ :lines: 52-95
.. note::
Téléchargement des fichiers
test_3.00.med
test_3.fr.med
test_3.apad.02.bilan
+ test_11.py
+ test_11.apad.03.bilan
+ test_12.py
+ test_12.apad.02.bilan
+ test_13.py
+ test_13.apad.02.bilan
+ test_14.py
+ test_14.apad.03.bilan
+ test_15.py
+ test_15.apad.02.bilan
)
INSTALL(FILES ${HOMARD_TEST_FILES} DESTINATION ${SALOME_HOMARD_INSTALL_RES_DATA})
#
"""
Python script for HOMARD
-Copyright EDF-R&D 2010, 2013
+Copyright EDF-R&D 2010, 2014
Test test_1
"""
-__revision__ = "V2.1"
+__revision__ = "V2.2"
#========================================================================
Test_Name = "test_1"
import HOMARD
import salome
#
+# ==================================
pathHomard = os.getenv('HOMARD_ROOT_DIR')
+# Repertoire des donnees du test
Rep_Test = os.path.join(pathHomard, "share", "salome", "resources", "homard")
Rep_Test = os.path.normpath(Rep_Test)
-Rep_Test_Resu = tempfile.mktemp()
-os.mkdir(Rep_Test_Resu)
-
sys.path.append(Rep_Test)
-from test_util import remove_dir
+from test_util import test_results
+# Repertoire des resultats
+dircase = tempfile.mktemp()
+os.mkdir(dircase)
+# ==================================
+
salome.salome_init()
import iparameters
def homard_exec(theStudy):
"""
Python script for HOMARD
-Copyright EDF-R&D 2010, 2013
"""
error = 0
#
print "-------- Creation of the case", CaseName
MeshFile = os.path.join(Rep_Test, Test_Name + '.00.med')
Case_test_1 = homard.CreateCase(CaseName, 'MAILL', MeshFile)
- Case_test_1.SetDirName(Rep_Test_Resu)
+ Case_test_1.SetDirName(dircase)
Case_test_1.SetConfType(1)
#
# Creation of the iterations
Iter_test_1_1.AssociateHypo(HypoName_1)
print ". Hypothese :", HypoName_1
Iter_test_1_1.SetMeshName('M1')
- Iter_test_1_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med'))
+ Iter_test_1_1.SetMeshFile(os.path.join(dircase, 'maill.01.med'))
Iter_test_1_1.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.00.med'))
Iter_test_1_1.SetTimeStepRank(1, 1)
Iter_test_1_1.SetFieldInterpTimeStep('RESU____DEPL____________________', 1)
Iter_test_1_2.AssociateHypo(HypoName_1)
print ". Hypothese :", HypoName_1
Iter_test_1_2.SetMeshName('M2')
- Iter_test_1_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med'))
+ Iter_test_1_2.SetMeshFile(os.path.join(dircase, 'maill.02.med'))
Iter_test_1_2.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.01.med'))
Iter_test_1_2.SetTimeStepRank(1, 1)
Iter_test_1_2.SetFieldInterpTimeStep('RESU____DEPL____________________', 1)
Iter_test_1_3.AssociateHypo(HypoName_2)
print ". Hypothese :", HypoName_2
Iter_test_1_3.SetMeshName('M3')
- Iter_test_1_3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med'))
+ Iter_test_1_3.SetMeshFile(os.path.join(dircase, 'maill.03.med'))
Iter_test_1_2.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.02.med'))
print ". Instants d'interpolation :", Iter_test_1_3.GetFieldInterpsTimeStepRank()
error = Iter_test_1_3.Compute(1, 1)
# ===========================
ScriptFile = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "en", "_downloads", "yacs_script.py")
ScriptFile = os.path.normpath(ScriptFile)
- DirName = Rep_Test_Resu
+ DirName = dircase
YACS_test_1 = Case_test_1.CreateYACSSchema("YACS_test_1", ScriptFile, DirName, MeshFile)
error = YACS_test_1.Write()
if error :
homard = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
assert homard is not None, "Impossible to load homard engine"
homard.SetLanguageShort("fr")
-
#
# Exec of HOMARD-SALOME
#
except Exception, e:
raise Exception('Pb in homard_exec: '+e.message)
#
-# Test of the result
-#
-test_file_suff = "apad.%02d.bilan" % n_iter_test_file
-rep_test_file = "I%02d" % n_iter_test_file
-#
-test_file = os.path.join(Rep_Test, Test_Name + "." + test_file_suff)
-mess_error_ref = "\nReference file: " + test_file
-try :
- file = open (test_file, "r")
- mess_ref = file.readlines()
- file.close()
-except :
- mess_error = mess_error_ref + "\nThis file does not exist.\n"
- raise Exception(mess_error)
-#
-test_file = os.path.join(Rep_Test_Resu, rep_test_file, test_file_suff)
-if os.path.isfile (test_file) :
- file = open (test_file, "r")
- mess = file.readlines()
- file.close()
-else :
- mess_error = "\nResult file: " + test_file
- mess_error += "\nThis file does not exist.\n"
- raise Exception(mess_error)
-
-nblign = len(mess_ref)
-if ( len(mess) != nblign ):
- mess_error = mess_error_ref + "\nResult file: " + test_file
- mess_error += "\nThe number of lines of the files are not the same.\n"
- raise Exception(mess_error)
-
-for num in range(nblign) :
- if (( "creation" not in mess_ref[num] ) and ( mess_ref[num] != mess[num])) :
- message_erreur = "\nRefe : " + mess_ref[num]
- message_erreur += "Test : " + mess[num][:-1]
- message_erreur += "\nThe test is different from the reference."
- raise Exception(message_erreur)
+# Test of the results
#
-remove_dir(Rep_Test_Resu)
+n_rep_test_file = n_iter_test_file
+test_results(Rep_Test, Test_Name, dircase, n_iter_test_file, n_rep_test_file)
#
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
--- /dev/null
+
+
+ANALYSE DU MAILLAGE
+===================
+
+ Maillage apres adaptation
+ MAILL
+ Date de creation : vendredi 21 mars 2014 a 13 h 35 mn 56 s
+ Dimension : 3
+ Degre : 2
+ C'est un maillage obtenu apres 3 adaptations.
+ Le niveau minimum actif est : 3
+ Le niveau maximum atteint est : 3
+
+ Direction | Unite | Minimum | Maximum
+ ---------------------------------------------------------------
+ X | INCONNUE | 0.0000 | 1.0000
+ Y | INCONNUE | 0.0000 | 1.0000
+ Z | INCONNUE | 0.0000 | 1.0000
+
+
+ NOMBRE D'ENTITES DU CALCUL
+ ==========================
+
+
+ ************************************************************
+ * Noeuds *
+ ************************************************************
+ * Nombre total * 4913 *
+ * . dont sommets d'aretes * 729 *
+ * . dont milieux d'aretes * 4184 *
+ ************************************************************
+
+ ************************************************************
+ * Mailles-Points *
+ ************************************************************
+ * Nombre total * 2 *
+ ************************************************************
+
+ ************************************************************
+ * Segments *
+ ************************************************************
+ * Nombre total * 8 *
+ * . dont aretes isolees * 0 *
+ * . dont aretes de bord de regions 2D * 0 *
+ * . dont aretes internes aux faces/volumes * 8 *
+ ************************************************************
+
+ ************************************************************
+ * Triangles *
+ ************************************************************
+ * Nombre total * 768 *
+ * . dont triangles de regions 2D * 0 *
+ * . dont triangles de bord * 768 *
+ * . dont triangles internes aux volumes * 0 *
+ ************************************************************
+ * . du niveau 0 * 0 *
+ * . du niveau 1 * 0 *
+ * . du niveau 2 * 0 *
+ * . du niveau 3 * 768 *
+ ************************************************************
+
+ ************************************************************
+ * Tetraedres *
+ ************************************************************
+ * Nombre total * 3072 *
+ ************************************************************
+ * . du niveau 0 * 0 *
+ * . du niveau 1 * 0 *
+ * . du niveau 2 * 0 *
+ * . du niveau 3 * 3072 *
+ ************************************************************
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2011-2014 CEA/DEN, 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
+#
+"""
+Python script for HOMARD
+Copyright EDF-R&D 2010, 2014
+Test test_11 associe au tutorial 1
+"""
+__revision__ = "V2.1"
+
+#========================================================================
+Test_Name = "test_11"
+n_iter_test_file = 3
+#========================================================================
+import os
+import tempfile
+import sys
+import HOMARD
+import salome
+#
+# ==================================
+pathHomard = os.getenv('HOMARD_ROOT_DIR')
+# Repertoire des donnees du test
+Rep_Test = os.path.join(pathHomard, "share", "salome", "resources", "homard")
+Rep_Test = os.path.normpath(Rep_Test)
+sys.path.append(Rep_Test)
+from test_util import test_results
+# Repertoire des resultats
+dircase = tempfile.mktemp()
+os.mkdir(dircase)
+# Repertoire des donnees du tutorial
+data_dir = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
+data_dir = os.path.normpath(data_dir)
+sys.path.append(data_dir)
+from tutorial_util import gzip_gunzip
+# ==================================
+gzip_gunzip(data_dir, 1, -1)
+# ==================================
+
+salome.salome_init()
+import iparameters
+ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", 1))
+ipar.append("AP_MODULES_LIST", "Homard")
+#
+#========================================================================
+#========================================================================
+def homard_exec(theStudy):
+ """
+Python script for HOMARD
+ """
+ #
+ homard.SetCurrentStudy(theStudy)
+ #
+ # Hypotheses
+ # ==========
+ Hypo_1 = homard.CreateHypothesis('Hypo_1')
+ Hypo_1.SetUnifRefinUnRef(1)
+ #
+ # Cas
+ # ===
+ Case_1 = homard.CreateCase('Case_1', 'MAILL', data_dir+'/tutorial_1.00.med')
+ Case_1.SetDirName(dircase)
+ Case_1.SetConfType(1)
+ #
+ # Iterations
+ # ==========
+ # Iteration "Iter_1_1"
+ Iter_1_1 = Case_1.NextIteration('Iter_1_1')
+ Iter_1_1.SetMeshName('MESH')
+ Iter_1_1.SetMeshFile(dircase+'/maill.01.med')
+ Iter_1_1.AssociateHypo('Hypo_1')
+ error = Iter_1_1.Compute(1, 2)
+
+ # Iteration "Iter_1_2"
+ Iter_1_2 = Iter_1_1.NextIteration('Iter_1_2')
+ Iter_1_2.SetMeshName('MESH')
+ Iter_1_2.SetMeshFile(dircase+'/maill.02.med')
+ Iter_1_2.AssociateHypo('Hypo_1')
+ error = Iter_1_2.Compute(1, 2)
+
+ # Iteration "Iter_1_3"
+ Iter_1_3 = Iter_1_2.NextIteration('Iter_1_3')
+ Iter_1_3.SetMeshName('MESH')
+ Iter_1_3.SetMeshFile(dircase+'/maill.03.med')
+ Iter_1_3.AssociateHypo('Hypo_1')
+ error = Iter_1_3.Compute(1, 2)
+ #
+ return error
+
+#========================================================================
+
+homard = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
+assert homard is not None, "Impossible to load homard engine"
+homard.SetLanguageShort("fr")
+#
+# Exec of HOMARD-SALOME
+#
+try :
+ error_main = homard_exec(salome.myStudy)
+ if error_main :
+ raise Exception('Pb in homard_exec at iteration %d' %error_main )
+except Exception, e:
+ raise Exception('Pb in homard_exec: '+e.message)
+#
+# Test of the results
+#
+n_rep_test_file = n_iter_test_file
+test_results(Rep_Test, Test_Name, dircase, n_iter_test_file, n_rep_test_file)
+#
+# ==================================
+gzip_gunzip(data_dir, 1, 1)
+# ==================================
+#
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
+ iparameters.getSession().restoreVisualState(1)
+
--- /dev/null
+
+
+ANALYSE DU MAILLAGE
+===================
+
+ Maillage apres adaptation
+ MZERO
+ Date de creation : vendredi 21 mars 2014 a 11 h 33 mn 28 s
+ Dimension : 3
+ Degre : 2
+ C'est un maillage obtenu apres 2 adaptations.
+ Le niveau minimum actif est : 1
+ Le niveau maximum atteint est : 2
+
+ Direction | Unite | Minimum | Maximum
+ ---------------------------------------------------------------
+ X | INCONNUE | 0.0000 | 1.0000
+ Y | INCONNUE | 0.0000 | 1.0000
+ Z | INCONNUE | 0.0000 | 1.0000
+
+
+ NOMBRE D'ENTITES DU CALCUL
+ ==========================
+
+
+ ************************************************************
+ * Noeuds *
+ ************************************************************
+ * Nombre total * 231 *
+ * . dont sommets d'aretes * 43 *
+ * . dont milieux d'aretes * 188 *
+ ************************************************************
+
+ ************************************************************
+ * Mailles-Points *
+ ************************************************************
+ * Nombre total * 2 *
+ ************************************************************
+
+ ************************************************************
+ * Segments *
+ ************************************************************
+ * Nombre total * 3 *
+ * . dont aretes isolees * 0 *
+ * . dont aretes de bord de regions 2D * 0 *
+ * . dont aretes internes aux faces/volumes * 3 *
+ ************************************************************
+
+ ************************************************************
+ * Triangles *
+ ************************************************************
+ * Nombre total * 66 *
+ * . dont triangles de regions 2D * 0 *
+ * . dont triangles de bord * 66 *
+ * . dont triangles internes aux volumes * 0 *
+ ************************************************************
+ * . du niveau 0 * 0 *
+ * . du niveau 1 * 30 *
+ * . du niveau 2 * 36 *
+ ************************************************************
+
+ ************************************************************
+ * Tetraedres *
+ ************************************************************
+ * Nombre total * 113 *
+ ************************************************************
+ * . du niveau 0 * 0 *
+ * . du niveau 1 * 23 *
+ * . du niveau 2 * 90 *
+ ************************************************************
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2011-2014 CEA/DEN, 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
+#
+"""
+Python script for HOMARD
+Copyright EDF-R&D 2010, 2014
+Test test_11 associe au tutorial 2
+"""
+__revision__ = "V2.1"
+
+#========================================================================
+Test_Name = "test_12"
+n_iter_test_file = 2
+#========================================================================
+import os
+import tempfile
+import sys
+import HOMARD
+import salome
+#
+# ==================================
+pathHomard = os.getenv('HOMARD_ROOT_DIR')
+# Repertoire des donnees du test
+Rep_Test = os.path.join(pathHomard, "share", "salome", "resources", "homard")
+Rep_Test = os.path.normpath(Rep_Test)
+sys.path.append(Rep_Test)
+from test_util import test_results
+# Repertoire des resultats
+dircase = tempfile.mktemp()
+os.mkdir(dircase)
+# Repertoire des donnees du tutorial
+data_dir = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
+data_dir = os.path.normpath(data_dir)
+sys.path.append(data_dir)
+from tutorial_util import gzip_gunzip
+# ==================================
+gzip_gunzip(data_dir, 2, -1)
+# ==================================
+
+salome.salome_init()
+import iparameters
+ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", 1))
+ipar.append("AP_MODULES_LIST", "Homard")
+#
+#========================================================================
+#========================================================================
+def homard_exec(theStudy):
+ """
+Python script for HOMARD
+ """
+ #
+ homard.SetCurrentStudy(theStudy)
+ #
+ # Creation des zones
+ # ==================
+ # Box "Zone_0"
+ Zone_0 = homard.CreateZoneBox ('Zone_0', -0.1, 1.1, -0.1, 1.1, 0.9, 1.1)
+ #
+ # Sphere "Zone_1"
+ Zone_1 = homard.CreateZoneSphere ('Zone_1', 0., 0., 0., 1.05)
+ #
+ # Box "Zone_2"
+ Zone_2 = homard.CreateZoneBox ('Zone_2', -0.1, 0.51, -0.1, 0.51, -0.1, 0.51)
+ #
+ # Hypothese "Hypo_2"
+ # ==================
+ Hypo_2 = homard.CreateHypothesis('Hypo_2')
+ Hypo_2.AddZone('Zone_1', 1)
+ Hypo_2.AddZone('Zone_0', 1)
+ #
+ # Hypothese "Hypo_2_bis"
+ # ======================
+ Hypo_2_bis = homard.CreateHypothesis('Hypo_2_bis')
+ Hypo_2_bis.AddZone('Zone_0', -1)
+ Hypo_2_bis.AddZone('Zone_2', 1)
+ #
+ # Cas
+ # ===
+ Case_2 = homard.CreateCase('Case_2', 'MZERO', data_dir+'/tutorial_2.00.med')
+ Case_2.SetDirName(dircase)
+ #
+ # Iteration "Iter_2_1"
+ # ====================
+ Iter_2_1 = Case_2.NextIteration('Iter_2_1')
+ Iter_2_1.SetMeshName('M_1')
+ Iter_2_1.SetMeshFile(dircase+'/maill.01.med')
+ Iter_2_1.AssociateHypo('Hypo_2')
+ error = Iter_2_1.Compute(1, 2)
+ #
+ # Iteration "Iter_2_2"
+ # ====================
+ Iter_2_2 = Iter_2_1.NextIteration('Iter_2_2')
+ Iter_2_2.SetMeshName('M_2')
+ Iter_2_2.SetMeshFile(dircase+'/maill.02.med')
+ Iter_2_2.AssociateHypo('Hypo_2_bis')
+ error = Iter_2_2.Compute(1, 2)
+ #
+ return error
+
+#========================================================================
+
+homard = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
+assert homard is not None, "Impossible to load homard engine"
+homard.SetLanguageShort("fr")
+#
+# Exec of HOMARD-SALOME
+#
+try :
+ error_main = homard_exec(salome.myStudy)
+ if error_main :
+ raise Exception('Pb in homard_exec at iteration %d' %error_main )
+except Exception, e:
+ raise Exception('Pb in homard_exec: '+e.message)
+#
+# Test of the results
+#
+n_rep_test_file = n_iter_test_file
+test_results(Rep_Test, Test_Name, dircase, n_iter_test_file, n_rep_test_file)
+#
+# ==================================
+gzip_gunzip(data_dir, 2, 1)
+# ==================================
+#
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
+ iparameters.getSession().restoreVisualState(1)
+
--- /dev/null
+
+
+ANALYSE DU MAILLAGE
+===================
+
+ Maillage apres adaptation
+ G_0
+ Date de creation : vendredi 21 mars 2014 a 11 h 33 mn 32 s
+ Dimension : 3
+ Degre : 2
+ C'est un maillage obtenu apres 2 adaptations.
+ Le niveau minimum actif est : 0
+ Le niveau maximum atteint est : 2
+
+ Direction | Unite | Minimum | Maximum
+ ---------------------------------------------------------------
+ X | INCONNUE | 0.0000 | 0.60000
+ Y | INCONNUE | 0.0000 | 0.30000
+ Z | INCONNUE | 0.0000 | 0.20000
+
+
+ NOMBRE D'ENTITES DU CALCUL
+ ==========================
+
+
+ ************************************************************
+ * Noeuds *
+ ************************************************************
+ * Nombre total * 14455 *
+ * . dont sommets d'aretes * 3839 *
+ * . dont milieux d'aretes * 10616 *
+ ************************************************************
+
+ ************************************************************
+ * Segments *
+ ************************************************************
+ * Nombre total * 764 *
+ * . dont aretes isolees * 0 *
+ * . dont aretes de bord de regions 2D * 0 *
+ * . dont aretes internes aux faces/volumes * 764 *
+ ************************************************************
+
+ ************************************************************
+ * Triangles *
+ ************************************************************
+ * Nombre total * 288 *
+ * . dont triangles de regions 2D * 0 *
+ * . dont triangles de bord * 288 *
+ * . dont triangles internes aux volumes * 0 *
+ ************************************************************
+ * . du niveau 0 * 0 *
+ * . du niveau 1 * 168 *
+ * . du niveau 2 * 120 *
+ ************************************************************
+
+ ************************************************************
+ * Quadrangles *
+ ************************************************************
+ * Nombre total * 2534 *
+ * . dont quadrangles de regions 2D * 0 *
+ * . dont quadrangles de bord * 2534 *
+ * . dont quadrangles internes aux volumes * 0 *
+ ************************************************************
+ * . du niveau 0 * 142 *
+ * . du niveau 1 * 2296 *
+ * . du niveau 2 * 96 *
+ ************************************************************
+
+ ************************************************************
+ * Tetraedres *
+ ************************************************************
+ * Nombre total * 256 *
+ ************************************************************
+ * . du niveau 0 * 0 *
+ * . du niveau 1 * 96 *
+ * . du niveau 2 * 160 *
+ ************************************************************
+
+ ************************************************************
+ * Hexaedres *
+ ************************************************************
+ * Nombre total * 2230 *
+ ************************************************************
+ * . du niveau 0 * 66 *
+ * . du niveau 1 * 1972 *
+ * . du niveau 2 * 192 *
+ ************************************************************
+
+ ************************************************************
+ * Pyramides *
+ ************************************************************
+ * Nombre total * 432 *
+ ************************************************************
+ * . du niveau 0 * 0 *
+ * . du niveau 1 * 120 *
+ * . du niveau 2 * 312 *
+ ************************************************************
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2011-2014 CEA/DEN, 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
+#
+"""
+Python script for HOMARD
+Copyright EDF-R&D 2010, 2014
+Test test_11 associe au tutorial 3
+"""
+__revision__ = "V2.1"
+
+#========================================================================
+Test_Name = "test_13"
+n_iter_test_file = 2
+#========================================================================
+import os
+import tempfile
+import sys
+import HOMARD
+import salome
+#
+# ==================================
+pathHomard = os.getenv('HOMARD_ROOT_DIR')
+# Repertoire des donnees du test
+Rep_Test = os.path.join(pathHomard, "share", "salome", "resources", "homard")
+Rep_Test = os.path.normpath(Rep_Test)
+sys.path.append(Rep_Test)
+from test_util import test_results
+# Repertoire des resultats
+dircase = tempfile.mktemp()
+os.mkdir(dircase)
+# Repertoire des donnees du tutorial
+data_dir = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
+data_dir = os.path.normpath(data_dir)
+sys.path.append(data_dir)
+from tutorial_util import gzip_gunzip
+# ==================================
+gzip_gunzip(data_dir, 3, -1)
+# ==================================
+
+salome.salome_init()
+import iparameters
+ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", 1))
+ipar.append("AP_MODULES_LIST", "Homard")
+#
+#========================================================================
+#========================================================================
+def homard_exec(theStudy):
+ """
+Python script for HOMARD
+ """
+ #
+ homard.SetCurrentStudy(theStudy)
+ #
+ # Hypothese "Hypo_0vers1"
+ # =======================
+ Hypo_0vers1 = homard.CreateHypothesis('Hypo_0vers1')
+ # Characterization of the field
+ Hypo_0vers1.SetField('SOLU_0__QIRE_ELEM_SIGM__________')
+ Hypo_0vers1.SetUseComp(0)
+ Hypo_0vers1.AddComp('ERREST ')
+ Hypo_0vers1.SetRefinThr(3, 1.0)
+ Hypo_0vers1.SetTypeFieldInterp(2)
+ Hypo_0vers1.AddFieldInterp('SOLU_0__DEPL____________________')
+ Hypo_0vers1.AddFieldInterp('SOLU_0__ERRE_ELEM_SIGM__________')
+ #
+ # Hypothese "Hypo_1vers2"
+ # =======================
+ Hypo_1vers2 = homard.CreateHypothesis('Hypo_1vers2')
+ # Characterization of the field
+ Hypo_1vers2.SetField('SOLU_1__QIRE_ELEM_SIGM__________')
+ Hypo_1vers2.SetUseComp(0)
+ Hypo_1vers2.AddComp('ERREST ')
+ Hypo_1vers2.SetRefinThr(3, 1.5)
+ Hypo_1vers2.SetUnRefThr(3, 6.)
+ Hypo_1vers2.SetTypeFieldInterp(2)
+ Hypo_1vers2.AddFieldInterp('SOLU_1__DEPL____________________')
+ Hypo_1vers2.AddFieldInterp('SOLU_1__QIRE_ELEM_SIGM__________')
+ #
+ # Hypothese "Hypo_1vers2_bis"
+ # ===========================
+ Hypo_1vers2_bis = homard.CreateHypothesis('Hypo_1vers2_bis')
+ # Characterization of the field
+ Hypo_1vers2_bis.SetField('SOLU_1__DEPL____________________')
+ Hypo_1vers2_bis.SetUseComp(1)
+ Hypo_1vers2_bis.AddComp('DX')
+ Hypo_1vers2_bis.AddComp('DY')
+ Hypo_1vers2_bis.AddComp('DZ')
+ Hypo_1vers2_bis.SetRefinThr(1, 0.0001)
+ Hypo_1vers2_bis.SetUnRefThr(1, 0.000001)
+ Hypo_1vers2_bis.SetTypeFieldInterp(0)
+ #
+ # Cas
+ # ===
+ Case_3 = homard.CreateCase('Case_3', 'G_0', data_dir+'/tutorial_3.00.med')
+ Case_3.SetDirName(dircase)
+ #
+ # Iteration "Iter_3_1"
+ # ====================
+ Iter_3_1 = Case_3.NextIteration('Iter_3_1')
+ Iter_3_1.SetMeshName('H_1')
+ Iter_3_1.SetMeshFile(dircase+'/maill.01.med')
+ Iter_3_1.SetFieldFile(data_dir+'/tutorial_3.00.med')
+ Iter_3_1.SetTimeStepRank( 1, 1)
+ Iter_3_1.AssociateHypo('Hypo_0vers1')
+ error = Iter_3_1.Compute(1, 2)
+ #
+ # Iteration "Iter_3_2"
+ # ====================
+ Iter_3_2 = Iter_3_1.NextIteration('Iter_3_2')
+ Iter_3_2.SetMeshName('H_2')
+ Iter_3_2.SetMeshFile(dircase+'/maill.02.med')
+ Iter_3_2.SetFieldFile(data_dir+'/tutorial_3.01.med')
+ Iter_3_2.SetTimeStepRank(1, 1)
+ Iter_3_2.AssociateHypo('Hypo_1vers2')
+ error = Iter_3_2.Compute(1, 2)
+ #
+ # Iteration "Iter_3_2_bis"
+ # ========================
+ Iter_3_2_bis = Iter_3_1.NextIteration('Iter_3_2_bis')
+ Iter_3_2_bis.SetMeshName('H_2_bis')
+ Iter_3_2_bis.SetMeshFile(dircase+'/maill.02.bis.med')
+ Iter_3_2_bis.SetFieldFile(data_dir+'/tutorial_3.01.med')
+ Iter_3_2_bis.SetTimeStepRank(1, 1)
+ Iter_3_2_bis.AssociateHypo('Hypo_1vers2_bis')
+ error = Iter_3_2_bis.Compute(1, 2)
+ #
+ return error
+
+#========================================================================
+
+homard = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
+assert homard is not None, "Impossible to load homard engine"
+homard.SetLanguageShort("fr")
+#
+# Exec of HOMARD-SALOME
+#
+try :
+ error_main = homard_exec(salome.myStudy)
+ if error_main :
+ raise Exception('Pb in homard_exec at iteration %d' %error_main )
+except Exception, e:
+ raise Exception('Pb in homard_exec: '+e.message)
+#
+# Test of the results
+#
+n_rep_test_file = 3
+test_results(Rep_Test, Test_Name, dircase, n_iter_test_file, n_rep_test_file)
+#
+# ==================================
+gzip_gunzip(data_dir, 3, 1)
+# ==================================
+#
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
+ iparameters.getSession().restoreVisualState(1)
+
--- /dev/null
+
+
+ANALYSE DU MAILLAGE
+===================
+
+ Maillage apres adaptation
+ PIQUAGE
+ Date de creation : vendredi 21 mars 2014 a 11 h 35 mn 40 s
+ Dimension : 3
+ Degre : 1
+ C'est un maillage obtenu apres 3 adaptations.
+ Le niveau minimum actif est : 1
+ Le niveau maximum atteint est : 2
+
+ Direction | Unite | Minimum | Maximum
+ ---------------------------------------------------------------
+ | | -230.00 | 136.45
+ | | -250.62 | 189.69
+ | | -285.21 | 155.03
+
+
+ NOMBRE D'ENTITES DU CALCUL
+ ==========================
+
+
+ ************************************************************
+ * Noeuds *
+ ************************************************************
+ * Nombre total * 12825 *
+ ************************************************************
+
+ ************************************************************
+ * Segments *
+ ************************************************************
+ * Nombre total * 758 *
+ * . dont aretes isolees * 0 *
+ * . dont aretes de bord de regions 2D * 0 *
+ * . dont aretes internes aux faces/volumes * 758 *
+ ************************************************************
+
+ ************************************************************
+ * Triangles *
+ ************************************************************
+ * Nombre total * 20838 *
+ * . dont triangles de regions 2D * 0 *
+ * . dont triangles de bord * 20560 *
+ * . dont triangles internes aux volumes * 278 *
+ ************************************************************
+ * . du niveau 0 * 0 *
+ * . du niveau 1 * 3530 *
+ * . du niveau 2 * 17308 *
+ ************************************************************
+
+ ************************************************************
+ * Tetraedres *
+ ************************************************************
+ * Nombre total * 43490 *
+ ************************************************************
+ * . du niveau 0 * 0 *
+ * . du niveau 1 * 18174 *
+ * . du niveau 2 * 25316 *
+ ************************************************************
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2011-2014 CEA/DEN, 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
+#
+"""
+Python script for HOMARD
+Copyright EDF-R&D 2010, 2014
+Test test_11 associe au tutorial 4
+"""
+__revision__ = "V2.1"
+
+#========================================================================
+Test_Name = "test_14"
+n_iter_test_file = 3
+#========================================================================
+import os
+import tempfile
+import sys
+import HOMARD
+import salome
+#
+# ==================================
+pathHomard = os.getenv('HOMARD_ROOT_DIR')
+# Repertoire des donnees du test
+Rep_Test = os.path.join(pathHomard, "share", "salome", "resources", "homard")
+Rep_Test = os.path.normpath(Rep_Test)
+sys.path.append(Rep_Test)
+from test_util import test_results
+# Repertoire des resultats
+dircase = tempfile.mktemp()
+os.mkdir(dircase)
+# Repertoire des donnees du tutorial
+data_dir = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
+data_dir = os.path.normpath(data_dir)
+sys.path.append(data_dir)
+from tutorial_util import gzip_gunzip
+# ==================================
+gzip_gunzip(data_dir, 4, -1)
+# ==================================
+
+salome.salome_init()
+import iparameters
+ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", 1))
+ipar.append("AP_MODULES_LIST", "Homard")
+#
+#========================================================================
+#========================================================================
+def homard_exec(theStudy):
+ """
+Python script for HOMARD
+ """
+ #
+ homard.SetCurrentStudy(theStudy)
+#
+ # Frontieres
+ # ==========
+ Boun_4_1 = homard.CreateBoundaryDi('intersection', 'PIQUAGE', data_dir+'/tutorial_4.fr.med')
+ #
+ Boun_4_2 = homard.CreateBoundaryCylinder('cyl_1_ext', 0.0, 25., -25., 25., 50., 75., 100.)
+ #
+ Boun_4_3 = homard.CreateBoundaryCylinder('cyl_2_ext', 17.5, -2.5, -12.5, -100., -75., -25., 50.)
+ #
+ Boun_4_4 = homard.CreateBoundaryCylinder('cyl_1_int', 0.0, 25., -25., 25., 50., 75., 75.)
+ #
+ Boun_4_5 = homard.CreateBoundaryCylinder('cyl_2_int', 17.5, -2.5, -12.5, -100., -75., -25., 25.)
+ #
+ # Hypotheses
+ # ==========
+ # Creation of the hypothesis Hypo_4
+ Hypo_4 = homard.CreateHypothesis('Hypo_4')
+ Hypo_4.SetUnifRefinUnRef(1)
+ Hypo_4.AddGroup('T1_INT_I')
+ Hypo_4.AddGroup('T1_INT_O')
+ Hypo_4.AddGroup('T2_INT')
+ # Creation of the hypothesis Hypo_4_bis
+ Hypo_4_bis = homard.CreateHypothesis('Hypo_4_bis')
+ Hypo_4_bis.SetUnifRefinUnRef(1)
+ Hypo_4_bis.AddGroup('T1_EXT_I')
+ Hypo_4_bis.AddGroup('T1_EXT_O')
+ Hypo_4_bis.AddGroup('T2_EXT')
+ #
+ # Cas
+ # ===
+ Case_4 = homard.CreateCase('Case_4', 'PIQUAGE', data_dir+'/tutorial_4.00.med')
+ Case_4.SetDirName(dircase)
+ Case_4.AddBoundaryGroup( 'intersection', '' )
+ Case_4.AddBoundaryGroup( 'cyl_1_int', 'T1_INT_I' )
+ Case_4.AddBoundaryGroup( 'cyl_1_ext', 'T1_EXT_I' )
+ Case_4.AddBoundaryGroup( 'cyl_1_int', 'T1_INT_O' )
+ Case_4.AddBoundaryGroup( 'cyl_1_ext', 'T1_EXT_O' )
+ Case_4.AddBoundaryGroup( 'cyl_2_int', 'T2_INT' )
+ Case_4.AddBoundaryGroup( 'cyl_2_ext', 'T2_EXT' )
+ #
+ # Iterations
+ # ==========
+ # Iteration Iter_4_1 : raffinement selon les faces internes
+ Iter_4_1 = Case_4.NextIteration('Iter_4_1')
+ Iter_4_1.SetMeshName('PIQUAGE_1')
+ Iter_4_1.SetMeshFile(dircase+'/maill.01.med')
+ Iter_4_1.AssociateHypo('Hypo_4')
+ error = Iter_4_1.Compute(1, 2)
+ # Iteration Iter_4_2 : raffinement selon les faces externes
+ Iter_4_2 = Iter_4_1.NextIteration('Iter_4_2')
+ Iter_4_2.SetMeshName('PIQUAGE_2')
+ Iter_4_2.SetMeshFile(dircase+'/maill.02.med')
+ Iter_4_2.AssociateHypo('Hypo_4_bis')
+ error = Iter_4_2.Compute(1, 2)
+ # Iteration Iter_4_3 : second raffinement selon les faces externes
+ Iter_4_3 = Iter_4_2.NextIteration('Iter_4_3')
+ Iter_4_3.SetMeshName('PIQUAGE_3')
+ Iter_4_3.SetMeshFile(dircase+'/maill.03.med')
+ Iter_4_3.AssociateHypo('Hypo_4_bis')
+ error = Iter_4_3.Compute(1, 2)
+ #
+ return error
+
+#========================================================================
+
+homard = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
+assert homard is not None, "Impossible to load homard engine"
+homard.SetLanguageShort("fr")
+#
+# Exec of HOMARD-SALOME
+#
+try :
+ error_main = homard_exec(salome.myStudy)
+ if error_main :
+ raise Exception('Pb in homard_exec at iteration %d' %error_main )
+except Exception, e:
+ raise Exception('Pb in homard_exec: '+e.message)
+#
+# Test of the results
+#
+n_rep_test_file = n_iter_test_file
+test_results(Rep_Test, Test_Name, dircase, n_iter_test_file, n_rep_test_file)
+#
+# ==================================
+gzip_gunzip(data_dir, 4, 1)
+# ==================================
+#
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
+ iparameters.getSession().restoreVisualState(1)
+
--- /dev/null
+
+
+ANALYSE DU MAILLAGE
+===================
+
+ Maillage apres adaptation
+ COEUR_2D
+ Date de creation : vendredi 21 mars 2014 a 11 h 33 mn 45 s
+ Dimension : 2
+ Degre : 1
+ C'est un maillage obtenu apres 2 adaptations.
+ Le niveau minimum actif est : 0
+ Le niveau maximum atteint est : 2
+
+ Direction | Unite | Minimum | Maximum
+ ---------------------------------------------------------------
+ | | -248.00 | 248.00
+ | | -248.00 | 248.00
+
+
+ NOMBRE D'ENTITES DU CALCUL
+ ==========================
+
+
+ ************************************************************
+ * Noeuds *
+ ************************************************************
+ * Nombre total * 1542 *
+ ************************************************************
+
+ ************************************************************
+ * Segments *
+ ************************************************************
+ * Nombre total * 359 *
+ * . dont aretes isolees * 0 *
+ * . dont aretes de bord de regions 2D * 240 *
+ * . dont aretes internes aux faces/volumes * 119 *
+ ************************************************************
+
+ ************************************************************
+ * Triangles *
+ ************************************************************
+ * Nombre total * 2204 *
+ ************************************************************
+ * . du niveau 0 * 88 *
+ * . du niveau 1 * 980 *
+ * . du niveau 2 * 1136 *
+ ************************************************************
+
+ ************************************************************
+ * Quadrangles *
+ ************************************************************
+ * Nombre total * 334 *
+ ************************************************************
+ * . du niveau 0 * 162 *
+ * . du niveau 1 * 172 *
+ * . du niveau 2 * 0 *
+ ************************************************************
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2011-2014 CEA/DEN, 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
+#
+"""
+Python script for HOMARD
+Copyright EDF-R&D 2010, 2014
+Test test_11 associe au tutorial 5
+"""
+__revision__ = "V2.1"
+
+#========================================================================
+Test_Name = "test_15"
+n_iter_test_file = 2
+#========================================================================
+import os
+import tempfile
+import sys
+import HOMARD
+import salome
+#
+# ==================================
+pathHomard = os.getenv('HOMARD_ROOT_DIR')
+# Repertoire des donnees du test
+Rep_Test = os.path.join(pathHomard, "share", "salome", "resources", "homard")
+Rep_Test = os.path.normpath(Rep_Test)
+sys.path.append(Rep_Test)
+from test_util import test_results
+# Repertoire des resultats
+dircase = tempfile.mktemp()
+os.mkdir(dircase)
+# Repertoire des donnees du tutorial
+data_dir = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
+data_dir = os.path.normpath(data_dir)
+sys.path.append(data_dir)
+from tutorial_util import gzip_gunzip
+# ==================================
+gzip_gunzip(data_dir, 5, -1)
+# ==================================
+
+salome.salome_init()
+import iparameters
+ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", 1))
+ipar.append("AP_MODULES_LIST", "Homard")
+#
+#========================================================================
+#========================================================================
+def homard_exec(theStudy):
+ """
+Python script for HOMARD
+ """
+ #
+ homard.SetCurrentStudy(theStudy)
+#
+ # Frontiere
+ # =========
+ # Creation of the discrete boundary Boun_5_1
+ Boun_5_1 = homard.CreateBoundaryDi('Boun_5_1', 'MAIL_EXT', data_dir+'/tutorial_5.fr.med')
+ #
+ # Creation des zones
+ # ==================
+ # Creation of the disk with hole enveloppe
+ enveloppe = homard.CreateZoneDiskWithHole( 'enveloppe', 0., 0., 250., 193., 1 )
+ # Creation of the rectangle quart_sup
+ quart_sup = homard.CreateZoneBox2D( 'quart_sup', 0., 250., 0., 250., 1 )
+ #
+ # Hypotheses
+ # ==========
+ # Creation of the hypothesis Hypo_5
+ Hypo_5 = homard.CreateHypothesis('Hypo_5')
+ Hypo_5.AddZone('enveloppe', 1)
+ # Creation of the hypothesis Hypo_5_bis
+ Hypo_5_bis = homard.CreateHypothesis('Hypo_5_bis')
+ Hypo_5_bis.AddZone('quart_sup', 1)
+ #
+ # Cas
+ # ===
+ Case_5 = homard.CreateCase('Case_5', 'COEUR_2D', data_dir+'/tutorial_5.00.med')
+ Case_5.SetDirName(dircase)
+ Case_5.SetConfType(3)
+ Case_5.AddBoundaryGroup('Boun_5_1', '')
+ #
+ # Iteration "Iter_5_1"
+ # ====================
+ Iter_5_1 = Case_5.NextIteration('Iter_5_1')
+ Iter_5_1.SetMeshName('COEUR_2D_01')
+ Iter_5_1.SetMeshFile(dircase+'/maill.01.med')
+ Iter_5_1.AssociateHypo('Hypo_5')
+ error = Iter_5_1.Compute(1, 2)
+ #
+ # Iteration "Iter_5_2"
+ # ====================
+ Iter_5_2 = Iter_5_1.NextIteration('Iter_5_2')
+ Iter_5_2.SetMeshName('COEUR_2D_02')
+ Iter_5_2.SetMeshFile(dircase+'/maill.02.med')
+ Iter_5_2.AssociateHypo('Hypo_5_bis')
+ error = Iter_5_2.Compute(1, 2)
+ #
+ return error
+
+#========================================================================
+
+homard = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
+assert homard is not None, "Impossible to load homard engine"
+homard.SetLanguageShort("fr")
+#
+# Exec of HOMARD-SALOME
+#
+try :
+ error_main = homard_exec(salome.myStudy)
+ if error_main :
+ raise Exception('Pb in homard_exec at iteration %d' %error_main )
+except Exception, e:
+ raise Exception('Pb in homard_exec: '+e.message)
+#
+# Test of the results
+#
+n_rep_test_file = n_iter_test_file
+test_results(Rep_Test, Test_Name, dircase, n_iter_test_file, n_rep_test_file)
+#
+# ==================================
+gzip_gunzip(data_dir, 5, 1)
+# ==================================
+#
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
+ iparameters.getSession().restoreVisualState(1)
+
#
"""
Python script for HOMARD
-Copyright EDF-R&D 2010, 2013
+Copyright EDF-R&D 2010, 2014
Test test_2
"""
-__revision__ = "V2.1"
+__revision__ = "V2.2"
#========================================================================
Test_Name = "test_2"
import HOMARD
import salome
#
+# ==================================
pathHomard = os.getenv('HOMARD_ROOT_DIR')
+# Repertoire des donnees du test
Rep_Test = os.path.join(pathHomard, "share", "salome", "resources", "homard")
Rep_Test = os.path.normpath(Rep_Test)
-Rep_Test_Resu = tempfile.mktemp()
-os.mkdir(Rep_Test_Resu)
-
sys.path.append(Rep_Test)
-from test_util import remove_dir
+from test_util import test_results
+# Repertoire des resultats
+dircase = tempfile.mktemp()
+os.mkdir(dircase)
+# ==================================
+
salome.salome_init()
import iparameters
def homard_exec(theStudy):
"""
Python script for HOMARD
-Copyright EDF-R&D 2010, 2013
"""
error = 0
#
CaseName = "Case_" + Test_Name
MeshFile = os.path.join(Rep_Test, Test_Name + '.00.med')
Case_test_2 = homard.CreateCase(CaseName, 'PLAQUE_0', MeshFile)
- Case_test_2.SetDirName(Rep_Test_Resu)
+ Case_test_2.SetDirName(dircase)
Case_test_2.SetConfType(1)
Case_test_2.AddBoundaryGroup('internal_boundary', '')
#
IterName = "I_" + Test_Name + "_1"
Iter_test_2_1 = Case_test_2.NextIteration(IterName)
Iter_test_2_1.SetMeshName('PLAQUE_1')
- Iter_test_2_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med'))
+ Iter_test_2_1.SetMeshFile(os.path.join(dircase, 'maill.01.med'))
Iter_test_2_1.AssociateHypo(HypoName_1)
error = Iter_test_2_1.Compute(1, 1)
if error :
IterName = "I_" + Test_Name + "_2"
Iter_test_2_2 = Iter_test_2_1.NextIteration(IterName)
Iter_test_2_2.SetMeshName('PLAQUE_2')
- Iter_test_2_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med'))
+ Iter_test_2_2.SetMeshFile(os.path.join(dircase, 'maill.02.med'))
Iter_test_2_2.AssociateHypo(HypoName_1)
error = Iter_test_2_2.Compute(1, 1)
if error :
IterName = "I_" + Test_Name + "_3"
Iter_test_2_3 = Iter_test_2_2.NextIteration(IterName)
Iter_test_2_3.SetMeshName('PLAQUE_3')
- Iter_test_2_3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med'))
+ Iter_test_2_3.SetMeshFile(os.path.join(dircase, 'maill.03.med'))
Iter_test_2_3.AssociateHypo(HypoName_2)
error = Iter_test_2_3.Compute(1, 1)
if error :
# ===========================
ScriptFile = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "en", "_downloads", "yacs_script.py")
ScriptFile = os.path.normpath(ScriptFile)
- DirName = Rep_Test_Resu
+ DirName = dircase
YACS_test_2 = Case_test_2.CreateYACSSchema("YACS_test_2", ScriptFile, DirName, MeshFile)
YACS_test_2.SetType(1)
- filexml = os.path.join(Rep_Test_Resu, 'YACS_test_2.xml')
+ filexml = os.path.join(dircase, 'YACS_test_2.xml')
error = YACS_test_2.WriteOnFile(filexml)
if error :
error = 4
raise Exception('Pb in homard_exec at iteration %d' %error_main )
except Exception, e:
raise Exception('Pb in homard_exec: '+e.message)
-
-#
-# Test of the result
-#
-test_file_suff = "apad.%02d.bilan" % n_iter_test_file
-rep_test_file = "I%02d" % n_iter_test_file
#
-test_file = os.path.join(Rep_Test, Test_Name + "." + test_file_suff)
-mess_error_ref = "\nReference file: " + test_file
-try :
- file = open (test_file, "r")
- mess_ref = file.readlines()
- file.close()
-except :
- mess_error = mess_error_ref + "\nThis file does not exist.\n"
- raise Exception(mess_error)
-#
-test_file = os.path.join(Rep_Test_Resu, rep_test_file, test_file_suff)
-if os.path.isfile (test_file) :
- file = open (test_file, "r")
- mess = file.readlines()
- file.close()
-else :
- mess_error = "\nResult file: " + test_file
- mess_error += "\nThis file does not exist.\n"
- raise Exception(mess_error)
-
-nblign = len(mess_ref)
-if ( len(mess) != nblign ):
- mess_error = mess_error_ref + "\nResult file: " + test_file
- mess_error += "\nThe number of lines of the files are not the same.\n"
- raise Exception(mess_error)
-
-for num in range(nblign) :
- if (( "creation" not in mess_ref[num] ) and ( mess_ref[num] != mess[num])) :
- message_erreur = "\nRefe : " + mess_ref[num]
- message_erreur += "Test : " + mess[num][:-1]
- message_erreur += "\nThe test is different from the reference."
- raise Exception(message_erreur)
+# Test of the results
#
-remove_dir(Rep_Test_Resu)
+n_rep_test_file = n_iter_test_file
+test_results(Rep_Test, Test_Name, dircase, n_iter_test_file, n_rep_test_file)
#
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
pathHomard = os.getenv('HOMARD_ROOT_DIR')
Rep_Test = os.path.join(pathHomard, "share", "salome", "resources", "homard")
Rep_Test = os.path.normpath(Rep_Test)
-Rep_Test_Resu = tempfile.mktemp()
-os.mkdir(Rep_Test_Resu)
+dircase = tempfile.mktemp()
+os.mkdir(dircase)
sys.path.append(Rep_Test)
-from test_util import remove_dir
+from test_util import test_results
salome.salome_init()
import iparameters
print "-------- Creation of the case", CaseName
MeshFile = os.path.join(Rep_Test, Test_Name + '.00.med')
Case_test_3 = homard.CreateCase(CaseName, 'MOYEU', MeshFile)
- Case_test_3.SetDirName(Rep_Test_Resu)
+ Case_test_3.SetDirName(dircase)
Case_test_3.SetConfType(1)
Case_test_3.AddBoundaryGroup('courbes', '')
Case_test_3.AddBoundaryGroup('cyl_ext', 'EXT')
print "-------- Creation of the iteration", IterName
Iter_test_3_1 = Case_test_3.NextIteration(IterName)
Iter_test_3_1.SetMeshName('MOYEU_1')
- Iter_test_3_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med'))
+ Iter_test_3_1.SetMeshFile(os.path.join(dircase, 'maill.01.med'))
Iter_test_3_1.AssociateHypo('Hypo_test_3')
error = Iter_test_3_1.Compute(1, 1)
if error :
print "-------- Creation of the iteration", IterName
Iter_test_3_2 = Iter_test_3_1.NextIteration(IterName)
Iter_test_3_2.SetMeshName('MOYEU_2')
- Iter_test_3_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med'))
+ Iter_test_3_2.SetMeshFile(os.path.join(dircase, 'maill.02.med'))
Iter_test_3_2.AssociateHypo('Hypo_test_3')
error = Iter_test_3_2.Compute(1, 1)
if error :
# ===========================
ScriptFile = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "en", "_downloads", "yacs_script.py")
ScriptFile = os.path.normpath(ScriptFile)
- DirName = Rep_Test_Resu
+ DirName = dircase
YACSName = "YACS_" + Test_Name
print "-------- Creation of the schema", YACSName
YACS_test_3 = Case_test_3.CreateYACSSchema(YACSName, ScriptFile, DirName, MeshFile)
except Exception, e:
raise Exception('Pb in homard_exec: '+e.message)
#
-# Test of the result
+# Test of the results
#
-test_file_suff = "apad.%02d.bilan" % n_iter_test_file
-rep_test_file = "I%02d" % (n_iter_test_file*n_boucle)
-#
-test_file = os.path.join(Rep_Test, Test_Name + "." + test_file_suff)
-mess_error_ref = "\nReference file: " + test_file
-try :
- file = open (test_file, "r")
- mess_ref = file.readlines()
- file.close()
-except :
- mess_error = mess_error_ref + "\nThis file does not exist.\n"
- raise Exception(mess_error)
-#
-test_file = os.path.join(Rep_Test_Resu, rep_test_file, test_file_suff)
-if os.path.isfile (test_file) :
- file = open (test_file, "r")
- mess = file.readlines()
- file.close()
-else :
- mess_error = "\nResult file: " + test_file
- mess_error += "\nThis file does not exist.\n"
- raise Exception(mess_error)
-
-nblign = len(mess_ref)
-if ( len(mess) != nblign ):
- mess_error = mess_error_ref + "\nResult file: " + test_file
- mess_error += "\nThe number of lines of the files are not the same.\n"
- raise Exception(mess_error)
-
-for num in range(nblign) :
- if (( "creation" not in mess_ref[num] ) and ( mess_ref[num] != mess[num])) :
- message_erreur = "\nRefe : " + mess_ref[num]
- message_erreur += "Test : " + mess[num][:-1]
- message_erreur += "\nThe test is different from the reference."
- raise Exception(message_erreur)
-#
-remove_dir(Rep_Test_Resu)
+n_rep_test_file = n_iter_test_file*n_boucle
+test_results(Rep_Test, Test_Name, dircase, n_iter_test_file, n_rep_test_file)
#
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
#
#========================================================================
#========================================================================
+def test_results(Rep_Test, Test_Name, dircase, n_iter_test_file, n_rep_test_file) :
+ """
+Test of the result
+Rep_Test: repertoire des tests
+Test_Name: nom du test
+dircase: repertoire des resultats du test
+n_iter_test_file: numero de l'iteration a tester
+n_rep_test_file: numero du repertoire de l'iteration a tester
+Copyright EDF-R&D 2014
+ """
+ #
+ test_file_suff = "apad.%02d.bilan" % n_iter_test_file
+ rep_test_file = "I%02d" % n_rep_test_file
+ #
+ test_file = os.path.join(Rep_Test, Test_Name + "." + test_file_suff)
+ mess_error_ref = "\nReference file: " + test_file
+ try :
+ file = open (test_file, "r")
+ mess_ref = file.readlines()
+ file.close()
+ except :
+ mess_error = mess_error_ref + "\nThis file does not exist.\n"
+ raise Exception(mess_error)
+ #
+ test_file = os.path.join(dircase, rep_test_file, test_file_suff)
+ if os.path.isfile (test_file) :
+ file = open (test_file, "r")
+ mess = file.readlines()
+ file.close()
+ else :
+ mess_error = "\nResult file: " + test_file
+ mess_error += "\nThis file does not exist.\n"
+ raise Exception(mess_error)
+
+ nblign = len(mess_ref)
+ if ( len(mess) != nblign ):
+ mess_error = mess_error_ref + "\nResult file: " + test_file
+ mess_error += "\nThe number of lines of the files are not the same.\n"
+ raise Exception(mess_error)
+
+ for num in range(nblign) :
+ if (( "creation" not in mess_ref[num] ) and ( mess_ref[num] != mess[num])) :
+ message_erreur = "\nRefe : " + mess_ref[num]
+ message_erreur += "Test : " + mess[num][:-1]
+ message_erreur += "\nThe test is different from the reference."
+ raise Exception(message_erreur)
+ #
+ remove_dir(dircase)
+#
+ return
+#
+#========================================================================
+#========================================================================