ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/microstructure/src/mstruct_analyse.cpp
Revision: 965
Committed: Tue Sep 4 14:33:33 2018 UTC (6 years, 8 months ago) by couturad
File size: 151038 byte(s)
Log Message:
Ajout d'include manquant.

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