]> SALOME platform Git repositories - modules/homard.git/blob - doc/en/tui_create_iteration.rst
Salome HOME
Introduction de la doculmentation en anglais - phase 3
[modules/homard.git] / doc / en / tui_create_iteration.rst
1 .. _tui_create_iteration:
2
3 The iteration
4 =============
5
6 .. index:: single: iteration
7 .. index:: single: hypothesis
8 .. index:: single: zone
9
10 The variables are described in :ref:`gui_create_iteration`.
11
12 Methods of the class homard
13 """"""""""""""""""""""""""""
14
15 +---------------------------------------------------------------+
16 +---------------------------------------------------------------+
17 | .. module:: GetIteration                                      |
18 |                                                               |
19 | **GetIteration(iter_name)**                                   |
20 |     Returns an instance of the class ``iteration``            |
21 |     known by its name                                         |
22 |                                                               |
23 |     - ``iter_name``: the name of the iteration                |
24 +---------------------------------------------------------------+
25 | .. module:: GetAllIterationsName                              |
26 |                                                               |
27 | **GetAllIterationsName()**                                    |
28 |     Returns the liste of the name of all the existing         |
29 |     iterations                                                |
30 |                                                               |
31 +---------------------------------------------------------------+
32
33 Methods of the class cas
34 """""""""""""""""""""""""
35
36 +---------------------------------------------------------------+
37 +---------------------------------------------------------------+
38 | .. module:: NextIteration                                     |
39 |                                                               |
40 | **NextIteration(iter_name)**                                  |
41 |     Returns an instance of the class ``iteration`` after      |
42 |     its creation: it is the next iteration after the very     |
43 |     first one that corresponds to the first mesh of the case  |
44 |                                                               |
45 |     - ``iter_name``: the name of this next iteration          |
46 |                                                               |
47 | Default:                                                      |
48 |                                                               |
49 |  * the produced mesh has got the same name as the iteration   |
50 +---------------------------------------------------------------+
51 | .. module:: LastIteration                                     |
52 |                                                               |
53 | **LastIteration()**                                           |
54 |     Returns an instance of the class ``iteration``: the last  |
55 |     iteration into the descendants of the initial iteration   |
56 |     of the case. It is the one that has got no child. There is|
57 |     an error if more than one branch exists into the          |
58 |     descendants.                                              |
59 |                                                               |
60 +---------------------------------------------------------------+
61
62 Methods of the class iteration
63 """"""""""""""""""""""""""""""
64
65 General methods
66 ^^^^^^^^^^^^^^^
67
68 +---------------------------------------------------------------+
69 +---------------------------------------------------------------+
70 | .. module:: NextIteration                                     |
71 |                                                               |
72 | **NextIteration(iter_name)**                                  |
73 |     Returns an instance of the class ``iteration`` after      |
74 |     its creation: it is the next iteration after the current  |
75 |     one                                                       |
76 |                                                               |
77 |     - ``iter_name``: the name of this next iteration          |
78 |                                                               |
79 | Default:                                                      |
80 |                                                               |
81 |  * the produced mesh has got the same name as the iteration   |
82 +---------------------------------------------------------------+
83 | .. module:: Compute                                           |
84 |                                                               |
85 | **Compute(option1, option2)**                                 |
86 |     Computes the mesh produced by the iteration               |
87 |                                                               |
88 |     - ``option1``: an integer to decide what to do with       |
89 |       existing files, if any                                  |
90 |                                                               |
91 |         * 0: stop with error                                  |
92 |         * 1: the old files are removed                        |
93 |                                                               |
94 |     - ``option2``: an integer to decide what to do with       |
95 |       the results                                             |
96 |                                                               |
97 |         * 1: no specific action                               |
98 |         * 2: publication into the module SMESH                |
99 |                                                               |
100 |     Returns an integer:                                       |
101 |         * 0: successful adaptation                            |
102 |         * other value: problem                                |
103 +---------------------------------------------------------------+
104 | .. module:: GetName                                           |
105 |                                                               |
106 | **GetName()**                                                 |
107 |     Returns the name of the iteration                         |
108 +---------------------------------------------------------------+
109 | .. module:: GetNumber                                         |
110 |                                                               |
111 | **GetNumber()**                                               |
112 |     Returns the number of the iteration.                      |
113 |                                                               |
114 |     The iteration #0 is the one associated to the initial     |
115 |     mesh. Then, an iteration with number #N comes from the    |
116 |     adaptation of an iteration with number #(N-1).            |
117 +---------------------------------------------------------------+
118 | .. module:: GetIterParent                                     |
119 |                                                               |
120 | **GetIterParent()**                                           |
121 |     Returns the iteration parent                              |
122 +---------------------------------------------------------------+
123 | .. module:: LastIteration                                     |
124 |                                                               |
125 | **LastIteration()**                                           |
126 |     Returns an instance of the class ``iteration``: the last  |
127 |     iteration into the descendants of the current iteration.  |
128 |     It is the one that has got no child. There is             |
129 |     an error if more than one branch exists into the          |
130 |     descendants.                                              |
131 +---------------------------------------------------------------+
132 | .. module:: AssociateHypo                                     |
133 |                                                               |
134 | **AssociateHypo(hypo_name)**                                  |
135 |     Associate an hypothesis with the iteration                |
136 |                                                               |
137 |     - ``hypo_name``: the name of the hypothesis               |
138 +---------------------------------------------------------------+
139 | .. module:: GetHypoName                                       |
140 |                                                               |
141 | **GetHypoName()**                                             |
142 |     Returns the name of the associated hypothesis             |
143 +---------------------------------------------------------------+
144 | .. module:: GetCaseName                                       |
145 |                                                               |
146 | **GetCaseName()**                                             |
147 |     Returns the name of the associated case                   |
148 +---------------------------------------------------------------+
149 | .. module:: GetState                                          |
150 |                                                               |
151 | **GetState()**                                                |
152 |     Returns the state of the iteration                        |
153 |                                                               |
154 |     - ``2``: computed iteration                               |
155 |     - ``1``: non computed iteration                           |
156 |     - ``<=0``: initial iteration not to be computed, with a   |
157 |       number equal to the absolute valure of the state        |
158 +---------------------------------------------------------------+
159 | .. module:: GetLogFile                                        |
160 |                                                               |
161 | **GetLogFile()**                                              |
162 |     Returns the name of the file with the messages all along  |
163 |     the running of HOMARD                                     |
164 +---------------------------------------------------------------+
165 | .. module:: GetFileInfo                                       |
166 |                                                               |
167 | **GetFileInfo()**                                             |
168 |     Returns the name of the file with the analysis of the mesh|
169 +---------------------------------------------------------------+
170 | .. module:: GetDirName                                        |
171 |                                                               |
172 | **GetDirName()**                                              |
173 |     Returns the name of the directory that contains the       |
174 |     results of the iteration                                  |
175 +---------------------------------------------------------------+
176 | .. module:: Delete                                            |
177 |                                                               |
178 | **Delete(option)**                                            |
179 |     Deletes the iteration and all its children                |
180 |                                                               |
181 |     - ``option``: an integer to define what to do with the    |
182 |       MED file of the associated meshes                       |
183 |                                                               |
184 |         * 0: the files are kept                               |
185 |         * 1: the files are removed                            |
186 |                                                               |
187 |     Returns an integer:                                       |
188 |         * 0: the destruction is done                          |
189 |         * other value: problem                                |
190 +---------------------------------------------------------------+
191
192 Information about the meshes
193 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
194
195 +---------------------------------------------------------------+
196 +---------------------------------------------------------------+
197 | .. module:: SetMeshName                                       |
198 |                                                               |
199 | **SetMeshName(mesh_name)**                                    |
200 |     Defines the name of the produced mesh                     |
201 |                                                               |
202 |     - ``mesh_name``: the name of the produced mesh            |
203 +---------------------------------------------------------------+
204 | .. module:: GetMeshName                                       |
205 |                                                               |
206 | **GetMeshName()**                                             |
207 |     Returns the name of the produced mesh                     |
208 +---------------------------------------------------------------+
209 | .. module:: SetMeshFile                                       |
210 |                                                               |
211 | **SetMeshFile(mesh_file)**                                    |
212 |     Defines the name of the MED file of the produced mesh     |
213 |                                                               |
214 |     - ``mesh_file``: the name of the MED file of the          |
215 |       produced mesh                                           |
216 +---------------------------------------------------------------+
217 | .. module:: GetMeshFile                                       |
218 |                                                               |
219 | **GetMeshFile()**                                             |
220 |     Returns the name of the MED file of the produced mesh     |
221 +---------------------------------------------------------------+
222 | .. module:: MeshInfo                                          |
223 |                                                               |
224 | **MeshInfo(Qual, Diam, Conn, Tail, Inte)**                    |
225 |     Gives information about the current mesh. For every       |
226 |     option, the choice #0 corresponds to 'no action', while   |
227 |     the choice #1 launches the option.                        |
228 |                                                               |
229 |     - ``Qual``: quality of the elements                       |
230 |     - ``Diam``: diametre of the elements                      |
231 |     - ``Conn``: connexity of the domain; a single block, how  |
232 |       many holes, etc.                                        |
233 |     - ``Tail``: size of the parts of the domain, group by     |
234 |       group                                                   |
235 |     - ``Inte``: staggered elements, by dimension              |
236 +---------------------------------------------------------------+
237
238 Information about the field
239 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
240
241 +---------------------------------------------------------------+
242 +---------------------------------------------------------------+
243 | .. module:: SetFieldFile                                      |
244 |                                                               |
245 | **SetFieldFile(field_file)**                                  |
246 |     Defines the MED file of the field                         |
247 |                                                               |
248 |     - ``field_file``: the name of the MED file of the field   |
249 +---------------------------------------------------------------+
250 | .. module:: SetTimeStepRank                                   |
251 |                                                               |
252 | **SetTimeStepRank(TimeStep, Rank)**                           |
253 |     Defines the time steps for the fields                     |
254 |                                                               |
255 |     Useless if no time step is defined for the field.         |
256 |                                                               |
257 |     If a single time step is defined for the filed, it is the |
258 |     default choice.                                           |
259 |                                                               |
260 |     - ``TimeStep``: the selected time step                    |
261 |     - ``Rank``: the selected rank                             |
262 +---------------------------------------------------------------+
263 | .. module:: SetTimeStepRankLast                               |
264 |                                                               |
265 | **SetTimeStepRankLast()**                                     |
266 |     The last time step will be used, whatever its value       |
267 +---------------------------------------------------------------+
268 | .. module:: GetFieldFileName                                  |
269 |                                                               |
270 | **GetFieldFileName()**                                        |
271 |     Returns the name of the MED file of the field             |
272 +---------------------------------------------------------------+
273 | .. module:: GetTimeStep                                       |
274 |                                                               |
275 | **GetTimeStep()**                                             |
276 |     Returns the selected time step for the field              |
277 +---------------------------------------------------------------+
278 | .. module:: GetRank                                           |
279 |                                                               |
280 | **GetRank()**                                                 |
281 |     Returns the selected rank for the field                   |
282 +---------------------------------------------------------------+
283
284 Example
285 """""""
286 .. index:: single: mesh;initial
287
288 To create the first iteration, the starting point is the iteration associated to the initial mesh. It is the one that defines the case.
289 ::
290
291     iter_name = "Iteration_1"
292     iter_1 = case_1.NextIteration(iter_name)
293     iter_1.SetField(field_file)
294     iter_1.SetTimeStepRank( 0, 0)
295     iter_1.SetMeshName("maill_01")
296     iter_1.SetMeshFile("/local00/M.01.med")
297     iter_1.AssociateHypo("HypoField")
298     codret = iter_1.Compute(1, 2)
299
300 Then, the next iteration is created from the current iteration.
301 ::
302
303     iter_name = "Iteration_2"
304     iter_2 = iter_1.NextIteration(iter_name)
305     iter_2.SetField(field_file)
306     iter_2.SetTimeStepRank( 1, 1)
307     iter_2.SetMeshName("maill_02")
308     iter_2.SetMeshFile("/local00/M.02.med")
309     iter_2.AssociateHypo("HypoField")
310     codret = iter_2.Compute(1, 2)
311
312
313 Similar graphical input
314 """""""""""""""""""""""
315 Look at :ref:`gui_create_iteration`