Here is the description of a scheme for a computation in which a value is to be stabilized. The computation starts over an initial mesh, then HOMARD makes an adaptation. A new computation is done over this new mesh and its result is analyzed. Depending on this analysis, the coupling goes on or does not. The general look of the scheme is this one:
-.. image:: ../images/yacs_01.png
+.. image:: ./images/yacs_01.png
:align: center
- :alt: yacs - allure générale
- :width: 512
- :height: 306
+ :alt: yacs - global view
+ :width: 530
+ :height: 281
.. 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.
The main boxes are:
- DataInit : initialisation of the initial mesh
-- Etude_Initialisation : launching of the module HOMARD inside SALOME
-- Boucle_de_convergence : gestion of the loop computation/adaptation
-- Bilan : final information
+- Study_Initialisation : launching of the module HOMARD inside SALOME
+- Convergence_Loop : gestion of the loop computation/adaptation
+- Results : final information
DataInit
========
-.. image:: ../images/yacs_a_01.png
+.. image:: ./images/yacs_a_01.png
:align: center
:alt: DataInit
:width: 158
This box is type PresetNode's elementary node. Its only function is to initialize the variable MeshFile that contains the name of the file of the initial mesh.
.. literalinclude:: ../files/yacs_01.en.xml
- :lines: 38-42
+ :lines: 37-41
-Etude_Initialisation
+Study_Initialisation
====================
-The box Etude_Initialisation launches the component HOMARD inside SALOME. It is a block consisted of two parts, that are invariable whatever is the envisaged application:
+The box Study_Initialisation launches the component HOMARD inside SALOME. It is a block consisted of two parts, that are invariable whatever is the envisaged application:
- StudyCreation : python node
- UpdateStudy : service of the component HOMARD
-.. image:: ../images/yacs_b_01.png
+.. image:: ./images/yacs_b_01.png
:align: center
- :alt: Etude_Initialisation
- :width: 323
- :height: 97
+ :alt: Study_Initialisation
+ :width: 322
+ :height: 69
The python node StudyCreation initialize the SALOME study that is given through the output:
.. literalinclude:: ../files/yacs_01.en.xml
- :lines: 44-62
+ :lines: 43-59
The service UpdateStudy connects this study to an instance of HOMARD.
.. literalinclude:: ../files/yacs_01.en.xml
- :lines: 63-68
+ :lines: 60-64
-Boucle_de_convergence
+Convergence_Loop
=====================
-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.
+The box Convergence_Loop is type WhileLoop. The condition is initialized with 1: the internal block Alternation_Computation_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 to 0. The loop ends and we pass in the following box, Results.
-.. image:: ../images/yacs_c_01.png
+.. image:: ./images/yacs_c_01.png
:align: center
:alt: Boucle
- :width: 163
- :height: 93
+ :width: 192
+ :height: 141
-Bilan
-=====
-.. image:: ../images/yacs_d_01.png
+Results
+=======
+.. image:: ./images/yacs_d_01.png
:align: center
- :alt: Bilan
- :width: 158
- :height: 63
+ :alt: Results
+ :width: 157
+ :height: 62
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.en.xml
- :lines: 406-419
+ :lines: 398-411
Loop for the calculations
*************************
-.. image:: ../images/yacs_c_02.png
+.. image:: ./images/yacs_c_02.png
:align: center
:alt: Boucle
- :width: 338
- :height: 152
+ :width: 505
+ :height: 114
This box is a block that manages the computation, the adaptation and the analysis.
-Calcul
-======
-.. image:: ../images/yacs_c_03.png
+Computation
+===========
+.. image:: ./images/yacs_c_03.png
:align: center
- :alt: Calcul
- :width: 155
- :height: 87
+ :alt: Computation
+ :width: 158
+ :height: 90
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.en.xml
- :lines: 77-103
+ :lines: 70-90
In this example, we must define:
Adaptation
==========
-.. image:: ../images/yacs_c_04.png
+.. image:: ./images/yacs_c_04.png
:align: center
:alt: Adaptation
- :width: 661
- :height: 566
+ :width: 667
+ :height: 568
-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.
+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 Loop_Stop.
Adaptation_HOMARD
-----------------
Iter_1
^^^^^^
-.. image:: ../images/yacs_c_06.png
+.. image:: ./images/yacs_c_06.png
:align: center
:alt: Iter_1
:width: 481
This box begins by creating the case HOMARD by calling the CreateCase service.
.. literalinclude:: ../files/yacs_01.en.xml
- :lines: 208-215
+ :lines: 200-207
-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.
+The name of the case CaseName is imposed on "Computation". 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.en.xml
- :lines: 443-446
+ :lines: 435-438
.. literalinclude:: ../files/yacs_01.en.xml
- :lines: 483-486
+ :lines: 475-478
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 :doc:`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.en.xml
- :lines: 216-228
+ :lines: 208-220
Finally, a hypothesis is created by calling the CreateHypothese service. The parameter of output is an instance of hypothese.
^^^^^^^^^^^
Once initialized, the adaptation can be calculated. It is the goal of the Homard_Exec box, in the form of a script python.
-.. image:: ../images/yacs_c_09.png
+.. image:: ./images/yacs_c_09.png
:align: center
:alt: Homard_Exec
:width: 153
The directory of calculation is recovered. The name of the mesh is given.
.. literalinclude:: ../files/yacs_01.en.xml
- :lines: 245-250
+ :lines: 237-242
../..
.. literalinclude:: ../files/yacs_01.en.xml
- :lines: 325-333
+ :lines: 317-325
The hypothesis transmitted in input parameter characterized (look :doc:`tui_create_hypothese`) :
.. literalinclude:: ../files/yacs_01.en.xml
- :lines: 254-278
+ :lines: 246-270
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.en.xml
- :lines: 280-290
+ :lines: 272-282
The iteration is supplemented : hypothesis, future mesh, field (look :doc:`tui_create_iteration`) :
.. literalinclude:: ../files/yacs_01.en.xml
- :lines: 292-311
+ :lines: 284-303
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.en.xml
- :lines: 313-324
+ :lines: 305-316
After this execution, the process leaves the Adaptation_HOMARD node, then Adaptation node. One arrives then at the node of analysis.
Iter_n
^^^^^^
-.. image:: ../images/yacs_c_07.png
+.. image:: ./images/yacs_c_07.png
:align: center
:alt: Iter_n
:width: 323
One passes then in the Homard_Exec node to calculate the new mesh.
-Arret_boucle
-------------
-.. image:: ../images/yacs_c_08.png
+Loop_Stop
+---------
+.. image:: ./images/yacs_c_08.png
:align: center
- :alt: Arret_boucle
- :width: 163
- :height: 152
+ :alt: Loop_Stop
+ :width: 161
+ :height: 151
-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:
+The Loop_Stop 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.en.xml
- :lines: 173-184
+ :lines: 165-176
-Analyse
-=======
-.. image:: ../images/yacs_c_05.png
+Analysis
+========
+.. image:: ./images/yacs_c_05.png
:align: center
- :alt: Analyse
- :width: 156
- :height: 139
+ :alt: Analysis
+ :width: 158
+ :height: 143
-The Analyse block is a script python which ensures the complete control of the process by examining the causes of possible error successively.
+The Analysis 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.en.xml
- :lines: 104-116
+ :lines: 96-108
../..
.. literalinclude:: ../files/yacs_01.en.xml
- :lines: 162-170
+ :lines: 154-162
One starts by analyzing the return of the computer code:
.. literalinclude:: ../files/yacs_01.en.xml
- :lines: 118-123
+ :lines: 110-115
Checking of the presence of the name of the result file in the dictionary of the results:
.. literalinclude:: ../files/yacs_01.en.xml
- :lines: 125-132
+ :lines: 117-124
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.en.xml
- :lines: 134-152
+ :lines: 126-146
Lastly, it is checked that a maximum nomber of adaptations is not exceeded:
.. literalinclude:: ../files/yacs_01.en.xml
- :lines: 154-159
+ :lines: 146-151
Use this scheme
</container>
<datanode name="DataInit">
<parameter name="MeshFile" type="string">
- <value><string>/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/maill.00.med</string></value>
+ <value><string>/home/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/maill.00.med</string></value>
</parameter>
</datanode>
- <bloc name="Etude_Initialisation">
+ <bloc name="Study_Initialisation">
<inline name="StudyCreation">
<script><code><![CDATA[
import orbmodule
clt = orbmodule.client()
CurrentStudy = clt.Resolve("/Study")
]]></code></script>
- <outport name="CurrentStudy" type="Study"/>
</inline>
<service name="UpdateStudy">
<component>HOMARD</component>
</service>
<control> <fromnode>StudyCreation</fromnode> <tonode>UpdateStudy</tonode> </control>
</bloc>
- <while name="Boucle_de_convergence">
- <bloc name="Alternance_Calcul_HOMARD">
- <inline name="Calcul">
+ <while name="Convergence_Loop">
+ <bloc name="Alternation_Computation_HOMARD">
+ <inline name="Computation">
<script><code><![CDATA[
import sys
import os
#
-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")
+rep_calc = "/home/D68518/HOMARD_SVN/trunk/training/tet_aster_ther"
+rep_script = os.path.dirname("/home/D68518/HOMARD_SVN/trunk/training/script")
sys.path.append(rep_script)
from ScriptAster import Script
#
#
Script_A = Script(argu)
#
-Error, message_erreur, dico_resu = Script_A.compute ()
+Error, message_erreur, dict_resu = Script_A.compute ()
#
-dico_resu["rep_calc"] = rep_calc
+dict_resu["rep_calc"] = rep_calc
#
]]></code></script>
<inport name="numCalc" type="int"/>
<inport name="MeshFile" type="string"/>
<outport name="Error" type="int"/>
- <outport name="dico_resu" type="pyobj"/>
+ <outport name="dict_resu" type="pyobj"/>
</inline>
- <inline name="Analyse">
+ <inline name="Analysis">
<script><code><![CDATA[
global NumCalc
global resu1
#
# If the file is not defined, stop:
#
- if ( "FileName" in dico_resu ) :
- FileName = dico_resu["FileName"]
+ if ( "FileName" in dict_resu ) :
+ FileName = dict_resu["FileName"]
else :
MessInfo = "The file for the mesh is not defined."
Error = -2
#
# If the criterion is satisfied, stop:
#
- if ( "V_TEST" in dico_resu ) :
- valeur_v = dico_resu["V_TEST"]
+ if ( "V_TEST" in dict_resu ) :
+ valeur_v = dict_resu["V_TEST"]
if NumCalc == 0 :
resu1 = [valeur_v]
else :
]]></code></script>
<inport name="NumCalc" type="int"/>
<inport name="ErrCalc" type="int"/>
- <inport name="dico_resu" type="pyobj"/>
+ <inport name="dict_resu" type="pyobj"/>
<outport name="Error" type="int"/>
<outport name="NumCalcP1" type="int"/>
<outport name="FileName" type="string"/>
</inline>
<switch name="Adaptation" select="0">
<default>
- <bloc name="Arret_boucle">
+ <bloc name="Loop_Stop">
<inline name="Arret">
<script><code><![CDATA[
OK = 0
<default>
<bloc name="Iter_n">
<service name="LastIteration">
- <node>Etude_Initialisation.UpdateStudy</node>
+ <node>Study_Initialisation.UpdateStudy</node>
<method>LastIteration</method>
<inport name="CaseName" type="string"/>
<outport name="return" type="HOMARD_Iteration"/>
</service>
<service name="GetHypothesis">
- <node>Etude_Initialisation.UpdateStudy</node>
+ <node>Study_Initialisation.UpdateStudy</node>
<method>GetHypothesis</method>
<inport name="HypoName" type="string"/>
<outport name="return" type="HOMARD_Hypothesis"/>
<case id="1">
<bloc name="Iter_1">
<service name="CreateCase">
- <node>Etude_Initialisation.UpdateStudy</node>
+ <node>Study_Initialisation.UpdateStudy</node>
<method>CreateCase</method>
<inport name="CaseName" type="string"/>
<inport name="MeshName" type="string"/>
<script><code><![CDATA[
import os
# Directory for the adaptation
-DirName = "/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/HOMARD"
+DirName = "/home/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/HOMARD"
Case.SetDirName(DirName)
Case.SetConfType(1)
# Associated iteration #0
<outport name="Iter0" type="HOMARD_Iteration"/>
</inline>
<service name="CreateHypothesis">
- <node>Etude_Initialisation.UpdateStudy</node>
+ <node>Study_Initialisation.UpdateStudy</node>
<method>CreateHypothesis</method>
<inport name="HypoName" type="string"/>
<outport name="return" type="HOMARD_Hypothesis"/>
Iter.SetMeshFile(MeshFile)
#
# . The file for the fields
-FileName = dico_resu["FileName"]
+FileName = dict_resu["FileName"]
Iter.SetFieldFile(FileName)
#
-# Calculation
+# Computationation
# ===========
Error = Iter.Compute(1,1)
#
<inport name="NumAdapt" type="int"/>
<inport name="LastIter" type="HOMARD_Iteration"/>
<inport name="Hypo" type="HOMARD_Hypothesis"/>
- <inport name="dico_resu" type="pyobj"/>
+ <inport name="dict_resu" type="pyobj"/>
<outport name="OK" type="bool"/>
<outport name="MessInfo" type="string"/>
<outport name="MeshFile" type="string"/>
</bloc>
</case>
</switch>
- <control> <fromnode>Calcul</fromnode> <tonode>Analyse</tonode> </control>
- <control> <fromnode>Analyse</fromnode> <tonode>Adaptation</tonode> </control>
+ <control> <fromnode>Computation</fromnode> <tonode>Analysis</tonode> </control>
+ <control> <fromnode>Analysis</fromnode> <tonode>Adaptation</tonode> </control>
<datalink control="false">
- <fromnode>Analyse</fromnode> <fromport>Error</fromport>
+ <fromnode>Analysis</fromnode> <fromport>Error</fromport>
<tonode>Adaptation</tonode> <toport>select</toport>
</datalink>
<datalink control="false">
- <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
- <tonode>Calcul</tonode> <toport>numCalc</toport>
+ <fromnode>Analysis</fromnode> <fromport>NumCalcP1</fromport>
+ <tonode>Computation</tonode> <toport>numCalc</toport>
</datalink>
<datalink control="false">
- <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
+ <fromnode>Analysis</fromnode> <fromport>NumCalcP1</fromport>
<tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode> <toport>select</toport>
</datalink>
<datalink control="false">
- <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
+ <fromnode>Analysis</fromnode> <fromport>NumCalcP1</fromport>
<tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>NumAdapt</toport>
</datalink>
<datalink control="false">
- <fromnode>Analyse</fromnode> <fromport>FileName</fromport>
+ <fromnode>Analysis</fromnode> <fromport>FileName</fromport>
<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>
- <tonode>Adaptation.default_Arret_boucle.Arret</tonode> <toport>MessInfo</toport>
+ <fromnode>Analysis</fromnode> <fromport>MessInfo</fromport>
+ <tonode>Adaptation.default_Loop_Stop.Arret</tonode> <toport>MessInfo</toport>
</datalink>
<datalink control="false">
- <fromnode>Calcul</fromnode> <fromport>Error</fromport>
- <tonode>Analyse</tonode> <toport>ErrCalc</toport>
+ <fromnode>Computation</fromnode> <fromport>Error</fromport>
+ <tonode>Analysis</tonode> <toport>ErrCalc</toport>
</datalink>
<datalink control="false">
- <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
- <tonode>Analyse</tonode> <toport>dico_resu</toport>
+ <fromnode>Computation</fromnode> <fromport>dict_resu</fromport>
+ <tonode>Analysis</tonode> <toport>dict_resu</toport>
</datalink>
<datalink control="false">
- <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
- <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>dico_resu</toport>
+ <fromnode>Computation</fromnode> <fromport>dict_resu</fromport>
+ <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>dict_resu</toport>
</datalink>
<datalink control="false">
- <fromnode>Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MeshFile</fromport>
- <tonode>Calcul</tonode> <toport>MeshFile</toport>
+ <fromnode>Adaptation.default_Loop_Stop.Arret</fromnode> <fromport>MeshFile</fromport>
+ <tonode>Computation</tonode> <toport>MeshFile</toport>
</datalink>
<datalink control="false">
<fromnode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MeshFile</fromport>
- <tonode>Calcul</tonode> <toport>MeshFile</toport>
+ <tonode>Computation</tonode> <toport>MeshFile</toport>
</datalink>
</bloc>
<datalink control="false">
- <fromnode>Alternance_Calcul_HOMARD.Analyse</fromnode> <fromport>NumCalcP1</fromport>
- <tonode>Alternance_Calcul_HOMARD.Analyse</tonode> <toport>NumCalc</toport>
+ <fromnode>Alternation_Computation_HOMARD.Analysis</fromnode> <fromport>NumCalcP1</fromport>
+ <tonode>Alternation_Computation_HOMARD.Analysis</tonode> <toport>NumCalc</toport>
</datalink>
</while>
- <inline name="Bilan">
+ <inline name="Results">
<script><code><![CDATA[
-from PyQt4 import QtGui
+from PyQt5 import QtWidgets
import sys
-app = QtGui.QApplication(sys.argv)
-MessageBoxTitle = "Bilan"
+app = QtWidgets.QApplication(sys.argv)
+MessageBoxTitle = "Results"
if MessInfo == "" :
MessInfo = "The convergence is reached."
- QtGui.QMessageBox.information(None, MessageBoxTitle, MessInfo)
+ QtWidgets.QMessageBox.information(None, MessageBoxTitle, MessInfo)
else :
- QtGui.QMessageBox.critical(None, MessageBoxTitle, MessInfo)
+ QtWidgets.QMessageBox.critical(None, MessageBoxTitle, MessInfo)
]]></code></script>
<inport name="MessInfo" type="string"/>
</inline>
- <control> <fromnode>DataInit</fromnode> <tonode>Etude_Initialisation</tonode> </control>
- <control> <fromnode>Etude_Initialisation</fromnode> <tonode>Boucle_de_convergence</tonode> </control>
- <control> <fromnode>Boucle_de_convergence</fromnode> <tonode>Bilan</tonode> </control>
+ <control> <fromnode>DataInit</fromnode> <tonode>Study_Initialisation</tonode> </control>
+ <control> <fromnode>Study_Initialisation</fromnode> <tonode>Convergence_Loop</tonode> </control>
+ <control> <fromnode>Convergence_Loop</fromnode> <tonode>Results</tonode> </control>
<datalink control="false">
<fromnode>DataInit</fromnode> <fromport>MeshFile</fromport>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode> <toport>MeshFile</toport>
+ <tonode>Convergence_Loop.Alternation_Computation_HOMARD.Computation</tonode> <toport>MeshFile</toport>
</datalink>
<datalink control="false">
- <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>OK</fromport>
- <tonode>Boucle_de_convergence</tonode> <toport>condition</toport>
+ <fromnode>Convergence_Loop.Alternation_Computation_HOMARD.Adaptation.default_Loop_Stop.Arret</fromnode> <fromport>OK</fromport>
+ <tonode>Convergence_Loop</tonode> <toport>condition</toport>
</datalink>
<datalink control="false">
- <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>
+ <fromnode>Convergence_Loop.Alternation_Computation_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>OK</fromport>
+ <tonode>Convergence_Loop</tonode> <toport>condition</toport>
</datalink>
<datalink control="false">
- <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MessInfo</fromport>
- <tonode>Bilan</tonode> <toport>MessInfo</toport>
+ <fromnode>Convergence_Loop.Alternation_Computation_HOMARD.Adaptation.default_Loop_Stop.Arret</fromnode> <fromport>MessInfo</fromport>
+ <tonode>Results</tonode> <toport>MessInfo</toport>
</datalink>
<datalink control="false">
- <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MessInfo</fromport>
- <tonode>Bilan</tonode> <toport>MessInfo</toport>
+ <fromnode>Convergence_Loop.Alternation_Computation_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MessInfo</fromport>
+ <tonode>Results</tonode> <toport>MessInfo</toport>
</datalink>
<parameter>
- <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>
+ <tonode>Convergence_Loop.Alternation_Computation_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode><toport>CaseName</toport>
+ <value><string>Computation</string></value>
</parameter>
<parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode><toport>numCalc</toport>
+ <tonode>Convergence_Loop.Alternation_Computation_HOMARD.Computation</tonode><toport>numCalc</toport>
<value><int>0</int></value>
</parameter>
<parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation</tonode><toport>select</toport>
+ <tonode>Convergence_Loop.Alternation_Computation_HOMARD.Adaptation</tonode><toport>select</toport>
<value><int>0</int></value>
</parameter>
<parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode><toport>select</toport>
+ <tonode>Convergence_Loop.Alternation_Computation_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode><toport>select</toport>
<value><int>0</int></value>
</parameter>
<parameter>
- <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>
+ <tonode>Convergence_Loop.Alternation_Computation_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.LastIteration</tonode><toport>CaseName</toport>
+ <value><string>Computation</string></value>
</parameter>
<parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.GetHypothesis</tonode><toport>HypoName</toport>
+ <tonode>Convergence_Loop.Alternation_Computation_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.GetHypothesis</tonode><toport>HypoName</toport>
<value><string>Hypo</string></value>
</parameter>
<parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</tonode><toport>HypoName</toport>
+ <tonode>Convergence_Loop.Alternation_Computation_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</tonode><toport>HypoName</toport>
<value><string>Hypo</string></value>
</parameter>
<parameter>
- <tonode>Boucle_de_convergence</tonode><toport>condition</toport>
+ <tonode>Convergence_Loop</tonode><toport>condition</toport>
<value><boolean>true</boolean></value>
</parameter>
<parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>NumCalc</toport>
+ <tonode>Convergence_Loop.Alternation_Computation_HOMARD.Analysis</tonode><toport>NumCalc</toport>
<value><int>0</int></value>
</parameter>
<parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>ErrCalc</toport>
+ <tonode>Convergence_Loop.Alternation_Computation_HOMARD.Analysis</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>
+ <tonode>Convergence_Loop.Alternation_Computation_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="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.UpdateStudy" 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"/>
+ <presentation name="Study_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="Study_Initialisation.StudyCreation" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Study_Initialisation.UpdateStudy" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Convergence_Loop" x="4" y="103" width="569" height="514" expanded="1" expx="4" expy="103" expWidth="569" expHeight="514" shownState="0"/>
+ <presentation name="Convergence_Loop.Alternation_Computation_HOMARD" x="4" y="59" width="561" height="451" expanded="1" expx="10" expy="59" expWidth="561" expHeight="451" shownState="0"/>
+ <presentation name="Convergence_Loop.Alternation_Computation_HOMARD.Computation" x="4" y="32" width="158" height="90" expanded="1" expx="4" expy="32" expWidth="158" expHeight="90" shownState="0"/>
+ <presentation name="Convergence_Loop.Alternation_Computation_HOMARD.Analysis" x="181" y="32" width="158" height="171" expanded="1" expx="181" expy="32" expWidth="158" expHeight="171" shownState="0"/>
+ <presentation name="Convergence_Loop.Alternation_Computation_HOMARD.Adaptation" x="4" y="204" width="553" height="243" expanded="1" expx="4" expy="204" expWidth="553" expHeight="243" shownState="0"/>
+ <presentation name="Convergence_Loop.Alternation_Computation_HOMARD.Adaptation.default_Loop_Stop" x="4" y="59" width="166" height="153" expanded="1" expx="4" expy="59" expWidth="166" expHeight="153" shownState="0"/>
+ <presentation name="Convergence_Loop.Alternation_Computation_HOMARD.Adaptation.default_Loop_Stop.Arret" x="4" y="32" width="158" height="117" expanded="1" expx="4" expy="32" expWidth="158" expHeight="117" shownState="0"/>
+ <presentation name="Convergence_Loop.Alternation_Computation_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="Convergence_Loop.Alternation_Computation_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="Convergence_Loop.Alternation_Computation_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="Convergence_Loop.Alternation_Computation_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="Convergence_Loop.Alternation_Computation_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="Convergence_Loop.Alternation_Computation_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="Convergence_Loop.Alternation_Computation_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="Convergence_Loop.Alternation_Computation_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="Convergence_Loop.Alternation_Computation_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="Convergence_Loop.Alternation_Computation_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="Results" x="350" y="32" width="158" height="63" expanded="1" expx="350" expy="32" expWidth="158" expHeight="63" shownState="0"/>
</proc>
</container>
<datanode name="DataInit">
<parameter name="MeshFile" type="string">
- <value><string>/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/maill.00.med</string></value>
+ <value><string>/home/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/maill.00.med</string></value>
</parameter>
</datanode>
<bloc name="Etude_Initialisation">
clt = orbmodule.client()
CurrentStudy = clt.Resolve("/Study")
]]></code></script>
- <outport name="CurrentStudy" type="Study"/>
</inline>
<service name="UpdateStudy">
<component>HOMARD</component>
import sys
import os
#
-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")
+rep_calc = "/home/D68518/HOMARD_SVN/trunk/training/tet_aster_ther"
+rep_script = os.path.dirname("/home/D68518/HOMARD_SVN/trunk/training/script")
sys.path.append(rep_script)
from ScriptAster import Script
#
#
Script_A = Script(argu)
#
-Error, message_erreur, dico_resu = Script_A.compute ()
+Error, message_erreur, dict_resu = Script_A.compute ()
#
-dico_resu["rep_calc"] = rep_calc
+dict_resu["rep_calc"] = rep_calc
#
]]></code></script>
<inport name="numCalc" type="int"/>
<inport name="MeshFile" type="string"/>
<outport name="Error" type="int"/>
- <outport name="dico_resu" type="pyobj"/>
+ <outport name="dict_resu" type="pyobj"/>
</inline>
<inline name="Analyse">
<script><code><![CDATA[
#
# Si le fichier n'a pas ete defini, on arrete :
#
- if ( "FileName" in dico_resu ) :
- FileName = dico_resu["FileName"]
+ if ( "FileName" in dict_resu ) :
+ FileName = dict_resu["FileName"]
else :
MessInfo = "Le fichier du maillage n'a pas ete defini"
Error = -2
#
# Si le critere est respecte, on arrete :
#
- if ( "V_TEST" in dico_resu ) :
- valeur_v = dico_resu["V_TEST"]
+ if ( "V_TEST" in dict_resu ) :
+ valeur_v = dict_resu["V_TEST"]
if NumCalc == 0 :
resu1 = [valeur_v]
else :
]]></code></script>
<inport name="NumCalc" type="int"/>
<inport name="ErrCalc" type="int"/>
- <inport name="dico_resu" type="pyobj"/>
+ <inport name="dict_resu" type="pyobj"/>
<outport name="Error" type="int"/>
<outport name="NumCalcP1" type="int"/>
<outport name="FileName" type="string"/>
<script><code><![CDATA[
import os
# Repertoire d'adaptation
-DirName = "/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/HOMARD"
+DirName = "/home/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/HOMARD"
Case.SetDirName(DirName)
Case.SetConfType(1)
# Iteration 0 associee
<script><code><![CDATA[
import os
# Repertoire d'execution
-DirName = "/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther"
+DirName = "/home/D68518/HOMARD_SVN/trunk/training/tet_aster_ther"
MeshName = "BOX"
#
# Hypothese
Iter.SetMeshFile(MeshFile)
#
# . Le fichier contenant les champs
-FileName = dico_resu["FileName"]
+FileName = dict_resu["FileName"]
Iter.SetFieldFile(FileName)
#
# Calcul
<inport name="NumAdapt" type="int"/>
<inport name="LastIter" type="HOMARD_Iteration"/>
<inport name="Hypo" type="HOMARD_Hypothesis"/>
- <inport name="dico_resu" type="pyobj"/>
+ <inport name="dict_resu" type="pyobj"/>
<outport name="OK" type="bool"/>
<outport name="MessInfo" type="string"/>
<outport name="MeshFile" type="string"/>
<tonode>Analyse</tonode> <toport>ErrCalc</toport>
</datalink>
<datalink control="false">
- <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
- <tonode>Analyse</tonode> <toport>dico_resu</toport>
+ <fromnode>Calcul</fromnode> <fromport>dict_resu</fromport>
+ <tonode>Analyse</tonode> <toport>dict_resu</toport>
</datalink>
<datalink control="false">
- <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
- <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>dico_resu</toport>
+ <fromnode>Calcul</fromnode> <fromport>dict_resu</fromport>
+ <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>dict_resu</toport>
</datalink>
<datalink control="false">
<fromnode>Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MeshFile</fromport>
</while>
<inline name="Bilan">
<script><code><![CDATA[
-from PyQt4 import QtGui
+from PyQt5 import QtWidgets
import sys
-app = QtGui.QApplication(sys.argv)
+app = QtWidgets.QApplication(sys.argv)
MessageBoxTitle = "Bilan"
if MessInfo == "" :
MessInfo = "Le calcul est converge."
- QtGui.QMessageBox.information(None, MessageBoxTitle, MessInfo)
+ QtWidgets.QMessageBox.information(None, MessageBoxTitle, MessInfo)
else :
- QtGui.QMessageBox.critical(None, MessageBoxTitle, MessInfo)
+ QtWidgets.QMessageBox.critical(None, MessageBoxTitle, MessInfo)
]]></code></script>
<inport name="MessInfo" type="string"/>
</inline>
On va décrire ici un schéma s'appliquant à un calcul pour lequel on cherche à stabiliser une valeur. Le calcul démarre sur un maillage initial puis HOMARD enchaîne avec une adaptation. On refait un calcul sur ce nouveau maillage et son résultat est analysé. En fonction de cette analyse, le couplage continue ou non. L'allure générale du schéma est la suivante :
-.. image:: ../images/yacs_01.png
+.. image:: ./images/yacs_01.png
:align: center
:alt: yacs - allure générale
:width: 512
DataInit
========
-.. image:: ../images/yacs_a_01.png
+.. image:: ./images/yacs_a_01.png
:align: center
:alt: DataInit
:width: 158
Cette boîte est un noeud élémentaire de type PresetNode. Sa seule fonction est d'initialiser la variable MeshFile qui contient le nom du fichier du maillage initial.
.. literalinclude:: ../files/yacs_01.fr.xml
- :lines: 38-42
+ :lines: 37-41
Etude_Initialisation
====================
- StudyCreation : noeud python
- UpdateStudy : service du composant HOMARD
-.. image:: ../images/yacs_b_01.png
+.. image:: ./images/yacs_b_01.png
:align: center
:alt: Etude_Initialisation
- :width: 323
- :height: 97
+ :width: 327
+ :height: 73
Le noeud python StudyCreation sert à initialiser l'étude SALOME qui est fournie en sortie :
.. literalinclude:: ../files/yacs_01.fr.xml
- :lines: 44-62
+ :lines: 43-59
Le service UpdateStudy affecte cette étude à une instance de HOMARD.
.. literalinclude:: ../files/yacs_01.fr.xml
- :lines: 63-68
+ :lines: 60-64
Boucle_de_convergence
=====================
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
+.. image:: ./images/yacs_c_01.png
:align: center
:alt: Boucle
:width: 163
Bilan
=====
-.. image:: ../images/yacs_d_01.png
+.. image:: ./images/yacs_d_01.png
:align: center
:alt: Bilan
:width: 158
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.fr.xml
- :lines: 406-419
+ :lines: 398-411
La boucle de calculs
********************
-.. image:: ../images/yacs_c_02.png
+.. image:: ./images/yacs_c_02.png
:align: center
:alt: Boucle
- :width: 338
- :height: 152
+ :width: 496
+ :height: 112
-Cette boîte est un bloc qui gère le calcul, l'adaptation et l'analyse.
+Cette boîte est un bloc qui gère le calcul, l'analyse et l'adaptation.
Calcul
======
-.. image:: ../images/yacs_c_03.png
+.. image:: ./images/yacs_c_03.png
:align: center
:alt: Calcul
:width: 155
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.fr.xml
- :lines: 77-103
+ :lines: 70-90
Dans cet exemple, il faut définir :
Adaptation
==========
-.. image:: ../images/yacs_c_04.png
+.. image:: ./images/yacs_c_04.png
:align: center
:alt: Adaptation
:width: 661
Iter_1
^^^^^^
-.. image:: ../images/yacs_c_06.png
+.. image:: ./images/yacs_c_06.png
:align: center
:alt: Iter_1
:width: 481
Cette boîte commence par créer le cas HOMARD en appelant le service CreateCase.
.. literalinclude:: ../files/yacs_01.fr.xml
- :lines: 208-215
+ :lines: 200-207
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.fr.xml
- :lines: 443-446
+ :lines: 435-438
.. literalinclude:: ../files/yacs_01.fr.xml
- :lines: 483-486
+ :lines: 475-478
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 :doc:`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.fr.xml
- :lines: 216-228
+ :lines: 208-220
Enfin, une hypothèse est créée en appelant le service CreateHypothese. Le paramètre de sortie est une instance d'hypothèse.
^^^^^^^^^^^
Une fois initialisée, l'adaptation peut être calculée. C'est le but de la boîte Homard_Exec, sous forme d'un script python.
-.. image:: ../images/yacs_c_09.png
+.. image:: ./images/yacs_c_09.png
:align: center
:alt: Homard_Exec
:width: 153
Le répertoire de calcul est récupéré. Le nom du maillage est rappelé.
.. literalinclude:: ../files/yacs_01.fr.xml
- :lines: 245-250
+ :lines: 237-242
../..
.. literalinclude:: ../files/yacs_01.fr.xml
- :lines: 325-333
+ :lines: 317-325
L'hypothèse transmise en paramètre d'entrée est caractérisée (voir :doc:`tui_create_hypothese`) :
.. literalinclude:: ../files/yacs_01.fr.xml
- :lines: 254-278
+ :lines: 246-270
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.fr.xml
- :lines: 280-290
+ :lines: 272-282
L'itération est complétée : hypothèse, futur maillage, champ (voir :doc:`tui_create_iteration`) :
.. literalinclude:: ../files/yacs_01.fr.xml
- :lines: 292-311
+ :lines: 284-303
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.fr.xml
- :lines: 313-324
+ :lines: 305-316
Après cette exécution, le processus sort du noeud Adaptation_HOMARD, puis du noeud Adaptation. On arrive alors au noeud d'analyse.
Iter_n
^^^^^^
-.. image:: ../images/yacs_c_07.png
+.. image:: ./images/yacs_c_07.png
:align: center
:alt: Iter_n
:width: 323
Arret_boucle
------------
-.. image:: ../images/yacs_c_08.png
+.. image:: ./images/yacs_c_08.png
:align: center
:alt: Arret_boucle
:width: 163
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.fr.xml
- :lines: 173-184
+ :lines: 165-176
Analyse
=======
-.. image:: ../images/yacs_c_05.png
+.. image:: ./images/yacs_c_05.png
:align: center
:alt: Analyse
:width: 156
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.fr.xml
- :lines: 104-116
+ :lines: 96-108
../..
.. literalinclude:: ../files/yacs_01.fr.xml
- :lines: 162-170
+ :lines: 154-162
On commence par analyser le retour du code de calcul :
.. literalinclude:: ../files/yacs_01.fr.xml
- :lines: 118-123
+ :lines: 110-115
Vérification de la présence du nom du fichier de résultats dans le dictionnaire des résultats :
.. literalinclude:: ../files/yacs_01.fr.xml
- :lines: 125-132
+ :lines: 117-124
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.fr.xml
- :lines: 134-152
+ :lines: 126-146
Enfin, on vérifie que l'on ne dépasse pas un nombre maximal d'adaptations :
.. literalinclude:: ../files/yacs_01.fr.xml
- :lines: 154-159
+ :lines: 146-151
Utiliser ce schéma