1 <?xml version='1.0' encoding='iso-8859-1' ?>
3 <objref name="CALCIUM_real" id="IDL:Ports/Calcium_Ports/Calcium_Real_Port:1.0"/>
4 <type name="string" kind="string"/>
5 <struct name="Engines/dataref">
6 <member name="ref" type="string"/>
8 <objref name="HOMARD_Boundary" id="IDL:HOMARD/HOMARD_Boundary:1.0"/>
9 <objref name="HOMARD_Cas" id="IDL:HOMARD/HOMARD_Cas:1.0"/>
10 <objref name="HOMARD_Hypothesis" id="IDL:HOMARD/HOMARD_Hypothesis:1.0"/>
11 <objref name="HOMARD_Iteration" id="IDL:HOMARD/HOMARD_Iteration:1.0"/>
12 <objref name="HOMARD_Zone" id="IDL:HOMARD/HOMARD_Zone:1.0"/>
13 <objref name="Study" id="IDL:SALOMEDS/Study:1.0"/>
14 <type name="bool" kind="bool"/>
15 <sequence name="boolvec" content="bool"/>
16 <type name="double" kind="double"/>
17 <sequence name="dblevec" content="double"/>
18 <objref name="file" id="file"/>
19 <type name="int" kind="int"/>
20 <sequence name="intvec" content="int"/>
21 <struct name="stringpair">
22 <member name="name" type="string"/>
23 <member name="value" type="string"/>
25 <sequence name="propvec" content="stringpair"/>
26 <objref name="pyobj" id="python:obj:1.0"/>
27 <sequence name="seqboolvec" content="boolvec"/>
28 <sequence name="seqdblevec" content="dblevec"/>
29 <sequence name="seqint" content="int"/>
30 <sequence name="seqintvec" content="intvec"/>
31 <sequence name="stringvec" content="string"/>
32 <sequence name="seqstringvec" content="stringvec"/>
33 <container name="DefaultContainer">
34 <property name="container_name" value="FactoryServer"/>
35 <property name="name" value="localhost"/>
37 <datanode name="DataInit">
38 <parameter name="MeshFile" type="string">
42 <bloc name="Etude_Initialisation">
43 <inline name="StudyCreation">
44 <script><code><![CDATA[
51 import HOMARD_Iteration_idl
52 import HOMARD_Hypothesis_idl
53 import HOMARD_Zone_idl
54 import HOMARD_Boundary_idl
58 CurrentStudy = salome.myStudy
60 <outport name="CurrentStudy" type="Study"/>
62 <service name="SetCurrentStudy">
63 <component>HOMARD</component>
64 <load container="DefaultContainer"/>
65 <method>SetCurrentStudy</method>
66 <inport name="theStudy" type="Study"/>
68 <control> <fromnode>StudyCreation</fromnode> <tonode>SetCurrentStudy</tonode> </control>
69 <datalink control="false">
70 <fromnode>StudyCreation</fromnode> <fromport>CurrentStudy</fromport>
71 <tonode>SetCurrentStudy</tonode> <toport>theStudy</toport>
74 <while name="Boucle_de_convergence">
75 <bloc name="Alternance_Calcul_HOMARD">
76 <inline name="Calcul">
77 <script><code><![CDATA[
81 Alternance_Calcul_HOMARD_Calcul
84 argu.append("--rep_calc=" + rep_calc)
85 argu.append("--num=%d" % numCalc)
86 argu.append("--mesh_file=" + MeshFile)
88 Script_A = Script(argu)
90 Error, message_erreur, dico_resu = Script_A.compute ()
92 dico_resu["rep_calc"] = rep_calc
95 <inport name="numCalc" type="int"/>
96 <inport name="MeshFile" type="string"/>
97 <outport name="Error" type="int"/>
98 <outport name="dico_resu" type="pyobj"/>
100 <inline name="Analyse">
101 <script><code><![CDATA[
105 NumCalcP1 = NumCalc + 1
108 Analyse_Test_Convergence
114 # If the computation failed, stop:
117 MessInfo = "Computation error # %d" % ErrCalc
121 # If the file is not defined, stop:
123 if dico_resu.has_key("FileName") :
124 FileName = dico_resu["FileName"]
126 MessInfo = "The file for the mesh is not defined."
130 # If the criterion is satisfied, stop:
132 if dico_resu.has_key("V_TEST") :
133 valeur_v = dico_resu["V_TEST"]
137 resu1.append(valeur_v)
140 rap = ( resu1[-1] - solu_m1 ) / solu_m1
141 if abs(rap) < 0.001 :
146 MessInfo = "The value for the test is not available."
150 # If the maximum number of adaptations is reached, stop:
153 if NumCalc >= MaxIter :
154 MessInfo = "The maximum number of adaptations is reached: %d" % (MaxIter+1)
160 <inport name="NumCalc" type="int"/>
161 <inport name="ErrCalc" type="int"/>
162 <inport name="dico_resu" type="pyobj"/>
163 <outport name="Error" type="int"/>
164 <outport name="NumCalcP1" type="int"/>
165 <outport name="FileName" type="string"/>
166 <outport name="MessInfo" type="string"/>
168 <switch name="Adaptation" select="0">
170 <bloc name="Arret_boucle">
171 <inline name="Arret">
172 <script><code><![CDATA[
176 <inport name="MessInfo" type="string"/>
177 <outport name="OK" type="bool"/>
178 <outport name="MeshFile" type="string"/>
179 <outport name="MessInfo" type="string"/>
184 <bloc name="Adaptation_HOMARD">
185 <switch name="HOMARD_Initialisation" select="0">
188 <service name="LastIteration">
189 <node>Etude_Initialisation.SetCurrentStudy</node>
190 <method>LastIteration</method>
191 <inport name="CaseName" type="string"/>
192 <outport name="return" type="HOMARD_Iteration"/>
194 <service name="GetHypothesis">
195 <node>Etude_Initialisation.SetCurrentStudy</node>
196 <method>GetHypothesis</method>
197 <inport name="HypoName" type="string"/>
198 <outport name="return" type="HOMARD_Hypothesis"/>
200 <control> <fromnode>LastIteration</fromnode> <tonode>GetHypothesis</tonode> </control>
205 <service name="CreateCase">
206 <node>Etude_Initialisation.SetCurrentStudy</node>
207 <method>CreateCase</method>
208 <inport name="CaseName" type="string"/>
209 <inport name="MeshName" type="string"/>
210 <inport name="FileName" type="string"/>
211 <outport name="return" type="HOMARD_Cas"/>
213 <inline name="Case_Options">
214 <script><code><![CDATA[
216 # Directory for the adaptation
218 # Associated iteration #0
219 Iter0 = Case.GetIter0()
221 <inport name="Case" type="HOMARD_Cas"/>
222 <outport name="Iter0" type="HOMARD_Iteration"/>
224 <service name="CreateHypothesis">
225 <node>Etude_Initialisation.SetCurrentStudy</node>
226 <method>CreateHypothesis</method>
227 <inport name="HypoName" type="string"/>
228 <outport name="return" type="HOMARD_Hypothesis"/>
231 <datalink control="false">
232 <fromnode>CreateCase</fromnode> <fromport>return</fromport>
233 <tonode>Case_Options</tonode> <toport>Case</toport>
238 <inline name="HOMARD_Exec">
239 <script><code><![CDATA[
241 # Directory for the computation
247 # . Name of the hypothesis
248 # ------------------------
249 HypoName = Hypo.GetName()
253 HOMARD_Exec_Hypo_Options
255 # Name of the next iteration
256 # ==========================
257 # . Name of the previous iteration
258 LastIterName = LastIter.GetName()
259 aux = '%03d' % NumAdapt
260 # . At iteration #1, addition
262 IterName = LastIterName + "_" + aux
263 # . Then, substitution
265 IterName = LastIterName[:-3] + aux
267 # Creation of the iteration
268 # =========================
269 Iter = LastIter.NextIteration(IterName)
271 # Options of the iteration
272 # ========================
273 # . Association de l'hypothese
274 Iter.AssociateHypo(HypoName)
276 # . The name of the next mesh
277 Iter.SetMeshName(MeshName)
279 # . The file of the next mesh
280 aux = '%02d' % NumAdapt
281 MeshFile = os.path.join (DirName, "maill."+aux+".med")
282 Iter.SetMeshFile(MeshFile)
284 # . The file for the fields
285 FileName = dico_resu["FileName"]
286 Iter.SetFieldFile(FileName)
288 HOMARD_Exec_Iter_Options
292 Error = Iter.Compute(1,1)
294 # The loops stops if problem
295 # ==========================
298 MessInfo = "Error in HOMARD in the adaptation # %d" % NumAdapt
303 <inport name="NumAdapt" type="int"/>
304 <inport name="LastIter" type="HOMARD_Iteration"/>
305 <inport name="Hypo" type="HOMARD_Hypothesis"/>
306 <inport name="dico_resu" type="pyobj"/>
307 <outport name="OK" type="bool"/>
308 <outport name="MessInfo" type="string"/>
309 <outport name="MeshFile" type="string"/>
311 <control> <fromnode>HOMARD_Initialisation</fromnode> <tonode>HOMARD_Exec</tonode> </control>
312 <datalink control="false">
313 <fromnode>HOMARD_Initialisation.default_Iter_n.LastIteration</fromnode> <fromport>return</fromport>
314 <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
316 <datalink control="false">
317 <fromnode>HOMARD_Initialisation.p1_Iter_1.Case_Options</fromnode> <fromport>Iter0</fromport>
318 <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
320 <datalink control="false">
321 <fromnode>HOMARD_Initialisation.default_Iter_n.GetHypothesis</fromnode> <fromport>return</fromport>
322 <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
324 <datalink control="false">
325 <fromnode>HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</fromnode> <fromport>return</fromport>
326 <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
331 <control> <fromnode>Calcul</fromnode> <tonode>Analyse</tonode> </control>
332 <control> <fromnode>Analyse</fromnode> <tonode>Adaptation</tonode> </control>
333 <datalink control="false">
334 <fromnode>Analyse</fromnode> <fromport>Error</fromport>
335 <tonode>Adaptation</tonode> <toport>select</toport>
337 <datalink control="false">
338 <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
339 <tonode>Calcul</tonode> <toport>numCalc</toport>
341 <datalink control="false">
342 <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
343 <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode> <toport>select</toport>
345 <datalink control="false">
346 <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
347 <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>NumAdapt</toport>
349 <datalink control="false">
350 <fromnode>Analyse</fromnode> <fromport>FileName</fromport>
351 <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode> <toport>FileName</toport>
353 <datalink control="false">
354 <fromnode>Analyse</fromnode> <fromport>MessInfo</fromport>
355 <tonode>Adaptation.default_Arret_boucle.Arret</tonode> <toport>MessInfo</toport>
357 <datalink control="false">
358 <fromnode>Calcul</fromnode> <fromport>Error</fromport>
359 <tonode>Analyse</tonode> <toport>ErrCalc</toport>
361 <datalink control="false">
362 <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
363 <tonode>Analyse</tonode> <toport>dico_resu</toport>
365 <datalink control="false">
366 <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
367 <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>dico_resu</toport>
369 <datalink control="false">
370 <fromnode>Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MeshFile</fromport>
371 <tonode>Calcul</tonode> <toport>MeshFile</toport>
373 <datalink control="false">
374 <fromnode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MeshFile</fromport>
375 <tonode>Calcul</tonode> <toport>MeshFile</toport>
378 <datalink control="false">
379 <fromnode>Alternance_Calcul_HOMARD.Analyse</fromnode> <fromport>NumCalcP1</fromport>
380 <tonode>Alternance_Calcul_HOMARD.Analyse</tonode> <toport>NumCalc</toport>
383 <inline name="Bilan">
384 <script><code><![CDATA[
385 from PyQt4 import QtGui
387 app = QtGui.QApplication(sys.argv)
388 MessageBoxTitle = "Bilan"
390 MessInfo = "The convergence is reached."
391 QtGui.QMessageBox.information(None, MessageBoxTitle, MessInfo)
393 QtGui.QMessageBox.critical(None, MessageBoxTitle, MessInfo)
395 <inport name="MessInfo" type="string"/>
397 <control> <fromnode>DataInit</fromnode> <tonode>Etude_Initialisation</tonode> </control>
398 <control> <fromnode>Etude_Initialisation</fromnode> <tonode>Boucle_de_convergence</tonode> </control>
399 <control> <fromnode>Boucle_de_convergence</fromnode> <tonode>Bilan</tonode> </control>
400 <datalink control="false">
401 <fromnode>DataInit</fromnode> <fromport>MeshFile</fromport>
402 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode> <toport>MeshFile</toport>
404 <datalink control="false">
405 <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>OK</fromport>
406 <tonode>Boucle_de_convergence</tonode> <toport>condition</toport>
408 <datalink control="false">
409 <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>OK</fromport>
410 <tonode>Boucle_de_convergence</tonode> <toport>condition</toport>
412 <datalink control="false">
413 <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MessInfo</fromport>
414 <tonode>Bilan</tonode> <toport>MessInfo</toport>
416 <datalink control="false">
417 <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MessInfo</fromport>
418 <tonode>Bilan</tonode> <toport>MessInfo</toport>
421 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode><toport>CaseName</toport>
422 <value><string>Calcul</string></value>
425 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode><toport>numCalc</toport>
426 <value><int>0</int></value>
429 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation</tonode><toport>select</toport>
430 <value><int>0</int></value>
433 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode><toport>select</toport>
434 <value><int>0</int></value>
437 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.LastIteration</tonode><toport>CaseName</toport>
438 <value><string>Calcul</string></value>
441 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.GetHypothesis</tonode><toport>HypoName</toport>
442 <value><string>Hypo</string></value>
445 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</tonode><toport>HypoName</toport>
446 <value><string>Hypo</string></value>
449 <tonode>Boucle_de_convergence</tonode><toport>condition</toport>
450 <value><boolean>true</boolean></value>
453 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>NumCalc</toport>
454 <value><int>0</int></value>
457 <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>ErrCalc</toport>
458 <value><int>0</int></value>
461 <presentation name="__ROOT__" x="0" y="0" width="704" height="977" expanded="1" expx="0" expy="0" expWidth="704" expHeight="977" shownState="0"/>
462 <presentation name="DataInit" x="4" y="32" width="158" height="63" expanded="1" expx="4" expy="32" expWidth="158" expHeight="63" shownState="0"/>
463 <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"/>
464 <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"/>
465 <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"/>
466 <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"/>
467 <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"/>
468 <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"/>
469 <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"/>
470 <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"/>
471 <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"/>
472 <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"/>
473 <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"/>
474 <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"/>
475 <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"/>
476 <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"/>
477 <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"/>
478 <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"/>
479 <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"/>
480 <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"/>
481 <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"/>
482 <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"/>
483 <presentation name="Bilan" x="350" y="32" width="158" height="63" expanded="1" expx="350" expy="32" expWidth="158" expHeight="63" shownState="0"/>