MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
mstruct_generateur_polycristaux.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 //####// mstruct_generateur_polycristaux.cpp
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2025
19 //####// Derniere modification par francois
20 //####// mer 14 mai 2025 17:54:57 EDT
21 //####//------------------------------------------------------------
22 //####//------------------------------------------------------------
23  #include "gestionversion.h"
24  #include "mg_file.h"
26  #include "tpl_grille.h"
27  #ifdef PROJECT_POLYCRISTAUX
28  #include "polycristal.h"
29  #endif
30  #include "occ_import.h"
32  #include "mailleur0d.h"
33  #include "mailleur1d.h"
34  #include "mailleur2d.h"
35  #include "mailleur3d.h"
36  #include "mailleur_fem.h"
37  #include "mailleur_analyse.h"
38  #include "mg_export.h"
39  #include "mstruct_outils.h"
40  #include "mstruct_definition.h"
41  #include "mgaster.h"
42  #include "lc_point.h"
43  #include "mailleur_analyse.h"
44  #include <fstream>
45  #include <math.h>
46  #include <random>
47  #include "mstruct_borne.h"
48 #include <sys/stat.h>
49 #include <mutex>
50 
51 
53 {
54 public:
56 {
57 nbcristaux=-1;
58 degre=-1;
59 dg=-1;
60 KDH=-1.;
61 GDH=-1.;
62 EDH=-1.;
63 KCH=-1.;
64 GCH=-1.;
65 ECH=-1.;
66 nbphase=0;;
67 Evoigt=-1;
68 Ereuss=-1;
69 Kvoigt=-1;
70 Kreuss=-1;
71 Gvoigt=-1;
72 Greuss=-1;
73 nuvoigt=-1;
74 nureuss=-1;
75 }
76 
77 
78 
80 int degre;
81 double dg;
82 double KDH,GDH,EDH;
83 double KCH,GCH,ECH;
84 double tens1[9],tens2[9],tens3[9];
85 int nbphase;
86 std::vector<int> nbcristauxphase;
87 std::vector<double> masse;
88 std::vector<double> volume;
89 std::vector<OT_VECTEUR_3D> cdm;
91 };
92 
93 
94 
95 
96 
98  {
99  ini_param(NULL);
100  }
101 
102 
104  {
105  ini_param(nomparam);
106  }
107 
109  {
110  MG_FILE gest(fichierin);
111  MG_GEOMETRIE *mggeo=gest.get_mg_geometrie(0);
112  FILE *out=fopen(fichierout,"wt");
113  LISTE_MG_POINT::iterator it;
114  for (MG_POINT* pt=mggeo->get_premier_point(it);pt!=NULL;pt=mggeo->get_suivant_point(it))
115  if (pt->get_type()==MG_ELEMENT_GEOMETRIQUE::TYPE_ELEMENT_GEOMETRIQUE::LC_POINT)
116  {
117  double xyz[3];
118  pt->evaluer(xyz);
119  fprintf(out,"%e %e %e\n",xyz[0],xyz[1],xyz[2]);
120  }
121  fclose(out);
122  }
123 
124 
126  {
127 
128  }
129 
131  {
132 
133  }
134 
136  {
137  affiche2=fonc;
138  affichageactif=1;
139  }
140 
142  {
143  if (affichageactif==1) affiche2(mess);
144  }
145 
147  {
148  param.ajouter("nommateriau","Cuivre",OT_PARAMETRES::STRING,"nom du matériaux");
149  //param.ajouter("bornereuss",109e9,OT_PARAMETRES::DOUBLE,"Valeur de la borne de Reuss en Pa");
150  //param.ajouter("bornevoigt",143e9,OT_PARAMETRES::DOUBLE,"Valeur de la borne de Voigt en Pa");
151  param.ajouter("boitexmin",0,OT_PARAMETRES::DOUBLE,"valeur x min de l'échantillon");
152  param.ajouter("boiteymin",0,OT_PARAMETRES::DOUBLE,"valeur y min de l'échantillon");
153  param.ajouter("boitezmin",0,OT_PARAMETRES::DOUBLE,"valeur z min de l'échantillon");
154  param.ajouter("boitexmax",1,OT_PARAMETRES::DOUBLE,"valeur x max de l'échantillon");
155  param.ajouter("boiteymax",1,OT_PARAMETRES::DOUBLE,"valeur y max de l'échantillon");
156  param.ajouter("boitezmax",1,OT_PARAMETRES::DOUBLE,"valeur z max de l'échantillon");
157  param.ajouter("nb_cristaux",100,OT_PARAMETRES::DOUBLE,"Nombre de cristaux à tirer aléatoirement");
158  param.ajouter("rayon",0.05,OT_PARAMETRES::DOUBLE,"Distance séparant deux points tirés aléatoirement en % de la longueur totale");
159  param.ajouter("nomfichier","nomcao",OT_PARAMETRES::STRING,"Nom du fichier de l'étude sans extension");
160  param.ajouter("enregistrementstep",0.,OT_PARAMETRES::DOUBLE,"0. pas de fichier step 1. avec fichier step");
161  param.ajouter("epsfusion",1e-6,OT_PARAMETRES::DOUBLE,"epsilon de la fusion des noeuds des Voronoi");
162  param.ajouter("dg",0.1,OT_PARAMETRES::DOUBLE,"ecart nodale pour la carte de taille");
163  param.ajouter("gradient",0.25,OT_PARAMETRES::DOUBLE,"gradient max visé pour la carte de taille");
164  param.ajouter("bornemin_carte",0.1,OT_PARAMETRES::DOUBLE,"Borne minimal de l'écart nodal");
165  param.ajouter("type_bornemin",1,OT_PARAMETRES::DOUBLE,"0. borne min absolue 1. borne min relative");
166  param.ajouter("Nbphase",2.0,OT_PARAMETRES::DOUBLE,"Nombre de phase du polycristal");
167  std::vector<double> lstphase;
168  lstphase.push_back(0.68);
169  lstphase.push_back(0.32);
170  param.ajouter("Proportionphase",lstphase,OT_PARAMETRES::DOUBLE,"Proportion de chacune des phases en masse");
171  std::vector<double> lstdens;
172  lstdens.push_back(5.);
173  lstdens.push_back(12.);
174  param.ajouter("Densite",lstdens,OT_PARAMETRES::DOUBLE,"Densité de chacune des phases");
175  std::vector<double> lst1,lst2,lst3;
176  lst1.push_back(66.69e9);
177  lst1.push_back(120.1e9);
178  lst2.push_back(0.4189);
179  lst2.push_back(0.3);
180  lst3.push_back(75.4e9);
181  lst3.push_back(85.2e9);
182 
183  param.ajouter("E1",lst1,OT_PARAMETRES::DOUBLE,"Module d'Young dans la direction 1 du polycristal");
184  param.ajouter("E2",lst1,OT_PARAMETRES::DOUBLE,"Module d'Young dans la direction 2 du polycristal");
185  param.ajouter("E3",lst1,OT_PARAMETRES::DOUBLE,"Module d'Young dans la direction 3 du polycristal");
186  param.ajouter("n1",lst2,OT_PARAMETRES::DOUBLE,"Coefficent de Poisson dans le plan 12 du polycristal");
187  param.ajouter("n2",lst2,OT_PARAMETRES::DOUBLE,"Coefficent de Poisson dans le plan 23 du polycristal");
188  param.ajouter("n3",lst2,OT_PARAMETRES::DOUBLE,"Coefficent de Poisson dans le plan 13 du polycristal");
189  param.ajouter("G1",lst3,OT_PARAMETRES::DOUBLE,"Module de Cisaillement dans le plan 12 du polycristal");
190  param.ajouter("G2",lst3,OT_PARAMETRES::DOUBLE,"Module de Cisaillement dans le plan 23 du polycristal");
191  param.ajouter("G3",lst3,OT_PARAMETRES::DOUBLE,"Module de Cisaillement dans le plan 13 du polycristal");
192  param.ajouter("Degre",1,OT_PARAMETRES::DOUBLE,"1 maillage lineaire 2 maillage quadratique");
193  param.ajouter("fichiercumul","cumul",OT_PARAMETRES::STRING,"Nom du fichier sans extension du cumul des resultats");
194  param.ajouter("enregistrerres","1.0",OT_PARAMETRES::DOUBLE,"0. pas d'enregistrement des résultats et statistiques 1. enregistrement");
195  param.ajouter("paramaster","param_aster.txt",OT_PARAMETRES::STRING,"Nom du fichier des parametres aster");
196  param.ajouter("reprise_geo",0.,OT_PARAMETRES::DOUBLE,"0. nouvelle géométrie 1. reprise de la dernière géométrie");
197  param.ajouter("reprise_ori",0.,OT_PARAMETRES::DOUBLE,"0. nouvelle orientation 1. reprise des dernières orientations");
198  param.ajouter("reprise_mai",0.,OT_PARAMETRES::DOUBLE,"0. nouveau maillage 1. reprise du dernier maillage");
199  param.ajouter("operationaeffectuer",3.,OT_PARAMETRES::DOUBLE,"0. rien 1. generation 2. maillage 3. calcul");
200  if (nom!=NULL) param.lire(nom);
201  }
202 
203 
204  void MSTRUCT_GENERATEUR_POLYCRISTAUX::cree_param(char* nom,char *nomexe)
205  {
206  affiche((char*)"\nCreation du fichier de parametre");
207  param.change_valeur("operationaeffectuer", 2.);
208  param.change_valeur("enregistrerres", 0.);
209  param.enregistrer(nom);
210 
211  char nom2[500];
212  strcpy(nom2, nom);
213  strcat(nom2, "2");
214  FILE *paraout2=fopen(nom2,"wt");
215  fprintf(paraout2,"-> %s\n",nom);
216  fprintf(paraout2,"operationaeffectuer = 3.000000\n");
217  fprintf(paraout2,"reprise_geo = 1.000000\n");
218  fprintf(paraout2,"reprise_ori = 1.000000\n");
219  fprintf(paraout2,"reprise_mai = 1.000000\n");
220  fprintf(paraout2,"enregistrerres = 1.000000\n");
221 
222 
223  fclose(paraout2);
224 
225 
226 
227 
228  FILE *out = fopen("vasy", "wt");
229  fprintf(out, "#!/bin/bash\n");
230 fprintf(out, "for ((c=1;c<=$1;c++))\n");
231 fprintf(out, "do\n");
232 fprintf(out, "timeout 900s %s -polycristaux -out cristal.magic -param %s\n", nomexe,nom);
233 fprintf(out, "VAR=$?\n");
234 fprintf(out, "if (( $VAR )) ; then\n");
235 fprintf(out, " echo \"Timeout\"\n");
236 fprintf(out, "else\n");
237 fprintf(out, " %s -polycristaux -out cristal.magic -param %s\n", nomexe,nom2);
238 fprintf(out, "fi\n");
239 fprintf(out, "done\n");
240 
241 
242  fclose(out);
243  out = fopen("vasy_par", "wt");
244  fprintf(out, "#!/bin/bash\n");
245 fprintf(out, "VAR=1\n");
246 fprintf(out, "while (($VAR))\n");
247 fprintf(out, "do\n");
248 bool chemindanspath=false;
249 if ((nomexe[0]>='a') && (nomexe[0]<='z')) chemindanspath=true;
250 if ((nomexe[0]>='A') && (nomexe[0]<='Z')) chemindanspath=true;
251 if (chemindanspath)
252  fprintf(out, "timeout 1800s %s -polycristaux -out cristal.magic -param %s\n", nomexe,nom);
253 else
254  fprintf(out, "timeout 1800s ../%s -polycristaux -out cristal.magic -param %s\n", nomexe,nom);
255 fprintf(out, "VAR=$?\n");
256 fprintf(out, "if (( $VAR )) ; then\n");
257 fprintf(out, " echo \"Timeout\"\n");
258 fprintf(out, "else\n");
259 if (chemindanspath)
260  fprintf(out, " %s -polycristaux -out cristal.magic -param %s\n", nomexe,nom2);
261 else
262  fprintf(out, " ../%s -polycristaux -out cristal.magic -param %s\n", nomexe,nom2);
263 fprintf(out, "fi\n");
264 fprintf(out, "done\n");
265 
266 
267  fclose(out);
268  chmod ("vasy",strtol("0777", NULL,8));
269  chmod ("vasy_par",strtol("0777", NULL,8));
270  MG_EXPORT exp;
271  exp.change_param_aster((char*)"Noeud_ele",2.);
272  exp.ecrire_params_aster((char*)"param_aster.txt");
273 
274  }
275 
276 
278  {
279  int reprendgeo=(int)param.get_valeur("reprise_geo");
280  int reprendmai=(int)param.get_valeur("reprise_mai");
281  int reprendori=(int)param.get_valeur("reprise_ori");
282 
283 
284 
285 
286  #ifdef PROJECT_POLYCRISTAUX
288  MG_GESTIONNAIRE *gest;
289  int afaire=(int)param.get_valeur("operationaeffectuer");
290  MG_GEOMETRIE* mggeo;
291  double dg=param.get_valeur("dg");
292  statres.dg=dg;
293  double epsfusion=param.get_valeur("epsfusion");
294  std::string nomfichier=param.get_nom("nomfichier");
295  std::string nomfichierbrep=nomfichier+".brep";
296  std::string nomfichierocaf=nomfichier+".ocaf";
297  std::string nomfichiercarte=nomfichier+".sol";
298  double xmin=param.get_valeur("boitexmin");
299  double ymin=param.get_valeur("boiteymin");
300  double zmin=param.get_valeur("boitezmin");
301  double xmax=param.get_valeur("boitexmax");
302  double ymax=param.get_valeur("boiteymax");
303  double zmax=param.get_valeur("boitezmax");
304  BOITE_3D boite(xmin,ymin,zmin,xmax,ymax,zmax);
305  BOITE_3D boite2=boite;
306  boite2.change_grosseur(1.01);
307  if (afaire>0)
308  {
309  std::random_device seed;
310  std::mt19937_64 generateur(seed());
311  affiche((char*)"\nInitialisation");
312 
313  if (reprendgeo==0)
314  {
315  gest=new MG_GESTIONNAIRE;
317  grille.initialiser(boite2.get_xmin(),boite2.get_ymin(),boite2.get_zmin(),boite2.get_xmax(),boite2.get_ymax(),boite2.get_zmax(),100,100,100);
318  /*POLYCRISTAUX::POINT_TIRE p1(0,0,0,0);grille.inserer(&p1);
319  POLYCRISTAUX::POINT_TIRE p2(1,1000,0,0);grille.inserer(&p2);
320  POLYCRISTAUX::POINT_TIRE p3(2,1000,1000,0);grille.inserer(&p3);
321  POLYCRISTAUX::POINT_TIRE p4(3,0,1000,0);grille.inserer(&p4);
322  POLYCRISTAUX::POINT_TIRE p5(4,0,0,0);grille.inserer(&p5);
323  POLYCRISTAUX::POINT_TIRE p6(5,1000,0,0);grille.inserer(&p6);
324  POLYCRISTAUX::POINT_TIRE p7(6,1000,1000,0);grille.inserer(&p7);
325  POLYCRISTAUX::POINT_TIRE p8(7,0,1000,0);grille.inserer(&p8);*/
326  double dx=boite.get_xmax()-boite.get_xmin();
327  double dy=boite.get_ymax()-boite.get_ymin();
328  double dz=boite.get_zmax()-boite.get_zmin();
329  affiche((char*)"Generation de cristaux aléatoires");
330  double rayon=param.get_valeur("rayon")*0.3333333333333333333*(dx+dy+dz);
331  std::uniform_real_distribution<double> distribution_position_x(boite.get_xmin(),boite.get_xmax());
332  std::uniform_real_distribution<double> distribution_position_y(boite.get_ymin(),boite.get_ymax());
333  std::uniform_real_distribution<double> distribution_position_z(boite.get_zmin(),boite.get_zmax());
334  int nbinsere=0;
335  int nbainsere=param.get_valeur("nb_cristaux");
336  std::vector<POLYCRISTAUX::POINT_TIRE*> listepointainserer;
337  std::vector<double> listedepointvoro;
338  listedepointvoro.push_back(boite.get_xmin());listedepointvoro.push_back(boite.get_ymin());listedepointvoro.push_back(boite.get_zmin());
339  listedepointvoro.push_back(boite.get_xmin());listedepointvoro.push_back(boite.get_ymax());listedepointvoro.push_back(boite.get_zmin());
340  listedepointvoro.push_back(boite.get_xmax());listedepointvoro.push_back(boite.get_ymax());listedepointvoro.push_back(boite.get_zmin());
341  listedepointvoro.push_back(boite.get_xmax());listedepointvoro.push_back(boite.get_ymin());listedepointvoro.push_back(boite.get_zmin());
342  listedepointvoro.push_back(boite.get_xmin());listedepointvoro.push_back(boite.get_ymin());listedepointvoro.push_back(boite.get_zmax());
343  listedepointvoro.push_back(boite.get_xmin());listedepointvoro.push_back(boite.get_ymax());listedepointvoro.push_back(boite.get_zmax());
344  listedepointvoro.push_back(boite.get_xmax());listedepointvoro.push_back(boite.get_ymax());listedepointvoro.push_back(boite.get_zmax());
345  listedepointvoro.push_back(boite.get_xmax());listedepointvoro.push_back(boite.get_ymin());listedepointvoro.push_back(boite.get_zmax());
346 
347  while (nbinsere<nbainsere)
348  {
349  double x=distribution_position_x(generateur);
350  double y=distribution_position_y(generateur);
351  double z=distribution_position_z(generateur);
353  grille.rechercher(x,y,z,rayon,lsttrouve);
355  bool bonpoint=true;
356  for (POLYCRISTAUX::POINT_TIRE* pt=lsttrouve.get_premier(it);pt!=NULL;pt=lsttrouve.get_suivant(it))
357  {
358  OT_VECTEUR_3D vec(x-pt->x,y-pt->y,z-pt->z);
359  if (vec.get_longueur()<rayon) bonpoint=false;
360  }
361  if (bonpoint)
362  {
363  listedepointvoro.push_back(x);
364  listedepointvoro.push_back(y);
365  listedepointvoro.push_back(z);
366  POLYCRISTAUX::POINT_TIRE *pt=new POLYCRISTAUX::POINT_TIRE(nbinsere+8,x,y,z);
367  grille.inserer(pt);
368  listepointainserer.push_back(pt);
369  nbinsere++;
370  }
371  }
372 
373  for (int i=0;i<listepointainserer.size();i++)
374  delete listepointainserer[i];
375 
376  char message[1000];
377  sprintf(message," Construction des Voronoi avec borne de fusion de %lf",epsfusion);
378  affiche(message);
379  Polycristal poly(listedepointvoro,(char*)nomfichierbrep.c_str(),epsfusion);
381  bool avecstep=false;
382  int valeur=(int)param.get_valeur("enregistrementstep");
383  if (valeur==0) avecstep=false;
384  if (valeur==1) avecstep=true;
385  poly.construit(avecstep);
386  OCC_IMPORT occ_import;
387  mggeo = occ_import.importer_fichier_brep_V2017(*gest,(char*)nomfichierbrep.c_str(),(char*)nomfichierocaf.c_str(),FICHIEROCC,1e-6,false);
388  occ_import.importer_triangulation_V2017(*gest,mggeo,0.1,1);
389  mggeo->change_valeur_unite(1.);
390  int nb=listedepointvoro.size()/3;
391  for (int i=8;i<nb;i++)
392  {
393  double x=listedepointvoro[3*i];
394  double y=listedepointvoro[3*i+1];
395  double z=listedepointvoro[3*i+2];
396  LC_POINT* pt=new LC_POINT(x,y,z);
397  mggeo->ajouter_mg_point(pt);
398  }
399 
400  }
401  else
402  {
403  affiche((char*)"Reprise de calcul d'un ancien polycristal");
404  gest=new MG_FILE(nommagic);
405  mggeo=gest->get_mg_geometrie(0);
406 
407  }
408  statres.nbcristaux=mggeo->get_nb_mg_volume();
409 
410  char mess[500];
411  sprintf(mess," Nombre de cristaux MAGiC assemblés = %d ", mggeo->get_nb_mg_volume());;
412  affiche(mess);
413  double tens1[9],tens2[9],tens3[9];
414  for (int i=0;i<9;i++)
415  {
416  tens1[i]=0.;
417  tens2[i]=0.;
418  tens3[i]=0.;
419  }
420  if (reprendori==0)
421  {
422  std::uniform_real_distribution<double> distribution_angle1(0.,360.);
423  std::uniform_real_distribution<double> distribution_angle2(-1.,1.);
424  std::uniform_real_distribution<double> distribution_angle3(0.,360.);
425  affiche((char*)"Conditions aux limites");
426  LISTE_MG_VOLUME::iterator it;
427  int nbphase=(int)param.get_valeur("Nbphase");
428  statres.nbphase=nbphase;
429  statres.volume.resize(statres.nbphase+1);
430  statres.masse.resize(statres.nbphase+1);
431  statres.nbcristauxphase.resize(statres.nbphase+1);
432  statres.cdm.resize(statres.nbphase+1);
433  //std::discrete_distribution<int> d({20, 80});
434  //std::map<int, int> m;
435  std::vector<double> volume(nbphase);
436  std::vector<double> tirage(nbphase);
437  std::vector<OT_VECTEUR_3D> cdm(nbphase);
438  std::vector<double> cible(nbphase);
439  std::vector<int> ordrecible(nbphase);
440  std::vector<double> densite(nbphase);
441  std::vector<int> nbcristaux(nbphase);
442  OT_TENSEUR rigtot(6,6),soutot(6,6);
443  MSTRUCT_BORNE borne;
444  for (int i=0;i<nbphase;i++)
445  {
446  volume[i]=0.;
447  tirage[i]=0.;
448  cdm[i].change_x(0.);
449  cdm[i].change_y(0.);
450  cdm[i].change_z(0.);
451  cible[i]=param.get_valeur("Proportionphase",i);
452  ordrecible[i]=i;
453  densite[i]=param.get_valeur("Densite",i);
454  nbcristaux[i]=0;
455  double E1=param.get_valeur("E1",i);
456  double E2=param.get_valeur("E2",i);
457  double E3=param.get_valeur("E3",i);
458  double n1=param.get_valeur("n1",i);
459  double n2=param.get_valeur("n2",i);
460  double n3=param.get_valeur("n3",i);
461  double G1=param.get_valeur("G1",i);
462  double G2=param.get_valeur("G2",i);
463  double G3=param.get_valeur("G3",i);
464  OT_TENSEUR rig(6,6),rigphase(6,6),souphase(6,6);
465  borne.get_tenseur_rigidite(E1/1e9,E2/1e9,E3/1e9,2.*G1/1e9,2.*G2/1e9,2.*G3/1e9,n1,n2,n3,rig);
466  borne.get_VoigtReuss_poly(rig,rigphase,souphase);
467  rigphase=cible[i]*rigphase;
468  souphase=cible[i]*souphase;
469  rigtot=rigtot+rigphase;
470  soutot=soutot+souphase;
471  }
472  double Ev,Gv,Kv,nuv;
473  double Er,Gr,Kr,nur;
474  borne.get_VoigtReuss_poly(rigtot,soutot,Kv,Gv,Ev,nuv,Kr,Gr,Er,nur);
475  statres.Evoigt=Ev*1e9;
476  statres.Kvoigt=Kv/3.*1e9;
477  statres.Gvoigt=Gv/2.*1e9;
478  statres.nuvoigt=nuv;
479  statres.Ereuss=Er*1e9;
480  statres.Kreuss=Kr/3.*1e9;
481  statres.Greuss=Gr/2.*1e9;
482  statres.nureuss=nur;
483  std::shuffle(ordrecible.begin(),ordrecible.end(),generateur);
484  std::vector<MG_VOLUME*> listevolume;
485  for (MG_VOLUME* vol=mggeo->get_premier_volume(it);vol!=NULL;vol=mggeo->get_suivant_volume(it))
486  listevolume.push_back(vol);
487  std::shuffle(listevolume.begin(),listevolume.end(),generateur);
488  double voltot=(boite.get_xmax()-boite.get_xmin())*(boite.get_ymax()-boite.get_ymin())*(boite.get_zmax()-boite.get_zmin());
489  double nume=voltot;
490  std::vector<double> deno(nbphase);
491  for (int i=0;i<nbphase;i++)
492  deno[i]=1.;
493  for (int i=0;i<nbphase;i++)
494  {
495  nume=nume*densite[i];
496  for (int j=0;j<nbphase;j++)
497  if (i!=j) deno[j]=deno[j]*densite[i];
498  else deno[j]=deno[j]*cible[i];
499  }
500  double massetot=0.;
501  for (int i=0;i<nbphase;i++)
502  massetot=massetot+deno[i];
503  massetot=nume/massetot;
504 
505 
506  for (int i=0;i<listevolume.size();i++)
507  {
508  MG_VOLUME *vol=listevolume[i];
509  int tir=-1,j=0;
510  while (tir==-1)
511  {
512  if (tirage[ordrecible[j]]/massetot<cible[ordrecible[j]]) tir=ordrecible[j];
513  j++;
514  //if (j>=nbphase) tir=j-1;
515  }
516  double volu,masse;
517  OT_VECTEUR_3D cdm2;
518  OT_MATRICE_3D m1,m2;
519  double dens=densite[tir];
520  vol->get_propriete_massique(gest->get_mg_maillage(0),volu,masse,cdm2,m1,m2,dens,-1);
521  volume[tir]=volume[tir]+volu;
522  tirage[tir]=tirage[tir]+masse;
523  cdm[tir]=cdm[tir]+masse*cdm2;
524  nbcristaux[tir]=nbcristaux[tir]+1;
525 
526 
527  for (int i=0;i<vol->get_nb_ccf();i++)
528  vol->supprimer_ccf(0);
529  double E1=param.get_valeur("E1",tir);
530  double E2=param.get_valeur("E2",tir);
531  double E3=param.get_valeur("E3",tir);
532  double n1=param.get_valeur("n1",tir);
533  double n2=param.get_valeur("n2",tir);
534  double n3=param.get_valeur("n3",tir);
535  double G1=param.get_valeur("G1",tir);
536  double G2=param.get_valeur("G2",tir);
537  double G3=param.get_valeur("G3",tir);
538  vol->ajouter_ccf((char*)"Ph",(double)tir);
539  vol->ajouter_ccf((char*)"E1",E1);
540  vol->ajouter_ccf((char*)"E2",E2);
541  vol->ajouter_ccf((char*)"E3",E3);
542  vol->ajouter_ccf((char*)"n1",n1);
543  vol->ajouter_ccf((char*)"n2",n2);
544  vol->ajouter_ccf((char*)"n3",n3);
545  vol->ajouter_ccf((char*)"G1",G1);
546  vol->ajouter_ccf((char*)"G2",G2);
547  vol->ajouter_ccf((char*)"G3",G3);
548  vol->ajouter_ccf((char*)"Ro",dens);
549  double a1=distribution_angle1(generateur);
550  double a3=distribution_angle3(generateur);
551  double a2=distribution_angle2(generateur);
552  a2=acos(a2)/M_PI*180.;
553  vol->ajouter_ccf((char*)"a1",a1);
554  vol->ajouter_ccf((char*)"a2",a2);
555  vol->ajouter_ccf((char*)"a3",a3);
556  double x1[3],x2[3],x3[3];
557  double psi=a1/180.*M_PI;
558  double teta=a2/180.*M_PI;
559  double phi=a3/180.*M_PI;
560  x1[0]=cos(phi)*cos(psi)-sin(phi)*cos(teta)*sin(psi);
561  x1[1]=cos(phi)*sin(psi)+sin(phi)*cos(teta)*cos(psi);
562  x1[2]=sin(phi)*sin(teta);
563  x2[0]=-sin(phi)*cos(psi)-cos(phi)*cos(teta)*sin(psi);
564  x2[1]=-sin(phi)*sin(psi)+cos(phi)*cos(teta)*cos(psi);
565  x2[2]=cos(phi)*sin(teta);
566  x3[0]=sin(teta)*sin(psi);
567  x3[1]=-sin(teta)*cos(psi);
568  x3[2]=cos(teta);
569  for (int i=0;i<3;i++)
570  for (int j=0;j<3;j++)
571  {
572  tens1[i*3+j]+=x1[i]*x1[j];
573  tens2[i*3+j]+=x2[i]*x2[j];
574  tens3[i*3+j]+=x3[i]*x3[j];
575  }
576 
577  }
578  double massetotale=0.;
579  double volumetotal=0.;
580  for (int i=0;i<nbphase;i++)
581  {
582  volumetotal=volumetotal+volume[i];
583  massetotale=massetotale+tirage[i];
584  }
585  char mess[500];
586  sprintf(mess," Masse estimée %lf calculée %lf",massetot,massetotale);
587  affiche(mess);
588  statres.masse[nbphase]=massetotale;
589  statres.volume[nbphase]=volumetotal;
590  for (int i=0;i<nbphase;i++)
591  {
592  char mess[500];
593  sprintf(mess," Phase %d (%d cristaux) = tirage %d \n masse %lf ou %lf%% \n volume %lf ou %lf%%", i+1,nbcristaux[i],ordrecible[i]+1,tirage[i],tirage[i]/massetotale*100.,volume[i],volume[i]/volumetotal*100.);
594  affiche(mess);
595  sprintf(mess," Centre de masse x = %lf ",cdm[i].get_x()/tirage[i]);
596  affiche(mess);
597  sprintf(mess," y = %lf ",cdm[i].get_y()/tirage[i]);
598  affiche(mess);
599  sprintf(mess," z = %lf ",cdm[i].get_z()/tirage[i]);
600  affiche(mess);
601  statres.masse[i]=tirage[i];
602  statres.volume[i]=volume[i];
603  statres.cdm[i]=cdm[i]/tirage[i];
604  statres.cdm[nbphase]=statres.cdm[nbphase]+cdm[i];
605  statres.nbcristauxphase[i]=nbcristaux[i];
606  }
607  statres.cdm[statres.nbphase]=(1./statres.masse[statres.nbphase])*statres.cdm[statres.nbphase];
608  sprintf(mess," Centre de masse global x = %lf ",statres.cdm[statres.nbphase].get_x());
609  affiche(mess);
610  sprintf(mess," y = %lf ",statres.cdm[statres.nbphase].get_y());
611  affiche(mess);
612  sprintf(mess," z = %lf ",statres.cdm[statres.nbphase].get_z());
613  affiche(mess);
614  }
615  else
616  {
617  affiche((char*)"Reprise conditions aux limites");
618  LISTE_MG_VOLUME::iterator it;
619  statres.nbphase=(int)param.get_valeur("Nbphase");
620  statres.volume.resize(statres.nbphase+1);
621  statres.masse.resize(statres.nbphase+1);
622  statres.nbcristauxphase.resize(statres.nbphase+1);
623  statres.cdm.resize(statres.nbphase+1);
624  for (int i=0;i<statres.nbphase;i++)
625  {
626  statres.volume[i]=0.;
627  statres.masse[i]=0.;
628  statres.nbcristauxphase[i]=0;
629  statres.cdm[i].change_x(0.);
630  statres.cdm[i].change_y(0.);
631  statres.cdm[i].change_z(0.);
632  }
633  for (MG_VOLUME* vol=mggeo->get_premier_volume(it);vol!=NULL;vol=mggeo->get_suivant_volume(it))
634  {
635  double a1,a2,a3;
636  vol->get_valeur_ccf((char*)"a1",a1);
637  vol->get_valeur_ccf((char*)"a2",a2);
638  vol->get_valeur_ccf((char*)"a3",a3);
639  double x1[3],x2[3],x3[3];
640  double psi=a1/180.*M_PI;
641  double teta=a2/180.*M_PI;
642  double phi=a3/180.*M_PI;
643  x1[0]=cos(phi)*cos(psi)-sin(phi)*cos(teta)*sin(psi);
644  x1[1]=cos(phi)*sin(psi)+sin(phi)*cos(teta)*cos(psi);
645  x1[2]=sin(phi)*sin(teta);
646  x2[0]=-sin(phi)*cos(psi)-cos(phi)*cos(teta)*sin(psi);
647  x2[1]=-sin(phi)*sin(psi)+cos(phi)*cos(teta)*cos(psi);
648  x2[2]=cos(phi)*sin(teta);
649  x3[0]=sin(teta)*sin(psi);
650  x3[1]=-sin(teta)*cos(psi);
651  x3[2]=cos(teta);
652  for (int i=0;i<3;i++)
653  for (int j=0;j<3;j++)
654  {
655  tens1[i*3+j]+=x1[i]*x1[j];
656  tens2[i*3+j]+=x2[i]*x2[j];
657  tens3[i*3+j]+=x3[i]*x3[j];
658  }
659  double val;
660  vol->get_valeur_ccf((char*)"Ph",val);
661  int numphase=(int)val;
662  vol->get_valeur_ccf((char*)"Ro",val);
663  double dens=val;
664  double volu,mass;
665  OT_VECTEUR_3D cdm2;
666  OT_MATRICE_3D m1,m2;
667  vol->get_propriete_massique(gest->get_mg_maillage(0),volu,mass,cdm2,m1,m2,dens,-1);
668  statres.volume[numphase]=statres.volume[numphase]+volu;
669  statres.masse[numphase]=statres.masse[numphase]+mass;
670  statres.nbcristauxphase[numphase]++;
671  statres.cdm[numphase]=statres.cdm[numphase]+mass*cdm2;
672  }
673  statres.masse[statres.nbphase]=0.;
674  statres.volume[statres.nbphase]=0.;
675  statres.cdm[statres.nbphase].change_x(0.);
676  statres.cdm[statres.nbphase].change_y(0.);
677  statres.cdm[statres.nbphase].change_z(0.);
678  for (int i=0;i<statres.nbphase;i++)
679  {
680  statres.volume[statres.nbphase]=statres.volume[statres.nbphase]+statres.volume[i];
681  statres.masse[statres.nbphase]=statres.masse[statres.nbphase]+statres.masse[i];
682  statres.cdm[i]=(1./statres.masse[i])*statres.cdm[i];
683  statres.cdm[statres.nbphase]=statres.cdm[statres.nbphase]+statres.masse[i]*statres.cdm[i];
684  }
685  statres.cdm[statres.nbphase]=(1./statres.masse[statres.nbphase])*statres.cdm[statres.nbphase];
686  for (int i=0;i<statres.nbphase;i++)
687  {
688  char mess[500];
689  sprintf(mess," Phase %d (%d cristaux) : masse %lf ou %lf%% \n volume %lf ou %lf%%", i+1,statres.nbcristauxphase[i],statres.masse[i],statres.masse[i]/statres.masse[statres.nbphase]*100.,statres.volume[i],statres.volume[i]/statres.volume[statres.nbphase]*100.);
690 
691  affiche(mess);
692 
693  sprintf(mess," Centre de masse x = %lf ",statres.cdm[i].get_x());
694  affiche(mess);
695  sprintf(mess," y = %lf ",statres.cdm[i].get_y());
696  affiche(mess);
697  sprintf(mess," z = %lf ",statres.cdm[i].get_z());
698  affiche(mess);
699 
700  }
701  sprintf(mess," Centre de masse global x = %lf ",statres.cdm[statres.nbphase].get_x());
702  affiche(mess);
703  sprintf(mess," y = %lf ",statres.cdm[statres.nbphase].get_y());
704  affiche(mess);
705  sprintf(mess," z = %lf ",statres.cdm[statres.nbphase].get_z());
706  affiche(mess);
707 
708  }
709 
710  for (int i=0;i<9;i++)
711  {
712  statres.tens1[i]=tens1[i]/mggeo->get_nb_mg_volume();
713  statres.tens2[i]=tens2[i]/mggeo->get_nb_mg_volume();
714  statres.tens3[i]=tens3[i]/mggeo->get_nb_mg_volume();
715  }
716  }
717  int degre=(int)param.get_valeur("Degre");
718  statres.degre=degre;
719  FEM_MAILLAGE* fem;
720  if (afaire>1)
721  {
722 
723  if (reprendmai==0)
724  {
727  for (int i=gest->get_nb_mg_maillage()-1;i>0;i--)
728  gest->supprimer_mg_maillage(i);
729  //FCT_TAILLE_FEM_SOLUTION_GENERATEUR_CONSTANT carte(gest,mggeo,dg,1,1,1,1,(char*)nomfichiercarte.c_str());
730  affiche((char*)"Carte de taille");
731 
732  std::vector<double> lstpoint;
733  int nbarete=mggeo->get_nb_mg_arete();
734  double bornerafmin=param.get_valeur("bornemin_carte");
735  int typeborne=(int)param.get_valeur("type_bornemin");
736  if (typeborne==1) bornerafmin=bornerafmin*dg;
737  for (int i=0;i<nbarete;i++)
738  {
739  MG_ARETE* are=mggeo->get_mg_arete(i);
740  double val=are->get_longueur(are->get_tmin(),are->get_tmax());
741  if (val<epsfusion) std::cout<< " pb" << std::endl;
742  if (val<dg)
743  {
744  double xyz[3];
745  are->get_cosommet1()->get_sommet()->get_point()->evaluer(xyz);
746  lstpoint.push_back(xyz[0]);
747  lstpoint.push_back(xyz[1]);
748  lstpoint.push_back(xyz[2]);
749  lstpoint.push_back(std::max(val,bornerafmin));
750  }
751 
752  }
753  char message[500];
754  sprintf(message," Écart nodal demande : %lf Écart nodal minimal : %lf",dg,bornerafmin);
755  affiche(message);
756  sprintf(message," %d points de raffinement",(int)(lstpoint.size())/4);
757  affiche(message);
758  //affiche((char*)"Enregistrement");
759  //gest->enregistrer(nommagic);
760  double gradient=param.get_valeur("gradient");
761  FCT_TAILLE_FEM_SOLUTION_GENERATEUR_GRADIENT carte(gest,mggeo,dg,2,50,50,50,(char*)nomfichiercarte.c_str(),lstpoint,gradient);
762  //carte.active_affichage(affiche2);
763  carte.construit();
764  carte.enregistrer(nommagic);
765 
766  MG_MAILLAGE *mai=new MG_MAILLAGE(mggeo);
767  gest->ajouter_mg_maillage(mai);
768  affiche((char*)"Maillage 0D");
769  MAILLEUR0D m0d(mai,mggeo);
771  m0d.maille();
772  affiche((char*)"Maillage 1D");
773  MAILLEUR1D m1d(mai,mggeo,&carte);
774  //m1d.active_affichage(affiche2);
775  m1d.maille();
776  affiche((char*)"Maillage 2D");
777  MAILLEUR2D m2d(mai,mggeo,&carte);
778  //m2d.active_affichage(affiche2);
779  m2d.maille();
780  affiche((char*)"Maillage 3D");
781  MAILLEUR3D m3d(mai,mggeo,&carte,false);
782  //m3d.active_affichage(affiche2);
783  m3d.maille();
784  //MAILLEUR_ANALYSE mana(mai);
785  //mana.active_affichage(affiche2);
786  //mana.analyse();
787  //optimise_maillage(mai);
788  //mana.analyse();
789  fem=new FEM_MAILLAGE(mggeo,mai,degre);
790  gest->ajouter_fem_maillage(fem);
791  char mess[400];
792  sprintf(mess,"Maillage FEM degre %d",degre);
793  affiche(mess);
794  MAILLEUR_FEM mfem;
795  mfem.maille(fem,0);
796  }
797  else
798  {
799  affiche((char*)"Reprise de calcul d'un ancien maillage");
800  fem=gest->get_fem_maillage(1);
801  }
802 
803  //verification volume
804  double volume=0.;
805  LISTE_FEM_ELEMENT3::iterator it;
806  for (FEM_ELEMENT3* ele=fem->get_premier_element3(it);ele!=NULL;ele=fem->get_suivant_element3(it))
807  {
808  MG_TETRA* tet=(MG_TETRA*)ele->get_mg_element_maillage();
809  MG_NOEUD* n1=tet->get_noeud1();
810  MG_NOEUD* n2=tet->get_noeud2();
811  MG_NOEUD* n3=tet->get_noeud3();
812  MG_NOEUD* n4=tet->get_noeud4();
813  OT_VECTEUR_3D vec1(n1->get_coord(),n2->get_coord());
814  OT_VECTEUR_3D vec2(n1->get_coord(),n3->get_coord());
815  OT_VECTEUR_3D vec3(n1->get_coord(),n4->get_coord());
816  OT_VECTEUR_3D pvec=vec1&vec2;
817  double vol=fabs(pvec*vec3);
818  volume=volume+vol;
819  }
820  volume=volume/6.;
821  char message[500];
822  sprintf(message," Volume des mailles = %lf",volume);
823  affiche(message);
824 
825  /*
826  MAILLEUR_ANALYSE mana(fem);
827  mana.active_affichage(affiche2);
828  mana.analyse(NULL);
829  */}
830  if (afaire>2)
831  {
832  double epsx,epsy,epsz,epsxy,epsxz,epsyz;
833  double sigx,sigy,sigz,sigxy,sigxz,sigyz;
834  affiche((char*)"\n---> 1. CLDHS\n");
836  int erreur=calcule_cacteristique_mecanique(gest,fem,epsx,epsy,epsz,epsxy,epsxz,epsyz,sigx,sigy,sigz,sigxy,sigxz,sigyz);
837  if (erreur==0)
838  {
839  statres.KDH=1./3.*(sigx+sigy+sigz)/(epsx+epsy+epsz);
840  mggeo->efface_ccf(false,true,true,true);
841  char message[500];
842  sprintf(message," KDH=%lf",statres.KDH);
843  affiche(message);
844  }
845  else exit(EXIT_FAILURE);
846 
847  if (erreur==0)
848  {
849 
850  affiche((char*)"\n---> 2. CLDHD\n");
852  erreur=calcule_cacteristique_mecanique(gest,fem,epsx,epsy,epsz,epsxy,epsxz,epsyz,sigx,sigy,sigz,sigxy,sigxz,sigyz);
853  if (erreur==0)
854  {
855  statres.GDH=1./6.*(sigxy/epsxy+sigyz/epsyz+sigxz/epsxz);
856  statres.EDH=9*statres.KDH*statres.GDH/(3*statres.KDH+statres.GDH);
857  mggeo->efface_ccf(false,true,true,true);
858  char message[500];
859  sprintf(message," GDH=%lf\n EDH=%lf\n",statres.GDH,statres.EDH);
860  affiche(message);
861  }
862  else exit(EXIT_FAILURE);
863  }
864 
865  if (erreur==0)
866  {
867  affiche((char*)"\n---> 3. CLCHS\n");
869  erreur=calcule_cacteristique_mecanique(gest,fem,epsx,epsy,epsz,epsxy,epsxz,epsyz,sigx,sigy,sigz,sigxy,sigxz,sigyz);
870  if (erreur==0)
871  {
872  statres.KCH=1./3.*(sigx+sigy+sigz)/(epsx+epsy+epsz);
873  mggeo->efface_ccf(false,true,true,true);
874  char message[500];
875  sprintf(message," KCH=%lf\n\n",statres.KCH);
876  affiche(message);
877  }
878  else exit(EXIT_FAILURE);
879 
880  }
881 
882  if (erreur==0)
883  {
884  affiche((char*)"\n---> 4. CLCHD\n");
886  calcule_cacteristique_mecanique(gest,fem,epsx,epsy,epsz,epsxy,epsxz,epsyz,sigx,sigy,sigz,sigxy,sigxz,sigyz);
887  if (erreur==0)
888  {
889  statres.GCH=1./6.*(sigxy/epsxy+sigyz/epsyz+sigxz/epsxz);
890  statres.ECH=9*statres.KCH*statres.GCH/(3*statres.KCH+statres.GCH);
891  mggeo->efface_ccf(false,true,true,true);
892  char message[500];
893  sprintf(message," GCH=%lf\n ECH=%lf\n",statres.GCH,statres.ECH);
894  affiche(message);
895  }
896  else exit(EXIT_FAILURE);
897 
898  //double GDH,EDH,KCH,GCH,ECH;
899  affiche((char*)"\n\n Résultats \n\n");
900  char message[500];
901  sprintf(message," KDH=%lf;GDH=%lf;EDH=%lf;",statres.KDH,statres.GDH,statres.EDH);
902  affiche(message);
903  sprintf(message," KCH=%lf;GCH=%lf;ECH=%lf;\n",statres.KCH,statres.GCH,statres.ECH);
904  affiche(message);
905  gest->enregistrer(nommagic);
906 
907 
908 
909  }
910 
911  }
912  int enregistreresultat=(int)param.get_valeur("enregistrerres");
913  if (enregistreresultat==1)
914  {
915  std::mutex mtx;
916  std::string nomcumul=param.get_nom("fichiercumul");
917  std::string nomcumul1 = nomcumul+".txt";
918  std::string nomcumul2 = nomcumul+".gnu";
919  std::string nomcumul3 = nomcumul+".svg";
920  FILE *outtest=fopen((char*)nomcumul1.c_str(),"rt");
921  bool existe =false;
922  if (outtest!=NULL) {existe=true;fclose(outtest);}
923  mtx.lock();
924  FILE *out=fopen((char*)nomcumul1.c_str(),"at");
925  if (!existe)
926  { fprintf(out,"Nbcristaux;degre;dg;KDH;GDH;EDH;KCH;GCH;ECH;ori1_11;ori1_12;ori1_13;ori1_21;ori1_22;ori1_23;ori1_31;ori1_32;ori1_33;ori2_11;ori2_12;ori2_13;ori2_21;ori2_22;ori2_23;ori2_31;ori2_32;ori2_33;ori3_11;ori3_12;ori3_13;ori3_21;ori3_22;ori3_23;ori3_31;ori3_32;ori3_33;Nbphase;");
927  for (int i=0;i<statres.nbphase;i++)
928  fprintf(out,"N%d;VPh%d;MPh%d;CDMx%d;CDMy%d;CDMz%d;",i+1,i+1,i+1,i+1,i+1,i+1);
929  fprintf(out,"VPhtot;MPhtot;CDMxtot;CDMytot;CDMztot,Kv,Gv,Ev,nuv,Kr,Gr,Er,nur\n");
930  }
931  fprintf(out,"%d;%d;%lf;",statres.nbcristaux,statres.degre,statres.dg);
932  fprintf(out,"%lf;%lf;%lf;",statres.KDH,statres.GDH,statres.EDH);
933  fprintf(out,"%lf;%lf;%lf;",statres.KCH,statres.GCH,statres.ECH);
934  for (int i=0;i<9;i++)
935  fprintf(out,"%lf;",statres.tens1[i]);
936  for (int i=0;i<9;i++)
937  fprintf(out,"%lf;",statres.tens2[i]);
938  for (int i=0;i<9;i++)
939  fprintf(out,"%lf;",statres.tens3[i]);
940  fprintf(out,"%d;",statres.nbphase);
941  for (int i=0;i<statres.nbphase;i++)
942  fprintf(out,"%d;%lf;%lf;%lf;%lf;%lf;",statres.nbcristauxphase[i],statres.volume[i],statres.masse[i],statres.cdm[i].get_x(),statres.cdm[i].get_y(),statres.cdm[i].get_z());
943  fprintf(out,"%lf;%lf;%lf;%lf;%lf;",statres.volume[statres.nbphase],statres.masse[statres.nbphase],statres.cdm[statres.nbphase].get_x(),statres.cdm[statres.nbphase].get_y(),statres.cdm[statres.nbphase].get_z());
944  fprintf(out,"%lf;%lf;%lf;%lf;%lf;%lf;%lf;%lf;",statres.Kvoigt,statres.Gvoigt,statres.Evoigt,statres.nuvoigt,statres.Kreuss,statres.Greuss,statres.Ereuss,statres.nureuss);
945  fprintf(out,"\n");
946 
947  fclose(out);
948  mtx.unlock();
949  /*outtest=fopen((char*)nomcumul2.c_str(),"rt");
950  existe =false;
951  if (outtest!=NULL) {existe=true;fclose(outtest);}
952  if (!existe)
953  {
954  mtx.lock();
955  FILE *out=fopen((char*)nomcumul2.c_str(),"wt");
956  fprintf(out, "set terminal svg\n");
957  fprintf(out, "set output \"%s\"\n", nomcumul3.c_str());
958  fprintf(out, "set datafile separator \";\"\n");
959  fprintf(out, "set key on bmargin horizontal\n");
960  fprintf(out, "set xlabel 'Numéro d''essai'\n");
961  fprintf(out, "set ylabel 'Module d''Young (GPa)'\n");
962  fprintf(out, "set y2label 'Écart à l''isotropie'\n");
963  fprintf(out, "set pointsize 1\n");
964  fprintf(out, "set autoscale x\n");
965  fprintf(out, "set autoscale y\n");
966  fprintf(out, "set y2tics 0.5,0.1,1\n");
967  fprintf(out, "set y2r [0.5:1]\n");
968  fprintf(out, "set ytics nomirror\n");
969  fprintf(out, "set xtics nomirror\n");
970  double facteur = (param.get_valeur("bornevoigt")-param.get_valeur("bornereuss"))/3./1e9;
971  fprintf(out, "set offsets graph 0, 0, %lf,0\n", facteur);
972  fprintf(out, "#\n");
973  fprintf(out, "d(x)=dd\n");
974  fprintf(out, "fit d(x) '%s' u :($6/1e9) via dd\n",nomcumul1.c_str());
975  fprintf(out, "c(x)=cc\n");
976  fprintf(out, "fit c(x) '%s' u :($9/1e9) via cc\n",nomcumul1.c_str());
977  fprintf(out, "#\n");
978  fprintf(out, "set title \"%s\\n %d cristaux\"\n",param.get_nom("nommateriau").c_str(), (int)param.get_valeur("nb_cristaux"));
979  fprintf(out, "plot '%s' u :($6/1e9) title 'EDH' pointtype 5 lc rgb \"blue\", '%s' u :($9/1e9) title 'ECH' pointtype 5 lc rgb \"red\",(%lf/1e9) title 'Borne Voigt' w l lc rgb \"violet\" lw 3,(%lf/1e9) title 'Borne Reuss' w l lc rgb \"dark-orange\" lw 3, '%s' u :(1.-sqrt(1./9.*(($10-1./3)*($10-1./3)+($14-1./3.)*($14-1./3)+($18-1./3.)*($18-1./3.)+($19-1./3)*($19-1./3)+($23-1./3.)*($23-1./3)+($27-1./3.)*($27-1./3.)+($28-1./3)*($28-1./3)+($32-1./3.)*($32-1./3)+($36-1./3.)*($36-1./3.)))) axis x1y2 title 'Isotropie' lc rgb \"green\" pointtype 1,c(x) title sprintf(\"moyenne %%.1f\",cc) lc rgb \"red\" dt 2 ,d(x) title sprintf(\"moyenne %%.1f\",dd) lc rgb \"blue\" dt 2", nomcumul1.c_str(),nomcumul1.c_str(),statres.Evoigt,statres.Ereuss,nomcumul1.c_str() );
980 
981 
982  fclose(out);
983  mtx.unlock();
984  }*/
985  }
986 
987 
988 
989  affiche((char*)"Enregistrement");
990  gest->enregistrer(nommagic);
991  delete gest;
992 
993  #endif
994  }
995 
996 
997 
998  int MSTRUCT_GENERATEUR_POLYCRISTAUX::calcule_cacteristique_mecanique(MG_GESTIONNAIRE *gest,FEM_MAILLAGE* fem, double& epsx, double& epsy, double& epsz, double& epsxy, double& epsxz, double& epsyz, double& sigx, double& sigy, double& sigz, double& sigxy, double& sigxz, double& sigyz)
999  {
1000 
1001  //affiche((char*)"Calcul aster");
1002  MGASTER ef;
1004  std::string nomparamaster=param.get_nom("paramaster");
1005  std::string nomfichier=param.get_nom("nomfichier");
1006  int erreur=ef.calcule((char*)nomparamaster.c_str(),fem,(char*)nomfichier.c_str(),MAGIC::CALCUL_ASTER::ELASTIQUE,(char*)"00011111",false);
1007  if (erreur!=0) return erreur;
1008  int nb=gest->get_nb_fem_solution();
1009  for (int i=0;i<nb;i++)
1010  {
1011 
1012  FEM_SOLUTION* sol=gest->get_fem_solution(i);
1013  std::string nom=sol->get_nom();
1014  nom.erase(2,1000);
1015  if (nom=="GE")
1016  {
1017  epsx=sol->get_moyenne_volumique_champs(NULL,0);
1018  epsy=sol->get_moyenne_volumique_champs(NULL,1);
1019  epsz=sol->get_moyenne_volumique_champs(NULL,2);
1020  epsxy=sol->get_moyenne_volumique_champs(NULL,3);
1021  epsxz=sol->get_moyenne_volumique_champs(NULL,4);
1022  epsyz=sol->get_moyenne_volumique_champs(NULL,5);
1023  }
1024  if ((nom=="GS") && (sol->get_nb_champ()==6))
1025  {
1026  sigx=sol->get_moyenne_volumique_champs(NULL,0);
1027  sigy=sol->get_moyenne_volumique_champs(NULL,1);
1028  sigz=sol->get_moyenne_volumique_champs(NULL,2);
1029  sigxy=sol->get_moyenne_volumique_champs(NULL,3);
1030  sigxz=sol->get_moyenne_volumique_champs(NULL,4);
1031  sigyz=sol->get_moyenne_volumique_champs(NULL,5);
1032  }
1033  }
1034  return erreur;
1035  }
1036 
1037 
1038 
1039 
1040 
1041 
1043 {
1044 double bornerafmin=param.get_valeur("bornemin_carte");
1045 int typeborne=(int)param.get_valeur("type_bornemin");
1046 double dg=param.get_valeur("dg");
1047 if (typeborne==1) bornerafmin=bornerafmin*dg;
1049 std::multimap<MG_NOEUD*,MG_NOEUD*> lst1;
1050 std::map<MG_NOEUD*,MG_NOEUD*> lst2;
1051 LISTE_MG_SEGMENT::iterator it;
1052 for (MG_SEGMENT* seg=mai->get_premier_segment(it);seg!=NULL;seg=mai->get_suivant_segment(it))
1053  {
1054  if (seg->get_longueur()<bornerafmin)
1055  {
1056  int nb1=seg->get_noeud1()->get_lien_tetra()->get_nb();
1057  int nb2=seg->get_noeud2()->get_lien_tetra()->get_nb();
1058  MG_NOEUD* no1=seg->get_noeud1();
1059  MG_NOEUD* no2=seg->get_noeud2();
1060  if (no1>no2)
1061  {
1062  MG_NOEUD* tmp=no1;
1063  no1=no2;
1064  no2=tmp;
1065  }
1066  std::map<MG_NOEUD*,MG_NOEUD*>::iterator itn=lst2.find(no1);
1067  if (itn!=lst2.end())
1068  no1=itn->second;
1069  std::pair<MG_NOEUD*,MG_NOEUD*> tmp1(no1,no2);
1070  std::pair<MG_NOEUD*,MG_NOEUD*> tmp2(no2,no1);
1071  std::pair<std::map<MG_NOEUD*,MG_NOEUD*>::iterator,bool> ret=lst2.insert(tmp2);
1072  if (ret.second==false) continue;
1073  lst1.insert(tmp1);
1074  for (int i=0;i<nb1;i++)
1075  for (int j=0;j<nb2;j++)
1076  if (seg->get_noeud1()->get_lien_tetra()->get(i)==seg->get_noeud2()->get_lien_tetra()->get(j))
1077  {
1078  MG_TETRA* tet=seg->get_noeud1()->get_lien_tetra()->get(i);
1079  coq.ajouter(tet);
1080  }
1081  }
1082  }
1084 for (MG_TETRA* tet=coq.get_premier(it2);tet!=NULL;tet=coq.get_suivant(it2))
1085  mai->supprimer_mg_tetraid(tet->get_id());
1086 for (std::multimap<MG_NOEUD*,MG_NOEUD*>::iterator itn=lst1.begin();itn!=lst1.end();itn++)
1087  {
1088  TPL_LISTE_ENTITE<MG_NOEUD*> lsttetaconstruire;
1089  TPL_LISTE_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> lsttetaconstruire2;
1090  coq.vide();
1091  MG_NOEUD* no1=itn->first;
1092  MG_NOEUD* no2=itn->second;
1093  int nb=no2->get_lien_tetra()->get_nb();
1094  for (int i=0;i<nb;i++)
1095  {
1096  MG_TETRA* tet=no2->get_lien_tetra()->get(i);
1097  if (tet->get_noeud1()==no2) lsttetaconstruire.ajouter(no1); else lsttetaconstruire.ajouter(tet->get_noeud1());
1098  if (tet->get_noeud2()==no2) lsttetaconstruire.ajouter(no1); else lsttetaconstruire.ajouter(tet->get_noeud2());
1099  if (tet->get_noeud3()==no2) lsttetaconstruire.ajouter(no1); else lsttetaconstruire.ajouter(tet->get_noeud3());
1100  if (tet->get_noeud4()==no2) lsttetaconstruire.ajouter(no1); else lsttetaconstruire.ajouter(tet->get_noeud4());
1101  lsttetaconstruire2.ajouter(tet->get_lien_topologie());
1102  coq.ajouter(tet);
1103  }
1104 
1105 for (int i=0;i<lsttetaconstruire.get_nb()/4;i++)
1106  {
1107  double qual=OPERATEUR::qualite_tetra(lsttetaconstruire.get(4*i)->get_coord(),lsttetaconstruire.get(4*i+1)->get_coord(),lsttetaconstruire.get(4*i+2)->get_coord(),lsttetaconstruire.get(4*i+3)->get_coord());
1108  if (qual<1e-14) std::cout << qual << std::endl;
1109  mai->ajouter_mg_tetra(lsttetaconstruire2.get(i),lsttetaconstruire.get(4*i),lsttetaconstruire.get(4*i+1),lsttetaconstruire.get(4*i+2),lsttetaconstruire.get(4*i+3),MAGIC::ORIGINE::MAILLEUR_AUTO);
1110  }
1111 
1112  }
1113 for (MG_TETRA* tet=coq.get_premier(it2);tet!=NULL;tet=coq.get_suivant(it2))
1114  mai->supprimer_mg_tetraid(tet->get_id());
1115 
1116 
1117 
1118 
1119 
1120 }
1121 
1122 
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::degre
int degre
Definition: mstruct_generateur_polycristaux.cpp:80
MG_ELEMENT_TOPOLOGIQUE::supprimer_ccf
virtual void supprimer_ccf(int num)
Definition: mg_element_topologique.cpp:241
MG_EXPORT
Definition: mg_export.h:33
MG_GESTIONNAIRE::enregistrer
virtual void enregistrer(std::ostream &o, double version=MAGIC_VERSION_FICHIER_DOUBLE)
Definition: mg_gestionnaire.cpp:1070
FEM_SOLUTION::get_nb_champ
int get_nb_champ(void)
Definition: fem_solution.cpp:467
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
MGASTER::calcule
virtual int calcule(char *nomfichierparam, class FEM_MAILLAGE *fem, char *nometude, int typeetude, char *code=NULL, bool avecenreg=true)
Definition: mgaster.cpp:62
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT()
Definition: mstruct_generateur_polycristaux.cpp:55
FEM_SOLUTION
Definition: fem_solution.h:40
MG_SEGMENT
Definition: mg_segment.h:38
FEM_MAILLAGE::get_suivant_element3
FEM_ELEMENT3 * get_suivant_element3(LISTE_FEM_ELEMENT3::iterator &it)
Definition: fem_maillage.cpp:680
MG_ELEMENT_TOPOLOGIQUE::ajouter_ccf
virtual void ajouter_ccf(char *nom, double val, std::string suiv="NS")
Definition: mg_element_topologique.cpp:159
MG_VOLUME::get_propriete_massique
virtual void get_propriete_massique(class MG_MAILLAGE *mai, double &masse, double &volume, class OT_VECTEUR_3D &cdm, class OT_MATRICE_3D &inertieglobale, class OT_MATRICE_3D &inertiecdm, double dens=1., int sens=1)
Definition: mg_volume.cpp:220
MG_TETRA::get_noeud2
virtual MG_NOEUD * get_noeud2(void)
Definition: mg_tetra.cpp:148
gestionversion.h
MG_GESTIONNAIRE::ajouter_fem_maillage
int ajouter_fem_maillage(FEM_MAILLAGE *femmai)
Definition: mg_gestionnaire.cpp:641
mstruct_outils.h
MSTRUCT::MECANIQUE
@ MECANIQUE
Definition: mstruct_definition.h:28
MAGIC_AFFICHE::active_affichage
virtual void active_affichage(fonction_affiche *fonc)
Definition: magic_affiche.cpp:49
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::tens2
double tens2[9]
Definition: mstruct_generateur_polycristaux.cpp:84
MG_GEOMETRIE::change_valeur_unite
void change_valeur_unite(double val)
Definition: mg_geometrie.cpp:2657
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::dg
double dg
Definition: mstruct_generateur_polycristaux.cpp:81
TPL_MAP_ENTITE
Definition: tpl_map_entite.h:35
MG_GESTIONNAIRE::supprimer_tout_fem_solution
void supprimer_tout_fem_solution(void)
Definition: mg_gestionnaire.cpp:1017
MSTRUCT_BORNE
Definition: mstruct_borne.h:10
OT_PARAMETRES::get_valeur
double get_valeur(std::string chaine, int num=0)
Definition: ot_parametres.cpp:191
BOITE_3D::get_xmin
double get_xmin(void)
Definition: ot_boite_3d.cpp:104
MG_GEOMETRIE::get_suivant_volume
MG_VOLUME * get_suivant_volume(LISTE_MG_VOLUME::iterator &it)
Definition: mg_geometrie.cpp:1702
FCT_TAILLE_FEM_SOLUTION_GENERATEUR_ISOTROPE::construit
virtual void construit(void)
Definition: fct_taille_fem_solution_generateur_isotrope.cpp:66
mailleur2d.h
MG_EXPORT::ecrire_params_aster
void ecrire_params_aster(char *fichier)
Definition: mg_export.cpp:115
OCC_IMPORT::importer_fichier_brep_V2017
class MG_GEOMETRIE * importer_fichier_brep_V2017(class MG_GESTIONNAIRE &gest, char *path_brep, char *nom_caf, int typefichier, double precision=1e-6, bool fusionner_entite_similaire=false)
Definition: occ_import.cpp:92
mstruct_borne.h
MG_TETRA::get_noeud1
virtual MG_NOEUD * get_noeud1(void)
Definition: mg_tetra.cpp:143
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::Evoigt
double Evoigt
Definition: mstruct_generateur_polycristaux.cpp:90
TPL_GRILLE::inserer
virtual void inserer(A a)
Definition: tpl_grille.h:274
MG_GEOMETRIE::get_nb_mg_arete
unsigned int get_nb_mg_arete(void)
Definition: mg_geometrie.cpp:813
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::KDH
double KDH
Definition: mstruct_generateur_polycristaux.cpp:82
OT_PARAMETRES::STRING
@ STRING
Definition: ot_parametres.h:38
OT_PARAMETRES::ajouter
void ajouter(std::string chaine, double valeur, int typep, std::string aide="")
Definition: ot_parametres.cpp:61
MAILLEUR3D::maille
virtual int maille(MG_GROUPE_TOPOLOGIQUE *mggt=NULL)
Definition: mailleur3d.cpp:55
mg_file.h
TPL_GRILLE
Definition: tpl_grille.h:121
FEM_ELEMENT3
Definition: fem_element3.h:34
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::Greuss
double Greuss
Definition: mstruct_generateur_polycristaux.cpp:90
MSTRUCT_GENERATEUR_POLYCRISTAUX::MSTRUCT_GENERATEUR_POLYCRISTAUX
MSTRUCT_GENERATEUR_POLYCRISTAUX()
Definition: mstruct_generateur_polycristaux.cpp:97
MSTRUCT_GENERATEUR_POLYCRISTAUX::affiche
virtual void affiche(char *mess)
Definition: mstruct_generateur_polycristaux.cpp:141
mailleur_analyse.h
MG_GEOMETRIE::get_premier_point
MG_POINT * get_premier_point(LISTE_MG_POINT::iterator &it)
Definition: mg_geometrie.cpp:233
MG_VOLUME
Definition: mg_volume.h:33
MG_GESTIONNAIRE
Definition: mg_gestionnaire.h:57
MG_MAILLAGE::get_premier_segment
MG_SEGMENT * get_premier_segment(LISTE_MG_SEGMENT::iterator &)
Definition: mg_maillage.cpp:630
MAILLEUR3D
Definition: mailleur3d.h:51
MSTRUCT_GENERATEUR_POLYCRISTAUX::ini_param
virtual void ini_param(char *nom)
Definition: mstruct_generateur_polycristaux.cpp:146
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::EDH
double EDH
Definition: mstruct_generateur_polycristaux.cpp:82
MSTRUCT_GENERATEUR_POLYCRISTAUX::~MSTRUCT_GENERATEUR_POLYCRISTAUX
~MSTRUCT_GENERATEUR_POLYCRISTAUX()
Definition: mstruct_generateur_polycristaux.cpp:130
MG_TETRA
Definition: mg_tetra.h:37
MSTRUCT_GENERATEUR_POLYCRISTAUX::cree_param
virtual void cree_param(char *nom, char *nomexe)
Definition: mstruct_generateur_polycristaux.cpp:204
FICHIEROCC
#define FICHIEROCC
Definition: occ_import.h:58
MAILLEUR2D
Definition: mailleur2d.h:49
MAILLEUR1D
Definition: mailleur1d.h:36
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::tens1
double tens1[9]
Definition: mstruct_generateur_polycristaux.cpp:84
MAILLEUR0D
Definition: mailleur0d.h:34
occ_import.h
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::Kvoigt
double Kvoigt
Definition: mstruct_generateur_polycristaux.cpp:90
MG_ARETE::get_tmin
virtual double get_tmin(void)
Definition: mg_arete.cpp:179
MG_GESTIONNAIRE::get_fem_solution
FEM_SOLUTION * get_fem_solution(unsigned int num)
Definition: mg_gestionnaire.cpp:930
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::volume
std::vector< double > volume
Definition: mstruct_generateur_polycristaux.cpp:88
BOITE_3D::get_zmax
double get_zmax(void)
Definition: ot_boite_3d.cpp:129
MGASTER
Definition: mgaster.h:29
BOITE_3D::get_ymin
double get_ymin(void)
Definition: ot_boite_3d.cpp:114
MG_GESTIONNAIRE::ajouter_mg_maillage
int ajouter_mg_maillage(MG_MAILLAGE *mgmai)
Definition: mg_gestionnaire.cpp:521
MG_GESTIONNAIRE::supprimer_mg_maillage
int supprimer_mg_maillage(unsigned int num)
Definition: mg_gestionnaire.cpp:602
MSTRUCT_GENERATEUR_POLYCRISTAUX::active_affichage
virtual void active_affichage(fonction_affiche *fonc)
Definition: mstruct_generateur_polycristaux.cpp:135
MSTRUCT_GENERATEUR_POLYCRISTAUX::optimise_maillage
void optimise_maillage(MG_MAILLAGE *mai)
Definition: mstruct_generateur_polycristaux.cpp:1042
fct_taille_fem_solution_generateur_gradient.h
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::masse
std::vector< double > masse
Definition: mstruct_generateur_polycristaux.cpp:87
mgaster.h
OCC_IMPORT::importer_triangulation_V2017
class MG_MAILLAGE * importer_triangulation_V2017(class MG_GESTIONNAIRE &gest, MG_GEOMETRIE *mggeo, double epsilon=1., int mode=1)
Definition: occ_import.cpp:1122
DEVIATORIQUE
@ DEVIATORIQUE
Definition: ve_definition.h:47
OT_TENSEUR
Definition: ot_tenseur.h:41
MG_EXPORT::change_param_aster
void change_param_aster(char *nomparam, double val)
Definition: mg_export.cpp:105
CONTRAINTE_HOMOGENE
@ CONTRAINTE_HOMOGENE
Definition: ve_definition.h:42
mg_export.h
MG_MAILLAGE::supprimer_mg_tetraid
int supprimer_mg_tetraid(unsigned long num)
Definition: mg_maillage.cpp:1268
lc_point.h
MSTRUCT_GENERATEUR_POLYCRISTAUX
Definition: mstruct_generateur_polycristaux.h:30
BOITE_3D::get_xmax
double get_xmax(void)
Definition: ot_boite_3d.cpp:109
OT_PARAMETRES::get_nom
std::string get_nom(std::string chaine)
Definition: ot_parametres.cpp:266
FEM_MAILLAGE
Definition: fem_maillage.h:66
OT_PARAMETRES::DOUBLE
@ DOUBLE
Definition: ot_parametres.h:38
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::nureuss
double nureuss
Definition: mstruct_generateur_polycristaux.cpp:90
TPL_MAP_ENTITE::get_nb
virtual int get_nb(void)
Definition: tpl_map_entite.h:83
MG_ELEMENT_TOPOLOGIQUE::get_nb_ccf
virtual int get_nb_ccf(void)
Definition: mg_element_topologique.cpp:154
MG_NOEUD
Definition: mg_noeud.h:41
OT_MATRICE_3D
Definition: ot_mathematique.h:160
TPL_GRILLE::rechercher
virtual void rechercher(BOITE_3D bt, TPL_MAP_ENTITE< A > &liste_entite_trouve)
Definition: tpl_grille.h:202
MG_GEOMETRIE::get_mg_arete
MG_ARETE * get_mg_arete(unsigned int num)
Definition: mg_geometrie.cpp:800
MG_MAILLAGE::get_suivant_segment
MG_SEGMENT * get_suivant_segment(LISTE_MG_SEGMENT::iterator &)
Definition: mg_maillage.cpp:638
tpl_grille.h
MG_GESTIONNAIRE::get_fem_maillage
FEM_MAILLAGE * get_fem_maillage(unsigned int num)
Definition: mg_gestionnaire.cpp:670
mailleur1d.h
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
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::Kreuss
double Kreuss
Definition: mstruct_generateur_polycristaux.cpp:90
TPL_MAP_ENTITE::ITERATEUR
std::map< unsigned long, X, std::less< unsigned long > >::iterator ITERATEUR
Definition: tpl_map_entite.h:38
MSTRUCT_GENERATEUR_POLYCRISTAUX::calcule_cacteristique_mecanique
int calcule_cacteristique_mecanique(MG_GESTIONNAIRE *gest, FEM_MAILLAGE *fem, double &epsx, double &epsy, double &epsz, double &epsxy, double &epsxz, double &epsyz, double &sigx, double &sigy, double &sigz, double &sigxy, double &sigxz, double &sigyz)
Definition: mstruct_generateur_polycristaux.cpp:998
MG_GESTIONNAIRE::get_mg_maillage
MG_MAILLAGE * get_mg_maillage(unsigned int num)
Definition: mg_gestionnaire.cpp:550
MAILLEUR_FEM::maille
virtual int maille(class FEM_MAILLAGE *fem, bool courbure_discrete=false, int num=0)
Definition: mailleur_fem.cpp:66
TPL_LISTE_ENTITE::get_nb
virtual int get_nb(void)
Definition: tpl_liste_entite.h:67
MG_SOMMET::get_point
virtual MG_POINT * get_point(void)
Definition: mg_sommet.cpp:52
MG_POINT
Definition: mg_point.h:33
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT
Definition: mstruct_generateur_polycristaux.cpp:52
MG_FILE
Definition: mg_file.h:31
MG_NOEUD::get_lien_tetra
TPL_LISTE_ENTITE< class MG_TETRA * > * get_lien_tetra(void)
Definition: mg_noeud.cpp:175
FEM_SOLUTION::get_nom
std::string get_nom(void)
Definition: fem_solution.cpp:834
MSTRUCT_GENERATEUR_POLYCRISTAUX::affiche2
fonction_affiche * affiche2
Definition: mstruct_generateur_polycristaux.h:48
mstruct_definition.h
MG_COSOMMET::get_sommet
virtual MG_SOMMET * get_sommet(void)
Definition: mg_cosommet.cpp:83
TPL_LISTE_ENTITE::get
virtual X get(int num)
Definition: tpl_liste_entite.h:72
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::cdm
std::vector< OT_VECTEUR_3D > cdm
Definition: mstruct_generateur_polycristaux.cpp:89
POLY_AFFICHE::active_affichage
virtual void active_affichage(fonction_affiche *fonc)
Definition: poly_affiche.cpp:36
BOITE_3D::get_ymax
double get_ymax(void)
Definition: ot_boite_3d.cpp:119
OPERATEUR::qualite_tetra
static double qualite_tetra(double *noeud1, double *noeud2, double *noeud3, double *noeud4)
Definition: ot_mathematique.cpp:1673
MSTRUCT_BORNE::get_tenseur_rigidite
void get_tenseur_rigidite(double E1, double E2, double E3, double G1, double G2, double G3, double nu1, double nu2, double nu3, OT_TENSEUR &rigE)
Definition: mstruct_borne.cpp:80
MAILLEUR_FEM
Definition: mailleur_fem.h:31
MSTRUCT_GENERATEUR_POLYCRISTAUX::param
OT_PARAMETRES param
Definition: mstruct_generateur_polycristaux.h:51
FCT_TAILLE_FEM_SOLUTION::enregistrer
virtual void enregistrer(char *nom)
Definition: fct_taille_fem_solution.cpp:337
polycristal.h
OT_PARAMETRES::enregistrer
void enregistrer(char *nom)
Definition: ot_parametres.cpp:132
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::nbphase
int nbphase
Definition: mstruct_generateur_polycristaux.cpp:85
acos
double2 acos(double2 &val)
Definition: ot_doubleprecision.cpp:224
OT_VECTEUR_3D
Definition: ot_mathematique.h:94
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::KCH
double KCH
Definition: mstruct_generateur_polycristaux.cpp:83
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
Polycristal::construit
virtual void construit(bool avecstep=false)
Definition: polycristal.cpp:75
BOITE_3D
Definition: ot_boite_3d.h:27
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::Ereuss
double Ereuss
Definition: mstruct_generateur_polycristaux.cpp:90
MAGIC::CALCUL_ASTER::ELASTIQUE
@ ELASTIQUE
Definition: mg_definition.h:134
MG_TETRA::get_noeud4
virtual MG_NOEUD * get_noeud4(void)
Definition: mg_tetra.cpp:158
POLYCRISTAUX::POINT_TIRE
Definition: mstruct_generateur_polycristaux.h:58
MSTRUCT_BORNE::get_VoigtReuss_poly
void get_VoigtReuss_poly(double c11, double c12, double c13, double c23, double c22, double c33, double c44, double c55, double c66, double &troisKvoigt, double &deuxGvoigt, double &Evoigt, double &nuvoigt, double &troisKreuss, double &deuxGreuss, double &Ereuss, double &nureuss)
Definition: mstruct_borne.cpp:22
MG_GEOMETRIE::efface_ccf
void efface_ccf(bool volume, bool face, bool arete, bool sommet)
Definition: mg_geometrie.cpp:2717
mstruct_generateur_polycristaux.h
FEM_SOLUTION::get_moyenne_volumique_champs
double get_moyenne_volumique_champs(class MG_VOLUME *vol, int numchamps, int coord=0)
Definition: fem_solution.cpp:564
mailleur3d.h
MAILLEUR1D::maille
int maille(MG_GROUPE_TOPOLOGIQUE *mggt=NULL)
Definition: mailleur1d.cpp:50
MG_GEOMETRIE::ajouter_mg_point
virtual int ajouter_mg_point(MG_POINT *mgpt)
Definition: mg_geometrie.cpp:137
LC_POINT
Definition: lc_point.h:30
MG_GESTIONNAIRE::supprimer_tout_fem_maillage
void supprimer_tout_fem_maillage(void)
Definition: mg_gestionnaire.cpp:723
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::tens3
double tens3[9]
Definition: mstruct_generateur_polycristaux.cpp:84
SPHERIQUE
@ SPHERIQUE
Definition: ve_definition.h:46
MAILLEUR2D::maille
int maille(MG_GROUPE_TOPOLOGIQUE *mggt=NULL)
Definition: mailleur2d.cpp:49
FCT_TAILLE_FEM_SOLUTION_GENERATEUR_GRADIENT
Definition: fct_taille_fem_solution_generateur_gradient.h:28
MG_ELEMENT_MAILLAGE::get_lien_topologie
MG_ELEMENT_TOPOLOGIQUE * get_lien_topologie(void)
Definition: mg_element_maillage.cpp:51
MSTRUCT_GENERATEUR_POLYCRISTAUX::affichageactif
int affichageactif
Definition: mstruct_generateur_polycristaux.h:49
MG_GESTIONNAIRE::get_nb_mg_maillage
unsigned int get_nb_mg_maillage(void)
Definition: mg_gestionnaire.cpp:579
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::nbcristauxphase
std::vector< int > nbcristauxphase
Definition: mstruct_generateur_polycristaux.cpp:86
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
BOITE_3D::get_zmin
double get_zmin(void)
Definition: ot_boite_3d.cpp:124
MGASTER::active_affichage
virtual void active_affichage(void(*fonc)(char *))
Definition: mgaster.cpp:56
MG_GEOMETRIE
Definition: mg_geometrie.h:84
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::nuvoigt
double nuvoigt
Definition: mstruct_generateur_polycristaux.cpp:90
OT_PARAMETRES::lire
int lire(char *nom)
Definition: ot_parametres.cpp:144
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::nbcristaux
int nbcristaux
Definition: mstruct_generateur_polycristaux.cpp:79
OT_VECTEUR_3D::get_longueur
virtual double get_longueur(void) const
Definition: ot_mathematique.cpp:483
MG_MAILLAGE
Definition: mg_maillage.h:62
TPL_LISTE_ENTITE< MG_NOEUD * >
mailleur_fem.h
fonction_affiche
void fonction_affiche(char *)
Definition: fct_taille.h:28
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::Gvoigt
double Gvoigt
Definition: mstruct_generateur_polycristaux.cpp:90
Polycristal
Definition: polycristal.h:31
MSTRUCT_OUTILS::appliquer_conditions_limites
static int appliquer_conditions_limites(MG_GEOMETRIE *m_mg_geometrie, BOITE_3D boite3D_ves, int Type_etude, int Type_CL, int Type_Chargement, double Valeur_CL, int Direction=0, double eps=1.0e-06)
Definition: mstruct_outils.cpp:885
MG_ARETE
Definition: mg_arete.h:36
existe
int existe(const std::vector< T > &vct, double val, int &idx)
MG_GESTIONNAIRE::get_nb_fem_solution
unsigned int get_nb_fem_solution(void)
Definition: mg_gestionnaire.cpp:960
BOITE_3D::change_grosseur
void change_grosseur(double f)
Definition: ot_boite_3d.cpp:176
MG_ARETE::get_cosommet1
virtual class MG_COSOMMET * get_cosommet1(void)
Definition: mg_arete.cpp:81
TPL_MAP_ENTITE::get_suivant
virtual X get_suivant(ITERATEUR &it)
Definition: tpl_map_entite.h:120
MG_ARETE::get_longueur
virtual double get_longueur(double t1, double t2, double precis=1e-6)
Definition: mg_arete.cpp:193
cos
double2 cos(double2 &val)
Definition: ot_doubleprecision.cpp:206
MAGIC::ORIGINE::MAILLEUR_AUTO
@ MAILLEUR_AUTO
Definition: mg_definition.h:79
TPL_GRILLE::initialiser
virtual void initialiser(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax, int nb_pasx, int nb_pasy, int nb_pasz)
Definition: tpl_grille.h:142
MG_GESTIONNAIRE::get_mg_geometrie
MG_GEOMETRIE * get_mg_geometrie(unsigned int num)
Definition: mg_gestionnaire.cpp:331
MSTRUCT_GENERATEUR_POLYCRISTAUX::genere
virtual void genere(char *nommagic)
Definition: mstruct_generateur_polycristaux.cpp:277
TPL_MAP_ENTITE::vide
virtual void vide(void)
Definition: tpl_map_entite.h:106
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::GCH
double GCH
Definition: mstruct_generateur_polycristaux.cpp:83
OCC_IMPORT
Definition: occ_import.h:60
DEFORMATION_HOMOGENE
@ DEFORMATION_HOMOGENE
Definition: ve_definition.h:41
MG_ARETE::get_tmax
virtual double get_tmax(void)
Definition: mg_arete.cpp:184
MG_GEOMETRIE::get_suivant_point
MG_POINT * get_suivant_point(LISTE_MG_POINT::iterator &it)
Definition: mg_geometrie.cpp:241
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::ECH
double ECH
Definition: mstruct_generateur_polycristaux.cpp:83
MAILLEUR0D::maille
int maille(MG_GROUPE_TOPOLOGIQUE *mggt=NULL)
Definition: mailleur0d.cpp:43
MG_POINT::evaluer
virtual void evaluer(double *xyz)=0
mailleur0d.h
MSTRUCT_GENERATEUR_POLYCRISTAUX_RESULTAT::GDH
double GDH
Definition: mstruct_generateur_polycristaux.cpp:82
FEM_MAILLAGE::get_premier_element3
FEM_ELEMENT3 * get_premier_element3(LISTE_FEM_ELEMENT3::iterator &it)
Definition: fem_maillage.cpp:672
sin
double2 sin(double2 &val)
Definition: ot_doubleprecision.cpp:250
OT_PARAMETRES::change_valeur
void change_valeur(std::string chaine, double val, int num=0)
Definition: ot_parametres.cpp:210