ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/microstructure/src/mstruct_analyse.cpp
Revision: 933
Committed: Wed May 23 18:48:54 2018 UTC (6 years, 11 months ago) by couturad
File size: 145701 byte(s)
Log Message:
MICROSTRUCTURE: 
Ajout d'un exportateur de maillage au format Abaqus
Mise a jour des fonctionnalites

File Contents

# User Rev Content
1 couturad 919 #include "mstruct_analyse.h"
2     #include "parse.h"
3     #include "pars_argument.h"
4 couturad 926 #include "mg_cg_modele.h"
5     #include "mstruct_outils.h"
6     #include "mg_cg_groupe_forme.h"
7     #include "mg_cg_assemblage.h"
8     #include "magic_plot.h"
9     #include <mg_gestionnaire.h>
10 couturad 919 using namespace MICROSTRUCTURE;
11    
12 couturad 926 MSTRUCT_ANALYSE::MSTRUCT_ANALYSE(void)
13 couturad 919 {
14 couturad 926 m_identifiant="";
15     m_boite_analyse=NULL;
16     m_nom_groupe_forme="";
17 couturad 919 }
18    
19 couturad 926 MSTRUCT_ANALYSE::MSTRUCT_ANALYSE(string identifiant, string nom_groupe_forme, BOITE_3D* boite_3d , long nb_ves)
20 couturad 919 {
21 couturad 926 m_identifiant=identifiant;
22     if(boite_3d!=NULL) m_boite_analyse=new BOITE_3D(*boite_3d);
23     else m_boite_analyse=NULL;
24     m_nom_groupe_forme=nom_groupe_forme;
25 couturad 933 m_nb_ves=nb_ves;
26 couturad 919 }
27    
28 couturad 926 MSTRUCT_ANALYSE::MSTRUCT_ANALYSE(MSTRUCT_ANALYSE& mdd)
29 couturad 919 {
30 couturad 926 m_identifiant=mdd.m_identifiant;
31     if(mdd.m_boite_analyse!=NULL) m_boite_analyse=new BOITE_3D(*mdd.m_boite_analyse);
32     else m_boite_analyse=NULL;
33     m_nom_groupe_forme=mdd.m_nom_groupe_forme;
34 couturad 927 m_nb_ves=mdd.m_nb_ves;
35 couturad 919 }
36    
37 couturad 926 MSTRUCT_ANALYSE::~MSTRUCT_ANALYSE(void)
38 couturad 919 {
39 couturad 926 if(m_boite_analyse!=NULL) delete m_boite_analyse;
40     }
41    
42     void MSTRUCT_ANALYSE::change_identifiant(string identifiant)
43     {
44 couturad 919 m_identifiant=identifiant;
45     }
46    
47 couturad 926 string MSTRUCT_ANALYSE::get_identifiant(void)
48 couturad 919 {
49 couturad 926 return m_identifiant;
50 couturad 919 }
51    
52 couturad 926 void MSTRUCT_ANALYSE::change_boite_analyse(BOITE_3D boite_3d)
53 couturad 919 {
54 couturad 926 delete m_boite_analyse;
55     m_boite_analyse=new BOITE_3D(boite_3d);
56 couturad 919 }
57    
58 couturad 926 BOITE_3D* MSTRUCT_ANALYSE::get_boite_analyse(void)
59 couturad 919 {
60     return m_boite_analyse;
61     }
62    
63 couturad 926 void MSTRUCT_ANALYSE::change_nom_groupe_forme(string nom_groupe_forme)
64 couturad 919 {
65 couturad 926 m_nom_groupe_forme=nom_groupe_forme;
66 couturad 919 }
67    
68 couturad 926 string MSTRUCT_ANALYSE::get_nom_groupe_forme(void)
69 couturad 919 {
70 couturad 926 return m_nom_groupe_forme;
71 couturad 919 }
72    
73 couturad 926 long int MSTRUCT_ANALYSE::get_nb_ves(void)
74 couturad 919 {
75 couturad 926 return m_nb_ves;
76     }
77    
78    
79     void MSTRUCT_ANALYSE::enregistrer(ofstream& ofstrm)
80     {
81     size_t len_identifiant = m_identifiant.size();
82     ofstrm.write((char*)&len_identifiant,sizeof(size_t));
83     ofstrm.write(m_identifiant.c_str(),m_identifiant.size());
84 couturad 919
85 couturad 926 size_t len_nom_groupe_forme = m_nom_groupe_forme.size();
86     ofstrm.write((char*)&len_nom_groupe_forme,sizeof(size_t));
87     ofstrm.write(m_nom_groupe_forme.c_str(),m_nom_groupe_forme.size());
88    
89     bool avec_boite;
90     if(m_boite_analyse==NULL) avec_boite=false;
91     else avec_boite=true;
92     ofstrm.write((char*)&avec_boite,sizeof(bool));
93     if(avec_boite)
94     {
95     double xmin=m_boite_analyse->get_xmin();
96     ofstrm.write((char*)&xmin,sizeof(double));
97     double ymin=m_boite_analyse->get_ymin();
98     ofstrm.write((char*)&ymin,sizeof(double));
99     double zmin=m_boite_analyse->get_zmin();
100     ofstrm.write((char*)&zmin,sizeof(double));
101     double xmax=m_boite_analyse->get_xmax();
102     ofstrm.write((char*)&xmax,sizeof(double));
103     double ymax=m_boite_analyse->get_ymax();
104     ofstrm.write((char*)&ymax,sizeof(double));
105     double zmax=m_boite_analyse->get_zmax();
106     ofstrm.write((char*)&zmax,sizeof(double));
107     }
108     ofstrm.write((char*)&m_nb_ves,sizeof(long));
109 couturad 919 }
110 couturad 926
111     void MSTRUCT_ANALYSE::ouvrir(ifstream& ifstrm)
112     {
113     size_t len_identifiant;
114     ifstrm.read((char*)&len_identifiant,sizeof(size_t));
115     char *temp_identifiant = new char[len_identifiant+1];
116     ifstrm.read(temp_identifiant,len_identifiant);
117     temp_identifiant[len_identifiant]='\0';
118     m_identifiant=temp_identifiant;
119     delete [] temp_identifiant;
120    
121     size_t len_nom_groupe_forme;
122     ifstrm.read((char*)&len_nom_groupe_forme,sizeof(size_t));
123     char *temp_nom_groupe_forme = new char[len_nom_groupe_forme+1];
124     ifstrm.read(temp_nom_groupe_forme,len_nom_groupe_forme);
125     temp_nom_groupe_forme[len_nom_groupe_forme]='\0';
126     m_nom_groupe_forme=temp_nom_groupe_forme;
127     delete [] temp_nom_groupe_forme;
128    
129     bool avec_boite;
130     ifstrm.read((char*)&avec_boite,sizeof(bool));
131    
132     if(avec_boite)
133     {
134     double xmin;
135     ifstrm.read((char*)&xmin,sizeof(double));
136     double ymin;
137     ifstrm.read((char*)&ymin,sizeof(double));
138     double zmin;
139     ifstrm.read((char*)&zmin,sizeof(double));
140     double xmax;
141     ifstrm.read((char*)&xmax,sizeof(double));
142     double ymax;
143     ifstrm.read((char*)&ymax,sizeof(double));
144     double zmax;
145     ifstrm.read((char*)&zmax,sizeof(double));
146     m_boite_analyse = new BOITE_3D(xmin,ymin,zmin,xmax,ymax,zmax);
147     }
148     else m_boite_analyse=NULL;
149     ifstrm.read((char*)&m_nb_ves,sizeof(long));
150     }
151    
152     void MSTRUCT_ANALYSE::affiche_contenu(MICROSTRUCTURE::fonction_affiche* fonc)
153     {
154     char ligne[5000];
155     sprintf(ligne,"MSTRUCT_ANALYSE");
156     fonc(ligne);
157     sprintf(ligne,"-> Identifiant : %s", m_identifiant.c_str());
158     fonc(ligne);
159     if(m_boite_analyse!=NULL) sprintf(ligne,"-> Boite_3D : [%lf,%lf,%lf,%lf,%lf,%lf]", m_boite_analyse->get_xmin(),
160     m_boite_analyse->get_ymin(),
161     m_boite_analyse->get_zmin(),
162     m_boite_analyse->get_xmax(),
163     m_boite_analyse->get_ymax(),
164     m_boite_analyse->get_zmax());
165     else sprintf(ligne,"-> Boite_3D : NULL");
166     fonc(ligne);
167     if(m_nom_groupe_forme!="") sprintf(ligne,"-> MG_CG_GROUPE_FORME : %s",m_nom_groupe_forme.c_str());
168     else sprintf(ligne,"-> MG_CG_GROUPE_FORME : NULL");
169     fonc(ligne);
170     sprintf(ligne,"-> NB ves : %li", m_nb_ves);
171     fonc(ligne);
172     }
173    
174    
175     MSTRUCT_ANALYSE_CHAMP::MSTRUCT_ANALYSE_CHAMP(void): MSTRUCT_ANALYSE()
176     {
177     }
178    
179     MSTRUCT_ANALYSE_CHAMP::MSTRUCT_ANALYSE_CHAMP(string identifiant, long int id_fem_solution, int nb_champ, double largeur_colonne, string nom_groupe_forme, BOITE_3D* boite_3d): MSTRUCT_ANALYSE(identifiant,nom_groupe_forme,boite_3d)
180     {
181     m_id_fem_solution=id_fem_solution;
182     m_nb_champ=nb_champ;
183     m_moyenne = new double[m_nb_champ];
184     m_ecart_type = new double[m_nb_champ];
185     m_min = new double[m_nb_champ];
186     m_max = new double[m_nb_champ];
187     m_tab_histogramme=new OT_HISTOGRAMME*[m_nb_champ];
188     for(int i=0;i<m_nb_champ;i++)
189     {
190     m_tab_histogramme[i] = new OT_HISTOGRAMME(largeur_colonne);
191     }
192     }
193    
194     MSTRUCT_ANALYSE_CHAMP::MSTRUCT_ANALYSE_CHAMP(std::vector< MSTRUCT_ANALYSE_CHAMP* >& vector_analyse_champ): MSTRUCT_ANALYSE()
195     {
196     std::vector<MSTRUCT_ANALYSE_CHAMP*>::iterator it_analyse=vector_analyse_champ.begin();
197     MSTRUCT_ANALYSE_CHAMP* analyse = *it_analyse;
198     m_identifiant=analyse->get_identifiant();
199     if(analyse->get_boite_analyse()!=NULL) change_boite_analyse(*analyse->get_boite_analyse());
200     m_nom_groupe_forme=analyse->get_nom_groupe_forme();
201     m_nb_ves=vector_analyse_champ.size();
202     m_id_fem_solution=-1;
203     m_nb_champ=analyse->get_nb_champ();
204     double largeur_colonne=analyse->get_distribution(0)->get_largeur_colonne();
205     m_moyenne = new double[m_nb_champ];
206     m_ecart_type = new double[m_nb_champ];
207     m_min = new double[m_nb_champ];
208     m_max = new double[m_nb_champ];
209     m_tab_histogramme=new OT_HISTOGRAMME*[m_nb_champ];
210     for(int i=0;i<m_nb_champ;i++)
211     {
212     m_tab_histogramme[i] = new OT_HISTOGRAMME(largeur_colonne);
213     }
214     for(int i=0;i<m_nb_champ;i++)
215     {
216     m_moyenne[i]=0;
217     m_ecart_type[i]=0;
218     m_min[i]=numeric_limits< double >::max();
219     m_max[i]=numeric_limits< double >::min();
220     }
221     for(it_analyse=vector_analyse_champ.begin();it_analyse!=vector_analyse_champ.end();it_analyse++)
222     {
223     analyse = *it_analyse;
224     for(int i=0;i<m_nb_champ;i++)
225     {
226     m_moyenne[i]+=analyse->get_moyenne()[i];
227     if(analyse->get_tenseur_min()[i]<m_min[i]) m_min[i]=analyse->get_tenseur_min()[i];
228     if(analyse->get_tenseur_max()[i]>m_max[i]) m_max[i]=analyse->get_tenseur_max()[i];
229     std::map<long,double>::iterator it_his;
230     double val;
231     long l;
232     int k=analyse->get_distribution(i)->get_premiere_valeur(it_his,val,l);
233     while(k!=0)
234     {
235     m_tab_histogramme[i]->ajouter_valeur(l,val/m_nb_ves);
236     k=analyse->get_distribution(i)->get_suivante_valeur(it_his,val,l);
237     }
238     }
239     }
240     for(int i=0;i<m_nb_champ;i++)
241     {
242     m_moyenne[i]=m_moyenne[i]/m_nb_ves;
243     }
244 couturad 927 if(m_nb_ves>1)
245 couturad 926 {
246 couturad 927 for(it_analyse=vector_analyse_champ.begin();it_analyse!=vector_analyse_champ.end();it_analyse++)
247     {
248     analyse = *it_analyse;
249     for(int i=0;i<m_nb_champ;i++)
250     {
251     m_ecart_type[i]+=(analyse->get_moyenne()[i]-m_moyenne[i])*(analyse->get_moyenne()[i]-m_moyenne[i]);
252     }
253     }
254 couturad 926 for(int i=0;i<m_nb_champ;i++)
255     {
256 couturad 927 m_ecart_type[i]=sqrt(m_ecart_type[i]*(1.0/(m_nb_ves-1.0)));
257     }
258 couturad 926 }
259     }
260    
261     MSTRUCT_ANALYSE_CHAMP::MSTRUCT_ANALYSE_CHAMP(MSTRUCT_ANALYSE_CHAMP& mdd): MSTRUCT_ANALYSE(mdd)
262     {
263     m_id_fem_solution=mdd.m_id_fem_solution;
264     m_nb_champ=mdd.m_nb_champ;
265     m_moyenne = new double[m_nb_champ];
266     m_ecart_type = new double[m_nb_champ];
267     m_min = new double[m_nb_champ];
268     m_max = new double[m_nb_champ];
269     m_tab_histogramme=new OT_HISTOGRAMME*[m_nb_champ];
270     for(int i=0;i<m_nb_champ;i++)
271     {
272     m_moyenne[i]=mdd.m_moyenne[i];
273     m_ecart_type[i]=mdd.m_ecart_type[i];
274     m_min[i]=mdd.m_min[i];
275     m_max[i]=mdd.m_max[i];
276     m_tab_histogramme[i]=mdd.m_tab_histogramme[i];
277     }
278     }
279    
280     MSTRUCT_ANALYSE_CHAMP::~MSTRUCT_ANALYSE_CHAMP(void)
281     {
282     if(m_nb_champ>0)
283     {
284     delete [] m_moyenne;
285     delete [] m_ecart_type;
286     delete [] m_min;
287     delete [] m_max;
288     for(int i=0;i<m_nb_champ;i++) delete m_tab_histogramme[i];
289     delete [] m_tab_histogramme;
290     }
291     }
292    
293     long int MSTRUCT_ANALYSE_CHAMP::get_id_fem_solution(void)
294     {
295     return m_id_fem_solution;
296     }
297    
298     int MSTRUCT_ANALYSE_CHAMP::get_nb_champ(void)
299     {
300     return m_nb_champ;
301     }
302    
303     double* MSTRUCT_ANALYSE_CHAMP::get_moyenne(void)
304     {
305     return m_moyenne;
306     }
307    
308     double* MSTRUCT_ANALYSE_CHAMP::get_tenseur_ecart_type(void)
309     {
310     return m_ecart_type;
311     }
312    
313     double* MSTRUCT_ANALYSE_CHAMP::get_tenseur_min(void)
314     {
315     return m_min;
316     }
317    
318     double* MSTRUCT_ANALYSE_CHAMP::get_tenseur_max(void)
319     {
320     return m_max;
321     }
322    
323     OT_HISTOGRAMME* MSTRUCT_ANALYSE_CHAMP::get_distribution(int num_champ)
324     {
325     return m_tab_histogramme[num_champ];
326     }
327    
328     long int MSTRUCT_ANALYSE_CHAMP::get_type(void)
329     {
330     return TYPE_ANALYSE::CHAMP;
331     }
332    
333     void MSTRUCT_ANALYSE_CHAMP::executer(MSTRUCT_VES* ves)
334     {
335     FEM_SOLUTION* fem_sol = ves->get_mg_gestionnaire()->get_fem_solutionid(m_id_fem_solution);
336     MG_CG_GROUPE_FORME* groupe_forme=NULL;
337     if(m_nom_groupe_forme!="ALL") groupe_forme=ves->get_mgcg_modele()->get_mgcg_groupe_forme(m_nom_groupe_forme);
338     OUTILS::statistiques_champ_volumique(fem_sol,groupe_forme,m_boite_analyse,m_moyenne,m_ecart_type,m_min,m_max,m_tab_histogramme);
339     }
340    
341     void MSTRUCT_ANALYSE_CHAMP::exporter(ofstream& ofstrm, long int i, bool avec_histo, char* prefix_histo)
342     {
343 couturad 927 if(i==1) ofstrm << "#(1) [CHAMP](2-nb_champ) [±] [min] [max]" << std::endl;
344 couturad 926 ofstrm << i << " ";
345     for(int j=0;j<m_nb_champ;j++)
346     {
347     ofstrm << m_moyenne[j] << " ";
348     }
349     for(int j=0;j<m_nb_champ;j++)
350     {
351     ofstrm << m_ecart_type[j] << " ";
352     }
353     for(int j=0;j<m_nb_champ;j++)
354     {
355     ofstrm << m_min[j] << " ";
356     }
357     for(int j=0;j<m_nb_champ;j++)
358     {
359     ofstrm << m_max[j] << " ";
360     }
361     ofstrm << std::endl;
362     if(avec_histo)
363     for(int j=0;j<m_nb_champ;j++)
364     {
365     char nom_fichier[500];
366     sprintf(nom_fichier,"%shisto_%s_%i.txt",prefix_histo,m_identifiant.c_str(),j);
367     ofstream of_histo(nom_fichier,std::ios::out|std::ios::trunc);
368     of_histo.precision(16);
369     of_histo.setf(std::ios::showpoint);
370     m_tab_histogramme[j]->exporter(of_histo);
371     of_histo.close();
372 couturad 927
373     if(m_nb_champ==6)
374     {
375     OT_TENSEUR tenseur(3,3);
376     tenseur(0,0)=m_moyenne[0];
377     tenseur(1,1)=m_moyenne[1];
378     tenseur(2,2)=m_moyenne[2];
379     tenseur(0,1)=m_moyenne[3];
380     tenseur(0,2)=m_moyenne[4];
381     tenseur(1,2)=m_moyenne[5];
382     tenseur(1,0)=m_moyenne[3];
383     tenseur(2,0)=m_moyenne[4];
384     tenseur(2,1)=m_moyenne[5];
385     OT_TENSEUR tenseur_ecart_type(3,3);
386     tenseur_ecart_type(0,0)=m_ecart_type[0];
387     tenseur_ecart_type(1,1)=m_ecart_type[1];
388     tenseur_ecart_type(2,2)=m_ecart_type[2];
389     tenseur_ecart_type(0,1)=m_ecart_type[3];
390     tenseur_ecart_type(0,2)=m_ecart_type[4];
391     tenseur_ecart_type(1,2)=m_ecart_type[5];
392     tenseur_ecart_type(1,0)=m_ecart_type[3];
393     tenseur_ecart_type(2,0)=m_ecart_type[4];
394     tenseur_ecart_type(2,1)=m_ecart_type[5];
395     char nom_plot[500];
396     sprintf(nom_plot,"%stenseur_%s.plt",prefix_histo,m_identifiant.c_str());
397     MAGIC_PLOT magic_plot;
398     magic_plot.tenseur_couleur=MAGIC_PLOT::COULEUR::GRIS;
399     magic_plot.tenseur_titre="Tenseur champ";
400     magic_plot.tenseur_titrebarcouleur="";
401     magic_plot.plot_script_tenseur(2,tenseur,tenseur_ecart_type,nom_plot,true);
402     }
403 couturad 926 }
404     }
405    
406     void MSTRUCT_ANALYSE_CHAMP::enregistrer(std::ofstream& ofstrm)
407     {
408     long type_analyse=get_type();
409     ofstrm.write((char*)&type_analyse,sizeof(long));
410     MICROSTRUCTURE::MSTRUCT_ANALYSE::enregistrer(ofstrm);
411     ofstrm.write((char*)&m_id_fem_solution,sizeof(long));
412     ofstrm.write((char*)&m_nb_champ,sizeof(int));
413     for(int i=0;i<m_nb_champ;i++)
414     {
415     ofstrm.write((char*)&m_moyenne[i],sizeof(double));
416     ofstrm.write((char*)&m_ecart_type[i],sizeof(double));
417     ofstrm.write((char*)&m_min[i],sizeof(double));
418     ofstrm.write((char*)&m_max[i],sizeof(double));
419     m_tab_histogramme[i]->enregistrer_bin(ofstrm);
420     }
421     }
422    
423     void MSTRUCT_ANALYSE_CHAMP::ouvrir(std::ifstream& ifstrm)
424     {
425     MICROSTRUCTURE::MSTRUCT_ANALYSE::ouvrir(ifstrm);
426     ifstrm.read((char*)&m_id_fem_solution,sizeof(long));
427     ifstrm.read((char*)&m_nb_champ,sizeof(int));
428     m_moyenne = new double[m_nb_champ];
429     m_ecart_type = new double[m_nb_champ];
430     m_min = new double[m_nb_champ];
431     m_max = new double[m_nb_champ];
432     m_tab_histogramme=new OT_HISTOGRAMME*[m_nb_champ];
433     for(int i=0;i<m_nb_champ;i++)
434     {
435     ifstrm.read((char*)&m_moyenne[i],sizeof(double));
436     ifstrm.read((char*)&m_ecart_type[i],sizeof(double));
437     ifstrm.read((char*)&m_min[i],sizeof(double));
438     ifstrm.read((char*)&m_max[i],sizeof(double));
439     m_tab_histogramme[i] = new OT_HISTOGRAMME();
440     m_tab_histogramme[i]->ouvrir_bin(ifstrm);
441     }
442     }
443    
444     void MSTRUCT_ANALYSE_CHAMP::affiche_contenu(MICROSTRUCTURE::fonction_affiche* fonc)
445     {
446     MICROSTRUCTURE::MSTRUCT_ANALYSE::affiche_contenu(fonc);
447     char ligne[5000];
448     sprintf(ligne,"MSTRUCT_ANALYSE_CHAMP");
449     fonc(ligne);
450     sprintf(ligne,"-> ID FEM solution : %li", m_id_fem_solution);
451     fonc(ligne);
452     sprintf(ligne,"-> NB champ : %i", m_nb_champ);
453     fonc(ligne);
454     char valeur[100];
455     sprintf(ligne,"-> Moyenne : [");
456     for(int i=0;i<m_nb_champ-1;i++)
457     {
458     sprintf(valeur,"%lf,",m_moyenne[i]);
459     strcat(ligne,valeur);
460     }
461     sprintf(valeur,"%lf]",m_moyenne[m_nb_champ-1]);
462     strcat(ligne,valeur);
463     fonc(ligne);
464     sprintf(ligne,"-> Ecart-type : [");
465     for(int i=0;i<m_nb_champ-1;i++)
466     {
467     sprintf(valeur,"%lf,",m_ecart_type[i]);
468     strcat(ligne,valeur);
469     }
470     sprintf(valeur,"%lf]",m_ecart_type[m_nb_champ-1]);
471     strcat(ligne,valeur);
472     fonc(ligne);
473     sprintf(ligne,"-> Min : [");
474     for(int i=0;i<m_nb_champ-1;i++)
475     {
476     sprintf(valeur,"%lf,",m_min[i]);
477     strcat(ligne,valeur);
478     }
479     sprintf(valeur,"%lf]",m_min[m_nb_champ-1]);
480     strcat(ligne,valeur);
481     fonc(ligne);
482     sprintf(ligne,"-> Max : [");
483     for(int i=0;i<m_nb_champ-1;i++)
484     {
485     sprintf(valeur,"%lf,",m_max[i]);
486     strcat(ligne,valeur);
487     }
488     sprintf(valeur,"%lf]",m_max[m_nb_champ-1]);
489     strcat(ligne,valeur);
490     fonc(ligne);
491     for(int i=0;i<m_nb_champ;i++)
492     {
493     sprintf(ligne,"-> OT_HISTOGRAMME[%i] : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)",i,
494     m_tab_histogramme[i]->get_nb_colonne(),
495     m_tab_histogramme[i]->get_largeur_colonne(),
496     m_tab_histogramme[i]->get_x_min(),
497     m_tab_histogramme[i]->get_x_max());
498     fonc(ligne);
499     }
500     }
501    
502    
503    
504    
505    
506    
507     MSTRUCT_ANALYSE_ORIENTATION::MSTRUCT_ANALYSE_ORIENTATION(void): MSTRUCT_ANALYSE()
508     {
509     }
510    
511     MSTRUCT_ANALYSE_ORIENTATION::MSTRUCT_ANALYSE_ORIENTATION(string identifiant,
512     string nom_groupe_forme,
513     BOITE_3D* boite_3d): MSTRUCT_ANALYSE(identifiant, nom_groupe_forme, boite_3d)
514     {
515     }
516    
517     MSTRUCT_ANALYSE_ORIENTATION::MSTRUCT_ANALYSE_ORIENTATION(MSTRUCT_ANALYSE_ORIENTATION& mdd): MSTRUCT_ANALYSE(mdd)
518     {
519     for(int i=0;i<6;i++)
520     {
521     m_moyenne[i]=mdd.m_moyenne[i];
522     m_ecart_type[i]=mdd.m_ecart_type[i];
523     m_min[i]=mdd.m_min[i];
524     m_max[i]=mdd.m_max[i];
525     }
526     }
527    
528     MSTRUCT_ANALYSE_ORIENTATION::MSTRUCT_ANALYSE_ORIENTATION(std::vector< MSTRUCT_ANALYSE_ORIENTATION* >& vector_analyse_orientation): MSTRUCT_ANALYSE()
529     {
530     std::vector<MSTRUCT_ANALYSE_ORIENTATION*>::iterator it_analyse=vector_analyse_orientation.begin();
531     MSTRUCT_ANALYSE_ORIENTATION* analyse = *it_analyse;
532     m_identifiant=analyse->get_identifiant();
533     if(analyse->get_boite_analyse()!=NULL) change_boite_analyse(*analyse->get_boite_analyse());
534     m_nom_groupe_forme=analyse->get_nom_groupe_forme();
535     m_nb_ves=vector_analyse_orientation.size();
536     for(int i=0;i<6;i++)
537     {
538     m_moyenne[i]=0;
539     m_ecart_type[i]=0;
540     m_min[i]=numeric_limits< double >::max();
541     m_max[i]=numeric_limits< double >::min();
542     }
543     for(it_analyse=vector_analyse_orientation.begin();it_analyse!=vector_analyse_orientation.end();it_analyse++)
544     {
545     analyse = *it_analyse;
546     for(int i=0;i<6;i++)
547     {
548     m_moyenne[i]+=analyse->get_moyenne()[i];
549     if(analyse->get_min()[i]<m_min[i]) m_min[i]=analyse->get_min()[i];
550     if(analyse->get_max()[i]>m_max[i]) m_max[i]=analyse->get_max()[i];
551     }
552     }
553     for(int i=0;i<6;i++)
554     {
555     m_moyenne[i]=m_moyenne[i]/m_nb_ves;
556     }
557     if(m_nb_ves>1)
558     {
559     for(it_analyse=vector_analyse_orientation.begin();it_analyse!=vector_analyse_orientation.end();it_analyse++)
560     {
561     analyse = *it_analyse;
562     for(int i=0;i<6;i++)
563     {
564     m_ecart_type[i]+=(analyse->get_moyenne()[i]-m_moyenne[i])*(analyse->get_moyenne()[i]-m_moyenne[i]);
565     }
566     }
567     for(int i=0;i<6;i++)
568     {
569     m_ecart_type[i]=sqrt(m_ecart_type[i]*(1.0/(m_nb_ves-1.0)));
570     }
571     }
572     }
573    
574    
575     MSTRUCT_ANALYSE_ORIENTATION::~MSTRUCT_ANALYSE_ORIENTATION(void)
576     {
577     }
578    
579     double* MSTRUCT_ANALYSE_ORIENTATION::get_moyenne(void)
580     {
581     return m_moyenne;
582     }
583    
584     double* MSTRUCT_ANALYSE_ORIENTATION::get_ecart_type(void)
585     {
586     return m_ecart_type;
587     }
588    
589     double* MSTRUCT_ANALYSE_ORIENTATION::get_min(void)
590     {
591     return m_min;
592     }
593    
594     double* MSTRUCT_ANALYSE_ORIENTATION::get_max(void)
595     {
596     return m_max;
597     }
598    
599     long int MSTRUCT_ANALYSE_ORIENTATION::get_type(void)
600     {
601     return TYPE_ANALYSE::ORIENTATION;
602     }
603    
604     void MSTRUCT_ANALYSE_ORIENTATION::executer(MSTRUCT_VES* ves)
605     {
606     MG_CG_GROUPE_FORME* groupe_forme=NULL;
607     if(m_nom_groupe_forme!="ALL") groupe_forme=ves->get_mgcg_modele()->get_mgcg_groupe_forme(m_nom_groupe_forme);
608     OUTILS::statistiques_tenseur_orientation(groupe_forme,m_boite_analyse,m_moyenne,m_ecart_type,m_min,m_max);
609     }
610    
611     void MSTRUCT_ANALYSE_ORIENTATION::exporter(ofstream& ofstrm, long int i, bool avec_histo, char* prefix_histo)
612     {
613 couturad 927 if(i==1) ofstrm << "#(1) [ORIENTATION](2-7) [±](8-13) [min](14-19) [max](20-25)" << std::endl;
614 couturad 926 ofstrm << i << " ";
615     for(int j=0;j<6;j++)
616     {
617     ofstrm << m_moyenne[j] << " ";
618     }
619     for(int j=0;j<6;j++)
620     {
621     ofstrm << m_ecart_type[j] << " ";
622     }
623     for(int j=0;j<6;j++)
624     {
625     ofstrm << m_min[j] << " ";
626     }
627     for(int j=0;j<6;j++)
628     {
629     ofstrm << m_max[j] << " ";
630     }
631     ofstrm << std::endl;
632     if(avec_histo)
633     {
634     OT_TENSEUR tenseur_orientation(3,3);
635     tenseur_orientation(0,0)=m_moyenne[0];
636     tenseur_orientation(1,1)=m_moyenne[1];
637     tenseur_orientation(2,2)=m_moyenne[2];
638     tenseur_orientation(0,1)=m_moyenne[3];
639     tenseur_orientation(0,2)=m_moyenne[4];
640     tenseur_orientation(1,2)=m_moyenne[5];
641     tenseur_orientation(1,0)=m_moyenne[3];
642     tenseur_orientation(2,0)=m_moyenne[4];
643     tenseur_orientation(2,1)=m_moyenne[5];
644     OT_TENSEUR tenseur_orientation_ecart_type(3,3);
645     tenseur_orientation_ecart_type(0,0)=m_ecart_type[0];
646     tenseur_orientation_ecart_type(1,1)=m_ecart_type[1];
647     tenseur_orientation_ecart_type(2,2)=m_ecart_type[2];
648     tenseur_orientation_ecart_type(0,1)=m_ecart_type[3];
649     tenseur_orientation_ecart_type(0,2)=m_ecart_type[4];
650     tenseur_orientation_ecart_type(1,2)=m_ecart_type[5];
651     tenseur_orientation_ecart_type(1,0)=m_ecart_type[3];
652     tenseur_orientation_ecart_type(2,0)=m_ecart_type[4];
653     tenseur_orientation_ecart_type(2,1)=m_ecart_type[5];
654     char nom_plot[500];
655     sprintf(nom_plot,"%stenseur_%s.plt",prefix_histo,m_identifiant.c_str());
656     MAGIC_PLOT magic_plot;
657     magic_plot.tenseur_couleur=MAGIC_PLOT::COULEUR::GRIS;
658     magic_plot.tenseur_titre="Tenseur d'orientation";
659     magic_plot.tenseur_titrebarcouleur="";
660     magic_plot.plot_script_tenseur(2,tenseur_orientation,tenseur_orientation_ecart_type,nom_plot,true);
661     }
662     }
663    
664     void MSTRUCT_ANALYSE_ORIENTATION::enregistrer(ofstream& ofstrm)
665     {
666     long type_analyse=get_type();
667     ofstrm.write((char*)&type_analyse,sizeof(long));
668     MICROSTRUCTURE::MSTRUCT_ANALYSE::enregistrer(ofstrm);
669     for(int i=0;i<6;i++)
670     {
671     ofstrm.write((char*)&m_moyenne[i],sizeof(double));
672     ofstrm.write((char*)&m_ecart_type[i],sizeof(double));
673     ofstrm.write((char*)&m_min[i],sizeof(double));
674     ofstrm.write((char*)&m_max[i],sizeof(double));
675     }
676     }
677    
678     void MSTRUCT_ANALYSE_ORIENTATION::ouvrir(ifstream& ifstrm)
679     {
680     MICROSTRUCTURE::MSTRUCT_ANALYSE::ouvrir(ifstrm);
681     for(int i=0;i<6;i++)
682     {
683     ifstrm.read((char*)&m_moyenne[i],sizeof(double));
684     ifstrm.read((char*)&m_ecart_type[i],sizeof(double));
685     ifstrm.read((char*)&m_min[i],sizeof(double));
686     ifstrm.read((char*)&m_max[i],sizeof(double));
687     }
688     }
689    
690     void MSTRUCT_ANALYSE_ORIENTATION::affiche_contenu(MICROSTRUCTURE::fonction_affiche* fonc)
691     {
692     MICROSTRUCTURE::MSTRUCT_ANALYSE::affiche_contenu(fonc);
693     char ligne[5000];
694     sprintf(ligne,"MSTRUCT_ANALYSE_ORIENTATION");
695     fonc(ligne);
696     char valeur[100];
697     sprintf(ligne,"-> Moyenne : [");
698     for(int i=0;i<5;i++)
699     {
700     sprintf(valeur,"%lf,",m_moyenne[i]);
701     strcat(ligne,valeur);
702     }
703     sprintf(valeur,"%lf]",m_moyenne[5]);
704     strcat(ligne,valeur);
705     fonc(ligne);
706     sprintf(ligne,"-> Ecart-type : [");
707     for(int i=0;i<5;i++)
708     {
709     sprintf(valeur,"%lf,",m_ecart_type[i]);
710     strcat(ligne,valeur);
711     }
712     sprintf(valeur,"%lf]",m_ecart_type[5]);
713     strcat(ligne,valeur);
714     fonc(ligne);
715     sprintf(ligne,"-> Min : [");
716     for(int i=0;i<5;i++)
717     {
718     sprintf(valeur,"%lf,",m_min[i]);
719     strcat(ligne,valeur);
720     }
721     sprintf(valeur,"%lf]",m_min[5]);
722     strcat(ligne,valeur);
723     fonc(ligne);
724     sprintf(ligne,"-> Max : [");
725     for(int i=0;i<5;i++)
726     {
727     sprintf(valeur,"%lf,",m_max[i]);
728     strcat(ligne,valeur);
729     }
730     sprintf(valeur,"%lf]",m_max[5]);
731     strcat(ligne,valeur);
732     fonc(ligne);
733     }
734    
735    
736    
737     MSTRUCT_ANALYSE_CAO::MSTRUCT_ANALYSE_CAO(void): MSTRUCT_ANALYSE()
738     {
739     }
740    
741     MSTRUCT_ANALYSE_CAO::MSTRUCT_ANALYSE_CAO(string identifiant,
742     double largeur_colonne_nb_forme,
743     double largeur_colonne_nb_volume,
744     double largeur_colonne_volume,
745     double largeur_colonne_fraction_volumique,
746     double largeur_colonne_volume_forme,
747     string nom_groupe_forme): MSTRUCT_ANALYSE(identifiant,nom_groupe_forme)
748     {
749     m_nb_forme_histogramme.fixe_largeur_colonne(largeur_colonne_nb_forme);
750     m_nb_volume_histogramme.fixe_largeur_colonne(largeur_colonne_nb_volume);
751     m_volume_histogramme.fixe_largeur_colonne(largeur_colonne_volume);
752     m_fraction_volumique_histogramme.fixe_largeur_colonne(largeur_colonne_fraction_volumique);
753     m_volume_forme_histogramme.fixe_largeur_colonne(largeur_colonne_volume_forme);
754     }
755    
756     MSTRUCT_ANALYSE_CAO::MSTRUCT_ANALYSE_CAO(std::vector< MSTRUCT_ANALYSE_CAO* >& vector_analyse_cao): MSTRUCT_ANALYSE()
757     {
758     std::vector<MSTRUCT_ANALYSE_CAO*>::iterator it_analyse=vector_analyse_cao.begin();
759     MSTRUCT_ANALYSE_CAO* analyse = *it_analyse;
760     m_identifiant=analyse->get_identifiant();
761     if(analyse->get_boite_analyse()!=NULL) change_boite_analyse(*analyse->get_boite_analyse());
762     m_nom_groupe_forme=analyse->get_nom_groupe_forme();
763     m_nb_ves=vector_analyse_cao.size();
764    
765     m_nb_forme_histogramme.fixe_largeur_colonne(analyse->get_distribution_nb_forme()->get_largeur_colonne());
766     m_nb_volume_histogramme.fixe_largeur_colonne(analyse->get_distribution_nb_volume()->get_largeur_colonne());
767     m_volume_histogramme.fixe_largeur_colonne(analyse->get_distribution_volume()->get_largeur_colonne());
768     m_fraction_volumique_histogramme.fixe_largeur_colonne(analyse->get_distribution_fraction_volumique()->get_largeur_colonne());
769     m_volume_forme_histogramme.fixe_largeur_colonne(analyse->get_distribution_volume_forme()->get_largeur_colonne());
770    
771     m_nb_forme_moyenne=0.0;
772     m_nb_forme_ecart_type=0.0;
773     m_nb_forme_min=numeric_limits< long >::max();
774     m_nb_forme_max=numeric_limits< long >::min();
775     m_nb_volume_moyenne=0.0;
776     m_nb_volume_ecart_type=0.0;
777     m_nb_volume_min=numeric_limits< long >::max();
778     m_nb_volume_max=numeric_limits< long >::min();
779     m_volume_forme_moyenne=0.0;
780     m_volume_forme_ecart_type=0.0;
781     m_volume_forme_min=numeric_limits< double >::max();
782     m_volume_forme_max=numeric_limits< double >::min();
783     m_volume_moyenne=0.0;
784     m_volume_ecart_type=0.0;
785     m_volume_min=numeric_limits< double >::max();
786     m_volume_max=numeric_limits< double >::min();
787 couturad 927 m_fraction_volumique_moyenne=0.0;
788     m_fraction_volumique_ecart_type=0.0;
789 couturad 926 m_fraction_volumique_min=numeric_limits< double >::max();
790     m_fraction_volumique_max=numeric_limits< double >::min();
791    
792     for(it_analyse=vector_analyse_cao.begin();it_analyse!=vector_analyse_cao.end();it_analyse++)
793     {
794     analyse = *it_analyse;
795    
796     m_nb_forme_moyenne+=analyse->get_nb_forme_moyenne();
797     m_nb_forme_histogramme.ajouter_valeur(analyse->get_nb_forme_moyenne(),1./m_nb_ves);
798     if(analyse->get_nb_forme_min()<m_nb_forme_min) m_nb_forme_min=analyse->get_nb_forme_min();
799     if(analyse->get_nb_forme_max()>m_nb_forme_max) m_nb_forme_max=analyse->get_nb_forme_max();
800    
801     m_nb_volume_moyenne+=analyse->get_nb_volume_moyenne();
802     m_nb_volume_histogramme.ajouter_valeur(analyse->get_nb_volume_moyenne(),1./m_nb_ves);
803     if(analyse->get_nb_volume_min()<m_nb_volume_min) m_nb_volume_min=analyse->get_nb_volume_min();
804     if(analyse->get_nb_volume_max()>m_nb_volume_max) m_nb_volume_max=analyse->get_nb_volume_max();
805    
806     m_volume_forme_moyenne+=analyse->get_volume_forme_moyenne();
807     std::map<long,double>::iterator it_his;
808     double val;
809     long l;
810     int k=analyse->get_distribution_volume_forme()->get_premiere_valeur(it_his,val,l);
811     while(k!=0)
812     {
813     m_volume_forme_histogramme.ajouter_valeur(l,val/m_nb_ves);
814     k=analyse->get_distribution_volume_forme()->get_suivante_valeur(it_his,val,l);
815     }
816     if(analyse->get_volume_forme_min()<m_volume_forme_min) m_volume_forme_min=analyse->get_volume_forme_min();
817     if(analyse->get_volume_forme_max()>m_volume_forme_max) m_volume_forme_max=analyse->get_volume_forme_max();
818    
819     m_volume_moyenne+=analyse->get_volume_moyenne();
820     m_volume_histogramme.ajouter_valeur(analyse->get_volume_moyenne(),1./m_nb_ves);
821     if(analyse->get_volume_min()<m_volume_min) m_volume_min=analyse->get_volume_min();
822     if(analyse->get_volume_max()>m_volume_max) m_volume_max=analyse->get_volume_max();
823    
824     m_fraction_volumique_moyenne+=analyse->get_fraction_volumique_moyenne();
825     m_fraction_volumique_histogramme.ajouter_valeur(analyse->get_fraction_volumique_moyenne(),1./m_nb_ves);
826     if(analyse->get_fraction_volumique_min()<m_fraction_volumique_min) m_fraction_volumique_min=analyse->get_fraction_volumique_min();
827     if(analyse->get_fraction_volumique_max()>m_fraction_volumique_max) m_fraction_volumique_max=analyse->get_fraction_volumique_max();
828     }
829     m_nb_forme_moyenne=m_nb_forme_moyenne/m_nb_ves;
830     m_nb_volume_moyenne=m_nb_volume_moyenne/m_nb_ves;
831     m_volume_forme_moyenne=m_volume_forme_moyenne/m_nb_ves;
832     m_volume_moyenne=m_volume_moyenne/m_nb_ves;
833     m_fraction_volumique_moyenne=m_fraction_volumique_moyenne/m_nb_ves;
834 couturad 927 if(m_nb_ves>1)
835 couturad 926 {
836 couturad 927 for(it_analyse=vector_analyse_cao.begin();it_analyse!=vector_analyse_cao.end();it_analyse++)
837     {
838     analyse = *it_analyse;
839     m_nb_forme_ecart_type+=(analyse->get_nb_forme_moyenne()-m_nb_forme_moyenne)*(analyse->get_nb_forme_moyenne()-m_nb_forme_moyenne);
840     m_nb_volume_ecart_type+=(analyse->get_nb_volume_moyenne()-m_nb_volume_moyenne)*(analyse->get_nb_volume_moyenne()-m_nb_volume_moyenne);
841     m_volume_forme_ecart_type+=(analyse->get_volume_forme_moyenne()-m_volume_forme_moyenne)*(analyse->get_volume_forme_moyenne()-m_volume_forme_moyenne);
842     m_volume_ecart_type+=(analyse->get_volume_moyenne()-m_volume_moyenne)*(analyse->get_volume_moyenne()-m_volume_moyenne);
843     m_fraction_volumique_ecart_type+=(analyse->get_fraction_volumique_moyenne()-m_fraction_volumique_moyenne)*(analyse->get_fraction_volumique_moyenne()-m_fraction_volumique_moyenne);
844     }
845     m_nb_forme_ecart_type=sqrt(m_nb_forme_ecart_type*(1.0/(m_nb_ves-1.0)));
846     m_nb_volume_ecart_type=sqrt(m_nb_volume_ecart_type*(1.0/(m_nb_ves-1.0)));
847     m_volume_forme_ecart_type=sqrt(m_volume_forme_ecart_type*(1.0/(m_nb_ves-1.0)));
848     m_volume_ecart_type=sqrt(m_volume_ecart_type*(1.0/(m_nb_ves-1.0)));
849     m_fraction_volumique_ecart_type=sqrt(m_fraction_volumique_ecart_type*(1.0/(m_nb_ves-1.0)));
850 couturad 926 }
851     }
852    
853    
854     MSTRUCT_ANALYSE_CAO::MSTRUCT_ANALYSE_CAO(MSTRUCT_ANALYSE_CAO& mdd): MSTRUCT_ANALYSE(mdd)
855     {
856     m_nb_forme_min=mdd.m_nb_forme_min;
857     m_nb_forme_max=mdd.m_nb_forme_max;
858     m_nb_forme_moyenne=mdd.m_nb_forme_moyenne;
859     m_nb_forme_ecart_type=mdd.m_nb_forme_ecart_type;
860    
861     m_nb_volume_min=mdd.m_nb_volume_min;
862     m_nb_volume_max=mdd.m_nb_volume_max;
863     m_nb_volume_moyenne=mdd.m_nb_volume_moyenne;
864     m_nb_volume_ecart_type=mdd.m_nb_volume_ecart_type;
865    
866     m_volume_forme_min=mdd.m_volume_forme_min;
867     m_volume_forme_max=mdd.m_volume_forme_max;
868     m_volume_forme_moyenne=mdd.m_volume_forme_moyenne;
869     m_volume_forme_ecart_type=mdd.m_volume_forme_ecart_type;
870     m_volume_forme_histogramme=mdd.m_volume_forme_histogramme;
871    
872     m_volume_min=mdd.m_volume_min;
873     m_volume_max=mdd.m_volume_max;
874     m_volume_moyenne=mdd.m_volume_moyenne;
875     m_volume_ecart_type=mdd.m_volume_ecart_type;
876     m_volume_histogramme=mdd.m_volume_histogramme;
877    
878     m_fraction_volumique_min=mdd.m_fraction_volumique_min;
879     m_fraction_volumique_max=mdd.m_fraction_volumique_max;
880     m_fraction_volumique_ecart_type=mdd.m_fraction_volumique_ecart_type;
881     m_fraction_volumique_moyenne=mdd.m_fraction_volumique_moyenne;
882     }
883    
884     MSTRUCT_ANALYSE_CAO::~MSTRUCT_ANALYSE_CAO(void)
885     {
886     }
887    
888     long int MSTRUCT_ANALYSE_CAO::get_nb_forme_min(void)
889     {
890     return m_nb_forme_min;
891     }
892    
893     long int MSTRUCT_ANALYSE_CAO::get_nb_forme_max(void)
894     {
895     return m_nb_forme_max;
896     }
897    
898     long int MSTRUCT_ANALYSE_CAO::get_nb_forme_moyenne(void)
899     {
900     return m_nb_forme_moyenne;
901     }
902    
903     long int MSTRUCT_ANALYSE_CAO::get_nb_forme_ecart_type(void)
904     {
905     return m_nb_forme_ecart_type;
906     }
907    
908     OT_HISTOGRAMME* MSTRUCT_ANALYSE_CAO::get_distribution_nb_forme(void)
909     {
910     return &m_nb_forme_histogramme;
911     }
912    
913     long int MSTRUCT_ANALYSE_CAO::get_nb_volume_min(void)
914     {
915     return m_nb_volume_min;
916     }
917    
918     long int MSTRUCT_ANALYSE_CAO::get_nb_volume_max(void)
919     {
920     return m_nb_volume_max;
921     }
922    
923     long int MSTRUCT_ANALYSE_CAO::get_nb_volume_moyenne(void)
924     {
925     return m_nb_volume_moyenne;
926     }
927     long int MSTRUCT_ANALYSE_CAO::get_nb_volume_ecart_type(void)
928     {
929     return m_nb_volume_ecart_type;
930     }
931    
932     OT_HISTOGRAMME* MSTRUCT_ANALYSE_CAO::get_distribution_nb_volume(void)
933     {
934     return &m_nb_volume_histogramme;
935     }
936    
937     double MSTRUCT_ANALYSE_CAO::get_volume_forme_min(void)
938     {
939     return m_volume_forme_min;
940     }
941    
942     double MSTRUCT_ANALYSE_CAO::get_volume_forme_max(void)
943     {
944     return m_volume_forme_max;
945     }
946    
947     double MSTRUCT_ANALYSE_CAO::get_volume_forme_moyenne(void)
948     {
949     return m_volume_forme_moyenne;
950     }
951    
952     double MSTRUCT_ANALYSE_CAO::get_volume_forme_ecart_type(void)
953     {
954     return m_volume_forme_ecart_type;
955     }
956    
957     OT_HISTOGRAMME* MSTRUCT_ANALYSE_CAO::get_distribution_volume_forme(void)
958     {
959     return &m_volume_forme_histogramme;
960     }
961    
962     double MSTRUCT_ANALYSE_CAO::get_volume_moyenne(void)
963     {
964     return m_volume_moyenne;
965     }
966    
967     double MSTRUCT_ANALYSE_CAO::get_volume_ecart_type(void)
968     {
969     return m_volume_ecart_type;
970     }
971    
972     double MSTRUCT_ANALYSE_CAO::get_volume_min(void)
973     {
974     return m_volume_min;
975     }
976    
977     double MSTRUCT_ANALYSE_CAO::get_volume_max(void)
978     {
979     return m_volume_max;
980     }
981    
982     OT_HISTOGRAMME* MSTRUCT_ANALYSE_CAO::get_distribution_volume(void)
983     {
984     return &m_volume_histogramme;
985     }
986    
987     double MSTRUCT_ANALYSE_CAO::get_fraction_volumique_ecart_type(void)
988     {
989     return m_fraction_volumique_ecart_type;
990     }
991    
992     double MSTRUCT_ANALYSE_CAO::get_fraction_volumique_moyenne(void)
993     {
994     return m_fraction_volumique_moyenne;
995     }
996    
997     double MSTRUCT_ANALYSE_CAO::get_fraction_volumique_min(void)
998     {
999     return m_fraction_volumique_min;
1000     }
1001    
1002     double MSTRUCT_ANALYSE_CAO::get_fraction_volumique_max(void)
1003     {
1004     return m_fraction_volumique_max;
1005     }
1006    
1007     OT_HISTOGRAMME* MSTRUCT_ANALYSE_CAO::get_distribution_fraction_volumique(void)
1008     {
1009     return &m_fraction_volumique_histogramme;
1010     }
1011    
1012     long int MSTRUCT_ANALYSE_CAO::get_type(void)
1013     {
1014     return TYPE_ANALYSE::CAO;
1015     }
1016    
1017     void MSTRUCT_ANALYSE_CAO::executer(MSTRUCT_VES* ves)
1018     {
1019     MG_CG_GROUPE_FORME* groupe_forme=NULL;
1020     if(m_nom_groupe_forme!="ALL") groupe_forme=ves->get_mgcg_modele()->get_mgcg_groupe_forme(m_nom_groupe_forme);
1021     TPL_MAP_ENTITE<MG_CG_FORME*> tpl_map_forme;
1022     if(groupe_forme!=NULL)
1023     {
1024     std::map<long,MG_CG_FORME*>::iterator it_forme;
1025     for(MG_CG_FORME* forme=groupe_forme->get_premiere_mgcg_forme(it_forme);forme!=NULL;forme=groupe_forme->get_suivante_mgcg_forme(it_forme))
1026     {
1027     tpl_map_forme.ajouter(forme);
1028     }
1029     }
1030     else
1031     {
1032     std::map<long,MG_CG_FORME*>::iterator it_forme;
1033     MG_CG_ASSEMBLAGE* mgcg_ass=ves->get_mgcg_assemblage();
1034     for(MG_CG_FORME*forme=mgcg_ass->get_premiere_mgcg_forme(it_forme);forme!=NULL;forme=mgcg_ass->get_suivante_mgcg_forme(it_forme))
1035     {
1036     tpl_map_forme.ajouter(forme);
1037     }
1038     }
1039     OUTILS::statistiques_CAO(ves->get_boite3d_ves(),
1040     tpl_map_forme,
1041     m_nb_forme_moyenne,
1042     m_nb_volume_moyenne,
1043     m_volume_forme_moyenne,
1044     m_volume_forme_ecart_type,
1045     m_volume_forme_min,
1046     m_volume_forme_max,
1047     m_volume_forme_histogramme,
1048     m_volume_moyenne,
1049     m_fraction_volumique_moyenne);
1050    
1051     m_nb_forme_min=m_nb_forme_moyenne;
1052     m_nb_forme_max=m_nb_forme_moyenne;
1053     m_nb_forme_ecart_type=0.0;
1054     m_nb_volume_min=m_nb_volume_moyenne;
1055     m_nb_volume_max=m_nb_volume_moyenne;
1056     m_nb_volume_ecart_type=0.0;
1057     m_volume_min=m_volume_moyenne;
1058     m_volume_max=m_volume_moyenne;
1059     m_volume_ecart_type=0.0;
1060     m_fraction_volumique_min=m_fraction_volumique_moyenne;
1061     m_fraction_volumique_max=m_fraction_volumique_moyenne;
1062     m_fraction_volumique_ecart_type=0.0;
1063     }
1064    
1065     void MSTRUCT_ANALYSE_CAO::exporter(ofstream& ofstrm, long int i, bool avec_histo, char* prefix_histo)
1066     {
1067     if(i==1)
1068 couturad 927 ofstrm << "#(1) volume[moy(2) ±(3) min(4) max(5)] frac_vol[moy(6) ±(7) min(8) max(9)] nb_forme[moy(10) ±(11) min(12) max(13)] nb_volume[moy(14) ±(15) min(16) max(17)] volume_forme[moy(18) ±(19) min(20) max(21)]" << std::endl;
1069 couturad 926 ofstrm << i << " "
1070     << m_volume_moyenne << " "
1071     << m_volume_ecart_type << " "
1072     << m_volume_min << " "
1073     << m_volume_max << " "
1074     << m_fraction_volumique_moyenne << " "
1075     << m_fraction_volumique_ecart_type << " "
1076     << m_fraction_volumique_min << " "
1077     << m_fraction_volumique_max << " "
1078     << m_nb_forme_moyenne << " "
1079     << m_nb_forme_ecart_type << " "
1080     << m_nb_forme_min << " "
1081     << m_nb_forme_max << " "
1082     << m_nb_volume_moyenne << " "
1083     << m_nb_volume_ecart_type << " "
1084     << m_nb_volume_min << " "
1085     << m_nb_volume_max << " "
1086     << m_volume_forme_moyenne << " "
1087     << m_volume_forme_ecart_type << " "
1088     << m_volume_forme_min << " "
1089     << m_volume_forme_max << std::endl;
1090     if(avec_histo)
1091     {
1092     char nom_fichier[500];
1093     sprintf(nom_fichier,"%shisto_%s_volume_forme.txt",prefix_histo,m_identifiant.c_str());
1094     ofstream of_histo_volume_forme(nom_fichier,std::ios::out|std::ios::trunc);
1095     of_histo_volume_forme.precision(16);
1096     of_histo_volume_forme.setf(std::ios::showpoint);
1097     m_volume_forme_histogramme.exporter(of_histo_volume_forme);
1098     of_histo_volume_forme.close();
1099    
1100     sprintf(nom_fichier,"%shisto_%s_volume.txt",prefix_histo,m_identifiant.c_str());
1101     ofstream of_histo_volume(nom_fichier,std::ios::out|std::ios::trunc);
1102     of_histo_volume.precision(16);
1103     of_histo_volume.setf(std::ios::showpoint);
1104     m_volume_histogramme.exporter(of_histo_volume);
1105     of_histo_volume.close();
1106    
1107     sprintf(nom_fichier,"%shisto_%s_frac_vol.txt",prefix_histo,m_identifiant.c_str());
1108     ofstream of_histo_frac_vol(nom_fichier,std::ios::out|std::ios::trunc);
1109     of_histo_frac_vol.precision(16);
1110     of_histo_frac_vol.setf(std::ios::showpoint);
1111     m_fraction_volumique_histogramme.exporter(of_histo_frac_vol);
1112     of_histo_frac_vol.close();
1113    
1114     sprintf(nom_fichier,"%shisto_%s_nb_forme.txt",prefix_histo,m_identifiant.c_str());
1115     ofstream of_histo_nb_forme(nom_fichier,std::ios::out|std::ios::trunc);
1116     of_histo_nb_forme.precision(16);
1117     of_histo_nb_forme.setf(std::ios::showpoint);
1118     m_nb_forme_histogramme.exporter(of_histo_nb_forme);
1119     of_histo_nb_forme.close();
1120    
1121     sprintf(nom_fichier,"%shisto_%s_nb_vol.txt",prefix_histo,m_identifiant.c_str());
1122     ofstream of_histo_nb_volume(nom_fichier,std::ios::out|std::ios::trunc);
1123     of_histo_nb_volume.precision(16);
1124     of_histo_nb_volume.setf(std::ios::showpoint);
1125     m_nb_volume_histogramme.exporter(of_histo_nb_volume);
1126     of_histo_nb_volume.close();
1127     }
1128    
1129     }
1130    
1131     void MSTRUCT_ANALYSE_CAO::enregistrer(ofstream& ofstrm)
1132     {
1133     long type_analyse=get_type();
1134     ofstrm.write((char*)&type_analyse,sizeof(long));
1135     MICROSTRUCTURE::MSTRUCT_ANALYSE::enregistrer(ofstrm);
1136     ofstrm.write((char*)&m_nb_forme_moyenne,sizeof(long));
1137     ofstrm.write((char*)&m_nb_forme_ecart_type,sizeof(long));
1138     ofstrm.write((char*)&m_nb_forme_min,sizeof(long));
1139     ofstrm.write((char*)&m_nb_forme_max,sizeof(long));
1140     m_nb_forme_histogramme.enregistrer_bin(ofstrm);
1141     ofstrm.write((char*)&m_nb_volume_moyenne,sizeof(long));
1142     ofstrm.write((char*)&m_nb_volume_ecart_type,sizeof(long));
1143     ofstrm.write((char*)&m_nb_volume_min,sizeof(long));
1144     ofstrm.write((char*)&m_nb_volume_max,sizeof(long));
1145     m_nb_volume_histogramme.enregistrer_bin(ofstrm);
1146     ofstrm.write((char*)&m_volume_forme_moyenne,sizeof(double));
1147     ofstrm.write((char*)&m_volume_forme_ecart_type,sizeof(double));
1148     ofstrm.write((char*)&m_volume_forme_min,sizeof(double));
1149     ofstrm.write((char*)&m_volume_forme_max,sizeof(double));
1150     m_volume_forme_histogramme.enregistrer_bin(ofstrm);
1151     ofstrm.write((char*)&m_volume_moyenne,sizeof(double));
1152     ofstrm.write((char*)&m_volume_ecart_type,sizeof(double));
1153     ofstrm.write((char*)&m_volume_min,sizeof(double));
1154     ofstrm.write((char*)&m_volume_max,sizeof(double));
1155     m_volume_histogramme.enregistrer_bin(ofstrm);
1156     ofstrm.write((char*)&m_fraction_volumique_moyenne,sizeof(double));
1157     ofstrm.write((char*)&m_fraction_volumique_ecart_type,sizeof(double));
1158     ofstrm.write((char*)&m_fraction_volumique_min,sizeof(double));
1159     ofstrm.write((char*)&m_fraction_volumique_max,sizeof(double));
1160     m_fraction_volumique_histogramme.enregistrer_bin(ofstrm);
1161     }
1162    
1163     void MSTRUCT_ANALYSE_CAO::ouvrir(ifstream& ifstrm)
1164     {
1165     MICROSTRUCTURE::MSTRUCT_ANALYSE::ouvrir(ifstrm);
1166     ifstrm.read((char*)&m_nb_forme_moyenne,sizeof(long));
1167     ifstrm.read((char*)&m_nb_forme_ecart_type,sizeof(long));
1168     ifstrm.read((char*)&m_nb_forme_min,sizeof(long));
1169     ifstrm.read((char*)&m_nb_forme_max,sizeof(long));
1170     m_nb_forme_histogramme.ouvrir_bin(ifstrm);
1171     ifstrm.read((char*)&m_nb_volume_moyenne,sizeof(long));
1172     ifstrm.read((char*)&m_nb_volume_ecart_type,sizeof(long));
1173     ifstrm.read((char*)&m_nb_volume_min,sizeof(long));
1174     ifstrm.read((char*)&m_nb_volume_max,sizeof(long));
1175     m_nb_volume_histogramme.ouvrir_bin(ifstrm);
1176     ifstrm.read((char*)&m_volume_forme_moyenne,sizeof(double));
1177     ifstrm.read((char*)&m_volume_forme_ecart_type,sizeof(double));
1178     ifstrm.read((char*)&m_volume_forme_min,sizeof(double));
1179     ifstrm.read((char*)&m_volume_forme_max,sizeof(double));
1180     m_volume_forme_histogramme.ouvrir_bin(ifstrm);
1181     ifstrm.read((char*)&m_volume_moyenne,sizeof(double));
1182     ifstrm.read((char*)&m_volume_ecart_type,sizeof(double));
1183     ifstrm.read((char*)&m_volume_min,sizeof(double));
1184     ifstrm.read((char*)&m_volume_max,sizeof(double));
1185     m_volume_histogramme.ouvrir_bin(ifstrm);
1186     ifstrm.read((char*)&m_fraction_volumique_moyenne,sizeof(double));
1187     ifstrm.read((char*)&m_fraction_volumique_ecart_type,sizeof(double));
1188     ifstrm.read((char*)&m_fraction_volumique_min,sizeof(double));
1189     ifstrm.read((char*)&m_fraction_volumique_max,sizeof(double));
1190     m_fraction_volumique_histogramme.ouvrir_bin(ifstrm);
1191     }
1192    
1193     void MSTRUCT_ANALYSE_CAO::affiche_contenu(MICROSTRUCTURE::fonction_affiche* fonc)
1194     {
1195     MICROSTRUCTURE::MSTRUCT_ANALYSE::affiche_contenu(fonc);
1196     char ligne[5000];
1197     sprintf(ligne,"MSTRUCT_ANALYSE_CAO");
1198     fonc(ligne);
1199     sprintf(ligne,"-> Moyenne nb forme : %li",m_nb_forme_moyenne); fonc(ligne);
1200     sprintf(ligne,"-> Ecart-type nb forme : %li",m_nb_forme_ecart_type); fonc(ligne);
1201     sprintf(ligne,"-> Min nb forme : %li",m_nb_forme_min); fonc(ligne);
1202     sprintf(ligne,"-> Max nb forme : %li",m_nb_forme_max); fonc(ligne);
1203     sprintf(ligne,"-> OT_HISTOGRAMME nb forme : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_nb_forme_histogramme.get_nb_colonne(),
1204     m_nb_forme_histogramme.get_largeur_colonne(),
1205     m_nb_forme_histogramme.get_x_min(),
1206     m_nb_forme_histogramme.get_x_max());
1207     fonc(ligne);
1208     sprintf(ligne,"-> Moyenne nb volume : %li",m_nb_volume_moyenne); fonc(ligne);
1209     sprintf(ligne,"-> Ecart-type nb volume : %li",m_nb_volume_ecart_type); fonc(ligne);
1210     sprintf(ligne,"-> Min nb volume : %li",m_nb_volume_min); fonc(ligne);
1211     sprintf(ligne,"-> Max nb volume : %li",m_nb_volume_max); fonc(ligne);
1212     sprintf(ligne,"-> OT_HISTOGRAMME nb volume : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_nb_volume_histogramme.get_nb_colonne(),
1213     m_nb_volume_histogramme.get_largeur_colonne(),
1214     m_nb_volume_histogramme.get_x_min(),
1215     m_nb_volume_histogramme.get_x_max());
1216     fonc(ligne);
1217     sprintf(ligne,"-> Moyenne volume : %lf",m_volume_moyenne); fonc(ligne);
1218     sprintf(ligne,"-> Ecart-type volume : %lf",m_volume_ecart_type); fonc(ligne);
1219     sprintf(ligne,"-> Min volume : %lf",m_volume_min); fonc(ligne);
1220     sprintf(ligne,"-> Max volume : %lf",m_volume_max); fonc(ligne);
1221     sprintf(ligne,"-> OT_HISTOGRAMME volume : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_volume_histogramme.get_nb_colonne(),
1222     m_volume_histogramme.get_largeur_colonne(),
1223     m_volume_histogramme.get_x_min(),
1224     m_volume_histogramme.get_x_max());
1225     fonc(ligne);
1226     sprintf(ligne,"-> Moyenne fraction volumique : %lf",m_fraction_volumique_moyenne); fonc(ligne);
1227     sprintf(ligne,"-> Ecart-type fraction volumique : %lf",m_fraction_volumique_ecart_type); fonc(ligne);
1228     sprintf(ligne,"-> Min fraction volumique : %lf",m_fraction_volumique_min); fonc(ligne);
1229     sprintf(ligne,"-> Max fraction volumique : %lf",m_fraction_volumique_max); fonc(ligne);
1230     sprintf(ligne,"-> OT_HISTOGRAMME fraction volumique : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_fraction_volumique_histogramme.get_nb_colonne(),
1231     m_fraction_volumique_histogramme.get_largeur_colonne(),
1232     m_fraction_volumique_histogramme.get_x_min(),
1233     m_fraction_volumique_histogramme.get_x_max());
1234     fonc(ligne);
1235     sprintf(ligne,"-> Moyenne volume forme : %lf",m_volume_forme_moyenne); fonc(ligne);
1236     sprintf(ligne,"-> Ecart-type volume forme : %lf",m_volume_forme_ecart_type); fonc(ligne);
1237     sprintf(ligne,"-> Min volume forme : %lf",m_volume_forme_min); fonc(ligne);
1238     sprintf(ligne,"-> Max volume forme : %lf",m_volume_forme_max); fonc(ligne);
1239     sprintf(ligne,"-> OT_HISTOGRAMME volume forme : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_volume_forme_histogramme.get_nb_colonne(),
1240     m_volume_forme_histogramme.get_largeur_colonne(),
1241     m_volume_forme_histogramme.get_x_min(),
1242     m_volume_forme_histogramme.get_x_max());
1243     fonc(ligne);
1244     }
1245    
1246    
1247    
1248    
1249     MSTRUCT_ANALYSE_MG_MAILLAGE::MSTRUCT_ANALYSE_MG_MAILLAGE(void): MSTRUCT_ANALYSE()
1250     {
1251     }
1252    
1253     MSTRUCT_ANALYSE_MG_MAILLAGE::MSTRUCT_ANALYSE_MG_MAILLAGE(string identifiant,
1254     long int id_maillage,
1255     double largeur_colonne_nb_element_2D,
1256     double largeur_colonne_nb_element_3D,
1257     double largeur_colonne_qualite_2D,
1258     double largeur_colonne_taille_2D,
1259     double largeur_colonne_qualite_3D,
1260     double largeur_colonne_taille_3D,
1261     double largeur_colonne_volume,
1262     double largeur_colonne_fraction_volumique,
1263     string nom_groupe_forme): MSTRUCT_ANALYSE(identifiant,nom_groupe_forme)
1264     {
1265     m_id_maillage=id_maillage;
1266     m_nb_element_2D_histogramme.fixe_largeur_colonne(largeur_colonne_nb_element_2D);
1267     m_nb_element_3D_histogramme.fixe_largeur_colonne(largeur_colonne_nb_element_3D);
1268     m_2D_qualite_histogramme.fixe_largeur_colonne(largeur_colonne_qualite_2D);
1269     m_3D_qualite_histogramme.fixe_largeur_colonne(largeur_colonne_qualite_3D);
1270     m_2D_taille_histogramme.fixe_largeur_colonne(largeur_colonne_taille_2D);
1271     m_3D_taille_histogramme.fixe_largeur_colonne(largeur_colonne_taille_3D);
1272     m_volume_histogramme.fixe_largeur_colonne(largeur_colonne_volume);
1273     m_fraction_volumique_histogramme.fixe_largeur_colonne(largeur_colonne_fraction_volumique);
1274     }
1275    
1276     MSTRUCT_ANALYSE_MG_MAILLAGE::MSTRUCT_ANALYSE_MG_MAILLAGE(std::vector< MSTRUCT_ANALYSE_MG_MAILLAGE* > &vector_analyse): MSTRUCT_ANALYSE()
1277     {
1278     std::vector<MSTRUCT_ANALYSE_MG_MAILLAGE*>::iterator it_analyse=vector_analyse.begin();
1279     MSTRUCT_ANALYSE_MG_MAILLAGE* analyse = *it_analyse;
1280     m_identifiant=analyse->get_identifiant();
1281     if(analyse->get_boite_analyse()!=NULL) change_boite_analyse(*analyse->get_boite_analyse());
1282     m_nom_groupe_forme=analyse->get_nom_groupe_forme();
1283     m_nb_ves=vector_analyse.size();
1284    
1285     m_nb_element_2D_histogramme.fixe_largeur_colonne(analyse->get_distribution_nb_element_2D()->get_largeur_colonne());
1286     m_nb_element_3D_histogramme.fixe_largeur_colonne(analyse->get_distribution_nb_element_3D()->get_largeur_colonne());
1287     m_2D_qualite_histogramme.fixe_largeur_colonne(analyse->get_distribution_qualite_2D()->get_largeur_colonne());
1288     m_3D_qualite_histogramme.fixe_largeur_colonne(analyse->get_distribution_qualite_3D()->get_largeur_colonne());
1289     m_2D_taille_histogramme.fixe_largeur_colonne(analyse->get_distribution_taille_2D()->get_largeur_colonne());
1290     m_3D_taille_histogramme.fixe_largeur_colonne(analyse->get_distribution_taille_3D()->get_largeur_colonne());
1291     m_volume_histogramme.fixe_largeur_colonne(analyse->get_distribution_volume()->get_largeur_colonne());
1292     m_fraction_volumique_histogramme.fixe_largeur_colonne(analyse->get_distribution_fraction_volumique()->get_largeur_colonne());
1293    
1294     m_id_maillage=-1;
1295    
1296     m_nb_element_2D_moyenne=0;
1297     m_nb_element_2D_ecart_type=0;
1298     m_nb_element_2D_min=numeric_limits< long >::max();
1299     m_nb_element_2D_max=numeric_limits< long >::min();
1300    
1301     m_nb_element_3D_moyenne=0;
1302     m_nb_element_3D_ecart_type=0;
1303     m_nb_element_3D_min=numeric_limits< long >::max();
1304     m_nb_element_3D_max=numeric_limits< long >::min();
1305    
1306     m_2D_qualite_min=numeric_limits< double >::max();
1307     m_2D_qualite_max=numeric_limits< double >::min();
1308     m_2D_qualite_moyenne=0;
1309     m_2D_qualite_ecart_type=0;
1310    
1311     m_3D_qualite_min=numeric_limits< double >::max();
1312     m_3D_qualite_max=numeric_limits< double >::min();
1313     m_3D_qualite_moyenne=0;
1314     m_3D_qualite_ecart_type=0;
1315    
1316     m_2D_taille_min=numeric_limits< double >::max();
1317     m_2D_taille_max=numeric_limits< double >::min();
1318     m_2D_taille_moyenne=0;
1319     m_2D_taille_ecart_type=0;
1320    
1321     m_3D_taille_min=numeric_limits< double >::max();
1322     m_3D_taille_max=numeric_limits< double >::min();
1323     m_3D_taille_moyenne=0;
1324     m_3D_taille_ecart_type=0;
1325    
1326     m_volume_min=numeric_limits< double >::max();
1327     m_volume_max=numeric_limits< double >::min();
1328     m_volume_moyenne=0;
1329     m_volume_ecart_type=0;
1330    
1331     m_fraction_volumique_min=numeric_limits< double >::max();
1332     m_fraction_volumique_max=numeric_limits< double >::min();
1333     m_fraction_volumique_ecart_type=0;
1334     m_fraction_volumique_moyenne=0;
1335    
1336     for(it_analyse=vector_analyse.begin();it_analyse!=vector_analyse.end();it_analyse++)
1337     {
1338     analyse = *it_analyse;
1339    
1340     m_nb_element_2D_moyenne+=analyse->get_nb_element_2D_moyenne();
1341     m_nb_element_2D_histogramme.ajouter_valeur(analyse->get_nb_element_2D_moyenne(),1.0/m_nb_ves);
1342     if(analyse->get_nb_element_2D_min()<m_nb_element_2D_min) m_nb_element_2D_min=analyse->get_nb_element_2D_min();
1343     if(analyse->get_nb_element_2D_max()>m_nb_element_2D_max) m_nb_element_2D_max=analyse->get_nb_element_2D_max();
1344    
1345     m_nb_element_3D_moyenne+=analyse->get_nb_element_3D_moyenne();
1346     m_nb_element_3D_histogramme.ajouter_valeur(analyse->get_nb_element_3D_moyenne(),1.0/m_nb_ves);
1347     if(analyse->get_nb_element_3D_min()<m_nb_element_3D_min) m_nb_element_3D_min=analyse->get_nb_element_3D_min();
1348     if(analyse->get_nb_element_3D_max()>m_nb_element_3D_max) m_nb_element_3D_max=analyse->get_nb_element_3D_max();
1349    
1350     m_2D_qualite_moyenne+=analyse->get_qualite_moyenne_2D();
1351     std::map<long,double>::iterator it_his;
1352     double val;
1353     long l;
1354     int k=analyse->get_distribution_qualite_2D()->get_premiere_valeur(it_his,val,l);
1355     while(k!=0)
1356     {
1357     m_2D_qualite_histogramme.ajouter_valeur(l,val/m_nb_ves);
1358     k=analyse->get_distribution_qualite_2D()->get_suivante_valeur(it_his,val,l);
1359     }
1360     if(analyse->get_qualite_min_2D()<m_2D_qualite_min) m_2D_qualite_min=analyse->get_qualite_min_2D();
1361     if(analyse->get_qualite_max_2D()>m_2D_qualite_max) m_2D_qualite_max=analyse->get_qualite_max_2D();
1362    
1363     m_3D_qualite_moyenne+=analyse->get_qualite_moyenne_3D();
1364     k=analyse->get_distribution_qualite_3D()->get_premiere_valeur(it_his,val,l);
1365     while(k!=0)
1366     {
1367     m_3D_qualite_histogramme.ajouter_valeur(l,val/m_nb_ves);
1368     k=analyse->get_distribution_qualite_3D()->get_suivante_valeur(it_his,val,l);
1369     }
1370     if(analyse->get_qualite_min_3D()<m_3D_qualite_min) m_3D_qualite_min=analyse->get_qualite_min_3D();
1371     if(analyse->get_qualite_max_3D()>m_3D_qualite_max) m_3D_qualite_max=analyse->get_qualite_max_3D();
1372    
1373     m_2D_taille_moyenne+=analyse->get_taille_moyenne_2D();
1374     k=analyse->get_distribution_taille_2D()->get_premiere_valeur(it_his,val,l);
1375     while(k!=0)
1376     {
1377     m_2D_taille_histogramme.ajouter_valeur(l,val/m_nb_ves);
1378     k=analyse->get_distribution_taille_2D()->get_suivante_valeur(it_his,val,l);
1379     }
1380     if(analyse->get_taille_min_2D()<m_2D_taille_min) m_2D_taille_min=analyse->get_taille_min_2D();
1381     if(analyse->get_taille_max_2D()>m_2D_taille_max) m_2D_taille_max=analyse->get_taille_max_2D();
1382    
1383     m_3D_taille_moyenne+=analyse->get_taille_moyenne_3D();
1384     k=analyse->get_distribution_taille_3D()->get_premiere_valeur(it_his,val,l);
1385     while(k!=0)
1386     {
1387     m_3D_taille_histogramme.ajouter_valeur(l,val/m_nb_ves);
1388     k=analyse->get_distribution_taille_3D()->get_suivante_valeur(it_his,val,l);
1389     }
1390     if(analyse->get_taille_min_3D()<m_3D_taille_min) m_3D_taille_min=analyse->get_taille_min_3D();
1391     if(analyse->get_taille_max_3D()>m_3D_taille_max) m_3D_taille_max=analyse->get_taille_max_3D();
1392    
1393     m_volume_moyenne+=analyse->get_volume_moyenne();
1394     m_volume_histogramme.ajouter_valeur(analyse->get_volume_moyenne(),1.0/m_nb_ves);
1395     if(analyse->get_volume_min()<m_volume_min) m_volume_min=analyse->get_volume_min();
1396     if(analyse->get_volume_max()>m_volume_max) m_volume_max=analyse->get_volume_max();
1397    
1398     m_fraction_volumique_moyenne+=analyse->get_fraction_volumique_moyenne();
1399     m_fraction_volumique_histogramme.ajouter_valeur(analyse->get_fraction_volumique_moyenne(),1.0/m_nb_ves);
1400     if(analyse->get_fraction_volumique_min()<m_fraction_volumique_min) m_fraction_volumique_min=analyse->get_fraction_volumique_min();
1401     if(analyse->get_fraction_volumique_max()>m_fraction_volumique_max) m_fraction_volumique_max=analyse->get_fraction_volumique_max();
1402     }
1403     m_nb_element_2D_moyenne=m_nb_element_2D_moyenne/m_nb_ves;
1404     m_nb_element_3D_moyenne=m_nb_element_2D_moyenne/m_nb_ves;
1405     m_2D_qualite_moyenne=m_2D_qualite_moyenne/m_nb_ves;
1406     m_3D_qualite_moyenne=m_3D_qualite_moyenne/m_nb_ves;
1407     m_2D_taille_moyenne=m_2D_taille_moyenne/m_nb_ves;
1408     m_3D_taille_moyenne=m_3D_taille_moyenne/m_nb_ves;
1409     m_volume_moyenne=m_volume_moyenne/m_nb_ves;
1410     m_fraction_volumique_moyenne=m_fraction_volumique_moyenne/m_nb_ves;
1411 couturad 927 if(m_nb_ves>1)
1412 couturad 926 {
1413 couturad 927 for(it_analyse=vector_analyse.begin();it_analyse!=vector_analyse.end();it_analyse++)
1414     {
1415     analyse = *it_analyse;
1416     m_nb_element_2D_ecart_type+=(analyse->get_nb_element_2D_moyenne()-m_nb_element_2D_moyenne)*(analyse->get_nb_element_2D_moyenne()-m_nb_element_2D_moyenne);
1417     m_nb_element_3D_ecart_type+=(analyse->get_nb_element_3D_moyenne()-m_nb_element_3D_moyenne)*(analyse->get_nb_element_3D_moyenne()-m_nb_element_3D_moyenne);
1418     m_2D_qualite_ecart_type+=(analyse->get_qualite_moyenne_2D()-m_2D_qualite_moyenne)*(analyse->get_qualite_moyenne_2D()-m_2D_qualite_moyenne);
1419     m_3D_qualite_ecart_type+=(analyse->get_qualite_moyenne_3D()-m_3D_qualite_moyenne)*(analyse->get_qualite_moyenne_3D()-m_3D_qualite_moyenne);
1420     m_2D_taille_ecart_type+=(analyse->get_taille_moyenne_2D()-m_2D_taille_moyenne)*(analyse->get_taille_moyenne_2D()-m_2D_taille_moyenne);
1421     m_3D_taille_ecart_type+=(analyse->get_taille_moyenne_3D()-m_2D_taille_moyenne)*(analyse->get_taille_moyenne_3D()-m_2D_taille_moyenne);
1422     m_volume_ecart_type+=(analyse->get_volume_ecart_type()-m_volume_moyenne)*(analyse->get_volume_ecart_type()-m_volume_moyenne);
1423     m_fraction_volumique_ecart_type+=(analyse->get_fraction_volumique_ecart_type()-m_fraction_volumique_moyenne)*(analyse->get_fraction_volumique_ecart_type()-m_fraction_volumique_moyenne);
1424     }
1425     m_nb_element_2D_ecart_type=sqrt(m_nb_element_2D_ecart_type*(1.0/(m_nb_ves-1.0)));
1426     m_nb_element_3D_ecart_type=sqrt(m_nb_element_3D_ecart_type*(1.0/(m_nb_ves-1.0)));
1427     m_2D_qualite_ecart_type=sqrt(m_2D_qualite_ecart_type*(1.0/(m_nb_ves-1.0)));
1428     m_3D_qualite_ecart_type=sqrt(m_3D_qualite_ecart_type*(1.0/(m_nb_ves-1.0)));
1429     m_2D_taille_ecart_type=sqrt(m_2D_taille_ecart_type*(1.0/(m_nb_ves-1.0)));
1430     m_3D_taille_ecart_type=sqrt(m_3D_taille_ecart_type*(1.0/(m_nb_ves-1.0)));
1431     m_volume_ecart_type=sqrt(m_volume_ecart_type*(1.0/(m_nb_ves-1.0)));
1432     m_fraction_volumique_ecart_type=sqrt(m_fraction_volumique_ecart_type*(1.0/(m_nb_ves-1.0)));
1433     }
1434 couturad 926 }
1435    
1436    
1437     MSTRUCT_ANALYSE_MG_MAILLAGE::MSTRUCT_ANALYSE_MG_MAILLAGE(MSTRUCT_ANALYSE_MG_MAILLAGE& mdd): MSTRUCT_ANALYSE(mdd)
1438     {
1439     m_id_maillage=mdd.m_id_maillage;
1440     m_nb_element_2D_moyenne=mdd.m_nb_element_2D_moyenne;
1441     m_nb_element_2D_ecart_type=mdd.m_nb_element_2D_ecart_type;
1442     m_nb_element_2D_min=mdd.m_nb_element_2D_min;
1443     m_nb_element_2D_max=mdd.m_nb_element_2D_max;
1444     m_nb_element_2D_histogramme=mdd.m_nb_element_2D_histogramme;
1445     m_nb_element_3D_moyenne=mdd.m_nb_element_3D_moyenne;
1446     m_nb_element_3D_ecart_type=mdd.m_nb_element_3D_ecart_type;
1447     m_nb_element_3D_min=mdd.m_nb_element_3D_min;
1448     m_nb_element_3D_max=mdd.m_nb_element_3D_max;
1449     m_nb_element_3D_histogramme=mdd.m_nb_element_3D_histogramme;
1450     m_2D_qualite_min=mdd.m_2D_qualite_min;
1451     m_2D_qualite_max=mdd.m_2D_qualite_max;
1452     m_2D_qualite_moyenne=mdd.m_2D_qualite_moyenne;
1453     m_2D_qualite_ecart_type=mdd.m_2D_qualite_ecart_type;
1454     m_2D_qualite_histogramme=mdd.m_2D_qualite_histogramme;
1455     m_3D_qualite_min=mdd.m_3D_qualite_min;
1456     m_3D_qualite_max=mdd.m_3D_qualite_max;
1457     m_3D_qualite_moyenne=mdd.m_3D_qualite_moyenne;
1458     m_3D_qualite_ecart_type=mdd.m_3D_qualite_ecart_type;
1459     m_3D_qualite_histogramme=mdd.m_3D_qualite_histogramme;
1460     m_2D_taille_min=mdd.m_2D_taille_min;
1461     m_2D_taille_max=mdd.m_2D_taille_max;
1462     m_2D_taille_moyenne=mdd.m_2D_taille_moyenne;
1463     m_2D_taille_ecart_type=mdd.m_2D_taille_ecart_type;
1464     m_2D_taille_histogramme=mdd.m_2D_taille_histogramme;
1465     m_3D_taille_min=mdd.m_3D_taille_min;
1466     m_3D_taille_max=mdd.m_3D_taille_max;
1467     m_3D_taille_moyenne=mdd.m_3D_taille_moyenne;
1468     m_3D_taille_ecart_type=mdd.m_3D_taille_ecart_type;
1469     m_3D_taille_histogramme=mdd.m_3D_taille_histogramme;
1470     m_volume_min=mdd.m_volume_min;
1471     m_volume_max=mdd.m_volume_max;
1472     m_volume_moyenne=mdd.m_volume_moyenne;
1473     m_volume_ecart_type=mdd.m_volume_ecart_type;
1474     m_volume_histogramme=mdd.m_volume_histogramme;
1475     m_fraction_volumique_min=mdd.m_fraction_volumique_min;
1476     m_fraction_volumique_max=mdd.m_fraction_volumique_max;
1477     m_fraction_volumique_ecart_type=mdd.m_fraction_volumique_ecart_type;
1478     m_fraction_volumique_moyenne=mdd.m_fraction_volumique_moyenne;
1479     m_fraction_volumique_histogramme=mdd.m_fraction_volumique_histogramme;
1480     }
1481    
1482     MSTRUCT_ANALYSE_MG_MAILLAGE::~MSTRUCT_ANALYSE_MG_MAILLAGE(void)
1483     {
1484    
1485     }
1486    
1487     long int MSTRUCT_ANALYSE_MG_MAILLAGE::get_id_maillage(void)
1488     {
1489     return m_id_maillage;
1490     }
1491    
1492     long int MSTRUCT_ANALYSE_MG_MAILLAGE::get_nb_element_2D_min(void)
1493     {
1494     return m_nb_element_2D_min;
1495     }
1496    
1497     long int MSTRUCT_ANALYSE_MG_MAILLAGE::get_nb_element_2D_max(void)
1498     {
1499     return m_nb_element_2D_max;
1500     }
1501    
1502     long int MSTRUCT_ANALYSE_MG_MAILLAGE::get_nb_element_2D_moyenne(void)
1503     {
1504     return m_nb_element_2D_moyenne;
1505     }
1506    
1507     long int MSTRUCT_ANALYSE_MG_MAILLAGE::get_nb_element_2D_ecart_type(void)
1508     {
1509     return m_nb_element_2D_ecart_type;
1510     }
1511    
1512     OT_HISTOGRAMME* MSTRUCT_ANALYSE_MG_MAILLAGE::get_distribution_nb_element_2D(void)
1513     {
1514     return &m_nb_element_2D_histogramme;
1515     }
1516    
1517     long int MSTRUCT_ANALYSE_MG_MAILLAGE::get_nb_element_3D_min(void)
1518     {
1519     return m_nb_element_3D_min;
1520     }
1521    
1522     long int MSTRUCT_ANALYSE_MG_MAILLAGE::get_nb_element_3D_max(void)
1523     {
1524     return m_nb_element_3D_max;
1525     }
1526    
1527     long int MSTRUCT_ANALYSE_MG_MAILLAGE::get_nb_element_3D_moyenne(void)
1528     {
1529     return m_nb_element_3D_moyenne;
1530     }
1531    
1532     long int MSTRUCT_ANALYSE_MG_MAILLAGE::get_nb_element_3D_ecart_type(void)
1533     {
1534     return m_nb_element_3D_ecart_type;
1535     }
1536    
1537     OT_HISTOGRAMME* MSTRUCT_ANALYSE_MG_MAILLAGE::get_distribution_nb_element_3D(void)
1538     {
1539     return &m_nb_element_3D_histogramme;
1540     }
1541    
1542     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_qualite_moyenne_2D(void)
1543     {
1544     return m_2D_qualite_moyenne;
1545     }
1546    
1547     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_qualite_ecart_type_2D(void)
1548     {
1549     return m_2D_qualite_ecart_type;
1550     }
1551    
1552     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_qualite_min_2D(void)
1553     {
1554     return m_2D_qualite_min;
1555     }
1556    
1557     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_qualite_max_2D(void)
1558     {
1559     return m_2D_qualite_max;
1560     }
1561    
1562     OT_HISTOGRAMME* MSTRUCT_ANALYSE_MG_MAILLAGE::get_distribution_qualite_2D(void)
1563     {
1564     return &m_2D_qualite_histogramme;
1565     }
1566    
1567     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_qualite_moyenne_3D(void)
1568     {
1569     return m_3D_qualite_moyenne;
1570     }
1571    
1572     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_qualite_ecart_type_3D(void)
1573     {
1574     return m_3D_qualite_ecart_type;
1575     }
1576    
1577     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_qualite_min_3D(void)
1578     {
1579     return m_3D_qualite_min;
1580     }
1581    
1582     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_qualite_max_3D(void)
1583     {
1584     return m_3D_qualite_max;
1585     }
1586    
1587     OT_HISTOGRAMME* MSTRUCT_ANALYSE_MG_MAILLAGE::get_distribution_qualite_3D(void)
1588     {
1589     return &m_3D_qualite_histogramme;
1590     }
1591    
1592     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_taille_moyenne_2D(void)
1593     {
1594     return m_2D_taille_moyenne;
1595     }
1596    
1597     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_taille_ecart_type_2D(void)
1598     {
1599     return m_2D_taille_ecart_type;
1600     }
1601    
1602     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_taille_min_2D(void)
1603     {
1604     return m_2D_taille_min;
1605     }
1606    
1607     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_taille_max_2D(void)
1608     {
1609     return m_2D_taille_max;
1610     }
1611    
1612     OT_HISTOGRAMME* MSTRUCT_ANALYSE_MG_MAILLAGE::get_distribution_taille_2D(void)
1613     {
1614     return &m_2D_taille_histogramme;
1615     }
1616    
1617     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_taille_moyenne_3D(void)
1618     {
1619     return m_3D_taille_moyenne;
1620     }
1621    
1622     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_taille_ecart_type_3D(void)
1623     {
1624     return m_3D_taille_ecart_type;
1625     }
1626    
1627     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_taille_min_3D(void)
1628     {
1629     return m_3D_taille_min;
1630     }
1631    
1632     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_taille_max_3D(void)
1633     {
1634     return m_3D_taille_max;
1635     }
1636    
1637     OT_HISTOGRAMME* MSTRUCT_ANALYSE_MG_MAILLAGE::get_distribution_taille_3D(void)
1638     {
1639     return &m_3D_taille_histogramme;
1640     }
1641    
1642     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_volume_min(void)
1643     {
1644     return m_volume_min;
1645     }
1646    
1647     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_volume_max(void)
1648     {
1649     return m_volume_max;
1650     }
1651    
1652     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_volume_moyenne(void)
1653     {
1654     return m_volume_moyenne;
1655     }
1656    
1657     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_volume_ecart_type(void)
1658     {
1659     return m_volume_ecart_type;
1660     }
1661    
1662     OT_HISTOGRAMME* MSTRUCT_ANALYSE_MG_MAILLAGE::get_distribution_volume(void)
1663     {
1664     return &m_volume_histogramme;
1665     }
1666    
1667     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_fraction_volumique_min(void)
1668     {
1669     return m_fraction_volumique_min;
1670     }
1671    
1672     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_fraction_volumique_max(void)
1673     {
1674     return m_fraction_volumique_max;
1675     }
1676    
1677     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_fraction_volumique_moyenne(void)
1678     {
1679     return m_fraction_volumique_moyenne;
1680     }
1681    
1682     double MSTRUCT_ANALYSE_MG_MAILLAGE::get_fraction_volumique_ecart_type(void)
1683     {
1684     return m_fraction_volumique_ecart_type;
1685     }
1686    
1687     OT_HISTOGRAMME* MSTRUCT_ANALYSE_MG_MAILLAGE::get_distribution_fraction_volumique(void)
1688     {
1689     return & m_fraction_volumique_histogramme;
1690     }
1691    
1692     long int MSTRUCT_ANALYSE_MG_MAILLAGE::get_type(void)
1693     {
1694     return TYPE_ANALYSE::MAILLAGE_MG;
1695     }
1696    
1697     void MSTRUCT_ANALYSE_MG_MAILLAGE::executer(MSTRUCT_VES* ves)
1698     {
1699     MG_CG_GROUPE_FORME* groupe_forme=NULL;
1700     if(m_nom_groupe_forme!="ALL") groupe_forme=ves->get_mgcg_modele()->get_mgcg_groupe_forme(m_nom_groupe_forme);
1701     TPL_MAP_ENTITE<MG_CG_FORME*> tpl_map_forme;
1702     if(groupe_forme!=NULL)
1703     {
1704     std::map<long,MG_CG_FORME*>::iterator it_forme;
1705     for(MG_CG_FORME* forme=groupe_forme->get_premiere_mgcg_forme(it_forme);forme!=NULL;forme=groupe_forme->get_suivante_mgcg_forme(it_forme))
1706     {
1707     tpl_map_forme.ajouter(forme);
1708     }
1709     }
1710     else
1711     {
1712     std::map<long,MG_CG_FORME*>::iterator it_forme;
1713     MG_CG_ASSEMBLAGE* mgcg_ass=ves->get_mgcg_assemblage();
1714     for(MG_CG_FORME*forme=mgcg_ass->get_premiere_mgcg_forme(it_forme);forme!=NULL;forme=mgcg_ass->get_suivante_mgcg_forme(it_forme))
1715     {
1716     tpl_map_forme.ajouter(forme);
1717     }
1718     }
1719     OUTILS::statistiques_mg_maillage(ves->get_boite3d_ves(),
1720     ves->get_mg_maillage(),
1721     tpl_map_forme,
1722     m_nb_element_2D_moyenne,m_nb_element_3D_moyenne,
1723     m_2D_qualite_moyenne,m_2D_qualite_ecart_type,m_2D_qualite_min,m_2D_qualite_max,m_2D_qualite_histogramme,
1724     m_3D_qualite_moyenne,m_3D_qualite_ecart_type,m_3D_qualite_min,m_3D_qualite_min,m_3D_qualite_histogramme,
1725     m_2D_taille_moyenne,m_2D_taille_ecart_type,m_2D_taille_min,m_2D_taille_max,m_2D_taille_histogramme,
1726     m_3D_taille_moyenne,m_3D_taille_ecart_type,m_3D_taille_min,m_3D_taille_max,m_3D_taille_histogramme,
1727     m_volume_moyenne,
1728     m_fraction_volumique_moyenne);
1729     m_nb_element_2D_min=m_nb_element_2D_moyenne;
1730     m_nb_element_2D_max=m_nb_element_2D_moyenne;
1731     m_nb_element_2D_ecart_type=0.0;
1732     m_nb_element_3D_min=m_nb_element_3D_moyenne;
1733     m_nb_element_3D_max=m_nb_element_3D_moyenne;
1734     m_nb_element_3D_ecart_type=0.0;
1735     m_volume_min=m_volume_moyenne;
1736     m_volume_max=m_volume_moyenne;
1737     m_volume_ecart_type=0.0;
1738     m_fraction_volumique_min=m_fraction_volumique_moyenne;
1739     m_fraction_volumique_max=m_fraction_volumique_moyenne;
1740     m_fraction_volumique_ecart_type=0.0;
1741     }
1742    
1743     void MSTRUCT_ANALYSE_MG_MAILLAGE::exporter(ofstream& ofstrm, long int i, bool avec_histo, char* prefix_histo)
1744     {
1745 couturad 927 if(i==1) ofstrm << "#(1) volume[moy(2) ±(3) min(4) max(5)] frac_vol[moy(6) ±(7) min(8) max(9)] nb_ele_2D[moy(10) ±(11) min(12) max(13)] nb_ele_3D[moy(14) ±(15) min(16) max(17)] 2D_qualite[moy(18) ±(19) min(20) max(21)] 3D_qualite[moy(22) ±(23) min(24) max(25)] 2D_taille[moy(26) ±(27) min(28) max(29)] 3D_taille[moy(30) ±(31) min(32) max(33)]" << std::endl;
1746 couturad 926 ofstrm << i << " "
1747     << m_volume_moyenne << " "
1748     << m_volume_ecart_type << " "
1749     << m_volume_min << " "
1750     << m_volume_max << " "
1751     << m_fraction_volumique_moyenne << " "
1752     << m_fraction_volumique_ecart_type << " "
1753     << m_fraction_volumique_min << " "
1754     << m_fraction_volumique_max << " "
1755     << m_nb_element_2D_moyenne << " "
1756     << m_nb_element_2D_ecart_type << " "
1757     << m_nb_element_2D_min << " "
1758     << m_nb_element_2D_max << " "
1759     << m_nb_element_3D_moyenne << " "
1760     << m_nb_element_3D_ecart_type << " "
1761     << m_nb_element_3D_min << " "
1762     << m_nb_element_3D_max << " "
1763     << m_2D_qualite_moyenne << " "
1764     << m_2D_qualite_ecart_type << " "
1765     << m_2D_qualite_min << " "
1766     << m_2D_qualite_max << " "
1767     << m_3D_qualite_moyenne << " "
1768     << m_3D_qualite_ecart_type << " "
1769     << m_3D_qualite_min << " "
1770     << m_3D_qualite_min << " "
1771     << m_2D_taille_moyenne << " "
1772     << m_2D_taille_ecart_type << " "
1773     << m_2D_taille_min << " "
1774     << m_2D_taille_max << " "
1775     << m_3D_taille_moyenne << " "
1776     << m_3D_taille_ecart_type << " "
1777     << m_3D_taille_min << " "
1778     << m_3D_taille_max << " "
1779     << std::endl;
1780     if(avec_histo)
1781     {
1782     char nom_fichier[500];
1783     sprintf(nom_fichier,"%shisto_%s_qualite_2D.txt",prefix_histo,m_identifiant.c_str());
1784     ofstream of_histo_qual_2d(nom_fichier,std::ios::out|std::ios::trunc);
1785     of_histo_qual_2d.precision(16);
1786     of_histo_qual_2d.setf(std::ios::showpoint);
1787     m_2D_qualite_histogramme.exporter(of_histo_qual_2d);
1788     of_histo_qual_2d.close();
1789    
1790     sprintf(nom_fichier,"%shisto_%s_qualite_3D.txt",prefix_histo,m_identifiant.c_str());
1791     ofstream of_histo_qual_3d(nom_fichier,std::ios::out|std::ios::trunc);
1792     of_histo_qual_3d.precision(16);
1793     of_histo_qual_3d.setf(std::ios::showpoint);
1794     m_3D_qualite_histogramme.exporter(of_histo_qual_3d);
1795     of_histo_qual_3d.close();
1796    
1797     sprintf(nom_fichier,"%shisto_%s_taille_2D.txt",prefix_histo,m_identifiant.c_str());
1798     ofstream of_histo_taille_2d(nom_fichier,std::ios::out|std::ios::trunc);
1799     of_histo_taille_2d.precision(16);
1800     of_histo_taille_2d.setf(std::ios::showpoint);
1801     m_2D_taille_histogramme.exporter(of_histo_taille_2d);
1802     of_histo_taille_2d.close();
1803    
1804     sprintf(nom_fichier,"%shisto_%s_taille_3D.txt",prefix_histo,m_identifiant.c_str());
1805     ofstream of_histo_taille_3d(nom_fichier,std::ios::out|std::ios::trunc);
1806     of_histo_taille_3d.precision(16);
1807     of_histo_taille_3d.setf(std::ios::showpoint);
1808     m_3D_taille_histogramme.exporter(of_histo_taille_3d);
1809     of_histo_taille_3d.close();
1810    
1811     sprintf(nom_fichier,"%shisto_%s_volume.txt",prefix_histo,m_identifiant.c_str());
1812     ofstream of_histo_volume(nom_fichier,std::ios::out|std::ios::trunc);
1813     of_histo_volume.precision(16);
1814     of_histo_volume.setf(std::ios::showpoint);
1815     m_volume_histogramme.exporter(of_histo_volume);
1816     of_histo_volume.close();
1817    
1818     sprintf(nom_fichier,"%shisto_%s_frac_vol.txt",prefix_histo,m_identifiant.c_str());
1819     ofstream of_histo_frac_vol(nom_fichier,std::ios::out|std::ios::trunc);
1820     of_histo_frac_vol.precision(16);
1821     of_histo_frac_vol.setf(std::ios::showpoint);
1822     m_fraction_volumique_histogramme.exporter(of_histo_frac_vol);
1823     of_histo_frac_vol.close();
1824    
1825     sprintf(nom_fichier,"%shisto_%s_nb_ele_2D.txt",prefix_histo,m_identifiant.c_str());
1826     ofstream of_histo_nb_ele_2d(nom_fichier,std::ios::out|std::ios::trunc);
1827     of_histo_nb_ele_2d.precision(16);
1828     of_histo_nb_ele_2d.setf(std::ios::showpoint);
1829     m_nb_element_2D_histogramme.exporter(of_histo_nb_ele_2d);
1830     of_histo_nb_ele_2d.close();
1831    
1832     sprintf(nom_fichier,"%shisto_%s_nb_ele_3D.txt",prefix_histo,m_identifiant.c_str());
1833     ofstream of_histo_nb_ele_3d(nom_fichier,std::ios::out|std::ios::trunc);
1834     of_histo_nb_ele_3d.precision(16);
1835     of_histo_nb_ele_3d.setf(std::ios::showpoint);
1836     m_nb_element_3D_histogramme.exporter(of_histo_nb_ele_3d);
1837     of_histo_nb_ele_3d.close();
1838     }
1839    
1840     }
1841    
1842     void MSTRUCT_ANALYSE_MG_MAILLAGE::enregistrer(ofstream& ofstrm)
1843     {
1844     long type_analyse=get_type();
1845     ofstrm.write((char*)&type_analyse,sizeof(long));
1846     MICROSTRUCTURE::MSTRUCT_ANALYSE::enregistrer(ofstrm);
1847     ofstrm.write((char*)&m_id_maillage,sizeof(long));
1848    
1849     ofstrm.write((char*)&m_nb_element_2D_min,sizeof(long));
1850     ofstrm.write((char*)&m_nb_element_2D_max,sizeof(long));
1851     ofstrm.write((char*)&m_nb_element_2D_moyenne,sizeof(long));
1852     ofstrm.write((char*)&m_nb_element_2D_ecart_type,sizeof(long));
1853     m_nb_element_2D_histogramme.enregistrer_bin(ofstrm);
1854    
1855     ofstrm.write((char*)&m_nb_element_3D_min,sizeof(long));
1856     ofstrm.write((char*)&m_nb_element_3D_max,sizeof(long));
1857     ofstrm.write((char*)&m_nb_element_3D_moyenne,sizeof(long));
1858     ofstrm.write((char*)&m_nb_element_3D_ecart_type,sizeof(long));
1859     m_nb_element_3D_histogramme.enregistrer_bin(ofstrm);
1860    
1861     ofstrm.write((char*)&m_2D_qualite_min,sizeof(double));
1862     ofstrm.write((char*)&m_2D_qualite_max,sizeof(double));
1863     ofstrm.write((char*)&m_2D_qualite_moyenne,sizeof(double));
1864     ofstrm.write((char*)&m_2D_qualite_ecart_type,sizeof(double));
1865     m_2D_qualite_histogramme.enregistrer_bin(ofstrm);
1866    
1867     ofstrm.write((char*)&m_3D_qualite_min,sizeof(double));
1868     ofstrm.write((char*)&m_3D_qualite_max,sizeof(double));
1869     ofstrm.write((char*)&m_3D_qualite_moyenne,sizeof(double));
1870     ofstrm.write((char*)&m_3D_qualite_ecart_type,sizeof(double));
1871     m_3D_qualite_histogramme.enregistrer_bin(ofstrm);
1872    
1873     ofstrm.write((char*)&m_2D_taille_min,sizeof(double));
1874     ofstrm.write((char*)&m_2D_taille_max,sizeof(double));
1875     ofstrm.write((char*)&m_2D_taille_moyenne,sizeof(double));
1876     ofstrm.write((char*)&m_2D_taille_ecart_type,sizeof(double));
1877     m_2D_taille_histogramme.enregistrer_bin(ofstrm);
1878    
1879     ofstrm.write((char*)&m_3D_taille_min,sizeof(double));
1880     ofstrm.write((char*)&m_3D_taille_max,sizeof(double));
1881     ofstrm.write((char*)&m_3D_taille_moyenne,sizeof(double));
1882     ofstrm.write((char*)&m_3D_taille_ecart_type,sizeof(double));
1883     m_3D_taille_histogramme.enregistrer_bin(ofstrm);
1884    
1885     ofstrm.write((char*)&m_volume_moyenne,sizeof(double));
1886     ofstrm.write((char*)&m_volume_ecart_type,sizeof(double));
1887     ofstrm.write((char*)&m_volume_min,sizeof(double));
1888     ofstrm.write((char*)&m_volume_max,sizeof(double));
1889     m_volume_histogramme.enregistrer_bin(ofstrm);
1890     ofstrm.write((char*)&m_fraction_volumique_moyenne,sizeof(double));
1891     ofstrm.write((char*)&m_fraction_volumique_ecart_type,sizeof(double));
1892     ofstrm.write((char*)&m_fraction_volumique_min,sizeof(double));
1893     ofstrm.write((char*)&m_fraction_volumique_max,sizeof(double));
1894     m_fraction_volumique_histogramme.enregistrer_bin(ofstrm);
1895     }
1896    
1897     void MSTRUCT_ANALYSE_MG_MAILLAGE::ouvrir(ifstream& ifstrm)
1898     {
1899     MICROSTRUCTURE::MSTRUCT_ANALYSE::ouvrir(ifstrm);
1900     ifstrm.read((char*)&m_id_maillage,sizeof(long));
1901    
1902     ifstrm.read((char*)&m_nb_element_2D_min,sizeof(long));
1903     ifstrm.read((char*)&m_nb_element_2D_max,sizeof(long));
1904     ifstrm.read((char*)&m_nb_element_2D_moyenne,sizeof(long));
1905     ifstrm.read((char*)&m_nb_element_2D_ecart_type,sizeof(long));
1906     m_nb_element_2D_histogramme.ouvrir_bin(ifstrm);
1907    
1908     ifstrm.read((char*)&m_nb_element_3D_min,sizeof(long));
1909     ifstrm.read((char*)&m_nb_element_3D_max,sizeof(long));
1910     ifstrm.read((char*)&m_nb_element_3D_moyenne,sizeof(long));
1911     ifstrm.read((char*)&m_nb_element_3D_ecart_type,sizeof(long));
1912     m_nb_element_3D_histogramme.ouvrir_bin(ifstrm);
1913    
1914     ifstrm.read((char*)&m_2D_qualite_min,sizeof(double));
1915     ifstrm.read((char*)&m_2D_qualite_max,sizeof(double));
1916     ifstrm.read((char*)&m_2D_qualite_moyenne,sizeof(double));
1917     ifstrm.read((char*)&m_2D_qualite_ecart_type,sizeof(double));
1918     m_2D_qualite_histogramme.ouvrir_bin(ifstrm);
1919    
1920     ifstrm.read((char*)&m_3D_qualite_min,sizeof(double));
1921     ifstrm.read((char*)&m_3D_qualite_max,sizeof(double));
1922     ifstrm.read((char*)&m_3D_qualite_moyenne,sizeof(double));
1923     ifstrm.read((char*)&m_3D_qualite_ecart_type,sizeof(double));
1924     m_3D_qualite_histogramme.ouvrir_bin(ifstrm);
1925    
1926     ifstrm.read((char*)&m_2D_taille_min,sizeof(double));
1927     ifstrm.read((char*)&m_2D_taille_max,sizeof(double));
1928     ifstrm.read((char*)&m_2D_taille_moyenne,sizeof(double));
1929     ifstrm.read((char*)&m_2D_taille_ecart_type,sizeof(double));
1930     m_2D_taille_histogramme.ouvrir_bin(ifstrm);
1931    
1932     ifstrm.read((char*)&m_3D_taille_min,sizeof(double));
1933     ifstrm.read((char*)&m_3D_taille_max,sizeof(double));
1934     ifstrm.read((char*)&m_3D_taille_moyenne,sizeof(double));
1935     ifstrm.read((char*)&m_3D_taille_ecart_type,sizeof(double));
1936     m_3D_taille_histogramme.ouvrir_bin(ifstrm);
1937    
1938     ifstrm.read((char*)&m_volume_moyenne,sizeof(double));
1939     ifstrm.read((char*)&m_volume_ecart_type,sizeof(double));
1940     ifstrm.read((char*)&m_volume_min,sizeof(double));
1941     ifstrm.read((char*)&m_volume_max,sizeof(double));
1942     m_volume_histogramme.ouvrir_bin(ifstrm);
1943     ifstrm.read((char*)&m_fraction_volumique_moyenne,sizeof(double));
1944     ifstrm.read((char*)&m_fraction_volumique_ecart_type,sizeof(double));
1945     ifstrm.read((char*)&m_fraction_volumique_min,sizeof(double));
1946     ifstrm.read((char*)&m_fraction_volumique_max,sizeof(double));
1947     m_fraction_volumique_histogramme.ouvrir_bin(ifstrm);
1948     }
1949    
1950     void MSTRUCT_ANALYSE_MG_MAILLAGE::affiche_contenu(MICROSTRUCTURE::fonction_affiche* fonc)
1951     {
1952     MICROSTRUCTURE::MSTRUCT_ANALYSE::affiche_contenu(fonc);
1953     char ligne[5000];
1954     sprintf(ligne,"MSTRUCT_ANALYSE_CAO");fonc(ligne);
1955     sprintf(ligne,"-> ID MG_MAILLAGE : %li",m_id_maillage);fonc(ligne);
1956     sprintf(ligne,"-> Moyenne nb element 2D : %li",m_nb_element_2D_moyenne);fonc(ligne);
1957     sprintf(ligne,"-> Ecart-type nb element 2D : %li",m_nb_element_2D_ecart_type);fonc(ligne);
1958     sprintf(ligne,"-> Min nb element 2D : %li",m_nb_element_2D_min);fonc(ligne);
1959     sprintf(ligne,"-> Max nb element 2D : %li",m_nb_element_2D_max);fonc(ligne);
1960     sprintf(ligne,"-> OT_HISTOGRAMME nb element 2D : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_nb_element_2D_histogramme.get_nb_colonne(),
1961     m_nb_element_2D_histogramme.get_largeur_colonne(),
1962     m_nb_element_2D_histogramme.get_x_min(),
1963     m_nb_element_2D_histogramme.get_x_max());
1964     fonc(ligne);
1965     sprintf(ligne,"-> Moyenne nb element 3D : %li",m_nb_element_3D_moyenne);fonc(ligne);
1966     sprintf(ligne,"-> Ecart-type nb element 3D : %li",m_nb_element_3D_ecart_type);fonc(ligne);
1967     sprintf(ligne,"-> Min nb element 3D : %li",m_nb_element_3D_min);fonc(ligne);
1968     sprintf(ligne,"-> Max nb element 3D : %li",m_nb_element_3D_max);fonc(ligne);
1969     sprintf(ligne,"-> OT_HISTOGRAMME nb element 3D : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_nb_element_3D_histogramme.get_nb_colonne(),
1970     m_nb_element_3D_histogramme.get_largeur_colonne(),
1971     m_nb_element_3D_histogramme.get_x_min(),
1972     m_nb_element_3D_histogramme.get_x_max());
1973     fonc(ligne);
1974     sprintf(ligne,"-> Qualite moyenne 2D : %lf",m_2D_qualite_moyenne);fonc(ligne);
1975     sprintf(ligne,"-> Qualite ecart_type 2D : %lf",m_2D_qualite_ecart_type);fonc(ligne);
1976     sprintf(ligne,"-> Qualite min 2D : %lf",m_2D_qualite_min);fonc(ligne);
1977     sprintf(ligne,"-> Qualite max 2D : %lf",m_2D_qualite_max);fonc(ligne);
1978     sprintf(ligne,"-> OT_HISTOGRAMME Qualite 2D : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_2D_qualite_histogramme.get_nb_colonne(),
1979     m_2D_qualite_histogramme.get_largeur_colonne(),
1980     m_2D_qualite_histogramme.get_x_min(),
1981     m_2D_qualite_histogramme.get_x_max());
1982     fonc(ligne);
1983     sprintf(ligne,"-> Qualite moyenne 3D : %lf",m_3D_qualite_moyenne);fonc(ligne);
1984     sprintf(ligne,"-> Qualite ecart_type 3D : %lf",m_3D_qualite_ecart_type);fonc(ligne);
1985     sprintf(ligne,"-> Qualite min 3D : %lf",m_3D_qualite_min);fonc(ligne);
1986     sprintf(ligne,"-> Qualite max 3D : %lf",m_3D_qualite_max);fonc(ligne);
1987     sprintf(ligne,"-> OT_HISTOGRAMME Qualite 3D : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_3D_qualite_histogramme.get_nb_colonne(),
1988     m_3D_qualite_histogramme.get_largeur_colonne(),
1989     m_3D_qualite_histogramme.get_x_min(),
1990     m_3D_qualite_histogramme.get_x_max());
1991     fonc(ligne);
1992     sprintf(ligne,"-> Taille moyenne 2D : %lf",m_2D_taille_moyenne);fonc(ligne);
1993     sprintf(ligne,"-> Taille ecart_type 2D : %lf",m_2D_taille_ecart_type);fonc(ligne);
1994     sprintf(ligne,"-> Taille min 2D : %lf",m_2D_taille_min);fonc(ligne);
1995     sprintf(ligne,"-> Taille max 2D : %lf",m_2D_taille_max);fonc(ligne);
1996     sprintf(ligne,"-> OT_HISTOGRAMME Taille 2D : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_2D_taille_histogramme.get_nb_colonne(),
1997     m_2D_taille_histogramme.get_largeur_colonne(),
1998     m_2D_taille_histogramme.get_x_min(),
1999     m_2D_taille_histogramme.get_x_max());
2000     fonc(ligne);
2001     sprintf(ligne,"-> Taille moyenne 3D : %lf",m_3D_taille_moyenne);fonc(ligne);
2002     sprintf(ligne,"-> Taille ecart_type 3D : %lf",m_3D_taille_ecart_type);fonc(ligne);
2003     sprintf(ligne,"-> Taille min 3D : %lf",m_3D_taille_min);fonc(ligne);
2004     sprintf(ligne,"-> Taille max 3D : %lf",m_3D_taille_max);fonc(ligne);
2005     sprintf(ligne,"-> OT_HISTOGRAMME Taille 3D : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_3D_taille_histogramme.get_nb_colonne(),
2006     m_3D_taille_histogramme.get_largeur_colonne(),
2007     m_3D_taille_histogramme.get_x_min(),
2008     m_3D_taille_histogramme.get_x_max());
2009     fonc(ligne);
2010     sprintf(ligne,"-> Moyenne volume : %lf",m_volume_moyenne); fonc(ligne);
2011     sprintf(ligne,"-> Ecart-type volume : %lf",m_volume_ecart_type); fonc(ligne);
2012     sprintf(ligne,"-> Min volume : %lf",m_volume_min); fonc(ligne);
2013     sprintf(ligne,"-> Max volume : %lf",m_volume_max); fonc(ligne);
2014     sprintf(ligne,"-> OT_HISTOGRAMME volume : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_volume_histogramme.get_nb_colonne(),
2015     m_volume_histogramme.get_largeur_colonne(),
2016     m_volume_histogramme.get_x_min(),
2017     m_volume_histogramme.get_x_max());
2018     fonc(ligne);
2019     sprintf(ligne,"-> Moyenne fraction volumique : %lf",m_fraction_volumique_moyenne); fonc(ligne);
2020     sprintf(ligne,"-> Ecart-type fraction volumique : %lf",m_fraction_volumique_ecart_type); fonc(ligne);
2021     sprintf(ligne,"-> Min fraction volumique : %lf",m_fraction_volumique_min); fonc(ligne);
2022     sprintf(ligne,"-> Max fraction volumique : %lf",m_fraction_volumique_max); fonc(ligne);
2023     sprintf(ligne,"-> OT_HISTOGRAMME fraction volumique : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_fraction_volumique_histogramme.get_nb_colonne(),
2024     m_fraction_volumique_histogramme.get_largeur_colonne(),
2025     m_fraction_volumique_histogramme.get_x_min(),
2026     m_fraction_volumique_histogramme.get_x_max());
2027     fonc(ligne);
2028     }
2029    
2030    
2031    
2032    
2033    
2034     MSTRUCT_ANALYSE_FEM_MAILLAGE::MSTRUCT_ANALYSE_FEM_MAILLAGE(void): MSTRUCT_ANALYSE()
2035     {
2036    
2037     }
2038    
2039     MSTRUCT_ANALYSE_FEM_MAILLAGE::MSTRUCT_ANALYSE_FEM_MAILLAGE(string identifiant,
2040     long int id_fem_maillage,
2041     double largeur_colonne_nb_element_2D,
2042     double largeur_colonne_nb_element_3D,
2043     double largeur_colonne_jacobien_2D_min,
2044     double largeur_colonne_jacobien_2D_max,
2045     double largeur_colonne_distortion_2D,
2046     double largeur_colonne_jacobien_3D_min,
2047     double largeur_colonne_jacobien_3D_max,
2048     double largeur_colonne_distortion_3D,
2049     double largeur_colonne_volume,
2050     double largeur_colonne_fraction_volumique,
2051     string nom_groupe_forme,
2052     BOITE_3D* boite_3d): MSTRUCT_ANALYSE(identifiant, nom_groupe_forme, boite_3d)
2053     {
2054     m_nb_element_2D_histogramme.fixe_largeur_colonne(largeur_colonne_nb_element_2D);
2055     m_nb_element_3D_histogramme.fixe_largeur_colonne(largeur_colonne_nb_element_3D);
2056     m_2D_jacobien_histogramme_min.fixe_largeur_colonne(largeur_colonne_jacobien_2D_min);
2057     m_2D_jacobien_histogramme_max.fixe_largeur_colonne(largeur_colonne_jacobien_2D_max);
2058     m_3D_jacobien_histogramme_min.fixe_largeur_colonne(largeur_colonne_jacobien_3D_min);
2059     m_3D_jacobien_histogramme_max.fixe_largeur_colonne(largeur_colonne_jacobien_3D_max);
2060     m_2D_distortion_histogramme.fixe_largeur_colonne(largeur_colonne_distortion_2D);
2061     m_3D_distortion_histogramme.fixe_largeur_colonne(largeur_colonne_distortion_3D);
2062     m_volume_histogramme.fixe_largeur_colonne(largeur_colonne_volume);
2063     m_fraction_volumique_histogramme.fixe_largeur_colonne(largeur_colonne_fraction_volumique);
2064     }
2065    
2066     MSTRUCT_ANALYSE_FEM_MAILLAGE::MSTRUCT_ANALYSE_FEM_MAILLAGE(std::vector< MSTRUCT_ANALYSE_FEM_MAILLAGE* >& vector_analyse): MSTRUCT_ANALYSE()
2067     {
2068     std::vector<MSTRUCT_ANALYSE_FEM_MAILLAGE*>::iterator it_analyse=vector_analyse.begin();
2069     MSTRUCT_ANALYSE_FEM_MAILLAGE* analyse = *it_analyse;
2070     m_identifiant=analyse->get_identifiant();
2071     if(analyse->get_boite_analyse()!=NULL) change_boite_analyse(*analyse->get_boite_analyse());
2072     m_nom_groupe_forme=analyse->get_nom_groupe_forme();
2073     m_nb_ves=vector_analyse.size();
2074    
2075     m_nb_element_2D_histogramme.fixe_largeur_colonne(analyse->get_distribution_nb_element_2D()->get_largeur_colonne());
2076     m_nb_element_3D_histogramme.fixe_largeur_colonne(analyse->get_distribution_nb_element_3D()->get_largeur_colonne());
2077     m_2D_jacobien_histogramme_min.fixe_largeur_colonne(analyse->get_distribution_jacobien_min_2D()->get_largeur_colonne());
2078     m_2D_jacobien_histogramme_max.fixe_largeur_colonne(analyse->get_distribution_jacobien_max_2D()->get_largeur_colonne());
2079     m_3D_jacobien_histogramme_min.fixe_largeur_colonne(analyse->get_distribution_jacobien_min_3D()->get_largeur_colonne());
2080     m_3D_jacobien_histogramme_max.fixe_largeur_colonne(analyse->get_distribution_jacobien_max_3D()->get_largeur_colonne());
2081     m_2D_distortion_histogramme.fixe_largeur_colonne(analyse->get_distribution_distortion_2D()->get_largeur_colonne());
2082     m_3D_distortion_histogramme.fixe_largeur_colonne(analyse->get_distribution_distortion_3D()->get_largeur_colonne());
2083     m_volume_histogramme.fixe_largeur_colonne(analyse->get_distribution_volume()->get_largeur_colonne());
2084     m_fraction_volumique_histogramme.fixe_largeur_colonne(analyse->get_distribution_fraction_volumique()->get_largeur_colonne());
2085    
2086     m_id_fem_maillage=-1;
2087    
2088     m_nb_element_2D_moyenne=0.0;
2089     m_nb_element_2D_ecart_type=0.0;
2090     m_nb_element_2D_min=numeric_limits< long >::max();
2091     m_nb_element_2D_max=numeric_limits< long >::min();
2092    
2093     m_nb_element_3D_moyenne=0.0;
2094     m_nb_element_3D_ecart_type=0.0;
2095     m_nb_element_3D_min=numeric_limits< long >::max();
2096     m_nb_element_3D_max=numeric_limits< long >::min();
2097    
2098     m_2D_jacobien_min_min=numeric_limits< double >::max();
2099     m_2D_jacobien_min_max=numeric_limits< double >::min();
2100     m_2D_jacobien_min_moyenne=0.0;
2101     m_2D_jacobien_min_ecart_type=0.0;
2102    
2103     m_2D_jacobien_max_min=numeric_limits< double >::max();
2104     m_2D_jacobien_max_max=numeric_limits< double >::min();
2105     m_2D_jacobien_max_moyenne=0.0;
2106     m_2D_jacobien_max_ecart_type=0.0;
2107    
2108     m_3D_jacobien_min_min=numeric_limits< double >::max();
2109     m_3D_jacobien_min_max=numeric_limits< double >::min();
2110     m_3D_jacobien_min_moyenne=0.0;
2111     m_3D_jacobien_min_ecart_type=0.0;
2112    
2113     m_3D_jacobien_max_min=numeric_limits< double >::max();
2114     m_3D_jacobien_max_max=numeric_limits< double >::min();
2115     m_3D_jacobien_max_moyenne=0.0;
2116     m_3D_jacobien_max_ecart_type=0.0;
2117    
2118     m_2D_distortion_min=numeric_limits< double >::max();
2119     m_2D_distortion_max=numeric_limits< double >::min();
2120     m_2D_distortion_moyenne=0.0;
2121     m_2D_distortion_ecart_type=0.0;
2122    
2123     m_3D_distortion_min=numeric_limits< double >::max();
2124     m_3D_distortion_max=numeric_limits< double >::min();
2125     m_3D_distortion_moyenne=0.0;
2126     m_3D_distortion_ecart_type=0.0;
2127    
2128     m_volume_min=numeric_limits< double >::max();
2129     m_volume_max=numeric_limits< double >::min();
2130     m_volume_moyenne=0.0;
2131     m_volume_ecart_type=0.0;
2132    
2133     m_fraction_volumique_min=numeric_limits< double >::max();
2134     m_fraction_volumique_max=numeric_limits< double >::min();
2135     m_fraction_volumique_ecart_type=0.0;
2136     m_fraction_volumique_moyenne=0.0;
2137    
2138    
2139     for(it_analyse=vector_analyse.begin();it_analyse!=vector_analyse.end();it_analyse++)
2140     {
2141     analyse = *it_analyse;
2142    
2143     m_nb_element_2D_moyenne+=analyse->get_nb_element_2D_moyenne();
2144     m_nb_element_2D_histogramme.ajouter_valeur(analyse->get_nb_element_2D_moyenne(),1./m_nb_ves);
2145     if(analyse->get_nb_element_2D_min()<m_nb_element_2D_min) m_nb_element_2D_min=analyse->get_nb_element_2D_min();
2146     if(analyse->get_nb_element_2D_max()>m_nb_element_2D_max) m_nb_element_2D_max=analyse->get_nb_element_2D_max();
2147    
2148     m_nb_element_3D_moyenne+=analyse->get_nb_element_3D_moyenne();
2149     m_nb_element_3D_histogramme.ajouter_valeur(analyse->get_nb_element_3D_moyenne(),1./m_nb_ves);
2150     if(analyse->get_nb_element_3D_min()<m_nb_element_3D_min) m_nb_element_3D_min=analyse->get_nb_element_3D_min();
2151     if(analyse->get_nb_element_3D_max()>m_nb_element_3D_max) m_nb_element_3D_max=analyse->get_nb_element_3D_max();
2152    
2153     m_2D_jacobien_min_moyenne+=analyse->get_jacobien_min_moyenne_2D();
2154     std::map<long,double>::iterator it_his;
2155     double val;
2156     long l;
2157     int k=analyse->get_distribution_jacobien_min_2D()->get_premiere_valeur(it_his,val,l);
2158     while(k!=0)
2159     {
2160     m_2D_jacobien_histogramme_min.ajouter_valeur(l,val/m_nb_ves);
2161     k=analyse->get_distribution_jacobien_min_2D()->get_suivante_valeur(it_his,val,l);
2162     }
2163     if(analyse->get_jacobien_min_min_2D()<m_2D_jacobien_min_min) m_2D_jacobien_min_min=analyse->get_jacobien_min_min_2D();
2164     if(analyse->get_jacobien_min_max_2D()>m_2D_jacobien_min_max) m_2D_jacobien_min_max=analyse->get_jacobien_min_max_2D();
2165    
2166    
2167     m_2D_jacobien_max_moyenne+=analyse->get_jacobien_max_moyenne_2D();
2168     k=analyse->get_distribution_jacobien_max_2D()->get_premiere_valeur(it_his,val,l);
2169     while(k!=0)
2170     {
2171     m_2D_jacobien_histogramme_max.ajouter_valeur(l,val/m_nb_ves);
2172     k=analyse->get_distribution_jacobien_max_2D()->get_suivante_valeur(it_his,val,l);
2173     }
2174     if(analyse->get_jacobien_max_min_2D()<m_2D_jacobien_max_min) m_2D_jacobien_max_min=analyse->get_jacobien_max_min_2D();
2175     if(analyse->get_jacobien_max_max_2D()>m_2D_jacobien_max_max) m_2D_jacobien_max_max=analyse->get_jacobien_max_max_2D();
2176    
2177     m_3D_jacobien_min_moyenne+=analyse->get_jacobien_min_moyenne_3D();
2178     k=analyse->get_distribution_jacobien_min_3D()->get_premiere_valeur(it_his,val,l);
2179     while(k!=0)
2180     {
2181     m_3D_jacobien_histogramme_min.ajouter_valeur(l,val/m_nb_ves);
2182     k=analyse->get_distribution_jacobien_min_3D()->get_suivante_valeur(it_his,val,l);
2183     }
2184     if(analyse->get_jacobien_min_min_3D()<m_3D_jacobien_min_min) m_3D_jacobien_min_min=analyse->get_jacobien_min_min_3D();
2185     if(analyse->get_jacobien_min_max_3D()>m_3D_jacobien_min_max) m_3D_jacobien_min_max=analyse->get_jacobien_min_max_3D();
2186    
2187     m_3D_jacobien_max_moyenne+=analyse->get_jacobien_max_moyenne_3D();
2188     k=analyse->get_distribution_jacobien_max_3D()->get_premiere_valeur(it_his,val,l);
2189     while(k!=0)
2190     {
2191     m_3D_jacobien_histogramme_max.ajouter_valeur(l,val/m_nb_ves);
2192     k=analyse->get_distribution_jacobien_max_3D()->get_suivante_valeur(it_his,val,l);
2193     }
2194     if(analyse->get_jacobien_max_min_3D()<m_3D_jacobien_max_min) m_3D_jacobien_max_min=analyse->get_jacobien_max_min_3D();
2195     if(analyse->get_jacobien_max_max_3D()>m_3D_jacobien_max_max) m_3D_jacobien_max_max=analyse->get_jacobien_max_max_3D();
2196    
2197     m_2D_distortion_moyenne+=analyse->get_distortion_moyenne_2D();
2198     k=analyse->get_distribution_distortion_2D()->get_premiere_valeur(it_his,val,l);
2199     while(k!=0)
2200     {
2201     m_2D_distortion_histogramme.ajouter_valeur(l,val/m_nb_ves);
2202     k=analyse->get_distribution_distortion_2D()->get_suivante_valeur(it_his,val,l);
2203     }
2204     if(analyse->get_distortion_min_2D()<m_2D_distortion_min) m_2D_distortion_min=analyse->get_distortion_min_2D();
2205     if(analyse->get_distortion_max_2D()>m_2D_distortion_max) m_2D_distortion_max=analyse->get_distortion_max_2D();
2206    
2207     m_3D_distortion_moyenne+=analyse->get_distortion_moyenne_3D();
2208     k=analyse->get_distribution_distortion_3D()->get_premiere_valeur(it_his,val,l);
2209     while(k!=0)
2210     {
2211     m_3D_distortion_histogramme.ajouter_valeur(l,val/m_nb_ves);
2212     k=analyse->get_distribution_distortion_3D()->get_suivante_valeur(it_his,val,l);
2213     }
2214     if(analyse->get_distortion_min_3D()<m_3D_distortion_min) m_3D_distortion_min=analyse->get_distortion_min_3D();
2215     if(analyse->get_distortion_max_3D()>m_3D_distortion_max) m_3D_distortion_max=analyse->get_distortion_max_3D();
2216    
2217     m_volume_moyenne+=analyse->get_volume_moyenne();
2218     m_volume_histogramme.ajouter_valeur(analyse->get_volume_moyenne(),1.0/m_nb_ves);
2219     if(analyse->get_volume_min()<m_volume_min) m_volume_min=analyse->get_volume_min();
2220     if(analyse->get_volume_max()>m_volume_max) m_volume_max=analyse->get_volume_max();
2221    
2222     m_fraction_volumique_moyenne+=analyse->get_fraction_volumique_moyenne();
2223     m_fraction_volumique_histogramme.ajouter_valeur(analyse->get_fraction_volumique_moyenne(),1.0/m_nb_ves);
2224     if(analyse->get_fraction_volumique_min()<m_fraction_volumique_min) m_fraction_volumique_min=analyse->get_fraction_volumique_min();
2225     if(analyse->get_fraction_volumique_max()>m_fraction_volumique_max) m_fraction_volumique_max=analyse->get_fraction_volumique_max();
2226     }
2227     m_nb_element_2D_moyenne=m_nb_element_2D_moyenne/m_nb_ves;
2228     m_nb_element_3D_moyenne=m_nb_element_3D_moyenne/m_nb_ves;
2229     m_2D_jacobien_min_moyenne=m_2D_jacobien_min_moyenne/m_nb_ves;
2230     m_2D_jacobien_max_moyenne=m_2D_jacobien_max_moyenne/m_nb_ves;
2231     m_3D_jacobien_min_moyenne=m_3D_jacobien_min_moyenne/m_nb_ves;
2232     m_3D_jacobien_max_moyenne=m_3D_jacobien_max_moyenne/m_nb_ves;
2233     m_2D_distortion_moyenne=m_2D_distortion_moyenne/m_nb_ves;
2234     m_3D_distortion_moyenne=m_3D_distortion_moyenne/m_nb_ves;
2235     m_volume_moyenne=m_volume_moyenne/m_nb_ves;
2236     m_fraction_volumique_moyenne=m_fraction_volumique_moyenne/m_nb_ves;
2237 couturad 927 if(m_nb_ves>1)
2238 couturad 926 {
2239 couturad 927 for(it_analyse=vector_analyse.begin();it_analyse!=vector_analyse.end();it_analyse++)
2240     {
2241     analyse = *it_analyse;
2242     m_nb_element_2D_ecart_type+=(analyse->get_nb_element_2D_moyenne()-m_nb_element_2D_moyenne)*(analyse->get_nb_element_2D_moyenne()-m_nb_element_2D_moyenne);
2243     m_nb_element_3D_ecart_type+=(analyse->get_nb_element_3D_moyenne()-m_nb_element_3D_moyenne)*(analyse->get_nb_element_3D_moyenne()-m_nb_element_3D_moyenne);
2244     m_2D_jacobien_min_ecart_type+=(analyse->get_jacobien_min_moyenne_2D()-m_2D_jacobien_min_moyenne)*(analyse->get_jacobien_min_moyenne_2D()-m_2D_jacobien_min_moyenne);
2245     m_2D_jacobien_max_ecart_type+=(analyse->get_jacobien_max_moyenne_2D()-m_2D_jacobien_max_moyenne)*(analyse->get_jacobien_max_moyenne_2D()-m_2D_jacobien_max_moyenne);
2246     m_3D_jacobien_min_ecart_type+=(analyse->get_jacobien_min_moyenne_3D()-m_3D_jacobien_min_moyenne)*(analyse->get_jacobien_min_moyenne_3D()-m_3D_jacobien_min_moyenne);
2247     m_3D_jacobien_max_ecart_type+=(analyse->get_jacobien_max_moyenne_3D()-m_3D_jacobien_max_moyenne)*(analyse->get_jacobien_max_moyenne_3D()-m_3D_jacobien_max_moyenne);
2248     m_2D_distortion_ecart_type+=(analyse->get_distortion_moyenne_2D()-m_2D_distortion_moyenne)*(analyse->get_distortion_moyenne_2D()-m_2D_distortion_moyenne);
2249     m_3D_distortion_ecart_type+=(analyse->get_distortion_moyenne_3D()-m_3D_distortion_moyenne)*(analyse->get_distortion_moyenne_3D()-m_3D_distortion_moyenne);
2250     m_volume_ecart_type+=(analyse->get_volume_ecart_type()-m_volume_moyenne)*(analyse->get_volume_ecart_type()-m_volume_moyenne);
2251     m_fraction_volumique_ecart_type+=(analyse->get_fraction_volumique_ecart_type()-m_fraction_volumique_moyenne)*(analyse->get_fraction_volumique_ecart_type()-m_fraction_volumique_moyenne);
2252     }
2253     m_nb_element_2D_ecart_type=sqrt(m_nb_element_2D_ecart_type*(1.0/(m_nb_ves-1.0)));
2254     m_nb_element_3D_ecart_type=sqrt(m_nb_element_3D_ecart_type*(1.0/(m_nb_ves-1.0)));
2255     m_2D_jacobien_min_ecart_type=sqrt(m_2D_jacobien_min_ecart_type*(1.0/(m_nb_ves-1.0)));
2256     m_2D_jacobien_max_ecart_type=sqrt(m_2D_jacobien_max_ecart_type*(1.0/(m_nb_ves-1.0)));
2257     m_3D_jacobien_min_ecart_type=sqrt(m_3D_jacobien_min_ecart_type*(1.0/(m_nb_ves-1.0)));
2258     m_3D_jacobien_max_ecart_type=sqrt(m_3D_jacobien_max_ecart_type*(1.0/(m_nb_ves-1.0)));
2259     m_2D_distortion_ecart_type=sqrt(m_2D_distortion_ecart_type*(1.0/(m_nb_ves-1.0)));
2260     m_3D_distortion_ecart_type=sqrt(m_3D_distortion_ecart_type*(1.0/(m_nb_ves-1.0)));
2261     m_volume_ecart_type=sqrt(m_volume_ecart_type*(1.0/(m_nb_ves-1.0)));
2262     m_fraction_volumique_ecart_type=sqrt(m_fraction_volumique_ecart_type*(1.0/(m_nb_ves-1.0)));
2263     }
2264 couturad 926 }
2265    
2266    
2267     MSTRUCT_ANALYSE_FEM_MAILLAGE::MSTRUCT_ANALYSE_FEM_MAILLAGE(MSTRUCT_ANALYSE_FEM_MAILLAGE& mdd): MSTRUCT_ANALYSE(mdd)
2268     {
2269     m_id_fem_maillage=mdd.m_id_fem_maillage;
2270     m_nb_element_2D_moyenne=mdd.m_nb_element_2D_moyenne;
2271     m_nb_element_2D_ecart_type=mdd.m_nb_element_2D_ecart_type;
2272     m_nb_element_2D_min=mdd.m_nb_element_2D_min;
2273     m_nb_element_2D_max=mdd.m_nb_element_2D_max;
2274     m_nb_element_2D_histogramme=mdd.m_nb_element_2D_histogramme;
2275     m_nb_element_3D_moyenne=mdd.m_nb_element_3D_moyenne;
2276     m_nb_element_3D_ecart_type=mdd.m_nb_element_3D_ecart_type;
2277     m_nb_element_3D_min=mdd.m_nb_element_3D_min;
2278     m_nb_element_3D_max=mdd.m_nb_element_3D_max;
2279     m_nb_element_3D_histogramme=mdd.m_nb_element_3D_histogramme;
2280    
2281     m_2D_jacobien_min_min=mdd.m_2D_jacobien_min_min;
2282     m_2D_jacobien_min_max=mdd.m_2D_jacobien_min_max;
2283     m_2D_jacobien_min_moyenne=mdd.m_2D_jacobien_min_moyenne;
2284     m_2D_jacobien_min_ecart_type=mdd.m_2D_jacobien_min_ecart_type;
2285     m_2D_jacobien_histogramme_min=mdd.m_2D_jacobien_histogramme_min;
2286    
2287     m_2D_jacobien_max_min=mdd.m_2D_jacobien_max_min;
2288     m_2D_jacobien_max_max=mdd.m_2D_jacobien_max_max;
2289     m_2D_jacobien_max_moyenne=mdd.m_2D_jacobien_max_moyenne;
2290     m_2D_jacobien_max_ecart_type=mdd.m_2D_jacobien_max_ecart_type;
2291     m_2D_jacobien_histogramme_max=mdd.m_2D_jacobien_histogramme_max;
2292    
2293     m_3D_jacobien_min_min=mdd.m_3D_jacobien_min_min;
2294     m_3D_jacobien_min_max=mdd.m_3D_jacobien_min_max;
2295     m_3D_jacobien_min_moyenne=mdd.m_3D_jacobien_min_moyenne;
2296     m_3D_jacobien_min_ecart_type=mdd.m_3D_jacobien_min_ecart_type;
2297     m_3D_jacobien_histogramme_min=mdd.m_3D_jacobien_histogramme_min;
2298    
2299     m_3D_jacobien_max_min=mdd.m_3D_jacobien_max_min;
2300     m_3D_jacobien_max_max=mdd.m_3D_jacobien_max_max;
2301     m_3D_jacobien_max_moyenne=mdd.m_3D_jacobien_max_moyenne;
2302     m_3D_jacobien_max_ecart_type=mdd.m_3D_jacobien_max_ecart_type;
2303     m_3D_jacobien_histogramme_max=mdd.m_3D_jacobien_histogramme_max;
2304    
2305     m_2D_distortion_min=mdd.m_2D_distortion_min;
2306     m_2D_distortion_max=mdd.m_2D_distortion_max;
2307     m_2D_distortion_moyenne=mdd.m_2D_distortion_moyenne;
2308     m_2D_distortion_ecart_type=mdd.m_2D_distortion_ecart_type;
2309     m_2D_distortion_histogramme=mdd.m_2D_distortion_histogramme;
2310     m_3D_distortion_min=mdd.m_3D_distortion_min;
2311     m_3D_distortion_max=mdd.m_3D_distortion_max;
2312     m_3D_distortion_moyenne=mdd.m_3D_distortion_moyenne;
2313     m_3D_distortion_ecart_type=mdd.m_3D_distortion_ecart_type;
2314     m_3D_distortion_histogramme=mdd.m_3D_distortion_histogramme;
2315    
2316     m_volume_min=mdd.m_volume_min;
2317     m_volume_max=mdd.m_volume_max;
2318     m_volume_moyenne=mdd.m_volume_moyenne;
2319     m_volume_ecart_type=mdd.m_volume_ecart_type;
2320     m_volume_histogramme=mdd.m_volume_histogramme;
2321     m_fraction_volumique_min=mdd.m_fraction_volumique_min;
2322     m_fraction_volumique_max=mdd.m_fraction_volumique_max;
2323     m_fraction_volumique_ecart_type=mdd.m_fraction_volumique_ecart_type;
2324     m_fraction_volumique_moyenne=mdd.m_fraction_volumique_moyenne;
2325     m_fraction_volumique_histogramme=mdd.m_fraction_volumique_histogramme;
2326     }
2327    
2328     MSTRUCT_ANALYSE_FEM_MAILLAGE::~MSTRUCT_ANALYSE_FEM_MAILLAGE(void)
2329     {
2330    
2331     }
2332    
2333     long int MSTRUCT_ANALYSE_FEM_MAILLAGE::get_id_fem_maillage(void)
2334     {
2335     return m_id_fem_maillage;
2336     }
2337    
2338     long int MSTRUCT_ANALYSE_FEM_MAILLAGE::get_nb_element_2D_min(void)
2339     {
2340     return m_nb_element_2D_min;
2341     }
2342    
2343     long int MSTRUCT_ANALYSE_FEM_MAILLAGE::get_nb_element_2D_max(void)
2344     {
2345     return m_nb_element_2D_max;
2346     }
2347    
2348     long int MSTRUCT_ANALYSE_FEM_MAILLAGE::get_nb_element_2D_moyenne(void)
2349     {
2350     return m_nb_element_2D_moyenne;
2351     }
2352    
2353     long int MSTRUCT_ANALYSE_FEM_MAILLAGE::get_nb_element_2D_ecart_type(void)
2354     {
2355     return m_nb_element_2D_ecart_type;
2356     }
2357    
2358     OT_HISTOGRAMME* MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distribution_nb_element_2D(void)
2359     {
2360     return &m_nb_element_2D_histogramme;
2361     }
2362    
2363     long int MSTRUCT_ANALYSE_FEM_MAILLAGE::get_nb_element_3D_min(void)
2364     {
2365     return m_nb_element_3D_min;
2366     }
2367    
2368     long int MSTRUCT_ANALYSE_FEM_MAILLAGE::get_nb_element_3D_max(void)
2369     {
2370     return m_nb_element_3D_max;
2371     }
2372    
2373     long int MSTRUCT_ANALYSE_FEM_MAILLAGE::get_nb_element_3D_moyenne(void)
2374     {
2375     return m_nb_element_3D_moyenne;
2376     }
2377    
2378     long int MSTRUCT_ANALYSE_FEM_MAILLAGE::get_nb_element_3D_ecart_type(void)
2379     {
2380     return m_nb_element_3D_ecart_type;
2381     }
2382    
2383     OT_HISTOGRAMME* MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distribution_nb_element_3D(void)
2384     {
2385     return &m_nb_element_3D_histogramme;
2386     }
2387    
2388     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_min_moyenne_2D(void)
2389     {
2390     return m_2D_jacobien_min_moyenne;
2391     }
2392    
2393     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_min_ecart_type_2D(void)
2394     {
2395     return m_2D_jacobien_min_ecart_type;
2396     }
2397    
2398     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_min_min_2D(void)
2399     {
2400     return m_2D_jacobien_min_min;
2401     }
2402    
2403     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_min_max_2D(void)
2404     {
2405     return m_2D_jacobien_min_max;
2406     }
2407    
2408     OT_HISTOGRAMME* MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distribution_jacobien_min_2D(void)
2409     {
2410     return &m_2D_jacobien_histogramme_min;
2411     }
2412    
2413     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_max_moyenne_2D(void)
2414     {
2415     return m_2D_jacobien_max_moyenne;
2416     }
2417    
2418     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_max_ecart_type_2D(void)
2419     {
2420     return m_2D_jacobien_max_ecart_type;
2421     }
2422    
2423     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_max_min_2D(void)
2424     {
2425     return m_2D_jacobien_max_min;
2426     }
2427    
2428     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_max_max_2D(void)
2429     {
2430     return m_2D_jacobien_max_max;
2431     }
2432    
2433     OT_HISTOGRAMME* MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distribution_jacobien_max_2D(void)
2434     {
2435     return &m_2D_jacobien_histogramme_max;
2436     }
2437    
2438     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_min_moyenne_3D(void)
2439     {
2440     return m_3D_jacobien_min_moyenne;
2441     }
2442    
2443     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_min_ecart_type_3D(void)
2444     {
2445     return m_3D_jacobien_min_ecart_type;
2446     }
2447    
2448     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_min_min_3D(void)
2449     {
2450     return m_3D_jacobien_min_min;
2451     }
2452    
2453     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_min_max_3D(void)
2454     {
2455     return m_3D_jacobien_min_max;
2456     }
2457    
2458     OT_HISTOGRAMME* MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distribution_jacobien_min_3D(void)
2459     {
2460     return &m_3D_jacobien_histogramme_min;
2461     }
2462    
2463     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_max_moyenne_3D(void)
2464     {
2465     return m_3D_jacobien_max_moyenne;
2466     }
2467    
2468     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_max_ecart_type_3D(void)
2469     {
2470     return m_3D_jacobien_max_ecart_type;
2471     }
2472    
2473     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_max_min_3D(void)
2474     {
2475     return m_3D_jacobien_max_min;
2476     }
2477    
2478     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_jacobien_max_max_3D(void)
2479     {
2480     return m_3D_jacobien_max_max;
2481     }
2482    
2483     OT_HISTOGRAMME* MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distribution_jacobien_max_3D(void)
2484     {
2485     return &m_3D_jacobien_histogramme_max;
2486     }
2487    
2488     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distortion_moyenne_2D(void)
2489     {
2490     return m_2D_distortion_moyenne;
2491     }
2492    
2493     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distortion_ecart_type_2D(void)
2494     {
2495     return m_2D_distortion_ecart_type;
2496     }
2497    
2498     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distortion_min_2D(void)
2499     {
2500     return m_2D_distortion_min;
2501     }
2502    
2503     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distortion_max_2D(void)
2504     {
2505     return m_2D_distortion_max;
2506     }
2507    
2508     OT_HISTOGRAMME* MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distribution_distortion_2D(void)
2509     {
2510     return &m_2D_distortion_histogramme;
2511     }
2512    
2513     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distortion_moyenne_3D(void)
2514     {
2515     return m_3D_distortion_moyenne;
2516     }
2517    
2518     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distortion_ecart_type_3D(void)
2519     {
2520     return m_3D_distortion_ecart_type;
2521     }
2522    
2523     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distortion_min_3D(void)
2524     {
2525     return m_3D_distortion_min;
2526     }
2527    
2528     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distortion_max_3D(void)
2529     {
2530     return m_3D_distortion_max;
2531     }
2532    
2533     OT_HISTOGRAMME* MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distribution_distortion_3D(void)
2534     {
2535     return &m_3D_distortion_histogramme;
2536     }
2537    
2538     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_volume_min(void)
2539     {
2540     return m_volume_min;
2541     }
2542    
2543     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_volume_max(void)
2544     {
2545     return m_volume_max;
2546     }
2547    
2548     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_volume_moyenne(void)
2549     {
2550     return m_volume_moyenne;
2551     }
2552    
2553     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_volume_ecart_type(void)
2554     {
2555     return m_volume_ecart_type;
2556     }
2557    
2558     OT_HISTOGRAMME* MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distribution_volume(void)
2559     {
2560     return &m_volume_histogramme;
2561     }
2562    
2563     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_fraction_volumique_min(void)
2564     {
2565     return m_fraction_volumique_min;
2566     }
2567    
2568     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_fraction_volumique_max(void)
2569     {
2570     return m_fraction_volumique_max;
2571     }
2572    
2573     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_fraction_volumique_moyenne(void)
2574     {
2575     return m_fraction_volumique_moyenne;
2576     }
2577    
2578     double MSTRUCT_ANALYSE_FEM_MAILLAGE::get_fraction_volumique_ecart_type(void)
2579     {
2580     return m_fraction_volumique_ecart_type;
2581     }
2582    
2583     OT_HISTOGRAMME* MSTRUCT_ANALYSE_FEM_MAILLAGE::get_distribution_fraction_volumique(void)
2584     {
2585     return &m_fraction_volumique_histogramme;
2586     }
2587    
2588     long int MSTRUCT_ANALYSE_FEM_MAILLAGE::get_type(void)
2589     {
2590     return TYPE_ANALYSE::MAILLAGE_FEM;
2591     }
2592    
2593     void MSTRUCT_ANALYSE_FEM_MAILLAGE::executer(MSTRUCT_VES* ves)
2594     {
2595     FEM_MAILLAGE* fem=ves->get_fem_maillage();
2596     MG_CG_GROUPE_FORME* groupe_forme=NULL;
2597     if(m_nom_groupe_forme!="ALL") groupe_forme=ves->get_mgcg_modele()->get_mgcg_groupe_forme(m_nom_groupe_forme);
2598     TPL_MAP_ENTITE<MG_CG_FORME*> tpl_map_forme;
2599     if(groupe_forme!=NULL)
2600     {
2601     std::map<long,MG_CG_FORME*>::iterator it_forme;
2602     for(MG_CG_FORME* forme=groupe_forme->get_premiere_mgcg_forme(it_forme);forme!=NULL;forme=groupe_forme->get_suivante_mgcg_forme(it_forme))
2603     {
2604     tpl_map_forme.ajouter(forme);
2605     }
2606     }
2607     else
2608     {
2609     std::map<long,MG_CG_FORME*>::iterator it_forme;
2610     MG_CG_ASSEMBLAGE* mgcg_ass=ves->get_mgcg_assemblage();
2611     for(MG_CG_FORME*forme=mgcg_ass->get_premiere_mgcg_forme(it_forme);forme!=NULL;forme=mgcg_ass->get_suivante_mgcg_forme(it_forme))
2612     {
2613     tpl_map_forme.ajouter(forme);
2614     }
2615     }
2616 couturad 931 OUTILS::statistiques_fem_maillage(fem,
2617 couturad 926 m_boite_analyse,
2618     tpl_map_forme,
2619     m_nb_element_2D_moyenne,m_nb_element_3D_moyenne,
2620     m_2D_jacobien_min_moyenne, m_2D_jacobien_min_ecart_type, m_2D_jacobien_min_min, m_2D_jacobien_min_max,m_2D_jacobien_histogramme_min,
2621     m_2D_jacobien_max_moyenne, m_2D_jacobien_max_ecart_type, m_2D_jacobien_max_min, m_2D_jacobien_max_max,m_2D_jacobien_histogramme_max,
2622     m_3D_jacobien_min_moyenne, m_3D_jacobien_min_ecart_type, m_3D_jacobien_min_min, m_3D_jacobien_min_max,m_3D_jacobien_histogramme_min,
2623     m_3D_jacobien_max_moyenne, m_3D_jacobien_max_ecart_type, m_3D_jacobien_max_min, m_3D_jacobien_max_max,m_3D_jacobien_histogramme_max,
2624     m_2D_distortion_moyenne,m_2D_distortion_ecart_type,m_2D_distortion_min,m_2D_distortion_max,m_2D_distortion_histogramme,
2625     m_3D_distortion_moyenne,m_3D_distortion_ecart_type,m_3D_distortion_min,m_3D_distortion_max,m_3D_distortion_histogramme,
2626     m_volume_moyenne,
2627     m_fraction_volumique_moyenne);
2628     m_nb_element_2D_min=m_nb_element_2D_moyenne;
2629     m_nb_element_2D_max=m_nb_element_2D_moyenne;
2630     m_nb_element_2D_ecart_type=0.0;
2631     m_nb_element_3D_min=m_nb_element_3D_moyenne;
2632     m_nb_element_3D_max=m_nb_element_3D_moyenne;
2633     m_nb_element_3D_ecart_type=0.0;
2634     m_volume_min=m_volume_moyenne;
2635     m_volume_max=m_volume_moyenne;
2636     m_volume_ecart_type=0.0;
2637     m_fraction_volumique_min=m_fraction_volumique_moyenne;
2638     m_fraction_volumique_max=m_fraction_volumique_moyenne;
2639     m_fraction_volumique_ecart_type=0.0;
2640     }
2641    
2642     void MSTRUCT_ANALYSE_FEM_MAILLAGE::exporter(ofstream& ofstrm, long int i, bool avec_histo, char* prefix_histo)
2643     {
2644 couturad 927 if(i==1) ofstrm << "#(1) volume[moy(2) ±(3) min(4) max(5)] frac_vol[moy(6) ±(7) min(8) max(9)] nb_ele_2D[moy(10) ±(11) min(12) max(13)] nb_ele_3D[moy(14) ±(15) min(16) max(17)] jacobien_min_2D[moy(18) ±(19) min(20) max(21)] jacobien_max_2D[moy(22) ±(23) min(24) max(25)] jacobien_min_3D[moy(26) ±(27) min(28) max(29)] jacobien_max_3D[moy(30) ±(31) min(32) max(33)] distortion_2D[moy(34) ±(35) min(36) max(37)] distortion_3D[moy(38) ±(39) min(40) max(41)]" << std::endl;
2645 couturad 926 ofstrm << i << " "
2646     << m_volume_moyenne << " "
2647     << m_volume_ecart_type << " "
2648     << m_volume_max << " "
2649     << m_volume_max << " "
2650     << m_fraction_volumique_moyenne << " "
2651     << m_fraction_volumique_ecart_type << " "
2652     << m_fraction_volumique_min << " "
2653     << m_fraction_volumique_max << " "
2654     << m_nb_element_2D_moyenne << " "
2655     << m_nb_element_2D_ecart_type << " "
2656     << m_nb_element_2D_min << " "
2657     << m_nb_element_2D_max << " "
2658     << m_nb_element_3D_moyenne << " "
2659     << m_nb_element_3D_ecart_type << " "
2660     << m_nb_element_3D_min << " "
2661     << m_nb_element_3D_max << " "
2662     << m_2D_jacobien_min_moyenne << " "
2663     << m_2D_jacobien_min_ecart_type << " "
2664     << m_2D_jacobien_min_min << " "
2665     << m_2D_jacobien_min_max << " "
2666     << m_2D_jacobien_max_moyenne << " "
2667     << m_2D_jacobien_max_ecart_type << " "
2668     << m_2D_jacobien_max_min << " "
2669     << m_2D_jacobien_max_max << " "
2670     << m_3D_jacobien_min_moyenne << " "
2671     << m_3D_jacobien_min_ecart_type << " "
2672     << m_3D_jacobien_min_min << " "
2673     << m_3D_jacobien_min_max << " "
2674     << m_3D_jacobien_max_moyenne << " "
2675     << m_3D_jacobien_max_ecart_type << " "
2676     << m_3D_jacobien_max_min << " "
2677     << m_3D_jacobien_max_max << " "
2678     << m_2D_distortion_moyenne << " "
2679     << m_2D_distortion_ecart_type << " "
2680     << m_2D_distortion_min << " "
2681     << m_2D_distortion_max << " "
2682     << m_3D_distortion_moyenne << " "
2683     << m_3D_distortion_ecart_type << " "
2684     << m_3D_distortion_min << " "
2685     << m_3D_distortion_max << std::endl;
2686     if(avec_histo)
2687     {
2688     char nom_fichier[500];
2689     sprintf(nom_fichier,"%shisto_%s_jacobien_min_2D.txt",prefix_histo,m_identifiant.c_str());
2690     ofstream of_histo_javcobien_min_2d(nom_fichier,std::ios::out|std::ios::trunc);
2691     of_histo_javcobien_min_2d.precision(16);
2692     of_histo_javcobien_min_2d.setf(std::ios::showpoint);
2693     m_2D_jacobien_histogramme_min.exporter(of_histo_javcobien_min_2d);
2694     of_histo_javcobien_min_2d.close();
2695    
2696     sprintf(nom_fichier,"%shisto_%s_jacobien_max_2D.txt",prefix_histo,m_identifiant.c_str());
2697     ofstream of_histo_javcobien_max_2d(nom_fichier,std::ios::out|std::ios::trunc);
2698     of_histo_javcobien_max_2d.precision(16);
2699     of_histo_javcobien_max_2d.setf(std::ios::showpoint);
2700     m_2D_jacobien_histogramme_max.exporter(of_histo_javcobien_max_2d);
2701     of_histo_javcobien_max_2d.close();
2702    
2703     sprintf(nom_fichier,"%shisto_%s_jacobien_min_3D.txt",prefix_histo,m_identifiant.c_str());
2704     ofstream of_histo_javcobien_min_3d(nom_fichier,std::ios::out|std::ios::trunc);
2705     of_histo_javcobien_min_3d.precision(16);
2706     of_histo_javcobien_min_3d.setf(std::ios::showpoint);
2707     m_3D_jacobien_histogramme_min.exporter(of_histo_javcobien_min_3d);
2708     of_histo_javcobien_min_3d.close();
2709    
2710     sprintf(nom_fichier,"%shisto_%s_jacobien_max_3D.txt",prefix_histo,m_identifiant.c_str());
2711     ofstream of_histo_javcobien_max_3d(nom_fichier,std::ios::out|std::ios::trunc);
2712     of_histo_javcobien_max_3d.precision(16);
2713     of_histo_javcobien_max_3d.setf(std::ios::showpoint);
2714     m_3D_jacobien_histogramme_max.exporter(of_histo_javcobien_max_3d);
2715     of_histo_javcobien_max_3d.close();
2716    
2717     sprintf(nom_fichier,"%shisto_%s_distortion_2D.txt",prefix_histo,m_identifiant.c_str());
2718     ofstream of_histo_distortion_2D(nom_fichier,std::ios::out|std::ios::trunc);
2719     of_histo_distortion_2D.precision(16);
2720     of_histo_distortion_2D.setf(std::ios::showpoint);
2721     m_2D_distortion_histogramme.exporter(of_histo_distortion_2D);
2722     of_histo_distortion_2D.close();
2723    
2724     sprintf(nom_fichier,"%shisto_%s_distortion_3D.txt",prefix_histo,m_identifiant.c_str());
2725     ofstream of_histo_distortion_3D(nom_fichier,std::ios::out|std::ios::trunc);
2726     of_histo_distortion_3D.precision(16);
2727     of_histo_distortion_3D.setf(std::ios::showpoint);
2728     m_3D_distortion_histogramme.exporter(of_histo_distortion_3D);
2729     of_histo_distortion_3D.close();
2730    
2731     sprintf(nom_fichier,"%shisto_%s_volume.txt",prefix_histo,m_identifiant.c_str());
2732     ofstream of_histo_volume(nom_fichier,std::ios::out|std::ios::trunc);
2733     of_histo_volume.precision(16);
2734     of_histo_volume.setf(std::ios::showpoint);
2735     m_volume_histogramme.exporter(of_histo_volume);
2736     of_histo_volume.close();
2737    
2738     sprintf(nom_fichier,"%shisto_%s_frac_vol.txt",prefix_histo,m_identifiant.c_str());
2739     ofstream of_histo_frac_vol(nom_fichier,std::ios::out|std::ios::trunc);
2740     of_histo_frac_vol.precision(16);
2741     of_histo_frac_vol.setf(std::ios::showpoint);
2742     m_fraction_volumique_histogramme.exporter(of_histo_frac_vol);
2743     of_histo_frac_vol.close();
2744    
2745     sprintf(nom_fichier,"%shisto_%s_nb_ele_2D.txt",prefix_histo,m_identifiant.c_str());
2746     ofstream of_histo_nb_ele_2d(nom_fichier,std::ios::out|std::ios::trunc);
2747     of_histo_nb_ele_2d.precision(16);
2748     of_histo_nb_ele_2d.setf(std::ios::showpoint);
2749     m_nb_element_2D_histogramme.exporter(of_histo_nb_ele_2d);
2750     of_histo_nb_ele_2d.close();
2751    
2752     sprintf(nom_fichier,"%shisto_%s_nb_ele_3D.txt",prefix_histo,m_identifiant.c_str());
2753     ofstream of_histo_nb_ele_3d(nom_fichier,std::ios::out|std::ios::trunc);
2754     of_histo_nb_ele_3d.precision(16);
2755     of_histo_nb_ele_3d.setf(std::ios::showpoint);
2756     m_nb_element_3D_histogramme.exporter(of_histo_nb_ele_3d);
2757     of_histo_nb_ele_3d.close();
2758     }
2759     }
2760    
2761     void MSTRUCT_ANALYSE_FEM_MAILLAGE::enregistrer(ofstream& ofstrm)
2762     {
2763     long type_analyse=get_type();
2764     ofstrm.write((char*)&type_analyse,sizeof(long));
2765     MICROSTRUCTURE::MSTRUCT_ANALYSE::enregistrer(ofstrm);
2766     ofstrm.write((char*)&m_id_fem_maillage,sizeof(long));
2767    
2768     ofstrm.write((char*)&m_nb_element_2D_min,sizeof(long));
2769     ofstrm.write((char*)&m_nb_element_2D_max,sizeof(long));
2770     ofstrm.write((char*)&m_nb_element_2D_moyenne,sizeof(long));
2771     ofstrm.write((char*)&m_nb_element_2D_ecart_type,sizeof(long));
2772     m_nb_element_2D_histogramme.enregistrer_bin(ofstrm);
2773    
2774     ofstrm.write((char*)&m_nb_element_3D_min,sizeof(long));
2775     ofstrm.write((char*)&m_nb_element_3D_max,sizeof(long));
2776     ofstrm.write((char*)&m_nb_element_3D_moyenne,sizeof(long));
2777     ofstrm.write((char*)&m_nb_element_3D_ecart_type,sizeof(long));
2778     m_nb_element_3D_histogramme.enregistrer_bin(ofstrm);
2779    
2780     ofstrm.write((char*)&m_2D_jacobien_min_min,sizeof(double));
2781     ofstrm.write((char*)&m_2D_jacobien_min_max,sizeof(double));
2782     ofstrm.write((char*)&m_2D_jacobien_min_moyenne,sizeof(double));
2783     ofstrm.write((char*)&m_2D_jacobien_min_ecart_type,sizeof(double));
2784     m_2D_jacobien_histogramme_min.enregistrer_bin(ofstrm);
2785    
2786     ofstrm.write((char*)&m_2D_jacobien_max_min,sizeof(double));
2787     ofstrm.write((char*)&m_2D_jacobien_max_max,sizeof(double));
2788     ofstrm.write((char*)&m_2D_jacobien_max_moyenne,sizeof(double));
2789     ofstrm.write((char*)&m_2D_jacobien_max_ecart_type,sizeof(double));
2790     m_2D_jacobien_histogramme_max.enregistrer_bin(ofstrm);
2791    
2792     ofstrm.write((char*)&m_3D_jacobien_min_min,sizeof(double));
2793     ofstrm.write((char*)&m_3D_jacobien_min_max,sizeof(double));
2794     ofstrm.write((char*)&m_3D_jacobien_min_moyenne,sizeof(double));
2795     ofstrm.write((char*)&m_3D_jacobien_min_ecart_type,sizeof(double));
2796     m_3D_jacobien_histogramme_min.enregistrer_bin(ofstrm);
2797    
2798     ofstrm.write((char*)&m_3D_jacobien_max_min,sizeof(double));
2799     ofstrm.write((char*)&m_3D_jacobien_max_max,sizeof(double));
2800     ofstrm.write((char*)&m_3D_jacobien_max_moyenne,sizeof(double));
2801     ofstrm.write((char*)&m_3D_jacobien_max_ecart_type,sizeof(double));
2802     m_3D_jacobien_histogramme_max.enregistrer_bin(ofstrm);
2803    
2804     ofstrm.write((char*)&m_2D_distortion_min,sizeof(double));
2805     ofstrm.write((char*)&m_2D_distortion_max,sizeof(double));
2806     ofstrm.write((char*)&m_2D_distortion_moyenne,sizeof(double));
2807     ofstrm.write((char*)&m_2D_distortion_ecart_type,sizeof(double));
2808     m_2D_distortion_histogramme.enregistrer_bin(ofstrm);
2809    
2810     ofstrm.write((char*)&m_3D_distortion_min,sizeof(double));
2811     ofstrm.write((char*)&m_3D_distortion_max,sizeof(double));
2812     ofstrm.write((char*)&m_3D_distortion_moyenne,sizeof(double));
2813     ofstrm.write((char*)&m_3D_distortion_ecart_type,sizeof(double));
2814     m_3D_distortion_histogramme.enregistrer_bin(ofstrm);
2815    
2816     ofstrm.write((char*)&m_volume_moyenne,sizeof(double));
2817     ofstrm.write((char*)&m_volume_ecart_type,sizeof(double));
2818     ofstrm.write((char*)&m_volume_min,sizeof(double));
2819     ofstrm.write((char*)&m_volume_max,sizeof(double));
2820     m_volume_histogramme.enregistrer_bin(ofstrm);
2821     ofstrm.write((char*)&m_fraction_volumique_moyenne,sizeof(double));
2822     ofstrm.write((char*)&m_fraction_volumique_ecart_type,sizeof(double));
2823     ofstrm.write((char*)&m_fraction_volumique_min,sizeof(double));
2824     ofstrm.write((char*)&m_fraction_volumique_max,sizeof(double));
2825     m_fraction_volumique_histogramme.enregistrer_bin(ofstrm);
2826     }
2827    
2828     void MSTRUCT_ANALYSE_FEM_MAILLAGE::ouvrir(ifstream& ifstrm)
2829     {
2830     MICROSTRUCTURE::MSTRUCT_ANALYSE::ouvrir(ifstrm);
2831     ifstrm.read((char*)&m_id_fem_maillage,sizeof(long));
2832    
2833     ifstrm.read((char*)&m_nb_element_2D_min,sizeof(long));
2834     ifstrm.read((char*)&m_nb_element_2D_max,sizeof(long));
2835     ifstrm.read((char*)&m_nb_element_2D_moyenne,sizeof(long));
2836     ifstrm.read((char*)&m_nb_element_2D_ecart_type,sizeof(long));
2837     m_nb_element_2D_histogramme.ouvrir_bin(ifstrm);
2838    
2839     ifstrm.read((char*)&m_nb_element_3D_min,sizeof(long));
2840     ifstrm.read((char*)&m_nb_element_3D_max,sizeof(long));
2841     ifstrm.read((char*)&m_nb_element_3D_moyenne,sizeof(long));
2842     ifstrm.read((char*)&m_nb_element_3D_ecart_type,sizeof(long));
2843     m_nb_element_3D_histogramme.ouvrir_bin(ifstrm);
2844    
2845     ifstrm.read((char*)&m_2D_jacobien_min_min,sizeof(double));
2846     ifstrm.read((char*)&m_2D_jacobien_min_max,sizeof(double));
2847     ifstrm.read((char*)&m_2D_jacobien_min_moyenne,sizeof(double));
2848     ifstrm.read((char*)&m_2D_jacobien_min_ecart_type,sizeof(double));
2849     m_2D_jacobien_histogramme_min.ouvrir_bin(ifstrm);
2850    
2851     ifstrm.read((char*)&m_2D_jacobien_max_min,sizeof(double));
2852     ifstrm.read((char*)&m_2D_jacobien_max_max,sizeof(double));
2853     ifstrm.read((char*)&m_2D_jacobien_max_moyenne,sizeof(double));
2854     ifstrm.read((char*)&m_2D_jacobien_max_ecart_type,sizeof(double));
2855     m_2D_jacobien_histogramme_max.ouvrir_bin(ifstrm);
2856    
2857     ifstrm.read((char*)&m_3D_jacobien_min_min,sizeof(double));
2858     ifstrm.read((char*)&m_3D_jacobien_min_max,sizeof(double));
2859     ifstrm.read((char*)&m_3D_jacobien_min_moyenne,sizeof(double));
2860     ifstrm.read((char*)&m_3D_jacobien_min_ecart_type,sizeof(double));
2861     m_3D_jacobien_histogramme_min.ouvrir_bin(ifstrm);
2862    
2863     ifstrm.read((char*)&m_3D_jacobien_max_min,sizeof(double));
2864     ifstrm.read((char*)&m_3D_jacobien_max_max,sizeof(double));
2865     ifstrm.read((char*)&m_3D_jacobien_max_moyenne,sizeof(double));
2866     ifstrm.read((char*)&m_3D_jacobien_max_ecart_type,sizeof(double));
2867     m_3D_jacobien_histogramme_max.ouvrir_bin(ifstrm);
2868    
2869     ifstrm.read((char*)&m_2D_distortion_min,sizeof(double));
2870     ifstrm.read((char*)&m_2D_distortion_max,sizeof(double));
2871     ifstrm.read((char*)&m_2D_distortion_moyenne,sizeof(double));
2872     ifstrm.read((char*)&m_2D_distortion_ecart_type,sizeof(double));
2873     m_2D_distortion_histogramme.ouvrir_bin(ifstrm);
2874    
2875     ifstrm.read((char*)&m_3D_distortion_min,sizeof(double));
2876     ifstrm.read((char*)&m_3D_distortion_max,sizeof(double));
2877     ifstrm.read((char*)&m_3D_distortion_moyenne,sizeof(double));
2878     ifstrm.read((char*)&m_3D_distortion_ecart_type,sizeof(double));
2879     m_3D_distortion_histogramme.ouvrir_bin(ifstrm);
2880    
2881     ifstrm.read((char*)&m_volume_moyenne,sizeof(double));
2882     ifstrm.read((char*)&m_volume_ecart_type,sizeof(double));
2883     ifstrm.read((char*)&m_volume_min,sizeof(double));
2884     ifstrm.read((char*)&m_volume_max,sizeof(double));
2885     m_volume_histogramme.ouvrir_bin(ifstrm);
2886     ifstrm.read((char*)&m_fraction_volumique_moyenne,sizeof(double));
2887     ifstrm.read((char*)&m_fraction_volumique_ecart_type,sizeof(double));
2888     ifstrm.read((char*)&m_fraction_volumique_min,sizeof(double));
2889     ifstrm.read((char*)&m_fraction_volumique_max,sizeof(double));
2890     m_fraction_volumique_histogramme.ouvrir_bin(ifstrm);
2891     }
2892    
2893     void MSTRUCT_ANALYSE_FEM_MAILLAGE::affiche_contenu(MICROSTRUCTURE::fonction_affiche* fonc)
2894     {
2895     MICROSTRUCTURE::MSTRUCT_ANALYSE::affiche_contenu(fonc);
2896     char ligne[5000];
2897     sprintf(ligne,"MSTRUCT_ANALYSE_CAO");fonc(ligne);
2898     sprintf(ligne,"-> ID MG_MAILLAGE : %li",m_id_fem_maillage);fonc(ligne);
2899    
2900     sprintf(ligne,"-> Moyenne nb element 2D : %li",m_nb_element_2D_moyenne);fonc(ligne);
2901     sprintf(ligne,"-> Ecart-type nb element 2D : %li",m_nb_element_2D_ecart_type);fonc(ligne);
2902     sprintf(ligne,"-> Min nb element 2D : %li",m_nb_element_2D_min);fonc(ligne);
2903     sprintf(ligne,"-> Max nb element 2D : %li",m_nb_element_2D_max);fonc(ligne);
2904     sprintf(ligne,"-> OT_HISTOGRAMME nb element 2D : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_nb_element_2D_histogramme.get_nb_colonne(),
2905     m_nb_element_2D_histogramme.get_largeur_colonne(),
2906     m_nb_element_2D_histogramme.get_x_min(),
2907     m_nb_element_2D_histogramme.get_x_max());
2908     fonc(ligne);
2909     sprintf(ligne,"-> Moyenne nb element 3D : %li",m_nb_element_3D_moyenne);fonc(ligne);
2910     sprintf(ligne,"-> Ecart-type nb element 3D : %li",m_nb_element_3D_ecart_type);fonc(ligne);
2911     sprintf(ligne,"-> Min nb element 3D : %li",m_nb_element_3D_min);fonc(ligne);
2912     sprintf(ligne,"-> Max nb element 3D : %li",m_nb_element_3D_max);fonc(ligne);
2913     sprintf(ligne,"-> OT_HISTOGRAMME nb element 3D : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_nb_element_3D_histogramme.get_nb_colonne(),
2914     m_nb_element_3D_histogramme.get_largeur_colonne(),
2915     m_nb_element_3D_histogramme.get_x_min(),
2916     m_nb_element_3D_histogramme.get_x_max());
2917     fonc(ligne);
2918    
2919     sprintf(ligne,"-> 2D Jacobien Min moyenne : %lf",m_2D_jacobien_min_moyenne);fonc(ligne);
2920     sprintf(ligne,"-> 2D Jacobien Min ecart-type : %lf",m_2D_jacobien_min_ecart_type);fonc(ligne);
2921     sprintf(ligne,"-> 2D Jacobien Min min : %lf",m_2D_jacobien_min_min);fonc(ligne);
2922     sprintf(ligne,"-> 2D Jacobien Min max : %lf",m_2D_jacobien_min_max);fonc(ligne);
2923     sprintf(ligne,"-> OT_HISTOGRAMME 2D Jacobien Min : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_2D_jacobien_histogramme_min.get_nb_colonne(),
2924     m_2D_jacobien_histogramme_min.get_largeur_colonne(),
2925     m_2D_jacobien_histogramme_min.get_x_min(),
2926     m_2D_jacobien_histogramme_min.get_x_max());
2927     fonc(ligne);
2928    
2929     sprintf(ligne,"-> 2D Jacobien Max moyenne : %lf",m_2D_jacobien_max_moyenne);fonc(ligne);
2930     sprintf(ligne,"-> 2D Jacobien Max ecart-type : %lf",m_2D_jacobien_max_ecart_type);fonc(ligne);
2931     sprintf(ligne,"-> 2D Jacobien Max min : %lf",m_2D_jacobien_max_min);fonc(ligne);
2932     sprintf(ligne,"-> 2D Jacobien Max max : %lf",m_2D_jacobien_max_max);fonc(ligne);
2933     sprintf(ligne,"-> OT_HISTOGRAMME 2D Jacobien Min : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_2D_jacobien_histogramme_max.get_nb_colonne(),
2934     m_2D_jacobien_histogramme_max.get_largeur_colonne(),
2935     m_2D_jacobien_histogramme_max.get_x_min(),
2936     m_2D_jacobien_histogramme_max.get_x_max());
2937     fonc(ligne);
2938    
2939     sprintf(ligne,"-> 3D Jacobien Min moyenne : %lf",m_3D_jacobien_min_moyenne);fonc(ligne);
2940     sprintf(ligne,"-> 3D Jacobien Min ecart-type : %lf",m_3D_jacobien_min_ecart_type);fonc(ligne);
2941     sprintf(ligne,"-> 3D Jacobien Min min : %lf",m_3D_jacobien_min_min);fonc(ligne);
2942     sprintf(ligne,"-> 3D Jacobien Min max : %lf",m_3D_jacobien_min_max);fonc(ligne);
2943     sprintf(ligne,"-> OT_HISTOGRAMME 3D Jacobien Min : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_3D_jacobien_histogramme_min.get_nb_colonne(),
2944     m_3D_jacobien_histogramme_min.get_largeur_colonne(),
2945     m_3D_jacobien_histogramme_min.get_x_min(),
2946     m_3D_jacobien_histogramme_min.get_x_max());
2947     fonc(ligne);
2948    
2949     sprintf(ligne,"-> 3D Jacobien Max moyenne : %lf",m_3D_jacobien_max_moyenne);fonc(ligne);
2950     sprintf(ligne,"-> 3D Jacobien Max ecart-type : %lf",m_3D_jacobien_max_ecart_type);fonc(ligne);
2951     sprintf(ligne,"-> 3D Jacobien Max min : %lf",m_3D_jacobien_max_min);fonc(ligne);
2952     sprintf(ligne,"-> 3D Jacobien Max max : %lf",m_3D_jacobien_max_max);fonc(ligne);
2953     sprintf(ligne,"-> OT_HISTOGRAMME 3D Jacobien Min : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_3D_jacobien_histogramme_max.get_nb_colonne(),
2954     m_3D_jacobien_histogramme_max.get_largeur_colonne(),
2955     m_3D_jacobien_histogramme_max.get_x_min(),
2956     m_3D_jacobien_histogramme_max.get_x_max());
2957     fonc(ligne);
2958    
2959     sprintf(ligne,"-> 2D Distortion moyenne : %lf",m_2D_distortion_moyenne);fonc(ligne);
2960     sprintf(ligne,"-> 2D Distortion ecart-type : %lf",m_2D_distortion_ecart_type);fonc(ligne);
2961     sprintf(ligne,"-> 2D Distortion min : %lf",m_2D_distortion_min);fonc(ligne);
2962     sprintf(ligne,"-> 2D Distortion max : %lf",m_2D_distortion_max);fonc(ligne);
2963     sprintf(ligne,"-> OT_HISTOGRAMME 2D Jacobien Min : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_2D_distortion_histogramme.get_nb_colonne(),
2964     m_2D_distortion_histogramme.get_largeur_colonne(),
2965     m_2D_distortion_histogramme.get_x_min(),
2966     m_2D_distortion_histogramme.get_x_max());
2967     fonc(ligne);
2968    
2969     sprintf(ligne,"-> 3D Distortion moyenne : %lf",m_3D_distortion_moyenne);fonc(ligne);
2970     sprintf(ligne,"-> 3D Distortion ecart-type : %lf",m_3D_distortion_ecart_type);fonc(ligne);
2971     sprintf(ligne,"-> 3D Distortion min : %lf",m_3D_distortion_min);fonc(ligne);
2972     sprintf(ligne,"-> 3D Distortion max : %lf",m_3D_distortion_max);fonc(ligne);
2973     sprintf(ligne,"-> OT_HISTOGRAMME 3D Jacobien Min : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_3D_distortion_histogramme.get_nb_colonne(),
2974     m_3D_distortion_histogramme.get_largeur_colonne(),
2975     m_3D_distortion_histogramme.get_x_min(),
2976     m_3D_distortion_histogramme.get_x_max());
2977     fonc(ligne);
2978     sprintf(ligne,"-> Moyenne volume : %lf",m_volume_moyenne); fonc(ligne);
2979     sprintf(ligne,"-> Ecart-type volume : %lf",m_volume_ecart_type); fonc(ligne);
2980     sprintf(ligne,"-> Min volume : %lf",m_volume_min); fonc(ligne);
2981     sprintf(ligne,"-> Max volume : %lf",m_volume_max); fonc(ligne);
2982     sprintf(ligne,"-> OT_HISTOGRAMME volume : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_volume_histogramme.get_nb_colonne(),
2983     m_volume_histogramme.get_largeur_colonne(),
2984     m_volume_histogramme.get_x_min(),
2985     m_volume_histogramme.get_x_max());
2986     fonc(ligne);
2987     sprintf(ligne,"-> Moyenne fraction volumique : %lf",m_fraction_volumique_moyenne); fonc(ligne);
2988     sprintf(ligne,"-> Ecart-type fraction volumique : %lf",m_fraction_volumique_ecart_type); fonc(ligne);
2989     sprintf(ligne,"-> Min fraction volumique : %lf",m_fraction_volumique_min); fonc(ligne);
2990     sprintf(ligne,"-> Max fraction volumique : %lf",m_fraction_volumique_max); fonc(ligne);
2991     sprintf(ligne,"-> OT_HISTOGRAMME fraction volumique : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_fraction_volumique_histogramme.get_nb_colonne(),
2992     m_fraction_volumique_histogramme.get_largeur_colonne(),
2993     m_fraction_volumique_histogramme.get_x_min(),
2994     m_fraction_volumique_histogramme.get_x_max());
2995     fonc(ligne);
2996     }
2997    
2998    
2999 couturad 930
3000    
3001     MSTRUCT_ANALYSE_EROSION::MSTRUCT_ANALYSE_EROSION(void): MSTRUCT_ANALYSE()
3002 couturad 926 {
3003 couturad 930 m_nb_couche=0;
3004     m_epaisseur_couche=0;
3005 couturad 926 }
3006    
3007 couturad 930 MSTRUCT_ANALYSE_EROSION::MSTRUCT_ANALYSE_EROSION(string identifiant,
3008     MICROSTRUCTURE::MSTRUCT_ANALYSE* analyse_initiale,
3009     long nb_couche,
3010     double epaisseur_couche): MSTRUCT_ANALYSE(identifiant,
3011     analyse_initiale->get_nom_groupe_forme(),
3012     analyse_initiale->get_boite_analyse()),
3013     m_nb_couche(nb_couche),
3014     m_epaisseur_couche(epaisseur_couche)
3015 couturad 926 {
3016 couturad 930 std::string iden_ini=identifiant+"_0";
3017     analyse_initiale->change_identifiant(iden_ini);
3018     ajouter_analyse(analyse_initiale);
3019     int type_analyse = analyse_initiale->get_type();
3020     for(long i=1;i<m_nb_couche;i++)
3021     {
3022     MSTRUCT_ANALYSE* nouvelle_analyse;
3023     if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CHAMP)
3024     {
3025     MSTRUCT_ANALYSE_CHAMP* analyse_ini_champ = (MSTRUCT_ANALYSE_CHAMP*)analyse_initiale;
3026     MSTRUCT_ANALYSE_CHAMP* analyse_champ = new MSTRUCT_ANALYSE_CHAMP(*analyse_ini_champ);
3027     nouvelle_analyse=analyse_champ;
3028     }
3029     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::ORIENTATION)
3030     {
3031     MSTRUCT_ANALYSE_ORIENTATION* analyse_ini_ori = (MSTRUCT_ANALYSE_ORIENTATION*)analyse_initiale;
3032     MSTRUCT_ANALYSE_ORIENTATION* analyse_ori = new MSTRUCT_ANALYSE_ORIENTATION(*analyse_ini_ori);
3033     nouvelle_analyse=analyse_ori;
3034     }
3035     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CAO)
3036     {
3037     MSTRUCT_ANALYSE_CAO* analyse_ini_cao = (MSTRUCT_ANALYSE_CAO*)analyse_initiale;
3038     MSTRUCT_ANALYSE_CAO* analyse_cao = new MSTRUCT_ANALYSE_CAO(*analyse_ini_cao);
3039     nouvelle_analyse=analyse_cao;
3040     }
3041     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_MG)
3042     {
3043     MSTRUCT_ANALYSE_MG_MAILLAGE* analyse_ini_mg_maill = (MSTRUCT_ANALYSE_MG_MAILLAGE*)analyse_initiale;
3044     MSTRUCT_ANALYSE_MG_MAILLAGE* analyse_mg_maill = new MSTRUCT_ANALYSE_MG_MAILLAGE(*analyse_ini_mg_maill);
3045     nouvelle_analyse=analyse_mg_maill;
3046     }
3047     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_FEM)
3048     {
3049     MSTRUCT_ANALYSE_FEM_MAILLAGE* analyse_ini_fem_maill = (MSTRUCT_ANALYSE_FEM_MAILLAGE*)analyse_initiale;
3050     MSTRUCT_ANALYSE_FEM_MAILLAGE* analyse_fem_maill = new MSTRUCT_ANALYSE_FEM_MAILLAGE(*analyse_ini_fem_maill);
3051     nouvelle_analyse=analyse_fem_maill;
3052     }
3053     char iden[500];
3054     sprintf(iden,"%s_%li",identifiant.c_str(),i);
3055     nouvelle_analyse->change_identifiant(iden);
3056     if(nouvelle_analyse->get_boite_analyse()==NULL)
3057     {
3058     nouvelle_analyse->change_boite_analyse(BOITE_3D(0.0,0.0,0.0,1.0,1.0,1.0));
3059     }
3060     double xmin,ymin,zmin,xmax,ymax,zmax;
3061     xmin=nouvelle_analyse->get_boite_analyse()->get_xmin();
3062     ymin=nouvelle_analyse->get_boite_analyse()->get_ymin();
3063     zmin=nouvelle_analyse->get_boite_analyse()->get_zmin();
3064     xmax=nouvelle_analyse->get_boite_analyse()->get_xmax();
3065     ymax=nouvelle_analyse->get_boite_analyse()->get_ymax();
3066     zmax=nouvelle_analyse->get_boite_analyse()->get_zmax();
3067     xmin=xmin+i*m_epaisseur_couche;
3068     ymin=ymin+i*m_epaisseur_couche;
3069     zmin=zmin+i*m_epaisseur_couche;
3070     xmax=xmax-i*m_epaisseur_couche;
3071     ymax=ymax-i*m_epaisseur_couche;
3072     zmax=zmax-i*m_epaisseur_couche;
3073     nouvelle_analyse->get_boite_analyse()->reinit(xmin,ymin,zmin,xmax,ymax,zmax);
3074     ajouter_analyse(nouvelle_analyse);
3075     }
3076 couturad 926 }
3077    
3078 couturad 930
3079     MSTRUCT_ANALYSE_EROSION::MSTRUCT_ANALYSE_EROSION(std::vector< MSTRUCT_ANALYSE_EROSION* >& vector_analyse): MSTRUCT_ANALYSE()
3080 couturad 926 {
3081 couturad 930 std::vector<MSTRUCT_ANALYSE_EROSION*>::iterator it_analyse_erosion=vector_analyse.begin();
3082     MSTRUCT_ANALYSE_EROSION* analyse_erosion = *it_analyse_erosion;
3083     m_identifiant=analyse_erosion->get_identifiant();
3084     if(analyse_erosion->get_boite_analyse()!=NULL) change_boite_analyse(*analyse_erosion->get_boite_analyse());
3085     m_nom_groupe_forme=analyse_erosion->get_nom_groupe_forme();
3086 couturad 926 m_nb_ves=vector_analyse.size();
3087 couturad 930 m_nb_couche=analyse_erosion->get_nb_couche();
3088     m_epaisseur_couche=analyse_erosion->get_epaisseur_couche();
3089     int type_analyse = analyse_erosion->get_type();
3090     long nb_analyse=analyse_erosion->get_nb_analyse();
3091     if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CHAMP)
3092 couturad 926 {
3093 couturad 930 long i=0;
3094     while(i<nb_analyse)
3095     {
3096     std::vector<MSTRUCT_ANALYSE_CHAMP*> vector_analyse_compile;
3097     for(it_analyse_erosion=vector_analyse.begin();it_analyse_erosion!=vector_analyse.end();it_analyse_erosion++)
3098     {
3099     MSTRUCT_ANALYSE_EROSION* analyse_erosion = *it_analyse_erosion;
3100     vector_analyse_compile.push_back((MSTRUCT_ANALYSE_CHAMP*)analyse_erosion->get_analyse(i));
3101     }
3102     MSTRUCT_ANALYSE_CHAMP* nouvelle_analyse = new MSTRUCT_ANALYSE_CHAMP(vector_analyse_compile);
3103     ajouter_analyse(nouvelle_analyse);
3104     i++;
3105     }
3106 couturad 926 }
3107 couturad 930 else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::ORIENTATION)
3108 couturad 926 {
3109 couturad 930 long i=0;
3110     while(i<nb_analyse)
3111     {
3112     std::vector<MSTRUCT_ANALYSE_ORIENTATION*> vector_analyse_compile;
3113     for(it_analyse_erosion=vector_analyse.begin();it_analyse_erosion!=vector_analyse.end();it_analyse_erosion++)
3114     {
3115     MSTRUCT_ANALYSE_EROSION* analyse_erosion = *it_analyse_erosion;
3116     vector_analyse_compile.push_back((MSTRUCT_ANALYSE_ORIENTATION*)analyse_erosion->get_analyse(i));
3117     }
3118     MSTRUCT_ANALYSE_ORIENTATION* nouvelle_analyse = new MSTRUCT_ANALYSE_ORIENTATION(vector_analyse_compile);
3119     ajouter_analyse(nouvelle_analyse);
3120     i++;
3121     }
3122 couturad 926 }
3123 couturad 930 else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CAO)
3124     {
3125     long i=0;
3126     while(i<nb_analyse)
3127     {
3128     std::vector<MSTRUCT_ANALYSE_CAO*> vector_analyse_compile;
3129     for(it_analyse_erosion=vector_analyse.begin();it_analyse_erosion!=vector_analyse.end();it_analyse_erosion++)
3130     {
3131     MSTRUCT_ANALYSE_EROSION* analyse_erosion = *it_analyse_erosion;
3132     vector_analyse_compile.push_back((MSTRUCT_ANALYSE_CAO*)analyse_erosion->get_analyse(i));
3133     }
3134     MSTRUCT_ANALYSE_CAO* nouvelle_analyse = new MSTRUCT_ANALYSE_CAO(vector_analyse_compile);
3135     ajouter_analyse(nouvelle_analyse);
3136     i++;
3137     }
3138     }
3139     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_MG)
3140     {
3141     long i=0;
3142     while(i<nb_analyse)
3143     {
3144     std::vector<MSTRUCT_ANALYSE_MG_MAILLAGE*> vector_analyse_compile;
3145     for(it_analyse_erosion=vector_analyse.begin();it_analyse_erosion!=vector_analyse.end();it_analyse_erosion++)
3146     {
3147     MSTRUCT_ANALYSE_EROSION* analyse_erosion = *it_analyse_erosion;
3148     vector_analyse_compile.push_back((MSTRUCT_ANALYSE_MG_MAILLAGE*)analyse_erosion->get_analyse(i));
3149     }
3150     MSTRUCT_ANALYSE_MG_MAILLAGE* nouvelle_analyse = new MSTRUCT_ANALYSE_MG_MAILLAGE(vector_analyse_compile);
3151     ajouter_analyse(nouvelle_analyse);
3152     i++;
3153     }
3154     }
3155     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_FEM)
3156     {
3157     long i=0;
3158     while(i<nb_analyse)
3159     {
3160     std::vector<MSTRUCT_ANALYSE_FEM_MAILLAGE*> vector_analyse_compile;
3161     for(it_analyse_erosion=vector_analyse.begin();it_analyse_erosion!=vector_analyse.end();it_analyse_erosion++)
3162     {
3163     MSTRUCT_ANALYSE_EROSION* analyse_erosion = *it_analyse_erosion;
3164     vector_analyse_compile.push_back((MSTRUCT_ANALYSE_FEM_MAILLAGE*)analyse_erosion->get_analyse(i));
3165     }
3166     MSTRUCT_ANALYSE_FEM_MAILLAGE* nouvelle_analyse = new MSTRUCT_ANALYSE_FEM_MAILLAGE(vector_analyse_compile);
3167     ajouter_analyse(nouvelle_analyse);
3168     i++;
3169     }
3170     }
3171 couturad 926 }
3172    
3173 couturad 930 MSTRUCT_ANALYSE_EROSION::MSTRUCT_ANALYSE_EROSION(MSTRUCT_ANALYSE_EROSION& mdd): MSTRUCT_ANALYSE(mdd)
3174 couturad 926 {
3175 couturad 930 m_nb_couche=mdd.m_nb_couche;
3176     m_epaisseur_couche=mdd.m_epaisseur_couche;
3177     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse;
3178     for(MSTRUCT_ANALYSE* analyse=mdd.get_premiere_analyse(it_analyse);analyse!=NULL;analyse=mdd.get_suivante_analyse(it_analyse))
3179     {
3180     int type_analyse=analyse->get_type();
3181     if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CHAMP) ajouter_analyse(new MSTRUCT_ANALYSE_CHAMP(*(MSTRUCT_ANALYSE_CHAMP*)analyse));
3182     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::ORIENTATION) ajouter_analyse(new MSTRUCT_ANALYSE_ORIENTATION(*(MSTRUCT_ANALYSE_ORIENTATION*)analyse));
3183     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CAO) ajouter_analyse(new MSTRUCT_ANALYSE_CAO(*(MSTRUCT_ANALYSE_CAO*)analyse));
3184     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_MG) ajouter_analyse(new MSTRUCT_ANALYSE_MG_MAILLAGE(*(MSTRUCT_ANALYSE_MG_MAILLAGE*)analyse));
3185     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_FEM) ajouter_analyse(new MSTRUCT_ANALYSE_FEM_MAILLAGE(*(MSTRUCT_ANALYSE_FEM_MAILLAGE*)analyse));
3186     }
3187 couturad 926 }
3188    
3189 couturad 930 MSTRUCT_ANALYSE_EROSION::~MSTRUCT_ANALYSE_EROSION(void)
3190 couturad 926 {
3191 couturad 930 std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse;
3192     for(MSTRUCT_ANALYSE* analyse=get_premiere_analyse(it_analyse);analyse!=NULL;analyse=get_suivante_analyse(it_analyse)) delete analyse;
3193 couturad 926 }
3194    
3195 couturad 930 long int MSTRUCT_ANALYSE_EROSION::get_nb_couche(void)
3196 couturad 926 {
3197 couturad 930 return m_nb_couche;
3198 couturad 926 }
3199    
3200 couturad 930 double MSTRUCT_ANALYSE_EROSION::get_epaisseur_couche(void)
3201 couturad 926 {
3202 couturad 930 return m_epaisseur_couche;
3203 couturad 926 }
3204    
3205 couturad 930 long int MSTRUCT_ANALYSE_EROSION::get_nb_analyse(void)
3206 couturad 926 {
3207 couturad 930 return m_vector_analyse.size();
3208 couturad 926 }
3209    
3210 couturad 930 int MSTRUCT_ANALYSE_EROSION::ajouter_analyse(MSTRUCT_ANALYSE* analyse)
3211 couturad 926 {
3212 couturad 930 m_vector_analyse.push_back(analyse);
3213 couturad 926 }
3214    
3215 couturad 930 MSTRUCT_ANALYSE* MSTRUCT_ANALYSE_EROSION::get_premiere_analyse(std::vector<MSTRUCT_ANALYSE*>::iterator& it)
3216 couturad 926 {
3217 couturad 930 it=m_vector_analyse.begin();
3218     if(it!=m_vector_analyse.end()) return *it;
3219     else return NULL;
3220 couturad 926 }
3221    
3222 couturad 930 MSTRUCT_ANALYSE* MSTRUCT_ANALYSE_EROSION::get_suivante_analyse(std::vector<MSTRUCT_ANALYSE*>::iterator& it)
3223 couturad 926 {
3224 couturad 930 it++;
3225     if(it!=m_vector_analyse.end()) return *it;
3226     else return NULL;
3227 couturad 926 }
3228    
3229 couturad 930 MSTRUCT_ANALYSE* MSTRUCT_ANALYSE_EROSION::get_analyse(long num)
3230 couturad 926 {
3231 couturad 930 return m_vector_analyse.at(num);
3232 couturad 926 }
3233    
3234 couturad 930 long int MSTRUCT_ANALYSE_EROSION::get_type(void)
3235 couturad 926 {
3236 couturad 930 return TYPE_ANALYSE::EROSION;
3237 couturad 926 }
3238    
3239 couturad 930 void MSTRUCT_ANALYSE_EROSION::executer(MSTRUCT_VES* ves)
3240 couturad 926 {
3241 couturad 930 std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse;
3242     for(MSTRUCT_ANALYSE* analyse=get_premiere_analyse(it_analyse);analyse!=NULL;analyse=get_suivante_analyse(it_analyse)) analyse->executer(ves);
3243 couturad 926 }
3244    
3245 couturad 930 void MSTRUCT_ANALYSE_EROSION::exporter(ofstream& ofstrm, long int i, bool avec_histo, char* prefix_histo)
3246 couturad 926 {
3247 couturad 930 std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse;
3248     for(MSTRUCT_ANALYSE* analyse=get_premiere_analyse(it_analyse);analyse!=NULL;analyse=get_suivante_analyse(it_analyse))
3249     {
3250     ofstrm << analyse->get_identifiant() << std::endl;
3251     analyse->exporter(ofstrm,i,avec_histo,prefix_histo);
3252     }
3253 couturad 926 }
3254    
3255 couturad 930 void MSTRUCT_ANALYSE_EROSION::enregistrer(ofstream& ofstrm)
3256 couturad 926 {
3257 couturad 930 long type_analyse=get_type();
3258     ofstrm.write((char*)&type_analyse,sizeof(long));
3259     MICROSTRUCTURE::MSTRUCT_ANALYSE::enregistrer(ofstrm);
3260     ofstrm.write((char*)&m_nb_couche,sizeof(long));
3261     ofstrm.write((char*)&m_epaisseur_couche,sizeof(double));
3262     long nb_analyse=get_nb_analyse();
3263     ofstrm.write((char*)&nb_analyse,sizeof(long));
3264     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse;
3265     for(MSTRUCT_ANALYSE* analyse=get_premiere_analyse(it_analyse);analyse!=NULL;analyse=get_suivante_analyse(it_analyse)) analyse->enregistrer(ofstrm);
3266 couturad 926 }
3267    
3268 couturad 930 void MSTRUCT_ANALYSE_EROSION::ouvrir(ifstream& ifstrm)
3269 couturad 926 {
3270 couturad 930 MICROSTRUCTURE::MSTRUCT_ANALYSE::ouvrir(ifstrm);
3271     ifstrm.read((char*)&m_nb_couche,sizeof(long));
3272     ifstrm.read((char*)&m_epaisseur_couche,sizeof(double));
3273     long nb_analyse;
3274     ifstrm.read((char*)&nb_analyse,sizeof(long));
3275     for(long i=0;i<nb_analyse;i++)
3276     {
3277     long type_analyse;
3278     ifstrm.read((char*)&type_analyse,sizeof(long));
3279     MSTRUCT_ANALYSE *analyse;
3280     if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CHAMP)
3281     {
3282     analyse = new MSTRUCT_ANALYSE_CHAMP;
3283     analyse->ouvrir(ifstrm);
3284     }
3285     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::ORIENTATION)
3286     {
3287     analyse = new MSTRUCT_ANALYSE_ORIENTATION;
3288     analyse->ouvrir(ifstrm);
3289     }
3290     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CAO)
3291     {
3292     analyse = new MSTRUCT_ANALYSE_CAO;
3293     analyse->ouvrir(ifstrm);
3294     }
3295     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_MG)
3296     {
3297     analyse = new MSTRUCT_ANALYSE_MG_MAILLAGE;
3298     analyse->ouvrir(ifstrm);
3299     }
3300     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_FEM)
3301     {
3302     analyse = new MSTRUCT_ANALYSE_FEM_MAILLAGE;
3303     analyse->ouvrir(ifstrm);
3304     }
3305     ajouter_analyse(analyse);
3306     }
3307 couturad 926 }
3308    
3309 couturad 930 void MSTRUCT_ANALYSE_EROSION::affiche_contenu(MICROSTRUCTURE::fonction_affiche* fonc)
3310 couturad 926 {
3311 couturad 930 MICROSTRUCTURE::MSTRUCT_ANALYSE::affiche_contenu(fonc);
3312     char ligne[5000];
3313     sprintf(ligne,"MSTRUCT_ANALYSE_EROSION");fonc(ligne);
3314     sprintf(ligne,"-> Nb analyse : %li",get_nb_analyse());fonc(ligne);
3315     sprintf(ligne,"-> Nb couche : %li",m_nb_couche);fonc(ligne);
3316     sprintf(ligne,"-> Epaisseur couche : %lf",m_epaisseur_couche);fonc(ligne);
3317     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse;
3318     for(MSTRUCT_ANALYSE* analyse=get_premiere_analyse(it_analyse);analyse!=NULL;analyse=get_suivante_analyse(it_analyse))
3319     {
3320     analyse->affiche_contenu(fonc);
3321     }
3322 couturad 926 }
3323    
3324    
3325 couturad 930 MSTRUCT_ANALYSE_MODULES_MECA::MSTRUCT_ANALYSE_MODULES_MECA(MSTRUCT_ANALYSE_CHAMP* epsilon_sph,
3326     MSTRUCT_ANALYSE_CHAMP* sigma_sph,
3327     MSTRUCT_ANALYSE_CHAMP* epsilon_dev,
3328     MSTRUCT_ANALYSE_CHAMP* sigma_dev,
3329     double largeur_colonne_distribution_module_Kapp,
3330     double largeur_colonne_distribution_module_Gapp,
3331     double largeur_colonne_distribution_module_Eapp,
3332     double largeur_colonne_distribution_module_Nuapp)
3333     {
3334     m_Kapp_moyenne=0;
3335     m_Kapp_ecart_type=0;
3336     m_Kapp_min=0.0;
3337     m_Kapp_max=0.0;
3338     m_Kapp_histogramme.fixe_largeur_colonne(largeur_colonne_distribution_module_Kapp);
3339     m_Gapp_moyenne=0;
3340     m_Gapp_ecart_type=0;
3341     m_Gapp_min=0.0;
3342     m_Gapp_max=0.0;
3343     m_Gapp_histogramme.fixe_largeur_colonne(largeur_colonne_distribution_module_Gapp);
3344     m_Eapp_moyenne=0;
3345     m_Eapp_ecart_type=0;
3346     m_Eapp_min=0.0;
3347     m_Eapp_max=0.0;
3348     m_Eapp_histogramme.fixe_largeur_colonne(largeur_colonne_distribution_module_Eapp);
3349     m_Nuapp_moyenne=0;
3350     m_Nuapp_ecart_type=0;
3351     m_Nuapp_min=0.0;
3352     m_Nuapp_max=0.0;
3353     m_Nuapp_histogramme.fixe_largeur_colonne(largeur_colonne_distribution_module_Nuapp);
3354     m_Kapp_moyenne = (sigma_sph->get_moyenne()[0]+sigma_sph->get_moyenne()[1]+sigma_sph->get_moyenne()[2])/(3.0*(epsilon_sph->get_moyenne()[0]+epsilon_sph->get_moyenne()[1]+epsilon_sph->get_moyenne()[2]));
3355     m_Gapp_moyenne = (1./3.)*((sigma_dev->get_moyenne()[3]/(2*epsilon_dev->get_moyenne()[3]))+
3356     (sigma_dev->get_moyenne()[4]/(2*epsilon_dev->get_moyenne()[4]))+
3357     (sigma_dev->get_moyenne()[5]/(2*epsilon_dev->get_moyenne()[5])));
3358     m_Eapp_moyenne = (9.0*m_Kapp_moyenne*m_Gapp_moyenne)/(3.0*m_Kapp_moyenne+m_Gapp_moyenne);
3359     m_Nuapp_moyenne = (3.0*m_Kapp_moyenne-2.0*m_Gapp_moyenne)/(2.0*(3.0*m_Kapp_moyenne+m_Gapp_moyenne));
3360    
3361     m_Kapp_ecart_type=m_Kapp_moyenne;
3362     m_Kapp_min=m_Kapp_moyenne;
3363     m_Kapp_max=m_Kapp_moyenne;
3364    
3365     m_Gapp_ecart_type=m_Gapp_moyenne;
3366     m_Gapp_min=m_Gapp_moyenne;
3367     m_Gapp_max=m_Gapp_moyenne;
3368    
3369     m_Eapp_ecart_type=m_Eapp_moyenne;
3370     m_Eapp_min=m_Eapp_moyenne;
3371     m_Eapp_max=m_Eapp_moyenne;
3372    
3373     m_Nuapp_ecart_type=m_Nuapp_moyenne;
3374     m_Nuapp_min=m_Nuapp_moyenne;
3375     m_Nuapp_max=m_Nuapp_moyenne;
3376     }
3377 couturad 926
3378 couturad 930 MSTRUCT_ANALYSE_MODULES_MECA::MSTRUCT_ANALYSE_MODULES_MECA(std::vector< MSTRUCT_ANALYSE_MODULES_MECA* >& vector_analyse)
3379     {
3380     std::vector<MSTRUCT_ANALYSE_MODULES_MECA*>::iterator it_analyse=vector_analyse.begin();
3381     MSTRUCT_ANALYSE_MODULES_MECA* analyse=*it_analyse;
3382     m_Kapp_histogramme.fixe_largeur_colonne(analyse->get_Kapp_histogramme()->get_largeur_colonne());
3383     m_Gapp_histogramme.fixe_largeur_colonne(analyse->get_Gapp_histogramme()->get_largeur_colonne());
3384     m_Eapp_histogramme.fixe_largeur_colonne(analyse->get_Eapp_histogramme()->get_largeur_colonne());
3385     m_Nuapp_histogramme.fixe_largeur_colonne(analyse->get_Nuapp_histogramme()->get_largeur_colonne());
3386     m_Kapp_moyenne=0;
3387     m_Kapp_ecart_type=0;
3388     m_Kapp_min=numeric_limits<double>::max();
3389     m_Kapp_max=numeric_limits<double>::min();
3390     m_Gapp_moyenne=0;
3391     m_Gapp_ecart_type=0;
3392     m_Gapp_min=numeric_limits<double>::max();
3393     m_Gapp_max=numeric_limits<double>::min();
3394     m_Eapp_moyenne=0;
3395     m_Eapp_ecart_type=0;
3396     m_Eapp_min=numeric_limits<double>::max();
3397     m_Eapp_max=numeric_limits<double>::min();
3398     m_Nuapp_moyenne=0;
3399     m_Nuapp_ecart_type=0;
3400     m_Nuapp_min=numeric_limits<double>::max();
3401     m_Nuapp_max=numeric_limits<double>::min();
3402     m_nb_ves=vector_analyse.size();
3403     for(it_analyse=vector_analyse.begin();it_analyse!=vector_analyse.end();it_analyse++)
3404     {
3405     analyse=*it_analyse;
3406     m_Kapp_moyenne+=analyse->get_Kapp_moyenne();
3407     if(analyse->get_Kapp_moyenne()<m_Kapp_min) m_Kapp_min=analyse->get_Kapp_moyenne();
3408     if(analyse->get_Kapp_moyenne()>m_Kapp_max) m_Kapp_max=analyse->get_Kapp_moyenne();
3409     m_Kapp_histogramme.ajouter_valeur(analyse->get_Kapp_moyenne(),1.0/m_nb_ves);
3410    
3411     m_Gapp_moyenne+=analyse->get_Gapp_moyenne();
3412     if(analyse->get_Gapp_moyenne()<m_Gapp_min) m_Gapp_min=analyse->get_Gapp_moyenne();
3413     if(analyse->get_Gapp_moyenne()>m_Gapp_max) m_Gapp_max=analyse->get_Gapp_moyenne();
3414     m_Gapp_histogramme.ajouter_valeur(analyse->get_Gapp_moyenne(),1.0/m_nb_ves);
3415    
3416     m_Eapp_moyenne+=analyse->get_Eapp_moyenne();
3417     if(analyse->get_Eapp_moyenne()<m_Eapp_min) m_Eapp_min=analyse->get_Eapp_moyenne();
3418     if(analyse->get_Eapp_moyenne()>m_Eapp_max) m_Eapp_max=analyse->get_Eapp_moyenne();
3419     m_Eapp_histogramme.ajouter_valeur(analyse->get_Eapp_moyenne(),1.0/m_nb_ves);
3420    
3421     m_Nuapp_moyenne+=analyse->get_Nuapp_moyenne();
3422     if(analyse->get_Nuapp_moyenne()<m_Nuapp_min) m_Nuapp_min=analyse->get_Nuapp_moyenne();
3423     if(analyse->get_Nuapp_moyenne()>m_Nuapp_max) m_Nuapp_max=analyse->get_Nuapp_moyenne();
3424     m_Nuapp_histogramme.ajouter_valeur(analyse->get_Nuapp_moyenne(),1.0/m_nb_ves);
3425     }
3426     m_Kapp_moyenne=m_Kapp_moyenne/m_nb_ves;
3427     m_Gapp_moyenne=m_Gapp_moyenne/m_nb_ves;
3428     m_Eapp_moyenne=m_Eapp_moyenne/m_nb_ves;
3429     m_Nuapp_moyenne=m_Nuapp_moyenne/m_nb_ves;
3430     for(it_analyse=vector_analyse.begin();it_analyse!=vector_analyse.end();it_analyse++)
3431     {
3432     m_Kapp_ecart_type+=(analyse->get_Kapp_moyenne()-m_Kapp_moyenne)*(analyse->get_Kapp_moyenne()-m_Kapp_moyenne);
3433     m_Gapp_ecart_type+=(analyse->get_Gapp_moyenne()-m_Gapp_moyenne)*(analyse->get_Gapp_moyenne()-m_Gapp_moyenne);
3434     m_Eapp_ecart_type+=(analyse->get_Eapp_moyenne()-m_Eapp_moyenne)*(analyse->get_Eapp_moyenne()-m_Eapp_moyenne);
3435     m_Nuapp_ecart_type+=(analyse->get_Nuapp_moyenne()-m_Nuapp_moyenne)*(analyse->get_Nuapp_moyenne()-m_Nuapp_moyenne);
3436     }
3437     m_Kapp_ecart_type=sqrt(m_Kapp_ecart_type*(1.0/(m_nb_ves-1.0)));
3438     m_Gapp_ecart_type=sqrt(m_Gapp_ecart_type*(1.0/(m_nb_ves-1.0)));
3439     m_Eapp_ecart_type=sqrt(m_Eapp_ecart_type*(1.0/(m_nb_ves-1.0)));
3440     m_Nuapp_ecart_type=sqrt(m_Nuapp_ecart_type*(1.0/(m_nb_ves-1.0)));
3441     }
3442 couturad 926
3443 couturad 930 MSTRUCT_ANALYSE_MODULES_MECA::~MSTRUCT_ANALYSE_MODULES_MECA(void)
3444     {
3445     }
3446 couturad 926
3447 couturad 930 long int MSTRUCT_ANALYSE_MODULES_MECA::get_nb_ves(void)
3448     {
3449     return m_nb_ves;
3450     }
3451 couturad 926
3452 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Kapp_moyenne(void)
3453     {
3454     return m_Kapp_moyenne;
3455     }
3456 couturad 926
3457 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Kapp_ecart_type(void)
3458     {
3459     return m_Kapp_ecart_type;
3460     }
3461 couturad 926
3462 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Kapp_min(void)
3463     {
3464     return m_Kapp_min;
3465     }
3466 couturad 926
3467 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Kapp_max(void)
3468     {
3469     return m_Kapp_max;
3470     }
3471 couturad 926
3472 couturad 930 OT_HISTOGRAMME* MSTRUCT_ANALYSE_MODULES_MECA::get_Kapp_histogramme(void)
3473     {
3474     return &m_Kapp_histogramme;
3475     }
3476 couturad 926
3477 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Gapp_moyenne(void)
3478     {
3479     return m_Gapp_moyenne;
3480     }
3481 couturad 926
3482 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Gapp_ecart_type(void)
3483     {
3484     return m_Gapp_ecart_type;
3485     }
3486 couturad 926
3487 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Gapp_min(void)
3488     {
3489     return m_Gapp_min;
3490     }
3491 couturad 926
3492 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Gapp_max(void)
3493     {
3494     return m_Gapp_max;
3495     }
3496 couturad 926
3497 couturad 930 OT_HISTOGRAMME* MSTRUCT_ANALYSE_MODULES_MECA::get_Gapp_histogramme(void)
3498     {
3499     return &m_Gapp_histogramme;
3500     }
3501 couturad 926
3502 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Nuapp_moyenne(void)
3503     {
3504     return m_Nuapp_moyenne;
3505     }
3506 couturad 926
3507 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Nuapp_ecart_type(void)
3508     {
3509     return m_Nuapp_ecart_type;
3510     }
3511 couturad 926
3512 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Nuapp_min(void)
3513     {
3514     return m_Nuapp_min;
3515     }
3516 couturad 926
3517 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Nuapp_max(void)
3518     {
3519     return m_Nuapp_max;
3520     }
3521 couturad 926
3522 couturad 930 OT_HISTOGRAMME* MSTRUCT_ANALYSE_MODULES_MECA::get_Nuapp_histogramme(void)
3523     {
3524     return &m_Nuapp_histogramme;
3525     }
3526 couturad 926
3527 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Eapp_moyenne(void)
3528     {
3529     return m_Eapp_moyenne;
3530     }
3531 couturad 926
3532 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Eapp_ecart_type(void)
3533     {
3534     return m_Eapp_ecart_type;
3535     }
3536 couturad 926
3537 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Eapp_min(void)
3538     {
3539     return m_Eapp_min;
3540     }
3541 couturad 926
3542 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::v_Eapp_max(void)
3543     {
3544     return m_Eapp_max;
3545     }
3546 couturad 926
3547 couturad 930 OT_HISTOGRAMME* MSTRUCT_ANALYSE_MODULES_MECA::get_Eapp_histogramme(void)
3548     {
3549     return &m_Eapp_histogramme;
3550     }
3551 couturad 926
3552 couturad 930 void MSTRUCT_ANALYSE_MODULES_MECA::exporter(ofstream& ofstrm, long int i, bool avec_histo, char* prefix_histo)
3553     {
3554 couturad 931 if(i==1) ofstrm << "#(1) Eapp[moy(2) ±(3) min(4) max(5)] Nuapp[moy(6) ±(7) min(8) max(9)] Gapp[moy(10) ±(11) min(12) max(13)] Kapp[moy(14) ±(15) min(16) max(17)]" << std::endl;
3555     ofstrm << i << " "
3556     << m_Eapp_moyenne << " "
3557 couturad 930 << m_Eapp_ecart_type << " "
3558     << m_Eapp_min << " "
3559     << m_Eapp_max << " "
3560     << m_Nuapp_moyenne << " "
3561     << m_Nuapp_ecart_type << " "
3562     << m_Nuapp_min << " "
3563     << m_Nuapp_max << " "
3564     << m_Gapp_moyenne << " "
3565     << m_Gapp_ecart_type << " "
3566     << m_Gapp_min << " "
3567     << m_Gapp_max << " "
3568     << m_Kapp_moyenne << " "
3569     << m_Kapp_ecart_type << " "
3570     << m_Kapp_min << " "
3571     << m_Kapp_max << std::endl;
3572     if(avec_histo)
3573     {
3574     char nom_fichier[500];
3575     sprintf(nom_fichier,"%shisto_Eapp.txt",prefix_histo);
3576     ofstream of_histo_Eapp(nom_fichier,std::ios::out|std::ios::trunc);
3577     of_histo_Eapp.precision(16);
3578     of_histo_Eapp.setf(std::ios::showpoint);
3579     m_Eapp_histogramme.exporter(of_histo_Eapp);
3580     of_histo_Eapp.close();
3581    
3582     sprintf(nom_fichier,"%shisto_Nuapp.txt",prefix_histo);
3583     ofstream of_histo_Nuapp(nom_fichier,std::ios::out|std::ios::trunc);
3584     of_histo_Nuapp.precision(16);
3585     of_histo_Nuapp.setf(std::ios::showpoint);
3586     m_Nuapp_histogramme.exporter(of_histo_Nuapp);
3587     of_histo_Nuapp.close();
3588    
3589     sprintf(nom_fichier,"%shisto_Gapp.txt",prefix_histo);
3590     ofstream of_histo_Gapp(nom_fichier,std::ios::out|std::ios::trunc);
3591     of_histo_Gapp.precision(16);
3592     of_histo_Gapp.setf(std::ios::showpoint);
3593     m_Gapp_histogramme.exporter(of_histo_Gapp);
3594     of_histo_Gapp.close();
3595    
3596     sprintf(nom_fichier,"%shisto_Kapp.txt",prefix_histo);
3597     ofstream of_histo_Kapp(nom_fichier,std::ios::out|std::ios::trunc);
3598     of_histo_Kapp.precision(16);
3599     of_histo_Kapp.setf(std::ios::showpoint);
3600     m_Kapp_histogramme.exporter(of_histo_Kapp);
3601     of_histo_Kapp.close();
3602     }
3603     }
3604 couturad 926
3605