Salome HOME
simplification
[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
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:             |
43 |                                                               |
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                 |
47 |                                                               |
48 | Default:  the produced mesh has got the same name as the      |
49 | iteration                                                     |
50 |                                                               |
51 |     - ``iter_name``: the name of this next iteration          |
52 +---------------------------------------------------------------+
53 | .. module:: LastIteration                                     |
54 |                                                               |
55 | **LastIteration()**                                           |
56 |     Returns an instance of the class ``iteration`` that is    |
57 |     the last iteration into the descendants of:               |
58 |                                                               |
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                 |
62 |                                                               |
63 |     It is the one that has got no child. There is an error if |
64 |     more than one branch exists into the descendants.         |
65 |                                                               |
66 +---------------------------------------------------------------+
67
68 Methods of the class iteration
69 """"""""""""""""""""""""""""""
70
71 General methods
72 ^^^^^^^^^^^^^^^
73
74 +---------------------------------------------------------------+
75 +---------------------------------------------------------------+
76 | .. module:: Compute                                           |
77 |                                                               |
78 | **Compute(option1, option2)**                                 |
79 |     Computes the mesh produced by the iteration               |
80 |                                                               |
81 |     - ``option1``: an integer to decide what to do with       |
82 |       existing files, if any                                  |
83 |                                                               |
84 |         * 0: stop with error                                  |
85 |         * 1: the old files are removed                        |
86 |                                                               |
87 |     - ``option2``: an integer to decide what to do with       |
88 |       the results                                             |
89 |                                                               |
90 |         * 1: no specific action                               |
91 |         * 2: publication into the module SMESH                |
92 |                                                               |
93 |     Returns an integer:                                       |
94 |         * 0: successful adaptation                            |
95 |         * other value: problem                                |
96 +---------------------------------------------------------------+
97 | .. module:: GetName                                           |
98 |                                                               |
99 | **GetName()**                                                 |
100 |     Returns the name of the iteration                         |
101 +---------------------------------------------------------------+
102 | .. module:: GetNumber                                         |
103 |                                                               |
104 | **GetNumber()**                                               |
105 |     Returns the number of the iteration.                      |
106 |                                                               |
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                                     |
112 |                                                               |
113 | **GetIterParent()**                                           |
114 |     Returns the iteration parent                              |
115 +---------------------------------------------------------------+
116 | .. module:: AssociateHypo                                     |
117 |                                                               |
118 | **AssociateHypo(hypo_name)**                                  |
119 |     Associate an hypothesis with the iteration                |
120 |                                                               |
121 |     - ``hypo_name``: the name of the hypothesis               |
122 +---------------------------------------------------------------+
123 | .. module:: GetHypoName                                       |
124 |                                                               |
125 | **GetHypoName()**                                             |
126 |     Returns the name of the associated hypothesis             |
127 +---------------------------------------------------------------+
128 | .. module:: GetCaseName                                       |
129 |                                                               |
130 | **GetCaseName()**                                             |
131 |     Returns the name of the associated case                   |
132 +---------------------------------------------------------------+
133 | .. module:: GetState                                          |
134 |                                                               |
135 | **GetState()**                                                |
136 |     Returns the state of the iteration                        |
137 |                                                               |
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                                        |
144 |                                                               |
145 | **GetLogFile()**                                              |
146 |     Returns the name of the file with the messages all along  |
147 |     the running of HOMARD                                     |
148 +---------------------------------------------------------------+
149 | .. module:: GetFileInfo                                       |
150 |                                                               |
151 | **GetFileInfo()**                                             |
152 |     Returns the name of the file with the analysis of the mesh|
153 +---------------------------------------------------------------+
154 | .. module:: GetDirName                                        |
155 |                                                               |
156 | **GetDirName()**                                              |
157 |     Returns the name of the directory that contains the       |
158 |     results of the iteration                                  |
159 +---------------------------------------------------------------+
160 | .. module:: Delete                                            |
161 |                                                               |
162 | **Delete(option)**                                            |
163 |     Deletes the iteration and all its children                |
164 |                                                               |
165 |     - ``option``: an integer to define what to do with the    |
166 |       MED file of the associated meshes                       |
167 |                                                               |
168 |         * 0: the files are kept                               |
169 |         * 1: the files are removed                            |
170 |                                                               |
171 |     Returns an integer:                                       |
172 |         * 0: the destruction is done                          |
173 |         * other value: problem                                |
174 +---------------------------------------------------------------+
175
176 Information about the meshes
177 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
178
179 +---------------------------------------------------------------+
180 +---------------------------------------------------------------+
181 | .. module:: SetMeshName                                       |
182 |                                                               |
183 | **SetMeshName(mesh_name)**                                    |
184 |     Defines the name of the produced mesh                     |
185 |                                                               |
186 |     - ``mesh_name``: the name of the produced mesh            |
187 +---------------------------------------------------------------+
188 | .. module:: GetMeshName                                       |
189 |                                                               |
190 | **GetMeshName()**                                             |
191 |     Returns the name of the produced mesh                     |
192 +---------------------------------------------------------------+
193 | .. module:: SetMeshFile                                       |
194 |                                                               |
195 | **SetMeshFile(mesh_file)**                                    |
196 |     Defines the name of the MED file of the produced mesh     |
197 |                                                               |
198 |     - ``mesh_file``: the name of the MED file of the          |
199 |       produced mesh                                           |
200 +---------------------------------------------------------------+
201 | .. module:: GetMeshFile                                       |
202 |                                                               |
203 | **GetMeshFile()**                                             |
204 |     Returns the name of the MED file of the produced mesh     |
205 +---------------------------------------------------------------+
206 | .. module:: MeshInfo                                          |
207 |                                                               |
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.                        |
212 |                                                               |
213 |     - ``Qual``: quality of the elements                       |
214 |     - ``Diam``: diametre of the elements                      |
215 |     - ``Conn``: connexity of the domain; a single block, how  |
216 |       many holes, etc.                                        |
217 |     - ``Tail``: size of the parts of the domain, group by     |
218 |       group                                                   |
219 |     - ``Inte``: staggered elements, by dimension              |
220 +---------------------------------------------------------------+
221
222 Information about the field
223 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
224
225 +---------------------------------------------------------------+
226 +---------------------------------------------------------------+
227 | .. module:: SetFieldFile                                      |
228 |                                                               |
229 | **SetFieldFile(field_file)**                                  |
230 |     Defines the MED file of the field                         |
231 |                                                               |
232 |     - ``field_file``: the name of the MED file of the field   |
233 +---------------------------------------------------------------+
234 | .. module:: SetTimeStepRank                                   |
235 |                                                               |
236 | **SetTimeStepRank(TimeStep, Rank)**                           |
237 |     Defines the time steps for the fields                     |
238 |                                                               |
239 |     Useless if no time step is defined for the field.         |
240 |                                                               |
241 |     If a single time step is defined for the filed, it is the |
242 |     default choice.                                           |
243 |                                                               |
244 |     - ``TimeStep``: the selected time step                    |
245 |     - ``Rank``: the selected rank                             |
246 +---------------------------------------------------------------+
247 | .. module:: SetTimeStepRankLast                               |
248 |                                                               |
249 | **SetTimeStepRankLast()**                                     |
250 |     The last time step will be used, whatever its value       |
251 +---------------------------------------------------------------+
252 | .. module:: GetFieldFileName                                  |
253 |                                                               |
254 | **GetFieldFileName()**                                        |
255 |     Returns the name of the MED file of the field             |
256 +---------------------------------------------------------------+
257 | .. module:: GetTimeStep                                       |
258 |                                                               |
259 | **GetTimeStep()**                                             |
260 |     Returns the selected time step for the field              |
261 +---------------------------------------------------------------+
262 | .. module:: GetRank                                           |
263 |                                                               |
264 | **GetRank()**                                                 |
265 |     Returns the selected rank for the field                   |
266 +---------------------------------------------------------------+
267
268 Example
269 """""""
270 .. index:: single: mesh;initial
271
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.
273 ::
274
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)
283
284 Then, the next iteration is created from the current iteration.
285 ::
286
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)
295
296
297 Similar graphical input
298 """""""""""""""""""""""
299 Look at :ref:`gui_create_iteration`