5 ==============================
6 Define a law of discretization
7 ==============================
9 Add a new law of discretization in the document::
11 law_1 = doc.addLaw(name, nb_nodes)
13 Add laws on propagations based on min or max segment length::
15 hexablock.addLaws(doc, lg, lgmax)
17 Get the number of the law in the document::
21 Get a law of the document::
25 Remove a law from the document::
29 Find a law of discretization in the document::
31 law_1 = doc.findLaw(name)
33 Get the name of the law::
35 name = law_1.getName()
37 Change the name of the law::
41 Get the number of nodes for the law of discretization::
45 Set the number of nodes for the law of discretization::
49 Get the kind of the law (uniform, arithmetic, geometric)::
53 Set the kind of law of discretization::
57 Get the coefficient of the law::
59 coef = law_1.getCoefficient()
61 Set the coefficient of the law::
63 law_1.setCoefficent(coef)
66 Get the default law. This law is applied when there is no law on a propagation::
68 default_law = doc.getLaw(0)
70 It is possible to change the default law::
72 default_law.setNodes(10)
74 And the default law is not removable
76 GUI command: :ref:`guidiscretelaw`