1 .. _tui_create_iteration:
6 .. index:: single: iteration
7 .. index:: single: hypothesis
8 .. index:: single: zone
10 The variables are described in :ref:`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 :ref:`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 an 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 +---------------------------------------------------------------+
227 +---------------------------------------------------------------+
228 | .. module:: SetFieldFile |
230 | **SetFieldFile(field_file)** |
231 | Defines the MED file of the field |
233 | - ``field_file``: the name of the MED file of the field |
234 +---------------------------------------------------------------+
235 | .. module:: SetTimeStepRank |
237 | **SetTimeStepRank(TimeStep, Rank)** |
238 | Defines the time steps for the fields |
240 | Useless if no time step is defined for the field. |
242 | If a single time step is defined for the filed, it is the |
245 | - ``TimeStep``: the selected time step |
246 | - ``Rank``: the selected rank |
247 +---------------------------------------------------------------+
248 | .. module:: SetTimeStepRankLast |
250 | **SetTimeStepRankLast()** |
251 | The last time step will be used, whatever its value |
252 +---------------------------------------------------------------+
253 | .. module:: GetFieldFileName |
255 | **GetFieldFileName()** |
256 | Returns the name of the MED file of the field |
257 +---------------------------------------------------------------+
258 | .. module:: GetTimeStep |
260 | **GetTimeStep()** |
261 | Returns the selected time step for the field |
262 +---------------------------------------------------------------+
263 | .. module:: GetRank |
266 | Returns the selected rank for the field |
267 +---------------------------------------------------------------+
272 +---------------------------------------------------------------+
273 +---------------------------------------------------------------+
274 | .. module:: SetInfoCompute |
276 | **SetInfoCompute(MessInfo)** |
277 | Defines options to track the computation of the iteration |
279 | - ``MessInfo`` : integer that drives prints, as a multiple|
282 | * 1 : nothing (default) |
283 | * 2x : computational time |
286 +---------------------------------------------------------------+
287 | .. module:: GetInfoCompute |
289 | **GetInfoCompute()** |
290 | Returns the options to track the computation |
291 +---------------------------------------------------------------+
296 .. index:: single: mesh;initial
298 To create the first iteration, the starting point is the iteration associated to the initial mesh. It is the one that defines the case.
301 iter_name = "Iteration_1"
302 iter_1 = case_1.NextIteration(iter_name)
303 iter_1.SetField(field_file)
304 iter_1.SetTimeStepRank( 0, 0)
305 iter_1.SetMeshName("maill_01")
306 iter_1.SetMeshFile("/local00/M.01.med")
307 iter_1.AssociateHypo("HypoField")
308 codret = iter_1.Compute(1, 2)
310 Then, the next iteration is created from the current iteration.
313 iter_name = "Iteration_2"
314 iter_2 = iter_1.NextIteration(iter_name)
315 iter_2.SetField(field_file)
316 iter_2.SetTimeStepRank( 1, 1)
317 iter_2.SetMeshName("maill_02")
318 iter_2.SetMeshFile("/local00/M.02.med")
319 iter_2.AssociateHypo("HypoField")
320 codret = iter_2.Compute(1, 2)
323 Similar graphical input
324 ***********************
325 Look at :ref:`gui_create_iteration`