ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/microstructure/src/mstruct_analyse.cpp
Revision: 966
Committed: Thu Sep 6 16:46:34 2018 UTC (6 years, 8 months ago) by couturad
File size: 166277 byte(s)
Log Message:
Ajout de l'histogramme a MAGIC_PLOT
Ajout d'une sortie OK ou FAIL (int) au MAILLEUR afin de gerer certaines exceptions
Ajout d'une phase RSA a la fin du generateur DCR

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