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