ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/microstructure/src/mstruct_analyse.cpp
Revision: 931
Committed: Thu May 17 01:24:23 2018 UTC (6 years, 11 months ago) by couturad
File size: 145682 byte(s)
Log Message:
Correction bugs dans 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 couturad 931 OUTILS::statistiques_fem_maillage(fem,
2616 couturad 926 m_boite_analyse,
2617     tpl_map_forme,
2618     m_nb_element_2D_moyenne,m_nb_element_3D_moyenne,
2619     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,
2620     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,
2621     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,
2622     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,
2623     m_2D_distortion_moyenne,m_2D_distortion_ecart_type,m_2D_distortion_min,m_2D_distortion_max,m_2D_distortion_histogramme,
2624     m_3D_distortion_moyenne,m_3D_distortion_ecart_type,m_3D_distortion_min,m_3D_distortion_max,m_3D_distortion_histogramme,
2625     m_volume_moyenne,
2626     m_fraction_volumique_moyenne);
2627     m_nb_element_2D_min=m_nb_element_2D_moyenne;
2628     m_nb_element_2D_max=m_nb_element_2D_moyenne;
2629     m_nb_element_2D_ecart_type=0.0;
2630     m_nb_element_3D_min=m_nb_element_3D_moyenne;
2631     m_nb_element_3D_max=m_nb_element_3D_moyenne;
2632     m_nb_element_3D_ecart_type=0.0;
2633     m_volume_min=m_volume_moyenne;
2634     m_volume_max=m_volume_moyenne;
2635     m_volume_ecart_type=0.0;
2636     m_fraction_volumique_min=m_fraction_volumique_moyenne;
2637     m_fraction_volumique_max=m_fraction_volumique_moyenne;
2638     m_fraction_volumique_ecart_type=0.0;
2639     }
2640    
2641     void MSTRUCT_ANALYSE_FEM_MAILLAGE::exporter(ofstream& ofstrm, long int i, bool avec_histo, char* prefix_histo)
2642     {
2643 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;
2644 couturad 926 ofstrm << i << " "
2645     << m_volume_moyenne << " "
2646     << m_volume_ecart_type << " "
2647     << m_volume_max << " "
2648     << m_volume_max << " "
2649     << m_fraction_volumique_moyenne << " "
2650     << m_fraction_volumique_ecart_type << " "
2651     << m_fraction_volumique_min << " "
2652     << m_fraction_volumique_max << " "
2653     << m_nb_element_2D_moyenne << " "
2654     << m_nb_element_2D_ecart_type << " "
2655     << m_nb_element_2D_min << " "
2656     << m_nb_element_2D_max << " "
2657     << m_nb_element_3D_moyenne << " "
2658     << m_nb_element_3D_ecart_type << " "
2659     << m_nb_element_3D_min << " "
2660     << m_nb_element_3D_max << " "
2661     << m_2D_jacobien_min_moyenne << " "
2662     << m_2D_jacobien_min_ecart_type << " "
2663     << m_2D_jacobien_min_min << " "
2664     << m_2D_jacobien_min_max << " "
2665     << m_2D_jacobien_max_moyenne << " "
2666     << m_2D_jacobien_max_ecart_type << " "
2667     << m_2D_jacobien_max_min << " "
2668     << m_2D_jacobien_max_max << " "
2669     << m_3D_jacobien_min_moyenne << " "
2670     << m_3D_jacobien_min_ecart_type << " "
2671     << m_3D_jacobien_min_min << " "
2672     << m_3D_jacobien_min_max << " "
2673     << m_3D_jacobien_max_moyenne << " "
2674     << m_3D_jacobien_max_ecart_type << " "
2675     << m_3D_jacobien_max_min << " "
2676     << m_3D_jacobien_max_max << " "
2677     << m_2D_distortion_moyenne << " "
2678     << m_2D_distortion_ecart_type << " "
2679     << m_2D_distortion_min << " "
2680     << m_2D_distortion_max << " "
2681     << m_3D_distortion_moyenne << " "
2682     << m_3D_distortion_ecart_type << " "
2683     << m_3D_distortion_min << " "
2684     << m_3D_distortion_max << std::endl;
2685     if(avec_histo)
2686     {
2687     char nom_fichier[500];
2688     sprintf(nom_fichier,"%shisto_%s_jacobien_min_2D.txt",prefix_histo,m_identifiant.c_str());
2689     ofstream of_histo_javcobien_min_2d(nom_fichier,std::ios::out|std::ios::trunc);
2690     of_histo_javcobien_min_2d.precision(16);
2691     of_histo_javcobien_min_2d.setf(std::ios::showpoint);
2692     m_2D_jacobien_histogramme_min.exporter(of_histo_javcobien_min_2d);
2693     of_histo_javcobien_min_2d.close();
2694    
2695     sprintf(nom_fichier,"%shisto_%s_jacobien_max_2D.txt",prefix_histo,m_identifiant.c_str());
2696     ofstream of_histo_javcobien_max_2d(nom_fichier,std::ios::out|std::ios::trunc);
2697     of_histo_javcobien_max_2d.precision(16);
2698     of_histo_javcobien_max_2d.setf(std::ios::showpoint);
2699     m_2D_jacobien_histogramme_max.exporter(of_histo_javcobien_max_2d);
2700     of_histo_javcobien_max_2d.close();
2701    
2702     sprintf(nom_fichier,"%shisto_%s_jacobien_min_3D.txt",prefix_histo,m_identifiant.c_str());
2703     ofstream of_histo_javcobien_min_3d(nom_fichier,std::ios::out|std::ios::trunc);
2704     of_histo_javcobien_min_3d.precision(16);
2705     of_histo_javcobien_min_3d.setf(std::ios::showpoint);
2706     m_3D_jacobien_histogramme_min.exporter(of_histo_javcobien_min_3d);
2707     of_histo_javcobien_min_3d.close();
2708    
2709     sprintf(nom_fichier,"%shisto_%s_jacobien_max_3D.txt",prefix_histo,m_identifiant.c_str());
2710     ofstream of_histo_javcobien_max_3d(nom_fichier,std::ios::out|std::ios::trunc);
2711     of_histo_javcobien_max_3d.precision(16);
2712     of_histo_javcobien_max_3d.setf(std::ios::showpoint);
2713     m_3D_jacobien_histogramme_max.exporter(of_histo_javcobien_max_3d);
2714     of_histo_javcobien_max_3d.close();
2715    
2716     sprintf(nom_fichier,"%shisto_%s_distortion_2D.txt",prefix_histo,m_identifiant.c_str());
2717     ofstream of_histo_distortion_2D(nom_fichier,std::ios::out|std::ios::trunc);
2718     of_histo_distortion_2D.precision(16);
2719     of_histo_distortion_2D.setf(std::ios::showpoint);
2720     m_2D_distortion_histogramme.exporter(of_histo_distortion_2D);
2721     of_histo_distortion_2D.close();
2722    
2723     sprintf(nom_fichier,"%shisto_%s_distortion_3D.txt",prefix_histo,m_identifiant.c_str());
2724     ofstream of_histo_distortion_3D(nom_fichier,std::ios::out|std::ios::trunc);
2725     of_histo_distortion_3D.precision(16);
2726     of_histo_distortion_3D.setf(std::ios::showpoint);
2727     m_3D_distortion_histogramme.exporter(of_histo_distortion_3D);
2728     of_histo_distortion_3D.close();
2729    
2730     sprintf(nom_fichier,"%shisto_%s_volume.txt",prefix_histo,m_identifiant.c_str());
2731     ofstream of_histo_volume(nom_fichier,std::ios::out|std::ios::trunc);
2732     of_histo_volume.precision(16);
2733     of_histo_volume.setf(std::ios::showpoint);
2734     m_volume_histogramme.exporter(of_histo_volume);
2735     of_histo_volume.close();
2736    
2737     sprintf(nom_fichier,"%shisto_%s_frac_vol.txt",prefix_histo,m_identifiant.c_str());
2738     ofstream of_histo_frac_vol(nom_fichier,std::ios::out|std::ios::trunc);
2739     of_histo_frac_vol.precision(16);
2740     of_histo_frac_vol.setf(std::ios::showpoint);
2741     m_fraction_volumique_histogramme.exporter(of_histo_frac_vol);
2742     of_histo_frac_vol.close();
2743    
2744     sprintf(nom_fichier,"%shisto_%s_nb_ele_2D.txt",prefix_histo,m_identifiant.c_str());
2745     ofstream of_histo_nb_ele_2d(nom_fichier,std::ios::out|std::ios::trunc);
2746     of_histo_nb_ele_2d.precision(16);
2747     of_histo_nb_ele_2d.setf(std::ios::showpoint);
2748     m_nb_element_2D_histogramme.exporter(of_histo_nb_ele_2d);
2749     of_histo_nb_ele_2d.close();
2750    
2751     sprintf(nom_fichier,"%shisto_%s_nb_ele_3D.txt",prefix_histo,m_identifiant.c_str());
2752     ofstream of_histo_nb_ele_3d(nom_fichier,std::ios::out|std::ios::trunc);
2753     of_histo_nb_ele_3d.precision(16);
2754     of_histo_nb_ele_3d.setf(std::ios::showpoint);
2755     m_nb_element_3D_histogramme.exporter(of_histo_nb_ele_3d);
2756     of_histo_nb_ele_3d.close();
2757     }
2758     }
2759    
2760     void MSTRUCT_ANALYSE_FEM_MAILLAGE::enregistrer(ofstream& ofstrm)
2761     {
2762     long type_analyse=get_type();
2763     ofstrm.write((char*)&type_analyse,sizeof(long));
2764     MICROSTRUCTURE::MSTRUCT_ANALYSE::enregistrer(ofstrm);
2765     ofstrm.write((char*)&m_id_fem_maillage,sizeof(long));
2766    
2767     ofstrm.write((char*)&m_nb_element_2D_min,sizeof(long));
2768     ofstrm.write((char*)&m_nb_element_2D_max,sizeof(long));
2769     ofstrm.write((char*)&m_nb_element_2D_moyenne,sizeof(long));
2770     ofstrm.write((char*)&m_nb_element_2D_ecart_type,sizeof(long));
2771     m_nb_element_2D_histogramme.enregistrer_bin(ofstrm);
2772    
2773     ofstrm.write((char*)&m_nb_element_3D_min,sizeof(long));
2774     ofstrm.write((char*)&m_nb_element_3D_max,sizeof(long));
2775     ofstrm.write((char*)&m_nb_element_3D_moyenne,sizeof(long));
2776     ofstrm.write((char*)&m_nb_element_3D_ecart_type,sizeof(long));
2777     m_nb_element_3D_histogramme.enregistrer_bin(ofstrm);
2778    
2779     ofstrm.write((char*)&m_2D_jacobien_min_min,sizeof(double));
2780     ofstrm.write((char*)&m_2D_jacobien_min_max,sizeof(double));
2781     ofstrm.write((char*)&m_2D_jacobien_min_moyenne,sizeof(double));
2782     ofstrm.write((char*)&m_2D_jacobien_min_ecart_type,sizeof(double));
2783     m_2D_jacobien_histogramme_min.enregistrer_bin(ofstrm);
2784    
2785     ofstrm.write((char*)&m_2D_jacobien_max_min,sizeof(double));
2786     ofstrm.write((char*)&m_2D_jacobien_max_max,sizeof(double));
2787     ofstrm.write((char*)&m_2D_jacobien_max_moyenne,sizeof(double));
2788     ofstrm.write((char*)&m_2D_jacobien_max_ecart_type,sizeof(double));
2789     m_2D_jacobien_histogramme_max.enregistrer_bin(ofstrm);
2790    
2791     ofstrm.write((char*)&m_3D_jacobien_min_min,sizeof(double));
2792     ofstrm.write((char*)&m_3D_jacobien_min_max,sizeof(double));
2793     ofstrm.write((char*)&m_3D_jacobien_min_moyenne,sizeof(double));
2794     ofstrm.write((char*)&m_3D_jacobien_min_ecart_type,sizeof(double));
2795     m_3D_jacobien_histogramme_min.enregistrer_bin(ofstrm);
2796    
2797     ofstrm.write((char*)&m_3D_jacobien_max_min,sizeof(double));
2798     ofstrm.write((char*)&m_3D_jacobien_max_max,sizeof(double));
2799     ofstrm.write((char*)&m_3D_jacobien_max_moyenne,sizeof(double));
2800     ofstrm.write((char*)&m_3D_jacobien_max_ecart_type,sizeof(double));
2801     m_3D_jacobien_histogramme_max.enregistrer_bin(ofstrm);
2802    
2803     ofstrm.write((char*)&m_2D_distortion_min,sizeof(double));
2804     ofstrm.write((char*)&m_2D_distortion_max,sizeof(double));
2805     ofstrm.write((char*)&m_2D_distortion_moyenne,sizeof(double));
2806     ofstrm.write((char*)&m_2D_distortion_ecart_type,sizeof(double));
2807     m_2D_distortion_histogramme.enregistrer_bin(ofstrm);
2808    
2809     ofstrm.write((char*)&m_3D_distortion_min,sizeof(double));
2810     ofstrm.write((char*)&m_3D_distortion_max,sizeof(double));
2811     ofstrm.write((char*)&m_3D_distortion_moyenne,sizeof(double));
2812     ofstrm.write((char*)&m_3D_distortion_ecart_type,sizeof(double));
2813     m_3D_distortion_histogramme.enregistrer_bin(ofstrm);
2814    
2815     ofstrm.write((char*)&m_volume_moyenne,sizeof(double));
2816     ofstrm.write((char*)&m_volume_ecart_type,sizeof(double));
2817     ofstrm.write((char*)&m_volume_min,sizeof(double));
2818     ofstrm.write((char*)&m_volume_max,sizeof(double));
2819     m_volume_histogramme.enregistrer_bin(ofstrm);
2820     ofstrm.write((char*)&m_fraction_volumique_moyenne,sizeof(double));
2821     ofstrm.write((char*)&m_fraction_volumique_ecart_type,sizeof(double));
2822     ofstrm.write((char*)&m_fraction_volumique_min,sizeof(double));
2823     ofstrm.write((char*)&m_fraction_volumique_max,sizeof(double));
2824     m_fraction_volumique_histogramme.enregistrer_bin(ofstrm);
2825     }
2826    
2827     void MSTRUCT_ANALYSE_FEM_MAILLAGE::ouvrir(ifstream& ifstrm)
2828     {
2829     MICROSTRUCTURE::MSTRUCT_ANALYSE::ouvrir(ifstrm);
2830     ifstrm.read((char*)&m_id_fem_maillage,sizeof(long));
2831    
2832     ifstrm.read((char*)&m_nb_element_2D_min,sizeof(long));
2833     ifstrm.read((char*)&m_nb_element_2D_max,sizeof(long));
2834     ifstrm.read((char*)&m_nb_element_2D_moyenne,sizeof(long));
2835     ifstrm.read((char*)&m_nb_element_2D_ecart_type,sizeof(long));
2836     m_nb_element_2D_histogramme.ouvrir_bin(ifstrm);
2837    
2838     ifstrm.read((char*)&m_nb_element_3D_min,sizeof(long));
2839     ifstrm.read((char*)&m_nb_element_3D_max,sizeof(long));
2840     ifstrm.read((char*)&m_nb_element_3D_moyenne,sizeof(long));
2841     ifstrm.read((char*)&m_nb_element_3D_ecart_type,sizeof(long));
2842     m_nb_element_3D_histogramme.ouvrir_bin(ifstrm);
2843    
2844     ifstrm.read((char*)&m_2D_jacobien_min_min,sizeof(double));
2845     ifstrm.read((char*)&m_2D_jacobien_min_max,sizeof(double));
2846     ifstrm.read((char*)&m_2D_jacobien_min_moyenne,sizeof(double));
2847     ifstrm.read((char*)&m_2D_jacobien_min_ecart_type,sizeof(double));
2848     m_2D_jacobien_histogramme_min.ouvrir_bin(ifstrm);
2849    
2850     ifstrm.read((char*)&m_2D_jacobien_max_min,sizeof(double));
2851     ifstrm.read((char*)&m_2D_jacobien_max_max,sizeof(double));
2852     ifstrm.read((char*)&m_2D_jacobien_max_moyenne,sizeof(double));
2853     ifstrm.read((char*)&m_2D_jacobien_max_ecart_type,sizeof(double));
2854     m_2D_jacobien_histogramme_max.ouvrir_bin(ifstrm);
2855    
2856     ifstrm.read((char*)&m_3D_jacobien_min_min,sizeof(double));
2857     ifstrm.read((char*)&m_3D_jacobien_min_max,sizeof(double));
2858     ifstrm.read((char*)&m_3D_jacobien_min_moyenne,sizeof(double));
2859     ifstrm.read((char*)&m_3D_jacobien_min_ecart_type,sizeof(double));
2860     m_3D_jacobien_histogramme_min.ouvrir_bin(ifstrm);
2861    
2862     ifstrm.read((char*)&m_3D_jacobien_max_min,sizeof(double));
2863     ifstrm.read((char*)&m_3D_jacobien_max_max,sizeof(double));
2864     ifstrm.read((char*)&m_3D_jacobien_max_moyenne,sizeof(double));
2865     ifstrm.read((char*)&m_3D_jacobien_max_ecart_type,sizeof(double));
2866     m_3D_jacobien_histogramme_max.ouvrir_bin(ifstrm);
2867    
2868     ifstrm.read((char*)&m_2D_distortion_min,sizeof(double));
2869     ifstrm.read((char*)&m_2D_distortion_max,sizeof(double));
2870     ifstrm.read((char*)&m_2D_distortion_moyenne,sizeof(double));
2871     ifstrm.read((char*)&m_2D_distortion_ecart_type,sizeof(double));
2872     m_2D_distortion_histogramme.ouvrir_bin(ifstrm);
2873    
2874     ifstrm.read((char*)&m_3D_distortion_min,sizeof(double));
2875     ifstrm.read((char*)&m_3D_distortion_max,sizeof(double));
2876     ifstrm.read((char*)&m_3D_distortion_moyenne,sizeof(double));
2877     ifstrm.read((char*)&m_3D_distortion_ecart_type,sizeof(double));
2878     m_3D_distortion_histogramme.ouvrir_bin(ifstrm);
2879    
2880     ifstrm.read((char*)&m_volume_moyenne,sizeof(double));
2881     ifstrm.read((char*)&m_volume_ecart_type,sizeof(double));
2882     ifstrm.read((char*)&m_volume_min,sizeof(double));
2883     ifstrm.read((char*)&m_volume_max,sizeof(double));
2884     m_volume_histogramme.ouvrir_bin(ifstrm);
2885     ifstrm.read((char*)&m_fraction_volumique_moyenne,sizeof(double));
2886     ifstrm.read((char*)&m_fraction_volumique_ecart_type,sizeof(double));
2887     ifstrm.read((char*)&m_fraction_volumique_min,sizeof(double));
2888     ifstrm.read((char*)&m_fraction_volumique_max,sizeof(double));
2889     m_fraction_volumique_histogramme.ouvrir_bin(ifstrm);
2890     }
2891    
2892     void MSTRUCT_ANALYSE_FEM_MAILLAGE::affiche_contenu(MICROSTRUCTURE::fonction_affiche* fonc)
2893     {
2894     MICROSTRUCTURE::MSTRUCT_ANALYSE::affiche_contenu(fonc);
2895     char ligne[5000];
2896     sprintf(ligne,"MSTRUCT_ANALYSE_CAO");fonc(ligne);
2897     sprintf(ligne,"-> ID MG_MAILLAGE : %li",m_id_fem_maillage);fonc(ligne);
2898    
2899     sprintf(ligne,"-> Moyenne nb element 2D : %li",m_nb_element_2D_moyenne);fonc(ligne);
2900     sprintf(ligne,"-> Ecart-type nb element 2D : %li",m_nb_element_2D_ecart_type);fonc(ligne);
2901     sprintf(ligne,"-> Min nb element 2D : %li",m_nb_element_2D_min);fonc(ligne);
2902     sprintf(ligne,"-> Max nb element 2D : %li",m_nb_element_2D_max);fonc(ligne);
2903     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(),
2904     m_nb_element_2D_histogramme.get_largeur_colonne(),
2905     m_nb_element_2D_histogramme.get_x_min(),
2906     m_nb_element_2D_histogramme.get_x_max());
2907     fonc(ligne);
2908     sprintf(ligne,"-> Moyenne nb element 3D : %li",m_nb_element_3D_moyenne);fonc(ligne);
2909     sprintf(ligne,"-> Ecart-type nb element 3D : %li",m_nb_element_3D_ecart_type);fonc(ligne);
2910     sprintf(ligne,"-> Min nb element 3D : %li",m_nb_element_3D_min);fonc(ligne);
2911     sprintf(ligne,"-> Max nb element 3D : %li",m_nb_element_3D_max);fonc(ligne);
2912     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(),
2913     m_nb_element_3D_histogramme.get_largeur_colonne(),
2914     m_nb_element_3D_histogramme.get_x_min(),
2915     m_nb_element_3D_histogramme.get_x_max());
2916     fonc(ligne);
2917    
2918     sprintf(ligne,"-> 2D Jacobien Min moyenne : %lf",m_2D_jacobien_min_moyenne);fonc(ligne);
2919     sprintf(ligne,"-> 2D Jacobien Min ecart-type : %lf",m_2D_jacobien_min_ecart_type);fonc(ligne);
2920     sprintf(ligne,"-> 2D Jacobien Min min : %lf",m_2D_jacobien_min_min);fonc(ligne);
2921     sprintf(ligne,"-> 2D Jacobien Min max : %lf",m_2D_jacobien_min_max);fonc(ligne);
2922     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(),
2923     m_2D_jacobien_histogramme_min.get_largeur_colonne(),
2924     m_2D_jacobien_histogramme_min.get_x_min(),
2925     m_2D_jacobien_histogramme_min.get_x_max());
2926     fonc(ligne);
2927    
2928     sprintf(ligne,"-> 2D Jacobien Max moyenne : %lf",m_2D_jacobien_max_moyenne);fonc(ligne);
2929     sprintf(ligne,"-> 2D Jacobien Max ecart-type : %lf",m_2D_jacobien_max_ecart_type);fonc(ligne);
2930     sprintf(ligne,"-> 2D Jacobien Max min : %lf",m_2D_jacobien_max_min);fonc(ligne);
2931     sprintf(ligne,"-> 2D Jacobien Max max : %lf",m_2D_jacobien_max_max);fonc(ligne);
2932     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(),
2933     m_2D_jacobien_histogramme_max.get_largeur_colonne(),
2934     m_2D_jacobien_histogramme_max.get_x_min(),
2935     m_2D_jacobien_histogramme_max.get_x_max());
2936     fonc(ligne);
2937    
2938     sprintf(ligne,"-> 3D Jacobien Min moyenne : %lf",m_3D_jacobien_min_moyenne);fonc(ligne);
2939     sprintf(ligne,"-> 3D Jacobien Min ecart-type : %lf",m_3D_jacobien_min_ecart_type);fonc(ligne);
2940     sprintf(ligne,"-> 3D Jacobien Min min : %lf",m_3D_jacobien_min_min);fonc(ligne);
2941     sprintf(ligne,"-> 3D Jacobien Min max : %lf",m_3D_jacobien_min_max);fonc(ligne);
2942     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(),
2943     m_3D_jacobien_histogramme_min.get_largeur_colonne(),
2944     m_3D_jacobien_histogramme_min.get_x_min(),
2945     m_3D_jacobien_histogramme_min.get_x_max());
2946     fonc(ligne);
2947    
2948     sprintf(ligne,"-> 3D Jacobien Max moyenne : %lf",m_3D_jacobien_max_moyenne);fonc(ligne);
2949     sprintf(ligne,"-> 3D Jacobien Max ecart-type : %lf",m_3D_jacobien_max_ecart_type);fonc(ligne);
2950     sprintf(ligne,"-> 3D Jacobien Max min : %lf",m_3D_jacobien_max_min);fonc(ligne);
2951     sprintf(ligne,"-> 3D Jacobien Max max : %lf",m_3D_jacobien_max_max);fonc(ligne);
2952     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(),
2953     m_3D_jacobien_histogramme_max.get_largeur_colonne(),
2954     m_3D_jacobien_histogramme_max.get_x_min(),
2955     m_3D_jacobien_histogramme_max.get_x_max());
2956     fonc(ligne);
2957    
2958     sprintf(ligne,"-> 2D Distortion moyenne : %lf",m_2D_distortion_moyenne);fonc(ligne);
2959     sprintf(ligne,"-> 2D Distortion ecart-type : %lf",m_2D_distortion_ecart_type);fonc(ligne);
2960     sprintf(ligne,"-> 2D Distortion min : %lf",m_2D_distortion_min);fonc(ligne);
2961     sprintf(ligne,"-> 2D Distortion max : %lf",m_2D_distortion_max);fonc(ligne);
2962     sprintf(ligne,"-> OT_HISTOGRAMME 2D Jacobien Min : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_2D_distortion_histogramme.get_nb_colonne(),
2963     m_2D_distortion_histogramme.get_largeur_colonne(),
2964     m_2D_distortion_histogramme.get_x_min(),
2965     m_2D_distortion_histogramme.get_x_max());
2966     fonc(ligne);
2967    
2968     sprintf(ligne,"-> 3D Distortion moyenne : %lf",m_3D_distortion_moyenne);fonc(ligne);
2969     sprintf(ligne,"-> 3D Distortion ecart-type : %lf",m_3D_distortion_ecart_type);fonc(ligne);
2970     sprintf(ligne,"-> 3D Distortion min : %lf",m_3D_distortion_min);fonc(ligne);
2971     sprintf(ligne,"-> 3D Distortion max : %lf",m_3D_distortion_max);fonc(ligne);
2972     sprintf(ligne,"-> OT_HISTOGRAMME 3D Jacobien Min : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_3D_distortion_histogramme.get_nb_colonne(),
2973     m_3D_distortion_histogramme.get_largeur_colonne(),
2974     m_3D_distortion_histogramme.get_x_min(),
2975     m_3D_distortion_histogramme.get_x_max());
2976     fonc(ligne);
2977     sprintf(ligne,"-> Moyenne volume : %lf",m_volume_moyenne); fonc(ligne);
2978     sprintf(ligne,"-> Ecart-type volume : %lf",m_volume_ecart_type); fonc(ligne);
2979     sprintf(ligne,"-> Min volume : %lf",m_volume_min); fonc(ligne);
2980     sprintf(ligne,"-> Max volume : %lf",m_volume_max); fonc(ligne);
2981     sprintf(ligne,"-> OT_HISTOGRAMME volume : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_volume_histogramme.get_nb_colonne(),
2982     m_volume_histogramme.get_largeur_colonne(),
2983     m_volume_histogramme.get_x_min(),
2984     m_volume_histogramme.get_x_max());
2985     fonc(ligne);
2986     sprintf(ligne,"-> Moyenne fraction volumique : %lf",m_fraction_volumique_moyenne); fonc(ligne);
2987     sprintf(ligne,"-> Ecart-type fraction volumique : %lf",m_fraction_volumique_ecart_type); fonc(ligne);
2988     sprintf(ligne,"-> Min fraction volumique : %lf",m_fraction_volumique_min); fonc(ligne);
2989     sprintf(ligne,"-> Max fraction volumique : %lf",m_fraction_volumique_max); fonc(ligne);
2990     sprintf(ligne,"-> OT_HISTOGRAMME fraction volumique : nb_colonne(%li), largeur_colonne(%lf), xmin(%lf), xmax(%lf)", m_fraction_volumique_histogramme.get_nb_colonne(),
2991     m_fraction_volumique_histogramme.get_largeur_colonne(),
2992     m_fraction_volumique_histogramme.get_x_min(),
2993     m_fraction_volumique_histogramme.get_x_max());
2994     fonc(ligne);
2995     }
2996    
2997    
2998 couturad 930
2999    
3000     MSTRUCT_ANALYSE_EROSION::MSTRUCT_ANALYSE_EROSION(void): MSTRUCT_ANALYSE()
3001 couturad 926 {
3002 couturad 930 m_nb_couche=0;
3003     m_epaisseur_couche=0;
3004 couturad 926 }
3005    
3006 couturad 930 MSTRUCT_ANALYSE_EROSION::MSTRUCT_ANALYSE_EROSION(string identifiant,
3007     MICROSTRUCTURE::MSTRUCT_ANALYSE* analyse_initiale,
3008     long nb_couche,
3009     double epaisseur_couche): MSTRUCT_ANALYSE(identifiant,
3010     analyse_initiale->get_nom_groupe_forme(),
3011     analyse_initiale->get_boite_analyse()),
3012     m_nb_couche(nb_couche),
3013     m_epaisseur_couche(epaisseur_couche)
3014 couturad 926 {
3015 couturad 930 std::string iden_ini=identifiant+"_0";
3016     analyse_initiale->change_identifiant(iden_ini);
3017     ajouter_analyse(analyse_initiale);
3018     int type_analyse = analyse_initiale->get_type();
3019     for(long i=1;i<m_nb_couche;i++)
3020     {
3021     MSTRUCT_ANALYSE* nouvelle_analyse;
3022     if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CHAMP)
3023     {
3024     MSTRUCT_ANALYSE_CHAMP* analyse_ini_champ = (MSTRUCT_ANALYSE_CHAMP*)analyse_initiale;
3025     MSTRUCT_ANALYSE_CHAMP* analyse_champ = new MSTRUCT_ANALYSE_CHAMP(*analyse_ini_champ);
3026     nouvelle_analyse=analyse_champ;
3027     }
3028     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::ORIENTATION)
3029     {
3030     MSTRUCT_ANALYSE_ORIENTATION* analyse_ini_ori = (MSTRUCT_ANALYSE_ORIENTATION*)analyse_initiale;
3031     MSTRUCT_ANALYSE_ORIENTATION* analyse_ori = new MSTRUCT_ANALYSE_ORIENTATION(*analyse_ini_ori);
3032     nouvelle_analyse=analyse_ori;
3033     }
3034     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CAO)
3035     {
3036     MSTRUCT_ANALYSE_CAO* analyse_ini_cao = (MSTRUCT_ANALYSE_CAO*)analyse_initiale;
3037     MSTRUCT_ANALYSE_CAO* analyse_cao = new MSTRUCT_ANALYSE_CAO(*analyse_ini_cao);
3038     nouvelle_analyse=analyse_cao;
3039     }
3040     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_MG)
3041     {
3042     MSTRUCT_ANALYSE_MG_MAILLAGE* analyse_ini_mg_maill = (MSTRUCT_ANALYSE_MG_MAILLAGE*)analyse_initiale;
3043     MSTRUCT_ANALYSE_MG_MAILLAGE* analyse_mg_maill = new MSTRUCT_ANALYSE_MG_MAILLAGE(*analyse_ini_mg_maill);
3044     nouvelle_analyse=analyse_mg_maill;
3045     }
3046     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_FEM)
3047     {
3048     MSTRUCT_ANALYSE_FEM_MAILLAGE* analyse_ini_fem_maill = (MSTRUCT_ANALYSE_FEM_MAILLAGE*)analyse_initiale;
3049     MSTRUCT_ANALYSE_FEM_MAILLAGE* analyse_fem_maill = new MSTRUCT_ANALYSE_FEM_MAILLAGE(*analyse_ini_fem_maill);
3050     nouvelle_analyse=analyse_fem_maill;
3051     }
3052     char iden[500];
3053     sprintf(iden,"%s_%li",identifiant.c_str(),i);
3054     nouvelle_analyse->change_identifiant(iden);
3055     if(nouvelle_analyse->get_boite_analyse()==NULL)
3056     {
3057     nouvelle_analyse->change_boite_analyse(BOITE_3D(0.0,0.0,0.0,1.0,1.0,1.0));
3058     }
3059     double xmin,ymin,zmin,xmax,ymax,zmax;
3060     xmin=nouvelle_analyse->get_boite_analyse()->get_xmin();
3061     ymin=nouvelle_analyse->get_boite_analyse()->get_ymin();
3062     zmin=nouvelle_analyse->get_boite_analyse()->get_zmin();
3063     xmax=nouvelle_analyse->get_boite_analyse()->get_xmax();
3064     ymax=nouvelle_analyse->get_boite_analyse()->get_ymax();
3065     zmax=nouvelle_analyse->get_boite_analyse()->get_zmax();
3066     xmin=xmin+i*m_epaisseur_couche;
3067     ymin=ymin+i*m_epaisseur_couche;
3068     zmin=zmin+i*m_epaisseur_couche;
3069     xmax=xmax-i*m_epaisseur_couche;
3070     ymax=ymax-i*m_epaisseur_couche;
3071     zmax=zmax-i*m_epaisseur_couche;
3072     nouvelle_analyse->get_boite_analyse()->reinit(xmin,ymin,zmin,xmax,ymax,zmax);
3073     ajouter_analyse(nouvelle_analyse);
3074     }
3075 couturad 926 }
3076    
3077 couturad 930
3078     MSTRUCT_ANALYSE_EROSION::MSTRUCT_ANALYSE_EROSION(std::vector< MSTRUCT_ANALYSE_EROSION* >& vector_analyse): MSTRUCT_ANALYSE()
3079 couturad 926 {
3080 couturad 930 std::vector<MSTRUCT_ANALYSE_EROSION*>::iterator it_analyse_erosion=vector_analyse.begin();
3081     MSTRUCT_ANALYSE_EROSION* analyse_erosion = *it_analyse_erosion;
3082     m_identifiant=analyse_erosion->get_identifiant();
3083     if(analyse_erosion->get_boite_analyse()!=NULL) change_boite_analyse(*analyse_erosion->get_boite_analyse());
3084     m_nom_groupe_forme=analyse_erosion->get_nom_groupe_forme();
3085 couturad 926 m_nb_ves=vector_analyse.size();
3086 couturad 930 m_nb_couche=analyse_erosion->get_nb_couche();
3087     m_epaisseur_couche=analyse_erosion->get_epaisseur_couche();
3088     int type_analyse = analyse_erosion->get_type();
3089     long nb_analyse=analyse_erosion->get_nb_analyse();
3090     if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CHAMP)
3091 couturad 926 {
3092 couturad 930 long i=0;
3093     while(i<nb_analyse)
3094     {
3095     std::vector<MSTRUCT_ANALYSE_CHAMP*> vector_analyse_compile;
3096     for(it_analyse_erosion=vector_analyse.begin();it_analyse_erosion!=vector_analyse.end();it_analyse_erosion++)
3097     {
3098     MSTRUCT_ANALYSE_EROSION* analyse_erosion = *it_analyse_erosion;
3099     vector_analyse_compile.push_back((MSTRUCT_ANALYSE_CHAMP*)analyse_erosion->get_analyse(i));
3100     }
3101     MSTRUCT_ANALYSE_CHAMP* nouvelle_analyse = new MSTRUCT_ANALYSE_CHAMP(vector_analyse_compile);
3102     ajouter_analyse(nouvelle_analyse);
3103     i++;
3104     }
3105 couturad 926 }
3106 couturad 930 else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::ORIENTATION)
3107 couturad 926 {
3108 couturad 930 long i=0;
3109     while(i<nb_analyse)
3110     {
3111     std::vector<MSTRUCT_ANALYSE_ORIENTATION*> vector_analyse_compile;
3112     for(it_analyse_erosion=vector_analyse.begin();it_analyse_erosion!=vector_analyse.end();it_analyse_erosion++)
3113     {
3114     MSTRUCT_ANALYSE_EROSION* analyse_erosion = *it_analyse_erosion;
3115     vector_analyse_compile.push_back((MSTRUCT_ANALYSE_ORIENTATION*)analyse_erosion->get_analyse(i));
3116     }
3117     MSTRUCT_ANALYSE_ORIENTATION* nouvelle_analyse = new MSTRUCT_ANALYSE_ORIENTATION(vector_analyse_compile);
3118     ajouter_analyse(nouvelle_analyse);
3119     i++;
3120     }
3121 couturad 926 }
3122 couturad 930 else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CAO)
3123     {
3124     long i=0;
3125     while(i<nb_analyse)
3126     {
3127     std::vector<MSTRUCT_ANALYSE_CAO*> vector_analyse_compile;
3128     for(it_analyse_erosion=vector_analyse.begin();it_analyse_erosion!=vector_analyse.end();it_analyse_erosion++)
3129     {
3130     MSTRUCT_ANALYSE_EROSION* analyse_erosion = *it_analyse_erosion;
3131     vector_analyse_compile.push_back((MSTRUCT_ANALYSE_CAO*)analyse_erosion->get_analyse(i));
3132     }
3133     MSTRUCT_ANALYSE_CAO* nouvelle_analyse = new MSTRUCT_ANALYSE_CAO(vector_analyse_compile);
3134     ajouter_analyse(nouvelle_analyse);
3135     i++;
3136     }
3137     }
3138     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_MG)
3139     {
3140     long i=0;
3141     while(i<nb_analyse)
3142     {
3143     std::vector<MSTRUCT_ANALYSE_MG_MAILLAGE*> vector_analyse_compile;
3144     for(it_analyse_erosion=vector_analyse.begin();it_analyse_erosion!=vector_analyse.end();it_analyse_erosion++)
3145     {
3146     MSTRUCT_ANALYSE_EROSION* analyse_erosion = *it_analyse_erosion;
3147     vector_analyse_compile.push_back((MSTRUCT_ANALYSE_MG_MAILLAGE*)analyse_erosion->get_analyse(i));
3148     }
3149     MSTRUCT_ANALYSE_MG_MAILLAGE* nouvelle_analyse = new MSTRUCT_ANALYSE_MG_MAILLAGE(vector_analyse_compile);
3150     ajouter_analyse(nouvelle_analyse);
3151     i++;
3152     }
3153     }
3154     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_FEM)
3155     {
3156     long i=0;
3157     while(i<nb_analyse)
3158     {
3159     std::vector<MSTRUCT_ANALYSE_FEM_MAILLAGE*> vector_analyse_compile;
3160     for(it_analyse_erosion=vector_analyse.begin();it_analyse_erosion!=vector_analyse.end();it_analyse_erosion++)
3161     {
3162     MSTRUCT_ANALYSE_EROSION* analyse_erosion = *it_analyse_erosion;
3163     vector_analyse_compile.push_back((MSTRUCT_ANALYSE_FEM_MAILLAGE*)analyse_erosion->get_analyse(i));
3164     }
3165     MSTRUCT_ANALYSE_FEM_MAILLAGE* nouvelle_analyse = new MSTRUCT_ANALYSE_FEM_MAILLAGE(vector_analyse_compile);
3166     ajouter_analyse(nouvelle_analyse);
3167     i++;
3168     }
3169     }
3170 couturad 926 }
3171    
3172 couturad 930 MSTRUCT_ANALYSE_EROSION::MSTRUCT_ANALYSE_EROSION(MSTRUCT_ANALYSE_EROSION& mdd): MSTRUCT_ANALYSE(mdd)
3173 couturad 926 {
3174 couturad 930 m_nb_couche=mdd.m_nb_couche;
3175     m_epaisseur_couche=mdd.m_epaisseur_couche;
3176     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse;
3177     for(MSTRUCT_ANALYSE* analyse=mdd.get_premiere_analyse(it_analyse);analyse!=NULL;analyse=mdd.get_suivante_analyse(it_analyse))
3178     {
3179     int type_analyse=analyse->get_type();
3180     if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CHAMP) ajouter_analyse(new MSTRUCT_ANALYSE_CHAMP(*(MSTRUCT_ANALYSE_CHAMP*)analyse));
3181     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::ORIENTATION) ajouter_analyse(new MSTRUCT_ANALYSE_ORIENTATION(*(MSTRUCT_ANALYSE_ORIENTATION*)analyse));
3182     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CAO) ajouter_analyse(new MSTRUCT_ANALYSE_CAO(*(MSTRUCT_ANALYSE_CAO*)analyse));
3183     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_MG) ajouter_analyse(new MSTRUCT_ANALYSE_MG_MAILLAGE(*(MSTRUCT_ANALYSE_MG_MAILLAGE*)analyse));
3184     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_FEM) ajouter_analyse(new MSTRUCT_ANALYSE_FEM_MAILLAGE(*(MSTRUCT_ANALYSE_FEM_MAILLAGE*)analyse));
3185     }
3186 couturad 926 }
3187    
3188 couturad 930 MSTRUCT_ANALYSE_EROSION::~MSTRUCT_ANALYSE_EROSION(void)
3189 couturad 926 {
3190 couturad 930 std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse;
3191     for(MSTRUCT_ANALYSE* analyse=get_premiere_analyse(it_analyse);analyse!=NULL;analyse=get_suivante_analyse(it_analyse)) delete analyse;
3192 couturad 926 }
3193    
3194 couturad 930 long int MSTRUCT_ANALYSE_EROSION::get_nb_couche(void)
3195 couturad 926 {
3196 couturad 930 return m_nb_couche;
3197 couturad 926 }
3198    
3199 couturad 930 double MSTRUCT_ANALYSE_EROSION::get_epaisseur_couche(void)
3200 couturad 926 {
3201 couturad 930 return m_epaisseur_couche;
3202 couturad 926 }
3203    
3204 couturad 930 long int MSTRUCT_ANALYSE_EROSION::get_nb_analyse(void)
3205 couturad 926 {
3206 couturad 930 return m_vector_analyse.size();
3207 couturad 926 }
3208    
3209 couturad 930 int MSTRUCT_ANALYSE_EROSION::ajouter_analyse(MSTRUCT_ANALYSE* analyse)
3210 couturad 926 {
3211 couturad 930 m_vector_analyse.push_back(analyse);
3212 couturad 926 }
3213    
3214 couturad 930 MSTRUCT_ANALYSE* MSTRUCT_ANALYSE_EROSION::get_premiere_analyse(std::vector<MSTRUCT_ANALYSE*>::iterator& it)
3215 couturad 926 {
3216 couturad 930 it=m_vector_analyse.begin();
3217     if(it!=m_vector_analyse.end()) return *it;
3218     else return NULL;
3219 couturad 926 }
3220    
3221 couturad 930 MSTRUCT_ANALYSE* MSTRUCT_ANALYSE_EROSION::get_suivante_analyse(std::vector<MSTRUCT_ANALYSE*>::iterator& it)
3222 couturad 926 {
3223 couturad 930 it++;
3224     if(it!=m_vector_analyse.end()) return *it;
3225     else return NULL;
3226 couturad 926 }
3227    
3228 couturad 930 MSTRUCT_ANALYSE* MSTRUCT_ANALYSE_EROSION::get_analyse(long num)
3229 couturad 926 {
3230 couturad 930 return m_vector_analyse.at(num);
3231 couturad 926 }
3232    
3233 couturad 930 long int MSTRUCT_ANALYSE_EROSION::get_type(void)
3234 couturad 926 {
3235 couturad 930 return TYPE_ANALYSE::EROSION;
3236 couturad 926 }
3237    
3238 couturad 930 void MSTRUCT_ANALYSE_EROSION::executer(MSTRUCT_VES* ves)
3239 couturad 926 {
3240 couturad 930 std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse;
3241     for(MSTRUCT_ANALYSE* analyse=get_premiere_analyse(it_analyse);analyse!=NULL;analyse=get_suivante_analyse(it_analyse)) analyse->executer(ves);
3242 couturad 926 }
3243    
3244 couturad 930 void MSTRUCT_ANALYSE_EROSION::exporter(ofstream& ofstrm, long int i, bool avec_histo, char* prefix_histo)
3245 couturad 926 {
3246 couturad 930 std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse;
3247     for(MSTRUCT_ANALYSE* analyse=get_premiere_analyse(it_analyse);analyse!=NULL;analyse=get_suivante_analyse(it_analyse))
3248     {
3249     ofstrm << analyse->get_identifiant() << std::endl;
3250     analyse->exporter(ofstrm,i,avec_histo,prefix_histo);
3251     }
3252 couturad 926 }
3253    
3254 couturad 930 void MSTRUCT_ANALYSE_EROSION::enregistrer(ofstream& ofstrm)
3255 couturad 926 {
3256 couturad 930 long type_analyse=get_type();
3257     ofstrm.write((char*)&type_analyse,sizeof(long));
3258     MICROSTRUCTURE::MSTRUCT_ANALYSE::enregistrer(ofstrm);
3259     ofstrm.write((char*)&m_nb_couche,sizeof(long));
3260     ofstrm.write((char*)&m_epaisseur_couche,sizeof(double));
3261     long nb_analyse=get_nb_analyse();
3262     ofstrm.write((char*)&nb_analyse,sizeof(long));
3263     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse;
3264     for(MSTRUCT_ANALYSE* analyse=get_premiere_analyse(it_analyse);analyse!=NULL;analyse=get_suivante_analyse(it_analyse)) analyse->enregistrer(ofstrm);
3265 couturad 926 }
3266    
3267 couturad 930 void MSTRUCT_ANALYSE_EROSION::ouvrir(ifstream& ifstrm)
3268 couturad 926 {
3269 couturad 930 MICROSTRUCTURE::MSTRUCT_ANALYSE::ouvrir(ifstrm);
3270     ifstrm.read((char*)&m_nb_couche,sizeof(long));
3271     ifstrm.read((char*)&m_epaisseur_couche,sizeof(double));
3272     long nb_analyse;
3273     ifstrm.read((char*)&nb_analyse,sizeof(long));
3274     for(long i=0;i<nb_analyse;i++)
3275     {
3276     long type_analyse;
3277     ifstrm.read((char*)&type_analyse,sizeof(long));
3278     MSTRUCT_ANALYSE *analyse;
3279     if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CHAMP)
3280     {
3281     analyse = new MSTRUCT_ANALYSE_CHAMP;
3282     analyse->ouvrir(ifstrm);
3283     }
3284     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::ORIENTATION)
3285     {
3286     analyse = new MSTRUCT_ANALYSE_ORIENTATION;
3287     analyse->ouvrir(ifstrm);
3288     }
3289     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CAO)
3290     {
3291     analyse = new MSTRUCT_ANALYSE_CAO;
3292     analyse->ouvrir(ifstrm);
3293     }
3294     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_MG)
3295     {
3296     analyse = new MSTRUCT_ANALYSE_MG_MAILLAGE;
3297     analyse->ouvrir(ifstrm);
3298     }
3299     else if(type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_FEM)
3300     {
3301     analyse = new MSTRUCT_ANALYSE_FEM_MAILLAGE;
3302     analyse->ouvrir(ifstrm);
3303     }
3304     ajouter_analyse(analyse);
3305     }
3306 couturad 926 }
3307    
3308 couturad 930 void MSTRUCT_ANALYSE_EROSION::affiche_contenu(MICROSTRUCTURE::fonction_affiche* fonc)
3309 couturad 926 {
3310 couturad 930 MICROSTRUCTURE::MSTRUCT_ANALYSE::affiche_contenu(fonc);
3311     char ligne[5000];
3312     sprintf(ligne,"MSTRUCT_ANALYSE_EROSION");fonc(ligne);
3313     sprintf(ligne,"-> Nb analyse : %li",get_nb_analyse());fonc(ligne);
3314     sprintf(ligne,"-> Nb couche : %li",m_nb_couche);fonc(ligne);
3315     sprintf(ligne,"-> Epaisseur couche : %lf",m_epaisseur_couche);fonc(ligne);
3316     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse;
3317     for(MSTRUCT_ANALYSE* analyse=get_premiere_analyse(it_analyse);analyse!=NULL;analyse=get_suivante_analyse(it_analyse))
3318     {
3319     analyse->affiche_contenu(fonc);
3320     }
3321 couturad 926 }
3322    
3323    
3324 couturad 930 MSTRUCT_ANALYSE_MODULES_MECA::MSTRUCT_ANALYSE_MODULES_MECA(MSTRUCT_ANALYSE_CHAMP* epsilon_sph,
3325     MSTRUCT_ANALYSE_CHAMP* sigma_sph,
3326     MSTRUCT_ANALYSE_CHAMP* epsilon_dev,
3327     MSTRUCT_ANALYSE_CHAMP* sigma_dev,
3328     double largeur_colonne_distribution_module_Kapp,
3329     double largeur_colonne_distribution_module_Gapp,
3330     double largeur_colonne_distribution_module_Eapp,
3331     double largeur_colonne_distribution_module_Nuapp)
3332     {
3333     m_Kapp_moyenne=0;
3334     m_Kapp_ecart_type=0;
3335     m_Kapp_min=0.0;
3336     m_Kapp_max=0.0;
3337     m_Kapp_histogramme.fixe_largeur_colonne(largeur_colonne_distribution_module_Kapp);
3338     m_Gapp_moyenne=0;
3339     m_Gapp_ecart_type=0;
3340     m_Gapp_min=0.0;
3341     m_Gapp_max=0.0;
3342     m_Gapp_histogramme.fixe_largeur_colonne(largeur_colonne_distribution_module_Gapp);
3343     m_Eapp_moyenne=0;
3344     m_Eapp_ecart_type=0;
3345     m_Eapp_min=0.0;
3346     m_Eapp_max=0.0;
3347     m_Eapp_histogramme.fixe_largeur_colonne(largeur_colonne_distribution_module_Eapp);
3348     m_Nuapp_moyenne=0;
3349     m_Nuapp_ecart_type=0;
3350     m_Nuapp_min=0.0;
3351     m_Nuapp_max=0.0;
3352     m_Nuapp_histogramme.fixe_largeur_colonne(largeur_colonne_distribution_module_Nuapp);
3353     m_Kapp_moyenne = (sigma_sph->get_moyenne()[0]+sigma_sph->get_moyenne()[1]+sigma_sph->get_moyenne()[2])/(3.0*(epsilon_sph->get_moyenne()[0]+epsilon_sph->get_moyenne()[1]+epsilon_sph->get_moyenne()[2]));
3354     m_Gapp_moyenne = (1./3.)*((sigma_dev->get_moyenne()[3]/(2*epsilon_dev->get_moyenne()[3]))+
3355     (sigma_dev->get_moyenne()[4]/(2*epsilon_dev->get_moyenne()[4]))+
3356     (sigma_dev->get_moyenne()[5]/(2*epsilon_dev->get_moyenne()[5])));
3357     m_Eapp_moyenne = (9.0*m_Kapp_moyenne*m_Gapp_moyenne)/(3.0*m_Kapp_moyenne+m_Gapp_moyenne);
3358     m_Nuapp_moyenne = (3.0*m_Kapp_moyenne-2.0*m_Gapp_moyenne)/(2.0*(3.0*m_Kapp_moyenne+m_Gapp_moyenne));
3359    
3360     m_Kapp_ecart_type=m_Kapp_moyenne;
3361     m_Kapp_min=m_Kapp_moyenne;
3362     m_Kapp_max=m_Kapp_moyenne;
3363    
3364     m_Gapp_ecart_type=m_Gapp_moyenne;
3365     m_Gapp_min=m_Gapp_moyenne;
3366     m_Gapp_max=m_Gapp_moyenne;
3367    
3368     m_Eapp_ecart_type=m_Eapp_moyenne;
3369     m_Eapp_min=m_Eapp_moyenne;
3370     m_Eapp_max=m_Eapp_moyenne;
3371    
3372     m_Nuapp_ecart_type=m_Nuapp_moyenne;
3373     m_Nuapp_min=m_Nuapp_moyenne;
3374     m_Nuapp_max=m_Nuapp_moyenne;
3375     }
3376 couturad 926
3377 couturad 930 MSTRUCT_ANALYSE_MODULES_MECA::MSTRUCT_ANALYSE_MODULES_MECA(std::vector< MSTRUCT_ANALYSE_MODULES_MECA* >& vector_analyse)
3378     {
3379     std::vector<MSTRUCT_ANALYSE_MODULES_MECA*>::iterator it_analyse=vector_analyse.begin();
3380     MSTRUCT_ANALYSE_MODULES_MECA* analyse=*it_analyse;
3381     m_Kapp_histogramme.fixe_largeur_colonne(analyse->get_Kapp_histogramme()->get_largeur_colonne());
3382     m_Gapp_histogramme.fixe_largeur_colonne(analyse->get_Gapp_histogramme()->get_largeur_colonne());
3383     m_Eapp_histogramme.fixe_largeur_colonne(analyse->get_Eapp_histogramme()->get_largeur_colonne());
3384     m_Nuapp_histogramme.fixe_largeur_colonne(analyse->get_Nuapp_histogramme()->get_largeur_colonne());
3385     m_Kapp_moyenne=0;
3386     m_Kapp_ecart_type=0;
3387     m_Kapp_min=numeric_limits<double>::max();
3388     m_Kapp_max=numeric_limits<double>::min();
3389     m_Gapp_moyenne=0;
3390     m_Gapp_ecart_type=0;
3391     m_Gapp_min=numeric_limits<double>::max();
3392     m_Gapp_max=numeric_limits<double>::min();
3393     m_Eapp_moyenne=0;
3394     m_Eapp_ecart_type=0;
3395     m_Eapp_min=numeric_limits<double>::max();
3396     m_Eapp_max=numeric_limits<double>::min();
3397     m_Nuapp_moyenne=0;
3398     m_Nuapp_ecart_type=0;
3399     m_Nuapp_min=numeric_limits<double>::max();
3400     m_Nuapp_max=numeric_limits<double>::min();
3401     m_nb_ves=vector_analyse.size();
3402     for(it_analyse=vector_analyse.begin();it_analyse!=vector_analyse.end();it_analyse++)
3403     {
3404     analyse=*it_analyse;
3405     m_Kapp_moyenne+=analyse->get_Kapp_moyenne();
3406     if(analyse->get_Kapp_moyenne()<m_Kapp_min) m_Kapp_min=analyse->get_Kapp_moyenne();
3407     if(analyse->get_Kapp_moyenne()>m_Kapp_max) m_Kapp_max=analyse->get_Kapp_moyenne();
3408     m_Kapp_histogramme.ajouter_valeur(analyse->get_Kapp_moyenne(),1.0/m_nb_ves);
3409    
3410     m_Gapp_moyenne+=analyse->get_Gapp_moyenne();
3411     if(analyse->get_Gapp_moyenne()<m_Gapp_min) m_Gapp_min=analyse->get_Gapp_moyenne();
3412     if(analyse->get_Gapp_moyenne()>m_Gapp_max) m_Gapp_max=analyse->get_Gapp_moyenne();
3413     m_Gapp_histogramme.ajouter_valeur(analyse->get_Gapp_moyenne(),1.0/m_nb_ves);
3414    
3415     m_Eapp_moyenne+=analyse->get_Eapp_moyenne();
3416     if(analyse->get_Eapp_moyenne()<m_Eapp_min) m_Eapp_min=analyse->get_Eapp_moyenne();
3417     if(analyse->get_Eapp_moyenne()>m_Eapp_max) m_Eapp_max=analyse->get_Eapp_moyenne();
3418     m_Eapp_histogramme.ajouter_valeur(analyse->get_Eapp_moyenne(),1.0/m_nb_ves);
3419    
3420     m_Nuapp_moyenne+=analyse->get_Nuapp_moyenne();
3421     if(analyse->get_Nuapp_moyenne()<m_Nuapp_min) m_Nuapp_min=analyse->get_Nuapp_moyenne();
3422     if(analyse->get_Nuapp_moyenne()>m_Nuapp_max) m_Nuapp_max=analyse->get_Nuapp_moyenne();
3423     m_Nuapp_histogramme.ajouter_valeur(analyse->get_Nuapp_moyenne(),1.0/m_nb_ves);
3424     }
3425     m_Kapp_moyenne=m_Kapp_moyenne/m_nb_ves;
3426     m_Gapp_moyenne=m_Gapp_moyenne/m_nb_ves;
3427     m_Eapp_moyenne=m_Eapp_moyenne/m_nb_ves;
3428     m_Nuapp_moyenne=m_Nuapp_moyenne/m_nb_ves;
3429     for(it_analyse=vector_analyse.begin();it_analyse!=vector_analyse.end();it_analyse++)
3430     {
3431     m_Kapp_ecart_type+=(analyse->get_Kapp_moyenne()-m_Kapp_moyenne)*(analyse->get_Kapp_moyenne()-m_Kapp_moyenne);
3432     m_Gapp_ecart_type+=(analyse->get_Gapp_moyenne()-m_Gapp_moyenne)*(analyse->get_Gapp_moyenne()-m_Gapp_moyenne);
3433     m_Eapp_ecart_type+=(analyse->get_Eapp_moyenne()-m_Eapp_moyenne)*(analyse->get_Eapp_moyenne()-m_Eapp_moyenne);
3434     m_Nuapp_ecart_type+=(analyse->get_Nuapp_moyenne()-m_Nuapp_moyenne)*(analyse->get_Nuapp_moyenne()-m_Nuapp_moyenne);
3435     }
3436     m_Kapp_ecart_type=sqrt(m_Kapp_ecart_type*(1.0/(m_nb_ves-1.0)));
3437     m_Gapp_ecart_type=sqrt(m_Gapp_ecart_type*(1.0/(m_nb_ves-1.0)));
3438     m_Eapp_ecart_type=sqrt(m_Eapp_ecart_type*(1.0/(m_nb_ves-1.0)));
3439     m_Nuapp_ecart_type=sqrt(m_Nuapp_ecart_type*(1.0/(m_nb_ves-1.0)));
3440     }
3441 couturad 926
3442 couturad 930 MSTRUCT_ANALYSE_MODULES_MECA::~MSTRUCT_ANALYSE_MODULES_MECA(void)
3443     {
3444     }
3445 couturad 926
3446 couturad 930 long int MSTRUCT_ANALYSE_MODULES_MECA::get_nb_ves(void)
3447     {
3448     return m_nb_ves;
3449     }
3450 couturad 926
3451 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Kapp_moyenne(void)
3452     {
3453     return m_Kapp_moyenne;
3454     }
3455 couturad 926
3456 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Kapp_ecart_type(void)
3457     {
3458     return m_Kapp_ecart_type;
3459     }
3460 couturad 926
3461 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Kapp_min(void)
3462     {
3463     return m_Kapp_min;
3464     }
3465 couturad 926
3466 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Kapp_max(void)
3467     {
3468     return m_Kapp_max;
3469     }
3470 couturad 926
3471 couturad 930 OT_HISTOGRAMME* MSTRUCT_ANALYSE_MODULES_MECA::get_Kapp_histogramme(void)
3472     {
3473     return &m_Kapp_histogramme;
3474     }
3475 couturad 926
3476 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Gapp_moyenne(void)
3477     {
3478     return m_Gapp_moyenne;
3479     }
3480 couturad 926
3481 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Gapp_ecart_type(void)
3482     {
3483     return m_Gapp_ecart_type;
3484     }
3485 couturad 926
3486 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Gapp_min(void)
3487     {
3488     return m_Gapp_min;
3489     }
3490 couturad 926
3491 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Gapp_max(void)
3492     {
3493     return m_Gapp_max;
3494     }
3495 couturad 926
3496 couturad 930 OT_HISTOGRAMME* MSTRUCT_ANALYSE_MODULES_MECA::get_Gapp_histogramme(void)
3497     {
3498     return &m_Gapp_histogramme;
3499     }
3500 couturad 926
3501 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Nuapp_moyenne(void)
3502     {
3503     return m_Nuapp_moyenne;
3504     }
3505 couturad 926
3506 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Nuapp_ecart_type(void)
3507     {
3508     return m_Nuapp_ecart_type;
3509     }
3510 couturad 926
3511 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Nuapp_min(void)
3512     {
3513     return m_Nuapp_min;
3514     }
3515 couturad 926
3516 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Nuapp_max(void)
3517     {
3518     return m_Nuapp_max;
3519     }
3520 couturad 926
3521 couturad 930 OT_HISTOGRAMME* MSTRUCT_ANALYSE_MODULES_MECA::get_Nuapp_histogramme(void)
3522     {
3523     return &m_Nuapp_histogramme;
3524     }
3525 couturad 926
3526 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Eapp_moyenne(void)
3527     {
3528     return m_Eapp_moyenne;
3529     }
3530 couturad 926
3531 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Eapp_ecart_type(void)
3532     {
3533     return m_Eapp_ecart_type;
3534     }
3535 couturad 926
3536 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::get_Eapp_min(void)
3537     {
3538     return m_Eapp_min;
3539     }
3540 couturad 926
3541 couturad 930 double MSTRUCT_ANALYSE_MODULES_MECA::v_Eapp_max(void)
3542     {
3543     return m_Eapp_max;
3544     }
3545 couturad 926
3546 couturad 930 OT_HISTOGRAMME* MSTRUCT_ANALYSE_MODULES_MECA::get_Eapp_histogramme(void)
3547     {
3548     return &m_Eapp_histogramme;
3549     }
3550 couturad 926
3551 couturad 930 void MSTRUCT_ANALYSE_MODULES_MECA::exporter(ofstream& ofstrm, long int i, bool avec_histo, char* prefix_histo)
3552     {
3553 couturad 931 if(i==1) ofstrm << "#(1) Eapp[moy(2) ±(3) min(4) max(5)] Nuapp[moy(6) ±(7) min(8) max(9)] Gapp[moy(10) ±(11) min(12) max(13)] Kapp[moy(14) ±(15) min(16) max(17)]" << std::endl;
3554     ofstrm << i << " "
3555     << m_Eapp_moyenne << " "
3556 couturad 930 << m_Eapp_ecart_type << " "
3557     << m_Eapp_min << " "
3558     << m_Eapp_max << " "
3559     << m_Nuapp_moyenne << " "
3560     << m_Nuapp_ecart_type << " "
3561     << m_Nuapp_min << " "
3562     << m_Nuapp_max << " "
3563     << m_Gapp_moyenne << " "
3564     << m_Gapp_ecart_type << " "
3565     << m_Gapp_min << " "
3566     << m_Gapp_max << " "
3567     << m_Kapp_moyenne << " "
3568     << m_Kapp_ecart_type << " "
3569     << m_Kapp_min << " "
3570     << m_Kapp_max << std::endl;
3571     if(avec_histo)
3572     {
3573     char nom_fichier[500];
3574     sprintf(nom_fichier,"%shisto_Eapp.txt",prefix_histo);
3575     ofstream of_histo_Eapp(nom_fichier,std::ios::out|std::ios::trunc);
3576     of_histo_Eapp.precision(16);
3577     of_histo_Eapp.setf(std::ios::showpoint);
3578     m_Eapp_histogramme.exporter(of_histo_Eapp);
3579     of_histo_Eapp.close();
3580    
3581     sprintf(nom_fichier,"%shisto_Nuapp.txt",prefix_histo);
3582     ofstream of_histo_Nuapp(nom_fichier,std::ios::out|std::ios::trunc);
3583     of_histo_Nuapp.precision(16);
3584     of_histo_Nuapp.setf(std::ios::showpoint);
3585     m_Nuapp_histogramme.exporter(of_histo_Nuapp);
3586     of_histo_Nuapp.close();
3587    
3588     sprintf(nom_fichier,"%shisto_Gapp.txt",prefix_histo);
3589     ofstream of_histo_Gapp(nom_fichier,std::ios::out|std::ios::trunc);
3590     of_histo_Gapp.precision(16);
3591     of_histo_Gapp.setf(std::ios::showpoint);
3592     m_Gapp_histogramme.exporter(of_histo_Gapp);
3593     of_histo_Gapp.close();
3594    
3595     sprintf(nom_fichier,"%shisto_Kapp.txt",prefix_histo);
3596     ofstream of_histo_Kapp(nom_fichier,std::ios::out|std::ios::trunc);
3597     of_histo_Kapp.precision(16);
3598     of_histo_Kapp.setf(std::ios::showpoint);
3599     m_Kapp_histogramme.exporter(of_histo_Kapp);
3600     of_histo_Kapp.close();
3601     }
3602     }
3603 couturad 926
3604