1 |
couturad |
919 |
#include "mstruct_ver.h" |
2 |
couturad |
926 |
#include "mstruct_ves_file.h" |
3 |
couturad |
919 |
|
4 |
couturad |
926 |
MSTRUCT_VER::MSTRUCT_VER(void) |
5 |
couturad |
919 |
{ |
6 |
|
|
|
7 |
|
|
} |
8 |
|
|
|
9 |
couturad |
926 |
MSTRUCT_VER::~MSTRUCT_VER(void) |
10 |
couturad |
919 |
{ |
11 |
|
|
|
12 |
|
|
} |
13 |
|
|
|
14 |
couturad |
951 |
void MSTRUCT_VER::active_affichage(fonction_affiche* fonc) |
15 |
couturad |
919 |
{ |
16 |
|
|
fonc_affiche = fonc; |
17 |
|
|
affichageactif = 1; |
18 |
|
|
} |
19 |
|
|
|
20 |
couturad |
926 |
void MSTRUCT_VER::affiche(char* message) |
21 |
couturad |
919 |
{ |
22 |
|
|
if(affichageactif==1) fonc_affiche(message); |
23 |
|
|
} |
24 |
|
|
|
25 |
couturad |
927 |
int MSTRUCT_VER::exporter_analyse(char* fichier_liste_ves, |
26 |
|
|
std::vector< OT_PARAMETRES* >& vector_params_analyse, |
27 |
|
|
char* dossier_resultat) |
28 |
|
|
{ |
29 |
|
|
char message[5000]; |
30 |
|
|
std::map<long,MSTRUCT_VES_FILE*> map_ves_file; |
31 |
|
|
std::ifstream f; |
32 |
couturad |
951 |
f.open(fichier_liste_ves,std::ios::in); |
33 |
couturad |
927 |
char ligne[1000]; |
34 |
|
|
f.getline(ligne,1000); |
35 |
|
|
long i=0; |
36 |
|
|
while(!f.eof()) |
37 |
|
|
{ |
38 |
|
|
char fichier_ves[1000]; |
39 |
|
|
sscanf(ligne,"%s",fichier_ves); |
40 |
|
|
if(strlen(fichier_ves)==0) continue; |
41 |
|
|
std::map<std::string,MSTRUCT_ANALYSE*>* map_analyse = new std::map<std::string,MSTRUCT_ANALYSE*>; |
42 |
|
|
MSTRUCT_VES_FILE *ves_file=new MSTRUCT_VES_FILE; |
43 |
couturad |
958 |
if(ves_file->ouvrir(fichier_ves)==FAIL) |
44 |
|
|
{ |
45 |
|
|
delete map_analyse; |
46 |
|
|
delete ves_file; |
47 |
|
|
return FAIL; |
48 |
|
|
} |
49 |
couturad |
927 |
map_ves_file.insert(std::pair<long,MSTRUCT_VES_FILE*>(i,ves_file)); |
50 |
|
|
i++; |
51 |
|
|
f.getline(ligne,1000); |
52 |
|
|
} |
53 |
|
|
f.close(); |
54 |
|
|
long nb_ves = map_ves_file.size(); |
55 |
|
|
sprintf(message,"NB_VES : %li",nb_ves); affiche(message); |
56 |
|
|
std::vector<OT_PARAMETRES*>::iterator it; |
57 |
|
|
for(it=vector_params_analyse.begin();it!=vector_params_analyse.end();it++) |
58 |
|
|
{ |
59 |
|
|
OT_PARAMETRES* param = *it; |
60 |
|
|
int Type_analyse = (int)param->get_valeur((char*)"Type_analyse"); |
61 |
|
|
std::string Identifiant = param->get_nom((char*)"Identifiant"); |
62 |
|
|
sprintf(message,"-> %s",Identifiant.c_str()); affiche(message); |
63 |
couturad |
951 |
int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion"); |
64 |
|
|
long Nb_couche = (long)param->get_valeur((char*)"Nb_couche"); |
65 |
|
|
if(!Analyse_erosion) |
66 |
couturad |
927 |
{ |
67 |
couturad |
951 |
char sys_mk_dossier[1000]; |
68 |
|
|
char nom_fichier_resultat[1000]; |
69 |
|
|
sprintf(nom_fichier_resultat,"%s/liste_%s.txt",dossier_resultat,Identifiant.c_str()); |
70 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
71 |
|
|
ofstrm.precision(16); |
72 |
|
|
std::vector<MSTRUCT_ANALYSE_CHAMP*> vector_analyse; |
73 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file; |
74 |
|
|
i=1; |
75 |
|
|
for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++) |
76 |
couturad |
927 |
{ |
77 |
couturad |
951 |
MSTRUCT_VES_FILE *ves_file=it_ves_file->second; |
78 |
|
|
MSTRUCT_ANALYSE* analyse = ves_file->get_analyse(Identifiant); |
79 |
|
|
if(i==1) analyse->exporter(ofstrm,i,true); |
80 |
|
|
else analyse->exporter(ofstrm,i,false); |
81 |
|
|
i++; |
82 |
couturad |
927 |
} |
83 |
couturad |
951 |
ofstrm.close(); |
84 |
couturad |
927 |
} |
85 |
couturad |
951 |
else |
86 |
|
|
{ |
87 |
|
|
for(long j=0;j<Nb_couche;j++) |
88 |
|
|
{ |
89 |
|
|
char sys_mk_dossier[1000]; |
90 |
|
|
char nom_fichier_resultat[1000]; |
91 |
|
|
sprintf(sys_mk_dossier,"mkdir -p %s/c_%li",dossier_resultat,j); |
92 |
|
|
system(sys_mk_dossier); |
93 |
|
|
sprintf(nom_fichier_resultat,"%s/c_%li/liste_%s.txt",dossier_resultat,j,Identifiant.c_str()); |
94 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
95 |
|
|
ofstrm.precision(16); |
96 |
|
|
std::vector<MSTRUCT_ANALYSE_CHAMP*> vector_analyse; |
97 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file; |
98 |
|
|
i=1; |
99 |
|
|
for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++) |
100 |
|
|
{ |
101 |
|
|
MSTRUCT_VES_FILE *ves_file=it_ves_file->second; |
102 |
|
|
MSTRUCT_ANALYSE_EROSION *analyse_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_file->get_analyse(Identifiant); |
103 |
|
|
if(i==1) analyse_erosion->get_analyse(j)->exporter(ofstrm,i,true); |
104 |
|
|
else analyse_erosion->get_analyse(j)->exporter(ofstrm,i,false); |
105 |
|
|
i++; |
106 |
|
|
} |
107 |
|
|
ofstrm.close(); |
108 |
|
|
} |
109 |
|
|
} |
110 |
couturad |
927 |
} |
111 |
couturad |
951 |
return OK; |
112 |
couturad |
927 |
} |
113 |
|
|
|
114 |
|
|
|
115 |
couturad |
926 |
int MSTRUCT_VER::cumuler_analyse(char* fichier_liste_ves, |
116 |
|
|
std::vector< OT_PARAMETRES* >& vector_params_analyse, |
117 |
|
|
char* dossier_resultat, |
118 |
|
|
bool avec_histogramme) |
119 |
couturad |
919 |
{ |
120 |
couturad |
926 |
char message[5000]; |
121 |
|
|
std::map<long,MSTRUCT_VES_FILE*> map_ves_file; |
122 |
couturad |
919 |
std::ifstream f; |
123 |
couturad |
951 |
f.open(fichier_liste_ves,std::ios::in); |
124 |
couturad |
919 |
char ligne[1000]; |
125 |
|
|
f.getline(ligne,1000); |
126 |
couturad |
926 |
long i=0; |
127 |
couturad |
919 |
while(!f.eof()) |
128 |
|
|
{ |
129 |
|
|
char fichier_ves[1000]; |
130 |
|
|
sscanf(ligne,"%s",fichier_ves); |
131 |
|
|
if(strlen(fichier_ves)==0) continue; |
132 |
couturad |
926 |
std::map<std::string,MSTRUCT_ANALYSE*>* map_analyse = new std::map<std::string,MSTRUCT_ANALYSE*>; |
133 |
|
|
MSTRUCT_VES_FILE *ves_file=new MSTRUCT_VES_FILE; |
134 |
|
|
if(ves_file->ouvrir(fichier_ves)==FAIL) return FAIL; |
135 |
|
|
map_ves_file.insert(std::pair<long,MSTRUCT_VES_FILE*>(i,ves_file)); |
136 |
|
|
i++; |
137 |
couturad |
919 |
f.getline(ligne,1000); |
138 |
|
|
} |
139 |
|
|
f.close(); |
140 |
couturad |
926 |
long nb_ves = map_ves_file.size(); |
141 |
|
|
sprintf(message,"NB_VES : %li",nb_ves); affiche(message); |
142 |
|
|
std::vector<OT_PARAMETRES*>::iterator it; |
143 |
|
|
for(it=vector_params_analyse.begin();it!=vector_params_analyse.end();it++) |
144 |
couturad |
919 |
{ |
145 |
couturad |
926 |
OT_PARAMETRES* param = *it; |
146 |
|
|
int Type_analyse = (int)param->get_valeur((char*)"Type_analyse"); |
147 |
|
|
std::string Identifiant = param->get_nom((char*)"Identifiant"); |
148 |
|
|
sprintf(message,"-> %s",Identifiant.c_str()); affiche(message); |
149 |
couturad |
931 |
int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion"); |
150 |
|
|
long Nb_couche = (long)param->get_valeur((char*)"Nb_couche"); |
151 |
couturad |
926 |
if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CHAMP) |
152 |
couturad |
919 |
{ |
153 |
couturad |
931 |
if(!Analyse_erosion) |
154 |
couturad |
926 |
{ |
155 |
couturad |
951 |
char nom_fichier_resultat[1000]; |
156 |
|
|
sprintf(nom_fichier_resultat,"%s/cumul_%s.txt",dossier_resultat,Identifiant.c_str()); |
157 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
158 |
|
|
ofstrm.precision(16); |
159 |
couturad |
931 |
std::vector<MSTRUCT_ANALYSE_CHAMP*> vector_analyse; |
160 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file; |
161 |
|
|
for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++) |
162 |
couturad |
926 |
{ |
163 |
couturad |
931 |
MSTRUCT_VES_FILE *ves_file=it_ves_file->second; |
164 |
|
|
MSTRUCT_ANALYSE* analyse = ves_file->get_analyse(Identifiant); |
165 |
|
|
vector_analyse.push_back((MSTRUCT_ANALYSE_CHAMP*)analyse); |
166 |
couturad |
926 |
} |
167 |
couturad |
951 |
MSTRUCT_ANALYSE_CHAMP analyse_champ(vector_analyse); |
168 |
|
|
analyse_champ.exporter(ofstrm,nb_ves,true,avec_histogramme,dossier_resultat); |
169 |
|
|
ofstrm.close(); |
170 |
couturad |
931 |
} |
171 |
|
|
else |
172 |
|
|
{ |
173 |
couturad |
951 |
for(long j=0;j<Nb_couche;j++) |
174 |
couturad |
931 |
{ |
175 |
couturad |
951 |
char nom_fichier_resultat[1000]; |
176 |
|
|
char sys_mk_dossier[1000]; |
177 |
|
|
char prefix_histo[1000]; |
178 |
|
|
sprintf(sys_mk_dossier,"mkdir -p %s/c_%li",dossier_resultat,j); |
179 |
|
|
system(sys_mk_dossier); |
180 |
|
|
sprintf(nom_fichier_resultat,"%s/c_%li/cumul_%s.txt",dossier_resultat,j,Identifiant.c_str()); |
181 |
|
|
sprintf(prefix_histo,"%s/c_%li/",dossier_resultat,j); |
182 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
183 |
|
|
ofstrm.precision(16); |
184 |
couturad |
931 |
std::vector<MSTRUCT_ANALYSE_CHAMP*> vector_analyse; |
185 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file; |
186 |
|
|
for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++) |
187 |
|
|
{ |
188 |
|
|
MSTRUCT_VES_FILE *ves_file=it_ves_file->second; |
189 |
|
|
MSTRUCT_ANALYSE_EROSION *analyse_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_file->get_analyse(Identifiant); |
190 |
couturad |
951 |
vector_analyse.push_back((MSTRUCT_ANALYSE_CHAMP*)analyse_erosion->get_analyse(j)); |
191 |
couturad |
931 |
} |
192 |
|
|
MSTRUCT_ANALYSE_CHAMP analyse_champ(vector_analyse); |
193 |
couturad |
951 |
analyse_champ.exporter(ofstrm,nb_ves,true,avec_histogramme,prefix_histo); |
194 |
|
|
ofstrm.close(); |
195 |
couturad |
926 |
} |
196 |
|
|
} |
197 |
couturad |
919 |
} |
198 |
couturad |
926 |
else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::ORIENTATION) |
199 |
couturad |
919 |
{ |
200 |
couturad |
931 |
if(!Analyse_erosion) |
201 |
couturad |
926 |
{ |
202 |
couturad |
951 |
char nom_fichier_resultat[1000]; |
203 |
|
|
sprintf(nom_fichier_resultat,"%s/cumul_%s.txt",dossier_resultat,Identifiant.c_str()); |
204 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
205 |
|
|
ofstrm.precision(16); |
206 |
couturad |
931 |
std::vector<MSTRUCT_ANALYSE_ORIENTATION*> vector_analyse; |
207 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file; |
208 |
|
|
for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++) |
209 |
couturad |
926 |
{ |
210 |
couturad |
931 |
MSTRUCT_VES_FILE *ves_file=it_ves_file->second; |
211 |
|
|
MSTRUCT_ANALYSE* analyse = ves_file->get_analyse(Identifiant); |
212 |
|
|
vector_analyse.push_back((MSTRUCT_ANALYSE_ORIENTATION*)analyse); |
213 |
couturad |
926 |
} |
214 |
couturad |
951 |
MSTRUCT_ANALYSE_ORIENTATION analyse_orientation(vector_analyse); |
215 |
|
|
analyse_orientation.exporter(ofstrm,nb_ves,true,avec_histogramme,dossier_resultat); |
216 |
|
|
ofstrm.close(); |
217 |
couturad |
926 |
} |
218 |
couturad |
931 |
else |
219 |
couturad |
926 |
{ |
220 |
couturad |
951 |
for(long j=0;j<Nb_couche;j++) |
221 |
couturad |
931 |
{ |
222 |
couturad |
951 |
char nom_fichier_resultat[1000]; |
223 |
|
|
char sys_mk_dossier[1000]; |
224 |
|
|
char prefix_histo[1000]; |
225 |
|
|
sprintf(sys_mk_dossier,"mkdir -p %s/c_%li",dossier_resultat,j); |
226 |
|
|
system(sys_mk_dossier); |
227 |
|
|
sprintf(nom_fichier_resultat,"%s/c_%li/cumul_%s.txt",dossier_resultat,j,Identifiant.c_str()); |
228 |
|
|
sprintf(prefix_histo,"%s/c_%li/",dossier_resultat,j); |
229 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
230 |
|
|
ofstrm.precision(16); |
231 |
couturad |
931 |
std::vector<MSTRUCT_ANALYSE_ORIENTATION*> vector_analyse; |
232 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file; |
233 |
|
|
for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++) |
234 |
|
|
{ |
235 |
|
|
MSTRUCT_VES_FILE *ves_file=it_ves_file->second; |
236 |
|
|
MSTRUCT_ANALYSE_EROSION *analyse_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_file->get_analyse(Identifiant); |
237 |
couturad |
951 |
vector_analyse.push_back((MSTRUCT_ANALYSE_ORIENTATION*)analyse_erosion->get_analyse(j)); |
238 |
couturad |
931 |
} |
239 |
|
|
MSTRUCT_ANALYSE_ORIENTATION analyse_orientation(vector_analyse); |
240 |
couturad |
951 |
analyse_orientation.exporter(ofstrm,nb_ves,true,avec_histogramme,prefix_histo); |
241 |
|
|
ofstrm.close(); |
242 |
couturad |
931 |
} |
243 |
couturad |
926 |
} |
244 |
couturad |
919 |
} |
245 |
couturad |
938 |
else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::ORIENTATION_PONDEREE) |
246 |
|
|
{ |
247 |
|
|
if(!Analyse_erosion) |
248 |
|
|
{ |
249 |
couturad |
951 |
char nom_fichier_resultat[1000]; |
250 |
|
|
sprintf(nom_fichier_resultat,"%s/cumul_%s.txt",dossier_resultat,Identifiant.c_str()); |
251 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
252 |
|
|
ofstrm.precision(16); |
253 |
couturad |
938 |
std::vector<MSTRUCT_ANALYSE_ORIENTATION*> vector_analyse; |
254 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file; |
255 |
|
|
for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++) |
256 |
|
|
{ |
257 |
|
|
MSTRUCT_VES_FILE *ves_file=it_ves_file->second; |
258 |
|
|
MSTRUCT_ANALYSE* analyse = ves_file->get_analyse(Identifiant); |
259 |
|
|
vector_analyse.push_back((MSTRUCT_ANALYSE_ORIENTATION_PONDEREE*)analyse); |
260 |
|
|
} |
261 |
couturad |
951 |
MSTRUCT_ANALYSE_ORIENTATION_PONDEREE analyse_orientation_ponderee(vector_analyse); |
262 |
|
|
analyse_orientation_ponderee.exporter(ofstrm,nb_ves,true,avec_histogramme,dossier_resultat); |
263 |
|
|
ofstrm.close(); |
264 |
couturad |
938 |
} |
265 |
|
|
else |
266 |
|
|
{ |
267 |
couturad |
951 |
for(long j=0;j<Nb_couche;j++) |
268 |
couturad |
938 |
{ |
269 |
couturad |
951 |
char nom_fichier_resultat[1000]; |
270 |
|
|
char sys_mk_dossier[1000]; |
271 |
|
|
char prefix_histo[1000]; |
272 |
|
|
sprintf(sys_mk_dossier,"mkdir -p %s/c_%li",dossier_resultat,j); |
273 |
|
|
system(sys_mk_dossier); |
274 |
|
|
sprintf(nom_fichier_resultat,"%s/c_%li/cumul_%s.txt",dossier_resultat,j,Identifiant.c_str()); |
275 |
|
|
sprintf(prefix_histo,"%s/c_%li/",dossier_resultat,j); |
276 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
277 |
|
|
ofstrm.precision(16); |
278 |
couturad |
938 |
std::vector<MSTRUCT_ANALYSE_ORIENTATION*> vector_analyse; |
279 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file; |
280 |
|
|
for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++) |
281 |
|
|
{ |
282 |
|
|
MSTRUCT_VES_FILE *ves_file=it_ves_file->second; |
283 |
|
|
MSTRUCT_ANALYSE_EROSION *analyse_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_file->get_analyse(Identifiant); |
284 |
couturad |
951 |
vector_analyse.push_back((MSTRUCT_ANALYSE_ORIENTATION_PONDEREE*)analyse_erosion->get_analyse(j)); |
285 |
couturad |
938 |
} |
286 |
couturad |
951 |
MSTRUCT_ANALYSE_ORIENTATION_PONDEREE analyse_orientation_ponderee(vector_analyse); |
287 |
|
|
analyse_orientation_ponderee.exporter(ofstrm,nb_ves,true,avec_histogramme,prefix_histo); |
288 |
|
|
ofstrm.close(); |
289 |
couturad |
938 |
} |
290 |
|
|
} |
291 |
|
|
} |
292 |
couturad |
926 |
else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CAO) |
293 |
couturad |
919 |
{ |
294 |
couturad |
931 |
if(!Analyse_erosion) |
295 |
couturad |
926 |
{ |
296 |
couturad |
951 |
char nom_fichier_resultat[1000]; |
297 |
|
|
sprintf(nom_fichier_resultat,"%s/cumul_%s.txt",dossier_resultat,Identifiant.c_str()); |
298 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
299 |
|
|
ofstrm.precision(16); |
300 |
couturad |
931 |
std::vector<MSTRUCT_ANALYSE_CAO*> vector_analyse; |
301 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file; |
302 |
|
|
for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++) |
303 |
couturad |
926 |
{ |
304 |
couturad |
931 |
MSTRUCT_VES_FILE *ves_file=it_ves_file->second; |
305 |
|
|
MSTRUCT_ANALYSE* analyse = ves_file->get_analyse(Identifiant); |
306 |
|
|
vector_analyse.push_back((MSTRUCT_ANALYSE_CAO*)analyse); |
307 |
couturad |
926 |
} |
308 |
couturad |
951 |
MSTRUCT_ANALYSE_CAO analyse_cao(vector_analyse); |
309 |
|
|
analyse_cao.exporter(ofstrm,nb_ves,true,avec_histogramme,dossier_resultat); |
310 |
|
|
ofstrm.close(); |
311 |
couturad |
926 |
} |
312 |
couturad |
931 |
else |
313 |
couturad |
926 |
{ |
314 |
couturad |
951 |
for(long j=0;j<Nb_couche;j++) |
315 |
couturad |
931 |
{ |
316 |
couturad |
951 |
char nom_fichier_resultat[1000]; |
317 |
|
|
char sys_mk_dossier[1000]; |
318 |
|
|
char prefix_histo[1000]; |
319 |
|
|
sprintf(sys_mk_dossier,"mkdir -p %s/c_%li",dossier_resultat,j); |
320 |
|
|
system(sys_mk_dossier); |
321 |
|
|
sprintf(nom_fichier_resultat,"%s/c_%li/cumul_%s.txt",dossier_resultat,j,Identifiant.c_str()); |
322 |
|
|
sprintf(prefix_histo,"%s/c_%li/",dossier_resultat,j); |
323 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
324 |
|
|
ofstrm.precision(16); |
325 |
couturad |
931 |
std::vector<MSTRUCT_ANALYSE_CAO*> vector_analyse; |
326 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file; |
327 |
|
|
for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++) |
328 |
|
|
{ |
329 |
|
|
MSTRUCT_VES_FILE *ves_file=it_ves_file->second; |
330 |
|
|
MSTRUCT_ANALYSE_EROSION *analyse_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_file->get_analyse(Identifiant); |
331 |
couturad |
951 |
vector_analyse.push_back((MSTRUCT_ANALYSE_CAO*)analyse_erosion->get_analyse(j)); |
332 |
couturad |
931 |
} |
333 |
|
|
MSTRUCT_ANALYSE_CAO analyse_cao(vector_analyse); |
334 |
couturad |
951 |
analyse_cao.exporter(ofstrm,nb_ves,true,avec_histogramme,prefix_histo); |
335 |
|
|
ofstrm.close(); |
336 |
couturad |
931 |
} |
337 |
couturad |
926 |
} |
338 |
couturad |
919 |
} |
339 |
couturad |
926 |
else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_MG) |
340 |
couturad |
919 |
{ |
341 |
couturad |
931 |
if(!Analyse_erosion) |
342 |
couturad |
926 |
{ |
343 |
couturad |
951 |
char nom_fichier_resultat[1000]; |
344 |
|
|
sprintf(nom_fichier_resultat,"%s/cumul_%s.txt",dossier_resultat,Identifiant.c_str()); |
345 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
346 |
|
|
ofstrm.precision(16); |
347 |
couturad |
931 |
std::vector<MSTRUCT_ANALYSE_MG_MAILLAGE*> vector_analyse; |
348 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file; |
349 |
|
|
for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++) |
350 |
couturad |
926 |
{ |
351 |
couturad |
931 |
MSTRUCT_VES_FILE *ves_file=it_ves_file->second; |
352 |
|
|
MSTRUCT_ANALYSE* analyse = ves_file->get_analyse(Identifiant); |
353 |
|
|
vector_analyse.push_back((MSTRUCT_ANALYSE_MG_MAILLAGE*)analyse); |
354 |
couturad |
926 |
} |
355 |
couturad |
951 |
MSTRUCT_ANALYSE_MG_MAILLAGE analyse_maillage_mg(vector_analyse); |
356 |
|
|
analyse_maillage_mg.exporter(ofstrm,nb_ves,true,avec_histogramme,dossier_resultat); |
357 |
|
|
ofstrm.close(); |
358 |
couturad |
926 |
} |
359 |
couturad |
931 |
else |
360 |
couturad |
926 |
{ |
361 |
couturad |
951 |
for(long j=0;j<Nb_couche;j++) |
362 |
couturad |
931 |
{ |
363 |
couturad |
951 |
char nom_fichier_resultat[1000]; |
364 |
|
|
char sys_mk_dossier[1000]; |
365 |
|
|
char prefix_histo[1000]; |
366 |
|
|
sprintf(sys_mk_dossier,"mkdir -p %s/c_%li",dossier_resultat,j); |
367 |
|
|
system(sys_mk_dossier); |
368 |
|
|
sprintf(nom_fichier_resultat,"%s/c_%li/cumul_%s.txt",dossier_resultat,j,Identifiant.c_str()); |
369 |
|
|
sprintf(prefix_histo,"%s/c_%li/",dossier_resultat,j); |
370 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
371 |
|
|
ofstrm.precision(16); |
372 |
couturad |
931 |
std::vector<MSTRUCT_ANALYSE_MG_MAILLAGE*> vector_analyse; |
373 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file; |
374 |
|
|
for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++) |
375 |
|
|
{ |
376 |
|
|
MSTRUCT_VES_FILE *ves_file=it_ves_file->second; |
377 |
|
|
MSTRUCT_ANALYSE_EROSION *analyse_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_file->get_analyse(Identifiant); |
378 |
couturad |
951 |
vector_analyse.push_back((MSTRUCT_ANALYSE_MG_MAILLAGE*)analyse_erosion->get_analyse(j)); |
379 |
couturad |
931 |
} |
380 |
couturad |
951 |
MSTRUCT_ANALYSE_MG_MAILLAGE analyse_maillage_mg(vector_analyse); |
381 |
|
|
analyse_maillage_mg.exporter(ofstrm,nb_ves,true,avec_histogramme,prefix_histo); |
382 |
|
|
ofstrm.close(); |
383 |
couturad |
931 |
} |
384 |
couturad |
926 |
} |
385 |
couturad |
919 |
} |
386 |
couturad |
926 |
else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_FEM) |
387 |
couturad |
919 |
{ |
388 |
couturad |
931 |
if(!Analyse_erosion) |
389 |
couturad |
926 |
{ |
390 |
couturad |
951 |
char nom_fichier_resultat[1000]; |
391 |
|
|
sprintf(nom_fichier_resultat,"%s/cumul_%s.txt",dossier_resultat,Identifiant.c_str()); |
392 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
393 |
|
|
ofstrm.precision(16); |
394 |
couturad |
931 |
std::vector<MSTRUCT_ANALYSE_FEM_MAILLAGE*> vector_analyse; |
395 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file; |
396 |
|
|
for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++) |
397 |
couturad |
926 |
{ |
398 |
couturad |
931 |
MSTRUCT_VES_FILE *ves_file=it_ves_file->second; |
399 |
|
|
MSTRUCT_ANALYSE* analyse = ves_file->get_analyse(Identifiant); |
400 |
|
|
vector_analyse.push_back((MSTRUCT_ANALYSE_FEM_MAILLAGE*)analyse); |
401 |
couturad |
926 |
} |
402 |
couturad |
951 |
MSTRUCT_ANALYSE_FEM_MAILLAGE analyse_maillage_fem(vector_analyse); |
403 |
|
|
analyse_maillage_fem.exporter(ofstrm,nb_ves,true,avec_histogramme,dossier_resultat); |
404 |
|
|
ofstrm.close(); |
405 |
couturad |
926 |
} |
406 |
couturad |
931 |
else |
407 |
couturad |
926 |
{ |
408 |
couturad |
951 |
for(long j=0;j<Nb_couche;j++) |
409 |
couturad |
931 |
{ |
410 |
couturad |
951 |
char nom_fichier_resultat[1000]; |
411 |
|
|
char sys_mk_dossier[1000]; |
412 |
|
|
char prefix_histo[1000]; |
413 |
|
|
sprintf(sys_mk_dossier,"mkdir -p %s/c_%li",dossier_resultat,j); |
414 |
|
|
system(sys_mk_dossier); |
415 |
|
|
sprintf(nom_fichier_resultat,"%s/c_%li/cumul_%s.txt",dossier_resultat,j,Identifiant.c_str()); |
416 |
|
|
sprintf(prefix_histo,"%s/c_%li/",dossier_resultat,j); |
417 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
418 |
|
|
ofstrm.precision(16); |
419 |
couturad |
931 |
std::vector<MSTRUCT_ANALYSE_FEM_MAILLAGE*> vector_analyse; |
420 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file; |
421 |
|
|
for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++) |
422 |
|
|
{ |
423 |
|
|
MSTRUCT_VES_FILE *ves_file=it_ves_file->second; |
424 |
|
|
MSTRUCT_ANALYSE_EROSION *analyse_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_file->get_analyse(Identifiant); |
425 |
couturad |
951 |
vector_analyse.push_back((MSTRUCT_ANALYSE_FEM_MAILLAGE*)analyse_erosion->get_analyse(j)); |
426 |
couturad |
931 |
} |
427 |
couturad |
951 |
MSTRUCT_ANALYSE_FEM_MAILLAGE analyse_maillage_fem(vector_analyse); |
428 |
|
|
analyse_maillage_fem.exporter(ofstrm,nb_ves,true,avec_histogramme,prefix_histo); |
429 |
|
|
ofstrm.close(); |
430 |
|
|
} |
431 |
couturad |
926 |
} |
432 |
couturad |
919 |
} |
433 |
|
|
} |
434 |
couturad |
926 |
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_file; |
435 |
|
|
for(it_ves_file=map_ves_file.begin();it_ves_file!=map_ves_file.end();it_ves_file++) |
436 |
couturad |
919 |
{ |
437 |
couturad |
926 |
delete it_ves_file->second; |
438 |
couturad |
919 |
} |
439 |
|
|
return OK; |
440 |
|
|
} |
441 |
|
|
|
442 |
couturad |
951 |
int MSTRUCT_VER::exporter_modules_mecaniques(char* fichier_liste_ves_spherique, |
443 |
couturad |
926 |
char* fichier_liste_ves_deviatorique, |
444 |
couturad |
930 |
std::vector< OT_PARAMETRES* >& vector_params_ver, |
445 |
couturad |
951 |
char* dossier_resultat) |
446 |
couturad |
919 |
{ |
447 |
couturad |
926 |
char message[5000]; |
448 |
|
|
std::map<long,MSTRUCT_VES_FILE*> map_ves_file_spherique; |
449 |
|
|
std::ifstream f; |
450 |
couturad |
951 |
f.open(fichier_liste_ves_spherique,std::ios::in); |
451 |
couturad |
926 |
char ligne[1000]; |
452 |
|
|
f.getline(ligne,1000); |
453 |
|
|
long i=0; |
454 |
|
|
while(!f.eof()) |
455 |
couturad |
919 |
{ |
456 |
couturad |
926 |
char fichier_ves[1000]; |
457 |
|
|
sscanf(ligne,"%s",fichier_ves); |
458 |
|
|
if(strlen(fichier_ves)==0) continue; |
459 |
|
|
std::map<std::string,MSTRUCT_ANALYSE*>* map_analyse = new std::map<std::string,MSTRUCT_ANALYSE*>; |
460 |
|
|
MSTRUCT_VES_FILE *ves_file=new MSTRUCT_VES_FILE; |
461 |
|
|
if(ves_file->ouvrir(fichier_ves)==FAIL) return FAIL; |
462 |
|
|
map_ves_file_spherique.insert(std::pair<long,MSTRUCT_VES_FILE*>(i,ves_file)); |
463 |
|
|
i++; |
464 |
|
|
f.getline(ligne,1000); |
465 |
couturad |
919 |
} |
466 |
couturad |
926 |
f.close(); |
467 |
|
|
std::map<long,MSTRUCT_VES_FILE*> map_ves_file_deviatorique; |
468 |
couturad |
951 |
f.open(fichier_liste_ves_deviatorique,std::ios::in); |
469 |
couturad |
926 |
f.getline(ligne,1000); |
470 |
|
|
i=0; |
471 |
|
|
while(!f.eof()) |
472 |
couturad |
919 |
{ |
473 |
couturad |
926 |
char fichier_ves[1000]; |
474 |
|
|
sscanf(ligne,"%s",fichier_ves); |
475 |
|
|
if(strlen(fichier_ves)==0) continue; |
476 |
|
|
std::map<std::string,MSTRUCT_ANALYSE*>* map_analyse = new std::map<std::string,MSTRUCT_ANALYSE*>; |
477 |
|
|
MSTRUCT_VES_FILE *ves_file=new MSTRUCT_VES_FILE; |
478 |
|
|
if(ves_file->ouvrir(fichier_ves)==FAIL) return FAIL; |
479 |
|
|
map_ves_file_deviatorique.insert(std::pair<long,MSTRUCT_VES_FILE*>(i,ves_file)); |
480 |
|
|
i++; |
481 |
|
|
f.getline(ligne,1000); |
482 |
couturad |
919 |
} |
483 |
couturad |
926 |
f.close(); |
484 |
|
|
if(map_ves_file_spherique.size()!=map_ves_file_deviatorique.size()) |
485 |
couturad |
919 |
{ |
486 |
couturad |
926 |
std::cerr << "*** MSTRUCT_VER::calculer_module_young : Liste non identique ***" << std::endl; |
487 |
couturad |
919 |
return FAIL; |
488 |
|
|
} |
489 |
couturad |
926 |
long nb_ves = map_ves_file_spherique.size(); |
490 |
|
|
sprintf(message,"NB_VES : %li",nb_ves); affiche(message); |
491 |
|
|
std::vector<OT_PARAMETRES*>::iterator it; |
492 |
|
|
for(it=vector_params_ver.begin();it!=vector_params_ver.end();it++) |
493 |
couturad |
919 |
{ |
494 |
couturad |
930 |
OT_PARAMETRES *param = *it; |
495 |
couturad |
926 |
std::string Identifiant_epsilon = param->get_nom((char*)"Identifiant_epsilon"); |
496 |
|
|
std::string Identifiant_sigma = param->get_nom((char*)"Identifiant_sigma"); |
497 |
couturad |
931 |
char ligne[1000]; |
498 |
|
|
sprintf(ligne,"-> %s_%s",Identifiant_epsilon.c_str(),Identifiant_sigma.c_str()); |
499 |
|
|
affiche(ligne); |
500 |
couturad |
927 |
double Largeur_colonne_distribution_module_Kapp = param->get_valeur((char*)"Largeur_colonne_distribution_module_Kapp"); |
501 |
|
|
double Largeur_colonne_distribution_module_Gapp = param->get_valeur((char*)"Largeur_colonne_distribution_module_Gapp"); |
502 |
|
|
double Largeur_colonne_distribution_module_Eapp = param->get_valeur((char*)"Largeur_colonne_distribution_module_Eapp"); |
503 |
|
|
double Largeur_colonne_distribution_module_Nuapp = param->get_valeur((char*)"Largeur_colonne_distribution_module_Nuapp"); |
504 |
couturad |
930 |
int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion"); |
505 |
|
|
if(Analyse_erosion) |
506 |
couturad |
919 |
{ |
507 |
couturad |
930 |
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_sph=map_ves_file_spherique.begin(); |
508 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_dev=map_ves_file_deviatorique.begin(); |
509 |
|
|
MSTRUCT_VES_FILE* file_sph=it_ves_sph->second; |
510 |
couturad |
951 |
MSTRUCT_VES_FILE* file_dev=it_ves_dev->second; |
511 |
couturad |
930 |
MSTRUCT_ANALYSE_EROSION* analyse_erosion_epsilon_sph = (MSTRUCT_ANALYSE_EROSION*)file_sph->get_analyse(Identifiant_epsilon); |
512 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_sigma_sph = (MSTRUCT_ANALYSE_EROSION*)file_sph->get_analyse(Identifiant_sigma); |
513 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_epsilon_dev = (MSTRUCT_ANALYSE_EROSION*)file_dev->get_analyse(Identifiant_epsilon); |
514 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_sigma_dev = (MSTRUCT_ANALYSE_EROSION*)file_dev->get_analyse(Identifiant_sigma); |
515 |
|
|
long nb_couche=analyse_erosion_epsilon_sph->get_nb_couche(); |
516 |
couturad |
951 |
char sys_mk_dossier[1000]; |
517 |
|
|
char sous_dossier[1000]; |
518 |
|
|
char nom_fichier_resultat[1000]; |
519 |
couturad |
930 |
for(long j=0;j<nb_couche;j++) |
520 |
couturad |
926 |
{ |
521 |
couturad |
933 |
sprintf(ligne,"\033[1A\033[K-> Couche #%li",j); |
522 |
|
|
affiche(ligne); |
523 |
couturad |
951 |
sprintf(sys_mk_dossier,"mkdir -p %s/c_%li",dossier_resultat,j); |
524 |
|
|
system(sys_mk_dossier); |
525 |
|
|
sprintf(sous_dossier,"%s/c_%li",dossier_resultat,j); |
526 |
|
|
sprintf(nom_fichier_resultat,"%s/c_%li/liste_modules_meca_%s_%s.txt",dossier_resultat,j,Identifiant_epsilon.c_str(),Identifiant_sigma.c_str()); |
527 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
528 |
|
|
ofstrm.precision(16); |
529 |
couturad |
930 |
it_ves_sph=map_ves_file_spherique.begin(); |
530 |
|
|
it_ves_dev=map_ves_file_deviatorique.begin(); |
531 |
couturad |
951 |
std::vector<MSTRUCT_ANALYSE_MODULES_MECA*> vector_analyse; |
532 |
|
|
i=1; |
533 |
couturad |
930 |
for(;it_ves_sph!=map_ves_file_spherique.end();it_ves_sph++,it_ves_dev++) |
534 |
couturad |
926 |
{ |
535 |
couturad |
930 |
file_sph=it_ves_sph->second; |
536 |
|
|
file_dev=it_ves_dev->second; |
537 |
|
|
analyse_erosion_epsilon_sph = (MSTRUCT_ANALYSE_EROSION*)file_sph->get_analyse(Identifiant_epsilon); |
538 |
|
|
analyse_erosion_sigma_sph = (MSTRUCT_ANALYSE_EROSION*)file_sph->get_analyse(Identifiant_sigma); |
539 |
|
|
analyse_erosion_epsilon_dev = (MSTRUCT_ANALYSE_EROSION*)file_dev->get_analyse(Identifiant_epsilon); |
540 |
|
|
analyse_erosion_sigma_dev = (MSTRUCT_ANALYSE_EROSION*)file_dev->get_analyse(Identifiant_sigma); |
541 |
|
|
MSTRUCT_ANALYSE_CHAMP* epsilon_sph=(MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_epsilon_sph->get_analyse(j); |
542 |
|
|
MSTRUCT_ANALYSE_CHAMP* sigma_sph=(MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_sigma_sph->get_analyse(j); |
543 |
|
|
MSTRUCT_ANALYSE_CHAMP* epsilon_dev=(MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_epsilon_dev->get_analyse(j); |
544 |
|
|
MSTRUCT_ANALYSE_CHAMP* sigma_dev=(MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_sigma_dev->get_analyse(j); |
545 |
|
|
MSTRUCT_ANALYSE_MODULES_MECA* analyse_meca = new MSTRUCT_ANALYSE_MODULES_MECA(epsilon_sph, |
546 |
|
|
sigma_sph, |
547 |
|
|
epsilon_dev, |
548 |
|
|
sigma_dev, |
549 |
|
|
Largeur_colonne_distribution_module_Kapp, |
550 |
|
|
Largeur_colonne_distribution_module_Gapp, |
551 |
|
|
Largeur_colonne_distribution_module_Eapp, |
552 |
|
|
Largeur_colonne_distribution_module_Nuapp); |
553 |
couturad |
951 |
if(i==1) analyse_meca->exporter(ofstrm,i,true); |
554 |
|
|
else analyse_meca->exporter(ofstrm,i,false); |
555 |
|
|
delete analyse_meca; |
556 |
|
|
i++; |
557 |
couturad |
926 |
} |
558 |
couturad |
951 |
ofstrm.close(); |
559 |
couturad |
933 |
} |
560 |
|
|
sprintf(ligne,"\033[1A\033[K"); |
561 |
|
|
affiche(ligne); |
562 |
couturad |
919 |
} |
563 |
couturad |
930 |
else |
564 |
couturad |
926 |
{ |
565 |
couturad |
951 |
char nom_fichier_resultat[1000]; |
566 |
|
|
char sys_mk_dossier[1000]; |
567 |
|
|
sprintf(nom_fichier_resultat,"%s/liste_modules_meca_%s_%s.txt",dossier_resultat,Identifiant_epsilon.c_str(),Identifiant_sigma.c_str()); |
568 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
569 |
|
|
ofstrm.precision(16); |
570 |
couturad |
930 |
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_sph=map_ves_file_spherique.begin(); |
571 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_dev=map_ves_file_deviatorique.begin(); |
572 |
|
|
MSTRUCT_VES_FILE* file_sph; |
573 |
|
|
MSTRUCT_VES_FILE* file_dev; |
574 |
couturad |
951 |
std::vector<MSTRUCT_ANALYSE_MODULES_MECA*> vector_analyse; |
575 |
couturad |
933 |
i=1; |
576 |
couturad |
951 |
for(;it_ves_sph!=map_ves_file_spherique.end();it_ves_sph++) |
577 |
couturad |
930 |
{ |
578 |
couturad |
951 |
it_ves_dev++; |
579 |
couturad |
930 |
file_sph=it_ves_sph->second; |
580 |
|
|
file_dev=it_ves_dev->second; |
581 |
|
|
MSTRUCT_ANALYSE_CHAMP* epsilon_sph=(MSTRUCT_ANALYSE_CHAMP*)file_sph->get_analyse(Identifiant_epsilon); |
582 |
|
|
MSTRUCT_ANALYSE_CHAMP* sigma_sph=(MSTRUCT_ANALYSE_CHAMP*)file_sph->get_analyse(Identifiant_sigma); |
583 |
|
|
MSTRUCT_ANALYSE_CHAMP* epsilon_dev=(MSTRUCT_ANALYSE_CHAMP*)file_dev->get_analyse(Identifiant_epsilon); |
584 |
|
|
MSTRUCT_ANALYSE_CHAMP* sigma_dev=(MSTRUCT_ANALYSE_CHAMP*)file_dev->get_analyse(Identifiant_sigma); |
585 |
|
|
MSTRUCT_ANALYSE_MODULES_MECA* analyse_meca = new MSTRUCT_ANALYSE_MODULES_MECA(epsilon_sph, |
586 |
|
|
sigma_sph, |
587 |
|
|
epsilon_dev, |
588 |
|
|
sigma_dev, |
589 |
|
|
Largeur_colonne_distribution_module_Kapp, |
590 |
|
|
Largeur_colonne_distribution_module_Gapp, |
591 |
|
|
Largeur_colonne_distribution_module_Eapp, |
592 |
|
|
Largeur_colonne_distribution_module_Nuapp); |
593 |
couturad |
951 |
if(i==1) analyse_meca->exporter(ofstrm,i,true); |
594 |
|
|
else analyse_meca->exporter(ofstrm,i,false); |
595 |
|
|
delete analyse_meca; |
596 |
|
|
ofstrm.close(); |
597 |
|
|
i++; |
598 |
|
|
} |
599 |
|
|
} |
600 |
|
|
} |
601 |
|
|
} |
602 |
|
|
|
603 |
|
|
int MSTRUCT_VER::cumuler_modules_mecaniques(char* fichier_liste_ves_spherique, |
604 |
|
|
char* fichier_liste_ves_deviatorique, |
605 |
|
|
std::vector< OT_PARAMETRES* >& vector_params_ver, |
606 |
|
|
char* dossier_resultat, |
607 |
|
|
bool avec_histogramme) |
608 |
|
|
{ |
609 |
|
|
char message[5000]; |
610 |
|
|
std::map<long,MSTRUCT_VES_FILE*> map_ves_file_spherique; |
611 |
|
|
std::ifstream f; |
612 |
|
|
f.open(fichier_liste_ves_spherique,std::ios::in); |
613 |
|
|
char ligne[1000]; |
614 |
|
|
f.getline(ligne,1000); |
615 |
|
|
long i=0; |
616 |
|
|
while(!f.eof()) |
617 |
|
|
{ |
618 |
|
|
char fichier_ves[1000]; |
619 |
|
|
sscanf(ligne,"%s",fichier_ves); |
620 |
|
|
if(strlen(fichier_ves)==0) continue; |
621 |
|
|
std::map<std::string,MSTRUCT_ANALYSE*>* map_analyse = new std::map<std::string,MSTRUCT_ANALYSE*>; |
622 |
|
|
MSTRUCT_VES_FILE *ves_file=new MSTRUCT_VES_FILE; |
623 |
|
|
if(ves_file->ouvrir(fichier_ves)==FAIL) return FAIL; |
624 |
|
|
map_ves_file_spherique.insert(std::pair<long,MSTRUCT_VES_FILE*>(i,ves_file)); |
625 |
|
|
i++; |
626 |
|
|
f.getline(ligne,1000); |
627 |
|
|
} |
628 |
|
|
f.close(); |
629 |
|
|
std::map<long,MSTRUCT_VES_FILE*> map_ves_file_deviatorique; |
630 |
|
|
f.open(fichier_liste_ves_deviatorique,std::ios::in); |
631 |
|
|
f.getline(ligne,1000); |
632 |
|
|
i=0; |
633 |
|
|
while(!f.eof()) |
634 |
|
|
{ |
635 |
|
|
char fichier_ves[1000]; |
636 |
|
|
sscanf(ligne,"%s",fichier_ves); |
637 |
|
|
if(strlen(fichier_ves)==0) continue; |
638 |
|
|
std::map<std::string,MSTRUCT_ANALYSE*>* map_analyse = new std::map<std::string,MSTRUCT_ANALYSE*>; |
639 |
|
|
MSTRUCT_VES_FILE *ves_file=new MSTRUCT_VES_FILE; |
640 |
|
|
if(ves_file->ouvrir(fichier_ves)==FAIL) return FAIL; |
641 |
|
|
map_ves_file_deviatorique.insert(std::pair<long,MSTRUCT_VES_FILE*>(i,ves_file)); |
642 |
|
|
i++; |
643 |
|
|
f.getline(ligne,1000); |
644 |
|
|
} |
645 |
|
|
f.close(); |
646 |
|
|
if(map_ves_file_spherique.size()!=map_ves_file_deviatorique.size()) |
647 |
|
|
{ |
648 |
|
|
std::cerr << "*** MSTRUCT_VER::calculer_module_young : Liste non identique ***" << std::endl; |
649 |
|
|
return FAIL; |
650 |
|
|
} |
651 |
|
|
long nb_ves = map_ves_file_spherique.size(); |
652 |
|
|
sprintf(message,"NB_VES : %li",nb_ves); affiche(message); |
653 |
|
|
std::vector<OT_PARAMETRES*>::iterator it; |
654 |
|
|
for(it=vector_params_ver.begin();it!=vector_params_ver.end();it++) |
655 |
|
|
{ |
656 |
|
|
OT_PARAMETRES *param = *it; |
657 |
|
|
std::string Identifiant_epsilon = param->get_nom((char*)"Identifiant_epsilon"); |
658 |
|
|
std::string Identifiant_sigma = param->get_nom((char*)"Identifiant_sigma"); |
659 |
|
|
char ligne[1000]; |
660 |
|
|
sprintf(ligne,"-> %s_%s",Identifiant_epsilon.c_str(),Identifiant_sigma.c_str()); |
661 |
|
|
affiche(ligne); |
662 |
|
|
double Largeur_colonne_distribution_module_Kapp = param->get_valeur((char*)"Largeur_colonne_distribution_module_Kapp"); |
663 |
|
|
double Largeur_colonne_distribution_module_Gapp = param->get_valeur((char*)"Largeur_colonne_distribution_module_Gapp"); |
664 |
|
|
double Largeur_colonne_distribution_module_Eapp = param->get_valeur((char*)"Largeur_colonne_distribution_module_Eapp"); |
665 |
|
|
double Largeur_colonne_distribution_module_Nuapp = param->get_valeur((char*)"Largeur_colonne_distribution_module_Nuapp"); |
666 |
|
|
int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion"); |
667 |
|
|
if(Analyse_erosion) |
668 |
|
|
{ |
669 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_sph=map_ves_file_spherique.begin(); |
670 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_dev=map_ves_file_deviatorique.begin(); |
671 |
|
|
MSTRUCT_VES_FILE* file_sph=it_ves_sph->second; |
672 |
|
|
MSTRUCT_VES_FILE* file_dev=it_ves_dev->second; |
673 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_epsilon_sph = (MSTRUCT_ANALYSE_EROSION*)file_sph->get_analyse(Identifiant_epsilon); |
674 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_sigma_sph = (MSTRUCT_ANALYSE_EROSION*)file_sph->get_analyse(Identifiant_sigma); |
675 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_epsilon_dev = (MSTRUCT_ANALYSE_EROSION*)file_dev->get_analyse(Identifiant_epsilon); |
676 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_sigma_dev = (MSTRUCT_ANALYSE_EROSION*)file_dev->get_analyse(Identifiant_sigma); |
677 |
|
|
long nb_couche=analyse_erosion_epsilon_sph->get_nb_couche(); |
678 |
|
|
char sys_mk_dossier[1000]; |
679 |
|
|
char sous_dossier[1000]; |
680 |
|
|
char nom_fichier_resultat[1000]; |
681 |
|
|
for(long j=0;j<nb_couche;j++) |
682 |
|
|
{ |
683 |
|
|
sprintf(ligne,"\033[1A\033[K-> Couche #%li",j); |
684 |
|
|
affiche(ligne); |
685 |
|
|
sprintf(sys_mk_dossier,"mkdir -p %s/c_%li",dossier_resultat,j); |
686 |
|
|
system(sys_mk_dossier); |
687 |
|
|
sprintf(sous_dossier,"%s/c_%li/",dossier_resultat,j); |
688 |
|
|
sprintf(nom_fichier_resultat,"%s/c_%li/cumul_modules_meca_%s_%s.txt",dossier_resultat,j,Identifiant_epsilon.c_str(),Identifiant_sigma.c_str()); |
689 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
690 |
|
|
ofstrm.precision(16); |
691 |
|
|
it_ves_sph=map_ves_file_spherique.begin(); |
692 |
|
|
it_ves_dev=map_ves_file_deviatorique.begin(); |
693 |
|
|
std::vector<MSTRUCT_ANALYSE_MODULES_MECA*> vector_analyse; |
694 |
|
|
for(;it_ves_sph!=map_ves_file_spherique.end();it_ves_sph++,it_ves_dev++) |
695 |
couturad |
926 |
{ |
696 |
couturad |
951 |
file_sph=it_ves_sph->second; |
697 |
|
|
file_dev=it_ves_dev->second; |
698 |
|
|
analyse_erosion_epsilon_sph = (MSTRUCT_ANALYSE_EROSION*)file_sph->get_analyse(Identifiant_epsilon); |
699 |
|
|
analyse_erosion_sigma_sph = (MSTRUCT_ANALYSE_EROSION*)file_sph->get_analyse(Identifiant_sigma); |
700 |
|
|
analyse_erosion_epsilon_dev = (MSTRUCT_ANALYSE_EROSION*)file_dev->get_analyse(Identifiant_epsilon); |
701 |
|
|
analyse_erosion_sigma_dev = (MSTRUCT_ANALYSE_EROSION*)file_dev->get_analyse(Identifiant_sigma); |
702 |
|
|
MSTRUCT_ANALYSE_CHAMP* epsilon_sph=(MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_epsilon_sph->get_analyse(j); |
703 |
|
|
MSTRUCT_ANALYSE_CHAMP* sigma_sph=(MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_sigma_sph->get_analyse(j); |
704 |
|
|
MSTRUCT_ANALYSE_CHAMP* epsilon_dev=(MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_epsilon_dev->get_analyse(j); |
705 |
|
|
MSTRUCT_ANALYSE_CHAMP* sigma_dev=(MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_sigma_dev->get_analyse(j); |
706 |
|
|
MSTRUCT_ANALYSE_MODULES_MECA* analyse_meca = new MSTRUCT_ANALYSE_MODULES_MECA(epsilon_sph, |
707 |
|
|
sigma_sph, |
708 |
|
|
epsilon_dev, |
709 |
|
|
sigma_dev, |
710 |
|
|
Largeur_colonne_distribution_module_Kapp, |
711 |
|
|
Largeur_colonne_distribution_module_Gapp, |
712 |
|
|
Largeur_colonne_distribution_module_Eapp, |
713 |
|
|
Largeur_colonne_distribution_module_Nuapp); |
714 |
|
|
vector_analyse.push_back(analyse_meca); |
715 |
couturad |
926 |
} |
716 |
couturad |
951 |
|
717 |
|
|
MSTRUCT_ANALYSE_MODULES_MECA analyse_meca_globale(vector_analyse); |
718 |
|
|
analyse_meca_globale.exporter(ofstrm,nb_ves,true,avec_histogramme,sous_dossier); |
719 |
|
|
ofstrm.close(); |
720 |
|
|
for(std::vector<MSTRUCT_ANALYSE_MODULES_MECA*>::iterator it_vct_analyse=vector_analyse.begin();it_vct_analyse!=vector_analyse.end();it_vct_analyse++) delete *it_vct_analyse; |
721 |
couturad |
930 |
} |
722 |
couturad |
951 |
sprintf(ligne,"\033[1A\033[K"); |
723 |
|
|
affiche(ligne); |
724 |
|
|
} |
725 |
|
|
else |
726 |
|
|
{ |
727 |
|
|
char nom_fichier_resultat[1000]; |
728 |
|
|
sprintf(nom_fichier_resultat,"%s/cumul_modules_meca_%s_%s.txt",dossier_resultat,Identifiant_epsilon.c_str(),Identifiant_sigma.c_str()); |
729 |
|
|
std::ofstream ofstrm(nom_fichier_resultat,std::ios::out); |
730 |
|
|
ofstrm.precision(16); |
731 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_sph=map_ves_file_spherique.begin(); |
732 |
|
|
std::map<long,MSTRUCT_VES_FILE*>::iterator it_ves_dev=map_ves_file_deviatorique.begin(); |
733 |
|
|
MSTRUCT_VES_FILE* file_sph; |
734 |
|
|
MSTRUCT_VES_FILE* file_dev; |
735 |
|
|
std::vector<MSTRUCT_ANALYSE_MODULES_MECA*> vector_analyse; |
736 |
|
|
for(;it_ves_sph!=map_ves_file_spherique.end();it_ves_sph++) |
737 |
couturad |
930 |
{ |
738 |
couturad |
951 |
it_ves_dev++; |
739 |
|
|
file_sph=it_ves_sph->second; |
740 |
|
|
file_dev=it_ves_dev->second; |
741 |
|
|
MSTRUCT_ANALYSE_CHAMP* epsilon_sph=(MSTRUCT_ANALYSE_CHAMP*)file_sph->get_analyse(Identifiant_epsilon); |
742 |
|
|
MSTRUCT_ANALYSE_CHAMP* sigma_sph=(MSTRUCT_ANALYSE_CHAMP*)file_sph->get_analyse(Identifiant_sigma); |
743 |
|
|
MSTRUCT_ANALYSE_CHAMP* epsilon_dev=(MSTRUCT_ANALYSE_CHAMP*)file_dev->get_analyse(Identifiant_epsilon); |
744 |
|
|
MSTRUCT_ANALYSE_CHAMP* sigma_dev=(MSTRUCT_ANALYSE_CHAMP*)file_dev->get_analyse(Identifiant_sigma); |
745 |
|
|
MSTRUCT_ANALYSE_MODULES_MECA* analyse_meca = new MSTRUCT_ANALYSE_MODULES_MECA(epsilon_sph, |
746 |
|
|
sigma_sph, |
747 |
|
|
epsilon_dev, |
748 |
|
|
sigma_dev, |
749 |
|
|
Largeur_colonne_distribution_module_Kapp, |
750 |
|
|
Largeur_colonne_distribution_module_Gapp, |
751 |
|
|
Largeur_colonne_distribution_module_Eapp, |
752 |
|
|
Largeur_colonne_distribution_module_Nuapp); |
753 |
|
|
vector_analyse.push_back(analyse_meca); |
754 |
couturad |
930 |
} |
755 |
couturad |
951 |
MSTRUCT_ANALYSE_MODULES_MECA analyse_meca_globale(vector_analyse); |
756 |
|
|
analyse_meca_globale.exporter(ofstrm,nb_ves,true,avec_histogramme,dossier_resultat); |
757 |
|
|
ofstrm.close(); |
758 |
|
|
for(std::vector<MSTRUCT_ANALYSE_MODULES_MECA*>::iterator it_vct_analyse=vector_analyse.begin();it_vct_analyse!=vector_analyse.end();it_vct_analyse++) delete *it_vct_analyse; |
759 |
|
|
} |
760 |
couturad |
930 |
} |
761 |
couturad |
919 |
} |
762 |
|
|
|
763 |
|
|
|
764 |
|
|
|
765 |
|
|
|
766 |
|
|
|
767 |
couturad |
926 |
|
768 |
|
|
|
769 |
|
|
|
770 |
|
|
|
771 |
|
|
|
772 |
|
|
|
773 |
|
|
|
774 |
|
|
|
775 |
|
|
|
776 |
|
|
|
777 |
|
|
|
778 |
|
|
|