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