Salome HOME
Mise à jour de la documentation
authornicolas <nicolas>
Thu, 19 Sep 2013 15:26:50 +0000 (15:26 +0000)
committernicolas <nicolas>
Thu, 19 Sep 2013 15:26:50 +0000 (15:26 +0000)
Correction des tutorial_*.py
Création automatique de schémas YACS (suite)

43 files changed:
doc/en/tutorials.rst
doc/en/yacs.rst
doc/files/tutorial_1.py
doc/files/tutorial_2.py
doc/files/tutorial_3.py
doc/files/tutorial_4.py
doc/files/tutorial_5.py
doc/files/yacs_01.xml
doc/files/yacs_script.py [new file with mode: 0755]
doc/files/yacs_script.tgz [deleted file]
doc/fr/tutorials.rst
doc/fr/yacs.rst
doc/images/yacs_01.png
doc/images/yacs_c_01.png
doc/images/yacs_c_02.png
doc/images/yacs_c_04.png
doc/images/yacs_c_05.png
doc/images/yacs_c_06.png
doc/images/yacs_c_07.png
idl/HOMARD_Gen.idl
resources/Makefile.am
resources/write.png [new file with mode: 0644]
resources/yacs_01.xml
src/HOMARD/HOMARD_Iteration.cxx
src/HOMARD/HOMARD_YACS.cxx
src/HOMARD/YACSDriver.cxx
src/HOMARD/YACSDriver.hxx
src/HOMARDGUI/CreateYACS.h
src/HOMARDGUI/CreateYACS.ui
src/HOMARDGUI/HOMARDGUI.cxx
src/HOMARDGUI/HOMARDGUI_Utils.cxx
src/HOMARDGUI/HOMARDGUI_Utils.h
src/HOMARDGUI/HOMARD_msg_en.ts
src/HOMARDGUI/HOMARD_msg_fr.ts
src/HOMARDGUI/HOMARD_msg_ja.ts
src/HOMARDGUI/MonCreateYACS.cxx
src/HOMARDGUI/MonCreateYACS.h
src/HOMARDGUI/MonEditYACS.cxx
src/HOMARDGUI/MonEditYACS.h
src/HOMARD_I/HOMARD_Cas_i.cxx
src/HOMARD_I/HOMARD_Gen_i.cxx
src/HOMARD_I/HOMARD_Gen_i.hxx
src/HOMARD_I/HOMARD_YACS_i.cxx

index 93e4f9e586285faa199f5214164009c5a080dded..74beaa55e2d7e9293b9911fd8d1610a3628b0625 100644 (file)
@@ -37,7 +37,7 @@ One will make here three successive uniform refinements of the mesh contained in
 
 
 .. literalinclude:: ../files/tutorial_1.py
-   :lines: 53-86
+   :lines: 57-89
 
 .. note::
   Download the files
@@ -53,7 +53,7 @@ Refinement by zones
 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. It will be noted that the type of refinement was not specified; by default, it will be thus in conformity.
 
 .. literalinclude:: ../files/tutorial_2.py
-   :lines: 53-98
+   :lines: 57-101
 
 .. note::
   Download the files
@@ -70,7 +70,7 @@ One proceeds here to refinement according to a field. The hypotheses are used to
 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: 53-128
+   :lines: 57-131
 
 .. note::
   Download the files
@@ -89,7 +89,7 @@ One tests the follow-up of the curved borders here: analytical borders to descri
 Scheme YACS carrying out this adaptation is downloadable.
 
 .. literalinclude:: ../files/tutorial_4.py
-   :lines: 53-112
+   :lines: 57-115
 
 .. note::
   Download the files
@@ -108,7 +108,7 @@ The instructions to adapt a 2D mesh are exactly identical to those necessary to
 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: 53-98
+   :lines: 57-101
 
 .. note::
   Download the files
index 1eb777885cd412fd616ade18da143cc765f4aa5c..9146bc795227a9f817ff3fbf07f50de4c0ab6b0c 100644 (file)
@@ -14,8 +14,8 @@ Here is the description of a scheme for a computation in which a value is to be
 .. image:: ../images/yacs_01.png
    :align: center
    :alt: yacs - allure générale
-   :width: 535
-   :height: 362
+   :width: 512
+   :height: 306
 
 .. note::
   Among all the treated data, certain are unchanging: the name of the directory of calculation, the name of the case, the name of the hypothesis of adaptation, etc. It was chosen to impose them 'hard' in the various parameters of service or within the scripts python. We could also define them a priori in a node PresetNode and then pass on them by links. We did not hold this solution because it increases strongly the number of parameters and links attached to every node. It is very penalizing for the legibility of the scheme. The only data which are going to circulate are the ones been imperative by the description of the service and those that evolve during the execution of the scheme.
@@ -27,7 +27,7 @@ The main boxes are:
 
 - DataInit : initialisation of the initial mesh
 - Etude_Initialisation : launching of the module HOMARD inside SALOME
-- Tant_que_le_calcul_n_a_pas_converge : gestion of the loop computation/adaptation
+- Boucle_de_convergence : gestion of the loop computation/adaptation
 - Bilan : final information
 
 DataInit
@@ -67,15 +67,15 @@ The service SetCurrentStudy connects this study to an instance of HOMARD.
    :lines: 63-68
 
 
-Tant_que_le_calcul_n_a_pas_converge
-===================================
-The box Tant_que_le_calcul_n_a_pas_converge is type WhileLoop. The condition is initialized in 1: the internal block Alternance_Calcul_HOMARD is executed. Within this block, we calculate and we adapt the mesh; when the process has to stop either as a result of error, or by convergence, the condition passes in 0. The loop ends and we pass in the following box, Bilan.
+Boucle_de_convergence
+=====================
+The box Boucle_de_convergence is type WhileLoop. The condition is initialized in 1: the internal block Alternance_Calcul_HOMARD is executed. Within this block, we calculate and we adapt the mesh; when the process has to stop either as a result of error, or by convergence, the condition passes in 0. The loop ends and we pass in the following box, Bilan.
 
 .. image:: ../images/yacs_c_01.png
    :align: center
    :alt: Boucle
-   :width: 195
-   :height: 142
+   :width: 163
+   :height: 93
 
 Bilan
 =====
@@ -88,7 +88,7 @@ Bilan
 This box is a node python that takes in input a character string, MessInfo. If everything passed well, this message is empty. A window QT appears to confirm the convergence. If there was a problem, the message contains messages emitted during the calculations. The window QT shows this message.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 424-437
+   :lines: 406-419
 
 
 Loop for the calculations
@@ -96,8 +96,8 @@ Loop for the calculations
 .. image:: ../images/yacs_c_02.png
    :align: center
    :alt: Boucle
-   :width: 323
-   :height: 158
+   :width: 338
+   :height: 152
 
 This box is a block that manages the computation, the adaptation and the analysis.
 
@@ -112,58 +112,60 @@ Calcul
 This box is a node python that is going to drive the calculation. In input, we find the number of the calculation (0 at first) and the name of the file which contains the mesh on which to calculate. In output, we find an integer which represents the error on this calculation (0 so everything goes well) and a dictionary python gathering the results of the calculation. The body of the node is established by the launch of a script python that activates the calculation.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 77-104
+   :lines: 77-103
 
 In this example, we must define:
 
 - rep_calc : the directory in which will be executed the calculation.
-- rep_script : the directory in which is the python that will launch the calculation. This directory is to be added to the PATH. From this directory, we shall import LanceCas from the file LanceCas.py
+- rep_script : the directory in which is the python that will launch the calculation. This directory is to be added to the PATH. From this directory, we shall import Script from the file ScriptAster.py
 
-The python LanceCas is programmed as the user wishes it so that the calculation can be made on the current mesh. According to the mode of launch of the code of calculation, we can need other information, as the number of the calculation or the directory of the calculation for example. The freedom is total. In our case, the arguments of input are the name of the file of mesh, the number of the calculation and the directory of calculation. They are given in a list python: ["--rep_calc=rep_calc", "--numero=numCalc", "--mesh_file=MeshFile"]
+The python Script is programmed as the user wishes it so that the calculation can be made on the current mesh. According to the mode of launch of the code of calculation, we can need other information, as the number of the calculation or the directory of the calculation for example. The freedom is total. In our case, the arguments of input are the name of the file of mesh, the number of the calculation and the directory of calculation. They are given in a list python: ["--rep_calc=rep_calc", "--num=numCalc", "--mesh_file=MeshFile"]
 ].
 
 On the other hand the output of the script has to obey the following rule. We get back a code of error, an error message and a dictionary. This dictionary contains necessarily the following keys:
 
 - "FileName" : the name of the file that contains the results of the calculation
-- "MeshName" : the name of the used mesh
-- "V00" : the value the convergence of which we want to test
+- "V_TEST" : the value the convergence of which we want to test
 
 Adaptation
 ==========
 .. image:: ../images/yacs_c_04.png
    :align: center
    :alt: Adaptation
-   :width: 672
-   :height: 569
+   :width: 661
+   :height: 566
 
 The box Adaptation is a Switch node driven by the code of error of the previous calculation. If this code is nil, YACS will activate the box Adaptation_HOMARD that will launch the adaptation. If the code is not nil, we pass directly in the box Arret_boucle.
 
 Adaptation_HOMARD
 -----------------
-The first task tries to execute concern the initialization of the data necessary for HOMARD in the box HOMARD_Initialisation. This box is a switch node driven by the number of the calculation. In the starting up, the number is nil and YACS activates the box Homard_init_au_debut.
+The first task tries to execute concern the initialization of the data necessary for HOMARD in the box HOMARD_Initialisation. This box is a switch node driven by the number of the calculation. In the starting up, the number is nil and YACS activates the box Iter_1.
 
-Homard_init_au_debut
-^^^^^^^^^^^^^^^^^^^^
+Iter_1
+^^^^^^
 .. image:: ../images/yacs_c_06.png
    :align: center
-   :alt: Homard_init_au_debut
+   :alt: Iter_1
    :width: 481
-   :height: 150
+   :height: 151
 
 This box begins by creating the case HOMARD by calling the CreateCase service.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 220-227
+   :lines: 208-215
 
-The name of the case CaseName is imposed on "Calculation". The parameters of input MeshName and FileName arises from the output of the previous calculation. The parameter of output is an instance of case.
+The name of the case CaseName is imposed on "Calcul". The name of the case MeshName is imposed on "BOX". The parameters of input FileName arise from the output of the previous calculation. The parameter of output is an instance of case.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 443-446
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 461-464
+   :lines: 483-486
 
 The options of this case must be now given. It is made by the node python CaseOptions. It is imperative to give the directory of calculation. We shall look at the description of the functions in:ref: ' tui_create_case '. In output, we get back the instance of the iteration corresponding to the initial state of the case.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 228-242
+   :lines: 216-228
 
 Finally, a hypothesis is created by calling the CreateHypothèse service. The parameter of output is an instance of hypothese.
 
@@ -177,45 +179,45 @@ Once initialized, the adaptation can be calculated. It is the goal of the Homard
    :width: 153
    :height: 141
 
-The directory of calculation is recovered.
+The directory of calculation is recovered. The name of the mesh is given.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 258-263
+   :lines: 245-250
 
 ../..
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 339-347
+   :lines: 325-333
 
 The hypothesis transmitted in input parameter characterized (look :ref:`tui_create_hypothese`) :
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 267-291
+   :lines: 254-278
 
 It is necessary to establish a name for the future iteration. To make sure that the name was never used, one installs a mechanism of incremental naming starting from the name of the initial iteration. As this initial name is the name of the initial mesh, one obtains a succession of names in the form: M_001, M_002, M_003, etc
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 293-303
+   :lines: 280-290
 
 The iteration is supplemented : hypothesis, future mesh, field (look :ref:`tui_create_iteration`) :
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 305-325
+   :lines: 292-311
 
 The iteration is calculated. If it were correct, variable OK equals 1: one will be able to continue the execution of the scheme. If there were a problem, variable OK equals 0 to mean that calculation must stop; an error message then is given.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 327-338
+   :lines: 313-324
 
 After this execution, the process leaves the Adaptation_HOMARD node, then Adaptation node. One arrives then at the node of analysis.
 
-Homard_init_ensuite
-^^^^^^^^^^^^^^^^^^^
+Iter_n
+^^^^^^
 .. image:: ../images/yacs_c_07.png
    :align: center
-   :alt: Homard_init_ensuite
+   :alt: Iter_n
    :width: 323
-   :height: 97
+   :height: 92
 
 For the following passing in the block of adaptation, it is necessary to recover:
 
@@ -235,57 +237,52 @@ Arret_boucle
 The Arret_boucle block is present to only make forward variables because the input parameters of the nodes must always be filled. It is a very simple python:
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 185-196
+   :lines: 173-184
 
 Analyse
 =======
 .. image:: ../images/yacs_c_05.png
    :align: center
    :alt: Analyse
-   :width: 155
-   :height: 169
+   :width: 156
+   :height: 139
 
 The Analyse block is a script python which ensures the complete control of the process by examining the causes of possible error successively.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 105-118
+   :lines: 104-116
 
 ../..
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 173-182
+   :lines: 162-170
 
 One starts by analyzing the return of the computer code:
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 120-125
-
-Checking of the presence of the name of the mesh in the dictionary of the results:
-
-.. literalinclude:: ../files/yacs_01.xml
-   :lines: 127-134
+   :lines: 118-123
 
 Checking of the presence of the name of the result file in the dictionary of the results:
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 136-143
+   :lines: 125-132
 
-Checking of convergence. That supposes that the value to be tested is present in the dictionary under the key 'V00'. Here, one set up a test on the variation of the value of one calculation at the other. With the first passage, nothing is tested. In the following passing, one tests if the relative variation is lower than 1 thousandths. One could have set up an absolute test if one had recovered a total level of error for example.
+Checking of convergence. That supposes that the value to be tested is present in the dictionary under the key 'V_TEST'. Here, one set up a test on the variation of the value of one calculation at the other. With the first passage, nothing is tested. In the following passing, one tests if the relative variation is lower than 1 thousandths. One could have set up an absolute test if one had recovered a total level of error for example.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 145-163
+   :lines: 134-152
 
 Lastly, it is checked that a maximum nomber of adaptations is not exceeded:
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 165-170
+   :lines: 154-159
 
 
 Use this scheme
 ***************
 To reproduce this example, download:
   * :download:`the scheme <../files/yacs_01.xml>`
-  * :download:`an example of python script <../files/yacs_script.tgz>`
+  * :download:`an example of python script <../files/yacs_script.py>`
 
 It should be adapted to simulation considered. In particular, it is necessary:
 
index 9f14755d91ece546ce5a0a35525569e3f65d986b..20d1b33164f89c3a2c96ed10bd7aa593b213abf9 100644 (file)
@@ -54,13 +54,13 @@ homard = salome.lcc.FindOrLoadComponent("FactoryServer", "HOMARD")
 study_main = salome.myStudyManager.NewStudy("HOMARD")
 homard.SetCurrentStudy(salome.myStudy)
 #
-# Hypothesis "Hypo_1"
-# ===================
+# Hypotheses
+# ==========
 Hypo_1 = homard.CreateHypothesis('Hypo_1')
 Hypo_1.SetAdapRefinUnRef(-1, 1, 0)
 #
-# Case "Case_1"
-# =============
+# Cas
+# ===
 Case_1 = homard.CreateCase('Case_1', 'MAILL', data_dir+'/tutorial_1.00.med')
 Case_1.SetDirName(dircase)
 Case_1.SetConfType(1)
index 46375f71147dd08f7332c2405b741be960fb23b2..6d0ee6bf6b6a0843df19bc35f1c5126256be6968 100644 (file)
@@ -54,8 +54,8 @@ homard = salome.lcc.FindOrLoadComponent("FactoryServer", "HOMARD")
 study_main = salome.myStudyManager.NewStudy("HOMARD")
 homard.SetCurrentStudy(salome.myStudy)
 #
-# Creation of the zones
-# =====================
+# Creation des zones
+# ==================
 # Box "Zone_0"
 Zone_0 = homard.CreateZoneBox ('Zone_0', -0.1, 1.1, -0.1, 1.1, 0.9, 1.1)
 #
@@ -65,27 +65,27 @@ 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)
 #
-# Hypothesis "Hypo_2"
-# ===================
+# Hypothese "Hypo_2"
+# ==================
 Hypo_2 = homard.CreateHypothesis('Hypo_2')
 Hypo_2.SetAdapRefinUnRef(0, 1, 0)
 Hypo_2.AddZone('Zone_1', 1)
 Hypo_2.AddZone('Zone_0', 1)
 #
-# Hypothesis "Hypo_2_bis"
-# ===================
+# Hypothese "Hypo_2_bis"
+# ======================
 Hypo_2_bis = homard.CreateHypothesis('Hypo_2_bis')
 Hypo_2_bis.SetAdapRefinUnRef(0, 1, 0)
 Hypo_2_bis.AddZone('Zone_0', 1)
 Hypo_2_bis.AddZone('Zone_2', 1)
 #
-# Case "Case_2"
-# =============
+# Cas
+# ===
 Case_2 = homard.CreateCase('Case_2', 'MZERO', data_dir+'/tutorial_2.00.med')
 Case_2.SetDirName(dircase)
 #
 # Iteration "Iter_2_0"
-# ==================
+# ====================
 Iter_2_0 = Case_2.NextIteration('Iter_2_0')
 Iter_2_0.SetMeshName('M_1')
 Iter_2_0.SetMeshFile(dircase+'/maill.01.med')
@@ -93,7 +93,7 @@ Iter_2_0.AssociateHypo('Hypo_2')
 codret = Iter_2_0.Compute(1, 2)
 #
 # Iteration "Iter_2_1"
-# ==================
+# ====================
 Iter_2_1 = Iter_2_0.NextIteration('Iter_2_1')
 Iter_2_1.SetMeshName('M_2')
 Iter_2_1.SetMeshFile(dircase+'/maill.02.med')
index 86ba7bb998531d172a7e675c35e6493f62e9e877..55943ecc0742b2c2acd07ed4ef7c9c6c2903913e 100644 (file)
@@ -54,8 +54,8 @@ homard = salome.lcc.FindOrLoadComponent("FactoryServer", "HOMARD")
 study_main = salome.myStudyManager.NewStudy("HOMARD")
 homard.SetCurrentStudy(salome.myStudy)
 #
-# Hypothesis "Hypo_0vers1"
-# ========================
+# Hypothese "Hypo_0vers1"
+# =======================
 Hypo_0vers1 = homard.CreateHypothesis('Hypo_0vers1')
 Hypo_0vers1.SetAdapRefinUnRef(1, 1, 0)
 # Characterization of the field
@@ -67,8 +67,8 @@ Hypo_0vers1.SetTypeFieldInterp(2)
 Hypo_0vers1.AddFieldInterp('SOLU_0__DEPL____________________')
 Hypo_0vers1.AddFieldInterp('SOLU_0__ERRE_ELEM_SIGM__________')
 #
-# Hypothesis "Hypo_1vers2"
-# ========================
+# Hypothese "Hypo_1vers2"
+# =======================
 Hypo_1vers2 = homard.CreateHypothesis('Hypo_1vers2')
 Hypo_1vers2.SetAdapRefinUnRef(1, 1, 1)
 # Characterization of the field
@@ -81,8 +81,8 @@ Hypo_1vers2.SetTypeFieldInterp(2)
 Hypo_1vers2.AddFieldInterp('SOLU_1__DEPL____________________')
 Hypo_1vers2.AddFieldInterp('SOLU_1__QIRE_ELEM_SIGM__________')
 #
-# Hypothesis "Hypo_1vers2_bis"
-# ============================
+# Hypothese "Hypo_1vers2_bis"
+# ===========================
 Hypo_1vers2_bis = homard.CreateHypothesis('Hypo_1vers2_bis')
 Hypo_1vers2_bis.SetAdapRefinUnRef(1, 1, 1)
 # Characterization of the field
@@ -95,13 +95,13 @@ Hypo_1vers2_bis.SetRefinThr(1, 0.0001)
 Hypo_1vers2_bis.SetUnRefThr(1, 0.000001)
 Hypo_1vers2_bis.SetTypeFieldInterp(0)
 #
-# Case "Case_3"
-# =============
+# 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')
@@ -111,7 +111,7 @@ Iter_3_1.AssociateHypo('Hypo_0vers1')
 codret = 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')
@@ -121,7 +121,7 @@ Iter_3_2.AssociateHypo('Hypo_1vers2')
 codret = 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')
index 73b10b77fcd22051d2347ccb27145af3693e3b90..662efa46d25fa8b2b6fb2936b3f8d65536583702 100644 (file)
@@ -54,8 +54,8 @@ homard = salome.lcc.FindOrLoadComponent("FactoryServer", "HOMARD")
 study_main = salome.myStudyManager.NewStudy("HOMARD")
 homard.SetCurrentStudy(salome.myStudy)
 #
