1 .. _tui_create_hypothese:
6 .. index:: single: iteration
7 .. index:: single: hypothesis
8 .. index:: single: zone
10 The variables are described in :ref:`gui_create_hypothese`.
12 Methods of the class homard
13 ***************************
15 +---------------------------------------------------------------+
16 +---------------------------------------------------------------+
17 | .. module:: CreateHypothesis |
19 | **CreateHypothesis(hypo_name)** |
20 | Returns an instance of the class ``hypothese`` |
22 | - ``hypo_name``: the name of the hypothesis |
23 +---------------------------------------------------------------+
24 | .. module:: GetHypothesis |
26 | **GetHypothesis(hypo_name)** |
27 | Returns an instance of the class ``hypothese`` |
30 | - ``hypo_name``: the name of the hypothesis |
31 +---------------------------------------------------------------+
32 | .. module:: GetAllHypothesesName |
34 | **GetAllHypothesesName()** |
35 | Returns the liste of the name of all the existing |
38 +---------------------------------------------------------------+
40 Methods of the class hypothese
41 ******************************
46 +---------------------------------------------------------------+
47 +---------------------------------------------------------------+
48 | .. module:: GetName |
51 | Returns the name of the hypothesis |
52 +---------------------------------------------------------------+
53 | .. module:: SetAdapRefinUnRef |
55 | **SetAdapRefinUnRef(Adap, Refin, UnRef)** |
56 | Gives the type of adaptation to the hypothesis |
58 | - ``Adap``: integer that defines the type of adaptation |
64 | - ``Refin``: integer that informs if the refinement is |
70 | - ``UnRef``: integer that informs if the refinement is |
76 +---------------------------------------------------------------+
77 | .. module:: GetAdapType |
80 | Returns the type of the adaptation |
81 +---------------------------------------------------------------+
82 | .. module:: GetRefinType |
84 | **GetRefinType()** |
85 | Returns the type of the refinement |
86 +---------------------------------------------------------------+
87 | .. module:: GetUnRefType |
89 | **GetUnRefType()** |
90 | Returns the type of the unrefinement |
91 +---------------------------------------------------------------+
92 | .. module:: Delete |
95 | Deletes the hypothesis |
97 | Returns an integer: |
98 | * 0: the destruction is done |
99 | * other value: problem |
100 +---------------------------------------------------------------+
102 The driving field and the thresholds
103 ====================================
105 +---------------------------------------------------------------+
106 +---------------------------------------------------------------+
107 | .. module:: SetField |
109 | **SetField(FieldName)** |
110 | Gives the name of a driving field to the hypothesis |
112 | - ``FieldName``: the name of the driving field |
113 +---------------------------------------------------------------+
114 | .. module:: GetFieldName |
116 | **GetFieldName()** |
117 | Returns the name of the driving field |
118 +---------------------------------------------------------------+
119 | .. module:: SetUseField |
121 | **SetUseField(use_field)** |
122 | Gives the usage of the driving field |
124 | - ``use_field``: integer that defines how the driving |
127 | * 0: value by element (default) |
128 | * 1: jump between an element and its neighbours |
129 +---------------------------------------------------------------+
130 | .. module:: SetRefinThr |
132 | **SetRefinThr(type_thres, threshold)** |
133 | Defines the thresholds for the refinement |
135 | - ``type_thres``: integer that defines the type of the |
136 | threshold for the refinement |
138 | * 1: absolute value |
139 | * 2: relative value in % |
140 | * 3: ratio of elements in % |
141 | * 4: mean + n times the standard deviation |
143 | - ``threshold``: numerical value that defines the |
145 +---------------------------------------------------------------+
146 | .. module:: GetRefinThrType |
148 | **GetRefinThrType()** |
149 | Returns the type of the threshold for the refinement |
150 +---------------------------------------------------------------+
151 | .. module:: SetUnRefThr |
153 | **SetUnRefThr(type_thres, threshold)** |
154 | Defines the thresholds for the unrefinement |
156 | - ``type_thres``: integer that defines the type of the |
157 | threshold for the unrefinement |
159 | * 1: absolute value |
160 | * 2: relative value in % |
161 | * 3: ratio of elements in % |
162 | * 4: mean - n times the standard deviation |
164 | - ``threshold``: numerical value that defines the |
166 +---------------------------------------------------------------+
167 | .. module:: GetUnRefThrType |
169 | **GetUnRefThrType()** |
170 | Returns the type of the threshold for the unrefinement |
171 +---------------------------------------------------------------+
174 The components of the driving field
175 ===================================
177 +---------------------------------------------------------------+
178 +---------------------------------------------------------------+
179 | .. module:: AddComp |
181 | **AddComp(comp_name)** |
182 | Add a component of the field |
184 | - ``comp_name``: name of a component to take into account |
186 | Note: if this method is not used, every component |
187 | of the field is taken into account. |
188 +---------------------------------------------------------------+
189 | .. module:: SetUseComp |
191 | **SetUseComp(use_comp)** |
192 | Defines hom to use the components |
194 | - ``use_comp``: integer that defines how to use the |
197 | * 0: L2 norm (default) |
198 | * 1: infinite norm |
199 | * 2: relative value, if only one component |
200 +---------------------------------------------------------------+
201 | .. module:: GetComps |
204 | Returns the list of the used components |
205 +---------------------------------------------------------------+
206 | .. module:: SupprComp |
208 | **SupprComp(comp_name)** |
209 | Eliminates a component of the field |
211 | - ``comp_name``: name of a component to eliminate |
212 +---------------------------------------------------------------+
213 | .. module:: SupprComps |
216 | Eliminates all the components of the field |
217 +---------------------------------------------------------------+
223 +---------------------------------------------------------------+
224 +---------------------------------------------------------------+
225 | .. module:: AddZone |
227 | **AddZone(zone_name, type_use)** |
229 | - ``zone_name``: the name of the zone to add |
230 | - ``type_use``: integer that defines how to use the zone |
233 | * -1: unrefinement |
234 +---------------------------------------------------------------+
235 | .. module:: GetZones |
238 | Returns the list of the used zones with their uses |
240 | Warning: the use is stored as a string in the list and |
241 | not as an integer. |
243 | Example: ['Zone_A', '1', 'Zone_B', '1', 'Zone_C', '1'] |
244 +---------------------------------------------------------------+
245 | .. module:: SupprZone |
247 | **SupprZone(zone_name)** |
248 | Eliminates a zone from the hypothesis |
250 | - ``zone_name``: name of a zone to eliminate |
251 +---------------------------------------------------------------+
252 | .. module:: SupprZones |
255 | Eliminates all the zones from the hypothesis |
256 +---------------------------------------------------------------+
259 The filtering by the groups
260 ===========================
262 +---------------------------------------------------------------+
263 +---------------------------------------------------------------+
264 | .. module:: AddGroup |
266 | **AddGroup(group_name)** |
267 | Add a group to the filtering |
269 | - ``group_name``: name of the group to take into account |
270 +---------------------------------------------------------------+
271 | .. module:: GetGroups |
274 | Returns the mist of the groups that are used in the |
276 +---------------------------------------------------------------+
278 Interpolation of fields
279 =======================
281 +---------------------------------------------------------------+
282 +---------------------------------------------------------------+
283 | .. module:: SetTypeFieldInterp |
285 | **SetTypeFieldInterp(typefieldinterp)** |
287 | - ``typefieldinterp``: integer that defines if some fields|
288 | are interpolated or not |
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 |
297 | **GetTypeFieldInterp()** |
298 | Returns the integer that defines if some fields are |
299 | interpolated or not |
300 +---------------------------------------------------------------+
301 | .. module:: AddFieldInterp |
303 | **AddFieldInterp(FieldName)** |
305 | - ``FieldName``: the name of the field to interpolate |
307 | The interpolation type is automatically deduced by |
308 | HOMARD; it corresponds to the type 0 of AddFieldInterpType|
309 +---------------------------------------------------------------+
310 | .. module:: AddFieldInterpType |
312 | **AddFieldInterpType(FieldName, type_interp)** |
314 | - ``FieldName``: the name of the field to interpolate |
315 | - ``type_interp``: integer that defines the type of |
318 | For a field over the nodes: |
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 |
326 | For a field over the elements: |
328 | * 0: the field will be interpolated as an intensive |
330 | * 1: the field will be interpolated as an extensive |
332 +---------------------------------------------------------------+
333 | .. module:: GetFieldInterps |
335 | **GetFieldInterps()** |
336 | Returns the list of the interpolated fields with their use|
338 | Warning: the use is stored as a string in the list and |
339 | not as an integer. |
341 | Example: ['DEPL', '0', 'Mass', '1', 'Density', '0'] |
342 +---------------------------------------------------------------+
343 | .. module:: SupprFieldInterp |
345 | **SupprFieldInterp(FieldName)** |
346 | Eliminates a field from the hypothesis |
348 | - ``FieldName``: name of a field to eliminate |
349 +---------------------------------------------------------------+
350 | .. module:: SupprFieldInterps |
352 | **SupprFieldInterps()** |
353 | Eliminates all the fields from the hypothesis |
354 +---------------------------------------------------------------+
357 The file and the time steps for the fiels are defined with the iteration; see :ref:`tui_create_iteration`.
362 +---------------------------------------------------------------+
363 +---------------------------------------------------------------+
364 | .. module:: SetNivMax |
366 | **SetNivMax(nivmax)** |
367 | Defines the maximum level for the refinement |
369 | - ``nivmax``: level of refinement that must not be |
371 +---------------------------------------------------------------+
372 | .. module:: GetNivMax |
375 | Returns the maximum level for the refinement |
376 +---------------------------------------------------------------+
377 | .. module:: SetDiamMin |
379 | **SetDiamMin(diammin)** |
380 | Defines the minimum diameter of the future elements |
382 | - ``diammin``: minimum diameter for an element |
383 +---------------------------------------------------------------+
384 | .. module:: GetDiamMin |
387 | Returns the minimum diameter of the future elements |
388 +---------------------------------------------------------------+
389 | .. module:: SetAdapInit |
391 | **SetAdapInit(option)** |
392 | Defines the treatment of the elements where the field that|
393 | governs the adaptation is not defined |
395 | - ``option``: integer as follows: |
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 |
403 | **GetAdapInit()** |
404 | Returns the treatment of the elements where the field that|
405 | governs the adaptation is not defined |
406 +---------------------------------------------------------------+
407 | .. module:: SetLevelOutput |
409 | **SetLevelOutput(option)** |
410 | Acts if the level of refinement is returned as a field in |
411 | the output MED file |
413 | - ``option``: integer as follows: |
415 | * 0: no effect (default) |
416 | * 1: the field is produced |
417 +---------------------------------------------------------------+
418 | .. module:: GetLevelOutput |
420 | **GetLevelOutput()** |
421 | Returns the choice for the output of the level of |
423 +---------------------------------------------------------------+
428 The creation of the object hypo_1 is done as follows:
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)
441 Similar graphical input
442 ***********************
443 Look at :ref:`gui_create_hypothese`
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.