Salome HOME
précision
[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 \r
96 .. _pipeTC:\r
97 \r
98 Cracked bended pipes\r
99 =====================================\r
100 \r
101 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
102 \r
103 +--------------------------------+----------------------------------------------+\r
104 | .. image:: images/coude_0.png  | .. image:: images/coude_0_2.png              |\r
105 |    :height: 500                |    :width: 500                               |\r
106 |    :align: center              |    :align: center                            |\r
107 |                                +----------------------------------------------+\r
108 |                                | View of the external crack of test_coude_0   |\r
109 |                                +----------------------------------------------+\r
110 |                                | .. image:: images/coude_3.png                |\r
111 |                                |    :width: 500                               |\r
112 |                                |    :align: center                            |\r
113 +--------------------------------+----------------------------------------------+\r
114 | Bended pipe test case coude_0  | View of the internal crack of test_coude_3   |\r
115 | with an external crack         |                                              |\r
116 +--------------------------------+----------------------------------------------+\r
117 \r
118 coude_0 can be computed using this file for the data:\r
119 \r
120   * :download:`data for a bended puipe <../ihm/dialogFissureCoude.dic>`\r
121 \r
122 « 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
123 \r
124 Running test cases\r
125 =====================================\r
126 \r
127 All the files for these test cases are stored in the directory of the installation of SALOME:\r
128 \r
129 ``Salome-VXXXX_package-YY/modules/SMESH_VXXXX/lib/python3.6/site-packages/salome/blocFissure``\r
130 \r
131 The test cases can be runned either through the python window of the SALOME GUI or with a python script.\r
132 \r
133 0) **Generate med and breps files.**::\r
134 \r
135     from blocFissure.materielCasTests import genereMateriel\r
136 \r
137 Once the files are generated, they are saved into the directory of the installation of SALOME:\r
138 \r
139 ``Salome-VXXXX_package-YY/modules/SMESH_VXXXX/lib/python3.6/site-packages/salome/blocFissure/materielCasTests``\r
140 \r
141 There is no need to generate them again.\r
142 \r
143 1) **To execute all test cases**::\r
144 \r
145     from blocFissure.CasTests import execution_Cas\r
146 \r
147 2) **To execute only selected test cases**:\r
148 \r
149 modify the file ``CasTests/execution_Cas.py`` and change::\r
150 \r
151     runall = False. #old : True\r
152 \r
153 And change from 0 to 1 of the index of the test you want to launch::\r
154 \r
155     torun = [ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\r
156 \r
157 then launch the test cases::\r
158 \r
159     from blocFissure.CasTests import execution_Cas\r
160 \r
161 The index of each test is the position of the test in the following table, from 0 for cubeAngle, 1 for cubeAngle2,\r
162 2 for cubeCoin... from top to bottom, then from left to right.\r
163 \r
164 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
165 | cubeAngle          | cylindre_2         | eprouvetteDroite_2 | fissureCoude_3  | fissureCoude_8  |\r
166 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
167 | cubeAngle2         | disquePerce        | faceGauche         | fissureCoude_4  | fissureCoude_10 |\r
168 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
169 | cubeCoin           | ellipse_1          | faceGauche_2       | fissure_Coude_4 | fissureCoude_10 |\r
170 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
171 | cubeMilieu         | ellipse_2          | fissure_Coude      | fissureCoude_5  | vis_1           |\r
172 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
173 | cubeTransverse     | eprouvetteCourbe   | fissureCoude_1     | fissureCoude_6  |                 |\r
174 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
175 | cylindre           | eprouvetteDroite   | fissureCoude_2     | fissureCoude_7  |                 |\r
176 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
177 \r
178 3) **To execute only one test case**::\r
179 \r
180     from blocFissure.CasTests.[TEST_CASE_NAME] import [TEST_CASE_NAME]\r
181 \r
182     [TEST_CASE_NAME](0).executeProbleme()\r
183 \r
184 [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
185 \r
186 \r
187 \r