Salome HOME
Merge branch 'master' into gni/evolution
[modules/smesh.git] / src / Tools / blocFissure / doc / testcases.rst
1 .. _test_cases:\r
2 \r
3 #######################\r
4 Test cases\r
5 #######################\r
6 \r
7 A base of 30 test cases guarantees the correct functioning of « Bloc Fissure ». 12 cases are dedicated to :ref:`cracked bended pipes <pipeTC>` and the others 13 are for other :ref:`generic geometries <genericTC>`. They are shown here in order to illustrate cases on which « Bloc Fissure » works.\r
8 \r
9 .. _genericTC:\r
10 \r
11 Generic cases\r
12 ===============================\r
13 \r
14 All 13 cases are shown Table 2. Two views show the whole cracked structure and a zoom onto the crack with its tore.\r
15 \r
16 +-------------------------------------------+----------------------------------------------+\r
17 | CubeAngle                                                                                |\r
18 +-------------------------------------------+----------------------------------------------+\r
19 |.. image:: images/01_CubeAngle.png         | .. image:: images/01_CubeAngle_2.png         |\r
20 |   :height: 300                            |    :height: 300                              |\r
21 |   :align: center                          |    :align: center                            |\r
22 +-------------------------------------------+----------------------------------------------+\r
23 | CubeAngle2                                                                               |\r
24 +-------------------------------------------+----------------------------------------------+\r
25 |.. image:: images/02_CubeAngle2.png        | .. image:: images/02_CubeAngle2_2.png        |\r
26 |   :height: 300                            |    :height: 300                              |\r
27 |   :align: center                          |    :align: center                            |\r
28 +-------------------------------------------+----------------------------------------------+\r
29 | cylindre                                                                                 |\r
30 +-------------------------------------------+----------------------------------------------+\r
31 |.. image:: images/03_cylindre.png          | .. image:: images/03_cylindre_2.png          |\r
32 |   :height: 300                            |    :height: 300                              |\r
33 |   :align: center                          |    :align: center                            |\r
34 +-------------------------------------------+----------------------------------------------+\r
35 | cylindre2                                                                                |\r
36 +-------------------------------------------+----------------------------------------------+\r
37 |.. image:: images/04_cylindre2.png         | .. image:: images/04_cylindre2_2.png         |\r
38 |   :height: 300                            |    :height: 300                              |\r
39 |   :align: center                          |    :align: center                            |\r
40 +-------------------------------------------+----------------------------------------------+\r
41 | disque                                                                                   |\r
42 +-------------------------------------------+----------------------------------------------+\r
43 |.. image:: images/05_disque.png            | .. image:: images/05_disque_2.png            |\r
44 |   :height: 300                            |    :height: 300                              |\r
45 |   :align: center                          |    :align: center                            |\r
46 +-------------------------------------------+----------------------------------------------+\r
47 | ellipse1                                                                                 |\r
48 +-------------------------------------------+----------------------------------------------+\r
49 |.. image:: images/06_ellipse1.png          | .. image:: images/06_ellipse1_2.png          |\r
50 |   :height: 300                            |    :height: 300                              |\r
51 |   :align: center                          |    :align: center                            |\r
52 +-------------------------------------------+----------------------------------------------+\r
53 | ellipse2 (tilted crack)                                                                  |\r
54 +-------------------------------------------+----------------------------------------------+\r
55 |.. image:: images/07_ellipse2.png          | .. image:: images/07_ellipse2_2.png          |\r
56 |   :height: 300                            |    :height: 300                              |\r
57 |   :align: center                          |    :align: center                            |\r
58 +-------------------------------------------+----------------------------------------------+\r
59 | eprouvetteCourbe                                                                         |\r
60 +-------------------------------------------+----------------------------------------------+\r
61 |.. image:: images/08_eprouvetteCourbe.png  | .. image:: images/08_eprouvetteCourbe_2.png  |\r
62 |   :height: 300                            |    :height: 300                              |\r
63 |   :align: center                          |    :align: center                            |\r
64 +-------------------------------------------+----------------------------------------------+\r
65 | eprouvetteDroite                                                                         |\r
66 +-------------------------------------------+----------------------------------------------+\r
67 |.. image:: images/09_eprouvetteDroite.png  | .. image:: images/09_eprouvetteDroite_2.png  |\r
68 |   :height: 300                            |    :height: 300                              |\r
69 |   :align: center                          |    :align: center                            |\r
70 +-------------------------------------------+----------------------------------------------+\r
71 | eprouvetteDroite2                                                                        |\r
72 +-------------------------------------------+----------------------------------------------+\r
73 |.. image:: images/10_eprouvetteDroite2.png | .. image:: images/10_eprouvetteDroite2_2.png |\r
74 |   :height: 300                            |    :height: 300                              |\r
75 |   :align: center                          |    :align: center                            |\r
76 +-------------------------------------------+----------------------------------------------+\r
77 | faceGauche                                                                               |\r
78 +-------------------------------------------+----------------------------------------------+\r
79 |.. image:: images/11_faceGauche.png        | .. image:: images/11_faceGauche_2.png        |\r
80 |   :height: 300                            |    :height: 300                              |\r
81 |   :align: center                          |    :align: center                            |\r
82 +-------------------------------------------+----------------------------------------------+\r
83 | faceGauche2                                                                              |\r
84 +-------------------------------------------+----------------------------------------------+\r
85 |.. image:: images/12_faceGauche2.png       | .. image:: images/12_faceGauche2_2.png       |\r
86 |   :height: 300                            |    :height: 300                              |\r
87 |   :align: center                          |    :align: center                            |\r
88 +-------------------------------------------+----------------------------------------------+\r
89 | vis (Crack is in the radius filet between the screw head and the screw shank)            |\r
90 +-------------------------------------------+----------------------------------------------+\r
91 |.. image:: images/13_vis_1.png             | .. image:: images/13_vis_1_2.png             |\r
92 |   :width: 400                             |    :width: 400                               |\r
93 |   :align: center                          |    :align: center                            |\r
94 +-------------------------------------------+----------------------------------------------+\r
95 | tube                                                                                     |\r
96 +-------------------------------------------+----------------------------------------------+\r
97 \r
98 .. _pipeTC:\r
99 \r
100 Cracked bended pipes\r
101 =====================================\r
102 \r
103 All 12 bended pipe test cases are not shown here because they are relatively similars with each others. Only test case cas coude_0 et coude_3 are presented, those two tests being based on the same geometry and having a crack on the internal and on the external surface.\r
104 \r
105 +--------------------------------+----------------------------------------------+\r
106 | .. image:: images/coude_0.png  | .. image:: images/coude_0_2.png              |\r
107 |    :height: 500                |    :width: 500                               |\r
108 |    :align: center              |    :align: center                            |\r
109 |                                +----------------------------------------------+\r
110 |                                | View of the external crack of test_coude_0   |\r
111 |                                +----------------------------------------------+\r
112 |                                | .. image:: images/coude_3.png                |\r
113 |                                |    :width: 500                               |\r
114 |                                |    :align: center                            |\r
115 +--------------------------------+----------------------------------------------+\r
116 | Bended pipe test case coude_0  | View of the internal crack of test_coude_3   |\r
117 | with an external crack         |                                              |\r
118 +--------------------------------+----------------------------------------------+\r
119 \r
120 coude_0 can be computed using this file for the data:\r
121 \r
122   * :download:`data for a bended puipe <../ihm/dialogFissureCoude.dic>`\r
123 \r
124 « Bloc Fissure » is very efficient for the case of bended pipes. The generation of the geometry and the crack insertion takes only around 15s.\r
125 \r
126 Running test cases\r
127 =====================================\r
128 \r
129 All the files for these test cases are stored in the directory of the installation of SALOME:\r
130 \r
131 ``Salome-VXXXX_package-YY/modules/SMESH_VXXXX/lib/python3.6/site-packages/salome/blocFissure``\r
132 \r
133 The test cases can be runned either through the python window of the SALOME GUI or with a python script.\r
134 \r
135 0) **Generate med and breps files.**::\r
136 \r
137     from blocFissure.materielCasTests import genereMateriel\r
138 \r
139 Once the files are generated, they are saved into the directory of the installation of SALOME:\r
140 \r
141 ``Salome-VXXXX_package-YY/modules/SMESH_VXXXX/lib/python3.6/site-packages/salome/blocFissure/materielCasTests``\r
142 \r
143 There is no need to generate them again.\r
144 \r
145 1) **To execute all test cases**::\r
146 \r
147     from blocFissure.CasTests import execution_Cas\r
148 \r
149 2) **To execute only selected test cases**:\r
150 \r
151 modify the file ``CasTests/execution_Cas.py`` and change::\r
152 \r
153     runall = False. #old : True\r
154 \r
155 And change from 0 to 1 of the index of the test you want to launch::\r
156 \r
157     torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\r
158 \r
159 then launch the test cases::\r
160 \r
161     from blocFissure.CasTests import execution_Cas\r
162 \r
163 The index of each test is the position of the test in the following table, from 0 for cubeAngle, 1 for cubeAngle2,\r
164 2 for cubeCoin... from top to bottom, then from left to right.\r
165 \r
166 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
167 | cubeAngle          | cylindre_2         | eprouvetteDroite_2 | fissureCoude_3  | fissureCoude_9  |\r
168 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
169 | cubeAngle2         | disquePerce        | faceGauche         | fissureCoude_4  | fissure_Coude   |\r
170 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
171 | cubeCoin           | ellipse_1          | faceGauche_2       | fissureCoude_5  | fissure_Coude_4 |\r
172 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
173 | cubeMilieu         | ellipse_2          | fissureCoude_1     | fissureCoude_6  | vis_1           |\r
174 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
175 | cubeTransverse     | eprouvetteCourbe   | fissureCoude_10    | fissureCoude_7  | tube            |\r
176 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
177 | cylindre           | eprouvetteDroite   | fissureCoude_2     | fissureCoude_8  |                 |\r
178 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
179 \r
180 3) **To execute only one test case**::\r
181 \r
182     from blocFissure.CasTests.[TEST_CASE_NAME] import [TEST_CASE_NAME]\r
183 \r
184     [TEST_CASE_NAME](0).executeProbleme()\r
185 \r
186 [TEST_CASE_NAME] is the name of the test case in the previous list. Note that the test cases fissureCoude_4 and fissure_Coude_4 are very similar.\r
187 \r
188 \r
189 \r