1 .. _tui_create_iteration:
6 .. index:: single: iteration
7 .. index:: single: hypothesis
8 .. index:: single: zone
10 The variables are described in :doc:`gui_create_iteration`.
12 Methods of the class homard
13 ***************************
15 +---------------------------------------------------------------+
16 +---------------------------------------------------------------+
17 | .. module:: GetIteration |
19 | **GetIteration(iter_name)** |
20 | Returns an instance of the class ``iteration`` |
23 | - ``iter_name``: the name of the iteration |
24 +---------------------------------------------------------------+
25 | .. module:: GetAllIterationsName |
27 | **GetAllIterationsName()** |
28 | Returns the liste of the name of all the existing |
31 +---------------------------------------------------------------+
33 Methods of both classes cas and iteration
34 ****************************************"
35 See also in :doc:`tui_create_case`.
37 +---------------------------------------------------------------+
38 +---------------------------------------------------------------+
39 | .. module:: NextIteration |
41 | **NextIteration(iter_name)** |
42 | Returns an instance of the class ``iteration`` after |
43 | its creation. It is the next iteration after: |
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 |
49 | Default: the produced mesh has got the same name as the |
52 | - ``iter_name``: the name of this next iteration |
53 +---------------------------------------------------------------+
54 | .. module:: LastIteration |
56 | **LastIteration()** |
57 | Returns an instance of the class ``iteration`` that is |
58 | the last iteration into the descendants of: |
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 |
64 | It is the one that has got no child. There is an error if |
65 | more than one branch exists into the descendants. |
67 +---------------------------------------------------------------+
69 Methods of the class iteration
70 ******************************
75 +---------------------------------------------------------------+
76 +---------------------------------------------------------------+
77 | .. module:: Compute |
79 | **Compute(option1, option2)** |
80 | Computes the mesh produced by the iteration |
82 | - ``option1``: an integer to decide what to do with |
83 | existing files, if any |
85 | * 0: stop with error |
86 | * 1: the old files are removed |
88 | - ``option2``: an integer to decide what to do with |
91 | * 1: no specific action |
92 | * 2: publication into the module SMESH |
94 | Returns an integer: |
95 | * 0: successful adaptation |
96 | * other value: problem |
97 +---------------------------------------------------------------+
98 | .. module:: GetName |
101 | Returns the name of the iteration |
102 +---------------------------------------------------------------+
103 | .. module:: GetNumber |
106 | Returns the number of the iteration. |
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 |
114 | **GetIterParent()** |
115 | Returns the iteration parent |
116 +---------------------------------------------------------------+
117 | .. module:: AssociateHypo |
119 | **AssociateHypo(hypo_name)** |
120 | Associate a hypothesis with the iteration |
122 | - ``hypo_name``: the name of the hypothesis |
123 +---------------------------------------------------------------+
124 | .. module:: GetHypoName |
126 | **GetHypoName()** |
127 | Returns the name of the associated hypothesis |
128 +---------------------------------------------------------------+
129 | .. module:: GetCaseName |
131 | **GetCaseName()** |
132 | Returns the name of the associated case |
133 +---------------------------------------------------------------+
134 | .. module:: GetState |
137 | Returns the state of the iteration |
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 |
147 | Returns the name of the file with the messages all along |
148 | the running of HOMARD |
149 +---------------------------------------------------------------+
150 | .. module:: GetFileInfo |
152 | **GetFileInfo()** |
153 | Returns the name of the file with the analysis of the mesh|
154 +---------------------------------------------------------------+
155 | .. module:: GetDirName |
158 | Returns the name of the directory that contains the |
159 | results of the iteration |
160 +---------------------------------------------------------------+
161 | .. module:: Delete |
163 | **Delete(option)** |
164 | Deletes the iteration and all its children |
166 | - ``option``: an integer to define what to do with the |
167 | MED file of the associated meshes |
169 | * 0: the files are kept |
170 | * 1: the files are removed |
172 | Returns an integer: |
173 | * 0: the destruction is done |
174 | * other value: problem |
175 +---------------------------------------------------------------+
177 Information about the meshes
178 ============================
180 +---------------------------------------------------------------+
181 +---------------------------------------------------------------+
182 | .. module:: SetMeshName |
184 | **SetMeshName(mesh_name)** |
185 | Defines the name of the produced mesh |
187 | - ``mesh_name``: the name of the produced mesh |
188 +---------------------------------------------------------------+
189 | .. module:: GetMeshName |
191 | **GetMeshName()** |
192 | Returns the name of the produced mesh |
193 +---------------------------------------------------------------+
194 | .. module:: SetMeshFile |
196 | **SetMeshFile(mesh_file)** |
197 | Defines the name of the MED file of the produced mesh |
199 | - ``mesh_file``: the name of the MED file of the |
201 +---------------------------------------------------------------+
202 | .. module:: GetMeshFile |
204 | **GetMeshFile()** |
205 | Returns the name of the MED file of the produced mesh |
206 +---------------------------------------------------------------+
207 | .. module:: MeshInfo |
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. |
214 | - ``Qual``: quality of the elements |
215 | - ``Diam``: diametre of the elements |
216 | - ``Conn``: connexity of the domain; a single block, how |
218 | - ``Tail``: size of the parts of the domain, group by |
220 | - ``Inte``: staggered elements, by dimension |
221 +---------------------------------------------------------------+
223 Information about the field
224 ===========================
226 The file of the fields
227 ----------------------
229 +---------------------------------------------------------------+
230 +---------------------------------------------------------------+
231 | .. module:: SetFieldFile |
233 | **SetFieldFile(field_file)** |
234 | Defines the MED file of the fields |
236 | - ``field_file``: the name of the MED file of the fields: |
237 | the driving field for the adaptation, or the fields to |
239 +---------------------------------------------------------------+
240 | .. module:: GetFieldFileName |
242 | **GetFieldFileName()** |
243 | Returns the name of the MED file of the fields |
244 +---------------------------------------------------------------+
246 The time step for the driving field
247 -----------------------------------
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.
251 +---------------------------------------------------------------+
252 +---------------------------------------------------------------+
253 | .. module:: SetTimeStep |
255 | **SetTimeStep(TimeStep)** |
256 | Defines the time step for the driving field for the |
257 | adaptation. The rank will be ignored. |
259 | - ``TimeStep``: the selected time step |
260 +---------------------------------------------------------------+
261 | .. module:: SetTimeStepRank |
263 | **SetTimeStepRank(TimeStep, Rank)** |
264 | Defines the time step and the rank for the driving field |
265 | for the adaptation |
267 | - ``TimeStep``: the selected time step |
268 | - ``Rank``: the selected rank |
269 +---------------------------------------------------------------+
270 | .. module:: SetTimeStepRankLast |
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 |
278 | **GetTimeStep()** |
279 | Returns the selected time step for the driving field |
280 +---------------------------------------------------------------+
281 | .. module:: GetRank |
284 | Returns the selected rank for the driving field |
285 +---------------------------------------------------------------+
287 The time steps for the fields to interpolate
288 --------------------------------------------
290 The choice of the fields to interpolated are defined in the hypothesis (see :doc:`tui_create_hypothese`).
291 For a given field, if nothing is declared, every single time step will be considered.
292 If some time steps are wanted, they must be defined as follows.
294 +---------------------------------------------------------------+
295 +---------------------------------------------------------------+
296 | .. module:: SetFieldInterpTimeStep |
298 | **SetFieldInterpTimeStep(FieldName, TimeStep)** |
299 | Defines the time step for the interpolation of the field. |
300 | The rank will be ignored. |
302 | - ``FieldName``: the name of the field to interpolate |
303 | - ``TimeStep``: the selected time step |
304 +---------------------------------------------------------------+
305 | .. module:: SetFieldInterpTimeStepRank |
307 | **SetFieldInterpTimeStepRank(FieldName, TimeStep)** |
308 | Defines the time step and the rank for the interpolation |
311 | - ``FieldName``: the name of the field to interpolate |
312 | - ``TimeStep``: the selected time step |
313 | - ``Rank``: the selected rank |
314 +---------------------------------------------------------------+
315 | .. module:: GetFieldInterpsTimeStepRank |
317 | **GetFieldInterpsTimeStepRank()** |
318 | Returns the information (name of the field, time step, |
321 | Warning: the time step and the rank are stored as strings |
322 | in the list and not as integers. |
324 | Example: ['DEPL', '1', '1', 'DEPL', '2', '1', 'Mass', |
325 | '2', '0', 'Mass', '3', '0'] |
326 +---------------------------------------------------------------+
331 +---------------------------------------------------------------+
332 +---------------------------------------------------------------+
333 | .. module:: SetInfoCompute |
335 | **SetInfoCompute(MessInfo)** |
336 | Defines options to track the computation of the iteration |
338 | - ``MessInfo``: integer that drives prints, as a multiple |
341 | * 1 : nothing (default) |
342 | * 2x : computational time |
345 +---------------------------------------------------------------+
346 | .. module:: GetInfoCompute |
348 | **GetInfoCompute()** |
349 | Returns the options to track the computation |
350 +---------------------------------------------------------------+
355 .. index:: single: mesh;initial
357 To create the first iteration, the starting point is the iteration associated to the initial mesh. It is the one that defines the case.
360 iter_name = "Iteration_1"
361 iter_1 = case_1.NextIteration(iter_name)
362 iter_1.SetField(field_file)
363 iter_1.SetTimeStepRank( 0, 0)
364 iter_1.SetMeshName("maill_01")
365 iter_1.SetMeshFile("/local00/M.01.med")
366 iter_1.AssociateHypo("HypoField")
367 codret = iter_1.Compute(1, 2)
369 Then, the next iteration is created from the current iteration.
372 iter_name = "Iteration_2"
373 iter_2 = iter_1.NextIteration(iter_name)
374 iter_2.SetField(field_file)
375 iter_2.SetTimeStepRank( 1, 1)
376 iter_2.SetMeshName("maill_02")
377 iter_2.SetMeshFile("/local00/M.02.med")
378 iter_2.AssociateHypo("HypoField")
379 codret = iter_2.Compute(1, 2)
382 Similar graphical input
383 ***********************
384 Look at :doc:`gui_create_iteration`