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 *****************************************
36 +---------------------------------------------------------------+
37 +---------------------------------------------------------------+
38 | .. module:: NextIteration |
40 | **NextIteration(iter_name)** |
41 | Returns an instance of the class ``iteration`` after |
42 | its creation. It is the next iteration after: |
44 | - for a case: the very first one that corresponds to the |
45 | first mesh of the case |
46 | - for an iteration: the current iteration |
48 | Default: the produced mesh has got the same name as the |
51 | - ``iter_name``: the name of this next iteration |
52 +---------------------------------------------------------------+
53 | .. module:: LastIteration |
55 | **LastIteration()** |
56 | Returns an instance of the class ``iteration`` that is |
57 | the last iteration into the descendants of: |
59 | - for a case: the very first one that corresponds to the |
60 | first mesh of the case |
61 | - for an iteration: the current iteration |
63 | It is the one that has got no child. There is an error if |
64 | more than one branch exists into the descendants. |
66 +---------------------------------------------------------------+
68 Methods of the class iteration
69 ******************************
74 +---------------------------------------------------------------+
75 +---------------------------------------------------------------+
76 | .. module:: Compute |
78 | **Compute(option1, option2)** |
79 | Computes the mesh produced by the iteration |
81 | - ``option1``: an integer to decide what to do with |
82 | existing files, if any |
84 | * 0: stop with error |
85 | * 1: the old files are removed |
87 | - ``option2``: an integer to decide what to do with |
90 | * 1: no specific action |
91 | * 2: publication into the module SMESH |
93 | Returns an integer: |
94 | * 0: successful adaptation |
95 | * other value: problem |
96 +---------------------------------------------------------------+
97 | .. module:: GetName |
100 | Returns the name of the iteration |
101 +---------------------------------------------------------------+
102 | .. module:: GetNumber |
105 | Returns the number of the iteration. |
107 | The iteration #0 is the one associated to the initial |
108 | mesh. Then, an iteration with number #N comes from the |
109 | adaptation of an iteration with number #(N-1). |
110 +---------------------------------------------------------------+
111 | .. module:: GetIterParent |
113 | **GetIterParent()** |
114 | Returns the iteration parent |
115 +---------------------------------------------------------------+
116 | .. module:: AssociateHypo |
118 | **AssociateHypo(hypo_name)** |
119 | Associate an hypothesis with the iteration |
121 | - ``hypo_name``: the name of the hypothesis |
122 +---------------------------------------------------------------+
123 | .. module:: GetHypoName |
125 | **GetHypoName()** |
126 | Returns the name of the associated hypothesis |
127 +---------------------------------------------------------------+
128 | .. module:: GetCaseName |
130 | **GetCaseName()** |
131 | Returns the name of the associated case |
132 +---------------------------------------------------------------+
133 | .. module:: GetState |
136 | Returns the state of the iteration |
138 | - ``2``: computed iteration |
139 | - ``1``: non computed iteration |
140 | - ``<=0``: initial iteration not to be computed, with a |
141 | number equal to the absolute valure of the state |
142 +---------------------------------------------------------------+
143 | .. module:: GetLogFile |
146 | Returns the name of the file with the messages all along |
147 | the running of HOMARD |
148 +---------------------------------------------------------------+
149 | .. module:: GetFileInfo |
151 | **GetFileInfo()** |
152 | Returns the name of the file with the analysis of the mesh|
153 +---------------------------------------------------------------+
154 | .. module:: GetDirName |
157 | Returns the name of the directory that contains the |
158 | results of the iteration |
159 +---------------------------------------------------------------+
160 | .. module:: Delete |
162 | **Delete(option)** |
163 | Deletes the iteration and all its children |
165 | - ``option``: an integer to define what to do with the |
166 | MED file of the associated meshes |
168 | * 0: the files are kept |
169 | * 1: the files are removed |
171 | Returns an integer: |
172 | * 0: the destruction is done |
173 | * other value: problem |
174 +---------------------------------------------------------------+
176 Information about the meshes
177 ============================
179 +---------------------------------------------------------------+
180 +---------------------------------------------------------------+
181 | .. module:: SetMeshName |
183 | **SetMeshName(mesh_name)** |
184 | Defines the name of the produced mesh |
186 | - ``mesh_name``: the name of the produced mesh |
187 +---------------------------------------------------------------+
188 | .. module:: GetMeshName |
190 | **GetMeshName()** |
191 | Returns the name of the produced mesh |
192 +---------------------------------------------------------------+
193 | .. module:: SetMeshFile |
195 | **SetMeshFile(mesh_file)** |
196 | Defines the name of the MED file of the produced mesh |
198 | - ``mesh_file``: the name of the MED file of the |
200 +---------------------------------------------------------------+
201 | .. module:: GetMeshFile |
203 | **GetMeshFile()** |
204 | Returns the name of the MED file of the produced mesh |
205 +---------------------------------------------------------------+
206 | .. module:: MeshInfo |
208 | **MeshInfo(Qual, Diam, Conn, Tail, Inte)** |
209 | Gives information about the current mesh. For every |
210 | option, the choice #0 corresponds to 'no action', while |
211 | the choice #1 launches the option. |
213 | - ``Qual``: quality of the elements |
214 | - ``Diam``: diametre of the elements |
215 | - ``Conn``: connexity of the domain; a single block, how |
217 | - ``Tail``: size of the parts of the domain, group by |
219 | - ``Inte``: staggered elements, by dimension |
220 +---------------------------------------------------------------+
222 Information about the field
223 ===========================
225 +---------------------------------------------------------------+
226 +---------------------------------------------------------------+
227 | .. module:: SetFieldFile |
229 | **SetFieldFile(field_file)** |
230 | Defines the MED file of the field |
232 | - ``field_file``: the name of the MED file of the field |
233 +---------------------------------------------------------------+
234 | .. module:: SetTimeStepRank |
236 | **SetTimeStepRank(TimeStep, Rank)** |
237 | Defines the time steps for the fields |
239 | Useless if no time step is defined for the field. |
241 | If a single time step is defined for the filed, it is the |
244 | - ``TimeStep``: the selected time step |
245 | - ``Rank``: the selected rank |
246 +---------------------------------------------------------------+
247 | .. module:: SetTimeStepRankLast |
249 | **SetTimeStepRankLast()** |
250 | The last time step will be used, whatever its value |
251 +---------------------------------------------------------------+
252 | .. module:: GetFieldFileName |
254 | **GetFieldFileName()** |
255 | Returns the name of the MED file of the field |
256 +---------------------------------------------------------------+
257 | .. module:: GetTimeStep |
259 | **GetTimeStep()** |
260 | Returns the selected time step for the field |
261 +---------------------------------------------------------------+
262 | .. module:: GetRank |
265 | Returns the selected rank for the field |
266 +---------------------------------------------------------------+
270 .. index:: single: mesh;initial
272 To create the first iteration, the starting point is the iteration associated to the initial mesh. It is the one that defines the case.
275 iter_name = "Iteration_1"
276 iter_1 = case_1.NextIteration(iter_name)
277 iter_1.SetField(field_file)
278 iter_1.SetTimeStepRank( 0, 0)
279 iter_1.SetMeshName("maill_01")
280 iter_1.SetMeshFile("/local00/M.01.med")
281 iter_1.AssociateHypo("HypoField")
282 codret = iter_1.Compute(1, 2)
284 Then, the next iteration is created from the current iteration.
287 iter_name = "Iteration_2"
288 iter_2 = iter_1.NextIteration(iter_name)
289 iter_2.SetField(field_file)
290 iter_2.SetTimeStepRank( 1, 1)
291 iter_2.SetMeshName("maill_02")
292 iter_2.SetMeshFile("/local00/M.02.med")
293 iter_2.AssociateHypo("HypoField")
294 codret = iter_2.Compute(1, 2)
297 Similar graphical input
298 ***********************
299 Look at :ref:`gui_create_iteration`