36 Cerr <<
"Debut Ecr_fic_Ansys::interpreter" << finl;
39 int non_hidden,domaines,tetas;
41 is >> nom_dom >> nom_fic >> non_hidden >> domaines >> tetas;
42 if(! sub_type(Domaine,
objet(nom_dom)))
45 Cerr <<
"On attendait un objet de type Domaine" << finl;
49 const Domaine& dom=ref_cast(Domaine,
objet(nom_dom));
50 const Domaine& domaine=dom;
53 fic <<
"/BATCH" << finl;
54 fic <<
"/PREP7" << finl;
55 fic <<
"/TITLE,none" << finl;
59 fic <<
"ANTYPE,STATIC" << finl;
64 fic <<
"CSYS,0" << finl;
66 fic <<
"CSYS,1" << finl;
68 fic <<
"CSYS,0" << finl;
69 fic <<
"/NOPR" << finl;
76 int nb_som=domaine.nb_som();
79 for (i=0; i<nb_som; i++)
82 xyz(k)=dom.
coord(i,k);
104 fic <<
"ET,1,SHELL57" << finl;
109 if (type==
"Rectangle" || type==
"Triangle" || type==
"Hexaedre" || type==
"Tetraedre" || type==
"Quadrangle" || type==
"Hexaedre_VEF")
112 fic <<
"ET,1,LINK32" << finl;
115 fic <<
"ET,1,SURF152" << finl;
116 fic <<
"KEYOPT,1,4,1" << finl;
117 fic <<
"KEYOPT,1,5,0" << finl;
120 else if (type==
"Rectangle_axi" || type==
"Hexaedre_axi")
123 fic <<
"ET,1,LINK32" << finl;
126 fic <<
"ET,1,SURF152" << finl;
127 fic <<
"KEYOPT,1,4,1" << finl;
128 fic <<
"KEYOPT,1,5,0" << finl;
131 else if (type==
"Rectangle_2D_axi")
133 fic <<
"ET,1,LINK32" << finl;
137 Cerr <<
"Element " << type <<
" inexistant." << finl;
150 int nombre_faces_rayonnantes=domaine.nb_bords()+domaine.nb_raccords();
151 for (i=0; i<nombre_faces_rayonnantes; i++)
153 const IntTab& som=(i<domaine.nb_bords()?domaine.bord(i).faces().les_sommets():domaine.raccord(i-domaine.nb_bords())->faces().les_sommets());
155 for (j=0; j<nb_faces; j++)
167 if (t1<t0) t1+=2*M_PI;
170 pos(0,1)=0.5*(t0+t1);
176 else if (est_egal(t0,t1))
178 pos(0,0)=0.5*(r0+r1);
195 pos(0,0)=0.5*(x0+x1)+alpha*nx;
196 pos(0,1)=0.5*(y0+y1)+alpha*ny;
201 fic<<
"EN,"<<num_globale+j+1<<
","<<som(j,0)+1<<
","<<som(j,1)+1;
207 fic<<
"EN,"<<num_globale+j+1<<
","<<som(j,1)+1<<
","<<som(j,0)+1;
217 double r0,t0,z0,r3,t3,z3;
225 if (t3<t0) t3+=2*M_PI;
229 pos(0,1)=0.5*(t0+t3);
234 pos(0,2)=0.5*(z0+z3);
236 else if (est_egal(z0,z3))
238 pos(0,0)=0.5*(r0+r3);
239 pos(0,1)=0.5*(t0+t3);
245 else if (est_egal(t0,t3))
247 pos(0,0)=0.5*(r0+r3);
248 pos(0,2)=0.5*(z0+z3);
256 fic<<
"EN,"<<num_globale+j+1<<
","<<som(j,0)+1<<
","<<som(j,1)+1<<
","<<som(j,3)+1<<
","<<som(j,2)+1<<finl;
258 fic<<
"EN,"<<num_globale+j+1<<
","<<som(j,0)+1<<
","<<som(j,2)+1<<
","<<som(j,3)+1<<
","<<som(j,1)+1<<finl;
262 double x0,y0,z0,x1,y1,z1,x2,y2,z2;
272 double nx=(y1-y0)*(z2-z0)-(z1-z0)*(y2-y0);
273 double ny=(z1-z0)*(x2-x0)-(x1-x0)*(z2-z0);
274 double nz=(x1-x0)*(y2-y0)-(y1-y0)*(x2-x0);
276 pos(0,0)=(x0+x1+x2)/3.+alpha*nx;
277 pos(0,1)=(y0+y1+y2)/3.+alpha*ny;
278 pos(0,2)=(z0+z1+z2)/3.+alpha*nz;
282 if (type==
"Tetraedre")
283 fic<<
"EN,"<<num_globale+j+1<<
","<<som(j,0)+1<<
","<<som(j,1)+1<<
","<<som(j,2)+1<<finl;
285 fic<<
"EN,"<<num_globale+j+1<<
","<<som(j,0)+1<<
","<<som(j,1)+1<<
","<<som(j,3)+1<<
","<<som(j,2)+1<<finl;
289 if (type==
"Tetraedre")
290 fic<<
"EN,"<<num_globale+j+1<<
","<<som(j,0)+1<<
","<<som(j,2)+1<<
","<<som(j,1)+1<<finl;
292 fic<<
"EN,"<<num_globale+j+1<<
","<<som(j,0)+1<<
","<<som(j,2)+1<<
","<<som(j,3)+1<<
","<<som(j,1)+1<<finl;
297 pos(0,0)=(x0+x1+x2)/3.-alpha*nx;
298 pos(0,1)=(y0+y1+y2)/3.-alpha*ny;
299 pos(0,2)=(z0+z1+z2)/3.-alpha*nz;
303 Cerr <<
"Cas non prevu dans l'algorithme de Ecr_fic_Ansys::interpreter ! " << finl;
304 Cerr <<
"La face " << j <<
" est entouree de deux elements " << el <<
" " << elem(0) << finl;
305 Cerr << alpha*nx << finl;
306 Cerr << alpha*ny << finl;
307 Cerr << alpha*nz << finl;
308 Cerr <<
"Contacter le support TRUST." <<finl;
315 num_globale+=nb_faces;
317 fic <<
"/GOPR" << finl;
318 Cerr <<
"Nombre de faces: " << num_globale << finl;
322 Cerr <<
"Methode Radiosity Solver" << finl;
323 Cerr <<
"La RAM necessaire pour le calcul va etre de " << 16*num_globale*num_globale/1024/1024 <<
" Mo." << finl;
324 Cerr <<
"26Mo <->1.8Mo" << finl;
325 Cerr <<
"25Mo <->2.6Mo" << finl;
326 fic <<
"SFE,ALL,2,RDSF,2,1" << finl;
327 fic <<
"/AUX12" << finl;
331 Cerr <<
"Methode Radiation Matrix" << finl;
332 Cerr <<
"La RAM necessaire pour le calcul va etre de " << 16*num_globale*num_globale/1024/1024 <<
" Mo." << finl;
333 fic <<
"/AUX12" << finl;
336 fic <<
"VTYPE,0," << domaines << finl;
337 else if (non_hidden==1)
338 fic <<
"VTYPE,1" << finl;
341 fic <<
"GEOM,1," << tetas << finl;
343 fic <<
"GEOM,1" << finl;
345 fic <<
"GEOM,0" << finl;
346 fic <<
"MPRINT,1" << finl;
354 fic <<
"SPCTEMP,1,0.E+00" << finl;
356 fic <<
"HEMIOPT,"<<domaines<< finl;
357 fic <<
"TOFFST,100" << finl;
358 fic <<
"VFOPT,NEW" << finl;
362 Nom vf_non_groupe(vf);
363 vf_non_groupe+=
".non_groupe";
364 vf_non_groupe=
"trash";
365 fic <<
"VFCALC," << vf_non_groupe << finl;
366 fic <<
"/OUT,trash" << finl;
370 fic <<
"VFCALC," << vf << finl;
376 for (i=0; i<nombre_faces_rayonnantes; i++)
378 const IntTab& som=(i<domaine.nb_bords()?domaine.bord(i).faces().les_sommets():domaine.raccord(i-domaine.nb_bords())->faces().les_sommets());
380 fic<<
"ESEL,S,,,"<<num_globale+1<<
","<<num_globale+nb_faces<<finl;
381 fic<<
"CM,B"<<i<<
",ELEM"<<finl;
382 fic<<
"F"<<i<<
"=0."<<finl;
383 num_globale+=nb_faces;
385 for (i=0; i<nombre_faces_rayonnantes; i++)
387 for (j=0; j<nombre_faces_rayonnantes; j++)
389 fic<<
"VFQUERY,B"<<i<<
",B"<<j<<finl;
390 fic<<
"*GET,F"<<i<<j<<
",RAD,,VFAVG"<<finl;
391 fic<<
"F"<<i<<
"=F"<<i<<
"+F"<<i<<j<<finl;
394 fic <<
"/OUT," << vf << finl;
395 fic <<
"*VWRITE,1"<<finl;
396 fic <<
"('Number of Enclosures = ',F3.1)"<<finl;
397 fic <<
"*VWRITE,"<< nombre_faces_rayonnantes <<finl;
398 fic <<
"('Facteurs de forme',F6.1,' Number of Surfaces = "<< nombre_faces_rayonnantes <<
"')";
399 for (i=0; i<nombre_faces_rayonnantes; i++)
402 fic <<
"*VWRITE,F"<<i<<finl;
403 fic <<
"('TOTAL= '1(F12.10,1X))"<<finl;
406 for (j=0; j<nombre_faces_rayonnantes; j++)
412 fic <<
"("<<colonne<<
"(F12.10,1X))"<<finl;
417 fic <<
",F" << i << j;
420 fic <<
"(" << colonne <<
"(F12.10,1X))";
427 fic <<
"/OUT," << vf << finl;
428 fic <<
"WRITE,radiation_matrix" << finl;
430 fic <<
"FINISH" << finl;
432 Cerr <<
"Fin Ecr_fic_Ansys::interpreter" << finl;
433 Cerr <<
"Lancement d'Ansys." << finl;
434 Cerr <<
"Cela peut prendre du temps..." << finl;
435 Cerr << (int) system(
"./.run_ansys") << finl;
SmallArrOfTID_t & chercher_elements(const DoubleTab &pos, SmallArrOfTID_t &elem, int reel=0) const
Recherche des elements contenant les points dont les coordonnees sont specifiees.
const DoubleTab_t & coord_sommets() const
double coord(int_t i, int j) const