Salome HOME
Suppression de la fonction SetAdapRefinUnRef et création de la fonction SetUnifRefinU...
[modules/homard.git] / doc / en / tui_create_hypothese.rst
1 .. _tui_create_hypothese:
2
3 The hypothesis
4 ##############
5
6 .. index:: single: iteration
7 .. index:: single: hypothesis
8 .. index:: single: zone
9
10 The variables are described in :ref:`gui_create_hypothese`.
11
12 Methods of the class homard
13 ***************************
14
15 +---------------------------------------------------------------+
16 +---------------------------------------------------------------+
17 | .. module:: CreateHypothesis                                  |
18 |                                                               |
19 | **CreateHypothesis(hypo_name)**                               |
20 |     Returns an instance of the class ``hypothese``            |
21 |                                                               |
22 |     - ``hypo_name``: the name of the hypothesis               |
23 +---------------------------------------------------------------+
24 | .. module:: GetHypothesis                                     |
25 |                                                               |
26 | **GetHypothesis(hypo_name)**                                  |
27 |     Returns an instance of the class ``hypothese``            |
28 |     known by its name                                         |
29 |                                                               |
30 |     - ``hypo_name``: the name of the hypothesis               |
31 +---------------------------------------------------------------+
32 | .. module:: GetAllHypothesesName                              |
33 |                                                               |
34 | **GetAllHypothesesName()**                                    |
35 |     Returns the liste of the name of all the existing         |
36 |     hypotheses                                                |
37 |                                                               |
38 +---------------------------------------------------------------+
39
40 Methods of the class hypothese
41 ******************************
42
43 General methods
44 ===============
45
46 +---------------------------------------------------------------+
47 +---------------------------------------------------------------+
48 | .. module:: GetName                                           |
49 |                                                               |
50 | **GetName()**                                                 |
51 |     Returns the name of the hypothesis                        |
52 +---------------------------------------------------------------+
53 | .. module:: GetAdapType                                       |
54 |                                                               |
55 | **GetAdapType()**                                             |
56 |     Returns the type of the adaptation                        |
57 |                                                               |
58 |         * -1: uniform                                         |
59 |         * 0: by zones                                         |
60 |         * 1: by a field                                       |
61 +---------------------------------------------------------------+
62 | .. module:: GetRefinType                                      |
63 |                                                               |
64 | **GetRefinType()**                                            |
65 |     Returns the type of the refinement                        |
66 |                                                               |
67 |         * 0: unactive                                         |
68 |         * 1: active                                           |
69 +---------------------------------------------------------------+
70 | .. module:: GetUnRefType                                      |
71 |                                                               |
72 | **GetUnRefType()**                                            |
73 |     Returns the type of the unrefinement                      |
74 |                                                               |
75 |         * 0: unactive                                         |
76 |         * 1: active                                           |
77 +---------------------------------------------------------------+
78 | .. module:: Delete                                            |
79 |                                                               |
80 | **Delete()**                                                  |
81 |     Deletes the hypothesis                                    |
82 |                                                               |
83 |     Returns an integer:                                       |
84 |         * 0: the destruction is done                          |
85 |         * other value: problem                                |
86 +---------------------------------------------------------------+
87
88 Uniform adaptation
89 ==================
90
91 +---------------------------------------------------------------+
92 +---------------------------------------------------------------+
93 | .. module:: SetUnifRefinUnRef                                 |
94 |                                                               |
95 | **SetUnifRefinUnRef(RefinUnRef)**                             |
96 |     Defines a type of adaptation for the whole mesh           |
97 |                                                               |
98 |     - ``RefinUnRef``: integer that defines the                |
99 |       type of adaptation                                      |
100 |                                                               |
101 |         * 1: refinement                                       |
102 |         * -1: unrefinement                                    |
103 +---------------------------------------------------------------+
104
105 Adaptation by a field
106 =====================
107
108 The driving field and the thresholds
109 ------------------------------------
110
111 +---------------------------------------------------------------+
112 +---------------------------------------------------------------+
113 | .. module:: SetField                                          |
114 |                                                               |
115 | **SetField(FieldName)**                                       |
116 |     Gives the name of a driving field to the hypothesis       |
117 |                                                               |
118 |     - ``FieldName``: the name of the driving field            |
119 +---------------------------------------------------------------+
120 | .. module:: GetFieldName                                      |
121 |                                                               |
122 | **GetFieldName()**                                            |
123 |     Returns the name of the driving field                     |
124 +---------------------------------------------------------------+
125 | .. module:: SetUseField                                       |
126 |                                                               |
127 | **SetUseField(use_field)**                                    |
128 |     Gives the usage of the driving field                      |
129 |                                                               |
130 |     - ``use_field``: integer that defines how the driving     |
131 |       field is used                                           |
132 |                                                               |
133 |        * 0: value by element (default)                        |
134 |        * 1: jump between an element and its neighbours        |
135 +---------------------------------------------------------------+
136 | .. module:: SetRefinThr                                       |
137 |                                                               |
138 | **SetRefinThr(type_thres, threshold)**                        |
139 |     Defines the thresholds for the refinement                 |
140 |                                                               |
141 |     - ``type_thres``: integer that defines the type of the    |
142 |       threshold for the refinement                            |
143 |                                                               |
144 |        * 1: absolute value                                    |
145 |        * 2: relative value in %                               |
146 |        * 3: ratio of elements in %                            |
147 |        * 4: mean + n times the standard deviation             |
148 |                                                               |
149 |     - ``threshold``: numerical value that defines the         |
150 |       threshold                                               |
151 +---------------------------------------------------------------+
152 | .. module:: GetRefinThrType                                   |
153 |                                                               |
154 | **GetRefinThrType()**                                         |
155 |     Returns the type of the threshold for the refinement      |
156 +---------------------------------------------------------------+
157 | .. module:: SetUnRefThr                                       |
158 |                                                               |
159 | **SetUnRefThr(type_thres, threshold)**                        |
160 |     Defines the thresholds for the unrefinement               |
161 |                                                               |
162 |     - ``type_thres``: integer that defines the type of the    |
163 |       threshold for the unrefinement                          |
164 |                                                               |
165 |        * 1: absolute value                                    |
166 |        * 2: relative value in %                               |
167 |        * 3: ratio of elements in %                            |
168 |        * 4: mean - n times the standard deviation             |
169 |                                                               |
170 |     - ``threshold``: numerical value that defines the         |
171 |       threshold                                               |
172 +---------------------------------------------------------------+
173 | .. module:: GetUnRefThrType                                   |
174 |                                                               |
175 | **GetUnRefThrType()**                                         |
176 |     Returns the type of the threshold for the unrefinement    |
177 +---------------------------------------------------------------+
178
179
180 The components of the driving field
181 -----------------------------------
182
183 +---------------------------------------------------------------+
184 +---------------------------------------------------------------+
185 | .. module:: AddComp                                           |
186 |                                                               |
187 | **AddComp(comp_name)**                                        |
188 |     Add a component of the field                              |
189 |                                                               |
190 |     - ``comp_name``: name of a component to take into account |
191 |                                                               |
192 |     Note: if this method is not used, every component         |
193 |     of the field is taken into account.                       |
194 +---------------------------------------------------------------+
195 | .. module:: SetUseComp                                        |
196 |                                                               |
197 | **SetUseComp(use_comp)**                                      |
198 |     Defines hom to use the components                         |
199 |                                                               |
200 |     - ``use_comp``: integer that defines how to use the       |
201 |       components                                              |
202 |                                                               |
203 |        * 0: L2 norm (default)                                 |
204 |        * 1: infinite norm                                     |
205 |        * 2: relative value, if only one component             |
206 +---------------------------------------------------------------+
207 | .. module:: GetComps                                          |
208 |                                                               |
209 | **GetComps()**                                                |
210 |     Returns the list of the used components                   |
211 +---------------------------------------------------------------+
212 | .. module:: SupprComp                                         |
213 |                                                               |
214 | **SupprComp(comp_name)**                                      |
215 |     Eliminates a component of the field                       |
216 |                                                               |
217 |     - ``comp_name``: name of a component to eliminate         |
218 +---------------------------------------------------------------+
219 | .. module:: SupprComps                                        |
220 |                                                               |
221 | **SupprComps()**                                              |
222 |     Eliminates all the components of the field                |
223 +---------------------------------------------------------------+
224
225
226 Adaptation by zones
227 ===================
228
229 +---------------------------------------------------------------+
230 +---------------------------------------------------------------+
231 | .. module:: AddZone                                           |
232 |                                                               |
233 | **AddZone(zone_name, type_use)**                              |
234 |                                                               |
235 |     - ``zone_name``: the name of the zone to add              |
236 |     - ``type_use``: integer that defines how to use the zone  |
237 |                                                               |
238 |         * 1: refinement                                       |
239 |         * -1: unrefinement                                    |
240 +---------------------------------------------------------------+
241 | .. module:: GetZones                                          |
242 |                                                               |
243 | **GetZones()**                                                |
244 |     Returns the list of the used zones with their uses        |
245 |                                                               |
246 |     Warning: the use is stored as a string in the list and    |
247 |     not as an integer.                                        |
248 |                                                               |
249 |     Example: ['Zone_A', '1', 'Zone_B', '1', 'Zone_C', '1']    |
250 +---------------------------------------------------------------+
251 | .. module:: SupprZone                                         |
252 |                                                               |
253 | **SupprZone(zone_name)**                                      |
254 |     Eliminates a zone from the hypothesis                     |
255 |                                                               |
256 |     - ``zone_name``: name of a zone to eliminate              |
257 +---------------------------------------------------------------+
258 | .. module:: SupprZones                                        |
259 |                                                               |
260 | **SupprZones()**                                              |
261 |     Eliminates all the zones from the hypothesis              |
262 +---------------------------------------------------------------+
263
264
265 The filtering by the groups
266 ===========================
267
268 +---------------------------------------------------------------+
269 +---------------------------------------------------------------+
270 | .. module:: AddGroup                                          |
271 |                                                               |
272 | **AddGroup(group_name)**                                      |
273 |     Add a group to the filtering                              |
274 |                                                               |
275 |     - ``group_name``: name of the group to take into account  |
276 +---------------------------------------------------------------+
277 | .. module:: GetGroups                                         |
278 |                                                               |
279 | **GetGroups()**                                               |
280 |     Returns the mist of the groups that are used in the       |
281 |     filtering                                                 |
282 +---------------------------------------------------------------+
283
284 Interpolation of fields
285 =======================
286
287 +---------------------------------------------------------------+
288 +---------------------------------------------------------------+
289 | .. module:: SetTypeFieldInterp                                |
290 |                                                               |
291 | **SetTypeFieldInterp(typefieldinterp)**                       |
292 |                                                               |
293 |     - ``typefieldinterp``: integer that defines if some fields|
294 |       are interpolated or not                                 |
295 |                                                               |
296 |         * 0: no field (default)                               |
297 |         * 1: every field is interpolated                      |
298 |         * 2: some fields are interpolated; automatically set  |
299 |           after using AddFieldInterp or AddFieldInterpType    |
300 +---------------------------------------------------------------+
301 | .. module:: GetTypeFieldInterp                                |
302 |                                                               |
303 | **GetTypeFieldInterp()**                                      |
304 |     Returns the integer that defines if some fields are       |
305 |     interpolated or not                                       |
306 +---------------------------------------------------------------+
307 | .. module:: AddFieldInterp                                    |
308 |                                                               |
309 | **AddFieldInterp(FieldName)**                                 |
310 |                                                               |
311 |     - ``FieldName``: the name of the field to interpolate     |
312 |                                                               |
313 |     The interpolation type is automatically deduced by        |
314 |     HOMARD; it corresponds to the type 0 of AddFieldInterpType|
315 +---------------------------------------------------------------+
316 | .. module:: AddFieldInterpType                                |
317 |                                                               |
318 | **AddFieldInterpType(FieldName, type_interp)**                |
319 |                                                               |
320 |     - ``FieldName``: the name of the field to interpolate     |
321 |     - ``type_interp``: integer that defines the type of       |
322 |       interpolation                                           |
323 |                                                               |
324 |     For a field over the nodes:                               |
325 |                                                               |
326 |         * 0: the field will be interpolated in degree 1 or 2  |
327 |           depending on its baseframe.                         |
328 |         * 1: interpolation en degree 1                        |
329 |         * 2: interpolation en degree 2                        |
330 |         * 3: interpolation iso-P2                             |
331 |                                                               |
332 |     For a field over the elements:                            |
333 |                                                               |
334 |         * 0: the field will be interpolated as an intensive   |
335 |           variable                                            |
336 |         * 1: the field will be interpolated as an extensive   |
337 |           variable                                            |
338 +---------------------------------------------------------------+
339 | .. module:: GetFieldInterps                                   |
340 |                                                               |
341 | **GetFieldInterps()**                                         |
342 |     Returns the list of the interpolated fields with their use|
343 |                                                               |
344 |     Warning: the use is stored as a string in the list and    |
345 |     not as an integer.                                        |
346 |                                                               |
347 |     Example: ['DEPL', '0', 'Mass', '1', 'Density', '0']       |
348 +---------------------------------------------------------------+
349 | .. module:: SupprFieldInterp                                  |
350 |                                                               |
351 | **SupprFieldInterp(FieldName)**                               |
352 |     Eliminates a field from the hypothesis                    |
353 |                                                               |
354 |     - ``FieldName``: name of a field to eliminate             |
355 +---------------------------------------------------------------+
356 | .. module:: SupprFieldInterps                                 |
357 |                                                               |
358 | **SupprFieldInterps()**                                       |
359 |     Eliminates all the fields from the hypothesis             |
360 +---------------------------------------------------------------+
361
362 .. note::
363   The file and the time steps for the fiels are defined with the iteration; see :ref:`tui_create_iteration`.
364
365 Advanced options
366 ================
367
368 +---------------------------------------------------------------+
369 +---------------------------------------------------------------+
370 | .. module:: SetNivMax                                         |
371 |                                                               |
372 | **SetNivMax(nivmax)**                                         |
373 |     Defines the maximum level for the refinement              |
374 |                                                               |
375 |     - ``nivmax``: level of refinement that must not be        |
376 |       exceeded                                                |
377 +---------------------------------------------------------------+
378 | .. module:: GetNivMax                                         |
379 |                                                               |
380 | **GetNivMax()**                                               |
381 |     Returns the maximum level for the refinement              |
382 +---------------------------------------------------------------+
383 | .. module:: SetDiamMin                                        |
384 |                                                               |
385 | **SetDiamMin(diammin)**                                       |
386 |     Defines the minimum diameter of the future elements       |
387 |                                                               |
388 |     - ``diammin``: minimum diameter for an element            |
389 +---------------------------------------------------------------+
390 | .. module:: GetDiamMin                                        |
391 |                                                               |
392 | **GetDiamMin()**                                              |
393 |     Returns the minimum diameter of the future elements       |
394 +---------------------------------------------------------------+
395 | .. module:: SetAdapInit                                       |
396 |                                                               |
397 | **SetAdapInit(option)**                                       |
398 |     Defines the treatment of the elements where the field that|
399 |     governs the adaptation is not defined                     |
400 |                                                               |
401 |     - ``option``: integer as follows:                         |
402 |                                                               |
403 |         *  0: no effect (default)                             |
404 |         *  1: the elements without field are refined          |
405 |         * -1: the elements without field are unrefined        |
406 +---------------------------------------------------------------+
407 | .. module:: GetAdapInit                                       |
408 |                                                               |
409 | **GetAdapInit()**                                             |
410 |     Returns the treatment of the elements where the field that|
411 |     governs the adaptation is not defined                     |
412 +---------------------------------------------------------------+
413 | .. module:: SetLevelOutput                                    |
414 |                                                               |
415 | **SetLevelOutput(option)**                                    |
416 |     Acts if the level of refinement is returned as a field in |
417 |     the output MED file                                       |
418 |                                                               |
419 |     - ``option``: integer as follows:                         |
420 |                                                               |
421 |         *  0: no effect (default)                             |
422 |         *  1: the field is produced                           |
423 +---------------------------------------------------------------+
424 | .. module:: GetLevelOutput                                    |
425 |                                                               |
426 | **GetLevelOutput()**                                          |
427 |     Returns the choice for the output of the level of         |
428 |     refinement                                                |
429 +---------------------------------------------------------------+
430
431
432 Example
433 *******
434 The creation of the object hypo_1 is done as follows:
435 ::
436
437     hypo_1 = homard.CreateHypothesis("HypoField")
438     hypo_1.SetField("INDICATEUR")
439     hypo_1.AddComp("INDX")
440     hypo_1.AddComp("INDZ")
441     hypo_1.SetRefinThr(1, 80.)
442     hypo_1.AddFieldInterp("DEPL")
443     hypo_1.AddFieldInterpType("MASS", 1)
444
445
446 Similar graphical input
447 ***********************
448 Look at :ref:`gui_create_hypothese`
449
450 .. warning::
451   With the graphical input mode, if an hypothesis is edited and if one of the characteristic is modified, the value of the threshold for the refinement for example, all the iterations that were computed with this hypothesis are unvalidated. In python mode, that is not true: the iterations stay as they are.