Salome HOME
Merge Python 3 porting.
[modules/yacs.git] / src / yacsloader / samples / foreach7.xml
1 <?xml version='1.0' encoding='iso-8859-1' ?>
2 <!--
3   Copyright (C) 2006-2016  CEA/DEN, EDF R&D
4
5   This library is free software; you can redistribute it and/or
6   modify it under the terms of the GNU Lesser General Public
7   License as published by the Free Software Foundation; either
8   version 2.1 of the License, or (at your option) any later version.
9
10   This library is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13   Lesser General Public License for more details.
14
15   You should have received a copy of the GNU Lesser General Public
16   License along with this library; if not, write to the Free Software
17   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
18
19   See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20
21 -->
22 <proc name="newSchema_1">
23    <type name="string" kind="string"/>
24    <struct name="Engines/dataref">
25       <member name="ref" type="string"/>
26    </struct>
27    <objref name="GEOM_Object" id="IDL:GEOM/GEOM_Object:1.0"/>
28    <type name="bool" kind="bool"/>
29    <sequence name="boolvec" content="bool"/>
30    <type name="double" kind="double"/>
31    <sequence name="dblevec" content="double"/>
32    <objref name="file" id="file"/>
33    <type name="int" kind="int"/>
34    <sequence name="intvec" content="int"/>
35    <objref name="pyobj" id="python:obj:1.0"/>
36    <sequence name="seqpyobj" content="pyobj"/>
37    <sequence name="stringvec" content="string"/>
38    <container name="DefaultContainer">
39       <property name="container_name" value="FactoryServer"/>
40       <property name="name" value="localhost"/>
41    </container>
42    <container name="container0">
43    </container>
44    <container name="container8">
45    </container>
46    <foreach name="ForEachLoop_pyobj0" type="pyobj">
47       <bloc name="Bloc1">
48          <remote name="PyFunction4">
49             <function name="fromPyObj2String">
50                <code><![CDATA[def fromPyObj2String(aRun,):
51     aMedFile = aRun[0]
52     aMeshName = aRun[1]
53     return aMedFile,aMeshName
54 ]]></code>
55             </function>
56             <load container="container8"/>
57             <inport name="aRun" type="pyobj"/>
58             <outport name="aMedFile" type="string"/>
59             <outport name="aMeshName" type="string"/>
60          </remote>
61          <service name="MakeBoxDXDYDZ1">
62             <component>GEOM_Superv</component>
63             <load container="container8"/>
64             <method>MakeBoxDXDYDZ</method>
65             <inport name="theDX" type="double"/>
66             <inport name="theDY" type="double"/>
67             <inport name="theDZ" type="double"/>
68             <outport name="return" type="GEOM_Object"/>
69          </service>
70          <control> <fromnode>PyFunction4</fromnode> <tonode>MakeBoxDXDYDZ1</tonode> </control>
71       </bloc>
72    </foreach>
73    <inline name="PyScript1">
74       <script><code><![CDATA[import os
75 numberOfRun = 5
76 runs = []
77 dir1 = "/home/crouzet/SUPPORT/NADIR"
78 dir2 = "/TestFAKECOMPO/"
79 medFile = dir1+dir2+"AlcyoneFields.med"
80 meshName="LE DOMAINE"
81 for run in range(numberOfRun):
82     runs.append([])
83     runs[run].append(medFile)
84     runs[run].append(meshName)
85     pass
86 print("There is(are) ",numberOfRun," runs of Fake Compo on process ",os.getpid())
87 ]]></code></script>
88       <outport name="numberOfRun" type="int"/>
89       <outport name="runs" type="seqpyobj"/>
90    </inline>
91    <control> <fromnode>PyScript1</fromnode> <tonode>ForEachLoop_pyobj0</tonode> </control>
92    <datalink control="false">
93       <fromnode>ForEachLoop_pyobj0</fromnode> <fromport>evalSamples</fromport>
94       <tonode>ForEachLoop_pyobj0.Bloc1.PyFunction4</tonode> <toport>aRun</toport>
95    </datalink>
96    <datalink control="false">
97       <fromnode>PyScript1</fromnode> <fromport>numberOfRun</fromport>
98       <tonode>ForEachLoop_pyobj0</tonode> <toport>nbBranches</toport>
99    </datalink>
100    <datalink control="false">
101       <fromnode>PyScript1</fromnode> <fromport>runs</fromport>
102       <tonode>ForEachLoop_pyobj0</tonode> <toport>SmplsCollection</toport>
103    </datalink>
104    <parameter>
105       <tonode>ForEachLoop_pyobj0.Bloc1.MakeBoxDXDYDZ1</tonode><toport>theDX</toport>
106       <value><double>10</double></value>
107    </parameter>
108    <parameter>
109       <tonode>ForEachLoop_pyobj0.Bloc1.MakeBoxDXDYDZ1</tonode><toport>theDY</toport>
110       <value><double>10</double></value>
111    </parameter>
112    <parameter>
113       <tonode>ForEachLoop_pyobj0.Bloc1.MakeBoxDXDYDZ1</tonode><toport>theDZ</toport>
114       <value><double>10</double></value>
115    </parameter>
116    <presentation name="ForEachLoop_pyobj0" x="283.5" y="74.5" width="457.5" height="281.5" expanded="1" expx="283.5" expy="74.5" expWidth="457.5" expHeight="281.5" shownState="0"/>
117    <presentation name="ForEachLoop_pyobj0.Bloc1" x="41.5" y="124.5" width="412" height="153" expanded="1" expx="41.5" expy="124.5" expWidth="412" expHeight="153" shownState="0"/>
118    <presentation name="PyScript1" x="40" y="75" width="158" height="90" expanded="1" expx="40" expy="75" expWidth="158" expHeight="90" shownState="0"/>
119    <presentation name="ForEachLoop_pyobj0.Bloc1.PyFunction4" x="10" y="35" width="158" height="90" expanded="1" expx="10" expy="35" expWidth="158" expHeight="90" shownState="0"/>
120    <presentation name="ForEachLoop_pyobj0.Bloc1.MakeBoxDXDYDZ1" x="250" y="32" width="158" height="117" expanded="1" expx="250" expy="32" expWidth="158" expHeight="117" shownState="0"/>
121    <presentation name="__ROOT__" x="0" y="0" width="745" height="360" expanded="1" expx="0" expy="0" expWidth="745" expHeight="360" shownState="0"/>
122 </proc>