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:: GetAdapType |
56 | Returns the type of the adaptation |
61 +---------------------------------------------------------------+
62 | .. module:: GetRefinType |
64 | **GetRefinType()** |
65 | Returns the type of the refinement |
69 +---------------------------------------------------------------+
70 | .. module:: GetUnRefType |
72 | **GetUnRefType()** |
73 | Returns the type of the unrefinement |
77 +---------------------------------------------------------------+
78 | .. module:: Delete |
81 | Deletes the hypothesis |
83 | Returns an integer: |
84 | * 0: the destruction is done |
85 | * other value: problem |
86 +---------------------------------------------------------------+
91 +---------------------------------------------------------------+
92 +---------------------------------------------------------------+
93 | .. module:: SetUnifRefinUnRef |
95 | **SetUnifRefinUnRef(RefinUnRef)** |
96 | Defines a type of adaptation for the whole mesh |
98 | - ``RefinUnRef``: integer that defines the |
99 | type of adaptation |
102 | * -1: unrefinement |
103 +---------------------------------------------------------------+
105 Adaptation by a field
106 =====================
108 The driving field and the thresholds
109 ------------------------------------
111 +---------------------------------------------------------------+
112 +---------------------------------------------------------------+
113 | .. module:: SetField |
115 | **SetField(FieldName)** |
116 | Gives the name of a driving field to the hypothesis |
118 | - ``FieldName``: the name of the driving field |
119 +---------------------------------------------------------------+
120 | .. module:: GetFieldName |
122 | **GetFieldName()** |
123 | Returns the name of the driving field |
124 +---------------------------------------------------------------+
125 | .. module:: SetUseField |
127 | **SetUseField(use_field)** |
128 | Gives the usage of the driving field |
130 | - ``use_field``: integer that defines how the driving |
133 | * 0: value by element (default) |
134 | * 1: jump between an element and its neighbours |
135 +---------------------------------------------------------------+
136 | .. module:: SetRefinThr |
138 | **SetRefinThr(type_thres, threshold)** |
139 | Defines the thresholds for the refinement |
141 | - ``type_thres``: integer that defines the type of the |
142 | threshold for the refinement |
144 | * 1: absolute value |
145 | * 2: relative value in % |
146 | * 3: ratio of elements in % |
147 | * 4: mean + n times the standard deviation |
149 | - ``threshold``: numerical value that defines the |
151 +---------------------------------------------------------------+
152 | .. module:: GetRefinThrType |
154 | **GetRefinThrType()** |
155 | Returns the type of the threshold for the refinement |
156 +---------------------------------------------------------------+
157 | .. module:: SetUnRefThr |
159 | **SetUnRefThr(type_thres, threshold)** |
160 | Defines the thresholds for the unrefinement |
162 | - ``type_thres``: integer that defines the type of the |
163 | threshold for the unrefinement |
165 | * 1: absolute value |
166 | * 2: relative value in % |
167 | * 3: ratio of elements in % |
168 | * 4: mean - n times the standard deviation |
170 | - ``threshold``: numerical value that defines the |
172 +---------------------------------------------------------------+
173 | .. module:: GetUnRefThrType |
175 | **GetUnRefThrType()** |
176 | Returns the type of the threshold for the unrefinement |
177 +---------------------------------------------------------------+
180 The components of the driving field
181 -----------------------------------
183 +---------------------------------------------------------------+
184 +---------------------------------------------------------------+
185 | .. module:: AddComp |
187 | **AddComp(comp_name)** |
188 | Add a component of the field |
190 | - ``comp_name``: name of a component to take into account |
192 | Note: if this method is not used, every component |
193 | of the field is taken into account. |
194 +---------------------------------------------------------------+
195 | .. module:: SetUseComp |
197 | **SetUseComp(use_comp)** |
198 | Defines hom to use the components |
200 | - ``use_comp``: integer that defines how to use the |
203 | * 0: L2 norm (default) |
204 | * 1: infinite norm |
205 | * 2: relative value, if only one component |
206 +---------------------------------------------------------------+
207 | .. module:: GetComps |
210 | Returns the list of the used components |
211 +---------------------------------------------------------------+
212 | .. module:: SupprComp |
214 | **SupprComp(comp_name)** |
215 | Eliminates a component of the field |
217 | - ``comp_name``: name of a component to eliminate |
218 +---------------------------------------------------------------+
219 | .. module:: SupprComps |
222 | Eliminates all the components of the field |
223 +---------------------------------------------------------------+
229 +---------------------------------------------------------------+
230 +---------------------------------------------------------------+
231 | .. module:: AddZone |
233 | **AddZone(zone_name, type_use)** |
235 | - ``zone_name``: the name of the zone to add |
236 | - ``type_use``: integer that defines how to use the zone |
239 | * -1: unrefinement |
240 +---------------------------------------------------------------+
241 | .. module:: GetZones |
244 | Returns the list of the used zones with their uses |
246 | Warning: the use is stored as a string in the list and |
247 | not as an integer. |
249 | Example: ['Zone_A', '1', 'Zone_B', '1', 'Zone_C', '1'] |
250 +---------------------------------------------------------------+
251 | .. module:: SupprZone |
253 | **SupprZone(zone_name)** |
254 | Eliminates a zone from the hypothesis |
256 | - ``zone_name``: name of a zone to eliminate |
257 +---------------------------------------------------------------+
258 | .. module:: SupprZones |
261 | Eliminates all the zones from the hypothesis |
262 +---------------------------------------------------------------+
265 The filtering by the groups
266 ===========================
268 +---------------------------------------------------------------+
269 +---------------------------------------------------------------+
270 | .. module:: AddGroup |
272 | **AddGroup(group_name)** |
273 | Add a group to the filtering |
275 | - ``group_name``: name of the group to take into account |
276 +---------------------------------------------------------------+
277 | .. module:: GetGroups |
280 | Returns the mist of the groups that are used in the |
282 +---------------------------------------------------------------+
284 Interpolation of fields
285 =======================
287 +---------------------------------------------------------------+
288 +---------------------------------------------------------------+
289 | .. module:: SetTypeFieldInterp |
291 | **SetTypeFieldInterp(typefieldinterp)** |
293 | - ``typefieldinterp``: integer that defines if some fields|
294 | are interpolated or not |
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 |
303 | **GetTypeFieldInterp()** |
304 | Returns the integer that defines if some fields are |
305 | interpolated or not |
306 +---------------------------------------------------------------+
307 | .. module:: AddFieldInterp |
309 | **AddFieldInterp(FieldName)** |
311 | - ``FieldName``: the name of the field to interpolate |
313 | The interpolation type is automatically deduced by |
314 | HOMARD; it corresponds to the type 0 of AddFieldInterpType|
315 +---------------------------------------------------------------+
316 | .. module:: AddFieldInterpType |
318 | **AddFieldInterpType(FieldName, type_interp)** |
320 | - ``FieldName``: the name of the field to interpolate |
321 | - ``type_interp``: integer that defines the type of |
324 | For a field over the nodes: |
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 |
332 | For a field over the elements: |
334 | * 0: the field will be interpolated as an intensive |
336 | * 1: the field will be interpolated as an extensive |
338 +---------------------------------------------------------------+
339 | .. module:: GetFieldInterps |
341 | **GetFieldInterps()** |
342 | Returns the list of the interpolated fields with their use|
344 | Warning: the use is stored as a string in the list and |
345 | not as an integer. |
347 | Example: ['DEPL', '0', 'Mass', '1', 'Density', '0'] |
348 +---------------------------------------------------------------+
349 | .. module:: SupprFieldInterp |
351 | **SupprFieldInterp(FieldName)** |
352 | Eliminates a field from the hypothesis |
354 | - ``FieldName``: name of a field to eliminate |
355 +---------------------------------------------------------------+
356 | .. module:: SupprFieldInterps |
358 | **SupprFieldInterps()** |
359 | Eliminates all the fields from the hypothesis |
360 +---------------------------------------------------------------+
363 The file and the time steps for the fiels are defined with the iteration; see :ref:`tui_create_iteration`.
368 +---------------------------------------------------------------+
369 +---------------------------------------------------------------+
370 | .. module:: SetNivMax |
372 | **SetNivMax(nivmax)** |
373 | Defines the maximum level for the refinement |
375 | - ``nivmax``: level of refinement that must not be |
377 +---------------------------------------------------------------+
378 | .. module:: GetNivMax |
381 | Returns the maximum level for the refinement |
382 +---------------------------------------------------------------+
383 | .. module:: SetDiamMin |
385 | **SetDiamMin(diammin)** |
386 | Defines the minimum diameter of the future elements |
388 | - ``diammin``: minimum diameter for an element |
389 +---------------------------------------------------------------+
390 | .. module:: GetDiamMin |
393 | Returns the minimum diameter of the future elements |
394 +---------------------------------------------------------------+
395 | .. module:: SetAdapInit |
397 | **SetAdapInit(option)** |
398 | Defines the treatment of the elements where the field that|
399 | governs the adaptation is not defined |
401 | - ``option``: integer as follows: |
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 |
409 | **GetAdapInit()** |
410 | Returns the treatment of the elements where the field that|
411 | governs the adaptation is not defined |
412 +---------------------------------------------------------------+
413 | .. module:: SetExtraOutput |
415 | **SetExtraOutput(option)** |
416 | Acts if some extra information are required into the |
417 | output MED file. The option is a product of 2, 3, 5. |
419 | - ``option``: integer as follows: |
421 | * 1 : no effect (default) |
422 | * 2x : the refinement level of every mesh is produced|
423 | * 3x : the quality of every mesh |
424 | * 5x : the diameter of every mesh |
425 +---------------------------------------------------------------+
426 | .. module:: GetExtraOutput |
428 | **GetExtraOutput()** |
429 | Returns the choice for the output of extra information |
430 +---------------------------------------------------------------+
435 The creation of the object hypo_1 is done as follows:
438 hypo_1 = homard.CreateHypothesis("HypoField")
439 hypo_1.SetField("INDICATEUR")
440 hypo_1.AddComp("INDX")
441 hypo_1.AddComp("INDZ")
442 hypo_1.SetRefinThr(1, 80.)
443 hypo_1.AddFieldInterp("DEPL")
444 hypo_1.AddFieldInterpType("MASS", 1)
447 Similar graphical input
448 ***********************
449 Look at :ref:`gui_create_hypothese`
452 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.