MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
mg_import.cpp
Aller à la documentation de ce fichier.
1 //####//------------------------------------------------------------
2 //####//------------------------------------------------------------
3 //####// MAGiC
4 //####// Jean Christophe Cuilliere et Vincent FRANCOIS
5 //####// Departement de Genie Mecanique - UQTR
6 //####//------------------------------------------------------------
7 //####// MAGIC est un projet de recherche de l equipe ERICCA
8 //####// du departement de genie mecanique de l Universite du Quebec a Trois Rivieres
9 //####// http://www.uqtr.ca/ericca
10 //####// http://www.uqtr.ca/
11 //####//------------------------------------------------------------
12 //####//------------------------------------------------------------
13 //####//
14 //####// mg_import.cpp
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:53 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 #include "gestionversion.h"
23 #include "mg_import.h"
24 #include "fem_solution.h"
25 #include "fem_maillage.h"
26 #include "mg_maillage.h"
27 #include "mg_gestionnaire.h"
28 #include <stdio.h>
29 #include <string.h>
30 #include <math.h>
31 
33 {
34 public :
35 std::vector<MG_SEGMENT*> lstseg;
36 std::vector<MG_SOMMET*> lstsom;
37 void ajouter(MG_SEGMENT* seg)
38  {
39  MG_NOEUD* no1=seg->get_noeud1();
40  MG_NOEUD* no2=seg->get_noeud2();
41  if (no1->get_lien_topologie()!=NULL)
42  if (no1->get_lien_topologie()->get_dimension()==0) lstsom.push_back((MG_SOMMET*)no1->get_lien_topologie());
43  if (no2->get_lien_topologie()!=NULL)
44  if (no2->get_lien_topologie()->get_dimension()==0) lstsom.push_back((MG_SOMMET*)no2->get_lien_topologie());
45  lstseg.push_back(seg);
46  };
47 };
48 
49 class GMSH_FACE
50 {
51 public :
52 std::vector<MG_TRIANGLE*> lsttri;
53 std::vector<MG_QUADRANGLE*> lstquad;
54 std::vector<MG_ARETE*> lstare;
55 void update(void)
56  {
57  int nbtri=lsttri.size();
58  for (int i=0;i<nbtri;i++)
59  {
60  MG_TRIANGLE* tri=lsttri[i];
61  MG_SEGMENT* seg1=tri->get_segment1();
62  MG_SEGMENT* seg2=tri->get_segment2();
63  MG_SEGMENT* seg3=tri->get_segment3();
64  if (seg1->get_lien_topologie()!=NULL)
65  if (seg1->get_lien_topologie()->get_dimension()==1) lstare.push_back((MG_ARETE*)seg1->get_lien_topologie());
66  if (seg2->get_lien_topologie()!=NULL)
67  if (seg2->get_lien_topologie()->get_dimension()==1) lstare.push_back((MG_ARETE*)seg2->get_lien_topologie());
68  if (seg3->get_lien_topologie()!=NULL)
69  if (seg3->get_lien_topologie()->get_dimension()==1) lstare.push_back((MG_ARETE*)seg3->get_lien_topologie());
70  }
71  int nbqua=lstquad.size();
72  for (int i=0;i<nbqua;i++)
73  {
74  MG_QUADRANGLE* qua=lstquad[i];
75  MG_SEGMENT* seg1=qua->get_segment1();
76  MG_SEGMENT* seg2=qua->get_segment2();
77  MG_SEGMENT* seg3=qua->get_segment3();
78  MG_SEGMENT* seg4=qua->get_segment4();
79  if (seg1->get_lien_topologie()!=NULL)
80  if (seg1->get_lien_topologie()->get_dimension()==1) lstare.push_back((MG_ARETE*)seg1->get_lien_topologie());
81  if (seg2->get_lien_topologie()!=NULL)
82  if (seg2->get_lien_topologie()->get_dimension()==1) lstare.push_back((MG_ARETE*)seg2->get_lien_topologie());
83  if (seg3->get_lien_topologie()!=NULL)
84  if (seg3->get_lien_topologie()->get_dimension()==1) lstare.push_back((MG_ARETE*)seg3->get_lien_topologie());
85  if (seg4->get_lien_topologie()!=NULL)
86  if (seg4->get_lien_topologie()->get_dimension()==1) lstare.push_back((MG_ARETE*)seg4->get_lien_topologie());
87 
88  }
89  }
90 void ajouter(MG_TRIANGLE* tri)
91  {
92  MG_SEGMENT* seg1=tri->get_segment1();
93  MG_SEGMENT* seg2=tri->get_segment2();
94  MG_SEGMENT* seg3=tri->get_segment3();
95  if (seg1->get_lien_topologie()!=NULL)
96  if (seg1->get_lien_topologie()->get_dimension()==1) lstare.push_back((MG_ARETE*)seg1->get_lien_topologie());
97  if (seg2->get_lien_topologie()!=NULL)
98  if (seg2->get_lien_topologie()->get_dimension()==1) lstare.push_back((MG_ARETE*)seg2->get_lien_topologie());
99  if (seg3->get_lien_topologie()!=NULL)
100  if (seg3->get_lien_topologie()->get_dimension()==1) lstare.push_back((MG_ARETE*)seg3->get_lien_topologie());
101  lsttri.push_back(tri);
102  };
104  {
105  MG_SEGMENT* seg1=qua->get_segment1();
106  MG_SEGMENT* seg2=qua->get_segment2();
107  MG_SEGMENT* seg3=qua->get_segment3();
108  MG_SEGMENT* seg4=qua->get_segment4();
109  if (seg1->get_lien_topologie()!=NULL)
110  if (seg1->get_lien_topologie()->get_dimension()==1) lstare.push_back((MG_ARETE*)seg1->get_lien_topologie());
111  if (seg2->get_lien_topologie()!=NULL)
112  if (seg2->get_lien_topologie()->get_dimension()==1) lstare.push_back((MG_ARETE*)seg2->get_lien_topologie());
113  if (seg3->get_lien_topologie()!=NULL)
114  if (seg3->get_lien_topologie()->get_dimension()==1) lstare.push_back((MG_ARETE*)seg3->get_lien_topologie());
115  if (seg4->get_lien_topologie()!=NULL)
116  if (seg4->get_lien_topologie()->get_dimension()==1) lstare.push_back((MG_ARETE*)seg4->get_lien_topologie());
117  lstquad.push_back(qua);
118  };
119 };
120 
122 {
123 public :
124 std::vector<MG_TETRA*> lsttet;
125 std::vector<MG_HEXA*> lsthex;
126 std::vector<MG_FACE*> lstface;
127 void update(void)
128  {
129  int nbtet=lsttet.size();
130  for (int i=0;i<nbtet;i++)
131  {
132  MG_TETRA* tet=lsttet[i];
133  MG_TRIANGLE* tri1=tet->get_triangle1();
134  MG_TRIANGLE* tri2=tet->get_triangle2();
135  MG_TRIANGLE* tri3=tet->get_triangle3();
136  MG_TRIANGLE* tri4=tet->get_triangle4();
137  if (tri1->get_lien_topologie()!=NULL)
138  if (tri1->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)tri1->get_lien_topologie());
139  if (tri2->get_lien_topologie()!=NULL)
140  if (tri2->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)tri2->get_lien_topologie());
141  if (tri3->get_lien_topologie()!=NULL)
142  if (tri3->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)tri3->get_lien_topologie());
143  if (tri4->get_lien_topologie()!=NULL)
144  if (tri4->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)tri4->get_lien_topologie());
145  }
146  int nbhex=lsthex.size();
147  for (int i=0;i<nbhex;i++)
148  {
149  MG_HEXA* hex=lsthex[i];
150  MG_QUADRANGLE* qua1=hex->get_quadrangle1();
151  MG_QUADRANGLE* qua2=hex->get_quadrangle2();
152  MG_QUADRANGLE* qua3=hex->get_quadrangle3();
153  MG_QUADRANGLE* qua4=hex->get_quadrangle4();
154  MG_QUADRANGLE* qua5=hex->get_quadrangle5();
155  MG_QUADRANGLE* qua6=hex->get_quadrangle6();
156  if (qua1->get_lien_topologie()!=NULL)
157  if (qua1->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)qua1->get_lien_topologie());
158  if (qua2->get_lien_topologie()!=NULL)
159  if (qua2->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)qua2->get_lien_topologie());
160  if (qua3->get_lien_topologie()!=NULL)
161  if (qua3->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)qua3->get_lien_topologie());
162  if (qua4->get_lien_topologie()!=NULL)
163  if (qua4->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)qua4->get_lien_topologie());
164  if (qua5->get_lien_topologie()!=NULL)
165  if (qua5->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)qua5->get_lien_topologie());
166  if (qua6->get_lien_topologie()!=NULL)
167  if (qua6->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)qua6->get_lien_topologie());
168  }
169  }
170 void ajouter(MG_TETRA* tet)
171  {
172  MG_TRIANGLE* tri1=tet->get_triangle1();
173  MG_TRIANGLE* tri2=tet->get_triangle2();
174  MG_TRIANGLE* tri3=tet->get_triangle3();
175  MG_TRIANGLE* tri4=tet->get_triangle4();
176  if (tri1->get_lien_topologie()!=NULL)
177  if (tri1->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)tri1->get_lien_topologie());
178  if (tri2->get_lien_topologie()!=NULL)
179  if (tri2->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)tri2->get_lien_topologie());
180  if (tri3->get_lien_topologie()!=NULL)
181  if (tri3->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)tri3->get_lien_topologie());
182  if (tri4->get_lien_topologie()!=NULL)
183  if (tri4->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)tri4->get_lien_topologie());
184  lsttet.push_back(tet);
185  };
186 void ajouter(MG_HEXA* hex)
187  {
188  MG_QUADRANGLE* qua1=hex->get_quadrangle1();
189  MG_QUADRANGLE* qua2=hex->get_quadrangle2();
190  MG_QUADRANGLE* qua3=hex->get_quadrangle3();
191  MG_QUADRANGLE* qua4=hex->get_quadrangle4();
192  MG_QUADRANGLE* qua5=hex->get_quadrangle5();
193  MG_QUADRANGLE* qua6=hex->get_quadrangle6();
194  if (qua1->get_lien_topologie()!=NULL)
195  if (qua1->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)qua1->get_lien_topologie());
196  if (qua2->get_lien_topologie()!=NULL)
197  if (qua2->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)qua2->get_lien_topologie());
198  if (qua3->get_lien_topologie()!=NULL)
199  if (qua3->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)qua3->get_lien_topologie());
200  if (qua4->get_lien_topologie()!=NULL)
201  if (qua4->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)qua4->get_lien_topologie());
202  if (qua5->get_lien_topologie()!=NULL)
203  if (qua5->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)qua5->get_lien_topologie());
204  if (qua6->get_lien_topologie()!=NULL)
205  if (qua6->get_lien_topologie()->get_dimension()==2) lstface.push_back((MG_FACE*)qua6->get_lien_topologie());
206  lsthex.push_back(hex);
207  };
208 };
209 
210 
212 {
213 }
214 
216 {
217 }
218 
219 void MG_IMPORT::optis(FEM_MAILLAGE* mai,char *nomfichier,char *nomfichier2,double seuil,double niveau,int flottant)
220 {
221 
222  FILE* in=fopen(nomfichier,"rt");
223  char message[750];
224  int nb_tet=0;
225  int fin=0;
226  int fin3=0;
227  int *tab=new int[mai->get_nb_fem_element3()];
228  int *tab2=new int[mai->get_nb_fem_element3()];
229  for (int i=0;i<mai->get_nb_fem_element3();i++)
230  {
231  tab[i]=0;
232  tab2[i]=0;
233  }
234 
235  do
236  {
237  char *res=fgets(message,750,in);
238  if (feof(in)) fin=1;
239  char mot1[100];
240  char mot2[100];
241  char mot3[100];
242  char mot4[100];
243  char mot5[100];
244  char mot6[100];
245  char mot7[100];
246  char mot8[100];
247  sscanf(message,"%s %s",mot1,mot2);
248  if (strcmp(mot1,"TETRA4")==0)
249  {
250  char *res=fgets(message,750,in);
251  sscanf(message,"%s",mot3);
252  char *pt=strchr(mot3,'M')+1;
253  nb_tet=atoi(pt);
254  }
255  if (strcmp(mot1,"GROUP_MA")==0)
256  if (mot2[0]=='N')
257  if (mot2[1]=='O')
258  if (mot2[2]=='M')
259  if (mot2[3]=='=')
260  if (mot2[4]=='G')
261  if (mot2[5]=='M')
262  if (mot2[6]=='_')
263  {
264  char *p=mot2+7;
265  int num=atoi(p);
266  if (num>=seuil*niveau)
267  if (num<niveau)
268  {
269  int fin2=0;
270  do
271  {
272  char *res=fgets(message,750,in);
273  int numlu = sscanf(message,"%s %s %s %s %s %s %s %s",mot1,mot2,mot3,mot4,mot5,mot6,mot7,mot8);
274  if (strcmp(mot1,"FINSF")==0) fin2=1;
275  else
276  {
277  if (numlu >= 1)
278  {
279  char *p1=strchr(mot1,'M')+1;
280  int num1=atoi(p1);
281  tab[num1-nb_tet]=1;
282  }
283  if (numlu >= 2)
284  {
285  char *p2=strchr(mot2,'M')+1;
286  int num2=atoi(p2);
287  tab[num2-nb_tet]=1;
288  }
289  if (numlu >= 3)
290  {
291  char *p3=strchr(mot3,'M')+1;
292  int num3=atoi(p3);
293  tab[num3-nb_tet]=1;
294  }
295  if (numlu >= 4)
296  {
297  char *p4=strchr(mot4,'M')+1;
298  int num4=atoi(p4);
299  tab[num4-nb_tet]=1;
300  }
301  if (numlu >= 5)
302  {
303  char *p5=strchr(mot5,'M')+1;
304  int num5=atoi(p5);
305  tab[num5-nb_tet]=1;
306  }
307  if (numlu >= 6)
308  {
309  char *p6=strchr(mot6,'M')+1;
310  int num6=atoi(p6);
311  tab[num6-nb_tet]=1;
312  }
313  if (numlu >= 7)
314  {
315  char *p7=strchr(mot7,'M')+1;
316  int num7=atoi(p7);
317  tab[num7-nb_tet]=1;
318  }
319  if (numlu == 8)
320  {
321  char *p8=strchr(mot8,'M')+1;
322  int num8=atoi(p8);
323  tab[num8-nb_tet]=1;
324  }
325  }
326  }
327  while (fin2==0);
328  }
329  }
330  }
331  while (fin==0);
332 
333  if (flottant == 1)
334  {
335  FILE* in2=fopen(nomfichier2,"rt");
336  char message2[750];
337  do
338  {
339  char *res=fgets(message2,750,in2);
340  char mot1[100];
341  char mot2[100];
342  sscanf(message2,"%s %s",mot1,mot2);
343  int temp1=atoi(mot1);
344  int temp2=atoi(mot2);
345  if (temp2 == 1)
346  tab2[temp1-nb_tet] = 1;
347  if (feof(in2)) fin3=1;
348  }
349  while (fin3 == 0);
350  }
351 
352  int num=0;
353  LISTE_FEM_ELEMENT3::iterator it;
354  for (FEM_ELEMENT3* tet=mai->get_premier_element3(it);tet!=NULL;tet=mai->get_suivant_element3(it))
355  {
356  MG_TETRA* mgtet=(MG_TETRA*)tet->get_mg_element_maillage();
357  int origine = mgtet->get_origine();
358  if (origine == MAGIC::ORIGINE::IMPOSE)
359  {
360  }
361  else
362  {
363  if (flottant == 1)
364  {
365  if ((tab[num]==1) && (tab2[num]==1))
366  {
368  }
369  else
370  {
372  }
373  }
374  else
375  {
376  if (tab[num]==1)
377  {
379  }
380  else
381  {
383  }
384  }
385  }
386  num++;
387  }
388 
389  delete [] tab;
390  delete [] tab2;
391 }
392 
393 
394 
395 std::string MG_IMPORT::aster(int base,FEM_MAILLAGE* mai,char* chaine,char *nomfichier)
396 {
397  /* Liste des champs :
398  DEPL (noeud)
399  DEPL_2D (noeud)
400  FORCE_REACTION (noeud)
401  TEMPERATURE (noeud)
402  ENERGIE (element)
403  ENERGIE_2D (element)
404  ERREUR (element)
405  ERREUR_2D (element)
406  TENSEUR_SIGMA (element)
407  TENSEUR_SIGMA_2D (element)
408  TENSEUR_SIGMA_INF (element)
409  TENSEUR_SIGMA_MOY (element)
410  TENSEUR_SIGMA_SUP (element)
411  TENSEUR_EPS (element)
412  TENSEUR_EPS_2D (element)
413  TENSEUR_EPS_INF (element)
414  TENSEUR_EPS_MOY (element)
415  TENSEUR_EPS_SUP (element)
416  CONTRAINTE_EQUI (element)
417  CONTRAINTE_EQUI_2D (element)
418  CONTRAINTE_EQUI2 (element)
419  CONTRAINTE_EQUI2_2D (element)
420  CONTRAINTE_EQUI_INF (element)
421  CONTRAINTE_EQUI2_INF (element)
422  CONTRAINTE_EQUI_MOY (element)
423  CONTRAINTE_EQUI2_MOY (element)
424  CONTRAINTE_EQUI_SUP (element)
425  CONTRAINTE_EQUI2_SUP (element)
426  TENSEUR_SIGMA (noeud)
427  TENSEUR_SIGMA_2D (noeud)
428  TENSEUR_SIGMA_MOY (noeud)
429  TENSEUR_SIGMA_INF (noeud)
430  TENSEUR_SIGMA_SUP (noeud)
431  CONTRAINTE_EQUI (noeud)
432  CONTRAINTE_EQUI_2D (noeud)
433  CONTRAINTE_EQUI_SUP (noeud)
434  CONTRAINTE_EQUI2_SUP (noeud)
435  CONTRAINTE_EQUI_MOY (noeud)
436  CONTRAINTE_EQUI2_MOY (noeud)
437  CONTRAINTE_EQUI_INF (noeud)
438  CONTRAINTE_EQUI2_INF (noeud)
439  CONTRAINTE_EQUI2 (noeud)
440  CONTRAINTE_EQUI2_2D (noeud)
441  TENSEUR_EPS (noeud)
442  TENSEUR_EPS_2D (noeud)
443  TENSEUR_EPS_MOY (noeud)
444  TENSEUR_EPS_INF (noeud)
445 */
446 
447 
448 
449  FILE* in=fopen(chaine,"rt");
450  char message[750];
451  int fin=0;
452  int codeimport=0;
453  int nbtetra=0;
454  nbtetra=mai->get_nb_fem_element3();
455  if (nbtetra!=0)
456  codeimport=3; // Éléments volumiques
457  if ((mai->get_mg_geometrie()->get_nb_mg_volume()>0) && (mai->get_mg_geometrie()->get_nb_mg_poutre()>0)) codeimport=5;
458  std::string resultat="";
459  int pas_temperature=0;
460  int pas_depl=0;
461  int pas_flux=0;
462  int pas_tenseur_sigma_noeud=0;
463  int pas_tenseur_sigma_element=0;
464  int pas_tenseur_sigmainf_element=0;
465  int pas_tenseur_sigmamoy_element=0;
466  int pas_tenseur_sigmasup_element=0;
467  int pas_tenseur_eps_noeud=0;
468  int pas_tenseur_eps_element=0;
469  int pas_tenseur_epsinf_element=0;
470  int pas_tenseur_epsmoy_element=0;
471  int pas_tenseur_epssup_element=0;
472  int pas_contrainte_equi_noeud=0;
473  int pas_contrainte_equi_element=0;
474  int pas_contrainte_equi2_noeud=0;
475  int pas_contrainte_equi2_element=0;
476  int pas_contrainte_equi2inf_element=0;
477  int pas_contrainte_equi2moy_element=0;
478  int pas_contrainte_equi2sup_element=0;
479 
480 
481  bool passejob=false;
482 
483  do
484  {
485  char *res=fgets(message,750,in);
486  if (feof(in)) fin=1;
487  char mot1[100];
488  char mot2[100];
489  char mot3[100];
490  char mot4[100];
491  char mot5[100];
492  char mot6[100];
493  char mot7[100];
494  char mot8[100];
495  char mot9[100];
496  char mot10[100];
497  char mot11[100];
498  int numlu=sscanf(message,"%s %s %s %s %s %s %s %s %s %s %s",mot1,mot2,mot3,mot4,mot5,mot6,mot7,mot8,mot9,mot10,mot11);
499 
500  if (numlu>2)
501  if (strcmp(mot2,"TOTAL_JOB")==0)
502  if (passejob==false)
503  {
504  double val;
505  sscanf(mot8,"%lf",&val);
507  sscanf(mot10,"%lf",&val);
509  passejob=true;
510  }
511 
512 
513 
514  std::string retour="\n";
515  if (numlu>2)
516  if (strcmp(mot1,"MECANIQUE")==0)
517  if (strcmp(mot2,":")==0)
518  if (strcmp(mot3,"ESTIMATEUR")==0)
519  {
520  resultat=resultat+message;
521  fgets(message,750,in);
522  fgets(message,750,in);
523  fgets(message,750,in);
524  fgets(message,750,in);
525  resultat=resultat+message;
526  fgets(message,750,in);
527  resultat=resultat+message;
528  }
529 
530  if (numlu>6)
531  if (strcmp(mot1,"CHAMP")==0)
532  if (strcmp(mot2,"AUX")==0)
533  if (strcmp(mot3,"NOEUDS")==0)
534  if (strcmp(mot4,"DE")==0)
535  if (strcmp(mot5,"NOM")==0)
536  if (strcmp(mot6,"SYMBOLIQUE")==0)
537  if (strcmp(mot7,"DEPL")==0)
538  {import_deplacement(base,mai,in,nomfichier,codeimport,pas_depl); pas_depl++;}
539  if (numlu>6)
540  if (strcmp(mot1,"CHAMP")==0)
541  if (strcmp(mot2,"AUX")==0)
542  if (strcmp(mot3,"NOEUDS")==0)
543  if (strcmp(mot4,"DE")==0)
544  if (strcmp(mot5,"NOM")==0)
545  if (strcmp(mot6,"SYMBOLIQUE")==0)
546  if (strcmp(mot7,"DEPL_2D")==0)
547  import_deplacement(base,mai,in,nomfichier,4);
548  if (numlu>6)
549  if (strcmp(mot1,"CHAMP")==0)
550  if (strcmp(mot2,"AUX")==0)
551  if (strcmp(mot3,"NOEUDS")==0)
552  if (strcmp(mot4,"DE")==0)
553  if (strcmp(mot5,"NOM")==0)
554  if (strcmp(mot6,"SYMBOLIQUE")==0)
555  if (strcmp(mot7,"FORCE_REACTION")==0)
556  import_reaction(base,mai,in);
557  if (numlu>6)
558  if (strcmp(mot1,"CHAMP")==0)
559  if (strcmp(mot2,"AUX")==0)
560  if (strcmp(mot3,"NOEUDS")==0)
561  if (strcmp(mot4,"DE")==0)
562  if (strcmp(mot5,"NOM")==0)
563  if (strcmp(mot6,"SYMBOLIQUE")==0)
564  if (strcmp(mot7,"TEMPERATURE")==0)
565  {
566  codeimport=3;
567  import_temperature(base,mai,in,nomfichier,codeimport,pas_temperature);
568  pas_temperature++;
569  }
570 
571 
572 
573  if (numlu>9)
574  if (strcmp(mot1,"CHAMP")==0)
575  if (strcmp(mot2,"PAR")==0)
576  if (strcmp(mot3,"ELEMENT")==0)
577  if (strcmp(mot4,"CONSTANT")==0)
578  if (strcmp(mot5,"SUR")==0)
579  if (strcmp(mot6,"ELEMENT")==0)
580  if (strcmp(mot7,"DE")==0)
581  if (strcmp(mot8,"NOM")==0)
582  if (strcmp(mot9,"SYMBOLIQUE")==0)
583  if (strcmp(mot10,"ENERGIE")==0)
584  import_energie(base,mai,in,nomfichier,codeimport);
585  if (numlu>9)
586  if (strcmp(mot1,"CHAMP")==0)
587  if (strcmp(mot2,"PAR")==0)
588  if (strcmp(mot3,"ELEMENT")==0)
589  if (strcmp(mot4,"CONSTANT")==0)
590  if (strcmp(mot5,"SUR")==0)
591  if (strcmp(mot6,"ELEMENT")==0)
592  if (strcmp(mot7,"DE")==0)
593  if (strcmp(mot8,"NOM")==0)
594  if (strcmp(mot9,"SYMBOLIQUE")==0)
595  if (strcmp(mot10,"ENERGIE_2D")==0)
596  import_energie(base,mai,in,nomfichier,4);
597  if (numlu>9)
598  if (strcmp(mot1,"CHAMP")==0)
599  if (strcmp(mot2,"PAR")==0)
600  if (strcmp(mot3,"ELEMENT")==0)
601  if (strcmp(mot4,"CONSTANT")==0)
602  if (strcmp(mot5,"SUR")==0)
603  if (strcmp(mot6,"ELEMENT")==0)
604  if (strcmp(mot7,"DE")==0)
605  if (strcmp(mot8,"NOM")==0)
606  if (strcmp(mot9,"SYMBOLIQUE")==0)
607  if (strcmp(mot10,"ERREUR")==0)
608  import_erreur(base,mai,in,nomfichier,codeimport);
609  if (numlu>9)
610  if (strcmp(mot1,"CHAMP")==0)
611  if (strcmp(mot2,"PAR")==0)
612  if (strcmp(mot3,"ELEMENT")==0)
613  if (strcmp(mot4,"CONSTANT")==0)
614  if (strcmp(mot5,"SUR")==0)
615  if (strcmp(mot6,"ELEMENT")==0)
616  if (strcmp(mot7,"DE")==0)
617  if (strcmp(mot8,"NOM")==0)
618  if (strcmp(mot9,"SYMBOLIQUE")==0)
619  if (strcmp(mot10,"ERREUR_2D")==0)
620  import_erreur(base,mai,in,nomfichier,4);
621  if (numlu>8)
622  if (strcmp(mot1,"CHAMP")==0)
623  if (strcmp(mot2,"PAR")==0)
624  if (strcmp(mot3,"ELEMENT")==0)
625  if (strcmp(mot4,"AUX")==0)
626  if (strcmp(mot5,"NOEUDS")==0)
627  if (strcmp(mot6,"DE")==0)
628  if (strcmp(mot7,"NOM")==0)
629  if (strcmp(mot8,"SYMBOLIQUE")==0)
630  if (strcmp(mot9,"TENSEUR_SIGMA")==0)
631  {
632  codeimport=3; // Éléments volumiques
633  import_contrainte(base,mai,in,nomfichier,codeimport, pas_tenseur_sigma_element);
634  pas_tenseur_sigma_element++;
635  }
636 
637  if (numlu>8)
638  if (strcmp(mot1,"CHAMP")==0)
639  if (strcmp(mot2,"PAR")==0)
640  if (strcmp(mot3,"ELEMENT")==0)
641  if (strcmp(mot4,"AUX")==0)
642  if (strcmp(mot5,"NOEUDS")==0)
643  if (strcmp(mot6,"DE")==0)
644  if (strcmp(mot7,"NOM")==0)
645  if (strcmp(mot8,"SYMBOLIQUE")==0)
646  if (strcmp(mot9,"TENSEUR_SIGMA_2D")==0)
647  import_contrainte(base,mai,in,nomfichier,4);
648 
649  if (numlu>8)
650  if (strcmp(mot1,"CHAMP")==0)
651  if (strcmp(mot2,"PAR")==0)
652  if (strcmp(mot3,"ELEMENT")==0)
653  if (strcmp(mot4,"AUX")==0)
654  if (strcmp(mot5,"NOEUDS")==0)
655  if (strcmp(mot6,"DE")==0)
656  if (strcmp(mot7,"NOM")==0)
657  if (strcmp(mot8,"SYMBOLIQUE")==0)
658  if (strcmp(mot9,"TENSEUR_SIGMA_INF")==0)
659  {
660  codeimport=1; // Plan inférieur
661  import_contrainte(base,mai,in,nomfichier,codeimport,pas_tenseur_sigmainf_element);
662  pas_tenseur_sigmainf_element++;
663  }
664  if (numlu>8)
665  if (strcmp(mot1,"CHAMP")==0)
666  if (strcmp(mot2,"PAR")==0)
667  if (strcmp(mot3,"ELEMENT")==0)
668  if (strcmp(mot4,"AUX")==0)
669  if (strcmp(mot5,"NOEUDS")==0)
670  if (strcmp(mot6,"DE")==0)
671  if (strcmp(mot7,"NOM")==0)
672  if (strcmp(mot8,"SYMBOLIQUE")==0)
673  if (strcmp(mot9,"TENSEUR_SIGMA_MOY")==0)
674  {
675  codeimport=0; // Plan moyen
676  import_contrainte(base,mai,in,nomfichier,codeimport,pas_tenseur_sigmamoy_element);
677  pas_tenseur_sigmamoy_element++;
678  }
679 
680  if (numlu>8)
681  if (strcmp(mot1,"CHAMP")==0)
682  if (strcmp(mot2,"PAR")==0)
683  if (strcmp(mot3,"ELEMENT")==0)
684  if (strcmp(mot4,"AUX")==0)
685  if (strcmp(mot5,"NOEUDS")==0)
686  if (strcmp(mot6,"DE")==0)
687  if (strcmp(mot7,"NOM")==0)
688  if (strcmp(mot8,"SYMBOLIQUE")==0)
689  if (strcmp(mot9,"TENSEUR_SIGMA_SUP")==0)
690  {
691  codeimport=2; // Plan supérieur
692  import_contrainte(base,mai,in,nomfichier,codeimport,pas_tenseur_sigmasup_element);
693  pas_tenseur_sigmasup_element++;
694  }
695  if (numlu>8)
696  if (strcmp(mot1,"CHAMP")==0)
697  if (strcmp(mot2,"PAR")==0)
698  if (strcmp(mot3,"ELEMENT")==0)
699  if (strcmp(mot4,"AUX")==0)
700  if (strcmp(mot5,"NOEUDS")==0)
701  if (strcmp(mot6,"DE")==0)
702  if (strcmp(mot7,"NOM")==0)
703  if (strcmp(mot8,"SYMBOLIQUE")==0)
704  if (strcmp(mot9,"TENSEUR_EPS")==0)
705  {
706  codeimport=3; // Éléments volumiques
707  import_deformation(base,mai,in,nomfichier,codeimport,pas_tenseur_eps_element);
708  pas_tenseur_eps_element++;
709  }
710  if (numlu>8)
711  if (strcmp(mot1,"CHAMP")==0)
712  if (strcmp(mot2,"PAR")==0)
713  if (strcmp(mot3,"ELEMENT")==0)
714  if (strcmp(mot4,"AUX")==0)
715  if (strcmp(mot5,"NOEUDS")==0)
716  if (strcmp(mot6,"DE")==0)
717  if (strcmp(mot7,"NOM")==0)
718  if (strcmp(mot8,"SYMBOLIQUE")==0)
719  if (strcmp(mot9,"TENSEUR_EPS_2D")==0)
720  import_deformation(base,mai,in,nomfichier,4);
721  if (numlu>8)
722  if (strcmp(mot1,"CHAMP")==0)
723  if (strcmp(mot2,"PAR")==0)
724  if (strcmp(mot3,"ELEMENT")==0)
725  if (strcmp(mot4,"AUX")==0)
726  if (strcmp(mot5,"NOEUDS")==0)
727  if (strcmp(mot6,"DE")==0)
728  if (strcmp(mot7,"NOM")==0)
729  if (strcmp(mot8,"SYMBOLIQUE")==0)
730  if (strcmp(mot9,"TENSEUR_EPS_INF")==0)
731  {
732  codeimport=1; // Plan inférieur
733  import_deformation(base,mai,in,nomfichier,codeimport,pas_tenseur_epsinf_element);
734  pas_tenseur_epsinf_element++;
735  }
736  if (numlu>8)
737  if (strcmp(mot1,"CHAMP")==0)
738  if (strcmp(mot2,"PAR")==0)
739  if (strcmp(mot3,"ELEMENT")==0)
740  if (strcmp(mot4,"AUX")==0)
741  if (strcmp(mot5,"NOEUDS")==0)
742  if (strcmp(mot6,"DE")==0)
743  if (strcmp(mot7,"NOM")==0)
744  if (strcmp(mot8,"SYMBOLIQUE")==0)
745  if (strcmp(mot9,"TENSEUR_EPS_MOY")==0)
746  {
747  codeimport=0; // Plan moyen
748  import_deformation(base,mai,in,nomfichier,codeimport,pas_tenseur_epsmoy_element);
749  pas_tenseur_epsmoy_element++;
750  }
751  if (numlu>8)
752  if (strcmp(mot1,"CHAMP")==0)
753  if (strcmp(mot2,"PAR")==0)
754  if (strcmp(mot3,"ELEMENT")==0)
755  if (strcmp(mot4,"AUX")==0)
756  if (strcmp(mot5,"NOEUDS")==0)
757  if (strcmp(mot6,"DE")==0)
758  if (strcmp(mot7,"NOM")==0)
759  if (strcmp(mot8,"SYMBOLIQUE")==0)
760  if (strcmp(mot9,"TENSEUR_EPS_SUP")==0)
761  {
762  codeimport=2; // Plan supérieur
763  import_deformation(base,mai,in,nomfichier,codeimport,pas_tenseur_epssup_element);
764  pas_tenseur_epssup_element++;
765  }
766  if (numlu>8)
767  if (strcmp(mot1,"CHAMP")==0)
768  if (strcmp(mot2,"PAR")==0)
769  if (strcmp(mot3,"ELEMENT")==0)
770  if (strcmp(mot4,"AUX")==0)
771  if (strcmp(mot5,"NOEUDS")==0)
772  if (strcmp(mot6,"DE")==0)
773  if (strcmp(mot7,"NOM")==0)
774  if (strcmp(mot8,"SYMBOLIQUE")==0)
775  if (strcmp(mot9,"CONTRAINTE_EQUI")==0)
776  {
777  codeimport=3; // Éléments volumiques
778  import_contrainteequi(base,mai,in,nomfichier,codeimport,pas_contrainte_equi_element);
779  pas_contrainte_equi_element++;
780  }
781  if (numlu>8)
782  if (strcmp(mot1,"CHAMP")==0)
783  if (strcmp(mot2,"PAR")==0)
784  if (strcmp(mot3,"ELEMENT")==0)
785  if (strcmp(mot4,"AUX")==0)
786  if (strcmp(mot5,"NOEUDS")==0)
787  if (strcmp(mot6,"DE")==0)
788  if (strcmp(mot7,"NOM")==0)
789  if (strcmp(mot8,"SYMBOLIQUE")==0)
790  if (strcmp(mot9,"CONTRAINTE_EQUI_2D")==0)
791  import_contrainteequi(base,mai,in,nomfichier,4);
792  if (numlu>8)
793  if (strcmp(mot1,"CHAMP")==0)
794  if (strcmp(mot2,"PAR")==0)
795  if (strcmp(mot3,"ELEMENT")==0)
796  if (strcmp(mot4,"AUX")==0)
797  if (strcmp(mot5,"NOEUDS")==0)
798  if (strcmp(mot6,"DE")==0)
799  if (strcmp(mot7,"NOM")==0)
800  if (strcmp(mot8,"SYMBOLIQUE")==0)
801  if (strcmp(mot9,"CONTRAINTE_EQUI2")==0)
802  {
803  codeimport=3; // Éléments volumiques
804  import_contrainteequi2(base,mai,in,nomfichier,codeimport,pas_contrainte_equi2_element);
805  pas_contrainte_equi2_element++;
806  }
807  if (numlu>8)
808  if (strcmp(mot1,"CHAMP")==0)
809  if (strcmp(mot2,"PAR")==0)
810  if (strcmp(mot3,"ELEMENT")==0)
811  if (strcmp(mot4,"AUX")==0)
812  if (strcmp(mot5,"NOEUDS")==0)
813  if (strcmp(mot6,"DE")==0)
814  if (strcmp(mot7,"NOM")==0)
815  if (strcmp(mot8,"SYMBOLIQUE")==0)
816  if (strcmp(mot9,"CONTRAINTE_EQUI2_2D")==0)
817  import_contrainteequi2(base,mai,in,nomfichier,4);
818  if (numlu>8)
819  if (strcmp(mot1,"CHAMP")==0)
820  if (strcmp(mot2,"PAR")==0)
821  if (strcmp(mot3,"ELEMENT")==0)
822  if (strcmp(mot4,"AUX")==0)
823  if (strcmp(mot5,"NOEUDS")==0)
824  if (strcmp(mot6,"DE")==0)
825  if (strcmp(mot7,"NOM")==0)
826  if (strcmp(mot8,"SYMBOLIQUE")==0)
827  if (strcmp(mot9,"CONTRAINTE_EQUI_INF")==0)
828  {
829  codeimport=1; // Plan inférieur
830  import_contrainteequi(base,mai,in,nomfichier,codeimport);
831  }
832  if (numlu>8)
833  if (strcmp(mot1,"CHAMP")==0)
834  if (strcmp(mot2,"PAR")==0)
835  if (strcmp(mot3,"ELEMENT")==0)
836  if (strcmp(mot4,"AUX")==0)
837  if (strcmp(mot5,"NOEUDS")==0)
838  if (strcmp(mot6,"DE")==0)
839  if (strcmp(mot7,"NOM")==0)
840  if (strcmp(mot8,"SYMBOLIQUE")==0)
841  if (strcmp(mot9,"CONTRAINTE_EQUI2_INF")==0)
842  {
843  codeimport=1; // Plan inférieur
844  import_contrainteequi2(base,mai,in,nomfichier,codeimport,pas_contrainte_equi2inf_element);
845  pas_contrainte_equi2inf_element++;
846  }
847  if (numlu>8)
848  if (strcmp(mot1,"CHAMP")==0)
849  if (strcmp(mot2,"PAR")==0)
850  if (strcmp(mot3,"ELEMENT")==0)
851  if (strcmp(mot4,"AUX")==0)
852  if (strcmp(mot5,"NOEUDS")==0)
853  if (strcmp(mot6,"DE")==0)
854  if (strcmp(mot7,"NOM")==0)
855  if (strcmp(mot8,"SYMBOLIQUE")==0)
856  if (strcmp(mot9,"CONTRAINTE_EQUI_MOY")==0)
857  {
858  codeimport=0; // Plan moyen
859  import_contrainteequi(base,mai,in,nomfichier,codeimport);
860  }
861  if (numlu>8)
862  if (strcmp(mot1,"CHAMP")==0)
863  if (strcmp(mot2,"PAR")==0)
864  if (strcmp(mot3,"ELEMENT")==0)
865  if (strcmp(mot4,"AUX")==0)
866  if (strcmp(mot5,"NOEUDS")==0)
867  if (strcmp(mot6,"DE")==0)
868  if (strcmp(mot7,"NOM")==0)
869  if (strcmp(mot8,"SYMBOLIQUE")==0)
870  if (strcmp(mot9,"CONTRAINTE_EQUI2_MOY")==0)
871  {
872  codeimport=0; // Plan moyen
873  import_contrainteequi2(base,mai,in,nomfichier,codeimport,pas_contrainte_equi2moy_element);
874  pas_contrainte_equi2moy_element++;
875  }
876  if (numlu>8)
877  if (strcmp(mot1,"CHAMP")==0)
878  if (strcmp(mot2,"PAR")==0)
879  if (strcmp(mot3,"ELEMENT")==0)
880  if (strcmp(mot4,"AUX")==0)
881  if (strcmp(mot5,"NOEUDS")==0)
882  if (strcmp(mot6,"DE")==0)
883  if (strcmp(mot7,"NOM")==0)
884  if (strcmp(mot8,"SYMBOLIQUE")==0)
885  if (strcmp(mot9,"CONTRAINTE_EQUI_SUP")==0)
886  {
887  codeimport=2; // Plan supérieur
888  import_contrainteequi(base,mai,in,nomfichier,codeimport);
889  }
890  if (numlu>8)
891  if (strcmp(mot1,"CHAMP")==0)
892  if (strcmp(mot2,"PAR")==0)
893  if (strcmp(mot3,"ELEMENT")==0)
894  if (strcmp(mot4,"AUX")==0)
895  if (strcmp(mot5,"NOEUDS")==0)
896  if (strcmp(mot6,"DE")==0)
897  if (strcmp(mot7,"NOM")==0)
898  if (strcmp(mot8,"SYMBOLIQUE")==0)
899  if (strcmp(mot9,"CONTRAINTE_EQUI2_SUP")==0)
900  {
901  codeimport=2; // Plan supérieur
902  import_contrainteequi2(base,mai,in,nomfichier,codeimport,pas_contrainte_equi2sup_element);
903  pas_contrainte_equi2sup_element++;
904  }
905  if (numlu>6)
906  if (strcmp(mot1,"CHAMP")==0)
907  if (strcmp(mot2,"AUX")==0)
908  if (strcmp(mot3,"NOEUDS")==0)
909  if (strcmp(mot4,"DE")==0)
910  if (strcmp(mot5,"NOM")==0)
911  if (strcmp(mot6,"SYMBOLIQUE")==0)
912  if (strcmp(mot7,"TENSEUR_SIGMA")==0)
913  {
914  //codeimport=3;
915  import_contrainte_noeud(base,mai,in,nomfichier,codeimport,pas_tenseur_sigma_noeud);
916  pas_tenseur_sigma_noeud++;
917  }
918  if (numlu>6)
919  if (strcmp(mot1,"CHAMP")==0)
920  if (strcmp(mot2,"AUX")==0)
921  if (strcmp(mot3,"NOEUDS")==0)
922  if (strcmp(mot4,"DE")==0)
923  if (strcmp(mot5,"NOM")==0)
924  if (strcmp(mot6,"SYMBOLIQUE")==0)
925  if (strcmp(mot7,"TENSEUR_SIGMA_2D")==0)
926  {
927  codeimport=4;
928  import_contrainte_noeud(base,mai,in,nomfichier,codeimport);
929  }
930  if (numlu>6)
931  if (strcmp(mot1,"CHAMP")==0)
932  if (strcmp(mot2,"AUX")==0)
933  if (strcmp(mot3,"NOEUDS")==0)
934  if (strcmp(mot4,"DE")==0)
935  if (strcmp(mot5,"NOM")==0)
936  if (strcmp(mot6,"SYMBOLIQUE")==0)
937  if (strcmp(mot7,"TENSEUR_SIGMA_MOY")==0)
938  {
939  codeimport=0;
940  import_contrainte_noeud(base,mai,in,nomfichier,codeimport);
941  }
942  if (numlu>6)
943  if (strcmp(mot1,"CHAMP")==0)
944  if (strcmp(mot2,"AUX")==0)
945  if (strcmp(mot3,"NOEUDS")==0)
946  if (strcmp(mot4,"DE")==0)
947  if (strcmp(mot5,"NOM")==0)
948  if (strcmp(mot6,"SYMBOLIQUE")==0)
949  if (strcmp(mot7,"TENSEUR_SIGMA_INF")==0)
950  {
951  codeimport=1;
952  import_contrainte_noeud(base,mai,in,nomfichier,codeimport);
953  }
954  if (numlu>6)
955  if (strcmp(mot1,"CHAMP")==0)
956  if (strcmp(mot2,"AUX")==0)
957  if (strcmp(mot3,"NOEUDS")==0)
958  if (strcmp(mot4,"DE")==0)
959  if (strcmp(mot5,"NOM")==0)
960  if (strcmp(mot6,"SYMBOLIQUE")==0)
961  if (strcmp(mot7,"TENSEUR_SIGMA_SUP")==0)
962  {
963  codeimport=2;
964  import_contrainte_noeud(base,mai,in,nomfichier,codeimport);
965  }
966 
967 
968  if (numlu>6)
969  if (strcmp(mot1,"CHAMP")==0)
970  if (strcmp(mot2,"AUX")==0)
971  if (strcmp(mot3,"NOEUDS")==0)
972  if (strcmp(mot4,"DE")==0)
973  if (strcmp(mot5,"NOM")==0)
974  if (strcmp(mot6,"SYMBOLIQUE")==0)
975  if (strcmp(mot7,"CONTRAINTE_EQUI")==0)
976  {
977  codeimport=3;
978  import_contrainteequi_noeud(base,mai,in,nomfichier,codeimport,pas_contrainte_equi_noeud);
979  pas_contrainte_equi_noeud++;
980  }
981  if (numlu>6)
982  if (strcmp(mot1,"CHAMP")==0)
983  if (strcmp(mot2,"AUX")==0)
984  if (strcmp(mot3,"NOEUDS")==0)
985  if (strcmp(mot4,"DE")==0)
986  if (strcmp(mot5,"NOM")==0)
987  if (strcmp(mot6,"SYMBOLIQUE")==0)
988  if (strcmp(mot7,"CONTRAINTE_EQUI_2D")==0)
989  {
990  codeimport=4;
991  import_contrainteequi_noeud(base,mai,in,nomfichier,codeimport);
992  }
993  if (numlu>6)
994  if (strcmp(mot1,"CHAMP")==0)
995  if (strcmp(mot2,"AUX")==0)
996  if (strcmp(mot3,"NOEUDS")==0)
997  if (strcmp(mot4,"DE")==0)
998  if (strcmp(mot5,"NOM")==0)
999  if (strcmp(mot6,"SYMBOLIQUE")==0)
1000  if (strcmp(mot7,"CONTRAINTE_EQUI_SUP")==0)
1001  {
1002  codeimport=2;
1003  import_contrainteequi_noeud(base,mai,in,nomfichier,codeimport);
1004  }
1005  if (numlu>6)
1006  if (strcmp(mot1,"CHAMP")==0)
1007  if (strcmp(mot2,"AUX")==0)
1008  if (strcmp(mot3,"NOEUDS")==0)
1009  if (strcmp(mot4,"DE")==0)
1010  if (strcmp(mot5,"NOM")==0)
1011  if (strcmp(mot6,"SYMBOLIQUE")==0)
1012  if (strcmp(mot7,"CONTRAINTE_EQUI2_SUP")==0)
1013  {
1014  codeimport=2;
1015  import_contrainteequi2_noeud(base,mai,in,nomfichier,codeimport);
1016  }
1017  if (numlu>6)
1018  if (strcmp(mot1,"CHAMP")==0)
1019  if (strcmp(mot2,"AUX")==0)
1020  if (strcmp(mot3,"NOEUDS")==0)
1021  if (strcmp(mot4,"DE")==0)
1022  if (strcmp(mot5,"NOM")==0)
1023  if (strcmp(mot6,"SYMBOLIQUE")==0)
1024  if (strcmp(mot7,"CONTRAINTE_EQUI_MOY")==0)
1025  {
1026  codeimport=0;
1027  import_contrainteequi_noeud(base,mai,in,nomfichier,codeimport);
1028  }
1029  if (numlu>6)
1030  if (strcmp(mot1,"CHAMP")==0)
1031  if (strcmp(mot2,"AUX")==0)
1032  if (strcmp(mot3,"NOEUDS")==0)
1033  if (strcmp(mot4,"DE")==0)
1034  if (strcmp(mot5,"NOM")==0)
1035  if (strcmp(mot6,"SYMBOLIQUE")==0)
1036  if (strcmp(mot7,"CONTRAINTE_EQUI2_MOY")==0)
1037  {
1038  codeimport=0;
1039  import_contrainteequi2_noeud(base,mai,in,nomfichier,codeimport);
1040  }
1041 
1042  if (numlu>6)
1043  if (strcmp(mot1,"CHAMP")==0)
1044  if (strcmp(mot2,"AUX")==0)
1045  if (strcmp(mot3,"NOEUDS")==0)
1046  if (strcmp(mot4,"DE")==0)
1047  if (strcmp(mot5,"NOM")==0)
1048  if (strcmp(mot6,"SYMBOLIQUE")==0)
1049  if (strcmp(mot7,"CONTRAINTE_EQUI_INF")==0)
1050  {
1051  codeimport=1;
1052  import_contrainteequi_noeud(base,mai,in,nomfichier,codeimport);
1053  }
1054  if (numlu>6)
1055  if (strcmp(mot1,"CHAMP")==0)
1056  if (strcmp(mot2,"AUX")==0)
1057  if (strcmp(mot3,"NOEUDS")==0)
1058  if (strcmp(mot4,"DE")==0)
1059  if (strcmp(mot5,"NOM")==0)
1060  if (strcmp(mot6,"SYMBOLIQUE")==0)
1061  if (strcmp(mot7,"CONTRAINTE_EQUI2_INF")==0)
1062  {
1063  codeimport=1;
1064  import_contrainteequi2_noeud(base,mai,in,nomfichier,codeimport);
1065  }
1066  if (numlu>6)
1067  if (strcmp(mot1,"CHAMP")==0)
1068  if (strcmp(mot2,"AUX")==0)
1069  if (strcmp(mot3,"NOEUDS")==0)
1070  if (strcmp(mot4,"DE")==0)
1071  if (strcmp(mot5,"NOM")==0)
1072  if (strcmp(mot6,"SYMBOLIQUE")==0)
1073  if (strcmp(mot7,"CONTRAINTE_EQUI2")==0)
1074  {
1075  //codeimport=3;
1076  import_contrainteequi2_noeud(base,mai,in,nomfichier,codeimport,pas_contrainte_equi2_noeud);
1077  pas_contrainte_equi2_noeud++;
1078  }
1079 
1080  if (numlu>6)
1081  if (strcmp(mot1,"CHAMP")==0)
1082  if (strcmp(mot2,"AUX")==0)
1083  if (strcmp(mot3,"NOEUDS")==0)
1084  if (strcmp(mot4,"DE")==0)
1085  if (strcmp(mot5,"NOM")==0)
1086  if (strcmp(mot6,"SYMBOLIQUE")==0)
1087  if (strcmp(mot7,"CONTRAINTE_EQUI2_2D")==0)
1088  {
1089  codeimport=4;
1090  import_contrainteequi2_noeud(base,mai,in,nomfichier,codeimport);
1091  }
1092 
1093  if (numlu>6)
1094  if (strcmp(mot1,"CHAMP")==0)
1095  if (strcmp(mot2,"AUX")==0)
1096  if (strcmp(mot3,"NOEUDS")==0)
1097  if (strcmp(mot4,"DE")==0)
1098  if (strcmp(mot5,"NOM")==0)
1099  if (strcmp(mot6,"SYMBOLIQUE")==0)
1100  if (strcmp(mot7,"TENSEUR_EPS")==0)
1101  {
1102  //codeimport=3;
1103  import_deformation_noeud(base,mai,in,nomfichier,codeimport,pas_tenseur_eps_noeud);
1104  pas_tenseur_eps_noeud++;
1105  }
1106  if (numlu>6)
1107  if (strcmp(mot1,"CHAMP")==0)
1108  if (strcmp(mot2,"AUX")==0)
1109  if (strcmp(mot3,"NOEUDS")==0)
1110  if (strcmp(mot4,"DE")==0)
1111  if (strcmp(mot5,"NOM")==0)
1112  if (strcmp(mot6,"SYMBOLIQUE")==0)
1113  if (strcmp(mot7,"TENSEUR_EPS_2D")==0)
1114  {
1115  codeimport=4;
1116  import_deformation_noeud(base,mai,in,nomfichier,codeimport);
1117  }
1118  if (numlu>6)
1119  if (strcmp(mot1,"CHAMP")==0)
1120  if (strcmp(mot2,"AUX")==0)
1121  if (strcmp(mot3,"NOEUDS")==0)
1122  if (strcmp(mot4,"DE")==0)
1123  if (strcmp(mot5,"NOM")==0)
1124  if (strcmp(mot6,"SYMBOLIQUE")==0)
1125  if (strcmp(mot7,"TENSEUR_EPS_MOY")==0)
1126  {
1127  codeimport=0;
1128  import_deformation_noeud(base,mai,in,nomfichier,codeimport);
1129  }
1130  if (numlu>6)
1131  if (strcmp(mot1,"CHAMP")==0)
1132  if (strcmp(mot2,"AUX")==0)
1133  if (strcmp(mot3,"NOEUDS")==0)
1134  if (strcmp(mot4,"DE")==0)
1135  if (strcmp(mot5,"NOM")==0)
1136  if (strcmp(mot6,"SYMBOLIQUE")==0)
1137  if (strcmp(mot7,"TENSEUR_EPS_INF")==0)
1138  {
1139  codeimport=1;
1140  import_deformation_noeud(base,mai,in,nomfichier,codeimport);
1141  }
1142  if (numlu>8)
1143  if (strcmp(mot1,"CHAMP")==0)
1144  if (strcmp(mot2,"PAR")==0)
1145  if (strcmp(mot3,"ELEMENT")==0)
1146  if (strcmp(mot4,"AUX")==0)
1147  if (strcmp(mot5,"POINTS")==0)
1148  if (strcmp(mot6,"DE")==0)
1149  if (strcmp(mot7,"GAUSS")==0)
1150  if (strcmp(mot8,"DE")==0)
1151  if (strcmp(mot9,"NOM")==0)
1152  if (strcmp(mot10,"SYMBOLIQUE")==0)
1153  if (strcmp(mot11,"TENSEUR_SIGMA")==0)
1154  {
1155  codeimport=3; // Éléments volumiques
1156  import_contrainte_gauss(base,mai,in,nomfichier,codeimport, pas_tenseur_sigma_element);
1157  pas_tenseur_sigma_element++;
1158  }
1159 
1160  if (numlu>8)
1161  if (strcmp(mot1,"CHAMP")==0)
1162  if (strcmp(mot2,"PAR")==0)
1163  if (strcmp(mot3,"ELEMENT")==0)
1164  if (strcmp(mot4,"AUX")==0)
1165  if (strcmp(mot5,"NOEUDS")==0)
1166  if (strcmp(mot6,"DE")==0)
1167  if (strcmp(mot7,"NOM")==0)
1168  if (strcmp(mot8,"SYMBOLIQUE")==0)
1169  if (strcmp(mot9,"EFFORT_NOEUD")==0)
1170  {
1171 
1172  import_effort(base,mai,in,nomfichier,codeimport);
1173  }
1174  if (numlu>8)
1175  if (strcmp(mot1,"CHAMP")==0)
1176  if (strcmp(mot2,"PAR")==0)
1177  if (strcmp(mot3,"ELEMENT")==0)
1178  if (strcmp(mot4,"AUX")==0)
1179  if (strcmp(mot5,"NOEUDS")==0)
1180  if (strcmp(mot6,"DE")==0)
1181  if (strcmp(mot7,"NOM")==0)
1182  if (strcmp(mot8,"SYMBOLIQUE")==0)
1183  if (strcmp(mot9,"CONTRAINTE_MAX_POUTRE")==0)
1184  {
1185 
1186  import_contrainte_max_poutre(base,mai,in,nomfichier,codeimport);
1187  }
1188  if (numlu>8)
1189  if (strcmp(mot1,"CHAMP")==0)
1190  if (strcmp(mot2,"PAR")==0)
1191  if (strcmp(mot3,"ELEMENT")==0)
1192  if (strcmp(mot4,"AUX")==0)
1193  if (strcmp(mot5,"NOEUDS")==0)
1194  if (strcmp(mot6,"DE")==0)
1195  if (strcmp(mot7,"NOM")==0)
1196  if (strcmp(mot8,"SYMBOLIQUE")==0)
1197  if (strcmp(mot9,"CONTRAINTE_POUTRE")==0)
1198  {
1199 
1200  import_contrainte_poutre(base,mai,in,nomfichier,codeimport);
1201  }
1202  if (numlu>8)
1203  if (strcmp(mot1,"CHAMP")==0)
1204  if (strcmp(mot2,"PAR")==0)
1205  if (strcmp(mot3,"ELEMENT")==0)
1206  if (strcmp(mot4,"AUX")==0)
1207  if (strcmp(mot5,"POINTS")==0)
1208  if (strcmp(mot6,"DE")==0)
1209  if (strcmp(mot7,"GAUSS")==0)
1210  if (strcmp(mot8,"DE")==0)
1211  if (strcmp(mot9,"NOM")==0)
1212  if (strcmp(mot10,"SYMBOLIQUE")==0)
1213  if (strcmp(mot11,"TENSEUR_SIGMA_MOY")==0)
1214  {
1215  codeimport=0;
1216  import_contrainte_gauss(base,mai,in,nomfichier,codeimport);
1217  }
1218  if (numlu>8)
1219  if (strcmp(mot1,"CHAMP")==0)
1220  if (strcmp(mot2,"PAR")==0)
1221  if (strcmp(mot3,"ELEMENT")==0)
1222  if (strcmp(mot4,"AUX")==0)
1223  if (strcmp(mot5,"POINTS")==0)
1224  if (strcmp(mot6,"DE")==0)
1225  if (strcmp(mot7,"GAUSS")==0)
1226  if (strcmp(mot8,"DE")==0)
1227  if (strcmp(mot9,"NOM")==0)
1228  if (strcmp(mot10,"SYMBOLIQUE")==0)
1229  if (strcmp(mot11,"TENSEUR_SIGMA_INF")==0)
1230  {
1231  codeimport=1;
1232  import_contrainte_gauss(base,mai,in,nomfichier,codeimport);
1233  }
1234  if (numlu>8)
1235  if (strcmp(mot1,"CHAMP")==0)
1236  if (strcmp(mot2,"PAR")==0)
1237  if (strcmp(mot3,"ELEMENT")==0)
1238  if (strcmp(mot4,"AUX")==0)
1239  if (strcmp(mot5,"POINTS")==0)
1240  if (strcmp(mot6,"DE")==0)
1241  if (strcmp(mot7,"GAUSS")==0)
1242  if (strcmp(mot8,"DE")==0)
1243  if (strcmp(mot9,"NOM")==0)
1244  if (strcmp(mot10,"SYMBOLIQUE")==0)
1245  if (strcmp(mot11,"TENSEUR_SIGMA_SUP")==0)
1246  {
1247  codeimport=2;
1248  import_contrainte_gauss(base,mai,in,nomfichier,codeimport);
1249  }
1250  if (numlu>8)
1251  if (strcmp(mot1,"CHAMP")==0)
1252  if (strcmp(mot2,"PAR")==0)
1253  if (strcmp(mot3,"ELEMENT")==0)
1254  if (strcmp(mot4,"AUX")==0)
1255  if (strcmp(mot5,"POINTS")==0)
1256  if (strcmp(mot6,"DE")==0)
1257  if (strcmp(mot7,"GAUSS")==0)
1258  if (strcmp(mot8,"DE")==0)
1259  if (strcmp(mot9,"NOM")==0)
1260  if (strcmp(mot10,"SYMBOLIQUE")==0)
1261  if (strcmp(mot11,"TENSEUR_SIGMA_2D")==0)
1262  {
1263  codeimport=4;
1264  import_contrainte_gauss(base,mai,in,nomfichier,codeimport);
1265  }
1266  if (numlu>8)
1267  if (strcmp(mot1,"CHAMP")==0)
1268  if (strcmp(mot2,"PAR")==0)
1269  if (strcmp(mot3,"ELEMENT")==0)
1270  if (strcmp(mot4,"AUX")==0)
1271  if (strcmp(mot5,"POINTS")==0)
1272  if (strcmp(mot6,"DE")==0)
1273  if (strcmp(mot7,"GAUSS")==0)
1274  if (strcmp(mot8,"DE")==0)
1275  if (strcmp(mot9,"NOM")==0)
1276  if (strcmp(mot10,"SYMBOLIQUE")==0)
1277  if (strcmp(mot11,"TENSEUR_EPS")==0)
1278  {
1279  codeimport=3; // Éléments volumiques
1280  import_deformation_gauss(base,mai,in,nomfichier,codeimport, pas_tenseur_sigma_element);
1281  pas_tenseur_eps_element++;
1282  }
1283  if (numlu>8)
1284  if (strcmp(mot1,"CHAMP")==0)
1285  if (strcmp(mot2,"PAR")==0)
1286  if (strcmp(mot3,"ELEMENT")==0)
1287  if (strcmp(mot4,"AUX")==0)
1288  if (strcmp(mot5,"POINTS")==0)
1289  if (strcmp(mot6,"DE")==0)
1290  if (strcmp(mot7,"GAUSS")==0)
1291  if (strcmp(mot8,"DE")==0)
1292  if (strcmp(mot9,"NOM")==0)
1293  if (strcmp(mot10,"SYMBOLIQUE")==0)
1294  if (strcmp(mot11,"TENSEUR_EPS_MOY")==0)
1295  {
1296  codeimport=0; // Éléments volumiques
1297  import_deformation_gauss(base,mai,in,nomfichier,codeimport);
1298  }
1299  if (numlu>8)
1300  if (strcmp(mot1,"CHAMP")==0)
1301  if (strcmp(mot2,"PAR")==0)
1302  if (strcmp(mot3,"ELEMENT")==0)
1303  if (strcmp(mot4,"AUX")==0)
1304  if (strcmp(mot5,"POINTS")==0)
1305  if (strcmp(mot6,"DE")==0)
1306  if (strcmp(mot7,"GAUSS")==0)
1307  if (strcmp(mot8,"DE")==0)
1308  if (strcmp(mot9,"NOM")==0)
1309  if (strcmp(mot10,"SYMBOLIQUE")==0)
1310  if (strcmp(mot11,"TENSEUR_EPS_INF")==0)
1311  {
1312  codeimport=1;
1313  import_deformation_gauss(base,mai,in,nomfichier,codeimport);
1314  }
1315  if (numlu>8)
1316  if (strcmp(mot1,"CHAMP")==0)
1317  if (strcmp(mot2,"PAR")==0)
1318  if (strcmp(mot3,"ELEMENT")==0)
1319  if (strcmp(mot4,"AUX")==0)
1320  if (strcmp(mot5,"POINTS")==0)
1321  if (strcmp(mot6,"DE")==0)
1322  if (strcmp(mot7,"GAUSS")==0)
1323  if (strcmp(mot8,"DE")==0)
1324  if (strcmp(mot9,"NOM")==0)
1325  if (strcmp(mot10,"SYMBOLIQUE")==0)
1326  if (strcmp(mot11,"TENSEUR_EPS_2D")==0)
1327  {
1328  codeimport=4;
1329  import_deformation_gauss(base,mai,in,nomfichier,codeimport);
1330  }
1331  if (numlu>8)
1332  if (strcmp(mot1,"CHAMP")==0)
1333  if (strcmp(mot2,"PAR")==0)
1334  if (strcmp(mot3,"ELEMENT")==0)
1335  if (strcmp(mot4,"AUX")==0)
1336  if (strcmp(mot5,"POINTS")==0)
1337  if (strcmp(mot6,"DE")==0)
1338  if (strcmp(mot7,"GAUSS")==0)
1339  if (strcmp(mot8,"DE")==0)
1340  if (strcmp(mot9,"NOM")==0)
1341  if (strcmp(mot10,"SYMBOLIQUE")==0)
1342  if (strcmp(mot11,"TENSEUR_EPS_SUP")==0)
1343  {
1344  codeimport=2;
1345  import_deformation_gauss(base,mai,in,nomfichier,codeimport);
1346  }
1347  if (numlu>8)
1348  if (strcmp(mot1,"CHAMP")==0)
1349  if (strcmp(mot2,"PAR")==0)
1350  if (strcmp(mot3,"ELEMENT")==0)
1351  if (strcmp(mot4,"AUX")==0)
1352  if (strcmp(mot5,"POINTS")==0)
1353  if (strcmp(mot6,"DE")==0)
1354  if (strcmp(mot7,"GAUSS")==0)
1355  if (strcmp(mot8,"DE")==0)
1356  if (strcmp(mot9,"NOM")==0)
1357  if (strcmp(mot10,"SYMBOLIQUE")==0)
1358  if (strcmp(mot11,"CONTRAINTE_EQUI2")==0)
1359  {
1360  codeimport=3; // Éléments volumiques
1361  import_contrainteequi2_gauss(base,mai,in,nomfichier,codeimport, pas_contrainte_equi2_element);
1362  pas_contrainte_equi2_element++;
1363  }
1364  if (numlu>8)
1365  if (strcmp(mot1,"CHAMP")==0)
1366  if (strcmp(mot2,"PAR")==0)
1367  if (strcmp(mot3,"ELEMENT")==0)
1368  if (strcmp(mot4,"AUX")==0)
1369  if (strcmp(mot5,"POINTS")==0)
1370  if (strcmp(mot6,"DE")==0)
1371  if (strcmp(mot7,"GAUSS")==0)
1372  if (strcmp(mot8,"DE")==0)
1373  if (strcmp(mot9,"NOM")==0)
1374  if (strcmp(mot10,"SYMBOLIQUE")==0)
1375  if (strcmp(mot11,"CONTRAINTE_EQUI2_MOY")==0)
1376  {
1377  codeimport=0;
1378  import_contrainteequi2_gauss(base,mai,in,nomfichier,codeimport);
1379  }
1380  if (numlu>8)
1381  if (strcmp(mot1,"CHAMP")==0)
1382  if (strcmp(mot2,"PAR")==0)
1383  if (strcmp(mot3,"ELEMENT")==0)
1384  if (strcmp(mot4,"AUX")==0)
1385  if (strcmp(mot5,"POINTS")==0)
1386  if (strcmp(mot6,"DE")==0)
1387  if (strcmp(mot7,"GAUSS")==0)
1388  if (strcmp(mot8,"DE")==0)
1389  if (strcmp(mot9,"NOM")==0)
1390  if (strcmp(mot10,"SYMBOLIQUE")==0)
1391  if (strcmp(mot11,"CONTRAINTE_EQUI2_INF")==0)
1392  {
1393  codeimport=1;
1394  import_contrainteequi2_gauss(base,mai,in,nomfichier,codeimport);
1395  }
1396  if (numlu>8)
1397  if (strcmp(mot1,"CHAMP")==0)
1398  if (strcmp(mot2,"PAR")==0)
1399  if (strcmp(mot3,"ELEMENT")==0)
1400  if (strcmp(mot4,"AUX")==0)
1401  if (strcmp(mot5,"POINTS")==0)
1402  if (strcmp(mot6,"DE")==0)
1403  if (strcmp(mot7,"GAUSS")==0)
1404  if (strcmp(mot8,"DE")==0)
1405  if (strcmp(mot9,"NOM")==0)
1406  if (strcmp(mot10,"SYMBOLIQUE")==0)
1407  if (strcmp(mot11,"CONTRAINTE_EQUI2_SUP")==0)
1408  {
1409  codeimport=2; // Éléments volumiques
1410  import_contrainteequi2_gauss(base,mai,in,nomfichier,codeimport, pas_contrainte_equi2_element);
1411  }
1412  if (numlu>8)
1413  if (strcmp(mot1,"CHAMP")==0)
1414  if (strcmp(mot2,"PAR")==0)
1415  if (strcmp(mot3,"ELEMENT")==0)
1416  if (strcmp(mot4,"AUX")==0)
1417  if (strcmp(mot5,"POINTS")==0)
1418  if (strcmp(mot6,"DE")==0)
1419  if (strcmp(mot7,"GAUSS")==0)
1420  if (strcmp(mot8,"DE")==0)
1421  if (strcmp(mot9,"NOM")==0)
1422  if (strcmp(mot10,"SYMBOLIQUE")==0)
1423  if (strcmp(mot11,"CONTRAINTE_EQUI2_2D")==0)
1424  {
1425  codeimport=4; // Éléments volumiques
1426  import_contrainteequi2_gauss(base,mai,in,nomfichier,codeimport);
1427  }
1428  if (numlu>6)
1429  if (strcmp(mot1,"CHAMP")==0)
1430  if (strcmp(mot2,"AUX")==0)
1431  if (strcmp(mot3,"NOEUDS")==0)
1432  if (strcmp(mot4,"DE")==0)
1433  if (strcmp(mot5,"NOM")==0)
1434  if (strcmp(mot6,"SYMBOLIQUE")==0)
1435  if (strcmp(mot7,"FLUX")==0)
1436  {
1437  codeimport=3;
1438  import_flux_noeud(base,mai,in,nomfichier,codeimport,pas_flux);
1439  pas_flux++;
1440  }
1441  if (numlu>8)
1442  if (strcmp(mot1,"CHAMP")==0)
1443  if (strcmp(mot2,"PAR")==0)
1444  if (strcmp(mot3,"ELEMENT")==0)
1445  if (strcmp(mot4,"AUX")==0)
1446  if (strcmp(mot5,"POINTS")==0)
1447  if (strcmp(mot6,"DE")==0)
1448  if (strcmp(mot7,"GAUSS")==0)
1449  if (strcmp(mot8,"DE")==0)
1450  if (strcmp(mot9,"NOM")==0)
1451  if (strcmp(mot10,"SYMBOLIQUE")==0)
1452  if (strcmp(mot11,"FLUX")==0)
1453  {
1454  codeimport=3;
1455  import_flux_gauss(base,mai,in,nomfichier,codeimport,pas_flux);
1456  pas_flux++;
1457  }
1458 
1459 
1460  }
1461  while (fin==0);
1462  fclose(in);
1463 if (passejob==false)
1464  {
1465  char chainetmp[500];
1466  strcpy(chainetmp,nomfichier);
1467  strcat(chainetmp,".mess");
1468  FILE* in=fopen(chainetmp,"rt");
1469  int fin=0;
1470  do
1471  {
1472  char message[750];
1473  char *res=fgets(message,750,in);
1474  if (feof(in)) fin=1;
1475  char mot1[100];
1476  char mot2[100];
1477  char mot3[100];
1478  char mot4[100];
1479  char mot5[100];
1480  char mot6[100];
1481  char mot7[100];
1482  char mot8[100];
1483  char mot9[100];
1484  char mot10[100];
1485  char mot11[100];
1486  int numlu=sscanf(message,"%s %s %s %s %s %s %s %s %s %s %s",mot1,mot2,mot3,mot4,mot5,mot6,mot7,mot8,mot9,mot10,mot11);
1487 
1488  if (numlu>2)
1489  if (strcmp(mot2,"TOTAL_JOB")==0)
1490  if (passejob==false)
1491  {
1492  double val;
1493  sscanf(mot8,"%lf",&val);
1495  sscanf(mot10,"%lf",&val);
1497  passejob=true;
1498  }
1499 
1500 
1501 
1502  std::string retour="\n";
1503  if (numlu>2)
1504  if (strcmp(mot1,"MECANIQUE")==0)
1505  if (strcmp(mot2,":")==0)
1506  if (strcmp(mot3,"ESTIMATEUR")==0)
1507  {
1508  resultat=resultat+message;
1509  fgets(message,750,in);
1510  fgets(message,750,in);
1511  fgets(message,750,in);
1512  fgets(message,750,in);
1513  resultat=resultat+message;
1514  fgets(message,750,in);
1515  resultat=resultat+message;
1516  }
1517  }
1518  while (fin==0);
1519  fclose(in);
1520  }
1521 return resultat;
1522 }
1523 void MG_IMPORT::import_deplacement(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport, int pas)
1524 {
1525  char nom[500];
1526  sprintf(nom,"%s_depl_%d.sol",nomfichier,pas);
1527  char nomsol[500];
1528  sprintf(nomsol,"U%%%d",pas);
1529  FEM_SOLUTION* solution;
1531  if ((codeimport==3)||(codeimport==4)) // Éléments volumiques
1532  {
1533  if (codeimport==3) solution=gest->get_fem_solution(mai,3,nom,(char*)nomsol);
1534  if (codeimport==4) solution=gest->get_fem_solution(mai,2,nom,(char*)nomsol);
1535  if (solution==NULL)
1536  {
1537  if (codeimport==3) solution=new FEM_SOLUTION(mai,3,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
1538  if (codeimport==4) solution=new FEM_SOLUTION(mai,2,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
1539  gest->ajouter_fem_solution(solution);
1540  }
1541  }
1542  else // Éléments de coques
1543  {
1544  solution=gest->get_fem_solution(mai,6,nom,(char*)nomsol);
1545  if (solution==NULL)
1546  {
1547  solution=new FEM_SOLUTION(mai,6,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
1548  gest->ajouter_fem_solution(solution);
1549  }
1550  }
1551 
1552  solution->change_legende(0,"X");
1553  solution->change_legende(1,"Y");
1554  if (codeimport!=4) solution->change_legende(2,"Z");
1555 
1556  if ((codeimport<3) || (codeimport==5)) // Éléments de coques
1557  {
1558  solution->change_legende(3,"DRX");
1559  solution->change_legende(4,"DRY");
1560  solution->change_legende(5,"DRZ");
1561  }
1562 
1563  int fin=0;
1564  int nbelement=0;
1565  do
1566  {
1567  char message[750];
1568  char *res=fgets(message,750,in);
1569  double x,y,z;
1570  char mot[50];
1571  if ((codeimport==3) || (codeimport==4)) // Éléments volumiques
1572  {
1573  int numlu=sscanf(message,"%s %lf %lf %lf",mot,&x,&y,&z);
1574  if (numlu==4)
1575  {
1576  char *p=strchr(mot,'N')+1;
1577  int num=ot.atoi(p,base);
1578 
1579  solution->ecrire(x,num-1,0);
1580  solution->ecrire(y,num-1,1);
1581  solution->ecrire(z,num-1,2);
1582  nbelement++;
1583  }
1584  if (numlu==3)
1585  {
1586  char *p=strchr(mot,'N')+1;
1587  int num=ot.atoi(p,base);
1588 
1589  solution->ecrire(x,num-1,0);
1590  solution->ecrire(y,num-1,1);
1591  nbelement++;
1592  }
1593  }
1594  else
1595  {
1596  double rx,ry,rz;
1597  int numlu=sscanf(message,"%s %lf %lf %lf %lf %lf %lf",mot,&x,&y,&z,&rx,&ry,&rz);
1598  if (numlu==7)
1599  {
1600  char *p=strchr(mot,'N')+1;
1601  int num=ot.atoi(p,base);
1602  solution->ecrire(x,num-1,0);
1603  solution->ecrire(y,num-1,1);
1604  solution->ecrire(z,num-1,2);
1605  solution->ecrire(rx,num-1,3);
1606  solution->ecrire(ry,num-1,4);
1607  solution->ecrire(rz,num-1,5);
1608  nbelement++;
1609  }
1610  if (numlu==4)
1611  {
1612  char *p=strchr(mot,'N')+1;
1613  int num=ot.atoi(p,base);
1614  solution->ecrire(x,num-1,0);
1615  solution->ecrire(y,num-1,1);
1616  solution->ecrire(z,num-1,2);
1617  solution->ecrire(0.,num-1,3);
1618  solution->ecrire(0.,num-1,4);
1619  solution->ecrire(0.,num-1,5);
1620  nbelement++;
1621  }
1622  }
1623  if (nbelement == mai->get_nb_fem_noeud()) fin=1;
1624  }
1625  while (fin==0);
1626  mai->calcul_deforme(solution,0,solution,1,solution,2);
1627 }
1628 void MG_IMPORT::import_reaction(int base,FEM_MAILLAGE* mai,FILE* in,int PAS_FORCE_REACTION)
1629 {
1630  LISTE_FEM_NOEUD::iterator it;
1631  FEM_NOEUD* noeud=mai->get_premier_noeud(it);
1632  int fin=0;
1633  int nbelement=0;
1634  do
1635  {
1636  char message[750];
1637  char *res=fgets(message,750,in);
1638  double x,y,z;
1639  char mot[50];
1640  {
1641  int numlu=sscanf(message,"%s %lf %lf %lf",mot,&x,&y,&z);
1642  if (numlu==3) z=0;
1643 
1644  if ((numlu==4) || (numlu==3))
1645  {
1646  char *p=strchr(mot,'N')+1;
1647  int num=ot.atoi(p,base);
1648  noeud->change_rx(x);
1649  noeud->change_ry(y);
1650  noeud->change_rz(z);
1651  noeud=mai->get_suivant_noeud(it);
1652  nbelement++;
1653  }
1654  }
1655  if (nbelement == mai->get_nb_fem_noeud()) fin=1;
1656  }
1657  while (fin==0);
1658  mai->active_reaction();
1659 }
1660 
1661 void MG_IMPORT::import_energie(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport)
1662 {
1663  char nom[500];
1664  strcpy(nom,nomfichier);
1665  strcat(nom,"_ener.sol");
1666  FEM_SOLUTION* solution;
1668  if (codeimport==3) // Éléments volumiques
1669  {
1670  solution=gest->get_fem_solution(mai,1,nom,(char*)"Ed");
1671  if (solution==NULL)
1672  {
1673  solution=new FEM_SOLUTION(mai,1,nom,mai->get_nb_fem_element3(),"Ed",MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT3);
1674  gest->ajouter_fem_solution(solution);
1675  }
1676  }
1677  else if (codeimport==5) // Éléments de coques
1678  {
1679  solution=gest->get_fem_solution(mai,1,nom,(char*)"Ed");
1680  if (solution==NULL)
1681  {
1683  gest->ajouter_fem_solution(solution);
1684  }
1685  }
1686  else // Éléments de coques
1687  {
1688  solution=gest->get_fem_solution(mai,1,nom,(char*)"Ed");
1689  if (solution==NULL)
1690  {
1691  solution=new FEM_SOLUTION(mai,1,nom,mai->get_nb_fem_element2(),"Ed",MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT2);
1692  gest->ajouter_fem_solution(solution);
1693  }
1694  }
1695 
1696  gest->ajouter_fem_solution(solution);
1697  solution->change_legende(0,"Totale");
1698  if (codeimport==5)
1699  {
1700  int num=mai->get_nb_fem_element1()+mai->get_nb_fem_element2()+mai->get_nb_fem_element3();
1701  for (int i=0;i<num;i++)
1702  {
1703  solution->ecrire(0.,i,0);
1704  }
1705  }
1706  int fin=0;
1707  int passe=0;
1708  int nbelement=0;
1709  int decalage;
1710  do
1711  {
1712  char message[750];
1713  char *res=fgets(message,750,in);
1714  char mot1[500];
1715  char mot2[500];
1716  if ((message[3]=='-')||(message[3]=='*'))
1717  if ((message[4]=='-')||(message[4]=='*'))
1718  if ((message[5]=='-')||(message[5]=='*'))
1719  if ((message[6]=='-')||(message[6]=='*'))
1720  if ((message[7]=='-')||(message[7]=='*'))
1721  if ((message[8]=='-')||(message[8]=='*'))
1722  {
1723  fin=1;continue;
1724  }
1725  int numlu=sscanf(message,"%s %s",mot1,mot2);
1726  int num;
1727  if ((numlu==2) && (strcmp(mot2,"TOTALE")==0))
1728  {
1729  char *p=strchr(mot1,'M')+1;
1730  num=ot.atoi(p,base);
1731  if (passe==0) {
1732  passe=1;
1733  decalage=num;
1734  }
1735  char *res=fgets(message,750,in);
1736  double val;
1737  sscanf(message,"%lf",&val);
1738  solution->ecrire(val,num-decalage,0);
1739  nbelement++;
1740  }
1741  if (codeimport==3) // Éléments volumiques
1742  {if (nbelement == mai->get_nb_fem_element3()) fin=1; }
1743  else if (codeimport==5) // Éléments volumiques
1744  //{if (nbelement == mai->get_nb_fem_element3()+mai->get_nb_fem_element2()+mai->get_nb_fem_element1()) fin=1;}
1745  {if (num == mai->get_nb_fem_element3()+mai->get_nb_fem_element2()+mai->get_nb_fem_element1()) fin=1;}
1746  else // Éléments de coques
1747  {if (nbelement == mai->get_nb_fem_element2()) fin=1;}
1748  }
1749  while (fin==0);
1750 }
1751 
1752 void MG_IMPORT::import_densite(int base,FEM_MAILLAGE* mai,char* chaine,char *nomfichier,int codeimport)
1753 {
1754  FILE* in=fopen(chaine,"rt");
1755  char nom[500];
1756  strcpy(nom,nomfichier);
1757  strcat(nom,"_densite.sol");
1759  FEM_SOLUTION* solution;
1760  if (codeimport==3) // Éléments volumiques
1761  {
1762  solution=gest->get_fem_solution(mai,1,nom,(char*)"Densite");
1763  if (solution==NULL)
1764  {
1765  solution=new FEM_SOLUTION(mai,1,nom,mai->get_nb_fem_element3(),"Densite",MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT3);
1766  gest->ajouter_fem_solution(solution);
1767  }
1768  }
1769  if (codeimport!=3) // Éléments de coques
1770  {
1771  solution=gest->get_fem_solution(mai,1,nom,(char*)"Densite");
1772  if (solution==NULL)
1773  {
1774  solution=new FEM_SOLUTION(mai,1,nom,mai->get_nb_fem_element2(),"Densite",MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT2);
1775  gest->ajouter_fem_solution(solution);
1776  }
1777  }
1778 
1779  solution->change_legende(0,"Densite");
1780  int fin=0;
1781  int passe=0;
1782  int nbelement=0;
1783  char mess[750];
1784  char *res=fgets(mess,750,in);
1785  int decalage;
1786  do
1787  {
1788  char message[750];
1789  char *res=fgets(message,750,in);
1790  int num;
1791  double val;
1792  sscanf(message,"%d %lf",&num,&val);
1793  if (passe==0)
1794  {
1795  passe=1;
1796  decalage=num;
1797  }
1798  solution->ecrire(val,num-decalage,0);
1799  nbelement++;
1800  if (codeimport==3) // Éléments volumiques
1801  if (nbelement == mai->get_nb_fem_element3()) fin=1;
1802  if (codeimport!=3) // Éléments de coques
1803  if (nbelement == mai->get_nb_fem_element2()) fin=1;
1804  }
1805  while (fin==0);
1806 }
1807 
1808 void MG_IMPORT::import_contrainte(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport, int pas)
1809 {
1810  char nom[500];
1811  char nomsol[500];
1812  sprintf(nomsol,"S%%%d",pas);
1813 
1814  if (codeimport==0)
1815  {
1816  //strcat(nom,"_cont_moy.sol");
1817  sprintf(nom,"%scont_moy_%d.sol",nomfichier,pas);
1818  }
1819  if (codeimport==1)
1820  {
1821  sprintf(nom,"%s_cont_inf_%d.sol",nomfichier,pas);
1822  }
1823  if (codeimport==2)
1824  {
1825  sprintf(nom,"%s_cont_sup_%d.sol",nomfichier,pas);
1826  }
1827  if ((codeimport==3) || (codeimport==4))
1828  {
1829  sprintf(nom,"%s_cont_%d.sol",nomfichier,pas);
1830  }
1831 
1833  FEM_SOLUTION* solution;
1834  if (codeimport==4) solution=gest->get_fem_solution(mai,4,nom,(char*)nomsol);
1835  else solution=gest->get_fem_solution(mai,6,nom,(char*)nomsol);
1836  if (solution==NULL)
1837  {
1838  if (codeimport==4) solution=new FEM_SOLUTION(mai,4,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
1839  else solution=new FEM_SOLUTION(mai,6,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
1840  gest->ajouter_fem_solution(solution);
1841  }
1842  if (codeimport==1)
1843  {
1844  solution->change_legende(0,"XX_INF");
1845  solution->change_legende(1,"YY_INF");
1846  solution->change_legende(2,"ZZ_INF");
1847  solution->change_legende(3,"XY_INF");
1848  solution->change_legende(4,"XZ_INF");
1849  solution->change_legende(5,"YZ_INF");
1850  }
1851  if (codeimport==0)
1852  {
1853  solution->change_legende(0,"XX_MOY");
1854  solution->change_legende(1,"YY_MOY");
1855  solution->change_legende(2,"ZZ_MOY");
1856  solution->change_legende(3,"XY_MOY");
1857  solution->change_legende(4,"XZ_MOY");
1858  solution->change_legende(5,"YZ_MOY");
1859  }
1860  if (codeimport==2)
1861  {
1862  solution->change_legende(0,"XX_SUP");
1863  solution->change_legende(1,"YY_SUP");
1864  solution->change_legende(2,"ZZ_SUP");
1865  solution->change_legende(3,"XY_SUP");
1866  solution->change_legende(4,"XZ_SUP");
1867  solution->change_legende(5,"YZ_SUP");
1868  }
1869  if (codeimport==3)
1870  {
1871  solution->change_legende(0,"XX");
1872  solution->change_legende(1,"YY");
1873  solution->change_legende(2,"ZZ");
1874  solution->change_legende(3,"XY");
1875  solution->change_legende(4,"XZ");
1876  solution->change_legende(5,"YZ");
1877  }
1878  if (codeimport==4)
1879  {
1880  solution->change_legende(0,"XX");
1881  solution->change_legende(1,"YY");
1882  solution->change_legende(2,"ZZ");
1883  solution->change_legende(3,"XY");
1884  }
1885  int *tab=new int[mai->get_nb_fem_noeud()];
1886  int nbchamp=6;
1887  if (codeimport==4) nbchamp=4;
1888  for (int j=0;j<mai->get_nb_fem_noeud();j++)
1889  {
1890  for (int i=0;i<nbchamp;i++)
1891  solution->ecrire(0.,j,i);
1892  tab[j]=0;
1893  }
1894  int fin=0;
1895  int nbelement=0;
1896  LISTE_FEM_ELEMENT2::iterator it;
1897  FEM_ELEMENT2* tri;
1898  do
1899  {
1900  char message[750];
1901  char *res=fgets(message,750,in);
1902  double tenseur[6];
1903  char mot[50];
1904  int numlu=sscanf(message,"%s %lf %lf %lf %lf %lf %lf",mot,tenseur,tenseur+1,tenseur+2,tenseur+3,tenseur+4,tenseur+5);
1905  if (numlu==1)
1906  {
1907  char *p=strchr(mot,'M');
1908  if (p!=NULL)
1909  {
1910  p++;
1911  int num=ot.atoi(p,base);
1912  nbelement++;
1913  if (nbelement==1) tri=mai->get_premier_element2(it);
1914  else tri=mai->get_suivant_element2(it);
1915  }
1916  }
1917  if (numlu==7)
1918  {
1919  char *p=strchr(mot,'N')+1;
1920  int num=ot.atoi(p,base);
1921  double *tenseurres;
1922  double tenseurglo[6];
1923  if (codeimport==3) tenseurres=tenseur; // Éléments volumiques
1924  else // Éléments de coques
1925  {
1926  change_repere_tenseur(tri,tenseurglo,tenseur);
1927  tenseurres=tenseurglo;
1928  }
1929  solution->ecrire(solution->lire(num-1,0)+tenseurres[0],num-1,0);
1930  solution->ecrire(solution->lire(num-1,1)+tenseurres[1],num-1,1);
1931  solution->ecrire(solution->lire(num-1,2)+tenseurres[2],num-1,2);
1932  solution->ecrire(solution->lire(num-1,3)+tenseurres[3],num-1,3);
1933  solution->ecrire(solution->lire(num-1,4)+tenseurres[4],num-1,4);
1934  solution->ecrire(solution->lire(num-1,5)+tenseurres[5],num-1,5);
1935  tab[num-1]++;
1936  }
1937  if (numlu==5)
1938  {
1939  char *p=strchr(mot,'N')+1;
1940  int num=ot.atoi(p,base);
1941  double *tenseurres=tenseur;
1942  solution->ecrire(solution->lire(num-1,0)+tenseurres[0],num-1,0);
1943  solution->ecrire(solution->lire(num-1,1)+tenseurres[1],num-1,1);
1944  solution->ecrire(solution->lire(num-1,2)+tenseurres[2],num-1,2);
1945  solution->ecrire(solution->lire(num-1,3)+tenseurres[3],num-1,3);
1946  tab[num-1]++;
1947  }
1948 
1949  if (codeimport==3) // Éléments volumiques
1950  if (nbelement == mai->get_nb_fem_element3()) fin=1;
1951  if (codeimport!=3) // Éléments de coques
1952  if (nbelement == mai->get_nb_fem_element2()) fin=1;
1953  }
1954  while (fin==0);
1955  for (int j=0;j<mai->get_nb_fem_noeud();j++)
1956  for (int i=0;i<nbchamp;i++)
1957  solution->ecrire(solution->lire(j,i)/tab[j],j,i);
1958  delete [] tab;
1959 }
1960 
1961 
1962 void MG_IMPORT::import_contrainte_gauss(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport, int pas)
1963 {
1964  char nom[500];
1965  char nomsol[500];
1966  sprintf(nomsol,"GS%%%d",pas);
1967 
1968  if (codeimport==0)
1969  {
1970  //strcat(nom,"_cont_moy.sol");
1971  sprintf(nom,"%scont_moy_gauss_%d.sol",nomfichier,pas);
1972  }
1973  if (codeimport==1)
1974  {
1975  sprintf(nom,"%s_cont_inf_gauss_%d.sol",nomfichier,pas);
1976  }
1977  if (codeimport==2)
1978  {
1979  sprintf(nom,"%s_cont_sup_gauss_%d.sol",nomfichier,pas);
1980  }
1981  if ((codeimport==3) || (codeimport==4))
1982  {
1983  sprintf(nom,"%s_cont_gauss_%d.sol",nomfichier,pas);
1984  }
1985 
1987  FEM_SOLUTION* solution;
1988  if (codeimport==4) solution=gest->get_fem_solution(mai,4,nom,(char*)nomsol);
1989  else solution=gest->get_fem_solution(mai,6,nom,(char*)nomsol);
1990  if (solution==NULL)
1991  {
1992  if (codeimport!=3) solution=new FEM_SOLUTION(mai,4,nom,mai->get_nb_fem_element2(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT2_GAUSS);
1993  else solution=new FEM_SOLUTION(mai,6,nom,mai->get_nb_fem_element3(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT3_GAUSS);
1994  gest->ajouter_fem_solution(solution);
1995  }
1996  if (codeimport==1)
1997  {
1998  solution->change_legende(0,"XX_INF");
1999  solution->change_legende(1,"YY_INF");
2000  solution->change_legende(2,"ZZ_INF");
2001  solution->change_legende(3,"XY_INF");
2002  solution->change_legende(4,"XZ_INF");
2003  solution->change_legende(5,"YZ_INF");
2004  }
2005  if (codeimport==0)
2006  {
2007  solution->change_legende(0,"XX_MOY");
2008  solution->change_legende(1,"YY_MOY");
2009  solution->change_legende(2,"ZZ_MOY");
2010  solution->change_legende(3,"XY_MOY");
2011  solution->change_legende(4,"XZ_MOY");
2012  solution->change_legende(5,"YZ_MOY");
2013  }
2014  if (codeimport==2)
2015  {
2016  solution->change_legende(0,"XX_SUP");
2017  solution->change_legende(1,"YY_SUP");
2018  solution->change_legende(2,"ZZ_SUP");
2019  solution->change_legende(3,"XY_SUP");
2020  solution->change_legende(4,"XZ_SUP");
2021  solution->change_legende(5,"YZ_SUP");
2022  }
2023  if (codeimport==3)
2024  {
2025  solution->change_legende(0,"XX");
2026  solution->change_legende(1,"YY");
2027  solution->change_legende(2,"ZZ");
2028  solution->change_legende(3,"XY");
2029  solution->change_legende(4,"XZ");
2030  solution->change_legende(5,"YZ");
2031  }
2032  if (codeimport==4)
2033  {
2034  solution->change_legende(0,"XX");
2035  solution->change_legende(1,"YY");
2036  solution->change_legende(2,"ZZ");
2037  solution->change_legende(3,"XY");
2038  }
2039  int nbchamp=6;
2040  if (codeimport==4) nbchamp=4;
2041 
2042 
2043  int fin=0;
2044  int nbelement=0;
2045  LISTE_FEM_ELEMENT2::iterator it;
2046  FEM_ELEMENT2* tri;
2047  std::vector<std::string> tabligne;
2048  int decalage;
2049  do
2050  {
2051  char message[750];
2052  char *res=fgets(message,750,in);
2053  double tenseur[6];
2054  char mot[50];
2055  int numlu=sscanf(message,"%s %lf %lf %lf %lf %lf %lf",mot,tenseur,tenseur+1,tenseur+2,tenseur+3,tenseur+4,tenseur+5);
2056  if (numlu==1)
2057  {
2058  char *p=strchr(mot,'M');
2059  if (p!=NULL)
2060  {
2061  p++;
2062  int num=ot.atoi(p,base);
2063  nbelement++;
2064  if (nbelement==1) tri=mai->get_premier_element2(it);
2065  else tri=mai->get_suivant_element2(it);
2066  if (nbelement==1) {tabligne.clear();decalage=num;}
2067  else
2068  {
2069 
2070  int nbgauss=tabligne.size();
2071  solution->change_nb_gauss(num-decalage-1,nbgauss);
2072  for (int i=0;i<nbgauss;i++)
2073  {
2074  char ligne[2000];
2075  strcpy(ligne,tabligne[i].c_str());
2076  int numgauss;
2077  int numlu=sscanf(ligne,"%d %lf %lf %lf %lf %lf %lf",&numgauss,tenseur,tenseur+1,tenseur+2,tenseur+3,tenseur+4,tenseur+5);
2078  if (numlu==7)
2079  {
2080  double *tenseurres;
2081  double tenseurglo[6];
2082  if (codeimport==3) tenseurres=tenseur; // Éléments volumiques
2083  else // Éléments de coques
2084  {
2085  change_repere_tenseur(tri,tenseurglo,tenseur);
2086  tenseurres=tenseurglo;
2087  }
2088  solution->ecrire(tenseurres[0],num-decalage-1,0,0,numgauss-1);
2089  solution->ecrire(tenseurres[1],num-decalage-1,1,0,numgauss-1);
2090  solution->ecrire(tenseurres[2],num-decalage-1,2,0,numgauss-1);
2091  solution->ecrire(tenseurres[3],num-decalage-1,3,0,numgauss-1);
2092  solution->ecrire(tenseurres[4],num-decalage-1,4,0,numgauss-1);
2093  solution->ecrire(tenseurres[5],num-decalage-1,5,0,numgauss-1);
2094  }
2095  if (numlu==5)
2096  {
2097  solution->ecrire(tenseur[0],num-decalage-1,0,0,numgauss-1);
2098  solution->ecrire(tenseur[1],num-decalage-1,1,0,numgauss-1);
2099  solution->ecrire(tenseur[2],num-decalage-1,2,0,numgauss-1);
2100  solution->ecrire(tenseur[3],num-decalage-1,3,0,numgauss-1);
2101  }
2102 
2103  }
2104  tabligne.clear();
2105  }
2106  }
2107  }
2108  else if (numlu>1) tabligne.push_back(message);
2109 
2110 
2111 
2112 
2113 
2114 
2115  if (codeimport==3)
2116  if (nbelement == mai->get_nb_fem_element3()) fin=-1;
2117  if (codeimport!=3) // Éléments de coques
2118  if (nbelement == mai->get_nb_fem_element2()) fin=-1;
2119  if ((fin==-1) && (numlu<1)) fin=1;
2120  }
2121  while (fin<1);
2122 int nbgauss=tabligne.size();
2123 solution->change_nb_gauss(nbelement-1,nbgauss);
2124 for (int i=0;i<nbgauss;i++)
2125  {
2126  char ligne[2000];
2127  strcpy(ligne,tabligne[i].c_str());
2128  int numgauss;
2129  double tenseur[6];
2130  int numlu=sscanf(ligne,"%d %lf %lf %lf %lf %lf %lf",&numgauss,tenseur,tenseur+1,tenseur+2,tenseur+3,tenseur+4,tenseur+5);
2131  if (numlu==7)
2132  {
2133  double *tenseurres;
2134  double tenseurglo[6];
2135  if (codeimport==3) tenseurres=tenseur; // Éléments volumiques
2136  else // Éléments de coques
2137  {
2138  change_repere_tenseur(tri,tenseurglo,tenseur);
2139  tenseurres=tenseurglo;
2140  }
2141  solution->ecrire(tenseurres[0],nbelement-1,0,0,numgauss-1);
2142  solution->ecrire(tenseurres[1],nbelement-1,1,0,numgauss-1);
2143  solution->ecrire(tenseurres[2],nbelement-1,2,0,numgauss-1);
2144  solution->ecrire(tenseurres[3],nbelement-1,3,0,numgauss-1);
2145  solution->ecrire(tenseurres[4],nbelement-1,4,0,numgauss-1);
2146  solution->ecrire(tenseurres[5],nbelement-1,5,0,numgauss-1);
2147  }
2148  if (numlu==5)
2149  {
2150  solution->ecrire(tenseur[0],nbelement-1,0,0,numgauss-1);
2151  solution->ecrire(tenseur[1],nbelement-1,1,0,numgauss-1);
2152  solution->ecrire(tenseur[2],nbelement-1,2,0,numgauss-1);
2153  solution->ecrire(tenseur[3],nbelement-1,3,0,numgauss-1);
2154  }
2155  }
2156 
2157 
2158 
2159 
2160 
2161 }
2162 
2163 void MG_IMPORT::import_deformation_gauss(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport, int pas)
2164 {
2165  char nom[500];
2166  char nomsol[500];
2167  sprintf(nomsol,"GE%%%d",pas);
2168 
2169  if (codeimport==0)
2170  {
2171  //strcat(nom,"_cont_moy.sol");
2172  sprintf(nom,"%sdef_moy_gauss_%d.sol",nomfichier,pas);
2173  }
2174  if (codeimport==1)
2175  {
2176  sprintf(nom,"%s_def_inf_gauss_%d.sol",nomfichier,pas);
2177  }
2178  if (codeimport==2)
2179  {
2180  sprintf(nom,"%s_def_sup_gauss_%d.sol",nomfichier,pas);
2181  }
2182  if ((codeimport==3) || (codeimport==4))
2183  {
2184  sprintf(nom,"%s_def_gauss_%d.sol",nomfichier,pas);
2185  }
2186 
2188  FEM_SOLUTION* solution;
2189  if (codeimport==4) solution=gest->get_fem_solution(mai,4,nom,(char*)nomsol);
2190  else solution=gest->get_fem_solution(mai,6,nom,(char*)nomsol);
2191  if (solution==NULL)
2192  {
2193  if (codeimport!=3) solution=new FEM_SOLUTION(mai,4,nom,mai->get_nb_fem_element2(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT2_GAUSS);
2194  else solution=new FEM_SOLUTION(mai,6,nom,mai->get_nb_fem_element3(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT3_GAUSS);
2195  gest->ajouter_fem_solution(solution);
2196  }
2197  if (codeimport==1)
2198  {
2199  solution->change_legende(0,"XX_INF");
2200  solution->change_legende(1,"YY_INF");
2201  solution->change_legende(2,"ZZ_INF");
2202  solution->change_legende(3,"XY_INF");
2203  solution->change_legende(4,"XZ_INF");
2204  solution->change_legende(5,"YZ_INF");
2205  }
2206  if (codeimport==0)
2207  {
2208  solution->change_legende(0,"XX_MOY");
2209  solution->change_legende(1,"YY_MOY");
2210  solution->change_legende(2,"ZZ_MOY");
2211  solution->change_legende(3,"XY_MOY");
2212  solution->change_legende(4,"XZ_MOY");
2213  solution->change_legende(5,"YZ_MOY");
2214  }
2215  if (codeimport==2)
2216  {
2217  solution->change_legende(0,"XX_SUP");
2218  solution->change_legende(1,"YY_SUP");
2219  solution->change_legende(2,"ZZ_SUP");
2220  solution->change_legende(3,"XY_SUP");
2221  solution->change_legende(4,"XZ_SUP");
2222  solution->change_legende(5,"YZ_SUP");
2223  }
2224  if (codeimport==3)
2225  {
2226  solution->change_legende(0,"XX");
2227  solution->change_legende(1,"YY");
2228  solution->change_legende(2,"ZZ");
2229  solution->change_legende(3,"XY");
2230  solution->change_legende(4,"XZ");
2231  solution->change_legende(5,"YZ");
2232  }
2233  if (codeimport==4)
2234  {
2235  solution->change_legende(0,"XX");
2236  solution->change_legende(1,"YY");
2237  solution->change_legende(2,"ZZ");
2238  solution->change_legende(3,"XY");
2239  }
2240  int nbchamp=6;
2241  if (codeimport==4) nbchamp=4;
2242 
2243 
2244  int fin=0;
2245  int nbelement=0;
2246  LISTE_FEM_ELEMENT2::iterator it;
2247  FEM_ELEMENT2* tri;
2248  std::vector<std::string> tabligne;
2249  int decalage;
2250  do
2251  {
2252  char message[750];
2253  char *res=fgets(message,750,in);
2254  double tenseur[6];
2255  char mot[50];
2256  int numlu=sscanf(message,"%s %lf %lf %lf %lf %lf %lf",mot,tenseur,tenseur+1,tenseur+2,tenseur+3,tenseur+4,tenseur+5);
2257  if (numlu==1)
2258  {
2259  char *p=strchr(mot,'M');
2260  if (p!=NULL)
2261  {
2262  p++;
2263  int num=ot.atoi(p,base);
2264  nbelement++;
2265  if (nbelement==1) tri=mai->get_premier_element2(it);
2266  else tri=mai->get_suivant_element2(it);
2267  if (nbelement==1) {tabligne.clear();decalage=num;}
2268  else
2269  {
2270 
2271  int nbgauss=tabligne.size();
2272  solution->change_nb_gauss(num-decalage-1,nbgauss);
2273  for (int i=0;i<nbgauss;i++)
2274  {
2275  char ligne[2000];
2276  strcpy(ligne,tabligne[i].c_str());
2277  int numgauss;
2278  int numlu=sscanf(ligne,"%d %lf %lf %lf %lf %lf %lf",&numgauss,tenseur,tenseur+1,tenseur+2,tenseur+3,tenseur+4,tenseur+5);
2279  if (numlu==7)
2280  {
2281  double *tenseurres;
2282  double tenseurglo[6];
2283  if (codeimport==3) tenseurres=tenseur; // Éléments volumiques
2284  else // Éléments de coques
2285  {
2286  change_repere_tenseur(tri,tenseurglo,tenseur);
2287  tenseurres=tenseurglo;
2288  }
2289  solution->ecrire(tenseurres[0],num-decalage-1,0,0,numgauss-1);
2290  solution->ecrire(tenseurres[1],num-decalage-1,1,0,numgauss-1);
2291  solution->ecrire(tenseurres[2],num-decalage-1,2,0,numgauss-1);
2292  solution->ecrire(tenseurres[3],num-decalage-1,3,0,numgauss-1);
2293  solution->ecrire(tenseurres[4],num-decalage-1,4,0,numgauss-1);
2294  solution->ecrire(tenseurres[5],num-decalage-1,5,0,numgauss-1);
2295  }
2296  if (numlu==5)
2297  {
2298  solution->ecrire(tenseur[0],num-decalage-1,0,0,numgauss-1);
2299  solution->ecrire(tenseur[1],num-decalage-1,1,0,numgauss-1);
2300  solution->ecrire(tenseur[2],num-decalage-1,2,0,numgauss-1);
2301  solution->ecrire(tenseur[3],num-decalage-1,3,0,numgauss-1);
2302  }
2303 
2304  }
2305  tabligne.clear();
2306  }
2307  }
2308  }
2309  else if (numlu>1) tabligne.push_back(message);
2310 
2311 
2312 
2313 
2314 
2315 
2316  if (codeimport==3)
2317  if (nbelement == mai->get_nb_fem_element3()) fin=-1;
2318  if (codeimport!=3) // Éléments de coques
2319  if (nbelement == mai->get_nb_fem_element2()) fin=-1;
2320  if ((fin==-1) && (numlu<1)) fin=1;
2321  }
2322  while (fin<1);
2323 int nbgauss=tabligne.size();
2324 solution->change_nb_gauss(nbelement-1,nbgauss);
2325 for (int i=0;i<nbgauss;i++)
2326  {
2327  char ligne[2000];
2328  strcpy(ligne,tabligne[i].c_str());
2329  int numgauss;
2330  double tenseur[6];
2331  int numlu=sscanf(ligne,"%d %lf %lf %lf %lf %lf %lf",&numgauss,tenseur,tenseur+1,tenseur+2,tenseur+3,tenseur+4,tenseur+5);
2332  if (numlu==7)
2333  {
2334  double *tenseurres;
2335  double tenseurglo[6];
2336  if (codeimport==3) tenseurres=tenseur; // Éléments volumiques
2337  else // Éléments de coques
2338  {
2339  change_repere_tenseur(tri,tenseurglo,tenseur);
2340  tenseurres=tenseurglo;
2341  }
2342  solution->ecrire(tenseurres[0],nbelement-1,0,0,numgauss-1);
2343  solution->ecrire(tenseurres[1],nbelement-1,1,0,numgauss-1);
2344  solution->ecrire(tenseurres[2],nbelement-1,2,0,numgauss-1);
2345  solution->ecrire(tenseurres[3],nbelement-1,3,0,numgauss-1);
2346  solution->ecrire(tenseurres[4],nbelement-1,4,0,numgauss-1);
2347  solution->ecrire(tenseurres[5],nbelement-1,5,0,numgauss-1);
2348  }
2349  if (numlu==5)
2350  {
2351  solution->ecrire(tenseur[0],nbelement-1,0,0,numgauss-1);
2352  solution->ecrire(tenseur[1],nbelement-1,1,0,numgauss-1);
2353  solution->ecrire(tenseur[2],nbelement-1,2,0,numgauss-1);
2354  solution->ecrire(tenseur[3],nbelement-1,3,0,numgauss-1);
2355  }
2356  }
2357 
2358 
2359 
2360 
2361 
2362 }
2363 
2364 
2365 void MG_IMPORT::import_contrainte_noeud(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport,int pas)
2366 {
2367  char nom[500];
2368  char nomsol[500];
2369  sprintf(nomsol,"S%%%d",pas);
2370 
2371  if (codeimport==0)
2372  {
2373  sprintf(nom,"%scont_moy_%d.sol",nomfichier,pas);
2374  }
2375  if (codeimport==1)
2376  {
2377  sprintf(nom,"%s_cont_inf_%d.sol",nomfichier,pas);
2378  }
2379  if (codeimport==2)
2380  {
2381  sprintf(nom,"%s_cont_sup_%d.sol",nomfichier,pas);
2382  }
2383  if ((codeimport==3) || (codeimport==4) || (codeimport==5))
2384  {
2385  sprintf(nom,"%s_cont_%d.sol",nomfichier,pas);
2386  }
2387 
2389  FEM_SOLUTION* solution;
2390  if (codeimport==4) solution=gest->get_fem_solution(mai,4,nom,(char*)nomsol);
2391  else solution=gest->get_fem_solution(mai,6,nom,(char*)nomsol);
2392  if (solution==NULL)
2393  {
2394  if (codeimport==4) solution=new FEM_SOLUTION(mai,4,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
2395  else solution=new FEM_SOLUTION(mai,6,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
2396  gest->ajouter_fem_solution(solution);
2397  }
2398  if (codeimport==1)
2399  {
2400  solution->change_legende(0,"XX_INF");
2401  solution->change_legende(1,"YY_INF");
2402  solution->change_legende(2,"ZZ_INF");
2403  solution->change_legende(3,"XY_INF");
2404  solution->change_legende(4,"XZ_INF");
2405  solution->change_legende(5,"YZ_INF");
2406  }
2407  if (codeimport==0)
2408  {
2409  solution->change_legende(0,"XX_MOY");
2410  solution->change_legende(1,"YY_MOY");
2411  solution->change_legende(2,"ZZ_MOY");
2412  solution->change_legende(3,"XY_MOY");
2413  solution->change_legende(4,"XZ_MOY");
2414  solution->change_legende(5,"YZ_MOY");
2415  }
2416  if (codeimport==2)
2417  {
2418  solution->change_legende(0,"XX_SUP");
2419  solution->change_legende(1,"YY_SUP");
2420  solution->change_legende(2,"ZZ_SUP");
2421  solution->change_legende(3,"XY_SUP");
2422  solution->change_legende(4,"XZ_SUP");
2423  solution->change_legende(5,"YZ_SUP");
2424  }
2425  if ((codeimport==3)||(codeimport==5))
2426  {
2427  solution->change_legende(0,"XX");
2428  solution->change_legende(1,"YY");
2429  solution->change_legende(2,"ZZ");
2430  solution->change_legende(3,"XY");
2431  solution->change_legende(4,"XZ");
2432  solution->change_legende(5,"YZ");
2433  }
2434  if (codeimport==4)
2435  {
2436  solution->change_legende(0,"XX");
2437  solution->change_legende(1,"YY");
2438  solution->change_legende(2,"ZZ");
2439  solution->change_legende(3,"XY");
2440  }
2441  if (codeimport==5)
2442  {
2443  int num=mai->get_nb_fem_noeud();
2444  for (int i=0;i<num;i++)
2445  {
2446  solution->ecrire(0.,i,0);
2447  solution->ecrire(0.,i,1);
2448  solution->ecrire(0.,i,2);
2449  solution->ecrire(0.,i,3);
2450  solution->ecrire(0.,i,4);
2451  solution->ecrire(0.,i,5);
2452  }
2453  }
2454  int fin=0;
2455  int nbelement=0;
2456  do
2457  {
2458  char message[750];
2459  char *res=fgets(message,750,in);
2460  double sxx,syy,szz,sxy,sxz,syz;
2461  char mot[50];
2462  if ((message[3]=='-')||(message[3]=='*'))
2463  if ((message[4]=='-')||(message[4]=='*'))
2464  if ((message[5]=='-')||(message[5]=='*'))
2465  if ((message[6]=='-')||(message[6]=='*'))
2466  if ((message[7]=='-')||(message[7]=='*'))
2467  if ((message[8]=='-')||(message[8]=='*'))
2468  {
2469  fin=1;continue;
2470  }
2471  int numlu=sscanf(message,"%s %lf %lf %lf %lf %lf %lf",mot,&sxx,&syy,&szz,&sxy,&sxz,&syz);
2472 
2473  if (numlu==7)
2474  {
2475  char *p=strchr(mot,'N')+1;
2476  int num=ot.atoi(p,base);
2477  solution->ecrire(sxx,num-1,0);
2478  solution->ecrire(syy,num-1,1);
2479  solution->ecrire(szz,num-1,2);
2480  solution->ecrire(sxy,num-1,3);
2481  solution->ecrire(sxz,num-1,4);
2482  solution->ecrire(syz,num-1,5);
2483  nbelement++;
2484  }
2485  if (numlu==5)
2486  {
2487  char *p=strchr(mot,'N')+1;
2488  int num=ot.atoi(p,base);
2489  solution->ecrire(sxx,num-1,0);
2490  solution->ecrire(syy,num-1,1);
2491  solution->ecrire(szz,num-1,2);
2492  solution->ecrire(sxy,num-1,3);
2493  nbelement++;
2494  }
2495 
2496  if (nbelement == mai->get_nb_fem_noeud()) fin=1;
2497  }
2498  while (fin==0);
2499 }
2500 void MG_IMPORT::import_deformation(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport,int pas)
2501 {
2502  char nom[500];
2503  char nomsol[500];
2504  sprintf(nomsol,"E%%%d",pas);
2505 
2506  if (codeimport==0)
2507  {
2508  sprintf(nom,"%s_def_moy_%d.sol",nomfichier,pas);
2509  }
2510  if (codeimport==1)
2511  {
2512  sprintf(nom,"%s_def_inf_%d.sol",nomfichier,pas);
2513  }
2514  if (codeimport==2)
2515  {
2516  sprintf(nom,"%s_def_sup_%d.sol",nomfichier,pas);
2517  }
2518  if ((codeimport==3)||(codeimport==4))
2519  {
2520  sprintf(nom,"%s_def_%d.sol",nomfichier,pas);
2521  }
2522 
2523  FEM_SOLUTION* solution;
2525  int nbchamps=6;
2526  if (codeimport==4) nbchamps=4;
2527  solution=gest->get_fem_solution(mai,nbchamps,nom,(char*)nomsol);
2528  if (solution==NULL)
2529  {
2530  solution=new FEM_SOLUTION(mai,nbchamps,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
2531  gest->ajouter_fem_solution(solution);
2532  }
2533  if (codeimport==1)
2534  {
2535  solution->change_legende(0,"XX_INF");
2536  solution->change_legende(1,"YY_INF");
2537  solution->change_legende(2,"ZZ_INF");
2538  solution->change_legende(3,"XY_INF");
2539  solution->change_legende(4,"XZ_INF");
2540  solution->change_legende(5,"YZ_INF");
2541  }
2542  if (codeimport==0)
2543  {
2544  solution->change_legende(0,"XX_MOY");
2545  solution->change_legende(1,"YY_MOY");
2546  solution->change_legende(2,"ZZ_MOY");
2547  solution->change_legende(3,"XY_MOY");
2548  solution->change_legende(4,"XZ_MOY");
2549  solution->change_legende(5,"YZ_MOY");
2550  }
2551  if (codeimport==2)
2552  {
2553  solution->change_legende(0,"XX_SUP");
2554  solution->change_legende(1,"YY_SUP");
2555  solution->change_legende(2,"ZZ_SUP");
2556  solution->change_legende(3,"XY_SUP");
2557  solution->change_legende(4,"XZ_SUP");
2558  solution->change_legende(5,"YZ_SUP");
2559  }
2560  if (codeimport==3)
2561  {
2562  solution->change_legende(0,"XX");
2563  solution->change_legende(1,"YY");
2564  solution->change_legende(2,"ZZ");
2565  solution->change_legende(3,"XY");
2566  solution->change_legende(4,"XZ");
2567  solution->change_legende(5,"YZ");
2568  }
2569  if (codeimport==4)
2570  {
2571  solution->change_legende(0,"XX");
2572  solution->change_legende(1,"YY");
2573  solution->change_legende(2,"ZZ");
2574  solution->change_legende(3,"XY");
2575  }
2576 
2577  int *tab=new int[mai->get_nb_fem_noeud()];
2578  for (int j=0;j<mai->get_nb_fem_noeud();j++)
2579  {
2580  for (int i=0;i<nbchamps;i++)
2581  solution->ecrire(0.,j,i);
2582  tab[j]=0;
2583  }
2584 
2585  int fin=0;
2586  int nbelement=0;
2587  LISTE_FEM_ELEMENT2::iterator it;
2588  FEM_ELEMENT2* tri;
2589  do
2590  {
2591  char message[750];
2592  char *res=fgets(message,750,in);
2593  double tenseur[6];
2594  char mot[50];
2595  int numlu=sscanf(message,"%s %lf %lf %lf %lf %lf %lf",mot,tenseur,tenseur+1,tenseur+2,tenseur+3,tenseur+4,tenseur+5);
2596  if (numlu==1)
2597  {
2598  char *p=strchr(mot,'M');
2599  if (p!=NULL)
2600  {
2601  p++;
2602  int num=ot.atoi(p,base);
2603  nbelement++;
2604  if (nbelement==1) tri=mai->get_premier_element2(it);
2605  else tri=mai->get_suivant_element2(it);
2606  }
2607  }
2608 
2609  if (numlu==7)
2610  {
2611  char *p=strchr(mot,'N')+1;
2612  int num=ot.atoi(p,base);
2613  double *tenseurres;
2614  double tenseurglo[6];
2615  if (codeimport==3) tenseurres=tenseur; // Éléments volumiques
2616  else // Éléments de coques
2617  {
2618  change_repere_tenseur(tri,tenseurglo,tenseur);
2619  tenseurres=tenseurglo;
2620  }
2621  solution->ecrire(solution->lire(num-1,0)+tenseurres[0],num-1,0);
2622  solution->ecrire(solution->lire(num-1,1)+tenseurres[1],num-1,1);
2623  solution->ecrire(solution->lire(num-1,2)+tenseurres[2],num-1,2);
2624  solution->ecrire(solution->lire(num-1,3)+tenseurres[3],num-1,3);
2625  solution->ecrire(solution->lire(num-1,4)+tenseurres[4],num-1,4);
2626  solution->ecrire(solution->lire(num-1,5)+tenseurres[5],num-1,5);
2627  tab[num-1]++;
2628  }
2629  if (numlu==5)
2630  {
2631  char *p=strchr(mot,'N')+1;
2632  int num=ot.atoi(p,base);
2633  double *tenseurres;
2634  double tenseurglo[6];
2635  tenseurres=tenseur; // Éléments volumiques
2636  solution->ecrire(solution->lire(num-1,0)+tenseurres[0],num-1,0);
2637  solution->ecrire(solution->lire(num-1,1)+tenseurres[1],num-1,1);
2638  solution->ecrire(solution->lire(num-1,2)+tenseurres[2],num-1,2);
2639  solution->ecrire(solution->lire(num-1,3)+tenseurres[3],num-1,3);
2640  tab[num-1]++;
2641  }
2642 
2643  if (codeimport==3) // Éléments volumiques
2644  if (nbelement == mai->get_nb_fem_element3()) fin=1;
2645  if (codeimport!=3) // Éléments de coques
2646  if (nbelement == mai->get_nb_fem_element2()) fin=1;
2647  }
2648  while (fin==0);
2649  for (int j=0;j<mai->get_nb_fem_noeud();j++)
2650  for (int i=0;i<nbchamps;i++)
2651  solution->ecrire(solution->lire(j,i)/tab[j],j,i);
2652  delete [] tab;
2653 }
2654 void MG_IMPORT::import_deformation_noeud(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport,int pas)
2655 {
2656  char nom[500];
2657  char nomsol[500];
2658  sprintf(nomsol,"E%%%d",pas);
2659 
2660  if (codeimport==0)
2661  {
2662  sprintf(nom,"%s_def_moy_%d.sol",nomfichier,pas);
2663  }
2664  if (codeimport==1)
2665  {
2666  sprintf(nom,"%s_def_inf_%d.sol",nomfichier,pas);
2667  }
2668  if (codeimport==2)
2669  {
2670  sprintf(nom,"%s_def_sup_%d.sol",nomfichier,pas);
2671  }
2672  if ((codeimport==3) || (codeimport==4)|| (codeimport==5))
2673  {
2674  sprintf(nom,"%s_def_%d.sol",nomfichier,pas);
2675  }
2676 
2677  FEM_SOLUTION* solution;
2679  if (codeimport==4) solution=gest->get_fem_solution(mai,4,nom,(char*)nomsol);
2680  else solution=gest->get_fem_solution(mai,6,nom,(char*)nomsol);
2681  if (solution==NULL)
2682  {
2683  if (codeimport==4) solution=new FEM_SOLUTION(mai,4,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
2684  else solution=new FEM_SOLUTION(mai,6,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
2685  gest->ajouter_fem_solution(solution);
2686  }
2687 
2688 
2689  if (codeimport==1)
2690  {
2691  solution->change_legende(0,"XX_INF");
2692  solution->change_legende(1,"YY_INF");
2693  solution->change_legende(2,"ZZ_INF");
2694  solution->change_legende(3,"XY_INF");
2695  solution->change_legende(4,"XZ_INF");
2696  solution->change_legende(5,"YZ_INF");
2697  }
2698  if (codeimport==0)
2699  {
2700  solution->change_legende(0,"XX_MOY");
2701  solution->change_legende(1,"YY_MOY");
2702  solution->change_legende(2,"ZZ_MOY");
2703  solution->change_legende(3,"XY_MOY");
2704  solution->change_legende(4,"XZ_MOY");
2705  solution->change_legende(5,"YZ_MOY");
2706  }
2707  if (codeimport==2)
2708  {
2709  solution->change_legende(0,"XX_SUP");
2710  solution->change_legende(1,"YY_SUP");
2711  solution->change_legende(2,"ZZ_SUP");
2712  solution->change_legende(3,"XY_SUP");
2713  solution->change_legende(4,"XZ_SUP");
2714  solution->change_legende(5,"YZ_SUP");
2715  }
2716  if ((codeimport==3)||(codeimport==5))
2717  {
2718  solution->change_legende(0,"XX");
2719  solution->change_legende(1,"YY");
2720  solution->change_legende(2,"ZZ");
2721  solution->change_legende(3,"XY");
2722  solution->change_legende(4,"XZ");
2723  solution->change_legende(5,"YZ");
2724  }
2725  if (codeimport==4)
2726  {
2727  solution->change_legende(0,"XX");
2728  solution->change_legende(1,"YY");
2729  solution->change_legende(2,"ZZ");
2730  solution->change_legende(3,"XY");
2731  }
2732  if (codeimport==5)
2733  {
2734  int num=mai->get_nb_fem_noeud();
2735  for (int i=0;i<num;i++)
2736  {
2737  solution->ecrire(0.,i,0);
2738  solution->ecrire(0.,i,1);
2739  solution->ecrire(0.,i,2);
2740  solution->ecrire(0.,i,3);
2741  solution->ecrire(0.,i,4);
2742  solution->ecrire(0.,i,5);
2743  }
2744  }
2745  int fin=0;
2746  int nbelement=0;
2747  do
2748  {
2749  char message[750];
2750  char *res=fgets(message,750,in);
2751  if (message[3]=='-')
2752  if (message[4]=='-')
2753  if (message[5]=='-')
2754  if (message[6]=='-')
2755  if (message[7]=='-')
2756  if (message[8]=='-')
2757  {
2758  fin=1;continue;
2759  }
2760  double exx,eyy,ezz,exy,exz,eyz;
2761  char mot[50];
2762 
2763  int numlu=sscanf(message,"%s %lf %lf %lf %lf %lf %lf",mot,&exx,&eyy,&ezz,&exy,&exz,&eyz);
2764 
2765  if (numlu==7)
2766  {
2767  char *p=strchr(mot,'N')+1;
2768  int num=ot.atoi(p,base);
2769  solution->ecrire(exx,num-1,0);
2770  solution->ecrire(eyy,num-1,1);
2771  solution->ecrire(ezz,num-1,2);
2772  solution->ecrire(exy,num-1,3);
2773  solution->ecrire(exz,num-1,4);
2774  solution->ecrire(eyz,num-1,5);
2775  nbelement++;
2776  }
2777  if (numlu==5)
2778  {
2779  char *p=strchr(mot,'N')+1;
2780  int num=ot.atoi(p,base);
2781  solution->ecrire(exx,num-1,0);
2782  solution->ecrire(eyy,num-1,1);
2783  solution->ecrire(ezz,num-1,2);
2784  solution->ecrire(exy,num-1,3);
2785  nbelement++;
2786  }
2787  if (nbelement == mai->get_nb_fem_noeud()) fin=1;
2788  }
2789  while (fin==0);
2790 
2791 }
2792 void MG_IMPORT::import_contrainteequi(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport,int pas)
2793 {
2794  char nom[500];
2795  char nomsol[500];
2796  sprintf(nomsol,"S%%%d",pas);
2797 
2798  if (codeimport==0)
2799  {
2800  strcat(nom,"_conq_moy.sol");
2801  sprintf(nom,"%s_onq_moy_%d.sol",nomfichier,pas);
2802  }
2803  if (codeimport==1)
2804  {
2805  strcat(nom,"_conq_inf.sol");
2806  sprintf(nom,"%s_conq_inf_%d.sol",nomfichier,pas);
2807  }
2808  if (codeimport==2)
2809  {
2810  strcat(nom,"_conq_sup.sol");
2811  sprintf(nom,"%s_conq_sup_%d.sol",nomfichier,pas);
2812  }
2813  if ((codeimport==3)||(codeimport==4))
2814  {
2815  strcat(nom,"_conq.sol");
2816  sprintf(nom,"%s_conq_%d.sol",nomfichier,pas);
2817  }
2819  FEM_SOLUTION* solution=gest->get_fem_solution(mai,5,nom,(char*)nomsol);
2820  if (solution==NULL)
2821  {
2822  solution=new FEM_SOLUTION(mai,5,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
2823  gest->ajouter_fem_solution(solution);
2824  }
2825  if (codeimport==1)
2826  {
2827  solution->change_legende(0,"VM_INF");
2828  solution->change_legende(1,"Tr_INF");
2829  solution->change_legende(2,"P1_INF");
2830  solution->change_legende(3,"P2_INF");
2831  solution->change_legende(4,"P3_INF");
2832  }
2833  if (codeimport==0)
2834  {
2835  solution->change_legende(0,"VM_MOY");
2836  solution->change_legende(1,"Tr_MOY");
2837  solution->change_legende(2,"P1_MOY");
2838  solution->change_legende(3,"P2_MOY");
2839  solution->change_legende(4,"P3_MOY");
2840  }
2841  if (codeimport==2)
2842  {
2843  solution->change_legende(0,"VM_SUP");
2844  solution->change_legende(1,"Tr_SUP");
2845  solution->change_legende(2,"P1_SUP");
2846  solution->change_legende(3,"P2_SUP");
2847  solution->change_legende(4,"P3_SUP");
2848  }
2849  if ((codeimport==3)||(codeimport==4))
2850  {
2851  solution->change_legende(0,"VM");
2852  solution->change_legende(1,"Tr");
2853  solution->change_legende(2,"P1");
2854  solution->change_legende(3,"P2");
2855  solution->change_legende(4,"P3");
2856  }
2857  int *tab=new int[mai->get_nb_fem_noeud()];
2858  for (int j=0;j<mai->get_nb_fem_noeud();j++)
2859  {
2860  for (int i=0;i<5;i++)
2861  solution->ecrire(0.,j,i);
2862  tab[j]=0;
2863  }
2864  int fin=0;
2865  int nbelement=0;
2866  do
2867  {
2868 
2869  char message[750];
2870  char *res=fgets(message,750,in);
2871  double tenseur[5];
2872  char mot[50];
2873  int numlu=sscanf(message,"%s %lf %lf %lf %lf %lf",mot,tenseur,tenseur+1,tenseur+2,tenseur+3,tenseur+4);
2874  if (numlu==1)
2875  {
2876  char *p=strchr(mot,'M');
2877  if (p!=NULL)
2878  {
2879  p++;
2880  int num=ot.atoi(p,base);
2881  nbelement++;
2882  }
2883 
2884  }
2885  if (numlu==6)
2886  {
2887  char *p=strchr(mot,'N')+1;
2888  int num=ot.atoi(p,base);
2889  solution->ecrire(solution->lire(num-1,0)+tenseur[0],num-1,0);
2890  solution->ecrire(solution->lire(num-1,1)+tenseur[1],num-1,1);
2891  solution->ecrire(solution->lire(num-1,2)+tenseur[2],num-1,2);
2892  solution->ecrire(solution->lire(num-1,3)+tenseur[3],num-1,3);
2893  solution->ecrire(solution->lire(num-1,4)+tenseur[4],num-1,4);
2894  tab[num-1]++;
2895  }
2896 
2897  if (codeimport==3) // Éléments volumiques
2898  if (nbelement == mai->get_nb_fem_element3()) fin=1;
2899  if (codeimport!=3) // Éléments de coques
2900  if (nbelement == mai->get_nb_fem_element2()) fin=1;
2901  }
2902  while (fin==0);
2903  for (int j=0;j<mai->get_nb_fem_noeud();j++)
2904  for (int i=0;i<5;i++)
2905  solution->ecrire(solution->lire(j,i)/tab[j],j,i);
2906  delete [] tab;
2907 
2908 }
2909 
2910 void MG_IMPORT::import_contrainteequi2(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport,int pas)
2911 {
2912 
2913  char nomsol[500];
2914  sprintf(nomsol,"S%%%d",pas);
2915  char nomsol2[500];
2916  sprintf(nomsol2,"V%%%d",pas);
2917  char nom[500];
2918  char nom2[500];
2919 
2920 
2921  if (codeimport==0)
2922  {
2923  sprintf(nom,"%s_conq_moy_%d.sol",nomfichier,pas);
2924  sprintf(nom2,"%s_vp_moy_%d.sol",nomfichier,pas);
2925  }
2926  if (codeimport==1)
2927  {
2928  sprintf(nom,"%s_conq_inf_%d.sol",nomfichier,pas);
2929  sprintf(nom2,"%s_vp_inf_%d.sol",nomfichier,pas);
2930  }
2931  if (codeimport==2)
2932  {
2933  sprintf(nom,"%s_conq_sup_%d.sol",nomfichier,pas);
2934  sprintf(nom2,"%s_vp_sup_%d.sol",nomfichier,pas);
2935 
2936  }
2937  if ((codeimport==3)||(codeimport==4))
2938  {
2939  sprintf(nom,"%s_conq_%d.sol",nomfichier,pas);
2940  sprintf(nom2,"%s_vp_%d.sol",nomfichier,pas);
2941  }
2943  FEM_SOLUTION* solution=gest->get_fem_solution(mai,5,nom,(char*)nomsol);
2944  FEM_SOLUTION* solution2=gest->get_fem_solution(mai,3,nom2,(char*)nomsol2);
2945  if (solution==NULL)
2946  {
2947  solution=new FEM_SOLUTION(mai,5,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
2948  gest->ajouter_fem_solution(solution);
2949  }
2950  if (solution2==NULL)
2951  {
2953  gest->ajouter_fem_solution(solution2);
2954  }
2955 
2956  if (codeimport==1)
2957  {
2958  solution->change_legende(0,"VM_INF");
2959  solution->change_legende(1,"Tr_INF");
2960  solution->change_legende(2,"P1_INF");
2961  solution->change_legende(3,"P2_INF");
2962  solution->change_legende(4,"P3_INF");
2963  solution2->change_legende(0,"V1_INF");
2964  solution2->change_legende(1,"V2_INF");
2965  solution2->change_legende(2,"V3_INF");
2966 
2967  }
2968  if (codeimport==0)
2969  {
2970  solution->change_legende(0,"VM_MOY");
2971  solution->change_legende(1,"Tr_MOY");
2972  solution->change_legende(2,"P1_MOY");
2973  solution->change_legende(3,"P2_MOY");
2974  solution->change_legende(4,"P3_MOY");
2975  solution2->change_legende(0,"V1_MOY");
2976  solution2->change_legende(1,"V2_MOY");
2977  solution2->change_legende(2,"V3_MOY");
2978  }
2979  if (codeimport==2)
2980  {
2981  solution->change_legende(0,"VM_SUP");
2982  solution->change_legende(1,"Tr_SUP");
2983  solution->change_legende(2,"P1_SUP");
2984  solution->change_legende(3,"P2_SUP");
2985  solution->change_legende(4,"P3_SUP");
2986  solution2->change_legende(0,"V1_SUP");
2987  solution2->change_legende(1,"V2_SUP");
2988  solution2->change_legende(2,"V3_SUP");
2989  }
2990  if ((codeimport==3)||(codeimport==4))
2991  {
2992  solution->change_legende(0,"VM");
2993  solution->change_legende(1,"Tr");
2994  solution->change_legende(2,"P1");
2995  solution->change_legende(3,"P2");
2996  solution->change_legende(4,"P3");
2997  solution2->change_legende(0,"V1");
2998  solution2->change_legende(1,"V2");
2999  solution2->change_legende(2,"V3");
3000 
3001  }
3002  int *tab=new int[mai->get_nb_fem_noeud()];
3003  for (int j=0;j<mai->get_nb_fem_noeud();j++)
3004  {
3005  for (int i=0;i<5;i++)
3006  solution->ecrire(0.,j,i);
3007  for (int i=0;i<3;i++)
3008  for (int k=0;k<3;k++)
3009  solution2->ecrire(0.,j,i,k);
3010  tab[j]=0;
3011  }
3012  int fin=0;
3013  int nbelement=0;
3014  do
3015  {
3016 
3017  char message[750];
3018  char *res=fgets(message,750,in);
3019  double tenseur[5];
3020  char mot[50];
3021  int numlu=sscanf(message,"%s %lf %lf %lf %lf %lf",mot,tenseur,tenseur+1,tenseur+2,tenseur+3,tenseur+4);
3022  if (numlu==1)
3023  {
3024  char *p=strchr(mot,'M');
3025  if (p!=NULL)
3026  {
3027  p++;
3028  int num=ot.atoi(p,base);
3029  nbelement++;
3030  }
3031 
3032  }
3033  if (numlu==6)
3034  {
3035  char *p=strchr(mot,'N');
3036  if (p!=NULL)
3037  {
3038  p++;
3039  int num=ot.atoi(p,base);
3040  solution->ecrire(solution->lire(num-1,0)+tenseur[0],num-1,0);
3041  solution->ecrire(solution->lire(num-1,1)+tenseur[1],num-1,1);
3042  solution->ecrire(solution->lire(num-1,2)+tenseur[2],num-1,2);
3043  solution->ecrire(solution->lire(num-1,3)+tenseur[3],num-1,3);
3044  solution->ecrire(solution->lire(num-1,4)+tenseur[4],num-1,4);
3045  double tenseur2[9];
3046  fgets(message,750,in);
3047  sscanf(message,"%lf %lf %lf %lf %lf %lf",tenseur2,tenseur2+1,tenseur2+2,tenseur2+3,tenseur2+4,tenseur2+5);
3048  fgets(message,750,in);
3049  sscanf(message,"%lf %lf %lf",tenseur2+6,tenseur2+7,tenseur2+8);
3050  solution2->ecrire(solution2->lire(num-1,0,0)+tenseur2[0],num-1,0,0);
3051  solution2->ecrire(solution2->lire(num-1,0,1)+tenseur2[1],num-1,0,1);
3052  solution2->ecrire(solution2->lire(num-1,0,2)+tenseur2[2],num-1,0,2);
3053  solution2->ecrire(solution2->lire(num-1,1,0)+tenseur2[3],num-1,1,0);
3054  solution2->ecrire(solution2->lire(num-1,1,1)+tenseur2[4],num-1,1,1);
3055  solution2->ecrire(solution2->lire(num-1,1,2)+tenseur2[5],num-1,1,2);
3056  solution2->ecrire(solution2->lire(num-1,2,0)+tenseur2[6],num-1,2,0);
3057  solution2->ecrire(solution2->lire(num-1,2,1)+tenseur2[7],num-1,2,1);
3058  solution2->ecrire(solution2->lire(num-1,2,2)+tenseur2[8],num-1,2,2);
3059  tab[num-1]++;
3060  }
3061  }
3062 
3063  if (codeimport==3) // Éléments volumiques
3064  if (nbelement == mai->get_nb_fem_element3()) fin=1;
3065  if (codeimport!=3) // Éléments de coques
3066  if (nbelement == mai->get_nb_fem_element2()) fin=1;
3067  }
3068  while (fin==0);
3069  for (int j=0;j<mai->get_nb_fem_noeud();j++)
3070  {
3071  for (int i=0;i<5;i++)
3072  solution->ecrire(solution->lire(j,i)/tab[j],j,i);
3073  for (int i=0;i<3;i++)
3074  {
3075  for (int k=0;k<3;k++)
3076  solution2->ecrire(solution2->lire(j,i,k)/tab[j],j,i,k);
3077  double x=solution2->lire(j,i,0);
3078  double y=solution2->lire(j,i,1);
3079  double z=solution2->lire(j,i,2);
3080  OT_VECTEUR_3D vec(x,y,z);
3081  vec.norme();
3082  vec=solution->lire(j,2+i)*vec;
3083  solution2->ecrire(vec.get_x(),j,i,0);
3084  solution2->ecrire(vec.get_y(),j,i,1);
3085  solution2->ecrire(vec.get_z(),j,i,2);
3086  }
3087 
3088  }
3089  delete [] tab;
3090 
3091 }
3092 
3093 void MG_IMPORT::import_contrainteequi2_gauss(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport,int pas)
3094 {
3095 
3096  char nomsol[500];
3097  sprintf(nomsol,"GS%%%d",pas);
3098  char nomsol2[500];
3099  sprintf(nomsol2,"GV%%%d",pas);
3100  char nom[500];
3101  char nom2[500];
3102 
3103 
3104  if (codeimport==0)
3105  {
3106  sprintf(nom,"%s_conq_moy_gauus_%d.sol",nomfichier,pas);
3107  sprintf(nom2,"%s_vp_moy_gauus_%d.sol",nomfichier,pas);
3108  }
3109  if (codeimport==1)
3110  {
3111  sprintf(nom,"%s_conq_inf_gauus_%d.sol",nomfichier,pas);
3112  sprintf(nom2,"%s_vp_inf_gauus_%d.sol",nomfichier,pas);
3113  }
3114  if (codeimport==2)
3115  {
3116  sprintf(nom,"%s_conq_sup_gauus_%d.sol",nomfichier,pas);
3117  sprintf(nom2,"%s_vp_sup_gauus_%d.sol",nomfichier,pas);
3118 
3119  }
3120  if ((codeimport==3)||(codeimport==4))
3121  {
3122  sprintf(nom,"%s_conq_gauus_%d.sol",nomfichier,pas);
3123  sprintf(nom2,"%s_vp_gauus_%d.sol",nomfichier,pas);
3124  }
3126  FEM_SOLUTION* solution=gest->get_fem_solution(mai,5,nom,(char*)nomsol);
3127  FEM_SOLUTION* solution2=gest->get_fem_solution(mai,3,nom2,(char*)nomsol2);
3128  if (solution==NULL)
3129  {
3130  if (codeimport==3) solution=new FEM_SOLUTION(mai,5,nom,mai->get_nb_fem_element3(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT3_GAUSS);
3131  else solution=new FEM_SOLUTION(mai,5,nom,mai->get_nb_fem_element2(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT2_GAUSS);
3132  gest->ajouter_fem_solution(solution);
3133  }
3134  if (solution2==NULL)
3135  {
3136  if (codeimport==3) solution2=new FEM_SOLUTION(mai,3,nom2,mai->get_nb_fem_element2(),nomsol2,MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT3_GAUSS,MAGIC::TYPE_SOLUTION::VECTEUR);
3138  gest->ajouter_fem_solution(solution2);
3139  }
3140 
3141  if (codeimport==1)
3142  {
3143  solution->change_legende(0,"VM_INF");
3144  solution->change_legende(1,"Tr_INF");
3145  solution->change_legende(2,"P1_INF");
3146  solution->change_legende(3,"P2_INF");
3147  solution->change_legende(4,"P3_INF");
3148  solution2->change_legende(0,"V1_INF");
3149  solution2->change_legende(1,"V2_INF");
3150  solution2->change_legende(2,"V3_INF");
3151 
3152  }
3153  if (codeimport==0)
3154  {
3155  solution->change_legende(0,"VM_MOY");
3156  solution->change_legende(1,"Tr_MOY");
3157  solution->change_legende(2,"P1_MOY");
3158  solution->change_legende(3,"P2_MOY");
3159  solution->change_legende(4,"P3_MOY");
3160  solution2->change_legende(0,"V1_MOY");
3161  solution2->change_legende(1,"V2_MOY");
3162  solution2->change_legende(2,"V3_MOY");
3163  }
3164  if (codeimport==2)
3165  {
3166  solution->change_legende(0,"VM_SUP");
3167  solution->change_legende(1,"Tr_SUP");
3168  solution->change_legende(2,"P1_SUP");
3169  solution->change_legende(3,"P2_SUP");
3170  solution->change_legende(4,"P3_SUP");
3171  solution2->change_legende(0,"V1_SUP");
3172  solution2->change_legende(1,"V2_SUP");
3173  solution2->change_legende(2,"V3_SUP");
3174  }
3175  if ((codeimport==3)||(codeimport==4))
3176  {
3177  solution->change_legende(0,"VM");
3178  solution->change_legende(1,"Tr");
3179  solution->change_legende(2,"P1");
3180  solution->change_legende(3,"P2");
3181  solution->change_legende(4,"P3");
3182  solution2->change_legende(0,"V1");
3183  solution2->change_legende(1,"V2");
3184  solution2->change_legende(2,"V3");
3185 
3186  }
3187 
3188  int fin=0;
3189  int nbelement=0;
3190  std::vector<std::string> tabligne;
3191  int decalage;
3192  do
3193  {
3194 
3195  char message[750];
3196  char *res=fgets(message,750,in);
3197  double tenseur[5];
3198  char mot[50];
3199  int numlu=sscanf(message,"%s %lf %lf %lf %lf %lf",mot,tenseur,tenseur+1,tenseur+2,tenseur+3,tenseur+4);
3200  if (numlu==1)
3201  {
3202  char *p=strchr(mot,'M');
3203  if (p!=NULL)
3204  {
3205  p++;
3206  int num=ot.atoi(p,base);
3207  nbelement++;
3208  if (nbelement==1) {tabligne.clear();decalage=num;}
3209  else
3210  {
3211  int nbgauss=tabligne.size()/3;
3212  solution->change_nb_gauss(num-decalage-1,nbgauss);
3213  solution2->change_nb_gauss(num-decalage-1,nbgauss);
3214  for (int i=0;i<nbgauss;i++)
3215  {
3216  char ligne[2000];
3217  strcpy(ligne,tabligne[3*i].c_str());
3218  int numgauss;
3219  double tenseur2[9];
3220  sscanf(ligne,"%d %lf %lf %lf %lf %lf",&numgauss,tenseur,tenseur+1,tenseur+2,tenseur+3,tenseur+4);
3221  strcpy(ligne,tabligne[3*i+1].c_str());
3222  sscanf(ligne,"%lf %lf %lf %lf %lf %lf",tenseur2,tenseur2+1,tenseur2+2,tenseur2+3,tenseur2+4,tenseur2+5);
3223  strcpy(ligne,tabligne[3*i+2].c_str());
3224  sscanf(ligne,"%lf %lf %lf",tenseur2+6,tenseur2+7,tenseur2+8);
3225  solution->ecrire(tenseur[0],num-decalage-1,0,0,numgauss-1);
3226  solution->ecrire(tenseur[1],num-decalage-1,1,0,numgauss-1);
3227  solution->ecrire(tenseur[2],num-decalage-1,2,0,numgauss-1);
3228  solution->ecrire(tenseur[3],num-decalage-1,3,0,numgauss-1);
3229  solution->ecrire(tenseur[4],num-decalage-1,4,0,numgauss-1);
3230  solution2->ecrire(tenseur2[0],num-decalage-1,0,0,numgauss-1);
3231  solution2->ecrire(tenseur2[1],num-decalage-1,0,1,numgauss-1);
3232  solution2->ecrire(tenseur2[2],num-decalage-1,0,2,numgauss-1);
3233  solution2->ecrire(tenseur2[3],num-decalage-1,1,0,numgauss-1);
3234  solution2->ecrire(tenseur2[4],num-decalage-1,1,1,numgauss-1);
3235  solution2->ecrire(tenseur2[5],num-decalage-1,1,2,numgauss-1);
3236  solution2->ecrire(tenseur2[6],num-decalage-1,2,0,numgauss-1);
3237  solution2->ecrire(tenseur2[7],num-decalage-1,2,1,numgauss-1);
3238  solution2->ecrire(tenseur2[8],num-decalage-1,2,2,numgauss-1);
3239  }
3240  tabligne.clear();
3241  }
3242  }
3243 
3244  }
3245  if (numlu==6)
3246  {
3247  tabligne.push_back(message);
3248  fgets(message,750,in);
3249  tabligne.push_back(message);
3250  fgets(message,750,in);
3251  tabligne.push_back(message);
3252 
3253  }
3254 
3255  if (codeimport==3) // Éléments volumiques
3256  if (nbelement == mai->get_nb_fem_element3()) fin=-1;
3257  if (codeimport!=3) // Éléments de coques
3258  if (nbelement == mai->get_nb_fem_element2()) fin=-1;
3259  if ((fin==-1) && (numlu<1)) fin=1;
3260  }
3261  while (fin<1);
3262  int nbgauss=tabligne.size()/3;
3263  solution->change_nb_gauss(nbelement-1,nbgauss);
3264  solution2->change_nb_gauss(nbelement-1,nbgauss);
3265  for (int i=0;i<nbgauss;i++)
3266  {
3267  char ligne[2000];
3268  strcpy(ligne,tabligne[3*i].c_str());
3269  int numgauss;
3270  double tenseur[5];
3271  double tenseur2[9];
3272  sscanf(ligne,"%d %lf %lf %lf %lf %lf",&numgauss,tenseur,tenseur+1,tenseur+2,tenseur+3,tenseur+4);
3273  strcpy(ligne,tabligne[3*i+1].c_str());
3274  sscanf(ligne,"%lf %lf %lf %lf %lf %lf",tenseur2,tenseur2+1,tenseur2+2,tenseur2+3,tenseur2+4,tenseur2+5);
3275  strcpy(ligne,tabligne[3*i+2].c_str());
3276  sscanf(ligne,"%lf %lf %lf",tenseur2+6,tenseur2+7,tenseur2+8);
3277  solution->ecrire(tenseur[0],nbelement-1,0,0,numgauss-1);
3278  solution->ecrire(tenseur[1],nbelement-1,1,0,numgauss-1);
3279  solution->ecrire(tenseur[2],nbelement-1,2,0,numgauss-1);
3280  solution->ecrire(tenseur[3],nbelement-1,3,0,numgauss-1);
3281  solution->ecrire(tenseur[4],nbelement-1,4,0,numgauss-1);
3282  solution2->ecrire(tenseur2[0],nbelement-1,0,0,numgauss-1);
3283  solution2->ecrire(tenseur2[1],nbelement-1,0,1,numgauss-1);
3284  solution2->ecrire(tenseur2[2],nbelement-1,0,2,numgauss-1);
3285  solution2->ecrire(tenseur2[3],nbelement-1,1,0,numgauss-1);
3286  solution2->ecrire(tenseur2[4],nbelement-1,1,1,numgauss-1);
3287  solution2->ecrire(tenseur2[5],nbelement-1,1,2,numgauss-1);
3288  solution2->ecrire(tenseur2[6],nbelement-1,2,0,numgauss-1);
3289  solution2->ecrire(tenseur2[7],nbelement-1,2,1,numgauss-1);
3290  solution2->ecrire(tenseur2[8],nbelement-1,2,2,numgauss-1);
3291  }
3292 tabligne.clear();
3293 for (int j=0;j<mai->get_nb_fem_element3();j++)
3294  {
3295  int nbgauss=solution2->get_nb_gauss(j);
3296  for (int g=0;g<nbgauss;g++)
3297  for (int i=0;i<3;i++)
3298  {
3299  double x=solution2->lire(j,i,0,g);
3300  double y=solution2->lire(j,i,1,g);
3301  double z=solution2->lire(j,i,2,g);
3302  OT_VECTEUR_3D vec(x,y,z);
3303  vec.norme();
3304  vec=solution->lire(j,2+i,0,g)*vec;
3305  solution2->ecrire(vec.get_x(),j,i,0,g);
3306  solution2->ecrire(vec.get_y(),j,i,1,g);
3307  solution2->ecrire(vec.get_z(),j,i,2,g);
3308  }
3309 
3310  }
3311 }
3312 
3313 void MG_IMPORT::import_contrainteequi_noeud(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport,int pas)
3314 {
3315  char nom[500];
3316  char nomsol[500];
3317  sprintf(nomsol,"S%%%d",pas);
3318 
3319  if (codeimport==0)
3320  {
3321  sprintf(nom,"%s_conq_moy_%d.sol",nomfichier,pas);
3322  }
3323  if (codeimport==1)
3324  {
3325  sprintf(nom,"%s_conq_inf_%d.sol",nomfichier,pas);
3326  }
3327  if (codeimport==2)
3328  {
3329  sprintf(nom,"%s_conq_sup_%d.sol",nomfichier,pas);
3330  }
3331  if ((codeimport==3) || (codeimport==4))
3332  {
3333  sprintf(nom,"%s_conq_%d.sol",nomfichier,pas);
3334  }
3336  FEM_SOLUTION* solution=gest->get_fem_solution(mai,5,nom,(char*)nomsol);
3337  if (solution==NULL)
3338  {
3339  solution=new FEM_SOLUTION(mai,5,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
3340  gest->ajouter_fem_solution(solution);
3341  }
3342  if (codeimport==1)
3343  {
3344  solution->change_legende(0,"VM_INF");
3345  solution->change_legende(1,"Tr_INF");
3346  solution->change_legende(2,"P1_INF");
3347  solution->change_legende(3,"P2_INF");
3348  solution->change_legende(4,"P3_INF");
3349  }
3350  if (codeimport==0)
3351  {
3352  solution->change_legende(0,"VM_MOY");
3353  solution->change_legende(1,"Tr_MOY");
3354  solution->change_legende(2,"P1_MOY");
3355  solution->change_legende(3,"P2_MOY");
3356  solution->change_legende(4,"P3_MOY");
3357  }
3358  if (codeimport==2)
3359  {
3360  solution->change_legende(0,"VM_SUP");
3361  solution->change_legende(1,"Tr_SUP");
3362  solution->change_legende(2,"P1_SUP");
3363  solution->change_legende(3,"P2_SUP");
3364  solution->change_legende(4,"P3_SUP");
3365  }
3366  if (codeimport==3)
3367  {
3368  solution->change_legende(0,"VM");
3369  solution->change_legende(1,"Tr");
3370  solution->change_legende(2,"P1");
3371  solution->change_legende(3,"P2");
3372  solution->change_legende(4,"P3");
3373  }
3374 
3375 
3376  int fin=0;
3377  int nbelement=0;
3378  do
3379  {
3380  char message[750];
3381  char *res=fgets(message,750,in);
3382  double vm,tr,p1,p2,p3;
3383  char mot[50];
3384 
3385 
3386  int numlu=sscanf(message,"%s %lf %lf %lf %lf %lf ",mot,&vm,&tr,&p1,&p2,&p3);
3387  if (numlu==6)
3388  {
3389  char *p=strchr(mot,'N')+1;
3390  int num=ot.atoi(p,base);
3391  solution->ecrire(vm,num-1,0);
3392  solution->ecrire(tr,num-1,1);
3393  solution->ecrire(p1,num-1,2);
3394  solution->ecrire(p2,num-1,3);
3395  solution->ecrire(p3,num-1,4);
3396  nbelement++;
3397  }
3398 
3399  if (nbelement == mai->get_nb_fem_noeud()) fin=1;
3400  }
3401  while (fin==0);
3402 
3403 }
3404 void MG_IMPORT::import_contrainteequi2_noeud(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport,int pas)
3405 {
3406  char nomsol[500];
3407  sprintf(nomsol,"S%%%d",pas);
3408  char nomsol2[500];
3409  sprintf(nomsol2,"V%%%d",pas);
3410  char nom[500];
3411  char nom2[500];
3412 
3413  if (codeimport==0)
3414  {
3415  sprintf(nom,"%s_conq_moy_%d.sol",nomfichier,pas);
3416  sprintf(nom2,"%s_vp_moy_%d.sol",nomfichier,pas);
3417  }
3418  if (codeimport==1)
3419  {
3420  sprintf(nom,"%s_conq_inf_%d.sol",nomfichier,pas);
3421  sprintf(nom2,"%s_vp_inf_%d.sol",nomfichier,pas);
3422  }
3423  if (codeimport==2)
3424  {
3425  sprintf(nom,"%s_conq_sup_%d.sol",nomfichier,pas);
3426  sprintf(nom2,"%s_vp_sup_%d.sol",nomfichier,pas);
3427 
3428  }
3429  if ((codeimport==3)||(codeimport==4)||(codeimport==5))
3430  {
3431  sprintf(nom,"%s_conq_%d.sol",nomfichier,pas);
3432  sprintf(nom2,"%s_vp_%d.sol",nomfichier,pas);
3433  }
3435  FEM_SOLUTION* solution=gest->get_fem_solution(mai,5,nom,(char*)nomsol);
3436  FEM_SOLUTION* solution2=gest->get_fem_solution(mai,3,nom2,(char*)nomsol2);
3437  if (solution==NULL)
3438  {
3439  solution=new FEM_SOLUTION(mai,5,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
3440  gest->ajouter_fem_solution(solution);
3441  }
3442  if (solution2==NULL)
3443  {
3445  gest->ajouter_fem_solution(solution2);
3446  }
3447  if (codeimport==1)
3448  {
3449  solution->change_legende(0,"VM_INF");
3450  solution->change_legende(1,"Tr_INF");
3451  solution->change_legende(2,"P1_INF");
3452  solution->change_legende(3,"P2_INF");
3453  solution->change_legende(4,"P3_INF");
3454  solution2->change_legende(0,"V1_INF");
3455  solution2->change_legende(1,"V2_INF");
3456  solution2->change_legende(2,"V3_INF");
3457  }
3458  if (codeimport==0)
3459  {
3460  solution->change_legende(0,"VM_MOY");
3461  solution->change_legende(1,"Tr_MOY");
3462  solution->change_legende(2,"P1_MOY");
3463  solution->change_legende(3,"P2_MOY");
3464  solution->change_legende(4,"P3_MOY");
3465  solution2->change_legende(0,"V1_MOY");
3466  solution2->change_legende(1,"V2_MOY");
3467  solution2->change_legende(2,"V3_MOY");
3468  }
3469  if (codeimport==2)
3470  {
3471  solution->change_legende(0,"VM_SUP");
3472  solution->change_legende(1,"Tr_SUP");
3473  solution->change_legende(2,"P1_SUP");
3474  solution->change_legende(3,"P2_SUP");
3475  solution->change_legende(4,"P3_SUP");
3476  solution2->change_legende(0,"V1_SUP");
3477  solution2->change_legende(1,"V2_SUP");
3478  solution2->change_legende(2,"V3_SUP");
3479  }
3480  if ((codeimport==3)||(codeimport==4)||(codeimport==5))
3481  {
3482  solution->change_legende(0,"VM");
3483  solution->change_legende(1,"Tr");
3484  solution->change_legende(2,"P1");
3485  solution->change_legende(3,"P2");
3486  solution->change_legende(4,"P3");
3487  solution2->change_legende(0,"V1");
3488  solution2->change_legende(1,"V2");
3489  solution2->change_legende(2,"V3");
3490  }
3491  if (codeimport==5)
3492  {
3493  int num=mai->get_nb_fem_noeud();
3494  for (int i=0;i<num;i++)
3495  {
3496  solution->ecrire(0.,i,0);
3497  solution->ecrire(0.,i,1);
3498  solution->ecrire(0.,i,2);
3499  solution->ecrire(0.,i,3);
3500  solution->ecrire(0.,i,4);
3501  solution2->ecrire(1.,i,0,0);
3502  solution2->ecrire(1.,i,0,1);
3503  solution2->ecrire(1.,i,0,2);
3504  solution2->ecrire(1.,i,1,0);
3505  solution2->ecrire(1.,i,1,1);
3506  solution2->ecrire(1.,i,1,2);
3507  solution2->ecrire(1.,i,2,0);
3508  solution2->ecrire(1.,i,2,1);
3509  solution2->ecrire(1.,i,2,2);
3510 
3511  }
3512  }
3513 
3514  int fin=0;
3515  int nbelement=0;
3516  do
3517  {
3518  char message[750];
3519  char *res=fgets(message,750,in);
3520  double vm,tr,p1,p2,p3;
3521  char mot[50];
3522  if ((message[3]=='-')||(message[3]=='*'))
3523  if ((message[4]=='-')||(message[4]=='*'))
3524  if ((message[5]=='-')||(message[5]=='*'))
3525  if ((message[6]=='-')||(message[6]=='*'))
3526  if ((message[7]=='-')||(message[7]=='*'))
3527  if ((message[8]=='-')||(message[8]=='*'))
3528  {
3529  fin=1;continue;
3530  }
3531 
3532  int numlu=sscanf(message,"%s %lf %lf %lf %lf %lf ",mot,&vm,&tr,&p1,&p2,&p3);
3533  if (numlu==6)
3534  {
3535  char *p=strchr(mot,'N');
3536  if (p!=NULL)
3537  {
3538  p++;
3539  int num=ot.atoi(p,base);
3540  solution->ecrire(vm,num-1,0);
3541  solution->ecrire(tr,num-1,1);
3542  solution->ecrire(p1,num-1,2);
3543  solution->ecrire(p2,num-1,3);
3544  solution->ecrire(p3,num-1,4);
3545  double tenseur2[9];
3546  fgets(message,750,in);
3547  sscanf(message,"%lf %lf %lf %lf %lf %lf",tenseur2,tenseur2+1,tenseur2+2,tenseur2+3,tenseur2+4,tenseur2+5);
3548  fgets(message,750,in);
3549  sscanf(message,"%lf %lf %lf",tenseur2+6,tenseur2+7,tenseur2+8);
3550  solution2->ecrire(solution2->lire(num-1,0,0)+tenseur2[0],num-1,0,0);
3551  solution2->ecrire(solution2->lire(num-1,0,1)+tenseur2[1],num-1,0,1);
3552  solution2->ecrire(solution2->lire(num-1,0,2)+tenseur2[2],num-1,0,2);
3553  solution2->ecrire(solution2->lire(num-1,1,0)+tenseur2[3],num-1,1,0);
3554  solution2->ecrire(solution2->lire(num-1,1,1)+tenseur2[4],num-1,1,1);
3555  solution2->ecrire(solution2->lire(num-1,1,2)+tenseur2[5],num-1,1,2);
3556  solution2->ecrire(solution2->lire(num-1,2,0)+tenseur2[6],num-1,2,0);
3557  solution2->ecrire(solution2->lire(num-1,2,1)+tenseur2[7],num-1,2,1);
3558  solution2->ecrire(solution2->lire(num-1,2,2)+tenseur2[8],num-1,2,2);
3559  nbelement++;
3560  }
3561  }
3562 
3563  if (nbelement == mai->get_nb_fem_noeud()) fin=1;
3564  }
3565  while (fin==0);
3566 
3567  for (int j=0;j<mai->get_nb_fem_noeud();j++)
3568  {
3569  for (int i=0;i<3;i++)
3570  {
3571  double x=solution2->lire(j,i,0);
3572  double y=solution2->lire(j,i,1);
3573  double z=solution2->lire(j,i,2);
3574  OT_VECTEUR_3D vec(x,y,z);
3575  vec.norme();
3576  vec=solution->lire(j,2+i)*vec;
3577  solution2->ecrire(vec.get_x(),j,i,0);
3578  solution2->ecrire(vec.get_y(),j,i,1);
3579  solution2->ecrire(vec.get_z(),j,i,2);
3580  }
3581 
3582  }
3583 }
3584 
3585 
3586 
3587 
3588 void MG_IMPORT::import_erreur(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport)
3589 {
3590  char nom[500];
3591  strcpy(nom,nomfichier);
3592  strcat(nom,"_erreur.sol");
3593  FEM_SOLUTION* solution;
3595  if (codeimport==3) // Éléments volumiques
3596  {
3597  solution=gest->get_fem_solution(mai,3,nom,(char*)"Er");
3598  if (solution==NULL)
3599  {
3600  solution=new FEM_SOLUTION(mai,3,nom,mai->get_nb_fem_element3(),"Er",MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT3);
3601  gest->ajouter_fem_solution(solution);
3602  }
3603  }
3604  else if (codeimport==5) // Éléments de coques
3605  {
3606  solution=gest->get_fem_solution(mai,3,nom,(char*)"Er");
3607  if (solution==NULL)
3608  {
3610  gest->ajouter_fem_solution(solution);
3611  }
3612  }
3613  else
3614  {
3615  solution=gest->get_fem_solution(mai,3,nom,(char*)"Er");
3616  if (solution==NULL)
3617  {
3618  solution=new FEM_SOLUTION(mai,3,nom,mai->get_nb_fem_element2(),"Er",MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT2);
3619  gest->ajouter_fem_solution(solution);
3620  }
3621  }
3622 
3623  gest->ajouter_fem_solution(solution);
3624  solution->change_legende(0,"estime");
3625  solution->change_legende(1,"nuestime");
3626  solution->change_legende(2,"sigcal");
3627  if (codeimport==5)
3628  {
3629  int num=mai->get_nb_fem_element1()+mai->get_nb_fem_element2()+mai->get_nb_fem_element3();
3630  for (int i=0;i<num;i++)
3631  {
3632  solution->ecrire(0.,i,0);
3633  solution->ecrire(0.,i,1);
3634  solution->ecrire(0.,i,2);
3635  }
3636  }
3637 
3638 
3639 
3640  int fin=0;
3641  int passe=0;
3642  int nbelement=0;
3643  int decalage=1;
3644  do
3645  {
3646  char message[750];
3647  char *res=fgets(message,750,in);
3648  char mot1[500];
3649  char mot2[500];
3650  if ((message[3]=='-')||(message[3]=='*'))
3651  if ((message[4]=='-')||(message[4]=='*'))
3652  if ((message[5]=='-')||(message[5]=='*'))
3653  if ((message[6]=='-')||(message[6]=='*'))
3654  if ((message[7]=='-')||(message[7]=='*'))
3655  if ((message[8]=='-')||(message[8]=='*'))
3656  {
3657  fin=1;continue;
3658  }
3659  int numlu=sscanf(message,"%s %s",mot1,mot2);
3660  if ((numlu==2) && (strcmp(mot2,"ERREST")==0))
3661  {
3662  char *p=strchr(mot1,'M')+1;
3663  int num=ot.atoi(p,base);
3664  if ((passe==0)&&(codeimport!=5)) {
3665  passe=1;
3666  decalage=num;
3667  }
3668  char *res=fgets(message,750,in);
3669  res=fgets(message,750,in);
3670  double val,val2,val3;
3671  sscanf(message,"%lf %lf %lf",&val,&val2,&val3);
3672  solution->ecrire(val,num-decalage,0);
3673  solution->ecrire(val2,num-decalage,1);
3674  solution->ecrire(val3,num-decalage,2);
3675  nbelement++;
3676  res=fgets(message,750,in);
3677  }
3678  if (codeimport==3) // Éléments volumiques
3679  {if (nbelement == mai->get_nb_fem_element3()) fin=1;}
3680  else if (codeimport==5) // Éléments volumiques
3681  {if (nbelement == mai->get_nb_fem_element3()+mai->get_nb_fem_element2()+mai->get_nb_fem_element1()) fin=1;}
3682  else // Éléments de coques
3683  if (nbelement == mai->get_nb_fem_element2()) fin=1;
3684  }
3685  while (fin==0);
3686 
3687 
3688 }
3689 
3690 
3691 void MG_IMPORT::import_contrainte_max_poutre(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport)
3692 {
3693  if (codeimport!=5) return;
3694  char nom[500];
3695  strcpy(nom,nomfichier);
3696  strcat(nom,"_conmax_poutre.sol");
3697  FEM_SOLUTION* solution;
3699  solution=gest->get_fem_solution(mai,2,nom,(char*)"SIXX");
3700  if (solution==NULL)
3701  {
3703  gest->ajouter_fem_solution(solution);
3704  }
3705  solution->change_legende(0,"MIN");
3706  solution->change_legende(1,"MAX");
3707  std::vector<FEM_ELEMENT_MAILLAGE*> corre;
3708  if (codeimport==5)
3709  {
3710  int i=0;
3711  LISTE_FEM_ELEMENT1::iterator it;
3712  for (FEM_ELEMENT1* ele=mai->get_premier_element1(it);ele!=NULL;ele=mai->get_suivant_element1(it))
3713  {
3714  corre.push_back(ele);
3715  int nb=ele->get_nb_fem_noeud();
3716  for (int j=0;j<nb;j++)
3717  {
3718  solution->ecrire(0.,i,0,0,j);
3719  solution->ecrire(0.,i,1,0,j);
3720  }
3721  i++;
3722  }
3723  LISTE_FEM_ELEMENT2::iterator it2;
3724  for (FEM_ELEMENT2* ele=mai->get_premier_element2(it2);ele!=NULL;ele=mai->get_suivant_element2(it2))
3725  {
3726  corre.push_back(ele);
3727  int nb=ele->get_nb_fem_noeud();
3728  for (int j=0;j<nb;j++)
3729  {
3730  solution->ecrire(0.,i,0,0,j);
3731  solution->ecrire(0.,i,1,0,j);
3732  }
3733  i++;
3734  }
3735  LISTE_FEM_ELEMENT3::iterator it3;
3736  for (FEM_ELEMENT3* ele=mai->get_premier_element3(it3);ele!=NULL;ele=mai->get_suivant_element3(it3))
3737  {
3738  corre.push_back(ele);
3739  int nb=ele->get_nb_fem_noeud();
3740  for (int j=0;j<nb;j++)
3741  {
3742  solution->ecrire(0.,i,0,0,j);
3743  solution->ecrire(0.,i,1,0,j);
3744  }
3745  i++;
3746  }
3747 
3748  }
3749 
3750 
3751 
3752  int fin=0;
3753  int passe=0;
3754  int nbelement=0;
3755  do
3756  {
3757  char message[750];
3758  char *res=fgets(message,750,in);
3759  char mot1[500];
3760  char mot2[500];
3761  if ((message[3]=='-')||(message[3]=='*'))
3762  if ((message[4]=='-')||(message[4]=='*'))
3763  if ((message[5]=='-')||(message[5]=='*'))
3764  if ((message[6]=='-')||(message[6]=='*'))
3765  if ((message[7]=='-')||(message[7]=='*'))
3766  if ((message[8]=='-')||(message[8]=='*'))
3767  {
3768  fin=1;continue;
3769  }
3770  int numlu=sscanf(message,"%s %s",mot1,mot2);
3771  if ((numlu==2) && (strcmp(mot2,"SIXXMIN")==0))
3772  {
3773  char *p=strchr(mot1,'M')+1;
3774  int num=ot.atoi(p,base);
3775 
3776  int nbnoeud;
3777  if (num-1<mai->get_nb_fem_element1()) nbnoeud=((FEM_ELEMENT1*)corre[num-1])->get_nb_fem_noeud();
3778  else if (num-1<mai->get_nb_fem_element1()+mai->get_nb_fem_element1()) nbnoeud=((FEM_ELEMENT2*)corre[num-1])->get_nb_fem_noeud();
3779  else nbnoeud=((FEM_ELEMENT1*)corre[num-1])->get_nb_fem_noeud();
3780  for (int i=0;i<nbnoeud;i++)
3781  {
3782  char *res=fgets(message,750,in);
3783  double val,val2;
3784  char mot3[500];
3785  sscanf(message,"%s %lf %lf",mot3,&val,&val2);
3786  solution->ecrire(val,num-1,0,0,i);
3787  solution->ecrire(val2,num-1,1,0,i);
3788  nbelement++;
3789  }
3790  }
3791  if (nbelement == mai->get_nb_fem_element3()+mai->get_nb_fem_element2()+mai->get_nb_fem_element1()) fin=1;
3792  }
3793  while (fin==0);
3794 
3795 
3796 }
3797 
3798 
3799 void MG_IMPORT::import_contrainte_poutre(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport)
3800 {
3801  if (codeimport!=5) return;
3802  char nom[500];
3803  strcpy(nom,nomfichier);
3804  strcat(nom,"_con_poutre.sol");
3805  FEM_SOLUTION* solution;
3807  solution=gest->get_fem_solution(mai,6,nom,(char*)"Sp");
3808  if (solution==NULL)
3809  {
3811  gest->ajouter_fem_solution(solution);
3812  }
3813  solution->change_legende(0,"N");
3814  solution->change_legende(1,"VY");
3815  solution->change_legende(2,"VZ");
3816  solution->change_legende(3,"MT");
3817  solution->change_legende(4,"MFY");
3818  solution->change_legende(5,"MFZ");
3819  std::vector<FEM_ELEMENT_MAILLAGE*> corre;
3820  if (codeimport==5)
3821  {
3822  int i=0;
3823  LISTE_FEM_ELEMENT1::iterator it;
3824  for (FEM_ELEMENT1* ele=mai->get_premier_element1(it);ele!=NULL;ele=mai->get_suivant_element1(it))
3825  {
3826  corre.push_back(ele);
3827  int nb=ele->get_nb_fem_noeud();
3828  for (int j=0;j<nb;j++)
3829  {
3830  solution->ecrire(0.,i,0,0,j);
3831  solution->ecrire(0.,i,1,0,j);
3832  solution->ecrire(0.,i,2,0,j);
3833  solution->ecrire(0.,i,3,0,j);
3834  solution->ecrire(0.,i,4,0,j);
3835  solution->ecrire(0.,i,5,0,j);
3836  }
3837  i++;
3838  }
3839  LISTE_FEM_ELEMENT2::iterator it2;
3840  for (FEM_ELEMENT2* ele=mai->get_premier_element2(it2);ele!=NULL;ele=mai->get_suivant_element2(it2))
3841  {
3842  corre.push_back(ele);
3843  int nb=ele->get_nb_fem_noeud();
3844  for (int j=0;j<nb;j++)
3845  {
3846  solution->ecrire(0.,i,0,0,j);
3847  solution->ecrire(0.,i,1,0,j);
3848  solution->ecrire(0.,i,2,0,j);
3849  solution->ecrire(0.,i,3,0,j);
3850  solution->ecrire(0.,i,4,0,j);
3851  solution->ecrire(0.,i,5,0,j);
3852  }
3853  i++;
3854  }
3855  LISTE_FEM_ELEMENT3::iterator it3;
3856  for (FEM_ELEMENT3* ele=mai->get_premier_element3(it3);ele!=NULL;ele=mai->get_suivant_element3(it3))
3857  {
3858  corre.push_back(ele);
3859  int nb=ele->get_nb_fem_noeud();
3860  for (int j=0;j<nb;j++)
3861  {
3862  solution->ecrire(0.,i,0,0,j);
3863  solution->ecrire(0.,i,1,0,j);
3864  solution->ecrire(0.,i,2,0,j);
3865  solution->ecrire(0.,i,3,0,j);
3866  solution->ecrire(0.,i,4,0,j);
3867  solution->ecrire(0.,i,5,0,j);
3868  }
3869  i++;
3870  }
3871 
3872  }
3873 
3874 
3875 
3876  int fin=0;
3877  int passe=0;
3878  int nbelement=0;
3879  do
3880  {
3881  char message[750];
3882  char *res=fgets(message,750,in);
3883  char mot1[500];
3884  char mot2[500];
3885  if ((message[3]=='-')||(message[3]=='*'))
3886  if ((message[4]=='-')||(message[4]=='*'))
3887  if ((message[5]=='-')||(message[5]=='*'))
3888  if ((message[6]=='-')||(message[6]=='*'))
3889  if ((message[7]=='-')||(message[7]=='*'))
3890  if ((message[8]=='-')||(message[8]=='*'))
3891  {
3892  fin=1;continue;
3893  }
3894  int numlu=sscanf(message,"%s %s",mot1,mot2);
3895  if ((numlu==2) && (strcmp(mot2,"SN")==0))
3896  {
3897  char *p=strchr(mot1,'M')+1;
3898  int num=ot.atoi(p,base);
3899 
3900  int nbnoeud;
3901  if (num-1<mai->get_nb_fem_element1()) nbnoeud=((FEM_ELEMENT1*)corre[num-1])->get_nb_fem_noeud();
3902  else if (num-1<mai->get_nb_fem_element1()+mai->get_nb_fem_element1()) nbnoeud=((FEM_ELEMENT2*)corre[num-1])->get_nb_fem_noeud();
3903  else nbnoeud=((FEM_ELEMENT1*)corre[num-1])->get_nb_fem_noeud();
3904  for (int i=0;i<nbnoeud;i++)
3905  {
3906  char *res=fgets(message,750,in);
3907  double val,val2,val3,val4,val5,val6;
3908  char mot3[500];
3909  sscanf(message,"%s %lf %lf %lf %lf %lf %lf",mot3,&val,&val2,&val3,&val4,&val5,&val6);
3910  solution->ecrire(val,num-1,0,0,i);
3911  solution->ecrire(val2,num-1,1,0,i);
3912  solution->ecrire(val3,num-1,2,0,i);
3913  solution->ecrire(val4,num-1,3,0,i);
3914  solution->ecrire(val5,num-1,4,0,i);
3915  solution->ecrire(val6,num-1,5,0,i);
3916  nbelement++;
3917  }
3918  }
3919  if (nbelement == mai->get_nb_fem_element3()+mai->get_nb_fem_element2()+mai->get_nb_fem_element1()) fin=1;
3920  }
3921  while (fin==0);
3922 
3923 
3924 }
3925 
3926 void MG_IMPORT::import_effort(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport)
3927 {
3928  if (codeimport!=5) return;
3929  char nom[500];
3930  strcpy(nom,nomfichier);
3931  strcat(nom,"_effort.sol");
3932  FEM_SOLUTION* solution;
3934  solution=gest->get_fem_solution(mai,6,nom,(char*)"Ef");
3935  if (solution==NULL)
3936  {
3938  gest->ajouter_fem_solution(solution);
3939  }
3940  solution->change_legende(0,"N");
3941  solution->change_legende(1,"VY");
3942  solution->change_legende(2,"VZ");
3943  solution->change_legende(3,"MT");
3944  solution->change_legende(4,"MFY");
3945  solution->change_legende(5,"MFZ");
3946  std::vector<FEM_ELEMENT_MAILLAGE*> corre;
3947  if (codeimport==5)
3948  {
3949  int i=0;
3950  LISTE_FEM_ELEMENT1::iterator it;
3951  for (FEM_ELEMENT1* ele=mai->get_premier_element1(it);ele!=NULL;ele=mai->get_suivant_element1(it))
3952  {
3953  corre.push_back(ele);
3954  int nb=ele->get_nb_fem_noeud();
3955  for (int j=0;j<nb;j++)
3956  {
3957  solution->ecrire(0.,i,0,0,j);
3958  solution->ecrire(0.,i,1,0,j);
3959  solution->ecrire(0.,i,2,0,j);
3960  solution->ecrire(0.,i,3,0,j);
3961  solution->ecrire(0.,i,4,0,j);
3962  solution->ecrire(0.,i,5,0,j);
3963  }
3964  i++;
3965  }
3966  LISTE_FEM_ELEMENT2::iterator it2;
3967  for (FEM_ELEMENT2* ele=mai->get_premier_element2(it2);ele!=NULL;ele=mai->get_suivant_element2(it2))
3968  {
3969  corre.push_back(ele);
3970  int nb=ele->get_nb_fem_noeud();
3971  for (int j=0;j<nb;j++)
3972  {
3973  solution->ecrire(0.,i,0,0,j);
3974  solution->ecrire(0.,i,1,0,j);
3975  solution->ecrire(0.,i,2,0,j);
3976  solution->ecrire(0.,i,3,0,j);
3977  solution->ecrire(0.,i,4,0,j);
3978  solution->ecrire(0.,i,5,0,j);
3979  }
3980  i++;
3981  }
3982  LISTE_FEM_ELEMENT3::iterator it3;
3983  for (FEM_ELEMENT3* ele=mai->get_premier_element3(it3);ele!=NULL;ele=mai->get_suivant_element3(it3))
3984  {
3985  corre.push_back(ele);
3986  int nb=ele->get_nb_fem_noeud();
3987  for (int j=0;j<nb;j++)
3988  {
3989  solution->ecrire(0.,i,0,0,j);
3990  solution->ecrire(0.,i,1,0,j);
3991  solution->ecrire(0.,i,2,0,j);
3992  solution->ecrire(0.,i,3,0,j);
3993  solution->ecrire(0.,i,4,0,j);
3994  solution->ecrire(0.,i,5,0,j);
3995  }
3996  i++;
3997  }
3998 
3999  }
4000 
4001 
4002 
4003  int fin=0;
4004  int passe=0;
4005  int nbelement=0;
4006  do
4007  {
4008  char message[750];
4009  char *res=fgets(message,750,in);
4010  char mot1[500];
4011  char mot2[500];
4012  if ((message[3]=='-')||(message[3]=='*'))
4013  if ((message[4]=='-')||(message[4]=='*'))
4014  if ((message[5]=='-')||(message[5]=='*'))
4015  if ((message[6]=='-')||(message[6]=='*'))
4016  if ((message[7]=='-')||(message[7]=='*'))
4017  if ((message[8]=='-')||(message[8]=='*'))
4018  {
4019  fin=1;continue;
4020  }
4021  int numlu=sscanf(message,"%s %s",mot1,mot2);
4022  if ((numlu==2) && (strcmp(mot2,"N")==0))
4023  {
4024  char *p=strchr(mot1,'M')+1;
4025  int num=ot.atoi(p,base);
4026 
4027  int nbnoeud;
4028  if (num-1<mai->get_nb_fem_element1()) nbnoeud=((FEM_ELEMENT1*)corre[num-1])->get_nb_fem_noeud();
4029  else if (num-1<mai->get_nb_fem_element1()+mai->get_nb_fem_element1()) nbnoeud=((FEM_ELEMENT2*)corre[num-1])->get_nb_fem_noeud();
4030  else nbnoeud=((FEM_ELEMENT1*)corre[num-1])->get_nb_fem_noeud();
4031  for (int i=0;i<nbnoeud;i++)
4032  {
4033  char *res=fgets(message,750,in);
4034  double val,val2,val3,val4,val5,val6;
4035  char mot3[500];
4036  sscanf(message,"%s %lf %lf %lf %lf %lf %lf",mot3,&val,&val2,&val3,&val4,&val5,&val6);
4037  solution->ecrire(val,num-1,0,0,i);
4038  solution->ecrire(val2,num-1,1,0,i);
4039  solution->ecrire(val3,num-1,2,0,i);
4040  solution->ecrire(val4,num-1,3,0,i);
4041  solution->ecrire(val5,num-1,4,0,i);
4042  solution->ecrire(val6,num-1,5,0,i);
4043  nbelement++;
4044  }
4045  }
4046  if (nbelement == mai->get_nb_fem_element3()+mai->get_nb_fem_element2()+mai->get_nb_fem_element1()) fin=1;
4047  }
4048  while (fin==0);
4049 
4050 
4051 }
4052 
4053 
4054 
4055 
4056 
4057 void MG_IMPORT::import_temperature(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport,int pas)
4058 {
4059 
4060  char nom[500];
4061  strcpy(nom,nomfichier);
4062  strcat(nom,"_temp.sol");
4063  sprintf(nom,"%s_temp_%d.sol",nomfichier,pas);
4064  FEM_SOLUTION* solution;
4066  if (codeimport==3)
4067  {
4068  char nomsol[500];
4069  sprintf(nomsol,"T%%%d",pas);
4070  solution=gest->get_fem_solution(mai,1,nom,(char*)nomsol);
4071 
4072  if (solution==NULL)
4073  {
4074  solution=new FEM_SOLUTION(mai,1,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
4075  gest->ajouter_fem_solution(solution);
4076  }
4077 
4078 
4079  }
4080 
4081 
4082  solution->change_legende(0,"temp");
4083 
4084 
4085 
4086 
4087  int fin=0;
4088  int nbnoeud=0;
4089  do
4090  {
4091 
4092  char message[750];
4093  char *res=fgets(message,750,in);
4094  double x;
4095  char mot[50];
4096  if (codeimport==3)
4097  {
4098  int numlu=sscanf(message,"%s %lf",mot,&x);
4099  if (numlu==2)
4100  {
4101  char *p=strchr(mot,'N')+1;
4102  int num=ot.atoi(p,base);
4103 
4104  solution->ecrire(x,num-1,0);
4105  ;
4106  nbnoeud++;
4107  }
4108 
4109  }
4110 
4111  if (nbnoeud == mai->get_nb_fem_noeud()) fin=1;
4112 
4113  }
4114  while (fin==0);
4115 
4116 }
4117 void MG_IMPORT::import_flux_noeud(int base,FEM_MAILLAGE* mai,FILE* in,char *nomfichier,int codeimport,int pas)
4118 {
4119  char nom[500];
4120  strcpy(nom,nomfichier);
4121  strcat(nom,"_flux.sol");
4122  sprintf(nom,"%s_flux_%d.sol",nomfichier,pas);
4123  FEM_SOLUTION* solution;
4125  if (codeimport==3)
4126  {
4127  char nomsol[500];
4128  sprintf(nomsol,"F%%%d",pas);
4129  solution=gest->get_fem_solution(mai,1,nom,(char*)nomsol);
4130  if (solution==NULL)
4131  {
4132  solution=new FEM_SOLUTION(mai,3,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
4133  gest->ajouter_fem_solution(solution);
4134  }
4135  }
4136  solution->change_legende(0,"x");
4137  solution->change_legende(1,"y");
4138  solution->change_legende(2,"z");
4139  int fin=0;
4140  int nbelement=0;
4141  do
4142  {
4143  char message[750];
4144  char *res=fgets(message,750,in);
4145  double flx,fly,flz;
4146  char mot[50];
4147  int numlu=sscanf(message,"%s %lf %lf %lf",mot,&flx,&fly,&flz);
4148  if (numlu==4)
4149  {
4150  char *p=strchr(mot,'N')+1;
4151  int num=ot.atoi(p,base);
4152  solution->ecrire(flx,num-1,0);
4153  solution->ecrire(fly,num-1,1);
4154  solution->ecrire(flz,num-1,2);
4155  nbelement++;
4156  }
4157  if (nbelement == mai->get_nb_fem_noeud()) fin=1;
4158  }
4159  while (fin==0);
4160 /*
4161 
4162 
4163 
4164 
4165 
4166 
4167 
4168 
4169 
4170 
4171 
4172  char nom[500];
4173  strcpy(nom,nomfichier);
4174  strcat(nom,"_flux.sol");
4175  sprintf(nom,"%s_flux_%d.sol",nomfichier,pas);
4176  FEM_SOLUTION* solution;
4177  MG_GESTIONNAIRE* gest=mai->get_mg_maillage()->get_gestionnaire();
4178  if (codeimport==3)
4179  {
4180  char nomsol[500];
4181  sprintf(nomsol,"F%%%d",pas);
4182  solution=gest->get_fem_solution(mai,1,nom,(char*)nomsol);
4183  if (solution==NULL)
4184  {
4185  solution=new FEM_SOLUTION(mai,3,nom,mai->get_nb_fem_noeud(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD);
4186  gest->ajouter_fem_solution(solution);
4187  }
4188  }
4189  solution->change_legende(0,"x");
4190  solution->change_legende(1,"y");
4191  solution->change_legende(2,"z");
4192  int fin=0;
4193  int nbnoeud=0;
4194  do
4195  {
4196  char message[750];
4197  char *res=fgets(message,750,in);
4198  double fl_x,fl_y,fl_z;
4199  char mot[50];
4200  if (codeimport==3)
4201  {
4202  int numlu=sscanf(message,"%s %lf %lf %lf",mot,&fl_x, &fl_y, &fl_z);
4203  if (numlu==4)
4204  {
4205  char *p=strchr(mot,'N')+1;
4206  int num=ot.atoi(p,base);
4207  solution->ecrire(fl_x,num-1,0);
4208  solution->ecrire(fl_y,num-1,1);
4209  solution->ecrire(fl_z,num-1,2);
4210  nbnoeud++;
4211  }
4212  }
4213  if (nbnoeud == mai->get_nb_fem_noeud()) fin=1;
4214  }
4215  while (fin==0);*/
4216 }
4217 
4218 void MG_IMPORT::import_flux_gauss(int base, FEM_MAILLAGE* mai, FILE* in, char* nomfichier, int codeimport, int pas)
4219 {
4220 char nom[500];
4221  char nomsol[500];
4222  sprintf(nomsol,"FLUX%%%d",pas);
4223 
4224  if (codeimport==0)
4225  {
4226  //strcat(nom,"_cont_moy.sol");
4227  sprintf(nom,"%sflux_moy_gauss_%d.sol",nomfichier,pas);
4228  }
4229  if (codeimport==1)
4230  {
4231  sprintf(nom,"%s_flux_inf_gauss_%d.sol",nomfichier,pas);
4232  }
4233  if (codeimport==2)
4234  {
4235  sprintf(nom,"%s_flux_sup_gauss_%d.sol",nomfichier,pas);
4236  }
4237  if ((codeimport==3) || (codeimport==4))
4238  {
4239  sprintf(nom,"%s_flux_gauss_%d.sol",nomfichier,pas);
4240  }
4241 
4243  FEM_SOLUTION* solution;
4244  if (codeimport==4) solution=gest->get_fem_solution(mai,2,nom,(char*)nomsol);
4245  else solution=gest->get_fem_solution(mai,3,nom,(char*)nomsol);
4246  if (solution==NULL)
4247  {
4248  if (codeimport!=3) solution=new FEM_SOLUTION(mai,2,nom,mai->get_nb_fem_element2(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT2_GAUSS);
4249  else solution=new FEM_SOLUTION(mai,3,nom,mai->get_nb_fem_element3(),nomsol,MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT3_GAUSS);
4250  gest->ajouter_fem_solution(solution);
4251  }
4252  if (codeimport==1)
4253  {
4254  solution->change_legende(0,"FLUX_X_INF");
4255  solution->change_legende(1,"FLUX_Y_INF");
4256  solution->change_legende(2,"FLUX_Z_INF");
4257  }
4258  if (codeimport==0)
4259  {
4260  solution->change_legende(0,"FLUX_X_MOY");
4261  solution->change_legende(1,"FLUX_Y_MOY");
4262  solution->change_legende(2,"FLUX_Z_MOY");
4263  }
4264  if (codeimport==2)
4265  {
4266  solution->change_legende(0,"FLUX_X_SUP");
4267  solution->change_legende(1,"FLUX_Y_SUP");
4268  solution->change_legende(2,"FLUX_Z_SUP");
4269  }
4270  if (codeimport==3)
4271  {
4272  solution->change_legende(0,"FLUX_X");
4273  solution->change_legende(1,"FLUX_Y");
4274  solution->change_legende(2,"FLUX_Z");
4275  }
4276  if (codeimport==4)
4277  {
4278  solution->change_legende(0,"FLUX_X");
4279  solution->change_legende(1,"FLUX_Y");
4280  solution->change_legende(2,"FLUX_Z");
4281  }
4282  int nbchamp=6;
4283  if (codeimport==4) nbchamp=4;
4284 
4285  int fin=0;
4286  int nbelement=0;
4287  LISTE_FEM_ELEMENT2::iterator it;
4288  FEM_ELEMENT2* tri;
4289  std::vector<std::string> tabligne;
4290  int decalage;
4291  do
4292  {
4293  char message[750];
4294  char *res=fgets(message,750,in);
4295  double tenseur[6];
4296  char mot[50];
4297  tenseur[3]=0;
4298  tenseur[4]=0;
4299  tenseur[5]=0;
4300  int numlu=sscanf(message,"%s %lf %lf %lf",mot,tenseur,tenseur+1,tenseur+2);
4301  if (numlu==1)
4302  {
4303  char *p=strchr(mot,'M');
4304  if (p!=NULL)
4305  {
4306  p++;
4307  int num=ot.atoi(p,base);
4308  nbelement++;
4309  if (nbelement==1) tri=mai->get_premier_element2(it);
4310  else tri=mai->get_suivant_element2(it);
4311  if (nbelement==1) {tabligne.clear();decalage=num;}
4312  else
4313  {
4314 
4315  int nbgauss=tabligne.size();
4316  solution->change_nb_gauss(num-decalage-1,nbgauss);
4317  for (int i=0;i<nbgauss;i++)
4318  {
4319  char ligne[2000];
4320  strcpy(ligne,tabligne[i].c_str());
4321  int numgauss;
4322  int numlu=sscanf(ligne,"%d %lf %lf %lf",&numgauss,tenseur,tenseur+1,tenseur+2);
4323  if (numlu==4)
4324  {
4325  double *tenseurres;
4326  double tenseurglo[6];
4327  if (codeimport==3) tenseurres=tenseur; // Éléments volumiques
4328  else // Éléments de coques
4329  {
4330  change_repere_tenseur(tri,tenseurglo,tenseur);
4331  tenseurres=tenseurglo;
4332  }
4333  solution->ecrire(tenseurres[0],num-decalage-1,0,0,numgauss-1);
4334  solution->ecrire(tenseurres[1],num-decalage-1,1,0,numgauss-1);
4335  solution->ecrire(tenseurres[2],num-decalage-1,2,0,numgauss-1);
4336  }
4337  if (numlu==3)
4338  {
4339  solution->ecrire(tenseur[0],num-decalage-1,0,0,numgauss-1);
4340  solution->ecrire(tenseur[1],num-decalage-1,1,0,numgauss-1);
4341  }
4342 
4343  }
4344  tabligne.clear();
4345  }
4346  }
4347  }
4348  else if (numlu>1) tabligne.push_back(message);
4349 
4350 
4351 
4352 
4353 
4354 
4355  if (codeimport==3)
4356  if (nbelement == mai->get_nb_fem_element3()) fin=-1;
4357  if (codeimport!=3) // Éléments de coques
4358  if (nbelement == mai->get_nb_fem_element2()) fin=-1;
4359  if ((fin==-1) && (numlu<1)) fin=1;
4360  }
4361  while (fin<1);
4362 int nbgauss=tabligne.size();
4363 solution->change_nb_gauss(nbelement-1,nbgauss);
4364 for (int i=0;i<nbgauss;i++)
4365  {
4366  char ligne[2000];
4367  strcpy(ligne,tabligne[i].c_str());
4368  int numgauss;
4369  double tenseur[6];
4370  tenseur[3]=0;
4371  tenseur[4]=0;
4372  tenseur[5]=0;
4373  int numlu=sscanf(ligne,"%d %lf %lf %lf",&numgauss,tenseur,tenseur+1,tenseur+2);
4374  if (numlu==4)
4375  {
4376  double *tenseurres;
4377  double tenseurglo[6];
4378  if (codeimport==3) tenseurres=tenseur; // Éléments volumiques
4379  else // Éléments de coques
4380  {
4381  change_repere_tenseur(tri,tenseurglo,tenseur);
4382  tenseurres=tenseurglo;
4383  }
4384  solution->ecrire(tenseurres[0],nbelement-1,0,0,numgauss-1);
4385  solution->ecrire(tenseurres[1],nbelement-1,1,0,numgauss-1);
4386  solution->ecrire(tenseurres[2],nbelement-1,2,0,numgauss-1);
4387  }
4388  if (numlu==3)
4389  {
4390  solution->ecrire(tenseur[0],nbelement-1,0,0,numgauss-1);
4391  solution->ecrire(tenseur[1],nbelement-1,1,0,numgauss-1);
4392  }
4393  }
4394 }
4395 
4396 void MG_IMPORT::change_repere_tenseur(FEM_ELEMENT2* tri,double *tensglobal,double *tenslocal)
4397 {
4398 FEM_NOEUD* no1=tri->get_fem_noeud(0);
4399 FEM_NOEUD* no2=tri->get_fem_noeud(1);
4400 FEM_NOEUD* no3=tri->get_fem_noeud(2);
4401 double *xyz1=no1->get_coord();
4402 double *xyz2=no2->get_coord();
4403 double *xyz3=no3->get_coord();
4404 OT_VECTEUR_3D vec1(xyz1,xyz2);
4405 OT_VECTEUR_3D vec2(xyz1,xyz3);
4406 OT_VECTEUR_3D normale=vec1&vec2; // Normale au triangle
4407 normale.norme(); // Normale unitaire
4408 OT_VECTEUR_3D dirx(1.,0.,0.);
4409 OT_VECTEUR_3D diry(0.,1.,0.);
4410 OT_VECTEUR_3D vecteur;
4411 if (fabs(fabs(normale*dirx)-1.)<0.0000000001) // Si l'axe X est // à la normale (produit scalaire=1 ou -1)
4412  vecteur=diry;
4413 else // Sinon l'axe Y est // à la normale
4414  vecteur=dirx;
4415 
4416 OT_VECTEUR_3D yloc=normale&vecteur;
4417 yloc.norme();
4418 OT_VECTEUR_3D xloc=yloc&normale;
4419 OT_MATRICE_3D transf(xloc,yloc,normale);
4420 OT_MATRICE_3D transfinv=transf.transpose();
4421 OT_MATRICE_3D tenseur;
4422 tenseur(0,0)=tenslocal[0];
4423 tenseur(1,1)=tenslocal[1];
4424 tenseur(2,2)=tenslocal[2];
4425 tenseur(0,1)=tenslocal[3];
4426 tenseur(1,0)=tenslocal[3];
4427 tenseur(0,2)=tenslocal[4];
4428 tenseur(2,0)=tenslocal[4];
4429 tenseur(1,2)=tenslocal[5];
4430 tenseur(2,1)=tenslocal[5];
4431 OT_MATRICE_3D tenseur2=transf*tenseur*transfinv;
4432 tensglobal[0]=tenseur2(0,0);
4433 tensglobal[1]=tenseur2(1,1);
4434 tensglobal[2]=tenseur2(2,2);
4435 tensglobal[3]=tenseur2(0,1);
4436 tensglobal[4]=tenseur2(0,2);
4437 tensglobal[5]=tenseur2(1,2);
4438 }
4439 
4440 
4441 
4442 
4443 void MG_IMPORT::maillage_gmsh(MG_GESTIONNAIRE* gest,char* nomfichier,MG_GEOMETRIE* geo)
4444 {
4445 MG_MAILLAGE* mai=new MG_MAILLAGE(geo);
4446 gest->ajouter_mg_maillage(mai);
4448 FILE* in=fopen(nomfichier,"rt");
4449 if (in!=NULL)
4450  {
4451  char mot[500];
4452  strcpy(mot,"");
4453  std::vector<GMSH_ARETE> lstaretegmsh;
4454  std::vector<GMSH_FACE> lstfacegmsh;
4455  std::vector<GMSH_VOLUME> lstvolumegmsh;
4456  while (strcmp(mot,"$Nodes")!=0)
4457  {
4458  char ligne[500];
4459  fgets(ligne,500,in);
4460  sscanf(ligne,"%s",mot);
4461  }
4462  while (strcmp(mot,"$EndNodes")!=0)
4463  {
4464  char ligne[500];
4465  fgets(ligne,500,in);
4466  sscanf(ligne,"%s",mot);
4467  int num;
4468  double x,y,z;
4469  int numarg=sscanf(ligne,"%d %lf %lf %lf",&num,&x,&y,&z);
4470  if (numarg==4)
4471  {
4472  MG_NOEUD* no=new MG_NOEUD(NULL,x,y,z,MAGIC::ORIGINE::GMSH);
4473  mai->ajouter_mg_noeud(no);
4474  lstno.ajouter(no);
4475  }
4476  }
4477  while (strcmp(mot,"$Elements")!=0)
4478  {
4479  char ligne[500];
4480  fgets(ligne,500,in);
4481  sscanf(ligne,"%s",mot);
4482  }
4483  while (strcmp(mot,"$EndElements")!=0)
4484  {
4485  char ligne[500];
4486  fgets(ligne,500,in);
4487  sscanf(ligne,"%s",mot);
4488  int num,code;
4489  int numarg=sscanf(ligne,"%d %d",&num,&code);
4490  if (numarg==2)
4491  {
4492  if (code==15)
4493  {
4494  int numtag;
4495  numarg=sscanf(ligne,"%d %d %d",&num,&code,&numtag);
4496  if (numarg==3)
4497  {
4498  int n1,tag1,tag2,tag3,tag4,tag5,tag6;
4499  if (numtag==0) sscanf(ligne,"%d %d %d %d",&num,&code,&numtag,&n1);
4500  if (numtag==1) sscanf(ligne,"%d %d %d %d %d",&num,&code,&numtag,&tag1,&n1);
4501  if (numtag==2) sscanf(ligne,"%d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&n1);
4502  if (numtag==3) sscanf(ligne,"%d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&n1);
4503  if (numtag==4) sscanf(ligne,"%d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&n1);
4504  if (numtag==5) sscanf(ligne,"%d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&tag5,&n1);
4505  if (numtag==6) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&tag5,&tag6,&n1);
4506  MG_NOEUD* no1=lstno.get(n1-1);
4507  if (geo!=NULL)
4508  {
4509  LISTE_MG_SOMMET::iterator it;
4510  double *xyz=no1->get_coord();
4511  for (MG_SOMMET* som=geo->get_premier_sommet(it);som!=NULL;som=geo->get_suivant_sommet(it))
4512  {
4513  double xyzpoint[3];
4514  som->get_point()->evaluer(xyzpoint);
4515  OT_VECTEUR_3D vec(xyz,xyzpoint);
4516  if (vec.get_longueur()<geo->get_valeur_precision())
4517  {
4518  no1->change_lien_topologie(som);
4519  break;
4520  }
4521  }
4522  }
4523  }
4524  }
4525  if (code==1)
4526  {
4527  int numtag;
4528  numarg=sscanf(ligne,"%d %d %d",&num,&code,&numtag);
4529  if (numarg==3)
4530  {
4531  int n1,n2,tag1,tag2,tag3,tag4,tag5,tag6;
4532  if (numtag==0) sscanf(ligne,"%d %d %d %d %d",&num,&code,&numtag,&n1,&n2);
4533  if (numtag==1) sscanf(ligne,"%d %d %d %d %d %d",&num,&code,&numtag,&tag1,&n1,&n2);
4534  if (numtag==2) sscanf(ligne,"%d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&n1,&n2);
4535  if (numtag==3) sscanf(ligne,"%d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&n1,&n2);
4536  if (numtag==4) sscanf(ligne,"%d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&n1,&n2);
4537  if (numtag==5) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&tag5,&n1,&n2);
4538  if (numtag==6) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&tag5,&tag6,&n1,&n2);
4539  MG_NOEUD* no1=lstno.get(n1-1);
4540  MG_NOEUD* no2=lstno.get(n2-1);
4541  MG_SEGMENT* seg=new MG_SEGMENT(NULL,no1,no2,MAGIC::ORIGINE::GMSH);
4542  mai->ajouter_mg_segment(seg);
4543  if (geo!=NULL)
4544  {
4545  while (lstaretegmsh.size()<tag2)
4546  {
4547  GMSH_ARETE are;
4548  lstaretegmsh.push_back(are);
4549  }
4550  lstaretegmsh[tag2-1].ajouter(seg);
4551  }
4552  }
4553  }
4554  if (code==2)
4555  {
4556  int numtag;
4557  numarg=sscanf(ligne,"%d %d %d",&num,&code,&numtag);
4558  if (numarg==3)
4559  {
4560  int n1,n2,n3,tag1,tag2,tag3,tag4,tag5,tag6;
4561  if (numtag==0) sscanf(ligne,"%d %d %d %d %d %d",&num,&code,&numtag,&n1,&n2,&n3);
4562  if (numtag==1) sscanf(ligne,"%d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&n1,&n2,&n3);
4563  if (numtag==2) sscanf(ligne,"%d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&n1,&n2,&n3);
4564  if (numtag==3) sscanf(ligne,"%d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&n1,&n2,&n3);
4565  if (numtag==4) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&n1,&n2,&n3);
4566  if (numtag==5) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&tag5,&n1,&n2,&n3);
4567  if (numtag==6) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&tag5,&tag6,&n1,&n2,&n3);
4568  MG_NOEUD* no1=lstno.get(n1-1);
4569  MG_NOEUD* no2=lstno.get(n2-1);
4570  MG_NOEUD* no3=lstno.get(n3-1);
4571  MG_TRIANGLE* tri=mai->ajouter_mg_triangle(NULL,no1,no2,no3,MAGIC::ORIGINE::GMSH);
4572  if (geo!=NULL)
4573  {
4574  while (lstfacegmsh.size()<tag2)
4575  {
4576  GMSH_FACE face;
4577  lstfacegmsh.push_back(face);
4578  }
4579  lstfacegmsh[tag2-1].ajouter(tri);
4580  }
4581 
4582  }
4583  }
4584  if (code==3)
4585  {
4586  int numtag;
4587  numarg=sscanf(ligne,"%d %d %d",&num,&code,&numtag);
4588  if (numarg==3)
4589  {
4590  int n1,n2,n3,n4,tag1,tag2,tag3,tag4,tag5,tag6;
4591  if (numtag==0) sscanf(ligne,"%d %d %d %d %d %d %d",&num,&code,&numtag,&n1,&n2,&n3,&n4);
4592  if (numtag==1) sscanf(ligne,"%d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&n1,&n2,&n3,&n4);
4593  if (numtag==2) sscanf(ligne,"%d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&n1,&n2,&n3,&n4);
4594  if (numtag==3) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&n1,&n2,&n3,&n4);
4595  if (numtag==4) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&n1,&n2,&n3,&n4);
4596  if (numtag==5) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&tag5,&n1,&n2,&n3,&n4);
4597  if (numtag==6) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&tag5,&tag6,&n1,&n2,&n3,&n4);
4598  MG_NOEUD* no1=lstno.get(n1-1);
4599  MG_NOEUD* no2=lstno.get(n2-1);
4600  MG_NOEUD* no3=lstno.get(n3-1);
4601  MG_NOEUD* no4=lstno.get(n4-1);
4602  MG_QUADRANGLE* qua=mai->ajouter_mg_quadrangle(NULL,no1,no2,no3,no4,MAGIC::ORIGINE::GMSH);
4603  if (geo!=NULL)
4604  {
4605  while (lstfacegmsh.size()<tag2)
4606  {
4607  GMSH_FACE face;
4608  lstfacegmsh.push_back(face);
4609  }
4610  lstfacegmsh[tag2-1].ajouter(qua);
4611  }
4612 
4613  }
4614  }
4615 
4616  if (code==4)
4617  {
4618  int numtag;
4619  numarg=sscanf(ligne,"%d %d %d",&num,&code,&numtag);
4620  if (numarg==3)
4621  {
4622  int n1,n2,n3,n4,tag1,tag2,tag3,tag4,tag5,tag6;
4623  if (numtag==0) sscanf(ligne,"%d %d %d %d %d %d %d",&num,&code,&numtag,&n1,&n2,&n3,&n4);
4624  if (numtag==1) sscanf(ligne,"%d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&n1,&n2,&n3,&n4);
4625  if (numtag==2) sscanf(ligne,"%d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&n1,&n2,&n3,&n4);
4626  if (numtag==3) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&n1,&n2,&n3,&n4);
4627  if (numtag==4) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&n1,&n2,&n3,&n4);
4628  if (numtag==5) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&tag5,&n1,&n2,&n3,&n4);
4629  if (numtag==6) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&tag5,&tag6,&n1,&n2,&n3,&n4);
4630  MG_NOEUD* no1=lstno.get(n1-1);
4631  MG_NOEUD* no2=lstno.get(n2-1);
4632  MG_NOEUD* no3=lstno.get(n3-1);
4633  MG_NOEUD* no4=lstno.get(n4-1);
4634  MG_TETRA* tet=mai->ajouter_mg_tetra(NULL,no1,no2,no3,no4,MAGIC::ORIGINE::GMSH);
4635  if (geo!=NULL)
4636  {
4637  while (lstvolumegmsh.size()<tag2)
4638  {
4639  GMSH_VOLUME vol;
4640  lstvolumegmsh.push_back(vol);
4641  }
4642  lstvolumegmsh[tag2-1].ajouter(tet);
4643  }
4644 
4645  }
4646  }
4647  if (code==5)
4648  {
4649  int numtag;
4650  numarg=sscanf(ligne,"%d %d %d",&num,&code,&numtag);
4651  if (numarg==3)
4652  {
4653  int n1,n2,n3,n4,n5,n6,n7,n8,tag1,tag2,tag3,tag4,tag5,tag6;
4654  if (numtag==0) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&n1,&n2,&n3,&n4,&n5,&n6,&n7,&n8);
4655  if (numtag==1) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&n1,&n2,&n3,&n4,&n5,&n6,&n7,&n8);
4656  if (numtag==2) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&n1,&n2,&n3,&n4,&n5,&n6,&n7,&n8);
4657  if (numtag==3) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&n1,&n2,&n3,&n4,&n5,&n6,&n7,&n8);
4658  if (numtag==4) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&n1,&n2,&n3,&n4,&n5,&n6,&n7,&n8);
4659  if (numtag==5) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&tag5,&n1,&n2,&n3,&n4,&n5,&n6,&n7,&n8);
4660  if (numtag==6) sscanf(ligne,"%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d",&num,&code,&numtag,&tag1,&tag2,&tag3,&tag4,&tag5,&tag6,&n1,&n2,&n3,&n4,&n5,&n6,&n7,&n8);
4661  MG_NOEUD* no1=lstno.get(n1-1);
4662  MG_NOEUD* no2=lstno.get(n2-1);
4663  MG_NOEUD* no3=lstno.get(n3-1);
4664  MG_NOEUD* no4=lstno.get(n4-1);
4665  MG_NOEUD* no5=lstno.get(n5-1);
4666  MG_NOEUD* no6=lstno.get(n6-1);
4667  MG_NOEUD* no7=lstno.get(n7-1);
4668  MG_NOEUD* no8=lstno.get(n8-1);
4669  MG_HEXA* hex=mai->ajouter_mg_hexa(NULL,no1,no2,no3,no4,no5,no6,no7,no8,MAGIC::ORIGINE::GMSH);
4670  if (geo!=NULL)
4671  {
4672  while (lstvolumegmsh.size()<tag2)
4673  {
4674  GMSH_VOLUME vol;
4675  lstvolumegmsh.push_back(vol);
4676  }
4677  lstvolumegmsh[tag2-1].ajouter(hex);
4678  }
4679 
4680  }
4681  }
4682  }
4683  }
4684  fclose(in);
4685  if (geo!=NULL)
4686  {
4687  // attache segment
4688  int nbaregmsh=lstaretegmsh.size();
4689  for (int i=0;i<nbaregmsh;i++)
4690  {
4691  MG_SOMMET* som1=lstaretegmsh[i].lstsom[0];
4692  MG_SOMMET* som2=lstaretegmsh[i].lstsom[1];
4693  MG_ARETE* are=NULL;
4694  LISTE_MG_ARETE::iterator it;
4695  for (MG_ARETE *aretmp=geo->get_premier_arete(it);aretmp!=NULL;aretmp=geo->get_suivant_arete(it))
4696  {
4697  if ( ((aretmp->get_cosommet1()->get_sommet()==som1) &&(aretmp->get_cosommet2()->get_sommet()==som2)) || ((aretmp->get_cosommet1()->get_sommet()==som2) &&(aretmp->get_cosommet2()->get_sommet()==som1)) )
4698  if (are==NULL)
4699  are=aretmp;
4700  else
4701  {
4702  int j=0;
4703  MG_NOEUD* no=NULL;
4704  while (no==NULL)
4705  {
4706  MG_NOEUD *notmp=lstaretegmsh[i].lstseg[j]->get_noeud1();
4707  if (notmp->get_lien_topologie()==NULL) no=notmp;
4708  notmp=lstaretegmsh[i].lstseg[j]->get_noeud2();
4709  if (notmp->get_lien_topologie()==NULL) no=notmp;
4710  j++;
4711  }
4712  double *xyz=no->get_coord();
4713  double t;
4714  aretmp->inverser(t,xyz);
4715  double xyz2[3];
4716  aretmp->evaluer(t,xyz2);
4717  OT_VECTEUR_3D vec(xyz,xyz2);
4718  if (vec.get_longueur()<geo->get_valeur_precision())
4719  {
4720  if (aretmp->get_courbe()->est_periodique()==1)
4721  if (t<aretmp->get_tmin()) t=t+aretmp->get_courbe()->get_periode();
4722  if ((t>aretmp->get_tmin()) && (t<aretmp->get_tmax()))
4723  are=aretmp;
4724  }
4725 
4726  }
4727  }
4728  MG_SEGMENT* seg=lstaretegmsh[i].lstseg[0];
4729  double t1;
4730  double *xyz1=seg->get_noeud1()->get_coord();
4731  double *xyz2=seg->get_noeud2()->get_coord();
4732  are->inverser(t1,xyz1);
4733  bool sensidentique=true;
4734  OT_VECTEUR_3D vec(xyz1,xyz2);
4735  vec.norme();
4736  double dxyz1[3];
4737  are->deriver(t1,dxyz1);
4738  OT_VECTEUR_3D dvec(dxyz1);
4739  dvec.norme();
4740  double ps=dvec*vec;
4741  if (ps <0) sensidentique=false;
4742  int nbseg=lstaretegmsh[i].lstseg.size();
4743  for (int j=0;j<nbseg;j++)
4744  {
4745  MG_SEGMENT* seg=lstaretegmsh[i].lstseg[j];
4746  seg->change_lien_topologie(are);
4747  if (seg->get_noeud1()->get_lien_topologie()==NULL) seg->get_noeud1()->change_lien_topologie(are);
4748  if (seg->get_noeud2()->get_lien_topologie()==NULL) seg->get_noeud2()->change_lien_topologie(are);
4749  if (sensidentique==false) seg->inverse_sens();
4750  }
4751  }
4752 
4753  // attache face
4754  int nbfacegmsh=lstfacegmsh.size();
4755  for (int i=0;i<nbfacegmsh;i++)
4756  {
4757  MG_FACE* face=NULL;
4758  TPL_MAP_ENTITE<MG_ARETE*> lstaregmsh;
4759  lstfacegmsh[i].update();
4760  for (int j=0;j<lstfacegmsh[i].lstare.size();j++)
4761  lstaregmsh.ajouter(lstfacegmsh[i].lstare[j]);
4762  LISTE_MG_FACE::iterator it;
4763  for (MG_FACE *facetmp=geo->get_premier_face(it);facetmp!=NULL;facetmp=geo->get_suivant_face(it))
4764  {
4765  TPL_MAP_ENTITE<MG_ARETE*> lstaremagic;
4766  int nbbou=facetmp->get_nb_mg_boucle();
4767  for (int b=0;b<nbbou;b++)
4768  {
4769  MG_BOUCLE* bou=facetmp->get_mg_boucle(b);
4770  int nbare=bou->get_nb_mg_coarete();
4771  for (int a=0;a<nbare;a++)
4772  lstaremagic.ajouter(bou->get_mg_coarete(a)->get_arete());
4773  }
4774  if (lstaregmsh.get_nb()==lstaremagic.get_nb())
4775  {
4778  bool identique=true;
4779 
4780  MG_ARETE* are1=lstaregmsh.get_premier(it1);
4781  MG_ARETE* are2=lstaremagic.get_premier(it2);
4782  if (are1!=are2) identique=false;
4783  while ((identique==true) && (are1!=NULL))
4784  {
4785  are1=lstaregmsh.get_suivant(it1);
4786  are2=lstaremagic.get_suivant(it2);
4787  if (are1!=are2) identique=false;
4788 
4789  }
4790  if (identique==true) face=facetmp;
4791  }
4792 
4793  }
4794  bool sensidentiquetri=true;
4795  if (lstfacegmsh[i].lsttri.size()>0)
4796  {
4797  MG_TRIANGLE* tri=lstfacegmsh[i].lsttri[0];
4798  double *xyz1=tri->get_noeud1()->get_coord();
4799  double *xyz2=tri->get_noeud2()->get_coord();
4800  double *xyz3=tri->get_noeud3()->get_coord();
4801  OT_VECTEUR_3D vec12(xyz1,xyz2);
4802  OT_VECTEUR_3D vec13(xyz1,xyz3);
4803  double normal[3];
4804  double uv1[3];
4805  face->inverser(uv1,xyz1);
4806  face->calcul_normale_unitaire(uv1,normal);
4807  OT_VECTEUR_3D norgeo(normal);
4808  OT_VECTEUR_3D nor=vec13 & vec12;
4809  nor.norme();
4810  if ((nor*norgeo)<0.) sensidentiquetri=false;
4811  }
4812  bool sensidentiquequa=true;
4813  if (lstfacegmsh[i].lstquad.size()>0)
4814  {
4815  MG_QUADRANGLE* quad=lstfacegmsh[i].lstquad[0];
4816  double *xyz1=quad->get_noeud1()->get_coord();
4817  double *xyz2=quad->get_noeud2()->get_coord();
4818  double *xyz3=quad->get_noeud3()->get_coord();
4819  OT_VECTEUR_3D vec12(xyz1,xyz2);
4820  OT_VECTEUR_3D vec13(xyz1,xyz3);
4821  double normal[3];
4822  double uv1[3];
4823  face->inverser(uv1,xyz1);
4824  face->calcul_normale_unitaire(uv1,normal);
4825  OT_VECTEUR_3D norgeo(normal);
4826  OT_VECTEUR_3D nor=vec13 & vec12;
4827  nor.norme();
4828  if ((nor*norgeo)<0.) sensidentiquequa=false;
4829  }
4830  int nbtri=lstfacegmsh[i].lsttri.size();
4831  for (int j=0;j<nbtri;j++)
4832  {
4833  MG_TRIANGLE* tri=lstfacegmsh[i].lsttri[j];
4834  tri->change_lien_topologie(face);
4835  if (tri->get_noeud1()->get_lien_topologie()==NULL) tri->get_noeud1()->change_lien_topologie(face);
4836  if (tri->get_noeud2()->get_lien_topologie()==NULL) tri->get_noeud2()->change_lien_topologie(face);
4837  if (tri->get_noeud3()->get_lien_topologie()==NULL) tri->get_noeud3()->change_lien_topologie(face);
4838  if (sensidentiquetri==false) tri->inverse_sens();
4839  }
4840  int nbqua=lstfacegmsh[i].lstquad.size();
4841  for (int j=0;j<nbqua;j++)
4842  {
4843  MG_QUADRANGLE* qua=lstfacegmsh[i].lstquad[j];
4844  qua->change_lien_topologie(face);
4845  if (qua->get_noeud1()->get_lien_topologie()==NULL) qua->get_noeud1()->change_lien_topologie(face);
4846  if (qua->get_noeud2()->get_lien_topologie()==NULL) qua->get_noeud2()->change_lien_topologie(face);
4847  if (qua->get_noeud3()->get_lien_topologie()==NULL) qua->get_noeud3()->change_lien_topologie(face);
4848  if (qua->get_noeud4()->get_lien_topologie()==NULL) qua->get_noeud4()->change_lien_topologie(face);
4849  if (sensidentiquequa==false) qua->inverse_sens();
4850  }
4851  }
4852  // attache volume
4853  int nbvolumegmsh=lstvolumegmsh.size();
4854  for (int i=0;i<nbvolumegmsh;i++)
4855  {
4856  MG_VOLUME* vol=NULL;
4857  TPL_MAP_ENTITE<MG_FACE*> lstfacegmsh;
4858  lstvolumegmsh[i].update();
4859  for (int j=0;j<lstvolumegmsh[i].lstface.size();j++)
4860  lstfacegmsh.ajouter(lstvolumegmsh[i].lstface[j]);
4861  LISTE_MG_VOLUME::iterator it;
4862  for (MG_VOLUME *voltmp=geo->get_premier_volume(it);voltmp!=NULL;voltmp=geo->get_suivant_volume(it))
4863  {
4864  TPL_MAP_ENTITE<MG_FACE*> lstfacemagic;
4865  int nbcoq=voltmp->get_nb_mg_coquille();
4866  for (int c=0;c<nbcoq;c++)
4867  {
4868  MG_COQUILLE* coq=voltmp->get_mg_coquille(c);
4869  int nbface=coq->get_nb_mg_coface();
4870  for (int f=0;f<nbface;f++)
4871  lstfacemagic.ajouter(coq->get_mg_coface(f)->get_face());
4872  }
4873  if (lstfacegmsh.get_nb()==lstfacemagic.get_nb())
4874  {
4877  bool identique=true;
4878 
4879  MG_FACE* face1=lstfacegmsh.get_premier(it1);
4880  MG_FACE* face2=lstfacemagic.get_premier(it2);
4881  if (face1!=face2) identique=false;
4882  while ((identique==true) && (face1!=NULL))
4883  {
4884  face1=lstfacegmsh.get_suivant(it1);
4885  face2=lstfacemagic.get_suivant(it2);
4886  if (face1!=face2) identique=false;
4887 
4888  }
4889  if (identique==true) vol=voltmp;
4890  }
4891 
4892  }
4893  bool sensidentiquetet=true;
4894  if (lstvolumegmsh[i].lsttet.size()>0)
4895  {
4896  MG_TETRA* tet=lstvolumegmsh[i].lsttet[0];
4897  OT_VECTEUR_3D vec1(tet->get_noeud1()->get_coord(),tet->get_noeud2()->get_coord());
4898  OT_VECTEUR_3D vec2(tet->get_noeud1()->get_coord(),tet->get_noeud3()->get_coord());
4899  OT_VECTEUR_3D vec3(tet->get_noeud1()->get_coord(),tet->get_noeud4()->get_coord());
4900  OT_VECTEUR_3D pvec=vec1&vec2;
4901  double psca=pvec*vec3;
4902  if (psca<0.) sensidentiquetet=false;
4903  }
4904  bool sensidentiquehex=true;
4905  if (lstvolumegmsh[i].lsthex.size()>0)
4906  {
4907  MG_HEXA* hex=lstvolumegmsh[i].lsthex[0];
4908  OT_VECTEUR_3D vec1(hex->get_noeud1()->get_coord(),hex->get_noeud2()->get_coord());
4909  OT_VECTEUR_3D vec2(hex->get_noeud1()->get_coord(),hex->get_noeud4()->get_coord());
4910  OT_VECTEUR_3D vec3(hex->get_noeud1()->get_coord(),hex->get_noeud5()->get_coord());
4911  OT_VECTEUR_3D pvec=vec1&vec2;
4912  double psca=pvec*vec3;
4913  if (psca<0.) sensidentiquehex=false;
4914  }
4915  int nbtet=lstvolumegmsh[i].lsttet.size();
4916  for (int j=0;j<nbtet;j++)
4917  {
4918  MG_TETRA* tet=lstvolumegmsh[i].lsttet[j];
4919  tet->change_lien_topologie(vol);
4920  if (tet->get_noeud1()->get_lien_topologie()==NULL) tet->get_noeud1()->change_lien_topologie(vol);
4921  if (tet->get_noeud2()->get_lien_topologie()==NULL) tet->get_noeud2()->change_lien_topologie(vol);
4922  if (tet->get_noeud3()->get_lien_topologie()==NULL) tet->get_noeud3()->change_lien_topologie(vol);
4923  if (tet->get_noeud4()->get_lien_topologie()==NULL) tet->get_noeud4()->change_lien_topologie(vol);
4924  if (sensidentiquetet==false) tet->inverse_sens();
4925  }
4926  int nbhex=lstvolumegmsh[i].lsthex.size();
4927  for (int j=0;j<nbhex;j++)
4928  {
4929  MG_HEXA* hex=lstvolumegmsh[i].lsthex[j];
4930  hex->change_lien_topologie(vol);
4931  if (hex->get_noeud1()->get_lien_topologie()==NULL) hex->get_noeud1()->change_lien_topologie(vol);
4932  if (hex->get_noeud2()->get_lien_topologie()==NULL) hex->get_noeud2()->change_lien_topologie(vol);
4933  if (hex->get_noeud3()->get_lien_topologie()==NULL) hex->get_noeud3()->change_lien_topologie(vol);
4934  if (hex->get_noeud4()->get_lien_topologie()==NULL) hex->get_noeud4()->change_lien_topologie(vol);
4935  if (hex->get_noeud5()->get_lien_topologie()==NULL) hex->get_noeud5()->change_lien_topologie(vol);
4936  if (hex->get_noeud6()->get_lien_topologie()==NULL) hex->get_noeud6()->change_lien_topologie(vol);
4937  if (hex->get_noeud7()->get_lien_topologie()==NULL) hex->get_noeud7()->change_lien_topologie(vol);
4938  if (hex->get_noeud8()->get_lien_topologie()==NULL) hex->get_noeud8()->change_lien_topologie(vol);
4939  if (sensidentiquehex==false) hex->inverse_sens();
4940  }
4941  }
4942 
4943  }
4944  }
4945 }
GMSH_VOLUME::lsthex
std::vector< MG_HEXA * > lsthex
Definition: mg_import.cpp:125
MG_GEOMETRIE::get_valeur_precision
double get_valeur_precision(void)
Definition: mg_geometrie.cpp:2642
CODE_ASTER_CPU
double CODE_ASTER_CPU
Definition: ot_cpu.cpp:26
MG_HEXA::get_quadrangle1
virtual MG_QUADRANGLE * get_quadrangle1(void)
Definition: mg_hexa.cpp:235
MG_MAILLAGE::ajouter_mg_tetra
MG_TETRA * ajouter_mg_tetra(MG_ELEMENT_TOPOLOGIQUE *topo, class MG_NOEUD *mgnoeud1, class MG_NOEUD *mgnoeud2, class MG_NOEUD *mgnoeud3, class MG_NOEUD *mgnoeud4, int origine, unsigned long num=0)
Definition: mg_maillage.cpp:1158
TPL_MAP_ENTITE::get_premier
virtual X get_premier(ITERATEUR &it)
Definition: tpl_map_entite.h:112
MG_HEXA::get_noeud4
virtual MG_NOEUD * get_noeud4(void)
Definition: mg_hexa.cpp:214
MG_TRIANGLE::get_segment1
virtual MG_SEGMENT * get_segment1(void)
Definition: mg_triangle.cpp:142
FEM_SOLUTION
Definition: fem_solution.h:40
MG_SEGMENT
Definition: mg_segment.h:38
MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT2
@ ENTITE_ELEMENT2
Definition: mg_definition.h:86
FEM_MAILLAGE::get_suivant_element3
FEM_ELEMENT3 * get_suivant_element3(LISTE_FEM_ELEMENT3::iterator &it)
Definition: fem_maillage.cpp:680
MG_IMPORT::change_repere_tenseur
void change_repere_tenseur(class FEM_ELEMENT2 *tri, double *tensglobal, double *tenslocal)
Definition: mg_import.cpp:4396
MG_HEXA::get_quadrangle5
virtual MG_QUADRANGLE * get_quadrangle5(void)
Definition: mg_hexa.cpp:255
MG_TETRA::get_noeud2
virtual MG_NOEUD * get_noeud2(void)
Definition: mg_tetra.cpp:148
MG_IMPORT::import_contrainte_max_poutre
void import_contrainte_max_poutre(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport)
Definition: mg_import.cpp:3691
MG_BOUCLE
Definition: mg_boucle.h:35
gestionversion.h
MG_BOUCLE::get_nb_mg_coarete
virtual int get_nb_mg_coarete(void)
Definition: mg_boucle.cpp:78
MG_IMPORT::import_flux_gauss
void import_flux_gauss(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport, int pas=0)
Definition: mg_import.cpp:4218
MG_MAILLAGE::ajouter_mg_segment
MG_SEGMENT * ajouter_mg_segment(MG_ELEMENT_TOPOLOGIQUE *topo, class MG_NOEUD *mgnoeud1, class MG_NOEUD *mgnoeud2, int origine, double longue=0.0, unsigned long num=0)
Definition: mg_maillage.cpp:565
MG_IMPORT::import_contrainteequi_noeud
void import_contrainteequi_noeud(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport, int pas=0)
Definition: mg_import.cpp:3313
MG_IMPORT::import_contrainte
void import_contrainte(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport, int pas=0)
Definition: mg_import.cpp:1808
TPL_MAP_ENTITE
Definition: tpl_map_entite.h:35
MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENTND
@ ENTITE_ELEMENTND
Definition: mg_definition.h:86
FEM_MAILLAGE::calcul_deforme
void calcul_deforme(class FEM_SOLUTION *solx, int numx, class FEM_SOLUTION *soly, int numy, class FEM_SOLUTION *solz, int numz)
Definition: fem_maillage.cpp:1689
MG_GEOMETRIE::get_suivant_volume
MG_VOLUME * get_suivant_volume(LISTE_MG_VOLUME::iterator &it)
Definition: mg_geometrie.cpp:1702
fem_solution.h
mg_gestionnaire.h
GMSH_ARETE::lstsom
std::vector< MG_SOMMET * > lstsom
Definition: mg_import.cpp:36
MG_SEGMENT::get_noeud2
virtual MG_NOEUD * get_noeud2(void)
Definition: mg_segment.cpp:113
MG_IMPORT::import_contrainteequi2_noeud
void import_contrainteequi2_noeud(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport, int pas=0)
Definition: mg_import.cpp:3404
MG_IMPORT::import_deformation_gauss
void import_deformation_gauss(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport, int pas=0)
Definition: mg_import.cpp:2163
MG_QUADRANGLE::get_segment1
virtual MG_SEGMENT * get_segment1(void)
Definition: mg_quadrangle.cpp:166
MAGIC::TYPE_SOLUTION::VECTEUR
@ VECTEUR
Definition: mg_definition.h:93
GMSH_VOLUME
Definition: mg_import.cpp:121
MG_TETRA::get_noeud1
virtual MG_NOEUD * get_noeud1(void)
Definition: mg_tetra.cpp:143
MG_IMPORT::import_densite
void import_densite(int base, FEM_MAILLAGE *mai, char *chaine, char *nomfichier, int codeimport)
Definition: mg_import.cpp:1752
MG_IMPORT::import_deplacement
void import_deplacement(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport, int pas=0)
Definition: mg_import.cpp:1523
FEM_SOLUTION::ecrire
void ecrire(double val, int i, int j, int coord=0, int num_no=0)
Definition: fem_solution.cpp:411
fem_maillage.h
a
#define a(i, j)
MG_IMPORT::import_effort
void import_effort(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport)
Definition: mg_import.cpp:3926
MG_QUADRANGLE::get_segment3
virtual MG_SEGMENT * get_segment3(void)
Definition: mg_quadrangle.cpp:176
MG_QUADRANGLE::get_noeud2
virtual MG_NOEUD * get_noeud2(void)
Definition: mg_quadrangle.cpp:150
MG_GEOMETRIE::get_premier_face
MG_FACE * get_premier_face(LISTE_MG_FACE::iterator &it)
Definition: mg_geometrie.cpp:1338
MG_TRIANGLE::get_segment2
virtual MG_SEGMENT * get_segment2(void)
Definition: mg_triangle.cpp:147
MG_COFACE::get_face
virtual MG_FACE * get_face(void)
Definition: mg_coface.cpp:58
MG_IMPORT::MG_IMPORT
MG_IMPORT()
Definition: mg_import.cpp:211
FEM_ELEMENT3
Definition: fem_element3.h:34
FEM_MAILLAGE::get_premier_noeud
FEM_NOEUD * get_premier_noeud(LISTE_FEM_NOEUD::iterator &it)
Definition: fem_maillage.cpp:174
GMSH_FACE::ajouter
void ajouter(MG_QUADRANGLE *qua)
Definition: mg_import.cpp:103
FEM_MAILLAGE::get_mg_geometrie
MG_GEOMETRIE * get_mg_geometrie(void)
Definition: fem_maillage.cpp:88
GMSH_FACE::lstare
std::vector< MG_ARETE * > lstare
Definition: mg_import.cpp:54
FEM_MAILLAGE::active_reaction
void active_reaction(void)
Definition: fem_maillage.cpp:1731
MG_ELEMENT_TOPOLOGIQUE::get_dimension
virtual int get_dimension(void)=0
MG_ELEMENT_MAILLAGE::change_lien_topologie
void change_lien_topologie(MG_ELEMENT_TOPOLOGIQUE *topo)
Definition: mg_element_maillage.cpp:56
MG_TRIANGLE
Definition: mg_triangle.h:38
MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT3_GAUSS
@ ENTITE_ELEMENT3_GAUSS
Definition: mg_definition.h:86
MG_VOLUME
Definition: mg_volume.h:33
MG_COQUILLE
Definition: mg_coquille.h:34
MG_IMPORT::import_contrainteequi
void import_contrainteequi(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport, int pas=0)
Definition: mg_import.cpp:2792
MG_GESTIONNAIRE
Definition: mg_gestionnaire.h:57
OT_VECTEUR_3D::get_x
virtual double get_x(void) const
Definition: ot_mathematique.cpp:417
MG_TRIANGLE::get_segment3
virtual MG_SEGMENT * get_segment3(void)
Definition: mg_triangle.cpp:152
OT_MATRICE_3D::transpose
void transpose(OT_MATRICE_3D &res) const
Definition: ot_mathematique.cpp:750
MG_GESTIONNAIRE::ajouter_fem_solution
int ajouter_fem_solution(FEM_SOLUTION *mgsol)
Definition: mg_gestionnaire.cpp:902
MG_IMPORT::import_contrainte_noeud
void import_contrainte_noeud(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport, int pas=0)
Definition: mg_import.cpp:2365
MG_TETRA
Definition: mg_tetra.h:37
MG_HEXA
Definition: mg_hexa.h:37
MG_HEXA::inverse_sens
virtual void inverse_sens(void)
Definition: mg_hexa.cpp:265
FEM_ELEMENT2
Definition: fem_element2.h:34
FEM_MAILLAGE::get_mg_maillage
MG_MAILLAGE * get_mg_maillage(void)
Definition: fem_maillage.cpp:93
FEM_MAILLAGE::get_nb_fem_noeud
unsigned int get_nb_fem_noeud(void)
Definition: fem_maillage.cpp:190
MG_HEXA::get_noeud5
virtual MG_NOEUD * get_noeud5(void)
Definition: mg_hexa.cpp:218
MG_QUADRANGLE
Definition: mg_quadrangle.h:39
MG_GESTIONNAIRE::get_fem_solution
FEM_SOLUTION * get_fem_solution(unsigned int num)
Definition: mg_gestionnaire.cpp:930
MG_HEXA::get_noeud8
virtual MG_NOEUD * get_noeud8(void)
Definition: mg_hexa.cpp:230
MG_HEXA::get_noeud3
virtual MG_NOEUD * get_noeud3(void)
Definition: mg_hexa.cpp:209
FEM_MAILLAGE::get_premier_element2
FEM_ELEMENT2 * get_premier_element2(LISTE_FEM_ELEMENT2::iterator &it)
Definition: fem_maillage.cpp:561
GMSH_VOLUME::ajouter
void ajouter(MG_TETRA *tet)
Definition: mg_import.cpp:170
MG_FACE::inverser
virtual void inverser(double *uv, double *xyz, double precision=1e-6)
Definition: mg_face.cpp:228
MG_ARETE::inverser
virtual void inverser(double &t, double *xyz, double precision=1e-6)
Definition: mg_arete.cpp:173
MG_GEOMETRIE::get_suivant_sommet
MG_SOMMET * get_suivant_sommet(LISTE_MG_SOMMET::iterator &it)
Definition: mg_geometrie.cpp:632
GMSH_ARETE::lstseg
std::vector< MG_SEGMENT * > lstseg
Definition: mg_import.cpp:35
MG_GEOMETRIE::get_nb_mg_poutre
unsigned int get_nb_mg_poutre(void)
Definition: mg_geometrie.cpp:1974
MG_IMPORT::import_flux_noeud
void import_flux_noeud(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport, int pas=0)
Definition: mg_import.cpp:4117
GMSH_FACE::ajouter
void ajouter(MG_TRIANGLE *tri)
Definition: mg_import.cpp:90
FEM_NOEUD::change_rx
virtual void change_rx(double xx)
Definition: fem_noeud.cpp:283
MG_GESTIONNAIRE::ajouter_mg_maillage
int ajouter_mg_maillage(MG_MAILLAGE *mgmai)
Definition: mg_gestionnaire.cpp:521
MG_HEXA::get_quadrangle4
virtual MG_QUADRANGLE * get_quadrangle4(void)
Definition: mg_hexa.cpp:250
FEM_NOEUD::get_coord
virtual double * get_coord(void)
Definition: fem_noeud.cpp:254
MG_IMPORT::import_deformation_noeud
void import_deformation_noeud(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport, int pas=0)
Definition: mg_import.cpp:2654
FEM_MAILLAGE::get_suivant_element1
FEM_ELEMENT1 * get_suivant_element1(LISTE_FEM_ELEMENT1::iterator &it)
Definition: fem_maillage.cpp:457
MAGIC::ORIGINE::OPTIMISE
@ OPTIMISE
Definition: mg_definition.h:79
FEM_NOEUD::change_ry
virtual void change_ry(double yy)
Definition: fem_noeud.cpp:289
f
double f(double x, long nb, double *xfonc, double *fonc, double eng, double eni, double lambda, double nor, double *fonc2)
Definition: fct_generateur_calibrage.cpp:96
MG_MAILLAGE::ajouter_mg_hexa
MG_HEXA * ajouter_mg_hexa(MG_ELEMENT_TOPOLOGIQUE *topo, class MG_NOEUD *mgnoeud1, class MG_NOEUD *mgnoeud2, class MG_NOEUD *mgnoeud3, class MG_NOEUD *mgnoeud4, class MG_NOEUD *mgnoeud5, class MG_NOEUD *mgnoeud6, class MG_NOEUD *mgnoeud7, class MG_NOEUD *mgnoeud8, int origine, unsigned long num=0)
Definition: mg_maillage.cpp:1390
MG_HEXA::get_quadrangle6
virtual MG_QUADRANGLE * get_quadrangle6(void)
Definition: mg_hexa.cpp:260
MG_IMPORT::aster
std::string aster(int base, class FEM_MAILLAGE *mai, char *chaine, char *nomfichier)
Definition: mg_import.cpp:395
MG_IMPORT::ot
OT_CHAINE ot
Definition: mg_import.h:67
MAGIC::ORIGINE::GMSH
@ GMSH
Definition: mg_definition.h:79
MG_QUADRANGLE::inverse_sens
virtual void inverse_sens(void)
Definition: mg_quadrangle.cpp:186
MG_HEXA::get_noeud2
virtual MG_NOEUD * get_noeud2(void)
Definition: mg_hexa.cpp:204
GMSH_VOLUME::ajouter
void ajouter(MG_HEXA *hex)
Definition: mg_import.cpp:186
MG_MAILLAGE::ajouter_mg_triangle
MG_TRIANGLE * ajouter_mg_triangle(MG_ELEMENT_TOPOLOGIQUE *topo, class MG_NOEUD *mgnoeud1, class MG_NOEUD *mgnoeud2, class MG_NOEUD *mgnoeud3, int origine, unsigned long num=0)
Definition: mg_maillage.cpp:731
MG_SEGMENT::get_noeud1
virtual MG_NOEUD * get_noeud1(void)
Definition: mg_segment.cpp:108
FEM_MAILLAGE
Definition: fem_maillage.h:66
MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT2_GAUSS
@ ENTITE_ELEMENT2_GAUSS
Definition: mg_definition.h:86
TPL_MAP_ENTITE::get_nb
virtual int get_nb(void)
Definition: tpl_map_entite.h:83
MG_NOEUD
Definition: mg_noeud.h:41
OT_MATRICE_3D
Definition: ot_mathematique.h:160
FEM_NOEUD::change_rz
virtual void change_rz(double zz)
Definition: fem_noeud.cpp:295
GMSH_FACE::lsttri
std::vector< MG_TRIANGLE * > lsttri
Definition: mg_import.cpp:52
MAGIC::ORIGINE::IMPOSE
@ IMPOSE
Definition: mg_definition.h:79
FEM_MAILLAGE::get_nb_fem_element2
unsigned int get_nb_fem_element2(void)
Definition: fem_maillage.cpp:494
FEM_ELEMENT1
Definition: fem_element1.h:34
TPL_LISTE_ENTITE::ajouter
virtual void ajouter(X x)
Definition: tpl_liste_entite.h:38
MG_NOEUD::get_coord
virtual double * get_coord(void)
Definition: mg_noeud.cpp:92
GMSH_VOLUME::lsttet
std::vector< MG_TETRA * > lsttet
Definition: mg_import.cpp:124
TPL_MAP_ENTITE::ITERATEUR
std::map< unsigned long, X, std::less< unsigned long > >::iterator ITERATEUR
Definition: tpl_map_entite.h:38
MG_TETRA::get_triangle1
virtual MG_TRIANGLE * get_triangle1(void)
Definition: mg_tetra.cpp:163
FEM_SOLUTION::change_nb_gauss
void change_nb_gauss(int i, int num)
Definition: fem_solution.cpp:423
MG_SEGMENT::inverse_sens
virtual void inverse_sens(void)
Definition: mg_segment.cpp:118
FEM_MAILLAGE::get_nb_fem_element3
unsigned int get_nb_fem_element3(void)
Definition: fem_maillage.cpp:605
MG_ELEMENT_MAILLAGE::change_origine
virtual void change_origine(int)
Definition: mg_element_maillage.cpp:86
MG_HEXA::get_noeud6
virtual MG_NOEUD * get_noeud6(void)
Definition: mg_hexa.cpp:222
OT_VECTEUR_3D::norme
virtual void norme(void)
Definition: ot_mathematique.cpp:494
FEM_MAILLAGE::get_suivant_element2
FEM_ELEMENT2 * get_suivant_element2(LISTE_FEM_ELEMENT2::iterator &it)
Definition: fem_maillage.cpp:569
FEM_SOLUTION::lire
double lire(int i, int j, int coord=0, int num_no=0)
Definition: fem_solution.cpp:398
MG_TRIANGLE::get_noeud2
virtual MG_NOEUD * get_noeud2(void)
Definition: mg_triangle.cpp:131
MG_GEOMETRIE::get_premier_sommet
MG_SOMMET * get_premier_sommet(LISTE_MG_SOMMET::iterator &it)
Definition: mg_geometrie.cpp:624
TPL_LISTE_ENTITE::get
virtual X get(int num)
Definition: tpl_liste_entite.h:72
MG_TETRA::get_triangle2
virtual MG_TRIANGLE * get_triangle2(void)
Definition: mg_tetra.cpp:168
mg_import.h
FEM_MAILLAGE::get_premier_element1
FEM_ELEMENT1 * get_premier_element1(LISTE_FEM_ELEMENT1::iterator &it)
Definition: fem_maillage.cpp:449
FEM_NOEUD
Definition: fem_noeud.h:35
GMSH_FACE
Definition: mg_import.cpp:49
OT_VECTEUR_3D::get_y
virtual double get_y(void) const
Definition: ot_mathematique.cpp:423
MG_GEOMETRIE::get_premier_arete
MG_ARETE * get_premier_arete(LISTE_MG_ARETE::iterator &it)
Definition: mg_geometrie.cpp:907
OT_VECTEUR_3D
Definition: ot_mathematique.h:94
TPL_MAP_ENTITE::ajouter
virtual void ajouter(X x)
Definition: tpl_map_entite.h:55
MG_GEOMETRIE::get_nb_mg_volume
unsigned int get_nb_mg_volume(void)
Definition: mg_geometrie.cpp:1712
MG_HEXA::get_quadrangle2
virtual MG_QUADRANGLE * get_quadrangle2(void)
Definition: mg_hexa.cpp:240
MG_TRIANGLE::get_noeud1
virtual MG_NOEUD * get_noeud1(void)
Definition: mg_triangle.cpp:126
mg_maillage.h
MG_BOUCLE::get_mg_coarete
virtual MG_COARETE * get_mg_coarete(int num)
Definition: mg_boucle.cpp:84
GMSH_ARETE::ajouter
void ajouter(MG_SEGMENT *seg)
Definition: mg_import.cpp:37
MG_TETRA::get_noeud4
virtual MG_NOEUD * get_noeud4(void)
Definition: mg_tetra.cpp:158
MG_TETRA::inverse_sens
virtual void inverse_sens(void)
Definition: mg_tetra.cpp:183
MG_FACE::calcul_normale_unitaire
virtual void calcul_normale_unitaire(double *uv, double *normale)
Definition: mg_face.cpp:248
MG_MAILLAGE::get_gestionnaire
MG_GESTIONNAIRE * get_gestionnaire(void)
Definition: mg_maillage.cpp:2658
GMSH_VOLUME::update
void update(void)
Definition: mg_import.cpp:127
FEM_ELEMENT2::get_fem_noeud
virtual class FEM_NOEUD * get_fem_noeud(int num)=0
MG_IMPORT::import_contrainte_poutre
void import_contrainte_poutre(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport)
Definition: mg_import.cpp:3799
MG_ELEMENT_MAILLAGE::get_lien_topologie
MG_ELEMENT_TOPOLOGIQUE * get_lien_topologie(void)
Definition: mg_element_maillage.cpp:51
FEM_SOLUTION::get_nb_gauss
int get_nb_gauss(int i)
Definition: fem_solution.cpp:443
MG_TRIANGLE::get_noeud3
virtual MG_NOEUD * get_noeud3(void)
Definition: mg_triangle.cpp:137
MG_IMPORT::import_energie
void import_energie(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport)
Definition: mg_import.cpp:1661
MG_TETRA::get_noeud3
virtual MG_NOEUD * get_noeud3(void)
Definition: mg_tetra.cpp:153
MG_GEOMETRIE::get_premier_volume
MG_VOLUME * get_premier_volume(LISTE_MG_VOLUME::iterator &it)
Definition: mg_geometrie.cpp:1694
OT_VECTEUR_3D::get_z
virtual double get_z(void) const
Definition: ot_mathematique.cpp:429
MG_TRIANGLE::inverse_sens
virtual void inverse_sens(void)
Definition: mg_triangle.cpp:157
MG_IMPORT::import_contrainteequi2
void import_contrainteequi2(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport, int pas=0)
Definition: mg_import.cpp:2910
MG_IMPORT::import_deformation
void import_deformation(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport, int pas=0)
Definition: mg_import.cpp:2500
MG_GEOMETRIE
Definition: mg_geometrie.h:84
OT_VECTEUR_3D::get_longueur
virtual double get_longueur(void) const
Definition: ot_mathematique.cpp:483
MG_MAILLAGE
Definition: mg_maillage.h:62
FEM_MAILLAGE::get_suivant_noeud
FEM_NOEUD * get_suivant_noeud(LISTE_FEM_NOEUD::iterator &it)
Definition: fem_maillage.cpp:182
TPL_LISTE_ENTITE< MG_NOEUD * >
MG_QUADRANGLE::get_segment4
virtual MG_SEGMENT * get_segment4(void)
Definition: mg_quadrangle.cpp:181
MG_QUADRANGLE::get_noeud4
virtual MG_NOEUD * get_noeud4(void)
Definition: mg_quadrangle.cpp:161
MG_IMPORT::import_reaction
void import_reaction(int base, FEM_MAILLAGE *mai, FILE *in, int pas=0)
Definition: mg_import.cpp:1628
MG_QUADRANGLE::get_noeud3
virtual MG_NOEUD * get_noeud3(void)
Definition: mg_quadrangle.cpp:156
MG_IMPORT::import_temperature
void import_temperature(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport, int pas=0)
Definition: mg_import.cpp:4057
MG_COQUILLE::get_nb_mg_coface
virtual int get_nb_mg_coface(void)
Definition: mg_coquille.cpp:76
MG_COQUILLE::get_mg_coface
virtual MG_COFACE * get_mg_coface(int num)
Definition: mg_coquille.cpp:90
MG_HEXA::get_noeud7
virtual MG_NOEUD * get_noeud7(void)
Definition: mg_hexa.cpp:226
MG_HEXA::get_noeud1
virtual MG_NOEUD * get_noeud1(void)
Definition: mg_hexa.cpp:199
res
#define res(i, j)
MG_IMPORT::optis
void optis(FEM_MAILLAGE *mai, char *nomfichier, char *nomfichier2, double seuil=0.8, double niveau=150., int flottant=1)
Definition: mg_import.cpp:219
MG_TETRA::get_triangle4
virtual MG_TRIANGLE * get_triangle4(void)
Definition: mg_tetra.cpp:178
CODE_ASTER_ECOULE
double CODE_ASTER_ECOULE
Definition: ot_cpu.cpp:27
MG_IMPORT::import_contrainteequi2_gauss
void import_contrainteequi2_gauss(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport, int pas=0)
Definition: mg_import.cpp:3093
MG_IMPORT::import_erreur
void import_erreur(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport)
Definition: mg_import.cpp:3588
MG_ARETE::deriver
virtual void deriver(double t, double *xyz)
Definition: mg_arete.cpp:149
MG_ARETE
Definition: mg_arete.h:36
MG_FACE
Definition: mg_face.h:34
MG_QUADRANGLE::get_noeud1
virtual MG_NOEUD * get_noeud1(void)
Definition: mg_quadrangle.cpp:145
MG_ELEMENT_MAILLAGE::get_origine
virtual int get_origine(void)
Definition: mg_element_maillage.cpp:91
GMSH_VOLUME::lstface
std::vector< MG_FACE * > lstface
Definition: mg_import.cpp:126
OT_CHAINE::atoi
unsigned long atoi(std::string val, int base)
Definition: ot_chaine.cpp:178
TPL_MAP_ENTITE::get_suivant
virtual X get_suivant(ITERATEUR &it)
Definition: tpl_map_entite.h:120
MG_QUADRANGLE::get_segment2
virtual MG_SEGMENT * get_segment2(void)
Definition: mg_quadrangle.cpp:171
MG_SOMMET
Definition: mg_sommet.h:35
MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT3
@ ENTITE_ELEMENT3
Definition: mg_definition.h:86
MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENTND_NOEUD
@ ENTITE_ELEMENTND_NOEUD
Definition: mg_definition.h:86
MG_GEOMETRIE::get_suivant_face
MG_FACE * get_suivant_face(LISTE_MG_FACE::iterator &it)
Definition: mg_geometrie.cpp:1346
MAGIC::ORIGINE::MAILLEUR_AUTO
@ MAILLEUR_AUTO
Definition: mg_definition.h:79
MG_COARETE::get_arete
virtual MG_ARETE * get_arete(void)
Definition: mg_coarete.cpp:58
GMSH_FACE::update
void update(void)
Definition: mg_import.cpp:55
FEM_SOLUTION::change_legende
void change_legende(int num, std::string val)
Definition: fem_solution.cpp:457
MG_HEXA::get_quadrangle3
virtual MG_QUADRANGLE * get_quadrangle3(void)
Definition: mg_hexa.cpp:245
MG_IMPORT::~MG_IMPORT
~MG_IMPORT()
Definition: mg_import.cpp:215
MG_MAILLAGE::ajouter_mg_quadrangle
MG_QUADRANGLE * ajouter_mg_quadrangle(MG_ELEMENT_TOPOLOGIQUE *topo, class MG_NOEUD *mgnoeud1, class MG_NOEUD *mgnoeud2, class MG_NOEUD *mgnoeud3, class MG_NOEUD *mgnoeud4, int origine, unsigned long num=0)
Definition: mg_maillage.cpp:930
GMSH_ARETE
Definition: mg_import.cpp:32
MG_TETRA::get_triangle3
virtual MG_TRIANGLE * get_triangle3(void)
Definition: mg_tetra.cpp:173
MG_GEOMETRIE::get_suivant_arete
MG_ARETE * get_suivant_arete(LISTE_MG_ARETE::iterator &it)
Definition: mg_geometrie.cpp:915
MG_IMPORT::maillage_gmsh
void maillage_gmsh(class MG_GESTIONNAIRE *gest, char *nomfichier, class MG_GEOMETRIE *geo=NULL)
Definition: mg_import.cpp:4443
GMSH_FACE::lstquad
std::vector< MG_QUADRANGLE * > lstquad
Definition: mg_import.cpp:53
MG_IMPORT::import_contrainte_gauss
void import_contrainte_gauss(int base, FEM_MAILLAGE *mai, FILE *in, char *nomfichier, int codeimport, int pas=0)
Definition: mg_import.cpp:1962
FEM_MAILLAGE::get_nb_fem_element1
unsigned int get_nb_fem_element1(void)
Definition: fem_maillage.cpp:382
FEM_MAILLAGE::get_premier_element3
FEM_ELEMENT3 * get_premier_element3(LISTE_FEM_ELEMENT3::iterator &it)
Definition: fem_maillage.cpp:672
MG_MAILLAGE::ajouter_mg_noeud
MG_NOEUD * ajouter_mg_noeud(MG_ELEMENT_TOPOLOGIQUE *topo, double xx, double yy, double zz, int origine, unsigned long num=0)
Definition: mg_maillage.cpp:421
MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD
@ ENTITE_NOEUD
Definition: mg_definition.h:86