]> SALOME platform Git repositories - modules/hydrosolver.git/blob - src/salome_hydro/coupling1d2d/eficas/coupling1d2d_template_schema.xml
Salome HOME
the version delivered by EDF
[modules/hydrosolver.git] / src / salome_hydro / coupling1d2d / eficas / coupling1d2d_template_schema.xml
1 <?xml version='1.0' encoding='iso-8859-1' ?>
2 <proc name="newSchema_1">
3    <property name="DefaultStudyID" value="1"/>
4    <type name="string" kind="string"/>
5    <struct name="Engines/dataref">
6       <member name="ref" type="string"/>
7    </struct>
8    <type name="bool" kind="bool"/>
9    <sequence name="boolvec" content="bool"/>
10    <type name="double" kind="double"/>
11    <sequence name="dblevec" content="double"/>
12    <objref name="file" id="file"/>
13    <type name="int" kind="int"/>
14    <sequence name="intvec" content="int"/>
15    <struct name="stringpair">
16       <member name="name" type="string"/>
17       <member name="value" type="string"/>
18    </struct>
19    <sequence name="propvec" content="stringpair"/>
20    <objref name="pyobj" id="python:obj:1.0"/>
21    <sequence name="seqboolvec" content="boolvec"/>
22    <sequence name="seqdblevec" content="dblevec"/>
23    <sequence name="seqintvec" content="intvec"/>
24    <sequence name="stringvec" content="string"/>
25    <sequence name="seqstringvec" content="stringvec"/>
26    <container name="DefaultContainer">
27       <property name="container_name" value="FactoryServer"/>
28       <property name="name" value="localhost"/>
29    </container>
30    <container name="mascaret_container">
31       <property name="container_name" value=""/>
32       <property name="name" value="localhost"/>
33    </container>
34    <container name="telemac_container">
35       <property name="name" value="localhost"/>
36    </container>
37    <while name="TimeLoop">
38       <bloc name="TimeBloc">
39          <inline name="TimeController">
40             <script><code><![CDATA[time += timestep
41 cont = (time + timestep/2 < endtime) # Add half timestep to avoid rounding issues
42 timeData = {}
43 timeData["start_time"] = time
44 timeData["end_time"] = time + timestep
45 timeData["time_step"] = timestep
46
47 if cont:
48     log.write("time: %f\n" % timeData["end_time"])
49 else:
50     log.close()
51     graph.close()
52 ]]></code></script>
53             <inport name="time" type="double"/>
54             <inport name="endtime" type="double"/>
55             <inport name="timestep" type="double"/>
56             <inport name="log" type="pyobj"/>
57             <inport name="graph" type="pyobj"/>
58             <outport name="cont" type="bool"/>
59             <outport name="time" type="double"/>
60             <outport name="timeData" type="pyobj"/>
61          </inline>
62          <while name="ConvergenceLoop">
63             <bloc name="ConvergenceBloc">
64                <inline name="ConvergenceController">
65                   <script><code><![CDATA[telborders = set(telemacData.keys())
66 mascborders = set(mascData.keys())
67 border_names = telborders | mascborders
68
69 if iter == 1:
70     log.write("ITER ")
71     for name in border_names:
72         if name in mascData:
73             nbvar = len(mascData[name])
74             formatlen = nbvar * 10 - 5
75             log.write("MASC %-*s" % (formatlen, name))
76         if name in telemacData:
77             nbvar = len(telemacData[name])
78             formatlen = nbvar * 10 - 5
79             log.write("T2D  %-*s" % (formatlen, name))
80     log.write("\n")
81     log.write("ITER ")
82     for name in border_names:
83         if name in mascData:
84             keys = sorted(mascData[name].iterkeys())
85             for key in keys:
86                 log.write("%9s " % key)
87         if name in telemacData:
88             keys = sorted(telemacData[name].iterkeys())
89             for key in keys:
90                 log.write("%9s " % key)
91     log.write("\n")
92
93 log.write("%4d " % iter)
94 for name in border_names:
95     if name in mascData:
96         keys = sorted(mascData[name].iterkeys())
97         for key in keys:
98             log.write("%9.3f " % mascData[name][key])
99     if name in telemacData:
100         keys = sorted(telemacData[name].iterkeys())
101         for key in keys:
102             log.write("%9.3f " % telemacData[name][key])
103 log.write("\n")
104 log.flush()
105
106 convergence = True
107 for name in border_names:
108     if name in mascData and name in telemacData:
109         if abs(mascData[name]["Z"] - telemacData[name]["Z"]) > Z_tol:
110             convergence = False
111         if abs(mascData[name]["Q"] - telemacData[name]["Q"]) > Q_tol:
112             convergence = False
113
114 cont = True
115 if convergence:
116     log.write("Convergence reached\n")
117     cont = False
118
119 iter += 1
120 if iter > maxiter:
121     log.write("Max iterations reached\n")
122     cont = False
123
124 if not cont:
125     iter = 1
126
127     if timeData["start_time"] == 0.0:
128         graph.write("Time,")
129         for name in border_names:
130             if name in mascData:
131                 keys = sorted(mascData[name].iterkeys())
132                 for key in keys:
133                     graph.write("MASC %s %s," % (name, key))
134             if name in telemacData:
135                 keys = sorted(telemacData[name].iterkeys())
136                 for key in keys:
137                     graph.write("T2D %s %s," % (name, key))
138         graph.write("\n")
139
140     graph.write("%f," % timeData["end_time"])
141     for name in border_names:
142         if name in mascData:
143             keys = sorted(mascData[name].iterkeys())
144             for key in keys:
145                 graph.write("%f," % mascData[name][key])
146         if name in telemacData:
147             keys = sorted(telemacData[name].iterkeys())
148             for key in keys:
149                 graph.write("%f," % telemacData[name][key])
150     graph.write("\n")
151     graph.flush()
152 ]]></code></script>
153                   <inport name="mascData" type="pyobj"/>
154                   <inport name="telemacData" type="pyobj"/>
155                   <inport name="Z_tol" type="double"/>
156                   <inport name="Q_tol" type="double"/>
157                   <inport name="iter" type="int"/>
158                   <inport name="borders" type="pyobj"/>
159                   <inport name="log" type="pyobj"/>
160                   <inport name="maxiter" type="int"/>
161                   <inport name="timeData" type="pyobj"/>
162                   <inport name="graph" type="pyobj"/>
163                   <outport name="cont" type="bool"/>
164                   <outport name="iter" type="int"/>
165                   <outport name="timeData" type="pyobj"/>
166                   <outport name="mascData" type="pyobj"/>
167                   <outport name="telemacData" type="pyobj"/>
168                </inline>
169                <service name="MascExecStep">
170                   <component>MASCARET</component>
171                   <load container="mascaret_container"/>
172                   <method>ExecStep</method>
173                   <inport name="timeData" type="pyobj"/>
174                   <inport name="inputData" type="pyobj"/>
175                   <outport name="outputData" type="pyobj"/>
176                </service>
177                <service name="TelExecStep">
178                   <component>TELEMAC2D</component>
179                   <load container="telemac_container"/>
180                   <method>ExecStep</method>
181                   <inport name="timeData" type="pyobj"/>
182                   <inport name="inputData" type="pyobj"/>
183                   <outport name="outputData" type="pyobj"/>
184                </service>
185                <control> <fromnode>MascExecStep</fromnode> <tonode>ConvergenceController</tonode> </control>
186                <control> <fromnode>MascExecStep</fromnode> <tonode>TelExecStep</tonode> </control>
187                <control> <fromnode>TelExecStep</fromnode> <tonode>ConvergenceController</tonode> </control>
188                <datalink control="false">
189                   <fromnode>ConvergenceController</fromnode> <fromport>timeData</fromport>
190                   <tonode>MascExecStep</tonode> <toport>timeData</toport>
191                </datalink>
192                <datalink control="false">
193                   <fromnode>ConvergenceController</fromnode> <fromport>timeData</fromport>
194                   <tonode>TelExecStep</tonode> <toport>timeData</toport>
195                </datalink>
196                <datalink control="false">
197                   <fromnode>ConvergenceController</fromnode> <fromport>telemacData</fromport>
198                   <tonode>MascExecStep</tonode> <toport>inputData</toport>
199                </datalink>
200                <datalink control="false">
201                   <fromnode>MascExecStep</fromnode> <fromport>outputData</fromport>
202                   <tonode>ConvergenceController</tonode> <toport>mascData</toport>
203                </datalink>
204                <datalink control="false">
205                   <fromnode>MascExecStep</fromnode> <fromport>outputData</fromport>
206                   <tonode>TelExecStep</tonode> <toport>inputData</toport>
207                </datalink>
208                <datalink control="false">
209                   <fromnode>TelExecStep</fromnode> <fromport>outputData</fromport>
210                   <tonode>ConvergenceController</tonode> <toport>telemacData</toport>
211                </datalink>
212             </bloc>
213             <datalink control="false">
214                <fromnode>ConvergenceBloc.ConvergenceController</fromnode> <fromport>iter</fromport>
215                <tonode>ConvergenceBloc.ConvergenceController</tonode> <toport>iter</toport>
216             </datalink>
217             <datalink control="false">
218                <fromnode>ConvergenceBloc.ConvergenceController</fromnode> <fromport>timeData</fromport>
219                <tonode>ConvergenceBloc.ConvergenceController</tonode> <toport>timeData</toport>
220             </datalink>
221          </while>
222          <control> <fromnode>ConvergenceLoop</fromnode> <tonode>TimeController</tonode> </control>
223          <datalink control="false">
224             <fromnode>TimeController</fromnode> <fromport>cont</fromport>
225             <tonode>ConvergenceLoop</tonode> <toport>condition</toport>
226          </datalink>
227          <datalink control="false">
228             <fromnode>TimeController</fromnode> <fromport>timeData</fromport>
229             <tonode>ConvergenceLoop.ConvergenceBloc.ConvergenceController</tonode> <toport>timeData</toport>
230          </datalink>
231          <datalink control="false">
232             <fromnode>TimeController</fromnode> <fromport>timeData</fromport>
233             <tonode>ConvergenceLoop.ConvergenceBloc.MascExecStep</tonode> <toport>timeData</toport>
234          </datalink>
235          <datalink control="false">
236             <fromnode>TimeController</fromnode> <fromport>timeData</fromport>
237             <tonode>ConvergenceLoop.ConvergenceBloc.TelExecStep</tonode> <toport>timeData</toport>
238          </datalink>
239          <datalink control="false">
240             <fromnode>ConvergenceLoop.ConvergenceBloc.ConvergenceController</fromnode> <fromport>cont</fromport>
241             <tonode>ConvergenceLoop</tonode> <toport>condition</toport>
242          </datalink>
243       </bloc>
244       <datalink control="false">
245          <fromnode>TimeBloc.TimeController</fromnode> <fromport>time</fromport>
246          <tonode>TimeBloc.TimeController</tonode> <toport>time</toport>
247       </datalink>
248    </while>
249    <service name="InitMascaret">
250       <node>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.MascExecStep</node>
251       <method>Init</method>
252       <inport name="studyID" type="int"/>
253       <inport name="detCaseEntry" type="string"/>
254    </service>
255    <inline name="InitCoupling">
256       <script><code><![CDATA[execfile(couplingFile)
257
258 timeData = {}
259 timeData["start_time"] = starttime
260 timeData["end_time"] = starttime + timestep
261 timeData["time_step"] = timestep
262 timeData["save_state_flag"] = True
263
264 log = open(logFile, "w")
265 graph = open(graphFile, "w")
266 ]]></code></script>
267       <inport name="couplingFile" type="string"/>
268       <inport name="logFile" type="string"/>
269       <inport name="graphFile" type="string"/>
270       <outport name="starttime" type="double"/>
271       <outport name="endtime" type="double"/>
272       <outport name="timestep" type="double"/>
273       <outport name="eps_Z" type="double"/>
274       <outport name="eps_Q" type="double"/>
275       <outport name="borders" type="pyobj"/>
276       <outport name="timeData" type="pyobj"/>
277       <outport name="log" type="pyobj"/>
278       <outport name="maxiter" type="int"/>
279       <outport name="graph" type="pyobj"/>
280    </inline>
281    <service name="FinalizeMascaret">
282       <node>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.MascExecStep</node>
283       <method>Finalize</method>
284    </service>
285    <service name="InitTelemac">
286       <node>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.TelExecStep</node>
287       <method>Init</method>
288       <inport name="studyID" type="int"/>
289       <inport name="detCaseEntry" type="string"/>
290    </service>
291    <service name="FinalizeTelemac">
292       <node>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.TelExecStep</node>
293       <method>Finalize</method>
294    </service>
295    <service name="InitMascBorders">
296       <node>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.MascExecStep</node>
297       <method>InitBorders</method>
298       <inport name="borders" type="pyobj"/>
299    </service>
300    <service name="InitTelBorders">
301       <node>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.TelExecStep</node>
302       <method>InitBorders</method>
303       <inport name="borders" type="pyobj"/>
304    </service>
305    <control> <fromnode>TimeLoop</fromnode> <tonode>FinalizeMascaret</tonode> </control>
306    <control> <fromnode>TimeLoop</fromnode> <tonode>FinalizeTelemac</tonode> </control>
307    <control> <fromnode>InitMascaret</fromnode> <tonode>TimeLoop</tonode> </control>
308    <control> <fromnode>InitCoupling</fromnode> <tonode>TimeLoop</tonode> </control>
309    <control> <fromnode>InitCoupling</fromnode> <tonode>InitMascBorders</tonode> </control>
310    <control> <fromnode>InitCoupling</fromnode> <tonode>InitTelBorders</tonode> </control>
311    <control> <fromnode>InitTelemac</fromnode> <tonode>TimeLoop</tonode> </control>
312    <control> <fromnode>InitTelemac</fromnode> <tonode>InitTelBorders</tonode> </control>
313    <control> <fromnode>InitMascBorders</fromnode> <tonode>TimeLoop</tonode> </control>
314    <control> <fromnode>InitTelBorders</fromnode> <tonode>TimeLoop</tonode> </control>
315    <datalink control="false">
316       <fromnode>InitCoupling</fromnode> <fromport>starttime</fromport>
317       <tonode>TimeLoop.TimeBloc.TimeController</tonode> <toport>time</toport>
318    </datalink>
319    <datalink control="false">
320       <fromnode>InitCoupling</fromnode> <fromport>endtime</fromport>
321       <tonode>TimeLoop.TimeBloc.TimeController</tonode> <toport>endtime</toport>
322    </datalink>
323    <datalink control="false">
324       <fromnode>InitCoupling</fromnode> <fromport>timestep</fromport>
325       <tonode>TimeLoop.TimeBloc.TimeController</tonode> <toport>timestep</toport>
326    </datalink>
327    <datalink control="false">
328       <fromnode>InitCoupling</fromnode> <fromport>eps_Z</fromport>
329       <tonode>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.ConvergenceController</tonode> <toport>Z_tol</toport>
330    </datalink>
331    <datalink control="false">
332       <fromnode>InitCoupling</fromnode> <fromport>eps_Q</fromport>
333       <tonode>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.ConvergenceController</tonode> <toport>Q_tol</toport>
334    </datalink>
335    <datalink control="false">
336       <fromnode>InitCoupling</fromnode> <fromport>borders</fromport>
337       <tonode>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.ConvergenceController</tonode> <toport>borders</toport>
338    </datalink>
339    <datalink control="false">
340       <fromnode>InitCoupling</fromnode> <fromport>borders</fromport>
341       <tonode>InitMascBorders</tonode> <toport>borders</toport>
342    </datalink>
343    <datalink control="false">
344       <fromnode>InitCoupling</fromnode> <fromport>borders</fromport>
345       <tonode>InitTelBorders</tonode> <toport>borders</toport>
346    </datalink>
347    <datalink control="false">
348       <fromnode>InitCoupling</fromnode> <fromport>timeData</fromport>
349       <tonode>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.ConvergenceController</tonode> <toport>timeData</toport>
350    </datalink>
351    <datalink control="false">
352       <fromnode>InitCoupling</fromnode> <fromport>timeData</fromport>
353       <tonode>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.MascExecStep</tonode> <toport>timeData</toport>
354    </datalink>
355    <datalink control="false">
356       <fromnode>InitCoupling</fromnode> <fromport>timeData</fromport>
357       <tonode>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.TelExecStep</tonode> <toport>timeData</toport>
358    </datalink>
359    <datalink control="false">
360       <fromnode>InitCoupling</fromnode> <fromport>log</fromport>
361       <tonode>TimeLoop.TimeBloc.TimeController</tonode> <toport>log</toport>
362    </datalink>
363    <datalink control="false">
364       <fromnode>InitCoupling</fromnode> <fromport>log</fromport>
365       <tonode>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.ConvergenceController</tonode> <toport>log</toport>
366    </datalink>
367    <datalink control="false">
368       <fromnode>InitCoupling</fromnode> <fromport>maxiter</fromport>
369       <tonode>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.ConvergenceController</tonode> <toport>maxiter</toport>
370    </datalink>
371    <datalink control="false">
372       <fromnode>InitCoupling</fromnode> <fromport>graph</fromport>
373       <tonode>TimeLoop.TimeBloc.TimeController</tonode> <toport>graph</toport>
374    </datalink>
375    <datalink control="false">
376       <fromnode>InitCoupling</fromnode> <fromport>graph</fromport>
377       <tonode>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.ConvergenceController</tonode> <toport>graph</toport>
378    </datalink>
379    <datalink control="false">
380       <fromnode>TimeLoop.TimeBloc.TimeController</fromnode> <fromport>cont</fromport>
381       <tonode>TimeLoop</tonode> <toport>condition</toport>
382    </datalink>
383    <parameter>
384       <tonode>InitMascaret</tonode><toport>studyID</toport>
385       <value><int>1</int></value>
386    </parameter>
387    <parameter>
388       <tonode>InitMascaret</tonode><toport>detCaseEntry</toport>
389       <value><string>%parse_entry(CAS_MASCARET)%</string></value>
390    </parameter>
391    <parameter>
392       <tonode>InitCoupling</tonode><toport>couplingFile</toport>
393       <value><string>%FICHIER_COUPLAGE%</string></value>
394    </parameter>
395    <parameter>
396       <tonode>InitCoupling</tonode><toport>logFile</toport>
397       <value><string>%FICHIER_LOG%</string></value>
398    </parameter>
399    <parameter>
400       <tonode>InitCoupling</tonode><toport>graphFile</toport>
401       <value><string>%FICHIER_GRAPHIQUE%</string></value>
402    </parameter>
403    <parameter>
404       <tonode>TimeLoop</tonode><toport>condition</toport>
405       <value><boolean>true</boolean></value>
406    </parameter>
407    <parameter>
408       <tonode>TimeLoop.TimeBloc.ConvergenceLoop</tonode><toport>condition</toport>
409       <value><boolean>true</boolean></value>
410    </parameter>
411    <parameter>
412       <tonode>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.ConvergenceController</tonode><toport>iter</toport>
413       <value><int>1</int></value>
414    </parameter>
415    <parameter>
416       <tonode>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.MascExecStep</tonode><toport>inputData</toport>
417       <value><objref>N.</objref></value>
418    </parameter>
419    <parameter>
420       <tonode>TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.TelExecStep</tonode><toport>inputData</toport>
421       <value><objref>N.</objref></value>
422    </parameter>
423    <parameter>
424       <tonode>InitTelemac</tonode><toport>studyID</toport>
425       <value><int>1</int></value>
426    </parameter>
427    <parameter>
428       <tonode>InitTelemac</tonode><toport>detCaseEntry</toport>
429       <value><string>%parse_entry(CAS_TELEMAC2D)%</string></value>
430    </parameter>
431    <presentation name="InitMascaret" x="166" y="32" width="158" height="90" expanded="1" expx="166" expy="32" expWidth="158" expHeight="90" shownState="0"/>
432    <presentation name="TimeLoop" x="450.5" y="32" width="760" height="764.5" expanded="1" expx="450.5" expy="32" expWidth="760" expHeight="764.5" shownState="0"/>
433    <presentation name="TimeLoop.TimeBloc" x="4" y="60" width="752" height="700.5" expanded="1" expx="4" expy="60" expWidth="752" expHeight="700.5" shownState="0"/>
434    <presentation name="TimeLoop.TimeBloc.TimeController" x="590" y="56" width="158" height="171" expanded="1" expx="590" expy="56" expWidth="158" expHeight="171" shownState="0"/>
435    <presentation name="TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.ConvergenceController" x="330.5" y="32" width="158" height="306" expanded="1" expx="330.5" expy="32" expWidth="158" expHeight="306" shownState="0"/>
436    <presentation name="TimeLoop.TimeBloc.ConvergenceLoop" x="4" y="291.5" width="503" height="405" expanded="1" expx="4" expy="291.5" expWidth="503" expHeight="405" shownState="0"/>
437    <presentation name="TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc" x="6.5" y="59" width="492.5" height="342" expanded="1" expx="6.5" expy="59" expWidth="492.5" expHeight="342" shownState="0"/>
438    <presentation name="TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.MascExecStep" x="42" y="32" width="158" height="90" expanded="1" expx="42" expy="32" expWidth="158" expHeight="90" shownState="0"/>
439    <presentation name="InitCoupling" x="3.5" y="355.5" width="158" height="306" expanded="1" expx="3.5" expy="355.5" expWidth="158" expHeight="306" shownState="0"/>
440    <presentation name="TimeLoop.TimeBloc.ConvergenceLoop.ConvergenceBloc.TelExecStep" x="86" y="168.5" width="158" height="90" expanded="1" expx="86" expy="168.5" expWidth="158" expHeight="90" shownState="0"/>
441    <presentation name="FinalizeMascaret" x="1308" y="32" width="158" height="36" expanded="1" expx="1308" expy="32" expWidth="158" expHeight="36" shownState="0"/>
442    <presentation name="InitTelemac" x="4" y="138.5" width="158" height="90" expanded="1" expx="4" expy="138.5" expWidth="158" expHeight="90" shownState="0"/>
443    <presentation name="FinalizeTelemac" x="1308" y="89" width="158" height="36" expanded="1" expx="1308" expy="89" expWidth="158" expHeight="36" shownState="0"/>
444    <presentation name="InitMascBorders" x="184" y="273.5" width="158" height="63" expanded="1" expx="184" expy="273.5" expWidth="158" expHeight="63" shownState="0"/>
445    <presentation name="InitTelBorders" x="185" y="169" width="158" height="63" expanded="1" expx="185" expy="169" expWidth="158" expHeight="63" shownState="0"/>
446    <presentation name="__ROOT__" x="0" y="0" width="1470" height="800.5" expanded="1" expx="0" expy="0" expWidth="1470" expHeight="800.5" shownState="0"/>
447 </proc>