Salome HOME
Copyright update 2022
[modules/homard.git] / doc / files / tutorial_5.py
index c155c1d975d5601da44a60413d2514bcef373fdd..6a4ef753d88e3e351f4ebf630b1e47bc516bfa08 100755 (executable)
@@ -1,7 +1,7 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
-# Copyright (C) 2011-2016  CEA/DEN, EDF R&D
+# Copyright (C) 2011-2022  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
@@ -22,9 +22,9 @@
 
 """
 Exemple de couplage HOMARD-Salome
-Copyright EDF 1996, 2010, 2018
+Copyright EDF 1996, 2010, 2019
 """
-__revision__ = "V3.1"
+__revision__ = "V3.04"
 #
 import os
 import sys
@@ -35,11 +35,9 @@ PATH_HOMARD = os.getenv("HOMARD_ROOT_DIR")
 DATA_TUTORIAL = os.path.join(PATH_HOMARD, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
 DATA_TUTORIAL = os.path.normpath(DATA_TUTORIAL)
 sys.path.append(DATA_TUTORIAL)
-from tutorial_util import gzip_gunzip
 from tutorial_util import creation_dircase
 # ==================================
 DIRCASE = creation_dircase(5)
-gzip_gunzip(DATA_TUTORIAL, 5, -1)
 # ==================================
 #
 import salome
@@ -47,7 +45,7 @@ salome.salome_init()
 import HOMARD
 #
 homard = salome.lcc.FindOrLoadComponent("FactoryServer", "HOMARD")
-homard.SetCurrentStudy(salome.myStudy)
+homard.UpdateStudy()
 #
 #============================= Début des commandes =============================
 #
@@ -85,7 +83,7 @@ iter_5_1 = le_cas.NextIteration('iter_5_1')
 iter_5_1.SetMeshName('COEUR_2D_01')
 iter_5_1.SetMeshFile(os.path.join(DIRCASE, "maill.01.med"))
 iter_5_1.AssociateHypo('hypo_5')
-error = iter_5_1.Compute(1, 2)
+erreur = iter_5_1.Compute(1, 2)
 #
 # Iteration "iter_5_2"
 # ====================
@@ -93,13 +91,9 @@ iter_5_2 = iter_5_1.NextIteration('iter_5_2')
 iter_5_2.SetMeshName('COEUR_2D_02')
 iter_5_2.SetMeshFile(os.path.join(DIRCASE, "maill.02.med"))
 iter_5_2.AssociateHypo('hypo_5_bis')
-error = iter_5_2.Compute(1, 2)
+erreur = iter_5_2.Compute(1, 2)
 #
 #============================== Fin des commandes ==============================
 #
-# ==================================
-gzip_gunzip(DATA_TUTORIAL, 5, 1)
-# ==================================
-
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()