1 <?xml version='1.0' encoding='iso-8859-1' ?>
3 <property name="DefaultStudyID" value="1"/>
4 <objref name="CALCIUM_real" id="IDL:Ports/Calcium_Ports/Calcium_Real_Port:1.0"/>
5 <type name="string" kind="string"/>
6 <struct name="Engines/dataref">
7 <member name="ref" type="string"/>
9 <objref name="HOMARD_Boundary" id="IDL:HOMARD/HOMARD_Boundary:1.0"/>
10 <objref name="HOMARD_Cas" id="IDL:HOMARD/HOMARD_Cas:1.0"/>
11 <objref name="HOMARD_Hypothesis" id="IDL:HOMARD/HOMARD_Hypothesis:1.0"/>
12 <objref name="HOMARD_Iteration" id="IDL:HOMARD/HOMARD_Iteration:1.0"/>
13 <objref name="HOMARD_Zone" id="IDL:HOMARD/HOMARD_Zone:1.0"/>
14 <objref name="Study" id="IDL:SALOMEDS/Study:1.0"/>
15 <type name="bool" kind="bool"/>
16 <sequence name="boolvec" content="bool"/>
17 <type name="double" kind="double"/>
18 <sequence name="dblevec" content="double"/>
19 <objref name="file" id="file"/>
20 <type name="int" kind="int"/>
21 <sequence name="intvec" content="int"/>
22 <struct name="stringpair">
23 <member name="name" type="string"/>
24 <member name="value" type="string"/>
26 <sequence name="propvec" content="stringpair"/>
27 <objref name="pyobj" id="python:obj:1.0"/>
28 <sequence name="seqboolvec" content="boolvec"/>
29 <sequence name="seqdblevec" content="dblevec"/>
30 <sequence name="seqint" content="int"/>
31 <sequence name="seqintvec" content="intvec"/>
32 <sequence name="stringvec" content="string"/>
33 <sequence name="seqstringvec" content="stringvec"/>
34 <container name="DefaultContainer">
35 <property name="container_name" value="FactoryServer"/>
36 <property name="name" value="localhost"/>
38 <datanode name="DataInit">
39 <parameter name="MeshFile" type="string">
43 <bloc name="Etude_Initialisation">
44 <inline name="StudyCreation">
45 <script><code><![CDATA[
52 import HOMARD_Iteration_idl
53 import HOMARD_Hypothesis_idl
54 import HOMARD_Zone_idl
55 import HOMARD_Boundary_idl
59 CurrentStudy = salome.myStudy
61 <outport name="CurrentStudy" type="Study"/>
63 <service name="SetCurrentStudy">
64 <component>HOMARD</component>
65 <load container="DefaultContainer"/>
66 <method>SetCurrentStudy</method>
67 <inport name="theStudy" type="Study"/>
69 <control> <fromnode>StudyCreation</fromnode> <tonode>SetCurrentStudy</tonode> </control>
70 <datalink control="false">
71 <fromnode>StudyCreation</fromnode> <fromport>CurrentStudy</fromport>
72 <tonode>SetCurrentStudy</tonode> <toport>theStudy</toport>
75 <while name="Boucle_de_convergence">
76 <bloc name="Alternance_Calcul_HOMARD">
77 <inline name="Calcul">
78 <script><code><![CDATA[
82 Alternance_Calcul_HOMARD_Calcul
85 argu.append("--rep_calc=" + rep_calc)
86 argu.append("--num=%d" % numCalc)
87 argu.append("--mesh_file=" + MeshFile)
89 Script_A = Script(argu)
91 Error, message_erreur, dico_resu = Script_A.compute ()
93 dico_resu["rep_calc"] = rep_calc
96 <inport name="numCalc" type="int"/>
97 <inport name="MeshFile" type="string"/>
98 <outport name="Error" type="int"/>
99 <outport name="dico_resu" type="pyobj"/>
101 <inline name="Analyse">
102 <script><code><![CDATA[
106 NumCalcP1 = NumCalc + 1
109 Analyse_Test_Convergence
115 # If the computation failed, stop:
118 MessInfo = "Computation error # %d" % ErrCalc
122 # If the file is not defined, stop:
124 if dico_resu.has_key("FileName") :
125 FileName = dico_resu["FileName"]
127 MessInfo = "The file for the mesh is not defined."
131 # If the criterion is satisfied, stop:
133 if dico_resu.has_key("V_TEST") :
134 valeur_v = dico_resu["V_TEST"]
138 resu1.append(valeur_v)
141 rap = ( resu1[-1] - solu_m1 ) / solu_m1
142 if abs(rap) < 0.001 :
147 MessInfo = "The value for the test is not available."
151 # If the maximum number of adaptations is reached, stop:
154 if NumCalc >= MaxIter :
155 MessInfo = "The maximum number of adaptations is reached: %d" % (MaxIter+1)
161 <inport name="NumCalc" type="int"/>
162 <inport name="ErrCalc" type="int"/>
163 <inport name="dico_resu" type="pyobj"/>
164 <outport name="Error" type="int"/>
165 <outport name="NumCalcP1" type="int"/>
166 <outport name="FileName" type="string"/>
167 <outport name="MessInfo" type="string"/>
169 <switch name="Adaptation" select="0">
171 <bloc name="Arret_boucle">
172 <inline name="Arret">
173 <script><code><![CDATA[
177 <inport name="MessInfo" type="string"/>
178 <outport name="OK" type="bool"/>
179 <outport name="MeshFile" type="string"/>
180 <outport name="MessInfo" type="string"/>
185 <bloc name="Adaptation_HOMARD">
186 <switch name="HOMARD_Initialisation" select="0">
189 <service name="LastIteration">
190 <node>Etude_Initialisation.SetCurrentStudy</node>
191 <method>LastIteration</method>
192 <inport name="CaseName" type="string"/>
193 <outport name="return" type="HOMARD_Iteration"/>
195 <service name="GetHypothesis">
196 <node>Etude_Initialisation.SetCurrentStudy</node>
197 <method>GetHypothesis</method>
198 <inport name="HypoName" type="string"/>
199 <outport name="return" type="HOMARD_Hypothesis"/>
201 <control> <fromnode>LastIteration</fromnode> <tonode>GetHypothesis</tonode> </control>
206 <service name="CreateCase">
207 <node>Etude_Initialisation.SetCurrentStudy</node>
208 <method>CreateCase</method>
209 <inport name="CaseName" type="string"/>
210 <inport name="MeshName" type="string"/>
211 <inport name="FileName" type="string"/>
212 <outport name="return" type="HOMARD_Cas"/>
214 <inline name="Case_Options">
215 <script><code><![CDATA[
217 # Directory for the adaptation
219 # Associated iteration #0
220 Iter0 = Case.GetIter0()
222 <inport name="Case" type="HOMARD_Cas"/>
223 <outport name="Iter0" type="HOMARD_Iteration"/>
225 <service name="CreateHypothesis">
226 <node>Etude_Initialisation.SetCurrentStudy</node>
227 <method>CreateHypothesis</method>
228 <inport name="HypoName" type="string"/>
229 <outport name="return" type="HOMARD_Hypothesis"/>
232 <datalink control="false">
233 <fromnode>CreateCase</fromnode> <fromport>return</fromport>
234 <tonode>Case_Options</tonode> <toport>Case</toport>
239 <inline name="HOMARD_Exec">
240 <script><code><![CDATA[
242 # Directory for the computation
248 # . Name of the hypothesis
249 # ------------------------
250 HypoName = Hypo.GetName()
254 HOMARD_Exec_Hypo_Options
256 # Name of the next iteration
257 # ==========================
258 # . Name of the previous iteration
259 LastIterName = LastIter.GetName()
260 aux = '%03d' % NumAdapt
261 # . At iteration #1, addition
263 IterName = LastIterName + "_" + aux
264 # . Then, substitution
266 IterName = LastIterName[:-3] + aux
268 # Creation of the iteration
269 # =========================
270 Iter = LastIter.NextIteration(IterName)
272 # Options of the iteration
273 # ========================
274 # . Association de l'hypothese
275 Iter.AssociateHypo(HypoName)
277 # . The name of the next mesh
278 Iter.SetMeshName(MeshName)
280 # . The file of the next mesh
281 aux = '%02d' % NumAdapt
282 MeshFile = os.path.join (DirName, "maill."+aux+".med")
283 Iter.SetMeshFile(MeshFile)
285 # . The file for the fields
286 FileName = dico_resu["FileName"]
287 Iter.SetFieldFile(FileName)
289 HOMARD_Exec_Iter_Options
293 Error = Iter.Compute(1,1)
295 # The loops stops if problem
296 # ==========================
299 MessInfo = "Error in HOMARD in the adaptation # %d" % NumAdapt
304 <inport name="NumAdapt" type="int"/>
305 <inport name="LastIter" type="HOMARD_Iteration"/>
306 <inport name="Hypo" type="HOMARD_Hypothesis"/>
307 <inport name="dico_resu" type="pyobj"/>
308 <outport name="OK" type="bool"/>
309 <outport name="MessInfo" type="string"/>
310 <outport name="MeshFile" type="string"/>
312 <control> <fromnode>HOMARD_Initialisation</fromnode> <tonode>HOMARD_Exec</tonode> </control>
313 <datalink control="false">
314 <fromnode>HOMARD_Initialisation.default_Iter_n.LastIteration</fromnode> <fromport>return</fromport>
315 <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
317 <datalink control="false">
318 <fromnode>HOMARD_Initialisation.p1_Iter_1.Case_Options</fromnode> <fromport>Iter0</fromport>
319 <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
321 <datalink control="false">
322 <fromnode>HOMARD_Initialisation.default_Iter_n.GetHypothesis</fromnode> <fromport>return</fromport>
323 <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
325 <datalink control="false">
326 <fromnode>HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</fromnode> <fromport>return</fromport>
327 <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
332 <control> <fromnode>Calcul</fromnode> <tonode>Analyse</tonode> </control>
333 <control> <fromnode>Analyse</fromnode> <tonode>Adaptation</tonode> </control>
334 <datalink control="false">
335 <fromnode>Analyse</fromnode> <fromport>Error</fromport>
336 <tonode>Adaptation</tonode> <toport>select</toport>
338 <datalink control="false">
339 <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
340 <tonode>Calcul</tonode> <toport>numCalc</toport>
342 <datalink control="false">
343 <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
344 <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode> <toport>select</toport>
346 <datalink control="false">
347 <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
348 <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>NumAdapt</toport>
350 <datalink control="false">
351 <fromnode>Analyse</fromnode> <fromport>FileName</fromport>
352 <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode> <toport>FileName</toport>
354 <datalink control="false">
355 <fromnode>Analyse</fromnode> <fromport>MessInfo</fromport>
356 <tonode>Adaptation.default_Arret_boucle.Arret</tonode> <toport>MessInfo</toport>
358 <datalink control="false">
359 <fromnode>Calcul</fromnode> <fromport>Error</fromport>
360 <tonode>Analyse</tonode> <toport>ErrCalc</toport>
362 <datalink control="false">
363 <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
364 <tonode>Analyse</tonode> <toport>dico_resu</toport>
366 <datalink control="false">
367 <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
368 <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>dico_resu</toport>
370 <datalink control="false">
371 <fromnode>Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MeshFile</fromport>
372 <tonode>Calcul</tonode> <toport>MeshFile</toport>
374 <datalink control="false">
375 <fromnode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MeshFile</fromport>
376 <tonode>Calcul</tonode> <toport>MeshFile</toport>
379 <datalink control="false">
380 <fromnode>Alternance_Calcul_HOMARD.Analyse</fromnode> <fromport>NumCalcP1</fromport>
381 <tonode>Alternance_Calcul_HOMARD.Analyse</tonode> <toport>NumCalc</toport>
384 <inline name="Bilan">
385 <script><code><![CDATA[
386 from PyQt4 import QtGui
388 app = QtGui.QApplication(sys.argv)
389 MessageBoxTitle = "Bilan"
391 MessInfo = "The convergence is reached."
392 QtGui.QMessageBox.information(None, MessageBoxTitle, MessInfo)
394 QtGui.QMessageBox.critical(None, MessageBoxTitle, MessInfo)
396 <inport name="MessInfo" type="string"/>
398 <control> <fromnode>DataInit</fromnode> <tonode>Etude_Initialisation</tonode> </control>
399 <control> <fromnode>Etude_Initialisation</fromnode> <tonode>Boucle_de_convergence</tonode> </control>
400 <control> <fromnode>Boucle_de_convergence</fromnode> <tonode>Bilan</tonode> </control>
401 <datalink control="false">
402 <fromnode>DataInit</fromnode> <fromport>MeshFile</fromport>
403 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode> <toport>MeshFile</toport>
405 <datalink control="false">
406 <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>OK</fromport>
407 <tonode>Boucle_de_convergence</tonode> <toport>condition</toport>
409 <datalink control="false">
410 <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>OK</fromport>
411 <tonode>Boucle_de_convergence</tonode> <toport>condition</toport>
413 <datalink control="false">
414 <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MessInfo</fromport>
415 <tonode>Bilan</tonode> <toport>MessInfo</toport>
417 <datalink control="false">
418 <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MessInfo</fromport>
419 <tonode>Bilan</tonode> <toport>MessInfo</toport>
422 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode><toport>CaseName</toport>
423 <value><string>Calcul</string></value>
426 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode><toport>numCalc</toport>
427 <value><int>0</int></value>
430 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation</tonode><toport>select</toport>
431 <value><int>0</int></value>
434 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode><toport>select</toport>
435 <value><int>0</int></value>
438 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.LastIteration</tonode><toport>CaseName</toport>
439 <value><string>Calcul</string></value>
442 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.GetHypothesis</tonode><toport>HypoName</toport>
443 <value><string>Hypo</string></value>
446 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</tonode><toport>HypoName</toport>
447 <value><string>Hypo</string></value>
450 <tonode>Boucle_de_convergence</tonode><toport>condition</toport>
451 <value><boolean>true</boolean></value>
454 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>NumCalc</toport>
455 <value><int>0</int></value>
458 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>ErrCalc</toport>
459 <value><int>0</int></value>
462 <presentation name="__ROOT__" x="0" y="0" width="704" height="977" expanded="1" expx="0" expy="0" expWidth="704" expHeight="977" shownState="0"/>
463 <presentation name="DataInit" x="4" y="32" width="158" height="63" expanded="1" expx="4" expy="32" expWidth="158" expHeight="63" shownState="0"/>
464 <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"/>
465 <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"/>
466 <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"/>
467 <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"/>
468 <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"/>
469 <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"/>
470 <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"/>
471 <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"/>
472 <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"/>
473 <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"/>
474 <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"/>
475 <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"/>
476 <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"/>
477 <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"/>
478 <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"/>
479 <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"/>
480 <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"/>
481 <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"/>
482 <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"/>
483 <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"/>
484 <presentation name="Bilan" x="350" y="32" width="158" height="63" expanded="1" expx="350" expy="32" expWidth="158" expHeight="63" shownState="0"/>