1 # -*- coding: utf-8 -*-
12 from Editeur import eficas_go
13 from Editeur import splash
14 from Editeur import session
15 from Editeur import eficas
16 from Editeur import images
21 class TestCase(unittest.TestCase):
23 self.root = Tkinter.Tk()
25 # Analyse des arguments de la ligne de commande
26 options=session.parse([])
32 init_common(None,None)
38 splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code)
39 splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...")
40 app=eficas.EFICAS(root,code=code)
42 jdcdisplay=app.bureau.JDCDisplay_courant
43 init_common(root,jdcdisplay)
46 co=j.addentite("DEBUT",0)
48 co=j.addentite("FIN",1)
50 jdctree=jdcdisplay.tree.tree.children[0]
51 panel=select_child("DEBUT",jdctree)
53 panel=create_param("P1",9.8,panel)
54 panel=create_param("P2",8.8,panel)
55 panel=create_param("P3",7,panel)
56 panel=create_param("P4","[2,3,4]",panel)
57 panel=create_param("P5","P3*P1",panel)
58 panel=create_param(None,"P1-3",panel)
59 panel=create_comment("Pas trouve shellpanel",panel)
61 #commnde LIRE_MAILLAGE
62 panel=create_command("LIRE_MAILLAGE",panel)
64 panel=nomme_concept("MAILLA2",panel)
65 panel=select_node(command)
66 panel=create_mocle("UNITE",panel)
67 panel=set_valeur("P4[1]",panel)
69 panel=select_node(command)
71 panel=create_formule("az","a,z","a+z",panel)
73 panel=create_command("AFFE_MODELE",panel)
75 select_child("MAILLAGE",command)
76 panel=select_node(command)
77 panel=create_mocle("AFFE",panel)
79 panel=select_child("PHENOMENE",parent)
80 choose_valeur("MECANIQUE",panel)
81 panel=select_child("b_mecanique",parent)
82 panel=select_child("MODELISATION",panel.node)
83 add_valeur_into("3D",panel)
84 add_valeur_into("3D_FLUIDE",panel)
86 panel=select_node(parent)
87 panel=create_mocle("TOUT",panel)
88 choose_valeur("OUI",panel)
89 panel=select_node(command)
90 panel=nomme_concept("MO",panel)
92 #fin commande AFFE_MODELE
95 panel=create_mocle("AFFE",panel)
96 panel=select_node(command)
97 panel=create_mocle("AFFE",panel)
98 panel=select_mcf("AFFE",1,command)
100 panel=create_mocle("GROUP_NO",panel)
101 add_valeur("'GNP3','GNP5','GNP6','GNP7','GNP8','GNP9','GNP10','GNP11','GNP12'",panel)
102 valider_valeur(panel)
103 panel=select_child("PHENOMENE",parent)
104 choose_valeur("ACOUSTIQUE",panel)
105 panel=select_child("b_acoustique",parent)
106 panel=select_child("MODELISATION",panel.node)
107 add_valeur_into("PLAN",panel)
108 valider_valeur(panel)
110 panel=select_mcf("AFFE",2,command)
112 panel=create_mocle("GROUP_MA",panel)
113 add_valeur("MASSES",panel)
114 valider_valeur(panel)
115 panel=select_child("PHENOMENE",parent)
116 choose_valeur("THERMIQUE",panel)
117 panel=select_child("b_thermique",parent)
118 panel=select_child("MODELISATION",panel.node)
119 add_valeur_into("COQUE",panel)
120 valider_valeur(panel)
122 panel=select_node(command)
123 panel=nomme_concept("AFFE1",panel)
125 #fin commande AFFE_MODELE
126 #commande AFFE_CARA_ELEM
127 panel=create_command("AFFE_CARA_ELEM",panel)
129 panel=select_node(command)
130 panel=create_mocle("POUTRE",panel)
132 panel=select_child("SECTION",parent)
133 choose_valeur("CERCLE",panel)
134 panel=select_child("b_cercle",parent)
135 panel=select_child("b_constant",panel.node)
137 panel=select_child("CARA",p)
138 add_valeur_into("R",panel)
139 add_valeur_into("EP",panel)
140 valider_valeur(panel)
141 panel=select_child("VALE",p)
142 add_valeur("1,2",panel)
143 valider_valeur(panel)
144 panel=select_node(parent)
145 panel=create_mocle("GROUP_MA",panel)
146 add_valeur("GR1,GR2",panel)
147 valider_valeur(panel)
148 panel=select_child("MODELE",command)
149 choose_assd("MO",panel)
150 panel=select_node(command)
151 panel=nomme_concept("CARA",panel)
153 #fin commande AFFE_CARA_ELEM
154 panel=create_command("DEFI_FONCTION",panel)
156 panel=create_mocle("VALE",panel)
157 add_valeur("5.0,3.0",panel)
158 add_valeur("P4[1],P3",panel)
159 valider_valeur(panel)
160 panel=select_child("NOM_PARA",command)
161 choose_valeur("DX",panel)
162 panel=select_node(command)
163 panel=nomme_concept("F1",panel)
166 panel=create_command("DEFI_FONCTION",panel)
168 panel=create_mocle("VALE_C",panel)
169 add_valeur("5.0,7.0,9.0",panel)
170 add_valeur("9.0,8.0,7.0",panel)
171 valider_valeur(panel)
172 panel=select_child("NOM_PARA",command)
173 choose_valeur("DRX",panel)
174 panel=select_node(command)
175 panel=nomme_concept("F3",panel)
178 #MATER2=DEFI_MATERIAU(ELAS=_F(E=100000000000.0,
180 # ECRO_ASYM_LINE=_F(DC_SIGM_EPSI=0.0,
183 # SY_T=50000000.0,),);
185 panel=create_command("DEFI_MATERIAU",panel)
187 panel=create_mocle("ELAS",panel)
189 panel=select_child("E",p)
190 set_valeur("100000000000.0",panel)
191 panel=select_child("NU",p)
192 set_valeur("0.0",panel)
193 panel=select_node(command)
194 panel=create_mocle("ECRO_ASYM_LINE",panel)
196 panel=select_child("DC_SIGM_EPSI",p)
197 set_valeur("0.0",panel)
198 panel=select_child("SY_C",p)
199 set_valeur("200000000.0",panel)
200 panel=select_child("DT_SIGM_EPSI",p)
201 set_valeur("0.0",panel)
202 panel=select_child("SY_T",p)
203 set_valeur("50000000.0",panel)
204 panel=select_node(command)
205 panel=nomme_concept("MATER2",panel)
208 #PS1=DEFI_PARA_SENSI(VALE=1.0,);
209 #PS2=DEFI_PARA_SENSI(VALE=1.0,);
210 #PS3=DEFI_PARA_SENSI(VALE=1.0,);
211 panel=create_command("DEFI_PARA_SENSI",panel)
213 panel=select_child("VALE",command)
214 set_valeur("1.0",panel)
215 panel=select_node(command)
216 panel=nomme_concept("PS1",panel)
218 panel=create_command("DEFI_PARA_SENSI",panel)
220 panel=select_child("VALE",command)
221 set_valeur("1.0",panel)
222 panel=select_node(command)
223 panel=nomme_concept("PS2",panel)
225 panel=create_command("DEFI_PARA_SENSI",panel)
227 panel=select_child("VALE",command)
228 set_valeur("1.0",panel)
229 panel=select_node(command)
230 panel=nomme_concept("PS3",panel)
232 #CHMAT2=AFFE_MATERIAU(MAILLAGE=MAIL,
233 # AFFE=_F(TOUT='OUI',
235 panel=create_command("AFFE_MATERIAU",panel)
237 panel=select_child("MAILLAGE",command)
238 panel=select_child("AFFE",command)
240 panel=create_mocle("TOUT",panel)
241 choose_valeur("OUI",panel)
242 panel=select_child("MATER",affe)
243 add_valeur_into("MATER2",panel)
244 valider_valeur(panel)
245 panel=select_node(command)
246 panel=nomme_concept("CHMAT2",panel)
248 #AAAZ=AFFE_CHAR_THER(MODELE=AFFE1,
249 # TEMP_IMPO=_F(TOUT='OUI',
251 panel=create_command("AFFE_CHAR_THER",panel)
253 panel=create_mocle("TEMP_IMPO",panel)
255 panel=create_mocle("TOUT",panel)
256 choose_valeur("OUI",panel)
257 panel=select_node(temp)
258 panel=create_mocle("TEMP",panel)
259 panel=set_valeur("0.0",panel)
260 panel=select_child("MODELE",command)
261 choose_assd("AFFE1",panel)
262 panel=select_node(command)
263 panel=nomme_concept("AAAZ",panel)
265 #TH1=THER_LINEAIRE(MODELE=AFFE1,
267 # EXCIT=_F(CHARGE=AAAZ,),
268 # SENSIBILITE=(PS1,PS2,),);
269 panel=create_command("THER_LINEAIRE",panel)
271 panel=select_child("MODELE",command)
272 choose_assd("AFFE1",panel)
273 panel=select_child("CHAM_MATER",command)
274 panel=select_child("EXCIT",command)
275 panel=select_child("CHARGE",panel.node)
276 panel=select_node(command)
277 panel=create_mocle("SENSIBILITE",panel)
278 add_valeur_into("PS1",panel)
279 add_valeur_into("PS2",panel)
280 valider_valeur(panel)
281 panel=select_node(command)
282 panel=nomme_concept("TH1",panel)
284 #ACA1=AFFE_CHAR_ACOU(MODELE=AFFE1,
285 # PRES_IMPO=_F(TOUT='OUI',
286 # PRES=('RI',3.0,3.0,),),);
287 panel=create_command("AFFE_CHAR_ACOU",panel)
289 panel=create_mocle("PRES_IMPO",panel)
291 panel=create_mocle("TOUT",panel)
292 choose_valeur("OUI",panel)
293 panel=select_child("MODELE",command)
294 choose_assd("AFFE1",panel)
295 panel=select_child("PRES",pres)
296 set_complexe("'RI',3.0,3.0",panel)
297 panel=select_node(command)
298 panel=nomme_concept("ACA1",panel)
300 #MACRO_MATR_ASSE(MODELE=AFFE1,
301 # NUME_DDL=CO('DDL1'),
302 # MATR_ASSE=_F(MATRICE=CO('MAT1'),
303 # OPTION='RIGI_THER',),);
304 panel=create_command("MACRO_MATR_ASSE",panel)
306 panel=select_child("NUME_DDL",command)
307 set_sdco("DDL1",panel)
308 panel=select_child("MODELE",command)
309 choose_assd("AFFE1",panel)
310 panel=select_child("MATR_ASSE",command)
312 panel=select_child("OPTION",matr)
313 choose_valeur("RIGI_THER",panel)
314 panel=select_child("MATRICE",matr)
315 set_sdco("MAT1",panel)
316 panel=select_node(command)
318 #MACRO_MATR_ASSE(MODELE=AFFE1,
320 # MATR_ASSE=_F(MATRICE=MAT1,
321 # OPTION='RIGI_THER',),);
322 panel=create_command("MACRO_MATR_ASSE",panel)
324 panel=select_child("NUME_DDL",command)
325 choose_sdco("DDL1",panel)
326 panel=select_child("MODELE",command)
327 choose_assd("AFFE1",panel)
328 panel=select_child("MATR_ASSE",command)
330 panel=select_child("OPTION",matr)
331 choose_valeur("RIGI_THER",panel)
332 panel=select_child("MATRICE",matr)
333 set_sdco("MAT2",panel)
334 panel=select_node(command)
337 assert j.isvalid(),j.report()