Salome HOME
Instants du champ de pilotage de l'adaptation
[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 field and the thresholds
103 ============================
104
105 +---------------------------------------------------------------+
106 +---------------------------------------------------------------+
107 | .. module:: SetField                                          |
108 |                                                               |
109 | **SetField(field_name)**                                      |
110 |     Gives the name of a field to the hypothesis               |
111 |                                                               |
112 |     - ``field_name``: the name of the field                   |
113 +---------------------------------------------------------------+
114 | .. module:: GetFieldName                                      |
115 |                                                               |
116 | **GetFieldName()**                                            |
117 |     Returns the name of the field                             |
118 +---------------------------------------------------------------+
119 | .. module:: SetUseField                                       |
120 |                                                               |
121 | **SetUseField(use_field)**                                    |
122 |     Gives the usage of the field for the hypothesis           |
123 |                                                               |
124 |     - ``use_field``: integer that defines how the field is    |
125 |       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 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 |     Warning: the use is stored as a string in the list and    |
240 |     not as an integer.                                        |
241 |                                                               |
242 |     Example: ['Zone_A', '1', 'Zone_B', '1', 'Zone_C', '1']    |
243 +---------------------------------------------------------------+
244 | .. module:: SupprZone                                         |
245 |                                                               |
246 | **SupprZone(zone_name)**                                      |
247 |     Eliminates a zone from the hypothesis                     |
248 |                                                               |
249 |     - ``zone_name``: name of a zone to eliminate              |
250 +---------------------------------------------------------------+
251 | .. module:: SupprZones                                        |
252 |                                                               |
253 | **SupprZones()**                                              |
254 |     Eliminates all the zones from the hypothesis              |
255 +---------------------------------------------------------------+
256
257
258 The filtering by the groups
259 ===========================
260
261 +---------------------------------------------------------------+
262 +---------------------------------------------------------------+
263 | .. module:: AddGroup                                          |
264 |                                                               |
265 | **AddGroup(group_name)**                                      |
266 |     Add a group to the filtering                              |
267 |                                                               |
268 |     - ``group_name``: name of the group to take into account  |
269 +---------------------------------------------------------------+
270 | .. module:: GetGroups                                         |
271 |                                                               |
272 | **GetGroups()**                                               |
273 |     Returns the mist of the groups that are used in the       |
274 |     filtering                                                 |
275 +---------------------------------------------------------------+
276
277 Advanced options
278 ================
279
280 +---------------------------------------------------------------+
281 +---------------------------------------------------------------+
282 | .. module:: SetNivMax                                         |
283 |                                                               |
284 | **SetNivMax(nivmax)**                                         |
285 |     Defines the maximum level for the refinement              |
286 |                                                               |
287 |     - ``nivmax``: level of refinement that must not be        |
288 |       exceeded                                                |
289 +---------------------------------------------------------------+
290 | .. module:: GetNivMax                                         |
291 |                                                               |
292 | **GetNivMax()**                                               |
293 |     Returns the maximum level for the refinement              |
294 +---------------------------------------------------------------+
295 | .. module:: SetDiamMin                                        |
296 |                                                               |
297 | **SetDiamMin(diammin)**                                       |
298 |     Defines the minimum diameter of the future elements       |
299 |                                                               |
300 |     - ``diammin``: minimum diameter for an element            |
301 +---------------------------------------------------------------+
302 | .. module:: GetDiamMin                                        |
303 |                                                               |
304 | **GetDiamMin()**                                              |
305 |     Returns the minimum diameter of the future elements       |
306 +---------------------------------------------------------------+
307 | .. module:: SetAdapInit                                       |
308 |                                                               |
309 | **SetAdapInit(option)**                                       |
310 |     Defines the treatment of the elements where the field that|
311 |     governs the adaptation is not defined                     |
312 |                                                               |
313 |     - ``option``: integer as follows:                         |
314 |                                                               |
315 |         *  0: no effect (default)                             |
316 |         *  1: the elements without field are refined          |
317 |         * -1: the elements without field are unrefined        |
318 +---------------------------------------------------------------+
319 | .. module:: GetAdapInit                                       |
320 |                                                               |
321 | **GetAdapInit()**                                             |
322 |     Returns the treatment of the elements where the field that|
323 |     governs the adaptation is not defined                     |
324 +---------------------------------------------------------------+
325 | .. module:: SetLevelOutput                                    |
326 |                                                               |
327 | **SetLevelOutput(option)**                                    |
328 |     Acts if the level of refinement is returned as a field in |
329 |     the output MED file                                       |
330 |                                                               |
331 |     - ``option``: integer as follows:                         |
332 |                                                               |
333 |         *  0: no effect (default)                             |
334 |         *  1: the field is produced                           |
335 +---------------------------------------------------------------+
336 | .. module:: GetLevelOutput                                    |
337 |                                                               |
338 | **GetLevelOutput()**                                          |
339 |     Returns the choice for the output of the level of         |
340 |     refinement                                                |
341 +---------------------------------------------------------------+
342
343
344 Example
345 *******
346 The creation of the object hypo_1 is done as follows:
347 ::
348
349     hypo_1 = homard.CreateHypothesis("HypoField")
350     hypo_1.SetAdapRefinUnRef(1, 1, 0)
351     hypo_1.SetField("INDICATEUR")
352     hypo_1.AddComp("INDX")
353     hypo_1.AddComp("INDZ")
354     hypo_1.SetRefinThr(1, 80.)
355
356
357 Similar graphical input
358 ***********************
359 Look at :ref:`gui_create_hypothese`
360
361 .. warning::
362   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.