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