-# Creation of the boundaries
-# ==========================
+# 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.)
@@ -66,7 +66,7 @@ Boun_4_4 = homard.CreateBoundaryCylinder('cyl_1_int', 0.0, 25., -25., 25., 50.,
 #
 Boun_4_5 = homard.CreateBoundaryCylinder('cyl_2_int', 17.5, -2.5, -12.5, -100., -75., -25., 25.)
 #
-# Hypothesis
+# Hypotheses
 # ==========
 # Creation of the hypothesis Hypo_4
 Hypo_4 = homard.CreateHypothesis('Hypo_4')
@@ -81,8 +81,8 @@ Hypo_4_bis.AddGroup('T1_EXT_I')
 Hypo_4_bis.AddGroup('T1_EXT_O')
 Hypo_4_bis.AddGroup('T2_EXT')
 #
-# Case "Case_4"
-# =============
+# Cas
+# ===
 Case_4 = homard.CreateCase('Case_4', 'PIQUAGE', data_dir+'/tutorial_4.00.med')
 Case_4.SetDirName(dircase)
 Case_4.AddBoundaryGroup( 'intersection', '' )
@@ -93,21 +93,21 @@ 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' )
 #
-# Creation of the iterations
-# ==========================
-# Creation of the iteration Iter_4_1 : raffinement selon les faces internes
+# 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')
 codret = Iter_4_1.Compute(1, 2)
-# Creation of the iteration Iter_4_2 : raffinement selon les faces externes
+# 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)
-# Creation of the iteration Iter_4_3 : second raffinement selon les faces externes
+# 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')
index 03da77fe617370d1dfd72158e5acf9cf10d5813a..a9069877ddf8b5fcf0af9052a1945e619d28cc71 100644 (file)
@@ -54,19 +54,19 @@ homard = salome.lcc.FindOrLoadComponent("FactoryServer", "HOMARD")
 study_main = salome.myStudyManager.NewStudy("HOMARD")
 homard.SetCurrentStudy(salome.myStudy)
 #
-# Creation of the boundaries
-# ==========================
+# 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 of the zones
-# =====================
+# 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 )
 #
-# Hypothesis
+# Hypotheses
 # ==========
 # Creation of the hypothesis Hypo_5
 Hypo_5 = homard.CreateHypothesis('Hypo_5')
@@ -77,15 +77,15 @@ Hypo_5_bis = homard.CreateHypothesis('Hypo_5_bis')
 Hypo_5_bis.SetAdapRefinUnRef(0, 1, 0)
 Hypo_5_bis.AddZone('quart_sup', 1)
 #
-# Case "Case_5"
-# =============
+# 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')
@@ -93,7 +93,7 @@ Iter_5_1.AssociateHypo('Hypo_5')
 codret = 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')
index 9b299b2b80b0d9e95b8b9127f2296427eb1b77de..c62572b534013a40a6b84e8dc24700fce3add66b 100644 (file)
@@ -72,27 +72,26 @@ NewStudy = StudyManager.NewStudy("my_homard_study")
          <tonode>SetCurrentStudy</tonode> <toport>theStudy</toport>
       </datalink>
    </bloc>
-   <while name="Tant_que_le_calcul_n_a_pas_converge">
+   <while name="Boucle_de_convergence">
       <bloc name="Alternance_Calcul_HOMARD">
          <inline name="Calcul">
             <script><code><![CDATA[
 import sys
 import os
-# REPBASE : le repertoire de base de l'application
-REPBASE = os.environ["HOMARD_TRAINING"]
-rep_calc = os.path.join(REPBASE, "tet_aster_ther")
-rep_script = os.path.join(REPBASE, "script")
+#
+rep_calc = "/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther"
+rep_script = os.path.dirname("/scratch/D68518/Salome/HOMARD_SALOME/HOMARD_SRC/doc/files/ScriptAster.py")
 sys.path.append(rep_script)
-from LanceCas import LanceCas
+from ScriptAster import Script
 #
 argu  = ["-v"]
 argu.append("--rep_calc=" + rep_calc)
-argu.append("--numero=%d" % numCalc)
+argu.append("--num=%d" % numCalc)
 argu.append("--mesh_file="  + MeshFile)
 #
-LanceCas_A = LanceCas(argu)
+Script_A = Script(argu)
 #
-Error, message_erreur, dico_resu = LanceCas_A.calcul ()
+Error, message_erreur, dico_resu = Script_A.compute ()
 #
 dico_resu["rep_calc"] = rep_calc
 #
@@ -108,7 +107,6 @@ global NumCalc
 global resu1
 # Valeurs par defaut
 NumCalcP1 = NumCalc + 1
-MeshName = " "
 FileName = " "
 #
 NbCalcMax = 5
@@ -124,28 +122,19 @@ while not Error :
         Error = abs(ErrCalc)
         break
 #
-# Si le maillage n'a pas ete defini, on arrete :
-#
-    if dico_resu.has_key("MeshName") :
-        MeshName = dico_resu["MeshName"]
-    else :
-        MessInfo = "Le maillage n'a pas ete defini"
-        Error = -2
-        break
-#
 # Si le fichier n'a pas ete defini, on arrete :
 #
     if dico_resu.has_key("FileName") :
         FileName = dico_resu["FileName"]
     else :
         MessInfo = "Le fichier du maillage n'a pas ete defini"
-        Error = -3
+        Error = -2
         break
 #
 # Si le critere est respecte, on arrete :
 #
-    if dico_resu.has_key("V00") :
-        valeur_v = dico_resu["V00"]
+    if dico_resu.has_key("V_TEST") :
+        valeur_v = dico_resu["V_TEST"]
         if NumCalc == 0 :
             resu1 = [valeur_v]
         else :
@@ -159,7 +148,7 @@ while not Error :
                 break
     else :
         MessInfo = "La valeur a tester n'a pas ete fournie"
-        Error = -4
+        Error = -3
         break
 #
 # Si on depasse le maximum, on arrete :
@@ -176,7 +165,6 @@ while not Error :
             <inport name="dico_resu" type="pyobj"/>
             <outport name="Error" type="int"/>
             <outport name="NumCalcP1" type="int"/>
-            <outport name="MeshName" type="string"/>
             <outport name="FileName" type="string"/>
             <outport name="MessInfo" type="string"/>
          </inline>
@@ -199,7 +187,7 @@ MeshFile = " "
                <bloc name="Adaptation_HOMARD">
                   <switch name="HOMARD_Initialisation" select="0">
                      <default>
-                        <bloc name="HOMARD_Init_ensuite">
+                        <bloc name="Iter_n">
                            <service name="LastIteration">
                               <node>Etude_Initialisation.SetCurrentStudy</node>
                               <method>LastIteration</method>
@@ -216,7 +204,7 @@ MeshFile = " "
                         </bloc>
                      </default>
                      <case id="1">
-                        <bloc name="HOMARD_Init_au_debut">
+                        <bloc name="Iter_1">
                            <service name="CreateCase">
                               <node>Etude_Initialisation.SetCurrentStudy</node>
                               <method>CreateCase</method>
@@ -229,10 +217,8 @@ MeshFile = " "
                               <script><code><![CDATA[
 import os
 # Repertoire d'execution
-REPBASE = os.environ["HOMARD_TRAINING"]
-DirName = os.path.join(REPBASE, "tet_aster_ther", "resu")
+DirName = "/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/HOMARD"
 Case.SetDirName(DirName)
-# Options de conformite
 Case.SetConfType(1)
 # Iteration 0 associee
 Iter0 = Case.GetIter0()
@@ -248,6 +234,7 @@ Iter0 = Case.GetIter0()
                            </service>
                            <control> <fromnode>CreateCase</fromnode> <tonode>Case_Options</tonode> </control>
                            <control> <fromnode>Case_Options</fromnode> <tonode>CreateHypothesis</tonode> </control>
+
                            <datalink control="false">
                               <fromnode>CreateCase</fromnode> <fromport>return</fromport>
                               <tonode>Case_Options</tonode> <toport>Case</toport>
@@ -259,8 +246,8 @@ Iter0 = Case.GetIter0()
                      <script><code><![CDATA[
 import os
 # Repertoire d'execution
-REPBASE = os.environ["HOMARD_TRAINING"]
-DirName = os.path.join(REPBASE, "tet_aster_ther", "resu")
+DirName = "/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther"
+MeshName = "BOX"
 #
 # Hypothese
 # =========
@@ -271,20 +258,20 @@ HypoName = Hypo.GetName()
 # . Options
 # ---------
 # . Le mode d'adaptation : raffinement selon un champ
-Hypo.SetAdapRefinUnRef(1, 1, 0)
+Hypo.SetAdapRefinUnRef(1, 1, 1)
 # . Nom du champ
-Hypo.SetField('ERREUR')
-# . Nom de la composante
-Hypo.AddComp('ERTABS')
+Hypo.SetField("ERREUR")
 # . Valeurs prises par maille
-Hypo.SetUseComp(0)
+Hypo.SetUseField(0)
+# . Composante
+Hypo.AddComp("ERTABS")
 # . Mode de pilotage
-if NumAdapt <= 2 :
-    seuil = 5.
-else :
-    seuil = 3.
-# Type de seuil : 3 : x% des mailles les pires
-Hypo.SetRefinThr(3, seuil)
+Hypo.SetRefinThr(4, 3)
+Hypo.SetUnRefThr(4, 4)
+#
+# . Interpolation
+Hypo.SetTypeFieldInterp(2)
+Hypo.AddFieldInterp("TEMPERATURE")
 #
 # . Taille de maille limite
 aux = 0.0015
@@ -312,7 +299,6 @@ Iter = LastIter.NextIteration(IterName)
 Iter.AssociateHypo(HypoName)
 #
 # . Le nom du futur maillage
-MeshName = dico_resu["MeshName"]
 Iter.SetMeshName(MeshName)
 #
 # . Le fichier du futur maillage
@@ -347,19 +333,19 @@ else :
                   </inline>
                   <control> <fromnode>HOMARD_Initialisation</fromnode> <tonode>HOMARD_Exec</tonode> </control>
                   <datalink control="false">
-                     <fromnode>HOMARD_Initialisation.default_HOMARD_Init_ensuite.LastIteration</fromnode> <fromport>return</fromport>
+                     <fromnode>HOMARD_Initialisation.default_Iter_n.LastIteration</fromnode> <fromport>return</fromport>
                      <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
                   </datalink>
                   <datalink control="false">
-                     <fromnode>HOMARD_Initialisation.p1_HOMARD_Init_au_debut.Case_Options</fromnode> <fromport>Iter0</fromport>
+                     <fromnode>HOMARD_Initialisation.p1_Iter_1.Case_Options</fromnode> <fromport>Iter0</fromport>
                      <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
                   </datalink>
                   <datalink control="false">
-                     <fromnode>HOMARD_Initialisation.default_HOMARD_Init_ensuite.GetHypothesis</fromnode> <fromport>return</fromport>
+                     <fromnode>HOMARD_Initialisation.default_Iter_n.GetHypothesis</fromnode> <fromport>return</fromport>
                      <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
                   </datalink>
                   <datalink control="false">
-                     <fromnode>HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateHypothesis</fromnode> <fromport>return</fromport>
+                     <fromnode>HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</fromnode> <fromport>return</fromport>
                      <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
                   </datalink>
                </bloc>
@@ -383,13 +369,9 @@ else :
             <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
             <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>NumAdapt</toport>
          </datalink>
-         <datalink control="false">
-            <fromnode>Analyse</fromnode> <fromport>MeshName</fromport>
-            <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateCase</tonode> <toport>MeshName</toport>
-         </datalink>
          <datalink control="false">
             <fromnode>Analyse</fromnode> <fromport>FileName</fromport>
-            <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateCase</tonode> <toport>FileName</toport>
+            <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode> <toport>FileName</toport>
          </datalink>
          <datalink control="false">
             <fromnode>Analyse</fromnode> <fromport>MessInfo</fromport>
@@ -436,89 +418,95 @@ else :
       <inport name="MessInfo" type="string"/>
    </inline>
    <control> <fromnode>DataInit</fromnode> <tonode>Etude_Initialisation</tonode> </control>
-   <control> <fromnode>Etude_Initialisation</fromnode> <tonode>Tant_que_le_calcul_n_a_pas_converge</tonode> </control>
-   <control> <fromnode>Tant_que_le_calcul_n_a_pas_converge</fromnode> <tonode>Bilan</tonode> </control>
+   <control> <fromnode>Etude_Initialisation</fromnode> <tonode>Boucle_de_convergence</tonode> </control>
+   <control> <fromnode>Boucle_de_convergence</fromnode> <tonode>Bilan</tonode> </control>
    <datalink control="false">
       <fromnode>DataInit</fromnode> <fromport>MeshFile</fromport>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Calcul</tonode> <toport>MeshFile</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode> <toport>MeshFile</toport>
    </datalink>
    <datalink control="false">
-      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>OK</fromport>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge</tonode> <toport>condition</toport>
+      <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>OK</fromport>
+      <tonode>Boucle_de_convergence</tonode> <toport>condition</toport>
    </datalink>
    <datalink control="false">
-      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>OK</fromport>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge</tonode> <toport>condition</toport>
+      <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>OK</fromport>
+      <tonode>Boucle_de_convergence</tonode> <toport>condition</toport>
    </datalink>
    <datalink control="false">
-      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MessInfo</fromport>
+      <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MessInfo</fromport>
       <tonode>Bilan</tonode> <toport>MessInfo</toport>
    </datalink>
    <datalink control="false">
-      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MessInfo</fromport>
+      <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MessInfo</fromport>
       <tonode>Bilan</tonode> <toport>MessInfo</toport>
    </datalink>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateCase</tonode><toport>CaseName</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode><toport>CaseName</toport>
       <value><string>Calcul</string></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Calcul</tonode><toport>numCalc</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode><toport>numCalc</toport>
       <value><int>0</int></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation</tonode><toport>select</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation</tonode><toport>select</toport>
       <value><int>0</int></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode><toport>select</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode><toport>select</toport>
       <value><int>0</int></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.LastIteration</tonode><toport>CaseName</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.LastIteration</tonode><toport>CaseName</toport>
       <value><string>Calcul</string></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.GetHypothesis</tonode><toport>HypoName</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.GetHypothesis</tonode><toport>HypoName</toport>
       <value><string>Hypo</string></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateHypothesis</tonode><toport>HypoName</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</tonode><toport>HypoName</toport>
       <value><string>Hypo</string></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge</tonode><toport>condition</toport>
+      <tonode>Boucle_de_convergence</tonode><toport>condition</toport>
       <value><boolean>true</boolean></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Analyse</tonode><toport>NumCalc</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>NumCalc</toport>
       <value><int>0</int></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Analyse</tonode><toport>ErrCalc</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>ErrCalc</toport>
       <value><int>0</int></value>
    </parameter>
+   <parameter>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode><toport>MeshName</toport>
+      <value><string>BOX</string></value>
+   </parameter>
+
    <presentation name="__ROOT__" x="0" y="0" width="704" height="977" expanded="1" expx="0" expy="0" expWidth="704" expHeight="977" shownState="0"/>
    <presentation name="DataInit" x="4" y="32" width="158" height="63" expanded="1" expx="4" expy="32" expWidth="158" expHeight="63" shownState="0"/>
-   <presentation name="Etude_Initialisation" x="175" y="32" width="325" height="99" expanded="1" expx="175" expy="32" expWidth="325" expHeight="99" shownState="0"/>
-   <presentation name="Etude_Initialisation.StudyCreation" x="4" y="32" width="158" height="63" expanded="1" expx="4" expy="32" expWidth="158" expHeight="63" shownState="0"/>
-   <presentation name="Etude_Initialisation.SetCurrentStudy" x="163" y="32" width="158" height="63" expanded="1" expx="163" expy="32" expWidth="158" expHeight="63" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge" x="4" y="132" width="696" height="841" expanded="1" expx="4" expy="132" expWidth="696" expHeight="841" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD" x="4" y="59" width="682" height="778" expanded="1" expx="10" expy="59" expWidth="682" expHeight="778" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Calcul" x="4" y="32" width="158" height="90" expanded="1" expx="4" expy="32" expWidth="158" expHeight="90" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Analyse" x="181" y="32" width="158" height="171" expanded="1" expx="181" expy="32" expWidth="158" expHeight="171" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation" x="4" y="204" width="674" height="570" expanded="1" expx="4" expy="204" expWidth="674" expHeight="570" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle" x="4" y="59" width="166" height="153" expanded="1" expx="4" expy="59" expWidth="166" expHeight="153" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret" x="4" y="32" width="158" height="117" expanded="1" expx="4" expy="32" expWidth="158" expHeight="117" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD" x="4" y="213" width="666" height="353" expanded="1" expx="4" expy="213" expWidth="666" expHeight="353" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation" x="4" y="32" width="492" height="316" expanded="1" expx="4" expy="32" expWidth="492" expHeight="316" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut" x="4" y="59" width="483" height="153" expanded="1" expx="4" expy="59" expWidth="483" expHeight="153" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateCase" x="4" y="32" width="158" height="117" expanded="1" expx="4" expy="32" expWidth="158" expHeight="117" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.Case_Options" x="163" y="32" width="158" height="63" expanded="1" expx="163" expy="32" expWidth="158" expHeight="63" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateHypothesis" x="322" y="32" width="158" height="63" expanded="1" expx="322" expy="32" expWidth="158" expHeight="63" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite" x="4" y="213" width="325" height="99" expanded="1" expx="4" expy="213" expWidth="325" expHeight="99" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.LastIteration" x="4" y="32" width="158" height="63" expanded="1" expx="4" expy="32" expWidth="158" expHeight="63" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.GetHypothesis" x="163" y="32" width="158" height="63" expanded="1" expx="163" expy="32" expWidth="158" expHeight="63" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec" x="504" y="32" width="158" height="144" expanded="1" expx="504" expy="32" expWidth="158" expHeight="144" shownState="0"/>
-   <presentation name="Bilan" x="535" y="32" width="158" height="63" expanded="1" expx="535" expy="36" expWidth="158" expHeight="63" shownState="0"/>
+   <presentation name="Etude_Initialisation" x="175" y="32" width="158" height="38" expanded="0" expx="175" expy="32" expWidth="162.5" expHeight="40.5" shownState="1"/>
+   <presentation name="Etude_Initialisation.StudyCreation" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Etude_Initialisation.SetCurrentStudy" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Boucle_de_convergence" x="4" y="103" width="569" height="514" expanded="1" expx="4" expy="103" expWidth="569" expHeight="514" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD" x="4" y="59" width="561" height="451" expanded="1" expx="10" expy="59" expWidth="561" expHeight="451" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul" x="4" y="32" width="158" height="90" expanded="1" expx="4" expy="32" expWidth="158" expHeight="90" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse" x="181" y="32" width="158" height="171" expanded="1" expx="181" expy="32" expWidth="158" expHeight="171" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation" x="4" y="204" width="553" height="243" expanded="1" expx="4" expy="204" expWidth="553" expHeight="243" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle" x="4" y="59" width="166" height="153" expanded="1" expx="4" expy="59" expWidth="166" expHeight="153" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret" x="4" y="32" width="158" height="117" expanded="1" expx="4" expy="32" expWidth="158" expHeight="117" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD"  x="202" y="59" width="347" height="180" expanded="1" expx="202" expy="59" expWidth="347" expHeight="180" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation" x="4" y="32" width="158" height="65" expanded="0" expx="4" expy="32" expWidth="167" expHeight="67.5" shownState="1"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1" x="0" y="0" width="162.5" height="40.5" expanded="1" expx="4" expy="59" expWidth="162.5" expHeight="40.5" shownState="2"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.Case_Options" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateHypothesis" x="0" y="0" width="158" height="36" expanded="1" expx="322" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n" x="0" y="0" width="162.5" height="40.5" expanded="1" expx="4" expy="1639.5" expWidth="162.5" expHeight="40.5" shownState="2"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.LastIteration" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.GetHypothesis" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec" x="185" y="32" width="158" height="144" expanded="1" expx="185" expy="32" expWidth="158" expHeight="144" shownState="0"/>
+   <presentation name="Bilan" x="350" y="32" width="158" height="63" expanded="1" expx="350" expy="32" expWidth="158" expHeight="63" shownState="0"/>
 </proc>
+
diff --git a/doc/files/yacs_script.py b/doc/files/yacs_script.py
new file mode 100755 (executable)
index 0000000..5b6f347
--- /dev/null
@@ -0,0 +1,1370 @@
+#!/usr/bin/env python
+# -*- coding: iso-8859-1 -*-
+"""
+Lancement d'un calcul ASTER
+"""
+__revision__ = "V5.2"
+#
+import sys
+import os
+import tempfile
+import time
+#
+# ==== Debut de personnalisation ====
+#
+# opt1_defaut, opt2_defaut : les valeurs par defaut de ces options, selon les cas
+opt1_defaut = {}
+opt2_defaut = {}
+# liste_cas_tr : liste des cas transitoires
+liste_cas_tr = []
+#
+nro_couche = 1
+opt1_defaut["couche"] = str(nro_couche)
+nro_adap = 0
+opt2_defaut["couche"] = str(nro_adap)
+#
+liste_cas_tr.append("tet_aster_ther_tr")
+opt1_defaut["tet_aster_ther_tr"] = "0"
+opt2_defaut["tet_aster_ther_tr"] = "25"
+#
+liste_cas_tr.append("ssnp142d")
+opt1_defaut["ssnp142d"] = "0.0"
+opt2_defaut["ssnp142d"] = "4.0"
+#
+liste_cas_tr.append("Riete")
+opt1_defaut["Riete"] = "0.0"
+opt2_defaut["Riete"] = "8.0"
+#
+# ==== Fin de personnalisation ====
+#
+class Script :
+#
+  """
+Mode d'emploi :
+---------------
+
+Cette procedure lance un calcul Aster. Le mode de lancement est le suivant :
+
+ScriptAster --rep_calc=rep_calc --num=nro --mesh_file=mesh_file [-dump] [-h|-help] [-v] [-v_max] options
+
+Arguments obligatoires :
+--rep_calc=rep_calc : le repertoire du calcul.
+--num=nro : le numero du calcul, depuis 0.
+--mesh_file=mesh_file : le fichier contenant le maillage sur lequel on veut calculer.
+
+Options supplementaires, selon les cas :
+. Pour un cas transitoire :
+Les numeros des instants varient de 0 a N. On fournit le numero ou l'instant ; le jeu de commandes fait le tri entre les deux options.
+--opt1=inst_deb : le numero ou l'instant initial ; si absent, on prend 0.
+--opt2=inst_fin : le numero ou l'instant final ; si absent, on va jusqu'au bout du transitoire.
+. Pour l'excavation :
+--opt1=nro_couche : le numero de la couche ; si absent, on prend 1.
+--opt2=nro_adap : le nombre d'adaptations deja realisees pour la couche ; si absent, on prend 0.
+. Pour les autres cas :
+Aucune option supplementaire.
+
+Arguments optionnels :
+
+--wait=attente : temps d'attente en secondes entre deux examens de l'etat d'un calcul batch ; si absent, on prend 10.
+
+-dump : produit le fichier dump du fichier med de resultats ; par defaut, pas de dump.
+
+-h|-help : produit l'aide, quels que soient les autres arguments
+-v : mode verbeux simple
+-v_max : mode verbeux intensif
+
+Exemple :
+./ScriptAster.py --rep_calc=`pwd` --num=0 --mesh_file=maill.00.med -dump
+./ScriptAster.py --rep_calc=/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther --num=2 --mesh_file=/scratch/D68518/Salome/Adapt/resu/maill.02.med
+  """
+#
+#====
+# 0. Les defauts
+#====
+# 0.1. ==> Les constantes de la machine
+#
+  info_gene = os.uname()
+  #print info_gene
+#
+  machine = info_gene[1]
+  serveur = machine
+  mclient = machine
+#
+# 0.2. ==> Le user
+#
+  if os.environ.has_key("LOGNAME") :
+    user = os.environ ["LOGNAME"]
+  else :
+    user = "salome"
+  username = user
+  uclient = user
+#
+# 0.3. ==> Le lancement d'Aster
+#
+  aster_root = None
+#
+  nomjob = None
+  mode = None
+# Attente en secondes entre deux controles du job
+  attente = "10"
+#
+# 0.4. ==> Information
+#
+  affiche_aide_globale = 0
+  verbose = 0
+  verbose_max = 0
+  dump = 0
+#
+  message_info = "\n"
+#
+#
+#========================= Debut de la fonction ==================================
+#
+  def __init__ ( self, liste_arg ) :
+#
+    """
+Le constructeur de la classe Script
+    """
+#
+# 1. Decodage des arguments
+#
+    self.rep_calc = None
+    self.num = None
+    self.mesh_file = None
+    self.opt1 = None
+    self.opt2 = None
+    self.version = None
+#
+    for argu in liste_arg :
+#
+      #print argu
+      l_aux = argu.split("=")
+      #print l_aux
+      if len(l_aux) == 2 :
+        #print l_aux[0]
+        #print l_aux[1]
+        if l_aux[0] == "--rep_calc" :
+          self.rep_calc = l_aux[1]
+        elif l_aux[0] == "--num" :
+          self.numero = int(l_aux[1])
+        elif l_aux[0] == "--mesh_file" :
+          self.mesh_file = l_aux[1]
+        elif l_aux[0] == "--opt1" :
+          self.opt1 = l_aux[1]
+        elif l_aux[0] == "--opt2" :
+          self.opt2 = l_aux[1]
+        elif l_aux[0] == "--wait" :
+          self.attente = l_aux[1]
+        elif l_aux[0] == "--version" :
+          self.version = l_aux[1]
+      else :
+        saux = argu.upper()
+        if saux in ( "-H", "-HELP" ) :
+          self.affiche_aide_globale = 1
+        elif saux == "-V" :
+          self.verbose = 1
+        elif saux in ( "-V_MAX", "-VMAX" ) :
+          self.verbose = 1
+          self.verbose_max = 1
+        elif saux == "-DUMP" :
+          self.dump = 1
+#
+# 2. Les paramètres de base
+#
+    self.dico = {}
+    self.nomfic_export = None
+    self.nomcas = ""
+#
+    if self.verbose_max :
+      nom_fonction = __name__ + "/__init__"
+      print "\nDans " + nom_fonction + ","
+      print ". rep_calc  :", self.rep_calc
+      print ". numero    :", self.numero
+      print ". mesh_file :", self.mesh_file
+      print ". opt1      :", self.opt1
+      print ". opt2      :", self.opt2
+      print ". attente   :", self.attente
+#
+#=========================  Fin de la fonction ===================================
+#
+#========================= Debut de la fonction ==================================
+#
+  def compute ( self ) :
+#
+    """
+Lancement d'un calcul
+    """
+#
+    nom_fonction = __name__ + "/compute"
+    blabla = "\nDans " + nom_fonction + ","
+#
+    erreur = 0
+    message_erreur = " "
+#
+    dico_resu = {}
+#
+    while not erreur :
+#
+# 1. Preparation du calcul
+#
+      #print "\n==== self.prepa_calcul () ===="
+      erreur, message_erreur = self.prepa_calcul ()
+      if erreur :
+        break
+#
+# 2. Calcul
+#
+      #print "\n==== self.calcul () ===="
+      erreur, message_erreur, fic_caract, fic_caract_2 = self.calcul ()
+      #print "erreur en sortie de self.calcul :", erreur
+      if erreur :
+        break
+#
+# 3. Attente
+#
+      #print "\n==== calcul_aster_attente.calcul (",fic_caract,") ===="
+      erreur, message_erreur = self.calcul_aster_attente (fic_caract)
+      if erreur :
+        break
+      os.remove(fic_caract)
+      os.remove(fic_caract_2)
+#
+# 4. Gestion du resultat
+#
+      #print "\n==== self.post_aster (dico_resu) ===="
+      erreur, message_erreur, dico_resu = self.post_aster (dico_resu)
+      if erreur :
+        break
+#
+# 5. Dump eventuel
+#
+      if self.dump :
+        #print "\n==== self.dump_resultat() ===="
+        erreur, message_erreur = self.dump_resultat ()
+        if erreur :
+          break
+#
+      break
+#
+    if self.verbose_max :
+      print blabla
+      print ". erreur :", erreur
+#
+    return erreur, message_erreur, dico_resu
+#
+#=========================  Fin de la fonction ===================================
+#
+#========================= Debut de la fonction ==================================
+#
+  def prepa_calcul ( self ) :
+#
+    """
+Preparation d'un calcul
+    """
+#
+    messages_erreur = { 0 : None }
+#
+    nom_fonction = __name__ + "/prepa_calcul"
+    blabla = "\nDans " + nom_fonction + ","
+#
+    erreur = 0
+    message_erreur = " "
+#
+    if self.verbose_max :
+      print blabla
+      print ". numero    :", self.numero
+      print ". mesh_file :", self.mesh_file
+      print ". rep_calc  :", self.rep_calc
+#
+    while not erreur :
+#
+# 1. Controles des arguments
+#
+      erreur, message_erreur = self.controle_argument()
+      if erreur :
+        break
+#
+# 2. Modification du fichier export
+#
+      erreur, message_erreur = self.modif_export()
+      if erreur :
+        break
+#
+# 3. Modifications du fichier de commandes
+# 3.1. Pour un cas transitoire
+#
+      if self.nomcas in liste_cas_tr :
+        erreur, message_erreur = self.modif_cas_transitoire()
+        if erreur :
+          break
+#
+# 3.2. Pour l'excavation
+#
+      elif self.nomcas[:6] == "couche" :
+        erreur, message_erreur = self.modif_cas_excavation()
+        if erreur :
+          break
+#
+      break
+#
+    if self.verbose_max :
+      print blabla, "a la fin"
+      print ". erreur :", erreur
+#
+    return erreur, message_erreur
+#
+#=========================  Fin de la fonction ===================================
+#
+#========================= Debut de la fonction ==================================
+#
+  def controle_argument ( self ) :
+#
+    """
+Controle les arguments et stockage de quelques informations
+    """
+#
+    messages_erreur = { 0 : None,
+                       -1 : "Quel repertoire de calcul ?",
+                       -2 : "Quel fichier de maillage ?",
+                       -3 : "Ce repertoire est inconnu.",
+                       -4 : "Ce fichier est inconnu.",
+                       -5 : "Quel temps d'attente ?",
+                       -6 : "Quel numero de calcul ?",
+                       -7 : "Numeros de pas de temps invalides.",
+                       -8 : "Numero de couche invalide.",
+                       -9 : "Numero d'adaptation invalide." }
+#
+    nom_fonction = __name__ + "/controle_argument"
+    blabla = "\nDans " + nom_fonction + ","
+#
+    erreur = 0
+    message_erreur = " "
+#
+    if self.verbose_max :
+      print blabla
+      print ". rep_calc  :", self.rep_calc
+      print ". mesh_file :", self.mesh_file
+      print ". numero    :", self.numero
+      print ". attente   :", self.attente
+      print ". opt1      :", self.opt1
+      print ". opt2      :", self.opt2
+#
+    while not erreur :
+#
+# 1. Les repertoire et fichier
+#
+      if self.rep_calc == None :
+        erreur = -1
+      elif self.mesh_file == None :
+        erreur = -2
+      if erreur < 0 :
+        self.message_info += "Relancer avec -h pour avoir le mode d'emploi."
+        break
+#
+      if os.environ.has_key("HOME") :
+        HOME = os.environ ["HOME"]
+      else :
+        HOME = "/local/home/salome"
+#
+      if ( self.rep_calc[:1] == "~" ) :
+        self.rep_calc = os.path.join(HOME, self.rep_calc[2:])
+      if not os.path.isdir(self.rep_calc) :
+        self.message_info += "Repertoire " + self.rep_calc
+        erreur = -3
+        break
+      else :
+        aux = os.path.join(os.getcwd(),self.rep_calc)
+        self.rep_calc = os.path.normpath(aux)
+#
+      if ( self.mesh_file[:1] == "~" ) :
+        self.mesh_file = os.path.join(HOME, self.mesh_file[2:])
+      if not os.path.isfile(self.mesh_file) :
+        self.message_info += "Fichier " + self.mesh_file
+        erreur = -4
+        break
+      else :
+        aux = os.path.join(os.getcwd(),self.mesh_file)
+        self.mesh_file = os.path.normpath(aux)
+#
+# 2. On en deduit le cas
+#
+      self.nomcas = os.path.basename(self.rep_calc)
+      if self.verbose_max :
+        print ". Cas :", self.nomcas
+#
+# 3. Le temps d'attente
+#
+      iaux = None
+      try :
+        iaux = int(self.attente)
+      except :
+        erreur = -5
+        break
+      self.attente = iaux
+#
+# 4. Le numero du calcul
+#
+      if self.numero == None :
+        erreur = -6
+#
+# 5. Options speciales pour les cas transitoires et pour l'excavation
+#
+      if ( self.nomcas in liste_cas_tr ) or ( self.nomcas[:6] == "couche" ) :
+#
+        if self.opt1 == None :
+          self.opt1 = opt1_defaut[self.nomcas]
+#
+        if self.opt2 == None :
+          self.opt2 = opt2_defaut[self.nomcas]
+#
+# 5.1. Pour un cas transitoire
+#
+      if self.nomcas in liste_cas_tr :
+#
+        iaux1 = None
+        daux1 = None
+        try :
+          iaux1 = int(self.opt1)
+        except :
+          daux1 = float(self.opt1)
+#
+        iaux2 = None
+        daux2 = None
+        try :
+          iaux2 = int(self.opt2)
+        except :
+          daux2 = float(self.opt2)
+#
+        if ( ( daux1 == None ) and  ( daux2 == None ) ) :
+          #print "iaux1, iaux2 =", iaux1, iaux2
+          if iaux2 < iaux1 :
+            erreur = -7
+        elif ( ( iaux1 == None ) and  ( iaux2 == None ) ) :
+          #print "daux1, daux2 =", daux1, daux2
+          if daux2 < daux1 :
+            erreur = -7
+        else :
+          erreur = -7
+#
+        if erreur :
+          self.message_info += "opt1 = " + self.opt1
+          self.message_info += "\nopt2 = " + self.opt2
+#
+# 5.2. Pour l'excavation
+#
+      elif self.nomcas[:6] == "couche" :
+#
+        iaux1 = None
+        try :
+          iaux1 = int(self.opt1)
+        except :
+          erreur = -8
+#
+        if ( ( iaux1 < 1 ) or ( iaux1 > 20 ) ) :
+          #print "iaux1 =", iaux1
+          erreur = -8
+#
+        iaux2 = None
+        try :
+          iaux2 = int(self.opt2)
+        except :
+          erreur = -9
+#
+        if ( iaux2 < 0 ) :
+          #print "iaux1 =", iaux1
+          erreur = -9
+#
+        if erreur :
+          self.message_info += "nro_mail = " + self.numero
+          self.message_info += "\nopt1 = " + self.opt1
+          self.message_info += "\nopt2 = " + self.opt2
+          break
+#
+        self.nro_couche = iaux1
+        self.nro_adap = iaux2
+#
+      break
+#
+    if erreur :
+      message_erreur = messages_erreur[erreur]
+#
+    if self.verbose_max :
+      print ". rep_calc  :", self.rep_calc
+      print ". mesh_file :", self.mesh_file
+#
+    return erreur, message_erreur
+#
+#=========================  Fin de la fonction ===================================
+#
+#========================= Debut de la fonction ==================================
+#
+  def modif_export ( self ) :
+#
+    """
+Modification du fichier export et reperage de quelques informations
+    """
+#
+    messages_erreur = { 0 : None }
+#
+    nom_fonction = __name__ + "/modif_export"
+    blabla = "\nDans " + nom_fonction + ","
+#
+    erreur = 0
+    message_erreur = " "
+#
+    if self.verbose_max :
+      print blabla
+      print ". numero    :", self.numero
+      print ". mesh_file :", self.mesh_file
+#
+    while not erreur :
+#
+# 1. Lecture du fichier export original
+#
+      nomfic_export = os.path.join(self.rep_calc, "calcul.ref.export")
+      fic = open (nomfic_export, "r")
+      les_lignes = fic.readlines()
+      fic.close()
+#
+# 2. Ouverture du nouveau fichier export
+#
+      nomfic = "calcul"
+      if self.nomcas[:6] == "couche" :
+        nomfic += ".%02d" % self.nro_couche
+      nomfic += ".%03d.export" % self.numero
+      self.nomfic_export = os.path.join(self.rep_calc, nomfic)
+      fic = open (self.nomfic_export, "w")
+#
+# 3. Exploration des lignes
+#
+      for ligne in les_lignes :
+#
+# 3.1. Pas de modification, a priori
+#
+        ligne_bis = ligne
+        saux = ""
+#
+# 3.2. Decodage des composants de la ligne pour un fichier
+#
+        if ligne[0:2] == "F " :
+#
+          laux = ligne.split()
+          #print laux
+          typfic = laux[1]
+          #print typfic
+#
+          nomfic_0 = laux[2]
+          if ( ":" in nomfic_0 ) :
+            laux1 = nomfic_0.split(":")
+            saux = laux1[0] + ":"
+            nomfic_0 = laux1[1]
+#
+# 3.2.1. Si c'est le fichier de commandes, mise a jour du nom du repertoire
+#
+          if typfic == "comm" :
+#
+            nomfic_l_0 = os.path.basename(nomfic_0)
+            nomfic = os.path.join(self.rep_calc, nomfic_l_0)
+#
+# 3.2.2. Si ce n'est pas le fichier de commandes, mise a jour du nom
+#
+          else :
+#
+# 3.2.2.1. Le fichier de maillage est celui passe en argument
+#
+            if typfic == "mmed" :
+              nomfic = self.mesh_file
+#
+# 3.2.2.2. Pour les autres fichiers, on recupère le nom initial
+#
+            else :
+              nomfic_l_0 = os.path.basename(nomfic_0)
+              laux1 = nomfic_l_0.split(".")
+#
+# 3.2.2.2.1. Base des noms de fichiers si excavation
+#
+              if laux1[0] == "couche_n" :
+                saux0 = "couche_%02d" % self.nro_couche
+              else :
+                saux0 = laux1[0]
+#
+# 3.2.2.2.2. Indicage des fichiers
+#
+              if len(laux1) >= 3 :
+                iaux = len(laux1[1])
+                if iaux == 2 :
+                  saux1 = "%02d" % self.numero
+                elif iaux == 3 :
+                  saux1 = "%03d" % self.numero
+                elif iaux == 4 :
+                  saux1 = "%04d" % self.numero
+                else :
+                  saux1 = "%d" % self.numero
+                nomfic_l = saux0 + "." + saux1 + "." + laux1[2]
+              else :
+                nomfic_l = saux0 + "." + laux1[1]
+#
+              nomfic_l_1 = os.path.dirname(nomfic_0)
+              nomfic = os.path.join(nomfic_l_1, nomfic_l)
+#
+          ligne_bis  = laux[0] + " " + laux[1] + " " + saux
+          ligne_bis += nomfic + " "
+          ligne_bis += laux[3] + " " + laux[4] + "\n"
+#
+# 3.2.2.3. On detruit preventivement les fichiers des resultats
+#
+          if self.nomcas[:6] != "couche" :
+            if laux[3] == "R" :
+              if os.path.isfile(nomfic) :
+                os.remove(nomfic)
+#
+# 3.2.3. Memorisation des noms
+#
+          self.dico[typfic] = nomfic
+#
+# 3.3. Decodage des composants de la ligne pour la base
+#
+        elif ligne[0:2] == "R " :
+#
+          laux = ligne.split()
+          #print laux
+          typfic = laux[1]
+          #print typfic
+#
+# 3.3.1. Si c'est le fichier de la base, on recupere le nom initial, en ajustant l'indice
+#
+          if typfic in ( "base", "bhdf" ) :
+#
+            nomfic_0 = laux[2]
+            if ( ":" in nomfic_0 ) :
+              laux1 = nomfic_0.split(":")
+              saux = laux1[0] + ":"
+              nomfic_0 = laux1[1]
+            nomfic_l_0 = os.path.basename(nomfic_0)
+            laux1 = nomfic_l_0.split(".")
+            if len(laux1) >= 3 :
+              iaux = len(laux1[1])
+              if iaux == 2 :
+                saux1 = "%02d" % self.numero
+              elif iaux == 3 :
+                saux1 = "%03d" % self.numero
+              elif iaux == 4 :
+                saux1 = "%04d" % self.numero
+              else :
+                saux1 = "%d" % self.numero
+              nomfic_l = laux1[0] + "." + saux1 + "." + laux1[2]
+            elif len(laux1) >= 2 :
+              if laux1[0] == "couche_nm1" :
+                saux0 = "couche_%02d" % (self.nro_couche-1)
+              elif laux1[0] == "couche_n" :
+                saux0 = "couche_%02d" % self.nro_couche
+              else :
+                saux0 = laux1[0]
+              nomfic_l = saux0 + "." + laux1[1]
+            else :
+              nomfic_l = nomfic_l_0
+            nomfic_l_1 = os.path.dirname(nomfic_0)
+            nomfic = os.path.join(nomfic_l_1, nomfic_l)
+#
+            ligne_bis  = laux[0] + " " + laux[1] + " " + saux
+            ligne_bis += nomfic + " "
+            ligne_bis += laux[3] + " " + laux[4] + "\n"
+#
+# 3.4. Decodage des composants de la ligne pour un parametre
+#
+        elif ligne[0:2] == "P " :
+#
+          laux = ligne.split()
+          #print laux
+          if ( len(laux) == 3 ) :
+            aux = laux[2]
+            if laux[1] in ( "username" ) :
+              self.username = aux
+            elif laux[1] in ( "uclient" ) :
+              self.uclient = aux
+            elif laux[1] in ( "aster_root" ) :
+              self.aster_root = aux
+            elif laux[1] in ( "serveur" ) :
+              self.serveur = aux
+            elif laux[1] in ( "mclient" ) :
+              self.mclient = aux
+            #elif laux[1] in ( "display" ) :
+              #aux = self.machine+":0.0"
+            elif laux[1] in ( "nomjob" ) :
+              self.nomjob = aux
+            elif laux[1] in ( "mode" ) :
+              self.mode = aux
+            ligne_bis  = laux[0] + " " + laux[1] + " " + aux  + "\n"
+#
+# 3.5. Ecriture de la ligne
+#
+        fic.write(ligne_bis)
+#
+      fic.close()
+#
+      break
+#
+    if erreur :
+      message_erreur = messages_erreur[erreur]
+#
+    if self.verbose_max :
+      print ". mclient    ", self.mclient
+      print ". uclient    ", self.uclient
+      print ". serveur    ", self.serveur
+      print ". username   ", self.username
+      print ". aster_root ", self.aster_root
+      print ". nomjob     ", self.nomjob
+      print ". mode       ", self.mode
+#
+    return erreur, message_erreur
+#
+#=========================  Fin de la fonction ===================================
+#
+#========================= Debut de la fonction ==================================
+#
+  def modif_cas_transitoire ( self ) :
+#
+    """
+Modification du fichier de commandes lie au cas transitoire
+    """
+#
+    messages_erreur = { 0 : None,
+                        2 : "Mot_cle inconnu dans les commandes." }
+#
+    nom_fonction = __name__ + "/modif_cas_transitoire"
+    blabla = "\nDans " + nom_fonction + ","
+#
+    erreur = 0
+    message_erreur = " "
+#
+    if self.verbose_max :
+      print blabla
+      print ". opt1 :", self.opt1
+      print ". opt2 :", self.opt2
+#
+    while not erreur :
+#
+# 1. Lecture du fichier de commandes
+#
+      nomfic = os.path.join(self.rep_calc, self.dico["comm"])
+      fic = open (nomfic, "r")
+      les_lignes = fic.readlines()
+      fic.close()
+#
+# 2. Ouverture du nouveau fichier de commandes
+#
+      fic = open (nomfic, "w")
+#
+# 3. Exploration des lignes
+#
+# 3.0. Reperage de la zone a modifier
+#
+      A_modifier = 0
+#
+      for ligne in les_lignes :
+#
+        if self.verbose_max :
+          print "ligne =", ligne[:-1]
+#
+# 3.1. Pas de modification, a priori
+#
+        ligne_bis = ligne
+#
+# 3.2. Reperage de la zone a modifier
+#
+        if ( "A PERSONNALISER - DEBUT" in ligne ) :
+          A_modifier = 1
+        elif ( "A PERSONNALISER - FIN" in ligne ) :
+          A_modifier = 0
+#
+# 3.3. Modification
+#
+        #print "A_modifier =", A_modifier
+        if A_modifier :
+#
+          #print "ligne =", ligne[:-1]
+          for iaux in range(2) :
+            if iaux == 0 :
+              mot_cle_ref = "NUME_INST_"
+              lg_mot_cle = 10
+            else :
+              mot_cle_ref = "INST_"
+              lg_mot_cle = 5
+            #print "mot_cle_ref =", mot_cle_ref
+#
+            if ligne[0:lg_mot_cle] == mot_cle_ref :
+#
+              if ligne[lg_mot_cle:lg_mot_cle+4] == "INIT" :
+                aux = self.opt1
+                motcle = ligne[0:lg_mot_cle+4]
+              elif ligne[lg_mot_cle:lg_mot_cle+3] == "FIN" :
+                aux = self.opt2
+                motcle = ligne[0:lg_mot_cle+3]
+              else :
+                self.message_info += ligne
+                erreur = 2
+                break
+#
+              ligne_bis = motcle + " = " + str(aux) +"\n"
+#
+          if erreur :
+            break
+#
+# 3.4. Ecriture de la ligne
+#
+        fic.write(ligne_bis)
+#
+      fic.close()
+#
+      break
+#
+# 4. Gestion des erreurs
+#
+    if erreur :
+      message_erreur = messages_erreur[erreur]
+#
+    return erreur, message_erreur
+#
+#=========================  Fin de la fonction ===================================
+#
+#========================= Debut de la fonction ==================================
+#
+  def modif_cas_excavation ( self ) :
+#
+    """
+Modification du fichier de commandes lie au cas de l'excavation
+    """
+#
+    messages_erreur = { 0 : None }
+#
+    nom_fonction = __name__ + "/modif_cas_excavation"
+    blabla = "\nDans " + nom_fonction + ","
+#
+    erreur = 0
+    message_erreur = " "
+#
+    if self.verbose_max :
+      print blabla
+      print ". numero     :", self.numero
+      print ". nro_couche :", self.nro_couche
+      print ". nro_adap   :", self.nro_adap
+#
+    while not erreur :
+#
+# 1. Lecture du fichier de commandes
+#
+      nomfic = os.path.join(self.rep_calc, self.dico["comm"])
+      fic = open (nomfic, "r")
+      les_lignes = fic.readlines()
+      fic.close()
+#
+# 2. Ouverture du nouveau fichier de commandes
+#
+      fic = open (nomfic, "w")
+#
+# 3. Exploration des lignes
+#
+# 3.0. Reperage de la zone a modifier
+#
+      A_modifier = 0
+#
+      for ligne in les_lignes :
+#
+        if self.verbose_max :
+          print "ligne =", ligne[:-1]
+#
+# 3.1. Pas de modification, a priori
+#
+        ligne_bis = ligne
+#
+# 3.2. Reperage de la zone a modifier
+#
+        if ( "A PERSONNALISER - DEBUT" in ligne ) :
+          A_modifier = 1
+        elif ( "A PERSONNALISER - FIN" in ligne ) :
+          A_modifier = 0
+#
+# 3.3. Modification
+#
+        #print "A_modifier =", A_modifier
+        if A_modifier :
+#
+          #print "ligne =", ligne[:-1]
+          for iaux in range(3) :
+            if iaux == 0 :
+              mot_cle_ref = "nro_mail"
+              lg_mot_cle = 8
+              aux = self.numero
+            elif iaux == 1 :
+              mot_cle_ref = "nro_couche"
+              lg_mot_cle = 10
+              aux = self.nro_couche
+            elif iaux == 2 :
+              mot_cle_ref = "nro_adap"
+              lg_mot_cle = 8
+              aux = self.nro_adap
+            #print "mot_cle_ref =", mot_cle_ref
+#
+            if ligne[0:lg_mot_cle] == mot_cle_ref :
+              #print "==> aux =", aux, type(aux)
+              ligne_bis = mot_cle_ref + " = " + str(aux) +"\n"
+#
+# 3.4. Ecriture de la ligne
+#
+        fic.write(ligne_bis)
+#
+      fic.close()
+#
+      break
+#
+# 4. Gestion des erreurs
+#
+    if erreur :
+      message_erreur = messages_erreur[erreur]
+#
+    return erreur, message_erreur
+#
+#=========================  Fin de la fonction ===================================
+#
+#========================= Debut de la fonction ==================================
+#
+  def calcul ( self ) :
+#
+    """
+Lancement d'un calcul
+    """
+#
+    messages_erreur = { 0 : None }
+#
+    nom_fonction = __name__ + "/calcul"
+    blabla = "\nDans " + nom_fonction + ","
+#
+    erreur = 0
+    message_erreur = " "
+#
+    if self.verbose_max :
+      print ". mclient    ", self.mclient
+      print ". serveur    ", self.serveur
+#
+# 1. Copie du fichier export sur le serveur de calcul
+#
+    if ( self.mclient != self.serveur ) :
+#
+      nomfic_export_dist = self.nomjob + ".export"
+      commande = "scp " + self.nomfic_export + " " + self.username + "@" + self.serveur + ":" + nomfic_export_dist
+      if self.verbose_max :
+        print "Copie du fichier export vers", self.serveur, ":"
+        print commande
+      erreur = os.system(commande)
+#
+# 2. Commande du lancement
+#
+    commande_base  = os.path.join(self.aster_root, "bin", "as_run")
+    commande_base += " "
+    if self.mode == "batch" :
+      commande_base += "--serv "
+    commande_base += self.username + "@" + self.serveur + ":"
+    #if self.verbose_max :
+      #print commande_base
+#
+    fic_caract   = tempfile.mktemp()
+    fic_caract_2 = tempfile.mktemp()
+#
+# 3. Lancement
+# 3.1. Commande finale
+#
+    if ( self.mclient == self.serveur ) :
+      commande  = commande_base
+      commande += commande_base + self.nomfic_export
+    else :
+      commande  = "ssh " + self.username + "@" + self.serveur
+      commande += " \"" + commande_base + nomfic_export_dist + "\""
+    commande += " 1>" + fic_caract
+    commande += " 2>" + fic_caract_2
+    if self.verbose_max :
+      print "Lancement sur", self.serveur, ":"
+      print commande
+#
+# 3.2. Lancement vrai
+#
+    erreur = os.system(commande)
+    if erreur :
+      messages_erreur[erreur] = "erreur de calcul numero %d" % erreur
+    else :
+      self.message_info += "resultat dans le fichier :\n"
+      #print self.dico
+      self.message_info += self.dico["rmed"]+"\n"
+#
+    if self.verbose_max :
+      print blabla
+      print ". erreur     :", erreur
+      print ". self.mode  :", self.mode
+      print ". fic_caract :", fic_caract
+#
+    if erreur :
+      message_erreur = messages_erreur[erreur]
+#
+    return erreur, message_erreur, fic_caract, fic_caract_2
+#
+#=========================  Fin de la fonction ===================================
+#
+#========================= Debut de la fonction ==================================
+#
+  def calcul_aster_attente ( self, fic_caract ) :
+#
+    """
+Bilan du calcul Aster
+fic_caract : fichier caracteristique du job
+    """
+#
+    nom_fonction = __name__ + "/calcul_aster_attente"
+    blabla = "\nDans " + nom_fonction + ","
+#
+    erreur = 0
+    message_erreur = " "
+#
+    if self.verbose_max :
+      print ". fic_caract :", fic_caract
+      print ". nomjob     :", self.nomjob
+      print ". rep_calc   :", self.rep_calc
+      print ". mode       :", self.mode
+      print ". attente    :", self.attente
+#
+    if ( self.mode != "interactif" ) :
+#
+# 1. Recuperation du numero de job
+#
+      fic = open (fic_caract, "r")
+      les_lignes = fic.readlines()
+      fic.close()
+  #
+      for ligne in les_lignes :
+        #print ligne
+        if ( len(ligne)>0 ) :
+          # en batch :
+          if "JOBID" in ligne :
+            #print ligne
+            laux = ligne.split()
+            laux1 = laux[0].split("=")
+            numjob = laux1[1]
+          # en interactif :
+          elif "num_job" in ligne :
+            #print ligne
+            laux = ligne.split("num_job")
+            laux1 = laux[1].split()
+            numjob = laux1[0]
+  #
+      if self.verbose :
+        print ". numjob :", numjob
+#
+# 2. Commande de l'examen de l'etat du job,
+#
+      fic_etat = os.path.join(self.rep_calc, self.nomjob+".etat")
+      fic_etat_2 = tempfile.mktemp()
+      commande_base  = os.path.join(self.aster_root, "bin", "as_run")
+      commande_base += " --actu " + numjob + " " + self.nomjob + " " + self.mode
+      if self.verbose_max :
+        print "commande_base =", commande_base
+      if ( self.mclient == self.serveur ) :
+        commande  = commande_base
+      else :
+        commande  = "ssh " + self.username + "@" + self.serveur
+        commande += " \"" + commande_base + "\""
+      commande += " 1>" + fic_etat
+      commande += " 2>" + fic_etat_2
+      if self.verbose_max :
+        print "Examen sur", self.serveur, ":"
+        print commande
+#
+# 3. Examen de l'etat du job, jusqu'a la fin
+#
+      encore = 1
+      while encore :
+  #
+        if encore % 4 == 0 :
+          aux = ((encore-1)*self.attente) / 60
+          print "..", aux, "mn"
+          #print diag
+  #
+        time.sleep(self.attente)
+        erreur = os.system(commande)
+  #
+        if erreur :
+          erreur = -1
+          break
+        elif os.path.isfile(fic_etat) :
+          fic = open (fic_etat, "r")
+          les_lignes = fic.readlines()
+          fic.close()
+          if len(les_lignes) > 0 :
+            if len(les_lignes[0]) > 0 :
+              laux = les_lignes[0].split()
+              laux1 = laux[0].split("=")
+              etat = laux1[1]
+              laux1 = laux[1].split("=")
+              diag = laux1[1]
+              if self.verbose_max :
+                print etat, diag
+              if etat in ( "RUN", "PEND" ) :
+                encore += 1
+              else :
+                if etat != "ENDED" :
+                  self.message_info += "Etat du job : " + etat
+                  erreur = -2
+                else :
+                  if diag[:3] in ( "<S>", "<F>" ) :
+                    erreur = -3
+                if erreur :
+                  self.message_info = "Diagnostic du job : " + diag + "\n"
+                encore = 0
+                break
+            else :
+              encore += 1
+          else :
+            encore += 1
+        else :
+          erreur = -4
+          break
+#
+      os.remove(fic_etat_2)
+#
+    if self.verbose_max :
+      print blabla
+      print ". erreur :", erreur
+#
+    if erreur :
+      message_erreur = "Erreur dans le calcul"
+#
+    return erreur, message_erreur
+#
+#=========================  Fin de la fonction ===================================
+#
+#========================= Debut de la fonction ==================================
+#
+  def post_aster ( self, dico_resu_init ) :
+#
+    """
+Affichage de resultats selon les cas
+    """
+#
+    messages_erreur = { 0 : None,
+                        1 : "Ce fichier est inconnu." }
+#
+    nom_fonction = __name__ + "/post_aster"
+    blabla = "\nDans " + nom_fonction + ","
+#
+    erreur = 0
+    message_erreur = " "
+#
+    dico_resu = {}
+    for cle in dico_resu_init.keys() :
+      dico_resu[cle] = dico_resu_init[cle]
+#
+    while not erreur :
+#
+# 1. Exploration du fichier resu
+#
+# 1.1. Recuperation du contenu
+#
+      nomfic = self.dico["resu"]
+      chaine = "V_TEST"
+      nuocc = 1
+      erreur, message_erreur, info = self.post_aster_1 ( nomfic, chaine, nuocc )
+      if erreur :
+        break
+      self.message_info += info[:-1]
+#
+# 1.2. Details
+#
+      info = info.replace(chaine, " ")
+      laux = info[:-1].split()
+      aux = laux[0]
+      if ( "D" in aux ) :
+        aux = aux.replace("D", "E")
+      dico_resu[chaine] = float(aux)
+#
+# 2. Exploration du fichier mess
+# 2.1. Que chercher ?
+#
+      for chaine in ( "INSTANT", "NOMBRE DE NOEUDS", "NOMBRE DE MAILLES" ) :
+#
+# 2.2. Recuperation du contenu
+#
+        nomfic = self.dico["mess"]
+        if chaine == "INSTANT" :
+          nuocc = 0
+        else :
+          nuocc = 1
+        erreur, message_erreur, info = self.post_aster_1 ( nomfic, chaine, nuocc )
+        if erreur :
+          break
+        self.message_info += info[:-1]
+#
+# 2.3. Details
+#
+        if chaine == "INSTANT" :
+          l_aux = info[:-1].split()
+          lg_aux = len(l_aux)
+          for iaux in range(lg_aux) :
+            if ( "ORDRE" in l_aux[iaux] ) :
+              if l_aux[iaux+1] == ":" :
+                jaux = iaux+2
+              else :
+                jaux = iaux+1
+              ordre = int(l_aux[jaux])
+              dico_resu["ORDRE"] = ordre
+              dico_resu["PAS_DE_TEMPS"] = ordre
+        elif chaine in ( "NOMBRE DE NOEUDS", "NOMBRE DE MAILLES" ) :
+          l_aux = info[:-1].split(chaine)
+          dico_resu[chaine] = int(l_aux[1])
+#
+      if erreur :
+        break
+#
+# 3. Fichier de resultats au format med
+#
+      dico_resu["FileName"] = self.dico["rmed"]
+#
+      break
+#
+    if self.verbose :
+      print blabla
+      print ". erreur :", erreur
+      print ". dico_resu :", dico_resu
+#
+    if erreur :
+      message_erreur = messages_erreur[erreur]
+#
+    return erreur, message_erreur, dico_resu
+#
+#=========================  Fin de la fonction ===================================
+#
+#========================= Debut de la fonction ==================================
+#
+  def post_aster_1 ( self, nomfic, chaine, nuocc ) :
+#
+    """
+Decodage de fichier
+nomfic = nom du fichier a decoder
+chaine = chaine a chercher
+nuocc = numero de l'occurence a chercher, 0 si toutes
+    """
+#
+    messages_erreur = { 0 : None,
+                        1 : "Ce fichier est inconnu." }
+#
+    nom_fonction = __name__ + "/post_aster_1"
+    blabla = "\nDans " + nom_fonction + " :"
+    if self.verbose_max :
+      print blabla, "chaine =", chaine, ", nuocc =", nuocc
+#
+    erreur = 0
+    message_erreur = " "
+    info = ""
+#
+    while not erreur :
+#
+# 1. Lecture du fichier
+#
+      if not os.path.isfile(nomfic) :
+        self.message_info += "\nFichier "+nomfic+"\n"
+        erreur = 1
+        break
+      fic = open (nomfic, "r")
+      les_lignes = fic.readlines()
+      fic.close()
+#
+# 2. Exploration des lignes
+# 2.1. On recupere tout
+#
+      if chaine == None :
+#
+        for ligne in les_lignes :
+          info += ligne
+#
+# 2.2. On cible
+#
+      else :
+#
+        self.message_info += "\n"
+        iaux = 0
+        for ligne in les_lignes :
+          if chaine in ligne :
+            iaux += 1
+            if ( ( nuocc == 0 ) or ( iaux == nuocc ) ) :
+              info += ligne
+#
+      break
+#
+    if self.verbose_max :
+      print blabla
+      print ". erreur :", erreur
+#
+    if erreur :
+      message_erreur = messages_erreur[erreur]
+#
+    return erreur, message_erreur, info
+#
+#=========================  Fin de la fonction ===================================
+#
+#========================= Debut de la fonction ==================================
+#
+  def dump_resultat ( self ) :
+#
+    """
+Dump du resultat du calcul
+    """
+#
+    messages_erreur = { 0 : None }
+#
+    nom_fonction = __name__ + "/dump_resultat"
+    blabla = "\nDans " + nom_fonction + ","
+#
+    erreur = 0
+    message_erreur = " "
+#
+# 1. Lancement
+#
+    nomfic_donn = os.path.join(self.rep_calc, "donn")
+    fic = open (nomfic_donn, "w")
+    fic.write("1\n1\n1\n")
+    fic.close()
+    fic_dump = self.dico["rmed"]+".dump"
+    commande = "mdump " + self.dico["rmed"] + "<" + nomfic_donn + ">" + fic_dump
+    #print commande
+    erreur = os.system(commande)
+    if erreur :
+      messages_erreur[erreur] = "Erreur de dump numero %d" % erreur
+    else :
+      self.message_info += "\nDump dans le fichier :\n"
+      self.message_info += fic_dump+"\n"
+#
+    if self.verbose_max :
+      print blabla
+      print ". erreur :", erreur
+#
+    if erreur :
+      message_erreur = messages_erreur[erreur]
+#
+    return erreur, message_erreur
+#
+#=========================  Fin de la fonction ===================================
+#
+#
+if __name__ == "__main__" :
+#
+  #print "Arguments a l'entree de",  sys.argv[0], ":", sys.argv[1:], "\n"
+#
+  Script_A = Script(sys.argv[1:])
+#
+  if Script_A.affiche_aide_globale :
+    Script_A.message_info = Script_A.__doc__
+    erreur_m = 0
+    message_erreur_m = ""
+  else :
+    dico_resu_m = {}
+    erreur_m, message_erreur_m, dico_resu_m = Script_A.compute ()
+#
+  sys.stdout.write(Script_A.message_info+"\n")
+  sys.stderr.write(message_erreur_m+"\n")
+  sys.exit(erreur_m)
diff --git a/doc/files/yacs_script.tgz b/doc/files/yacs_script.tgz
deleted file mode 100644 (file)
index 361247e..0000000
Binary files a/doc/files/yacs_script.tgz and /dev/null differ
index d9d7e6bc60b10ebb96ca9770646716e6e5a331d4..d91c4f866883ac8edcfa803470d7239ec30dbed6 100644 (file)
@@ -36,7 +36,7 @@ On fera ici trois raffinements uniformes successifs du maillage contenu dans le
   * 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: 53-86
+   :lines: 57-89
 
 .. note::
   Téléchargement des fichiers
@@ -52,7 +52,7 @@ Raffinement par des zones
 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. On notera que le type de raffinement n'a pas été précisé ; par défaut, il sera donc conforme.
 
 .. literalinclude:: ../files/tutorial_2.py
-   :lines: 53-98
+   :lines: 57-101
 
 .. note::
   Téléchargement des fichiers
@@ -69,7 +69,7 @@ On proc
 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: 53-128
+   :lines: 57-131
 
 .. note::
   Téléchargement des fichiers
@@ -88,7 +88,7 @@ On teste ici le suivi des fronti
 Le schéma YACS réalisant cette adaptation est téléchargeable.
 
 .. literalinclude:: ../files/tutorial_4.py
-   :lines: 53-112
+   :lines: 57-115
 
 .. note::
   Téléchargement des fichiers
@@ -107,7 +107,7 @@ Les instructions pour adapter un maillage 2D sont exactement identiques 
 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: 53-98
+   :lines: 57-101
 
 .. note::
   Téléchargement des fichiers
index c45f834091b3fb047ad693aebafbc028d146a65b..a2fdeb48d7d06db4ba9c1ece5e14a1cb808bb013 100644 (file)
@@ -14,8 +14,8 @@ On va d
 .. image:: ../images/yacs_01.png
    :align: center
    :alt: yacs - allure générale
-   :width: 535
-   :height: 362
+   :width: 512
+   :height: 306
 
 .. note::
   Parmi l'ensemble des données manipulées, certaines sont immuables : le nom du répertoire de calcul, le nom du cas, le nom de l'hypothèse d'adaptation, etc. Il a été choisi de les imposer 'en dur' dans les différents paramètres de service ou au sein des scripts python. On pourrait également les définir a priori dans un noeud PresetNode et ensuite les transmettre par des liens. Nous n'avons pas retenu cette solution car elle augmente fortement le nombre de paramètres et de liens attachés à chaque noeud. Cela est très pénalisant pour la lisibilité du schéma. Les seules données qui vont circuler sont celles imposées par la description du service et celles qui évoluent au cours de l'exécution du schéma.
@@ -27,7 +27,7 @@ Les bo
 
 - DataInit : initialisation du maillage initial
 - Etude_Initialisation : lancement du module HOMARD dans SALOME
-- Tant_que_le_calcul_n_a_pas_converge : gestion de la boucle d'alternance calcul/adaptation
+- Boucle_de_convergence : gestion de la boucle d'alternance calcul/adaptation
 - Bilan : affichage final
 
 DataInit
@@ -67,15 +67,15 @@ Le service SetCurrentStudy affecte cette 
    :lines: 63-68
 
 
-Tant_que_le_calcul_n_a_pas_converge
+Boucle_de_convergence
 ===================================
-La boîte Tant_que_le_calcul_n_a_pas_converge est une boucle de type WhileLoop. La condition est initialisée à 1 : le bloc interne Alternance_Calcul_HOMARD est exécuté. Au sein de ce bloc, on calcule et on adapte le maillage ; quand le processus doit s'arrêter soit par suite d'erreur, soit par convergence, la condition passe à 0. La boucle s'achève et on passe à la boîte suivante, Bilan.
+La boîte Boucle_de_convergence est une boucle de type WhileLoop. La condition est initialisée à 1 : le bloc interne Alternance_Calcul_HOMARD est exécuté. Au sein de ce bloc, on calcule et on adapte le maillage ; quand le processus doit s'arrêter soit par suite d'erreur, soit par convergence, la condition passe à 0. La boucle s'achève et on passe à la boîte suivante, Bilan.
 
 .. image:: ../images/yacs_c_01.png
    :align: center
    :alt: Boucle
-   :width: 195
-   :height: 142
+   :width: 163
+   :height: 93
 
 Bilan
 =====
@@ -88,7 +88,7 @@ Bilan
 Cette boîte est un noeud python qui prend en entrée une chaîne de caractères, MessInfo. Si tout s'est bien passé, ce message est vide. Une fenêtre QT apparaît pour confirmer la convergence. S'il y a eu un problème, le message contient les messages émis au cours des calculs. La fenêtre QT affiche ce message.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 424-437
+   :lines: 406-419
 
 
 La boucle de calculs
@@ -96,8 +96,8 @@ La boucle de calculs
 .. image:: ../images/yacs_c_02.png
    :align: center
    :alt: Boucle
-   :width: 323
-   :height: 158
+   :width: 338
+   :height: 152
 
 Cette boîte est un bloc qui gère le calcul, l'adaptation et l'analyse.
 
@@ -112,58 +112,60 @@ Calcul
 Cette boîte est un noeud python qui va piloter le calcul. En entrée, on trouve le numéro du calcul (0 au départ) et le nom du fichier qui contient le maillage sur lequel calculer. En sortie, on trouve un entier qui représente l'erreur sur ce calcul (0 si tout va bien) et un dictionnaire python rassemblant les résultats du calcul. Le corps du noeud est constitué par le lancement d'un script python qui active le calcul.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 77-104
+   :lines: 77-103
 
 Dans cet exemple, il faut définir :
 
 - rep_calc : le répertoire dans lequel sera exécuté le calcul.
-- rep_script : le répertoire dans lequel se trouve le python qui lancera le calcul. Ce répertoire est à ajouter au PATH. Depuis ce répertoire, on importera LanceCas depuis le fichier LanceCas.py
+- rep_script : le répertoire dans lequel se trouve le python qui lancera le calcul. Ce répertoire est à ajouter au PATH. Depuis ce répertoire, on importera 'Script' depuis le fichier ScriptAster.py
 
-Le python LanceCas est programmé comme l'utilisateur le souhaite pour que le calcul puisse être effectué sur le maillage courant. Selon le mode de lancement du code de calcul, on peut avoir besoin d'autres informations, comme le numéro du calcul ou le répertoire du calcul par exemple. La liberté est totale. Dans notre cas, les arguments d'entrée sont le nom du fichier de maillage, le numéro du calcul et le répertoire de calcul sous la forme de la liste python ["--rep_calc=rep_calc", "--numero=numCalc", "--mesh_file=MeshFile"]
+Le python Script est programmé comme l'utilisateur le souhaite pour que le calcul puisse être effectué sur le maillage courant. Selon le mode de lancement du code de calcul, on peut avoir besoin d'autres informations, comme le numéro du calcul ou le répertoire du calcul par exemple. La liberté est totale. Dans notre cas, les arguments d'entrée sont le nom du fichier de maillage, le numéro du calcul et le répertoire de calcul sous la forme de la liste python ["--rep_calc=rep_calc", "--num=numCalc", "--mesh_file=MeshFile"]
 ].
 
 En revanche la sortie du script doit obéir à la règle suivante. On récupère un code d'erreur, un message d'erreur et un dictionnaire. Ce dictionnaire contient obligatoirement les clés suivantes :
 
 - "FileName" : le nom du fichier qui contient les résultats du calcul
-- "MeshName" : le nom du maillage utilisé
-- "V00" : la valeur dont on veut tester la convergence
+- "V_TEST" : la valeur dont on veut tester la convergence
 
 Adaptation
 ==========
 .. image:: ../images/yacs_c_04.png
    :align: center
    :alt: Adaptation
-   :width: 672
-   :height: 569
+   :width: 661
+   :height: 566
 
 La boîte Adaptation est un noeud Switch piloté par le code d'erreur du calcul précédent. Si ce code est nul, YACS activera la boîte Adaptation_HOMARD qui lancera l'adaptation. Si le code n'est pas nul, on passe directement dans la boîte Arret_boucle.
 
 Adaptation_HOMARD
 -----------------
-La première tâche à exécuter concerne l'initialisation des données nécessaires à HOMARD dans la boîte HOMARD_Initialisation. Cette boîte est un noeud switch piloté par le numéro du calcul. Au démarrage, le numéro est nul et YACS active la boîte Homard_init_au_debut.
+La première tâche à exécuter concerne l'initialisation des données nécessaires à HOMARD dans la boîte HOMARD_Initialisation. Cette boîte est un noeud switch piloté par le numéro du calcul. Au démarrage, le numéro est nul et YACS active la boîte Iter_1.
 
-Homard_init_au_debut
-^^^^^^^^^^^^^^^^^^^^
+Iter_1
+^^^^^^
 .. image:: ../images/yacs_c_06.png
    :align: center
-   :alt: Homard_init_au_debut
+   :alt: Iter_1
    :width: 481
-   :height: 150
+   :height: 151
 
 Cette boîte commence par créer le cas HOMARD en appelant le service CreateCase.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 220-227
+   :lines: 208-215
 
-Le nom du cas CaseName est imposé à "Calcul". Les paramètres d'entrée MeshName et FileName sont issus de la sortie du calcul précédent. Le paramètre de sortie est une instance de cas.
+Le nom du cas CaseName est imposé à "Calcul". Le paramètre d'entrée MeshName est imposé à "BOX". Le paramètre d'entrée FileName est issu de la sortie du calcul précédent. Le paramètre de sortie est une instance de cas.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 443-446
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 461-464
+   :lines: 483-486
 
 Les options de ce cas doivent maintenant être renseignées. C'est fait par le noeud python CaseOptions. Il est impératif de renseigner le répertoire de calcul. On regardera la description des fonctions dans :ref:`tui_create_case`. En sortie, on récupère l'instance de l'itération correspondant à l'état initial du cas.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 228-242
+   :lines: 216-228
 
 Enfin, une hypothèse est créée en appelant le service CreateHypothèse. Le paramètre de sortie est une instance d'hypothèse.
 
@@ -177,45 +179,45 @@ Une fois initialis
    :width: 153
    :height: 141
 
-Le répertoire de calcul est récupéré.
+Le répertoire de calcul est récupéré. Le nom du maillage est rappelé.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 258-263
+   :lines: 245-250
 
 ../..
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 339-347
+   :lines: 325-333
 
 L'hypothèse transmise en paramètre d'entrée est caractérisée (voir :ref:`tui_create_hypothese`) :
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 267-291
+   :lines: 254-278
 
 Il faut établir un nom pour la future itération. Pour s'assurer que le nom n'a jamais été utilisé, on met en place un mécanisme de nommage incrémental à partir du nom de l'itération initiale. Comme ce nom initial est le nom du maillage initial, on obtient une succession de noms sous la forme : M_001, M_002, M_003, etc.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 293-303
+   :lines: 280-290
 
 L'itération est complétée : hypothèse, futur maillage, champ (voir :ref:`tui_create_iteration`) :
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 305-325
+   :lines: 292-311
 
 L'itération est calculée. Si tout s'est bien passé, la variable OK vaut 1 : on pourra continuer l'exécution du schéma. S'il y a eu un problème, la variable OK vaut 0 pour signifier que le calcul doit s'arrêter ; on donne alors un message d'erreur.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 327-338
+   :lines: 313-324
 
 Après cette exécution, le processus sort du noeud Adaptation_HOMARD, puis du noeud Adaptation. On arrive alors au noeud d'analyse.
 
-Homard_init_ensuite
-^^^^^^^^^^^^^^^^^^^
+Iter_n
+^^^^^^
 .. image:: ../images/yacs_c_07.png
    :align: center
-   :alt: Homard_init_ensuite
+   :alt: Iter_n
    :width: 323
-   :height: 97
+   :height: 92
 
 Aux passages suivants dans le bloc d'adaptation, il faut récupérer :
 
@@ -235,57 +237,52 @@ Arret_boucle
 Le bloc Arret_boucle n'est présent que pour faire transiter des variables car les paramètres d'entrée des noeuds doivent toujours être remplis. C'est un python très simple :
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 185-196
+   :lines: 173-184
 
 Analyse
 =======
 .. image:: ../images/yacs_c_05.png
    :align: center
    :alt: Analyse
-   :width: 155
-   :height: 169
+   :width: 156
+   :height: 139
 
 Le bloc Analyse est un script python qui assure le contrôle complet du processus en examinant successivement les causes d'erreur possible.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 105-118
+   :lines: 104-116
 
 ../..
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 173-182
+   :lines: 162-170
 
 On commence par analyser le retour du code de calcul :
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 120-125
-
-Vérification de la présence du nom du maillage dans le dictionnaire des résultats :
-
-.. literalinclude:: ../files/yacs_01.xml
-   :lines: 127-134
+   :lines: 118-123
 
 Vérification de la présence du nom du fichier de résultats dans le dictionnaire des résultats :
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 136-143
+   :lines: 125-132
 
-Vérification de la convergence. Cela suppose que la valeur à tester est présente dans le dictionnaire sous la clé 'V00'. Ici, on a mis en place un test sur la variation de la valeur d'un calcul à l'autre. Au premier passage, on ne teste rien. Aux passages suivants, on teste si la variation relative est inférieure à 1 millième. On aurait pu mettre en place un test absolu si on avait récupéré un niveau global d'erreur par exemple.
+Vérification de la convergence. Cela suppose que la valeur à tester est présente dans le dictionnaire sous la clé 'V_TEST'. Ici, on a mis en place un test sur la variation de la valeur d'un calcul à l'autre. Au premier passage, on ne teste rien. Aux passages suivants, on teste si la variation relative est inférieure à 1 millième. On aurait pu mettre en place un test absolu si on avait récupéré un niveau global d'erreur par exemple.
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 145-163
+   :lines: 134-152
 
-Enfin, on vérifie que l'on ne dépasse pas un nomber maximal d'adaptations :
+Enfin, on vérifie que l'on ne dépasse pas un nombre maximal d'adaptations :
 
 .. literalinclude:: ../files/yacs_01.xml
-   :lines: 165-170
+   :lines: 154-159
 
 
 Utiliser ce schéma
 ******************
 Pour reproduire cet exemple, on pourra télécharger :
   * :download:`le schéma <../files/yacs_01.xml>`
-  * :download:`un exemple de script python <../files/yacs_script.tgz>`
+  * :download:`un exemple de script python <../files/yacs_script.py>`
 
 Il faut l'adapter à la simulation envisagée. En particulier, il faut :
 
index f2d62166876ccb1579ec0a3298c842b9c5059277..07967038f79bb4287f197ef77a35b07651971494 100644 (file)
Binary files a/doc/images/yacs_01.png and b/doc/images/yacs_01.png differ
index 3037d0d5406e533f48e8e235830c82ed5f916663..5f888dfb6c29ada27d0df1030edd1f1e67be3e1e 100644 (file)
Binary files a/doc/images/yacs_c_01.png and b/doc/images/yacs_c_01.png differ
index d2bf5c889235565dbb855791eccddd2dbd5cd26b..c8b5d9cd0413f531ac5ed5a923f9944cf4d6d567 100644 (file)
Binary files a/doc/images/yacs_c_02.png and b/doc/images/yacs_c_02.png differ
index d01612e76e40a59d14e7542d04c1cee315749441..110efe92494a4865978093c6fc157e0f23635db8 100644 (file)
Binary files a/doc/images/yacs_c_04.png and b/doc/images/yacs_c_04.png differ
index 65c2a22473042d5685ff770cee5f8a2e096c2564..5dc8c8658ea4076f61f7f1492619af73dca62ddb 100644 (file)
Binary files a/doc/images/yacs_c_05.png and b/doc/images/yacs_c_05.png differ
index 7f3bac2c3de4a9bdca7e77fd92e24e462a7a8db9..ed992907bd1f50798655e7ddc64622fd4e76e76c 100644 (file)
Binary files a/doc/images/yacs_c_06.png and b/doc/images/yacs_c_06.png differ
index 5b363b4abd4e87fd284fc65419a5d9e48aba7e40..fbddf895b737cd09881f4d45048d512de55dc28c 100644 (file)
Binary files a/doc/images/yacs_c_07.png and b/doc/images/yacs_c_07.png differ
index 76ce79444fafe9bea1c0313bf14a251add34bafa..724e7948907e0ce090db9e816c87f3bf0cf5d666 100644 (file)
@@ -193,6 +193,7 @@ module HOMARD
 //
     HOMARD_YACS CreateYACSSchema(in string YACSName, in string CaseName, in string ScriptFile, in string DirName, in string MeshFile)
                                                            raises (SALOME::SALOME_Exception);
+    long YACSWrite (in string YACSName)                    raises (SALOME::SALOME_Exception);
     long YACSWriteOnFile (in string YACSName, in string YACSFile)
                                                            raises (SALOME::SALOME_Exception);
 
index fecd15c17ebe76221064895dbbef6b84409003be..e7876f05bac323fa89c15978fd886b266a0e9c23 100644 (file)
@@ -67,6 +67,7 @@ dist_salomeres_DATA =   \
        texte_2.png \
        triangle.png \
        whatis.png \
+       write.png \
        yacs.png \
        yacs_01.xml \
        zone_boxdxyz.png \
diff --git a/resources/write.png b/resources/write.png
new file mode 100644 (file)
index 0000000..7988feb
Binary files /dev/null and b/resources/write.png differ
index b327c5994e2156096868343a175b3edbd7f30b27..62319b4ad0ec628d7e71c2b7c1c4b95213dacfca 100644 (file)
@@ -72,7 +72,7 @@ NewStudy = StudyManager.NewStudy("my_homard_study")
          <tonode>SetCurrentStudy</tonode> <toport>theStudy</toport>
       </datalink>
    </bloc>
-   <while name="Tant_que_le_calcul_n_a_pas_converge">
+   <while name="Boucle_de_convergence">
       <bloc name="Alternance_Calcul_HOMARD">
          <inline name="Calcul">
             <script><code><![CDATA[
@@ -83,12 +83,12 @@ Alternance_Calcul_HOMARD_Calcul
 #
 argu  = ["-v"]
 argu.append("--rep_calc=" + rep_calc)
-argu.append("--numero=%d" % numCalc)
+argu.append("--num=%d" % numCalc)
 argu.append("--mesh_file="  + MeshFile)
 #
-LanceCas_A = LanceCas(argu)
+Script_A = Script(argu)
 #
-Error, message_erreur, dico_resu = LanceCas_A.calcul ()
+Error, message_erreur, dico_resu = Script_A.compute ()
 #
 dico_resu["rep_calc"] = rep_calc
 #
@@ -104,7 +104,6 @@ global NumCalc
 global resu1
 # Valeurs par defaut
 NumCalcP1 = NumCalc + 1
-MeshName = " "
 FileName = " "
 #
 NbCalcMax = 5
@@ -120,28 +119,19 @@ while not Error :
         Error = abs(ErrCalc)
         break
 #
-# Si le maillage n'a pas ete defini, on arrete :
-#
-    if dico_resu.has_key("MeshName") :
-        MeshName = dico_resu["MeshName"]
-    else :
-        MessInfo = "Le maillage n'a pas ete defini"
-        Error = -2
-        break
-#
 # Si le fichier n'a pas ete defini, on arrete :
 #
     if dico_resu.has_key("FileName") :
         FileName = dico_resu["FileName"]
     else :
         MessInfo = "Le fichier du maillage n'a pas ete defini"
-        Error = -3
+        Error = -2
         break
 #
 # Si le critere est respecte, on arrete :
 #
-    if dico_resu.has_key("V00") :
-        valeur_v = dico_resu["V00"]
+    if dico_resu.has_key("V_TEST") :
+        valeur_v = dico_resu["V_TEST"]
         if NumCalc == 0 :
             resu1 = [valeur_v]
         else :
@@ -155,7 +145,7 @@ while not Error :
                 break
     else :
         MessInfo = "La valeur a tester n'a pas ete fournie"
-        Error = -4
+        Error = -3
         break
 #
 # Si on depasse le maximum, on arrete :
@@ -172,7 +162,6 @@ while not Error :
             <inport name="dico_resu" type="pyobj"/>
             <outport name="Error" type="int"/>
             <outport name="NumCalcP1" type="int"/>
-            <outport name="MeshName" type="string"/>
             <outport name="FileName" type="string"/>
             <outport name="MessInfo" type="string"/>
          </inline>
@@ -195,7 +184,7 @@ MeshFile = " "
                <bloc name="Adaptation_HOMARD">
                   <switch name="HOMARD_Initialisation" select="0">
                      <default>
-                        <bloc name="HOMARD_Init_ensuite">
+                        <bloc name="Iter_n">
                            <service name="LastIteration">
                               <node>Etude_Initialisation.SetCurrentStudy</node>
                               <method>LastIteration</method>
@@ -212,7 +201,7 @@ MeshFile = " "
                         </bloc>
                      </default>
                      <case id="1">
-                        <bloc name="HOMARD_Init_au_debut">
+                        <bloc name="Iter_1">
                            <service name="CreateCase">
                               <node>Etude_Initialisation.SetCurrentStudy</node>
                               <method>CreateCase</method>
@@ -225,7 +214,7 @@ MeshFile = " "
                               <script><code><![CDATA[
 import os
 # Repertoire d'execution
-HOMARD_Init_au_debut_Case_Options
+Iter_1_Case_Options
 # Iteration 0 associee
 Iter0 = Case.GetIter0()
 ]]></code></script>
@@ -238,7 +227,7 @@ Iter0 = Case.GetIter0()
                               <inport name="HypoName" type="string"/>
                               <outport name="return" type="HOMARD_Hypothesis"/>
                            </service>
-HOMARD_Init_au_debut
+Iter_1
                            <datalink control="false">
                               <fromnode>CreateCase</fromnode> <fromport>return</fromport>
                               <tonode>Case_Options</tonode> <toport>Case</toport>
@@ -251,6 +240,7 @@ HOMARD_Init_au_debut
 import os
 # Repertoire d'execution
 HOMARD_Exec_DirName
+HOMARD_Exec_MeshName
 #
 # Hypothese
 # =========
@@ -284,7 +274,6 @@ Iter = LastIter.NextIteration(IterName)
 Iter.AssociateHypo(HypoName)
 #
 # . Le nom du futur maillage
-MeshName = dico_resu["MeshName"]
 Iter.SetMeshName(MeshName)
 #
 # . Le fichier du futur maillage
@@ -319,19 +308,19 @@ else :
                   </inline>
                   <control> <fromnode>HOMARD_Initialisation</fromnode> <tonode>HOMARD_Exec</tonode> </control>
                   <datalink control="false">
-                     <fromnode>HOMARD_Initialisation.default_HOMARD_Init_ensuite.LastIteration</fromnode> <fromport>return</fromport>
+                     <fromnode>HOMARD_Initialisation.default_Iter_n.LastIteration</fromnode> <fromport>return</fromport>
                      <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
                   </datalink>
                   <datalink control="false">
-                     <fromnode>HOMARD_Initialisation.p1_HOMARD_Init_au_debut.Case_Options</fromnode> <fromport>Iter0</fromport>
+                     <fromnode>HOMARD_Initialisation.p1_Iter_1.Case_Options</fromnode> <fromport>Iter0</fromport>
                      <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
                   </datalink>
                   <datalink control="false">
-                     <fromnode>HOMARD_Initialisation.default_HOMARD_Init_ensuite.GetHypothesis</fromnode> <fromport>return</fromport>
+                     <fromnode>HOMARD_Initialisation.default_Iter_n.GetHypothesis</fromnode> <fromport>return</fromport>
                      <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
                   </datalink>
                   <datalink control="false">
-                     <fromnode>HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateHypothesis</fromnode> <fromport>return</fromport>
+                     <fromnode>HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</fromnode> <fromport>return</fromport>
                      <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
                   </datalink>
                </bloc>
@@ -355,13 +344,9 @@ else :
             <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
             <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>NumAdapt</toport>
          </datalink>
-         <datalink control="false">
-            <fromnode>Analyse</fromnode> <fromport>MeshName</fromport>
-            <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateCase</tonode> <toport>MeshName</toport>
-         </datalink>
          <datalink control="false">
             <fromnode>Analyse</fromnode> <fromport>FileName</fromport>
-            <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateCase</tonode> <toport>FileName</toport>
+            <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode> <toport>FileName</toport>
          </datalink>
          <datalink control="false">
             <fromnode>Analyse</fromnode> <fromport>MessInfo</fromport>
@@ -408,66 +393,66 @@ else :
       <inport name="MessInfo" type="string"/>
    </inline>
    <control> <fromnode>DataInit</fromnode> <tonode>Etude_Initialisation</tonode> </control>
-   <control> <fromnode>Etude_Initialisation</fromnode> <tonode>Tant_que_le_calcul_n_a_pas_converge</tonode> </control>
-   <control> <fromnode>Tant_que_le_calcul_n_a_pas_converge</fromnode> <tonode>Bilan</tonode> </control>
+   <control> <fromnode>Etude_Initialisation</fromnode> <tonode>Boucle_de_convergence</tonode> </control>
+   <control> <fromnode>Boucle_de_convergence</fromnode> <tonode>Bilan</tonode> </control>
    <datalink control="false">
       <fromnode>DataInit</fromnode> <fromport>MeshFile</fromport>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Calcul</tonode> <toport>MeshFile</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode> <toport>MeshFile</toport>
    </datalink>
    <datalink control="false">
-      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>OK</fromport>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge</tonode> <toport>condition</toport>
+      <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>OK</fromport>
+      <tonode>Boucle_de_convergence</tonode> <toport>condition</toport>
    </datalink>
    <datalink control="false">
-      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>OK</fromport>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge</tonode> <toport>condition</toport>
+      <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>OK</fromport>
+      <tonode>Boucle_de_convergence</tonode> <toport>condition</toport>
    </datalink>
    <datalink control="false">
-      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MessInfo</fromport>
+      <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MessInfo</fromport>
       <tonode>Bilan</tonode> <toport>MessInfo</toport>
    </datalink>
    <datalink control="false">
-      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MessInfo</fromport>
+      <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MessInfo</fromport>
       <tonode>Bilan</tonode> <toport>MessInfo</toport>
    </datalink>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateCase</tonode><toport>CaseName</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode><toport>CaseName</toport>
       <value><string>Calcul</string></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Calcul</tonode><toport>numCalc</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode><toport>numCalc</toport>
       <value><int>0</int></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation</tonode><toport>select</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation</tonode><toport>select</toport>
       <value><int>0</int></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode><toport>select</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode><toport>select</toport>
       <value><int>0</int></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.LastIteration</tonode><toport>CaseName</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.LastIteration</tonode><toport>CaseName</toport>
       <value><string>Calcul</string></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.GetHypothesis</tonode><toport>HypoName</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.GetHypothesis</tonode><toport>HypoName</toport>
       <value><string>Hypo</string></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateHypothesis</tonode><toport>HypoName</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</tonode><toport>HypoName</toport>
       <value><string>Hypo</string></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge</tonode><toport>condition</toport>
+      <tonode>Boucle_de_convergence</tonode><toport>condition</toport>
       <value><boolean>true</boolean></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Analyse</tonode><toport>NumCalc</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>NumCalc</toport>
       <value><int>0</int></value>
    </parameter>
    <parameter>
-      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Analyse</tonode><toport>ErrCalc</toport>
+      <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>ErrCalc</toport>
       <value><int>0</int></value>
    </parameter>
 PARAMETRES
@@ -476,22 +461,22 @@ PARAMETRES
    <presentation name="Etude_Initialisation" x="175" y="32" width="158" height="38" expanded="0" expx="175" expy="32" expWidth="162.5" expHeight="40.5" shownState="1"/>
    <presentation name="Etude_Initialisation.StudyCreation" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
    <presentation name="Etude_Initialisation.SetCurrentStudy" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge" x="4" y="103" width="569" height="514" expanded="1" expx="4" expy="103" expWidth="569" expHeight="514" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD" x="4" y="59" width="561" height="451" expanded="1" expx="10" expy="59" expWidth="561" expHeight="451" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Calcul" x="4" y="32" width="158" height="90" expanded="1" expx="4" expy="32" expWidth="158" expHeight="90" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Analyse" x="181" y="32" width="158" height="171" expanded="1" expx="181" expy="32" expWidth="158" expHeight="171" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation" x="4" y="204" width="553" height="243" expanded="1" expx="4" expy="204" expWidth="553" expHeight="243" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle" x="4" y="59" width="166" height="153" expanded="1" expx="4" expy="59" expWidth="166" expHeight="153" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret" x="4" y="32" width="158" height="117" expanded="1" expx="4" expy="32" expWidth="158" expHeight="117" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD"  x="202" y="59" width="347" height="180" expanded="1" expx="202" expy="59" expWidth="347" expHeight="180" shownState="0"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation" x="4" y="32" width="158" height="65" expanded="0" expx="4" expy="32" expWidth="167" expHeight="67.5" shownState="1"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut" x="0" y="0" width="162.5" height="40.5" expanded="1" expx="4" expy="59" expWidth="162.5" expHeight="40.5" shownState="2"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateCase" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.Case_Options" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateHypothesis" x="0" y="0" width="158" height="36" expanded="1" expx="322" expy="32" expWidth="158" expHeight="36" shownState="2"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite" x="0" y="0" width="162.5" height="40.5" expanded="1" expx="4" expy="1639.5" expWidth="162.5" expHeight="40.5" shownState="2"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.LastIteration" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.GetHypothesis" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
-   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec" x="185" y="32" width="158" height="144" expanded="1" expx="185" expy="32" expWidth="158" expHeight="144" shownState="0"/>
+   <presentation name="Boucle_de_convergence" x="4" y="103" width="569" height="514" expanded="1" expx="4" expy="103" expWidth="569" expHeight="514" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD" x="4" y="59" width="561" height="451" expanded="1" expx="10" expy="59" expWidth="561" expHeight="451" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul" x="4" y="32" width="158" height="90" expanded="1" expx="4" expy="32" expWidth="158" expHeight="90" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse" x="181" y="32" width="158" height="171" expanded="1" expx="181" expy="32" expWidth="158" expHeight="171" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation" x="4" y="204" width="553" height="243" expanded="1" expx="4" expy="204" expWidth="553" expHeight="243" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle" x="4" y="59" width="166" height="153" expanded="1" expx="4" expy="59" expWidth="166" expHeight="153" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret" x="4" y="32" width="158" height="117" expanded="1" expx="4" expy="32" expWidth="158" expHeight="117" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD"  x="202" y="59" width="347" height="180" expanded="1" expx="202" expy="59" expWidth="347" expHeight="180" shownState="0"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation" x="4" y="32" width="158" height="65" expanded="0" expx="4" expy="32" expWidth="167" expHeight="67.5" shownState="1"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1" x="0" y="0" width="162.5" height="40.5" expanded="1" expx="4" expy="59" expWidth="162.5" expHeight="40.5" shownState="2"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.Case_Options" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateHypothesis" x="0" y="0" width="158" height="36" expanded="1" expx="322" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n" x="0" y="0" width="162.5" height="40.5" expanded="1" expx="4" expy="1639.5" expWidth="162.5" expHeight="40.5" shownState="2"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.LastIteration" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.GetHypothesis" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec" x="185" y="32" width="158" height="144" expanded="1" expx="185" expy="32" expWidth="158" expHeight="144" shownState="0"/>
    <presentation name="Bilan" x="350" y="32" width="158" height="63" expanded="1" expx="350" expy="32" expWidth="158" expHeight="63" shownState="0"/>
 </proc>
index 16517a848014ffc3c45f0b345a739b301058be93..09bc0ad3b2575df2d8b3719c163014e3b1abc096 100644 (file)
@@ -113,8 +113,8 @@ std::string HOMARD_Iteration::GetDumpPython() const
 //   MESSAGE (".. Hypothese " << _NomHypo );
   aScript << "\t" << _Name << ".AssociateHypo(\"" << _NomHypo << "\")\n";
 
-  if (_Etat == true) { aScript << "\tcodret = "  <<_Name << ".Compute(1, 2)\n"; }
-  else               { aScript << "\t#codret = " <<_Name << ".Compute(1, 2)\n"; }
+  if (_Etat == true) { aScript << "\tcodret = "  <<_Name << ".Compute(1, 1)\n"; }
+  else               { aScript << "\t#codret = " <<_Name << ".Compute(1, 1)\n"; }
 //   MESSAGE (". Fin de l ecriture de l iteration " << _Name );
 
   return aScript.str();
index 0e238804789638a3c25808cd8bd649e54b8ef443..99b4c94f350ad687bc3ee7f4fe8ebb7f67a8124b 100644 (file)
@@ -78,10 +78,15 @@ std::string HOMARD_YACS::GetDumpPython() const
   MESSAGE (". Ecriture du schema " << _Name );
   std::ostringstream aScript;
   aScript << "\n# Creation of the schema " << _Name << "\n";
-// Le fichier du maillage initial
-  aScript << "\t" << _Name << ".SetMeshFile(\"" << _MeshFile << "\")\n";
+// Creation du schema
+  aScript << "\t" << _Name << " = " << _NomCas << ".CreateYACSSchema(\"" << _Name << "\", \"" << _ScriptFile << "\", \"" << _NomDir << "\", \"" << _MeshFile << "\")\n";
+// Le type de schema
+  aScript << "\t" << _Name << ".SetType(" << _Type << ")\n";
 
-//   MESSAGE (". Fin de l ecriture du schema " << _Name );
+// L'ecriture eventuelle du schema
+  aScript << "\t#" << _Name << ".Write()\n";
+
+  MESSAGE (". Fin de l ecriture du schema " << _Name );
 
   return aScript.str();
 }
index a8202e39eb00adfabd806d58e6fc2a8aa5b59f4f..a598c5a8306e6461ac08b468674827a463bd7d1b 100644 (file)
@@ -86,15 +86,15 @@ void YACSDriver::Texte_Alternance_Calcul_HOMARD_Calcul( const std::string FileNa
   _Texte += "rep_calc = \"" + _DirName + "\"\n" ;
   _Texte += "rep_script = os.path.dirname(\"" + FileName + "\")\n" ;
   _Texte += "sys.path.append(rep_script)\n" ;
-  _Texte += "from " + nomfic + " import LanceCas\n" ;
+  _Texte += "from " + nomfic + " import Script\n" ;
 //
 }
 //===============================================================================
 // Les options du cas
 //===============================================================================
-void YACSDriver::Texte_HOMARD_Init_au_debut_Case_Options( const std::string pythonTexte )
+void YACSDriver::Texte_Iter_1_Case_Options( const std::string pythonTexte )
 {
-  MESSAGE("Texte_HOMARD_Init_au_debut_Case_Options, pythonTexte\n"<<pythonTexte);
+  MESSAGE("Texte_Iter_1_Case_Options, pythonTexte\n"<<pythonTexte);
 //
   _Texte += "DirName = \"" + _DirName + "/HOMARD\"\n" ;
   _Texte += "Case.SetDirName(DirName)\n" ;
@@ -109,14 +109,14 @@ void YACSDriver::Texte_HOMARD_Init_au_debut_Case_Options( const std::string pyth
 // methode : methode associee a la creation de la zone
 // ZoneName : nom de la zone
 //===============================================================================
-std::string YACSDriver::Texte_HOMARD_Init_au_debut_Zone( int ZoneType, const std::string pythonStructure, const std::string methode, const std::string ZoneName )
+std::string YACSDriver::Texte_Iter_1_Zone( int ZoneType, const std::string pythonStructure, const std::string methode, const std::string ZoneName )
 {
-  MESSAGE("Texte_HOMARD_Init_au_debut_Zone, ZoneType = "<<ZoneType<<", pythonStructure = "<<pythonStructure);
+  MESSAGE("Texte_Iter_1_Zone, ZoneType = "<<ZoneType<<", pythonStructure = "<<pythonStructure);
   MESSAGE("methode = "<<methode<<", ZoneName = "<<ZoneName );
 //
 // 1. Le nom du noeud
   std::string noeud_2 = methode + "_" + ZoneName ;
-  std::string node = "Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut." ;
+  std::string node = "Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1." ;
   node += noeud_2 ;
 // 2. Texte de controle
   std::string texte_control = Texte_control (_noeud_1, noeud_2) ;
@@ -271,14 +271,14 @@ std::string YACSDriver::Texte_HOMARD_Init_au_debut_Zone( int ZoneType, const std
 // methode : methode associee a la creation de la frontiere
 // BoundaryName : nom de la frontiere
 //===============================================================================
-std::string YACSDriver::Texte_HOMARD_Init_au_debut_Boundary( int BoundaryType, const std::string pythonStructure, const std::string methode, const std::string BoundaryName )
+std::string YACSDriver::Texte_Iter_1_Boundary( int BoundaryType, const std::string pythonStructure, const std::string methode, const std::string BoundaryName )
 {
-  MESSAGE("Texte_HOMARD_Init_au_debut_Boundary, BoundaryType = "<<BoundaryType<<", pythonStructure = "<<pythonStructure);
+  MESSAGE("Texte_Iter_1_Boundary, BoundaryType = "<<BoundaryType<<", pythonStructure = "<<pythonStructure);
   MESSAGE("methode = "<<methode<<", BoundaryName = "<<BoundaryName );
 //
 // 1. Le nom du noeud
   std::string noeud_2 = methode + "_" + BoundaryName ;
-  std::string node = "Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut." ;
+  std::string node = "Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1." ;
   node += noeud_2 ;
 // 2. Texte de controle
   std::string texte_control = Texte_control (_noeud_1, noeud_2) ;
@@ -415,11 +415,11 @@ std::string YACSDriver::Texte_HOMARD_Init_au_debut_Boundary( int BoundaryType, c
 //
 }
 //===============================================================================
-// Controle des enchainements de noeud dans le noeud HOMARD_Init_au_debut
+// Controle des enchainements de noeud dans le noeud Iter_1
 //===============================================================================
-  std::string YACSDriver::Texte_HOMARD_Init_au_debut_control()
+  std::string YACSDriver::Texte_Iter_1_control()
 {
-  MESSAGE("Texte_HOMARD_Init_au_debut_control");
+  MESSAGE("Texte_Iter_1_control");
 //
   std::string texte ;
   texte  = Texte_control ("CreateCase", "Case_Options") ;
@@ -475,6 +475,16 @@ void YACSDriver::Texte_HOMARD_Exec_DirName( )
 //
 }
 //===============================================================================
+// Le nom du maillage
+//===============================================================================
+void YACSDriver::Texte_HOMARD_Exec_MeshName( const std::string MeshName )
+{
+  MESSAGE("Texte_HOMARD_Exec_MeshName pour "<<MeshName);
+//
+  _Texte += "MeshName = \"" + MeshName + "\"\n" ;
+//
+}
+//===============================================================================
 // Manipulation des instructions python
 // pythonTexte : le texte des instructions python a manipuler
 // indice : numero de la premiere ligne voulue
index 1c565bdabaa5155beefb5df79b28ef1284ed008a..26315c34cf9d03b554c8d979d4435ac33b61f208 100644 (file)
@@ -34,13 +34,14 @@ public:
   void        TexteAdd( const std::string ligne ) ;
   void        Texte_DataInit_MeshFile( const std::string Meshfile ) ;
   void        Texte_Alternance_Calcul_HOMARD_Calcul( const std::string FileName ) ;
-  void        Texte_HOMARD_Init_au_debut_Case_Options( const std::string pythonCas ) ;
-  std::string Texte_HOMARD_Init_au_debut_Boundary( int BoundaryType, const std::string pythonStructure, const std::string methode, const std::string BoundaryName ) ;
-  std::string Texte_HOMARD_Init_au_debut_Zone( int ZoneType, const std::string pythonStructure, const std::string methode, const std::string ZoneName ) ;
-  std::string Texte_HOMARD_Init_au_debut_control() ;
+  void        Texte_Iter_1_Case_Options( const std::string pythonCas ) ;
+  std::string Texte_Iter_1_Boundary( int BoundaryType, const std::string pythonStructure, const std::string methode, const std::string BoundaryName ) ;
+  std::string Texte_Iter_1_Zone( int ZoneType, const std::string pythonStructure, const std::string methode, const std::string ZoneName ) ;
+  std::string Texte_Iter_1_control() ;
   std::string Texte_control( const std::string noeud_1, const std::string noeud_2 ) ;
   std::string Texte_inport( const std::string inport_type, const std::string inport_nom ) ;
   void        Texte_HOMARD_Exec_DirName( ) ;
+  void        Texte_HOMARD_Exec_MeshName( const std::string MeshName ) ;
   void        Texte_python( const std::string pythonTexte, int indice, const std::string concept ) ;
   void        TexteParametre( const std::string node, const std::string port, const std::string type_value, const std::string value ) ;
   void        TexteAddParametres( ) ;
index 67f17a21a8e524b1925f883239dbca843c89df56..85eda433bfcbdfe796fe41886fe8608101e50314 100644 (file)
@@ -1,7 +1,7 @@
 /********************************************************************************
 ** Form generated from reading UI file 'CreateYACS.ui'
 **
-** Created: Tue Sep 17 15:43:52 2013
+** Created: Wed Sep 18 10:38:42 2013
 **      by: Qt User Interface Compiler version 4.6.3
 **
 ** WARNING! All changes made in this file will be lost when recompiling UI file!
@@ -39,15 +39,15 @@ public:
     QLineEdit *LECaseName;
     QHBoxLayout *_2;
     QLabel *Script;
-    QPushButton *PushFile;
+    QPushButton *PBScriptFile;
     QLineEdit *LEScriptFile;
     QHBoxLayout *hboxLayout;
     QLabel *DirectoryStart;
-    QPushButton *PushDir;
+    QPushButton *PBDir;
     QLineEdit *LEDirName;
     QHBoxLayout *_3;
     QLabel *MeshFile;
-    QPushButton *PushFile_2;
+    QPushButton *PBMeshFile;
     QLineEdit *LEMeshFile;
     QRadioButton *RBStatic;
     QRadioButton *RBTransient;
@@ -117,11 +117,11 @@ public:
 
         _2->addWidget(Script);
 
-        PushFile = new QPushButton(CreateYACS);
-        PushFile->setObjectName(QString::fromUtf8("PushFile"));
-        PushFile->setAutoDefault(false);
+        PBScriptFile = new QPushButton(CreateYACS);
+        PBScriptFile->setObjectName(QString::fromUtf8("PBScriptFile"));
+        PBScriptFile->setAutoDefault(false);
 
-        _2->addWidget(PushFile);
+        _2->addWidget(PBScriptFile);
 
         LEScriptFile = new QLineEdit(CreateYACS);
         LEScriptFile->setObjectName(QString::fromUtf8("LEScriptFile"));
@@ -143,11 +143,11 @@ public:
 
         hboxLayout->addWidget(DirectoryStart);
 
-        PushDir = new QPushButton(CreateYACS);
-        PushDir->setObjectName(QString::fromUtf8("PushDir"));
-        PushDir->setAutoDefault(false);
+        PBDir = new QPushButton(CreateYACS);
+        PBDir->setObjectName(QString::fromUtf8("PBDir"));
+        PBDir->setAutoDefault(false);
 
-        hboxLayout->addWidget(PushDir);
+        hboxLayout->addWidget(PBDir);
 
         LEDirName = new QLineEdit(CreateYACS);
         LEDirName->setObjectName(QString::fromUtf8("LEDirName"));
@@ -169,11 +169,11 @@ public:
 
         _3->addWidget(MeshFile);
 
-        PushFile_2 = new QPushButton(CreateYACS);
-        PushFile_2->setObjectName(QString::fromUtf8("PushFile_2"));
-        PushFile_2->setAutoDefault(false);
+        PBMeshFile = new QPushButton(CreateYACS);
+        PBMeshFile->setObjectName(QString::fromUtf8("PBMeshFile"));
+        PBMeshFile->setAutoDefault(false);
 
-        _3->addWidget(PushFile_2);
+        _3->addWidget(PBMeshFile);
 
         LEMeshFile = new QLineEdit(CreateYACS);
         LEMeshFile->setObjectName(QString::fromUtf8("LEMeshFile"));
@@ -249,11 +249,11 @@ public:
         Case->setText(QApplication::translate("CreateYACS", "Case", 0, QApplication::UnicodeUTF8));
         PBCaseName->setText(QString());
         Script->setText(QApplication::translate("CreateYACS", "Script", 0, QApplication::UnicodeUTF8));
-        PushFile->setText(QString());
+        PBScriptFile->setText(QString());
         DirectoryStart->setText(QApplication::translate("CreateYACS", "Directory", 0, QApplication::UnicodeUTF8));
-        PushDir->setText(QString());
+        PBDir->setText(QString());
         MeshFile->setText(QApplication::translate("CreateYACS", "Mesh file", 0, QApplication::UnicodeUTF8));
-        PushFile_2->setText(QString());
+        PBMeshFile->setText(QString());
         RBStatic->setText(QApplication::translate("CreateYACS", "Static", 0, QApplication::UnicodeUTF8));
         RBTransient->setText(QApplication::translate("CreateYACS", "Transient", 0, QApplication::UnicodeUTF8));
         GroupButtons->setTitle(QString());
index 53a1f363b74eec85d3afa7ea4b4ae6a93fed2027..aab5bc5b84a45a7ad3256291a1aecb1dab476435 100644 (file)
@@ -90,7 +90,7 @@
       </widget>
      </item>
      <item>
-      <widget class="QPushButton" name="PushFile">
+      <widget class="QPushButton" name="PBScriptFile">
        <property name="text">
         <string/>
        </property>
       </widget>
      </item>
      <item>
-      <widget class="QPushButton" name="PushDir">
+      <widget class="QPushButton" name="PBDir">
        <property name="text">
         <string/>
        </property>
       </widget>
      </item>
      <item>
-      <widget class="QPushButton" name="PushFile_2">
+      <widget class="QPushButton" name="PBMeshFile">
        <property name="text">
         <string/>
        </property>
index 56949368d15340a2ec1963891b1759fd9264e32c..3f59dd163f3bf3634b3cb08510cebc95bb2e44d5 100644 (file)
@@ -306,7 +306,7 @@ bool HOMARDGUI::OnGUIEvent (int theCommandID)
       if (monIter == QString("")) break;
       try
       {
-        homardGen->Compute(monIter.toStdString().c_str(), 0, 1, -1, 2);
+        homardGen->Compute(monIter.toStdString().c_str(), 0, 1, -1, 1);
       }
       catch( SALOME::SALOME_Exception& S_ex )
       {
@@ -369,7 +369,8 @@ bool HOMARDGUI::OnGUIEvent (int theCommandID)
         // Edition d'un schema YACS
         else if (HOMARD_UTILS::isYACS(obj))
         {
-          MonEditYACS *aDlg = new MonEditYACS(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName) ;
+          MESSAGE("appel de MonEditYACS");
+          MonEditYACS *aDlg = new MonEditYACS(true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName) ;
           aDlg->show();
         }
         // Edition d'une zone
@@ -468,11 +469,11 @@ bool HOMARDGUI::OnGUIEvent (int theCommandID)
       break;
     }
 
-    case 1302: // Affichage du fichier mess
+    case 1302: // Affichage de fichier texte
     {
       MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() );
       _PTR(SObject) obj = chercheMonObjet();
-      if ((obj) and ((HOMARD_UTILS::isFilelog(obj) or HOMARD_UTILS::isFileSummary(obj))))
+      if ( (obj) and ( HOMARD_UTILS::isFileType(obj,QString("log")) or HOMARD_UTILS::isFileType(obj,QString("Summary")) or HOMARD_UTILS::isFileType(obj,QString("xml")) ) )
       {
           MonEditFile *aDlg = new MonEditFile( 0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ;
           if ( aDlg->_codret == 0 ) { aDlg->show(); }
@@ -486,7 +487,7 @@ bool HOMARDGUI::OnGUIEvent (int theCommandID)
       MESSAGE("command " << theCommandID << " activated");
       QString Name=HOMARD_QT_COMMUN::SelectionArbreEtude(QString("CasHomard"), 1);
       MESSAGE("Name " << Name.toStdString().c_str() << " choisi dans arbre");
-      MonCreateYACS *aDlg = new MonCreateYACS( parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), Name ) ;
+      MonCreateYACS *aDlg = new MonCreateYACS( true, HOMARD::HOMARD_Gen::_duplicate(homardGen), Name ) ;
       aDlg->show();
       break;
     }
@@ -496,9 +497,18 @@ bool HOMARDGUI::OnGUIEvent (int theCommandID)
       MESSAGE("etape 1402")
       MESSAGE("command " << theCommandID << " activated");
       QString Name=HOMARD_QT_COMMUN::SelectionArbreEtude(QString("YACSHomard"), 1);
-      MESSAGE("YACSHomard " << Name.toStdString().c_str() << " choisi dans arbre");
-      MonCreateYACS *aDlg = new MonCreateYACS( parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), Name ) ;
-      aDlg->show();
+      if (Name == QString("")) break;
+      try
+      {
+        homardGen->YACSWrite(Name.toStdString().c_str());
+      }
+      catch( SALOME::SALOME_Exception& S_ex )
+      {
+        QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                                  QObject::tr(CORBA::string_dup(S_ex.details.text)) );
+        getApp()->updateObjectBrowser();
+        return false;
+      }
       break;
     }
 
@@ -643,8 +653,8 @@ void HOMARDGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& t
     }
     else if ( HOMARD_UTILS::isYACS(obj) )
     {
-      pix = resMgr->loadPixmap( "HOMARD", "save.png" );
-      menu->addAction(QIcon(pix), tr(QString("HOM_MEN_YACS").toLatin1().data()), this, SLOT(YACSWrite()));
+      pix = resMgr->loadPixmap( "HOMARD", "write.png" );
+      menu->addAction(QIcon(pix), tr(QString("HOM_MEN_WRITE").toLatin1().data()), this, SLOT(YACSWrite()));
       EditObject = true ;
       DeleteObject = true ;
     }
@@ -653,7 +663,7 @@ void HOMARDGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& t
       EditObject = true ;
       DeleteObject = true ;
     }
-    else if ( HOMARD_UTILS::isFilelog(obj) or HOMARD_UTILS::isFileSummary(obj) )
+    else if ( HOMARD_UTILS::isFileType(obj,QString("log")) or HOMARD_UTILS::isFileType(obj,QString("Summary")) or HOMARD_UTILS::isFileType(obj,QString("xml")) )
     {
       pix = resMgr->loadPixmap( "HOMARD", "texte.png" );
       menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT_MESS_FILE").toLatin1().data()), this, SLOT(EditAsciiFile()));
@@ -698,11 +708,6 @@ void HOMARDGUI::Delete()
   this->OnGUIEvent(1211);
 }
 
-// void HOMARDGUI::EditAsciiFile()
-// {
-//   this->OnGUIEvent(1301);
-// }
-
 void HOMARDGUI::EditAsciiFile()
 {
   this->OnGUIEvent(1302);
index a507297830ed98e6dee02af23e4aa86740a66589..89d7de235deae147ddb5c6130ac3431d82304177 100644 (file)
@@ -259,18 +259,11 @@ bool HOMARD_UTILS::isZone(_PTR(SObject) MonObj)
    return isObject( MonObj, QString("ZoneHomard"), -1 ) ;
 }
 //================================================================
-// Retourne vrai si l objet est un fichier de messages
+// Retourne vrai si l objet est un fichier de type TypeFile
 //================================================================
-bool HOMARD_UTILS::isFilelog(_PTR(SObject) MonObj)
+bool HOMARD_UTILS::isFileType(_PTR(SObject) MonObj, QString TypeFile)
 {
-   return isObject( MonObj, QString("log"), 0 ) ;
-}
-//================================================================
-// Retourne vrai si l objet est un fichier de bilan
-//================================================================
-bool HOMARD_UTILS::isFileSummary(_PTR(SObject) MonObj)
-{
-   return isObject( MonObj, QString("Summary"), 0 ) ;
+   return isObject( MonObj, TypeFile, 0 ) ;
 }
 
 //=========================================================================================================
index c538aa788823932b1bb0e2c406802724d5627fe3..e4315ba9c482f8f647532c847f028aac808a63c2 100644 (file)
@@ -80,8 +80,7 @@ namespace HOMARD_UTILS {
   bool isIter(_PTR(SObject)  MonObj);
   bool isYACS(_PTR(SObject)  MonObj);
   bool isZone(_PTR(SObject)  MonObj);
-  bool isFilelog(_PTR(SObject)  MonObj);
-  bool isFileSummary(_PTR(SObject)  MonObj);
+  bool isFileType(_PTR(SObject)  MonObj, QString TypeFile);
   bool isObject(_PTR(SObject)  MonObj, QString TypeObject, int option );
 
   void PushOnHelp(QString monFichierAide, QString contexte);
index ef7d0bb9c73ae1ec6016b4c9b81feeeb23bbe646..ffeb40f1264611ca8368390987be74fa7b60c07a 100644 (file)
         <source>HOM_MEN_EDIT_MESS_FILE</source>
         <translation>Show the file</translation>
     </message>
+    <message>
+        <source>HOM_MEN_WRITE</source>
+        <translation>Write</translation>
+    </message>
     <message>
         <source>HOM_TOP_HOMARD</source>
         <translation>HOMARD</translation>
index 418873852748955d822cc4e17377ef087375068d..77b334a9235564764af3cd6c833d819f0da1bcb2 100644 (file)
         <source>HOM_MEN_EDIT_MESS_FILE</source>
         <translation>Afficher le fichier</translation>
     </message>
+    <message>
+        <source>HOM_MEN_WRITE</source>
+        <translation>Ecrire</translation>
+    </message>
     <message>
         <source>HOM_TOP_HOMARD</source>
         <translation>HOMARD</translation>
index a2b415db18959ac8f5153ee6a7ad80d1ef15f7e6..a7079d5f0287b7b21d2ec952fa85c23fd6ef9ed8 100644 (file)
         <source>HOM_MEN_EDIT_MESS_FILE</source>
         <translation>Show the file</translation>
     </message>
+    <message>
+        <source>HOM_MEN_WRITE</source>
+        <translation>Write</translation>
+    </message>
     <message>
         <source>HOM_TOP_HOMARD</source>
         <translation>HOMARD</translation>
index 74538e816588d7d207e9c80616e6eb6795dfd5fa..0bf0acd65f19da3962ded425af41522ca7c2093c 100644 (file)
@@ -30,40 +30,39 @@ using namespace std;
 #include <utilities.h>
 
 
+// ----------------------------------------------------------------------
+MonCreateYACS::MonCreateYACS (bool modal, HOMARD::HOMARD_Gen_var myHomardGen0, QString CaseName ):
 // ----------------------------------------------------------------------
 /* Constructs a MonCreateYACS
  * Sets attributes to default values
  */
 // ----------------------------------------------------------------------
-MonCreateYACS::MonCreateYACS (QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen0, QString CaseName )
-    :
-    Ui_CreateYACS(),
-    _aCaseName(CaseName),
-    _aScriptFile(""),
-    _aDirName(""),
-    _aMeshFile("")
-{
-  MESSAGE("Debut du constructeur de MonCreateYACS");
-  myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
-  setupUi(this);
-  setModal(modal);
+  Ui_CreateYACS(),
+  _aCaseName(CaseName),
+  _aScriptFile(""),
+  _aDirName(""),
+  _aMeshFile("")
+  {
+//     MESSAGE("Debut du constructeur de MonCreateYACS");
+    myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
+    setupUi(this);
+    setModal(modal);
 
-  InitConnect();
+    InitConnect();
 
-  SetNewName() ;
+    SetNewName() ;
 
-  if (_aCaseName != QString(""))
-    { SetCaseName(); }
-  else
-    {setModal(false); /* permet selection du cas dans l arbre d etude */}
+    if (_aCaseName != QString(""))
+      { SetCaseName(); }
+    else
+      {setModal(false); /* permet selection du cas dans l arbre d etude */}
 
-  adjustSize();
-  MESSAGE("Fin du constructeur de MonCreateYACS");
-}
+    adjustSize();
+//     MESSAGE("Fin du constructeur de MonCreateYACS");
+  }
 
 // ----------------------------------------------------------------------
-MonCreateYACS::MonCreateYACS(QWidget* parent,
-                             HOMARD::HOMARD_Gen_var myHomardGen0,
+MonCreateYACS::MonCreateYACS(HOMARD::HOMARD_Gen_var myHomardGen0,
                              QString caseName):
 // ----------------------------------------------------------------------
 // Constructeur appele par MonEditYACS
@@ -72,7 +71,7 @@ MonCreateYACS::MonCreateYACS(QWidget* parent,
     _Name (""),
     Chgt (false)
     {
-  //  MESSAGE("Debut de  MonCreateYACS")
+//       MESSAGE("Debut du constructeur de MonCreateYACS appele par MonEditYACS");
       setupUi(this) ;
 
       setModal(true) ;
@@ -90,9 +89,9 @@ void MonCreateYACS::InitConnect()
 // ------------------------------------------------------------------------
 {
     connect( PBCaseName,     SIGNAL(pressed()), this, SLOT(SetCaseName()));
-    connect( PushDir,        SIGNAL(pressed()), this, SLOT(SetDirName()));
-    connect( PushFile,       SIGNAL(pressed()), this, SLOT(SetScriptFile()));
-    connect( PushFile_2,     SIGNAL(pressed()), this, SLOT(SetMeshFile()));
+    connect( PBScriptFile,   SIGNAL(pressed()), this, SLOT(SetScriptFile()));
+    connect( PBDir,          SIGNAL(pressed()), this, SLOT(SetDirName()));
+    connect( PBMeshFile,     SIGNAL(pressed()), this, SLOT(SetMeshFile()));
 
     connect( RBStatic,       SIGNAL(clicked()), this, SLOT(SetType(1)));
     connect( RBTransient,    SIGNAL(clicked()), this, SLOT(SetType(2)));
@@ -108,12 +107,6 @@ bool MonCreateYACS::PushOnApply()
 {
   MESSAGE("PushOnApply");
 
-  if ( _aCaseName == QString (""))
-  {
-    QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
-                              QObject::tr("HOM_CASE_NAME") );
-    return false;
-  }
 // Le fichier du script
   QString aFileName=LEScriptFile->text().trimmed();
   if (aFileName ==QString(""))
@@ -160,31 +153,76 @@ bool MonCreateYACS::PushOnApply()
     return false;
   }
 
-  HOMARD_UTILS::updateObjBrowser();
-  MESSAGE ("_aCaseName.toStdString " << _aCaseName.toStdString() );
+  bool bOK = CreateOrUpdate() ;
+
+  if ( bOK ) { HOMARD_UTILS::updateObjBrowser() ; }
+
+  return bOK;
+}
+// ---------------------------------------------------
+bool MonCreateYACS:: CreateOrUpdate()
+//----------------------------------------------------
+//  Creation ou modification du schema
+{
+  MESSAGE("CreateOrUpdate");
+  bool bOK = true ;
+
+  // Le cas
+  if ( _aCaseName == QString (""))
+  {
+    QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                              QObject::tr("HOM_CASE_NAME") );
+    return false;
+  }
+  // Les donnees
+  QString aScriptFile=LEScriptFile->text().trimmed();
+  if ( aScriptFile != _aScriptFile )
+  {
+    _aScriptFile = aScriptFile ;
+    Chgt = true ;
+  }
+  QString aDirName=LEDirName->text().trimmed();
+  if ( aDirName != _aDirName )
+  {
+    _aDirName = aDirName ;
+    Chgt = true ;
+  }
+  QString aMeshFile=LEMeshFile->text().trimmed();
+  if ( aMeshFile != _aMeshFile )
+  {
+    _aMeshFile = aMeshFile ;
+    Chgt = true ;
+  }
 
-// Creation de l'objet CORBA
+  // Creation de l'objet CORBA
   try
   {
     _Name=LEName->text().trimmed();
-    aYACS=myHomardGen->CreateYACSSchema(CORBA::string_dup(_Name.toStdString().c_str()), _aCaseName.toStdString().c_str(), _aScriptFile.toStdString().c_str(), _aDirName.toStdString().c_str(), _aMeshFile.toStdString().c_str());
-//     _parent->AddYACS(_Name);
+    aYACS=myHomardGen->CreateYACSSchema(CORBA::string_dup(_Name.toStdString().c_str()), CORBA::string_dup(_aCaseName.toStdString().c_str()), CORBA::string_dup(_aScriptFile.toStdString().c_str()), CORBA::string_dup(_aDirName.toStdString().c_str()), CORBA::string_dup(_aMeshFile.toStdString().c_str()));
   }
   catch( SALOME::SALOME_Exception& S_ex )
   {
     QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
                               QObject::tr(CORBA::string_dup(S_ex.details.text)) );
-    return false;
+    bOK = false;
   }
 
-return true;
+  // Options
+  if ( bOK )
+  { aYACS->SetType(_Type) ; }
+
+  // Ecriture du fichier
+  if ( bOK )
+  { aYACS->Write() ; }
+
+  return bOK;
 }
 // ---------------------------
 void MonCreateYACS::PushOnOK()
 // ---------------------------
 {
   bool bOK = PushOnApply();
-  if ( bOK )  this->close();
+  if ( bOK ) this->close();
 }
 //------------------------------
 void MonCreateYACS::PushOnHelp()
@@ -225,8 +263,6 @@ void MonCreateYACS::SetCaseName()
     _aCaseName=HOMARD_QT_COMMUN::SelectionArbreEtude(QString("CasHomard"), 1);
     if (_aCaseName == QString("")) { raise();return;};
   }
-/*  MESSAGE ("appel de GetCase avec _aCaseName = " << _aCaseName.toStdString() );*/
-  aCase = myHomardGen->GetCase(_aCaseName.toStdString().c_str());
   LECaseName->setText(_aCaseName);
 }
 // ------------------------------------------------------------------------
index 39043f207213c7b064efdcd30c65f47e19327f01..2f1d8843874e5da111ec79ea6998f986500e9c2d 100644 (file)
@@ -35,11 +35,11 @@ class MonCreateYACS : public QDialog, public Ui_CreateYACS
     Q_OBJECT
 
   public:
-    MonCreateYACS( QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString CaseName);
+    MonCreateYACS( bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString CaseName);
     virtual ~MonCreateYACS();
 
   protected :
-    MonCreateYACS( QWidget* parent, HOMARD::HOMARD_Gen_var myHomardGen, QString CaseName);
+    MonCreateYACS( HOMARD::HOMARD_Gen_var myHomardGen, QString CaseName);
 
     QString _Name;
     QString _aCaseName;
@@ -52,10 +52,10 @@ class MonCreateYACS : public QDialog, public Ui_CreateYACS
     bool Chgt;
 
     HOMARD::HOMARD_YACS_var aYACS;
-    HOMARD::HOMARD_Cas_var aCase ;
     HOMARD::HOMARD_Gen_var myHomardGen;
 
     virtual void InitConnect();
+    virtual bool CreateOrUpdate();
 
   public slots:
     virtual void SetNewName();
index 9986a305197acd37f8260475fc7e9773a47d5dd6..99ff258b6601c356ad67a01df9b41c0bb83916db 100644 (file)
@@ -32,10 +32,10 @@ using namespace std;
     herite de MonCreateYACS
 */
 // -------------------------------------------------------------
-MonEditYACS::MonEditYACS ( QWidget* parent, bool modal,
+MonEditYACS::MonEditYACS ( bool modal,
                            HOMARD::HOMARD_Gen_var myHomardGen,
                            QString Name ):
-   MonCreateYACS(parent, modal, myHomardGen, Name)
+   MonCreateYACS(myHomardGen, Name)
 {
     MESSAGE("Debut de MonEditYACS" << Name.toStdString().c_str());
     setWindowTitle(QObject::tr("HOM_YACS_EDIT_WINDOW_TITLE"));
@@ -56,25 +56,19 @@ void MonEditYACS::InitValEdit()
   LEName->setText(_Name);
   LEName->setReadOnly(true);
 
-  QString aCaseName = aYACS->GetCaseName();
-  LECaseName->setText(aCaseName);
+  QString _aCaseName = aYACS->GetCaseName();
+  LECaseName->setText(_aCaseName);
   LECaseName->setReadOnly(true);
-  PushDir->setVisible(0);
+  PBCaseName->setVisible(0);
 
   QString aScriptFile = aYACS->GetScriptFile();
   LEScriptFile->setText(aScriptFile);
-  LEScriptFile->setReadOnly(true);
-  PushDir->setVisible(0);
 
   QString aDirName = aYACS->GetDirName();
   LEDirName->setText(aDirName);
-  LEDirName->setReadOnly(true);
-  PushDir->setVisible(0);
 
   QString aMeshFile = aYACS->GetMeshFile();
   LEMeshFile->setText(aMeshFile);
-  LEMeshFile->setReadOnly(true);
-  PushDir->setVisible(0);
 
   int Type=aYACS->GetType();
   if(Type==1) { RBStatic->setChecked(true); }
@@ -85,9 +79,32 @@ void MonEditYACS::InitValEdit()
   adjustSize();
 }
 
-// -------------------------------------
-bool MonEditYACS::PushOnApply()
-// -------------------------------------
+// ---------------------------------------------------
+bool MonEditYACS:: CreateOrUpdate()
+//----------------------------------------------------
+//  Modification du schema
 {
+  MESSAGE("CreateOrUpdate");
+
+  // Les donnees
+  QString aScriptFile=LEScriptFile->text().trimmed();
+  if ( aScriptFile != _aScriptFile )
+  {
+    _aScriptFile = aScriptFile ;
+    aYACS->SetScriptFile(CORBA::string_dup(_aScriptFile.toStdString().c_str())) ;
+  }
+  QString aDirName=LEDirName->text().trimmed();
+  if ( aDirName != _aDirName )
+  {
+    _aDirName = aDirName ;
+    aYACS->SetDirName(CORBA::string_dup(_aDirName.toStdString().c_str())) ;
+  }
+  QString aMeshFile=LEMeshFile->text().trimmed();
+  if ( aMeshFile != _aMeshFile )
+  {
+    _aMeshFile = aMeshFile ;
+    aYACS->SetMeshFile(CORBA::string_dup(_aMeshFile.toStdString().c_str())) ;
+  }
+
   return true ;
-};
+}
index 232e4965d977c3e4f03c9eeb6424f1c74be86c74..3b9d5f4a1643d2e008714a764abe9eeeb34b002e 100644 (file)
@@ -32,14 +32,14 @@ class MonEditYACS : public MonCreateYACS
 {
     Q_OBJECT
 public:
-    MonEditYACS( QWidget* parent, bool modal,
+    MonEditYACS( bool modal,
                  HOMARD::HOMARD_Gen_var myHomardGen,
                  QString Name );
     virtual ~MonEditYACS();
 
 protected :
     virtual void InitValEdit();
-    virtual bool PushOnApply();
+    virtual bool CreateOrUpdate();
 
 public slots:
 
index b44f36b7c9334e38c738c11731748565818dbf24..8338f814dd2e531bd64f39c3bc6ad9c89f996674 100755 (executable)
@@ -283,25 +283,42 @@ void HOMARD_Cas_i::AddBoundaryGroup( const char* BoundaryName, const char* Group
 {
   MESSAGE ("AddBoundaryGroup : BoundaryName = "<< BoundaryName << ", Group = " << Group );
   ASSERT( myHomardCas );
-  // La frontiere est-elle deja enregistree pour ce cas ?
+  // A. La liste des frontiere+groupes
   const std::list<std::string>& ListBoundaryGroup = myHomardCas->GetBoundaryGroup();
   std::list<std::string>::const_iterator it;
-  int existe = 0;
+  // B. La frontiere
+  // B.1. La frontiere est-elle deja enregistree pour ce cas ?
+  bool existe = false ;
   for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ )
   {
-    if ( *it == BoundaryName )
-    { existe = 1 ; }
+//     MESSAGE ("..  Frontiere : "<< *it );
+    if ( *it == BoundaryName ) { existe = true ; }
     it++ ;
   }
-  // Enregistrement de la frontiere dans la reference du cas
-  myHomardCas->AddBoundaryGroup( BoundaryName, Group );
-  // Pour une nouvelle frontiere, publication dans l'arbre d'etudes sous le cas
-  if ( existe == 0 )
+  // B.2. Pour une nouvelle frontiere, publication dans l'arbre d'etudes sous le cas
+  if ( !existe )
   {
     char* CaseName = GetName() ;
     MESSAGE ( "AddBoundaryGroup : insertion de la frontiere dans l'arbre de " << CaseName );
     _gen_i->PublishBoundaryUnderCase(CaseName, BoundaryName) ;
   }
+  // C. Le groupe est-il deja enregistre pour une frontiere de ce cas ?
+  for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ )
+  {
+    std::string boun = *it ;
+    it++ ;
+//     MESSAGE ("..  Group : "<< *it );
+    if ( *it == Group )
+    { INFOS ("Le groupe " << Group << " est deja associe a la frontiere " << boun) ;
+      SALOME::ExceptionStruct es;
+      es.type = SALOME::BAD_PARAM;
+      es.text = "Invalid AddBoundaryGroup";
+      throw SALOME::SALOME_Exception(es);
+      return ;
+    }
+  }
+  // D. Enregistrement du couple (frontiere,groupe) dans la reference du cas
+  myHomardCas->AddBoundaryGroup( BoundaryName, Group );
 }
 //=============================================================================
 HOMARD::ListBoundaryGroupType* HOMARD_Cas_i::GetBoundaryGroup()
index 5629b019314dc083098c4035541bddcff53d6dbe..9bce3685e4c8638bbdf65ae2cc95157f9f2e55ab 100755 (executable)
@@ -1023,9 +1023,9 @@ HOMARD::HOMARD_Iteration_ptr  HOMARD_Gen_i::GetIteration(const char* NomIteratio
   return HOMARD::HOMARD_Iteration::_duplicate(myIteration);
 }
 //=============================================================================
-HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::GetYACS(const char* YACSName)
+HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::GetYACS(const char* nomYACS)
 {
-  HOMARD::HOMARD_YACS_var myYACS = myContextMap[GetCurrentStudyID()]._mesYACSs[YACSName];
+  HOMARD::HOMARD_YACS_var myYACS = myContextMap[GetCurrentStudyID()]._mesYACSs[nomYACS];
   ASSERT(!CORBA::is_nil(myYACS));
   return HOMARD::HOMARD_YACS::_duplicate(myYACS);
 }
@@ -3308,7 +3308,6 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishZoneInStudy(SALOMEDS::Study_ptr theSt
       break ;
     }
   }
-  MESSAGE("Appel de PublishInStudyAttr pour name = "<<theName);
   PublishInStudyAttr(aStudyBuilder, aResultSO, theName, "ZoneHomard", icone.c_str(), _orb->object_to_string(theObject) ) ;
 
   return aResultSO._retn();
@@ -3316,10 +3315,9 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishZoneInStudy(SALOMEDS::Study_ptr theSt
 //===========================================================================
 void HOMARD_Gen_i::PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder,
                                       SALOMEDS::SObject_var aResultSO,
-                                      const char* name, const char* value, const char* icone, const char* ior)
+                                      const char* name, const char* comment, const char* icone, const char* ior)
 {
-  MESSAGE("PublishInStudyAttr pour name = "<<name);
-  MESSAGE("value = "<<value);
+  MESSAGE("PublishInStudyAttr pour name = "<<name<<", comment = "<<comment);
 //   MESSAGE("icone = "<<icone);
 //   MESSAGE("ior   = "<<ior);
   SALOMEDS::GenericAttribute_var anAttr ;
@@ -3332,11 +3330,11 @@ void HOMARD_Gen_i::PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder,
   }
 
 //  Ajout du commentaire
-  if ( value != NULL )
+  if ( comment != NULL )
   {
     anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeComment");
     SALOMEDS::AttributeComment_var aCommentAttrib = SALOMEDS::AttributeComment::_narrow(anAttr);
-    aCommentAttrib->SetValue(value);
+    aCommentAttrib->SetValue(comment);
   }
 
 //  Ajout de l'icone
@@ -3380,6 +3378,31 @@ void HOMARD_Gen_i::PublishBoundaryUnderCase(const char* CaseName, const char* Bo
 
   aStudyBuilder->CommitCommand();
 
+};
+//=====================================================================================
+void HOMARD_Gen_i::PublishCaseUnderYACS(const char* nomYACS, const char* CaseName)
+{
+  MESSAGE ( "PublishCaseUnderYACS : nomYACS = " << nomYACS << ", CaseName= " << CaseName );
+
+  HOMARD::HOMARD_YACS_var myYACS = myContextMap[GetCurrentStudyID()]._mesYACSs[nomYACS];
+  ASSERT(!CORBA::is_nil(myYACS));
+  SALOMEDS::SObject_var aYACSSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myYACS)));
+  ASSERT(!CORBA::is_nil(aYACSSO));
+
+  HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[CaseName];
+  ASSERT(!CORBA::is_nil(myCase));
+  SALOMEDS::SObject_var aCaseSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myCase)));
+  ASSERT(!CORBA::is_nil(aCaseSO));
+
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+
+  aStudyBuilder->NewCommand();
+
+  SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aYACSSO);
+  aStudyBuilder->Addreference(aSubSO, aCaseSO);
+
+  aStudyBuilder->CommitCommand();
+
 };
 //=============================================================================
 void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option)
@@ -3514,24 +3537,8 @@ void HOMARD_Gen_i::DeleteResultInSmesh(std::string NomFich, std::string MeshName
 void HOMARD_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* NomFich, const char* Commentaire)
 {
 //   MESSAGE (" PublishFileUnderIteration pour l'iteration " << NomIter << " du fichier " << NomFich << " avec le commentaire " << Commentaire );
-  if (CORBA::is_nil(myCurrentStudy))
-  {
-      SALOME::ExceptionStruct es;
-      es.type = SALOME::BAD_PARAM;
-      es.text = "Invalid study context";
-      throw SALOME::SALOME_Exception(es);
-      return ;
-  };
-
   HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[NomIter];
-  if (CORBA::is_nil(myIteration))
-  {
-      SALOME::ExceptionStruct es;
-      es.type = SALOME::BAD_PARAM;
-      es.text = "Invalid iteration";
-      throw SALOME::SALOME_Exception(es);
-      return ;
-  };
+
   SALOMEDS::SObject_var aIterSO=SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
   if (CORBA::is_nil(myIteration))
   {
@@ -3548,7 +3555,7 @@ void HOMARD_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* No
 
   SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aIterSO);
 // Pour les fichiers med, on affiche une icone de maillage
-// Pour les fichiers qui sont texte, on affiche une icone de fichier texte 'texte'
+// Pour les fichiers qui sont du texte, on affiche une icone de fichier texte 'texte'
 // Le reperage se fait par la 1ere lettre du commentaire : I pour Iteration n
   std::string icone ;
   std::string ior = " " ;
@@ -3562,6 +3569,34 @@ void HOMARD_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* No
 }
 //
 //=============================================================================
+void HOMARD_Gen_i::PublishFileUnderYACS(const char* nomYACS, const char* NomFich, const char* Commentaire)
+{
+//   MESSAGE (" PublishFileUnderYACS pour le schema " << nomYACS << " du fichier " << NomFich << " avec le commentaire " << Commentaire );
+  HOMARD::HOMARD_YACS_var myYACS = myContextMap[GetCurrentStudyID()]._mesYACSs[nomYACS];
+
+  SALOMEDS::SObject_var aYACSSO=SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myYACS)));
+  if (CORBA::is_nil(myYACS))
+  {
+      SALOME::ExceptionStruct es;
+      es.type = SALOME::BAD_PARAM;
+      es.text = "Invalid YACSStudy Object";
+      throw SALOME::SALOME_Exception(es);
+      return ;
+  };
+
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+
+  aStudyBuilder->NewCommand();
+
+  SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aYACSSO);
+  std::string icone = "texte_2.png" ;
+  std::string ior = " " ;
+  PublishInStudyAttr(aStudyBuilder, aSubSO, NomFich, Commentaire, icone.c_str(), ior.c_str() ) ;
+
+  aStudyBuilder->CommitCommand();
+}
+//
+//=============================================================================
 //=============================================================================
 // YACS
 //=============================================================================
