ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/microstructure/src/mstruct_ver.cpp
Revision: 968
Committed: Sun Sep 16 15:27:49 2018 UTC (6 years, 7 months ago) by couturad
File size: 28570 byte(s)
Log Message:
Ajout d'une condition de sortie et d'un renvoi d'erreur pour le mailleur FEM.
Subdivision des fichiers mstruct_analyse.h/.cpp en sous fichiers pour une meilleure lisibilite.
Ajout d'une analyse des modules d'elasticite.
Ajout d'une analyse de l'energie.
Reconfiguration du main de microstructure.exe (suppression d'actions obsolètes).
Reconfiguration des fichiers generer_nb_ves, post_process.

File Contents

# User Rev Content
1 couturad 919 #include "mstruct_ver.h"
2 couturad 926 #include "mstruct_ves_file.h"
3 couturad 968 #include "mstruct_analyse_champ.h"
4     #include "mstruct_analyse_orientation.h"
5     #include "mstruct_analyse_cao.h"
6     #include "mstruct_analyse_mg_maillage.h"
7     #include "mstruct_analyse_fem_maillage.h"
8     #include "mstruct_analyse_modules_elasticite.h"
9     #include "mstruct_analyse_erosion.h"
10 couturad 919
11 couturad 968 #include "mstruct_analyse_liste_champ.h"
12     #include "mstruct_analyse_liste_orientation.h"
13     #include "mstruct_analyse_liste_cao.h"
14     #include "mstruct_analyse_liste_mg_maillage.h"
15     #include "mstruct_analyse_liste_fem_maillage.h"
16     #include "mstruct_analyse_liste_modules_elasticite.h"
17    
18     #include "mg_definition.h"
19     #include "mstruct_definition.h"
20     #include <string.h>
21 couturad 926 MSTRUCT_VER::MSTRUCT_VER(void)
22 couturad 919 {
23    
24     }
25    
26 couturad 926 MSTRUCT_VER::~MSTRUCT_VER(void)
27 couturad 919 {
28    
29     }
30    
31 couturad 951 void MSTRUCT_VER::active_affichage(fonction_affiche* fonc)
32 couturad 919 {
33     fonc_affiche = fonc;
34     affichageactif = 1;
35     }
36    
37 couturad 926 void MSTRUCT_VER::affiche(char* message)
38 couturad 919 {
39     if(affichageactif==1) fonc_affiche(message);
40     }
41    
42 couturad 968 int MSTRUCT_VER::cumuler_post_traitement(char* fichier_liste_ves,
43     std::vector<OT_PARAMETRES *>& vector_params_analyse,
44     char* dossier_resultat,
45     bool avec_graph)
46 couturad 927 {
47     char message[5000];
48     std::map<long,MSTRUCT_VES_FILE*> map_ves_file;
49     std::ifstream f;
50 couturad 951 f.open(fichier_liste_ves,std::ios::in);
51 couturad 927 char ligne[1000];
52     f.getline(ligne,1000);
53     long i=0;
54     while(!f.eof())
55     {
56 couturad 968 char nom_fichier_ves[1000];
57     sscanf(ligne,"%s",nom_fichier_ves);
58     if(strlen(nom_fichier_ves)==0) continue;
59 couturad 927 MSTRUCT_VES_FILE *ves_file=new MSTRUCT_VES_FILE;
60 couturad 968 if(ves_file->ouvrir(nom_fichier_ves)==FAIL) return FAIL;
61 couturad 927 map_ves_file.insert(std::pair<long,MSTRUCT_VES_FILE*>(i,ves_file));
62     i++;
63     f.getline(ligne,1000);
64     }
65     f.close();
66     long nb_ves = map_ves_file.size();
67     sprintf(message,"NB_VES : %li",nb_ves); affiche(message);
68     std::vector<OT_PARAMETRES*>::iterator it;
69     for(it=vector_params_analyse.begin();it!=vector_params_analyse.end();it++)
70     {
71     OT_PARAMETRES* param = *it;
72 couturad 968 int Type_post_traitement = (int)param->get_valeur((char*)"Type_post_traitement");
73     std::string Identifiant = param->get_nom((char*)"Identifiant");
74     if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP ||
75     Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP_NORMALISE ||
76     Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP_ECART ||
77     Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP_ECART_CHARGEMENT)
78 couturad 927 {
79 couturad 968 sprintf(ligne,"-> %s",Identifiant.c_str());
80     affiche(ligne);
81     int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
82     if(Analyse_erosion)
83 couturad 927 {
84 couturad 968 char nom_fichier_resultat_cumul_erosion[1000];
85     sprintf(nom_fichier_resultat_cumul_erosion,"%s/cumul_erosion_%s.txt",dossier_resultat,Identifiant.c_str());
86     std::ofstream ofstrm_cumul_erosion(nom_fichier_resultat_cumul_erosion,std::ios::out);
87     int Nb_couche = (int)param->get_valeur((char*)"Nb_couche");
88     for(int i=0;i<Nb_couche;i++)
89     {
90     char syscmd_mkdir_erosion_couche[1000];
91     sprintf(syscmd_mkdir_erosion_couche,"mkdir -p %s/c_%i",dossier_resultat,i);
92     system(syscmd_mkdir_erosion_couche);
93     std::vector<MSTRUCT_ANALYSE*> vector_analyse;
94     std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file;
95     for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++)
96     {
97     MSTRUCT_VES_FILE *ves_file=it_ves_file->second;
98     MSTRUCT_ANALYSE_EROSION* analyse_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_file->get_analyse(Identifiant);
99     vector_analyse.push_back(analyse_erosion->get_analyse(i));
100     }
101     MSTRUCT_ANALYSE_LISTE_CHAMP analyse_liste_champ(Identifiant,vector_analyse);
102     char nom_fichier_resultat_liste[1000];
103     sprintf(nom_fichier_resultat_liste,"%s/c_%i/liste_%s.txt",dossier_resultat,i,Identifiant.c_str());
104     std::ofstream ofstrm_liste(nom_fichier_resultat_liste,std::ios::out);
105     ofstrm_liste.precision(16);
106     analyse_liste_champ.exporter_liste(ofstrm_liste,true);
107     ofstrm_liste.close();
108     char nom_fichier_resultat_cumul[1000];
109     sprintf(nom_fichier_resultat_cumul,"%s/c_%i/cumul_%s.txt",dossier_resultat,i,Identifiant.c_str());
110     char prefix_graph[1000];
111     sprintf(prefix_graph,"%s/c_%i",dossier_resultat,i);
112     std::ofstream ofstrm_cumul(nom_fichier_resultat_cumul,std::ios::out);
113     ofstrm_cumul.precision(16);
114     analyse_liste_champ.exporter_cumul(ofstrm_cumul,true,avec_graph,prefix_graph);
115     ofstrm_cumul.close();
116     if(i==0) analyse_liste_champ.exporter_cumul_i(ofstrm_cumul_erosion,i,true);
117     else analyse_liste_champ.exporter_cumul_i(ofstrm_cumul_erosion,i,false);
118     }
119     ofstrm_cumul_erosion.close();
120 couturad 927 }
121 couturad 931 else
122     {
123 couturad 968 std::vector<MSTRUCT_ANALYSE*> vector_analyse;
124     std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file;
125     for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++)
126     {
127     MSTRUCT_VES_FILE *ves_file=it_ves_file->second;
128     vector_analyse.push_back(ves_file->get_analyse(Identifiant));
129     }
130     MSTRUCT_ANALYSE_LISTE_CHAMP analyse_liste_champ(Identifiant,vector_analyse);
131     char nom_fichier_resultat_liste[1000];
132     sprintf(nom_fichier_resultat_liste,"%s/liste_%s.txt",dossier_resultat,Identifiant.c_str());
133     std::ofstream ofstrm_liste(nom_fichier_resultat_liste,std::ios::out);
134     ofstrm_liste.precision(16);
135     analyse_liste_champ.exporter_liste(ofstrm_liste,true);
136     ofstrm_liste.close();
137     char nom_fichier_resultat_cumul[1000];
138     sprintf(nom_fichier_resultat_cumul,"%s/cumul_%s.txt",dossier_resultat,Identifiant.c_str());
139     std::ofstream ofstrm_cumul(nom_fichier_resultat_cumul,std::ios::out);
140     ofstrm_cumul.precision(16);
141     analyse_liste_champ.exporter_cumul(ofstrm_cumul,true,avec_graph,dossier_resultat);
142     ofstrm_cumul.close();
143 couturad 926 }
144 couturad 919 }
145 couturad 968 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_ORIENTATION ||
146     Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_ORIENTATION_ECART)
147 couturad 919 {
148 couturad 968 sprintf(ligne,"-> %s",Identifiant.c_str());
149     affiche(ligne);
150     int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
151     if(Analyse_erosion)
152 couturad 926 {
153 couturad 968 char nom_fichier_resultat_cumul_erosion[1000];
154     sprintf(nom_fichier_resultat_cumul_erosion,"%s/cumul_erosion_%s.txt",dossier_resultat,Identifiant.c_str());
155     std::ofstream ofstrm_cumul_erosion(nom_fichier_resultat_cumul_erosion,std::ios::out);
156     int Nb_couche = (int)param->get_valeur((char*)"Nb_couche");
157     for(int i=0;i<Nb_couche;i++)
158     {
159     char syscmd_mkdir_erosion_couche[1000];
160     sprintf(syscmd_mkdir_erosion_couche,"mkdir -p %s/c_%i",dossier_resultat,i);
161     system(syscmd_mkdir_erosion_couche);
162     std::vector<MSTRUCT_ANALYSE*> vector_analyse;
163     std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file;
164     for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++)
165     {
166     MSTRUCT_VES_FILE *ves_file=it_ves_file->second;
167     MSTRUCT_ANALYSE_EROSION* analyse_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_file->get_analyse(Identifiant);
168     vector_analyse.push_back(analyse_erosion->get_analyse(i));
169     }
170     MSTRUCT_ANALYSE_LISTE_ORIENTATION analyse_liste_orientation(Identifiant,vector_analyse);
171     char nom_fichier_resultat_liste[1000];
172     sprintf(nom_fichier_resultat_liste,"%s/c_%i/liste_%s.txt",dossier_resultat,i,Identifiant.c_str());
173     std::ofstream ofstrm_liste(nom_fichier_resultat_liste,std::ios::out);
174     ofstrm_liste.precision(16);
175     analyse_liste_orientation.exporter_liste(ofstrm_liste,true);
176     ofstrm_liste.close();
177     char nom_fichier_resultat_cumul[1000];
178     sprintf(nom_fichier_resultat_cumul,"%s/c_%i/cumul_%s.txt",dossier_resultat,i,Identifiant.c_str());
179     char prefix_graph[1000];
180     sprintf(prefix_graph,"%s/c_%i",dossier_resultat,i);
181     std::ofstream ofstrm_cumul(nom_fichier_resultat_cumul,std::ios::out);
182     ofstrm_cumul.precision(16);
183     analyse_liste_orientation.exporter_cumul(ofstrm_cumul,true,avec_graph,prefix_graph);
184     ofstrm_cumul.close();
185     if(i==0) analyse_liste_orientation.exporter_cumul_i(ofstrm_cumul_erosion,i,true);
186     else analyse_liste_orientation.exporter_cumul_i(ofstrm_cumul_erosion,i,false);
187     }
188     ofstrm_cumul_erosion.close();
189 couturad 926 }
190 couturad 931 else
191 couturad 926 {
192 couturad 968 std::vector<MSTRUCT_ANALYSE*> vector_analyse;
193     std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file;
194     for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++)
195     {
196     MSTRUCT_VES_FILE *ves_file=it_ves_file->second;
197     vector_analyse.push_back(ves_file->get_analyse(Identifiant));
198     }
199     MSTRUCT_ANALYSE_LISTE_ORIENTATION analyse_liste_orientation(Identifiant,vector_analyse);
200     char nom_fichier_resultat_liste[1000];
201     sprintf(nom_fichier_resultat_liste,"%s/liste_%s.txt",dossier_resultat,Identifiant.c_str());
202     std::ofstream ofstrm_liste(nom_fichier_resultat_liste,std::ios::out);
203     ofstrm_liste.precision(16);
204     analyse_liste_orientation.exporter_liste(ofstrm_liste,true);
205     ofstrm_liste.close();
206     char nom_fichier_resultat_cumul[1000];
207     sprintf(nom_fichier_resultat_cumul,"%s/cumul_%s.txt",dossier_resultat,Identifiant.c_str());
208     std::ofstream ofstrm_cumul(nom_fichier_resultat_cumul,std::ios::out);
209     ofstrm_cumul.precision(16);
210     analyse_liste_orientation.exporter_cumul(ofstrm_cumul,true,avec_graph,dossier_resultat);
211     ofstrm_cumul.close();
212     }
213 couturad 919 }
214 couturad 968 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CAO)
215 couturad 938 {
216 couturad 968 sprintf(ligne,"-> %s",Identifiant.c_str());
217     affiche(ligne);
218     double Largeur_colonne_distribution_nb_volume = param->get_valeur((char*)"Largeur_colonne_distribution_nb_volume");
219     double Largeur_colonne_distribution_nb_forme = param->get_valeur((char*)"Largeur_colonne_distribution_nb_forme");
220     double Largeur_colonne_distribution_volume = param->get_valeur((char*)"Largeur_colonne_distribution_volume");
221     double Largeur_colonne_distribution_fraction_volumique = param->get_valeur((char*)"Largeur_colonne_distribution_fraction_volumique");
222     std::vector<MSTRUCT_ANALYSE*> vector_analyse;
223     std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file;
224     for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++)
225 couturad 938 {
226 couturad 968 MSTRUCT_VES_FILE *ves_file=it_ves_file->second;
227     vector_analyse.push_back(ves_file->get_analyse(Identifiant));
228 couturad 938 }
229 couturad 968 MSTRUCT_ANALYSE_LISTE_CAO analyse_liste_cao(Identifiant,
230     vector_analyse,
231     Largeur_colonne_distribution_nb_forme,
232     Largeur_colonne_distribution_nb_volume,
233     Largeur_colonne_distribution_volume,
234     Largeur_colonne_distribution_fraction_volumique);
235     char nom_fichier_resultat_liste[1000];
236     sprintf(nom_fichier_resultat_liste,"%s/liste_%s.txt",dossier_resultat,Identifiant.c_str());
237     std::ofstream ofstrm_liste(nom_fichier_resultat_liste,std::ios::out);
238     ofstrm_liste.precision(16);
239     analyse_liste_cao.exporter_liste(ofstrm_liste,true);
240     ofstrm_liste.close();
241     char nom_fichier_resultat_cumul[1000];
242     sprintf(nom_fichier_resultat_cumul,"%s/cumul_%s.txt",dossier_resultat,Identifiant.c_str());
243     std::ofstream ofstrm_cumul(nom_fichier_resultat_cumul,std::ios::out);
244     ofstrm_cumul.precision(16);
245     analyse_liste_cao.exporter_cumul(ofstrm_cumul,true,avec_graph,dossier_resultat);
246     ofstrm_cumul.close();
247 couturad 938 }
248 couturad 968 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_MAILLAGE_MG)
249 couturad 919 {
250 couturad 968 sprintf(ligne,"-> %s",Identifiant.c_str());
251     affiche(ligne);
252     double Largeur_colonne_distribution_nb_element_2D = param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_2D");
253     double Largeur_colonne_distribution_nb_element_3D = param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_3D");
254     double Largeur_colonne_distribution_volume = param->get_valeur((char*)"Largeur_colonne_distribution_volume");
255     double Largeur_colonne_distribution_fraction_volumique = param->get_valeur((char*)"Largeur_colonne_distribution_fraction_volumique");
256     int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
257     if(Analyse_erosion)
258 couturad 926 {
259 couturad 968 char nom_fichier_resultat_cumul_erosion[1000];
260     sprintf(nom_fichier_resultat_cumul_erosion,"%s/cumul_erosion_%s.txt",dossier_resultat,Identifiant.c_str());
261     std::ofstream ofstrm_cumul_erosion(nom_fichier_resultat_cumul_erosion,std::ios::out);
262     int Nb_couche = (int)param->get_valeur((char*)"Nb_couche");
263     for(int i=0;i<Nb_couche;i++)
264     {
265     char syscmd_mkdir_erosion_couche[1000];
266     sprintf(syscmd_mkdir_erosion_couche,"mkdir -p %s/c_%i",dossier_resultat,i);
267     system(syscmd_mkdir_erosion_couche);
268     std::vector<MSTRUCT_ANALYSE*> vector_analyse;
269     std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file;
270     for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++)
271     {
272     MSTRUCT_VES_FILE *ves_file=it_ves_file->second;
273     MSTRUCT_ANALYSE_EROSION* analyse_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_file->get_analyse(Identifiant);
274     vector_analyse.push_back(analyse_erosion->get_analyse(i));
275     }
276     MSTRUCT_ANALYSE_LISTE_MG_MAILLAGE analyse_liste_mg_maillage(Identifiant,
277     vector_analyse,
278     Largeur_colonne_distribution_nb_element_2D,
279     Largeur_colonne_distribution_nb_element_3D,
280     Largeur_colonne_distribution_volume,
281     Largeur_colonne_distribution_fraction_volumique);
282     char nom_fichier_resultat_liste[1000];
283     sprintf(nom_fichier_resultat_liste,"%s/c_%i/liste_%s.txt",dossier_resultat,i,Identifiant.c_str());
284     std::ofstream ofstrm_liste(nom_fichier_resultat_liste,std::ios::out);
285     ofstrm_liste.precision(16);
286     analyse_liste_mg_maillage.exporter_liste(ofstrm_liste,true);
287     ofstrm_liste.close();
288     char nom_fichier_resultat_cumul[1000];
289     sprintf(nom_fichier_resultat_cumul,"%s/c_%i/cumul_%s.txt",dossier_resultat,i,Identifiant.c_str());
290     char prefix_graph[1000];
291     sprintf(prefix_graph,"%s/c_%i",dossier_resultat,i);
292     std::ofstream ofstrm_cumul(nom_fichier_resultat_cumul,std::ios::out);
293     ofstrm_cumul.precision(16);
294     analyse_liste_mg_maillage.exporter_cumul(ofstrm_cumul,true,avec_graph,prefix_graph);
295     ofstrm_cumul.close();
296     if(i==0) analyse_liste_mg_maillage.exporter_cumul_i(ofstrm_cumul_erosion,i,true);
297     else analyse_liste_mg_maillage.exporter_cumul_i(ofstrm_cumul_erosion,i,false);
298     }
299     ofstrm_cumul_erosion.close();
300 couturad 926 }
301 couturad 931 else
302 couturad 926 {
303 couturad 968 std::vector<MSTRUCT_ANALYSE*> vector_analyse;
304     std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file;
305     for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++)
306     {
307     MSTRUCT_VES_FILE *ves_file=it_ves_file->second;
308     vector_analyse.push_back(ves_file->get_analyse(Identifiant));
309     }
310     MSTRUCT_ANALYSE_LISTE_MG_MAILLAGE analyse_liste_mg_maillage(Identifiant,
311     vector_analyse,
312     Largeur_colonne_distribution_nb_element_2D,
313     Largeur_colonne_distribution_nb_element_3D,
314     Largeur_colonne_distribution_volume,
315     Largeur_colonne_distribution_fraction_volumique);
316     char nom_fichier_resultat_liste[1000];
317     sprintf(nom_fichier_resultat_liste,"%s/liste_%s.txt",dossier_resultat,Identifiant.c_str());
318     std::ofstream ofstrm_liste(nom_fichier_resultat_liste,std::ios::out);
319     ofstrm_liste.precision(16);
320     analyse_liste_mg_maillage.exporter_liste(ofstrm_liste,true);
321     ofstrm_liste.close();
322     char nom_fichier_resultat_cumul[1000];
323     sprintf(nom_fichier_resultat_cumul,"%s/cumul_%s.txt",dossier_resultat,Identifiant.c_str());
324     std::ofstream ofstrm_cumul(nom_fichier_resultat_cumul,std::ios::out);
325     ofstrm_cumul.precision(16);
326     analyse_liste_mg_maillage.exporter_cumul(ofstrm_cumul,true,avec_graph,dossier_resultat);
327     ofstrm_cumul.close();
328 couturad 926 }
329 couturad 919 }
330 couturad 968 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_MAILLAGE_FEM)
331 couturad 919 {
332 couturad 968 sprintf(ligne,"-> %s",Identifiant.c_str());
333     affiche(ligne);
334     double Largeur_colonne_distribution_nb_element_2D = param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_2D");
335     double Largeur_colonne_distribution_nb_element_3D = param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_3D");
336     double Largeur_colonne_distribution_volume = param->get_valeur((char*)"Largeur_colonne_distribution_volume");
337     double Largeur_colonne_distribution_fraction_volumique = param->get_valeur((char*)"Largeur_colonne_distribution_fraction_volumique");
338     int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
339     if(Analyse_erosion)
340 couturad 926 {
341 couturad 968 char nom_fichier_resultat_cumul_erosion[1000];
342     sprintf(nom_fichier_resultat_cumul_erosion,"%s/cumul_erosion_%s.txt",dossier_resultat,Identifiant.c_str());
343     std::ofstream ofstrm_cumul_erosion(nom_fichier_resultat_cumul_erosion,std::ios::out);
344     int Nb_couche = (int)param->get_valeur((char*)"Nb_couche");
345     for(int i=0;i<Nb_couche;i++)
346     {
347     char syscmd_mkdir_erosion_couche[1000];
348     sprintf(syscmd_mkdir_erosion_couche,"mkdir -p %s/c_%i",dossier_resultat,i);
349     system(syscmd_mkdir_erosion_couche);
350     std::vector<MSTRUCT_ANALYSE*> vector_analyse;
351     std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file;
352     for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++)
353     {
354     MSTRUCT_VES_FILE *ves_file=it_ves_file->second;
355     MSTRUCT_ANALYSE_EROSION* analyse_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_file->get_analyse(Identifiant);
356     vector_analyse.push_back(analyse_erosion->get_analyse(i));
357     }
358     MSTRUCT_ANALYSE_LISTE_FEM_MAILLAGE analyse_liste_fem_maillage(Identifiant,
359     vector_analyse,
360     Largeur_colonne_distribution_nb_element_2D,
361     Largeur_colonne_distribution_nb_element_3D,
362     Largeur_colonne_distribution_volume,
363     Largeur_colonne_distribution_fraction_volumique);
364     char nom_fichier_resultat_liste[1000];
365     sprintf(nom_fichier_resultat_liste,"%s/c_%i/liste_%s.txt",dossier_resultat,i,Identifiant.c_str());
366     std::ofstream ofstrm_liste(nom_fichier_resultat_liste,std::ios::out);
367     ofstrm_liste.precision(16);
368     analyse_liste_fem_maillage.exporter_liste(ofstrm_liste,true);
369     ofstrm_liste.close();
370     char nom_fichier_resultat_cumul[1000];
371     sprintf(nom_fichier_resultat_cumul,"%s/c_%i/cumul_%s.txt",dossier_resultat,i,Identifiant.c_str());
372     char prefix_graph[1000];
373     sprintf(prefix_graph,"%s/c_%i",dossier_resultat,i);
374     std::ofstream ofstrm_cumul(nom_fichier_resultat_cumul,std::ios::out);
375     ofstrm_cumul.precision(16);
376     analyse_liste_fem_maillage.exporter_cumul(ofstrm_cumul,true,avec_graph,prefix_graph);
377     ofstrm_cumul.close();
378     if(i==0) analyse_liste_fem_maillage.exporter_cumul_i(ofstrm_cumul_erosion,i,true);
379     else analyse_liste_fem_maillage.exporter_cumul_i(ofstrm_cumul_erosion,i,false);
380     }
381     ofstrm_cumul_erosion.close();
382 couturad 926 }
383 couturad 931 else
384 couturad 926 {
385 couturad 968 std::vector<MSTRUCT_ANALYSE*> vector_analyse;
386     std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file;
387     for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++)
388     {
389     MSTRUCT_VES_FILE *ves_file=it_ves_file->second;
390     vector_analyse.push_back(ves_file->get_analyse(Identifiant));
391     }
392     MSTRUCT_ANALYSE_LISTE_FEM_MAILLAGE analyse_liste_fem_maillage(Identifiant,
393     vector_analyse,
394     Largeur_colonne_distribution_nb_element_2D,
395     Largeur_colonne_distribution_nb_element_3D,
396     Largeur_colonne_distribution_volume,
397     Largeur_colonne_distribution_fraction_volumique);
398     char nom_fichier_resultat_liste[1000];
399     sprintf(nom_fichier_resultat_liste,"%s/liste_%s.txt",dossier_resultat,Identifiant.c_str());
400     std::ofstream ofstrm_liste(nom_fichier_resultat_liste,std::ios::out);
401     ofstrm_liste.precision(16);
402     analyse_liste_fem_maillage.exporter_liste(ofstrm_liste,true);
403     ofstrm_liste.close();
404     char nom_fichier_resultat_cumul[1000];
405     sprintf(nom_fichier_resultat_cumul,"%s/cumul_%s.txt",dossier_resultat,Identifiant.c_str());
406     std::ofstream ofstrm_cumul(nom_fichier_resultat_cumul,std::ios::out);
407     ofstrm_cumul.precision(16);
408     analyse_liste_fem_maillage.exporter_cumul(ofstrm_cumul,true,avec_graph,dossier_resultat);
409     ofstrm_cumul.close();
410 couturad 926 }
411 couturad 919 }
412 couturad 968 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_MODULES_ELASTICITE)
413 couturad 919 {
414 couturad 968 sprintf(ligne,"-> %s",Identifiant.c_str());
415     affiche(ligne);
416     double Largeur_colonne_distribution_module_Kapp = param->get_valeur((char*)"Largeur_colonne_distribution_module_Kapp");
417     double Largeur_colonne_distribution_module_Gapp = param->get_valeur((char*)"Largeur_colonne_distribution_module_Gapp");
418     double Largeur_colonne_distribution_module_Eapp = param->get_valeur((char*)"Largeur_colonne_distribution_module_Eapp");
419     double Largeur_colonne_distribution_module_Nuapp = param->get_valeur((char*)"Largeur_colonne_distribution_module_Nuapp");
420     int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
421     if(Analyse_erosion)
422 couturad 926 {
423 couturad 968 char nom_fichier_resultat_cumul_erosion[1000];
424     sprintf(nom_fichier_resultat_cumul_erosion,"%s/cumul_erosion_%s.txt",dossier_resultat,Identifiant.c_str());
425     std::ofstream ofstrm_cumul_erosion(nom_fichier_resultat_cumul_erosion,std::ios::out);
426     int Nb_couche = (int)param->get_valeur((char*)"Nb_couche");
427     for(int i=0;i<Nb_couche;i++)
428     {
429     char syscmd_mkdir_erosion_couche[1000];
430     sprintf(syscmd_mkdir_erosion_couche,"mkdir -p %s/c_%i",dossier_resultat,i);
431     system(syscmd_mkdir_erosion_couche);
432     std::vector<MSTRUCT_ANALYSE*> vector_analyse;
433     std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file;
434     for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++)
435     {
436     MSTRUCT_VES_FILE *ves_file=it_ves_file->second;
437     MSTRUCT_ANALYSE_EROSION* analyse_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_file->get_analyse(Identifiant);
438     vector_analyse.push_back(analyse_erosion->get_analyse(i));
439     }
440     MSTRUCT_ANALYSE_LISTE_MODULES_ELASTICITE analyse_liste_modules_elasticite(Identifiant,
441     vector_analyse,
442     Largeur_colonne_distribution_module_Kapp,
443     Largeur_colonne_distribution_module_Gapp,
444     Largeur_colonne_distribution_module_Eapp,
445     Largeur_colonne_distribution_module_Nuapp);
446     char nom_fichier_resultat_liste[1000];
447     sprintf(nom_fichier_resultat_liste,"%s/c_%i/liste_%s.txt",dossier_resultat,i,Identifiant.c_str());
448     std::ofstream ofstrm_liste(nom_fichier_resultat_liste,std::ios::out);
449     ofstrm_liste.precision(16);
450     analyse_liste_modules_elasticite.exporter_liste(ofstrm_liste,true);
451     ofstrm_liste.close();
452     char nom_fichier_resultat_cumul[1000];
453     sprintf(nom_fichier_resultat_cumul,"%s/c_%i/cumul_%s.txt",dossier_resultat,i,Identifiant.c_str());
454     char prefix_graph[1000];
455     sprintf(prefix_graph,"%s/c_%i",dossier_resultat,i);
456     std::ofstream ofstrm_cumul(nom_fichier_resultat_cumul,std::ios::out);
457     ofstrm_cumul.precision(16);
458     analyse_liste_modules_elasticite.exporter_cumul(ofstrm_cumul,true,avec_graph,prefix_graph);
459     ofstrm_cumul.close();
460     if(i==0) analyse_liste_modules_elasticite.exporter_cumul_i(ofstrm_cumul_erosion,i,true);
461     else analyse_liste_modules_elasticite.exporter_cumul_i(ofstrm_cumul_erosion,i,false);
462     }
463     ofstrm_cumul_erosion.close();
464 couturad 926 }
465 couturad 931 else
466 couturad 926 {
467 couturad 968 std::vector<MSTRUCT_ANALYSE*> vector_analyse;
468     std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file;
469     for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++)
470     {
471     MSTRUCT_VES_FILE *ves_file=it_ves_file->second;
472     vector_analyse.push_back(ves_file->get_analyse(Identifiant));
473     }
474     MSTRUCT_ANALYSE_LISTE_MODULES_ELASTICITE analyse_liste_modules_elasticite(Identifiant,
475     vector_analyse,
476     Largeur_colonne_distribution_module_Kapp,
477     Largeur_colonne_distribution_module_Gapp,
478     Largeur_colonne_distribution_module_Eapp,
479     Largeur_colonne_distribution_module_Nuapp);
480     char nom_fichier_resultat_liste[1000];
481     sprintf(nom_fichier_resultat_liste,"%s/liste_%s.txt",dossier_resultat,Identifiant.c_str());
482     std::ofstream ofstrm_liste(nom_fichier_resultat_liste,std::ios::out);
483     ofstrm_liste.precision(16);
484     analyse_liste_modules_elasticite.exporter_liste(ofstrm_liste,true);
485     ofstrm_liste.close();
486     char nom_fichier_resultat_cumul[1000];
487     sprintf(nom_fichier_resultat_cumul,"%s/cumul_%s.txt",dossier_resultat,Identifiant.c_str());
488     std::ofstream ofstrm_cumul(nom_fichier_resultat_cumul,std::ios::out);
489     ofstrm_cumul.precision(16);
490     analyse_liste_modules_elasticite.exporter_cumul(ofstrm_cumul,true,avec_graph,dossier_resultat);
491     ofstrm_cumul.close();
492 couturad 926 }
493 couturad 919 }
494     }
495     }