ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/microstructure/src/mstruct_analyse.cpp
Revision: 926
Committed: Tue May 1 20:38:42 2018 UTC (7 years ago) by couturad
File size: 125043 byte(s)
Log Message:
Ajout de nouvelles fonctionnalités de representation et d'analyse des VES
*Modification du CMakeLists.txt de microstructure

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