@@ -3572,16 +3607,16 @@ void HOMARD_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* No
 // FileName : nom du fichier contenant le script de lancement du calcul
 // DirName : le repertoire de lancement des calculs du schéma
 //=============================================================================
-HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::CreateYACSSchema (const char* YACSName, const char* nomCas, const char* ScriptFile, const char* DirName, const char* MeshFile)
+HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::CreateYACSSchema (const char* nomYACS, const char* nomCas, const char* ScriptFile, const char* DirName, const char* MeshFile)
 {
-  INFOS ( "CreateYACSSchema : Schema YACS " << YACSName );
+  INFOS ( "CreateYACSSchema : Schema YACS " << nomYACS );
   INFOS ( ". nomCas     : " << nomCas);
   INFOS ( ". ScriptFile : " << ScriptFile);
   INFOS ( ". DirName    : " << DirName);
   INFOS ( ". MeshFile   : " << MeshFile);
 
   // A. Controle du nom :
-  if ((myContextMap[GetCurrentStudyID()]._mesYACSs).find(YACSName) != (myContextMap[GetCurrentStudyID()]._mesYACSs).end())
+  if ((myContextMap[GetCurrentStudyID()]._mesYACSs).find(nomYACS) != (myContextMap[GetCurrentStudyID()]._mesYACSs).end())
   {
     SALOME::ExceptionStruct es;
     es.type = SALOME::BAD_PARAM;
@@ -3600,13 +3635,15 @@ HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::CreateYACSSchema (const char* YACSName, co
     throw SALOME::SALOME_Exception(es);
     return 0;
   };
-  myYACS->SetName( YACSName ) ;
+  myYACS->SetName( nomYACS ) ;
 
   // C. Enregistrement
-  myContextMap[GetCurrentStudyID()]._mesYACSs[YACSName] = myYACS;
+  myContextMap[GetCurrentStudyID()]._mesYACSs[nomYACS] = myYACS;
 
   SALOMEDS::SObject_var aSO;
-  SALOMEDS::SObject_var aResultSO=PublishInStudy(myCurrentStudy, aSO, myYACS, YACSName);
+  SALOMEDS::SObject_var aResultSO=PublishInStudy(myCurrentStudy, aSO, myYACS, nomYACS);
+
+  PublishCaseUnderYACS(nomYACS, nomCas);
 
   // D. Caracterisation
   myYACS->SetDirName( DirName ) ;
@@ -3620,6 +3657,26 @@ HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::CreateYACSSchema (const char* YACSName, co
 //=============================================================================
 // Ecriture d'un schema YACS
 //=============================================================================
+CORBA::Long HOMARD_Gen_i::YACSWrite(const char* nomYACS)
+{
+  INFOS ( "YACSWrite : Ecriture de " << nomYACS );
+// Le repertoire du cas
+  HOMARD::HOMARD_YACS_var myYACS = myContextMap[GetCurrentStudyID()]._mesYACSs[nomYACS];
+  ASSERT(!CORBA::is_nil(myYACS));
+  std::string casename = myYACS->GetCaseName() ;
+  HOMARD::HOMARD_Cas_ptr caseyacs = GetCase(casename.c_str()) ;
+  std::string dirnamecase = caseyacs->GetDirName() ;
+// Le nom par defaut du fichier du schema
+  std::string YACSFile ;
+  YACSFile = dirnamecase + "/schema.xml" ;
+
+  int codret = YACSWriteOnFile(nomYACS, YACSFile.c_str()) ;
+
+  return codret ;
+}
+//=============================================================================
+// Ecriture d'un schema YACS
+//=============================================================================
 CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* YACSFile)
 {
   INFOS ( "YACSWriteOnFile : Ecriture de " << nomYACS << " sur " << YACSFile );
@@ -3651,6 +3708,8 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* YACSF
   HOMARD::HOMARD_Iteration_var Iter0 = myCase->GetIter0() ;
   std::string Iter0Name = myCase->GetIter0Name() ;
   MESSAGE (". Iter0Name = " << Iter0Name);
+  std::string MeshName = Iter0->GetMeshName();
+  MESSAGE (". MeshName = " << MeshName);
   // D.2. L'iteration numero 1
   HOMARD::listeIterFilles* maListe = Iter0->GetIterations();
   int numberOfIter = maListe->length();
@@ -3690,7 +3749,15 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* YACSF
   // HOMARD_ROOT_DIR : repertoire ou se trouve le module HOMARD
   std::string YACSFile_base ;
   if ( getenv("HOMARD_ROOT_DIR") != NULL ) { YACSFile_base = getenv("HOMARD_ROOT_DIR") ; }
-  else                                     { ASSERT("HOMARD_ROOT_DIR est inconnu." == 0) ; }
+  else
+  {
+    SALOME::ExceptionStruct es ;
+    es.type = SALOME::BAD_PARAM;
+    std::string text = "HOMARD_ROOT_DIR est inconnu." ;
+    es.text = CORBA::string_dup(text.c_str());
+    throw SALOME::SALOME_Exception(es);
+    return 0;
+  }
   YACSFile_base += "/share/salome/resources/homard/yacs_01.xml" ;
   MESSAGE("YACSFile_base ="<<YACSFile_base);
 
@@ -3709,48 +3776,39 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* YACSF
       ligne_bis >> mot_cle ;
       // G.1.2. Le maillage initial
       if ( mot_cle == "DataInit_MeshFile" )
-      {
-        myDriver->Texte_DataInit_MeshFile(MeshFile);
-      }
+      { myDriver->Texte_DataInit_MeshFile(MeshFile); }
       // G.1.3. Le script de lancement
       else if ( mot_cle == "Alternance_Calcul_HOMARD_Calcul" )
-      {
-        myDriver->Texte_Alternance_Calcul_HOMARD_Calcul(ScriptFile);
-      }
+      { myDriver->Texte_Alternance_Calcul_HOMARD_Calcul(ScriptFile); }
       // G.1.4. Les options du cas
-      else if ( mot_cle == "HOMARD_Init_au_debut_Case_Options" )
-      {
-        myDriver->Texte_HOMARD_Init_au_debut_Case_Options(pythonCas);
-      }
+      else if ( mot_cle == "Iter_1_Case_Options" )
+      { myDriver->Texte_Iter_1_Case_Options(pythonCas); }
       // G.1.5. Execution de HOMARD : le repertoire du cas
       else if ( mot_cle == "HOMARD_Exec_DirName" )
+      { myDriver->Texte_HOMARD_Exec_DirName(); }
+      // G.1.6. Execution de HOMARD : le nom du maillage
+      else if ( mot_cle == "HOMARD_Exec_MeshName" )
       {
-        myDriver->Texte_HOMARD_Exec_DirName();
+        myDriver->Texte_HOMARD_Exec_MeshName(MeshName);
+        std::string node = "Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase" ;
+        myDriver->TexteParametre( node, "MeshName", "string", MeshName ) ;
       }
-      // G.1.6. Execution de HOMARD : les options de l'hypothese
+      // G.1.7. Execution de HOMARD : les options de l'hypothese
       else if ( mot_cle == "HOMARD_Exec_Hypo_Options" )
+      { myDriver->Texte_python( pythonHypo, 3, "Hypo" ) ;  }
+      // G.1.8. Zones et frontieres : les creations
+      else if ( mot_cle == "Iter_1" )
       {
-        myDriver->Texte_python( pythonHypo, 3, "Hypo" ) ;
-      }
-      // G.1.7. Zones et frontieres : les creations
-      else if ( mot_cle == "HOMARD_Init_au_debut" )
-      {
-        std::string texte_control = myDriver->Texte_HOMARD_Init_au_debut_control() ;
+        std::string texte_control = myDriver->Texte_Iter_1_control() ;
         if ( TypeAdap == 0 ) { texte_control += YACSDriverTexteZone( myHypo, myDriver ) ; }
         texte_control += YACSDriverTexteBoundary( myCase, myDriver ) ;
         myDriver->TexteAdd(texte_control);
       }
-      // G.1.8. Zones : les parametres
+      // G.1.9. Les parametres
       else if ( mot_cle == "PARAMETRES" )
-      {
-        if ( TypeAdap == 0 )
-        { myDriver->TexteAddParametres(); }
-      }
+      { myDriver->TexteAddParametres(); }
       // G.1.n. La ligne est recopiee telle quelle
-      else
-      {
-        myDriver->TexteAdd(ligne);
-      }
+      else { myDriver->TexteAdd(ligne);  }
     }
     // G.2. Ecriture du texte dans le fichier
     if ( codret == 0 )
@@ -3767,6 +3825,11 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* YACSF
 
   delete myDriver;
 
+  // H. Publication du fichier dans l'arbre
+
+    std::string Commentaire = "xml" ;
+    PublishFileUnderYACS(nomYACS, YACSFile, Commentaire.c_str());
+
   return codret ;
 }
 //=============================================================================
@@ -3807,7 +3870,7 @@ std::string HOMARD_Gen_i::YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHy
     int ZoneType = myZone->GetType();
     MESSAGE ( "... ZoneType = " << ZoneType);
     std::string texte_control_0 ;
-    texte_control_0 = myDriver->Texte_HOMARD_Init_au_debut_Zone(ZoneType, pythonStructure, methode, ZoneName );
+    texte_control_0 = myDriver->Texte_Iter_1_Zone(ZoneType, pythonStructure, methode, ZoneName );
     texte_control += texte_control_0 ;
     // 5. Decalage
     iaux += 1 ;
@@ -3866,7 +3929,7 @@ std::string HOMARD_Gen_i::YACSDriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase,
       int BoundaryType = myBoundary->GetType();
       MESSAGE ( "... BoundaryType = " << BoundaryType);
       std::string texte_control_0 ;
-      texte_control_0 = myDriver->Texte_HOMARD_Init_au_debut_Boundary(BoundaryType, pythonStructure, methode, BoundaryName );
+      texte_control_0 = myDriver->Texte_Iter_1_Boundary(BoundaryType, pythonStructure, methode, BoundaryName );
       texte_control += texte_control_0 ;
       // 5. Memorisation du traitement
       ListeBoundaryTraitees.push_back( BoundaryName );
@@ -4347,8 +4410,8 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
    for ( it_zone  = myContextMap[GetCurrentStudyID()]._mesZones.begin();
          it_zone != myContextMap[GetCurrentStudyID()]._mesZones.end(); ++it_zone)
    {
-    HOMARD::HOMARD_Zone_var maZone = (*it_zone).second;
-    CORBA::String_var dumpCorbaZone = maZone->GetDumpPython();
+    HOMARD::HOMARD_Zone_var myZone = (*it_zone).second;
+    CORBA::String_var dumpCorbaZone = myZone->GetDumpPython();
     std::string dumpZone = dumpCorbaZone.in();
     MESSAGE (dumpZone<<"\n");
     aScript += dumpZone;
@@ -4424,6 +4487,24 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
     aScript += dumpIter;
    }
 
+
+   if (myContextMap[GetCurrentStudyID()]._mesYACSs.size() > 0)
+   {
+    MESSAGE (". Ecritures des schemas YACS");
+    aScript += "#\n# Creation of the schemas YACS";
+    aScript +=  "\n# ============================";
+   }
+   std::map<std::string, HOMARD::HOMARD_YACS_var>::const_iterator it_yacs;
+   for ( it_yacs  = myContextMap[GetCurrentStudyID()]._mesYACSs.begin();
+         it_yacs != myContextMap[GetCurrentStudyID()]._mesYACSs.end(); ++it_yacs)
+   {
+    HOMARD::HOMARD_YACS_var myYACS = (*it_yacs).second;
+    CORBA::String_var dumpCorbaYACS = myYACS->GetDumpPython();
+    std::string dumpYACS = dumpCorbaYACS.in();
+    MESSAGE (dumpYACS<<"\n");
+    aScript += dumpYACS;
+   }
+
   MESSAGE (". Ecritures finales");
   if( isMultiFile )
     aScript += "\n\tpass";
index 1af594b5efedbe1676718736d07b496500e628e7..66efe93f23d59f2f5ab860272b3902d3eee45067 100644 (file)
@@ -179,14 +179,16 @@ public:
 
   CORBA::Boolean                  VerifieDir(const char* nomDir);
 
-  void                            PublishFileUnderIteration(const char* NomIter, const char* NomFich,
-                                                            const char* Commentaire);
+  void                            PublishFileUnderIteration(const char* NomIter, const char* NomFich, const char* Commentaire);
+  void                            PublishFileUnderYACS(const char* NomYACS, const char* NomFich, const char* Commentaire);
   void                            PublishBoundaryUnderCase(const char* CaseName, const char* BoundaryName);
+  void                            PublishCaseUnderYACS(const char* YACSName, const char* CaseName);
   void                            PublishResultInSmesh(const char* NomFich, CORBA::Long Option);
   void                            DeleteResultInSmesh(std::string NomFich, std::string MeshName);
 
 // YACS
   HOMARD::HOMARD_YACS_ptr         CreateYACSSchema (const char* YACSName, const char* nomCas, const char* ScriptFile, const char* DirName, const char* MeshFile);
+  CORBA::Long                     YACSWrite(const char* nomYACS);
   CORBA::Long                     YACSWriteOnFile(const char* nomYACS, const char* YACSFile);
   std::string                     YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, YACSDriver* myDriver);
   std::string                     YACSDriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, YACSDriver* myDriver);
