Salome HOME
Add license
[modules/hexablock.git] / doc / tui_discret_law.rst
1 :tocdepth: 3
2
3 .. _tuidiscretelaw:
4
5 ==============================
6 Define a law of discretization
7 ==============================
8
9 Add a new law of discretization in the document::
10
11     law_1 = doc.addLaw(name, nb_nodes)
12     
13 Add laws on propagations based on min or max segment length::
14
15         hexablock.addLaws(doc, lg, lgmax)
16
17 Get the number of the law in the document::
18
19     nl = doc.countLaw()
20
21 Get a law of the document::
22
23     law_i = doc.getLaw(i)
24
25 Remove a law from the document::
26
27     doc.removeLaw(law_1)
28
29 Find a law of discretization in the document::
30
31     law_1 = doc.findLaw(name)
32
33 Get the name of the law::
34
35     name = law_1.getName()
36
37 Change the name of the law::
38
39     law_1.setName(name)
40
41 Get the number of nodes for the law of discretization::
42
43     nb = law_1.getNodes()
44
45 Set the number of nodes for the law of discretization::
46
47     law_1.setNodes(nb)
48
49 Get the kind of the law (uniform, arithmetic, geometric)::
50
51     kd = law_1.getKind()
52
53 Set the kind of law of discretization::
54
55     law_1.setKind(kind)
56
57 Get the coefficient of the law::
58
59     coef = law_1.getCoefficient()
60
61 Set the coefficient of the law::
62
63     law_1.setCoefficent(coef)
64
65
66 Get the default law. This law is applied when there is no law on a propagation::
67
68     default_law = doc.getLaw(0)
69
70 It is possible to change the default law::
71
72     default_law.setNodes(10)
73
74 And the default law is not removable
75
76 GUI command: :ref:`guidiscretelaw`