ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/microstructure/src/mstruct_analyse.cpp
Revision: 951
Committed: Fri Aug 10 15:17:17 2018 UTC (6 years, 9 months ago) by couturad
File size: 151019 byte(s)
Log Message:
-> Ajout de Project Chrono (voir CMakeLists.txt).
-> Ajout d'un générateur de microstructure basé sur la dynamique des corps rigides (MSTRUCT_GENERATEUR_DCR).
-> Ajout d'un opérateur de décallage de la topologie (MG_CG_OP_TRANSF_DECALLAGE).
-> Retrait de «using namespace std»  (conflit avec namespace chrono) et modification des fichiers affectés.
-> Modification de mailleur2d.cpp afin d'enregistrer un fichier MAGiC (void.magic) lorsque le nombre d'itération dépasse la valeur maximale.

File Contents

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