@@ -266,7 +268,7 @@ private:
                                                      HOMARD::HOMARD_Zone_ptr theObject, const char* theName);
   virtual void                    PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder,
                                                      SALOMEDS::SObject_var aResultSO,
-                                                     const char* theName, const char* value, const char* icone, const char* ior);
+                                                     const char* theName, const char* comment, const char* icone, const char* ior);
 
   PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject);
 
index b5928a7a468b26561b0b9e07e975ee0a20557dad..2e1971153c123a78043d7b0e10d4f529a3ecd660 100644 (file)
@@ -178,17 +178,9 @@ char* HOMARD_YACS_i::GetCaseName()
 CORBA::Long HOMARD_YACS_i::Write()
 {
   MESSAGE ( "Write : ecriture du schema");
-  ASSERT( myHomardYACS );
-//
-// Le repertoire du cas
-  std::string casename = GetCaseName() ;
-  HOMARD::HOMARD_Cas_ptr caseyacs = _gen_i->GetCase(casename.c_str()) ;
-  std::string dirnamecase = caseyacs->GetDirName() ;
-// Le nom par defaut du fichier du schema
-  std::string YACSFile ;
-  YACSFile = dirnamecase + "/schema.xml" ;
 //
-  return WriteOnFile(YACSFile.c_str()) ;
+  char* nomYACS = GetName() ;
+  return _gen_i->YACSWrite(nomYACS) ;
 }
 //=============================================================================
 CORBA::Long HOMARD_YACS_i::WriteOnFile( const char* YACSFile )