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