ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/microstructure/src/mstruct_ves.cpp
Revision: 1000
Committed: Thu Jan 10 16:32:30 2019 UTC (6 years, 4 months ago) by couturad
File size: 93062 byte(s)
Log Message:
Correction bug affichage

File Contents

# User Rev Content
1 couturad 919 #include "mstruct_ves.h"
2     #include "mg_volume.h"
3     #include "mg_geometrie.h"
4     #include "mg_maillage.h"
5     #include "fem_maillage.h"
6     #include "mg_gestionnaire.h"
7     #include "mstruct_groupe_volume.h"
8     #include "mstruct_parametres.h"
9     #include "mstruct_generateur_rsa.h"
10 couturad 951 #include "mstruct_generateur_dcr.h"
11 couturad 968 #include "mstruct_definition.h"
12     #include "mstruct_analyse_champ.h"
13     #include "mstruct_analyse_orientation.h"
14     #include "mstruct_analyse_cao.h"
15 couturad 971 #include "mstruct_analyse_propriete_massique.h"
16 couturad 968 #include "mstruct_analyse_mg_maillage.h"
17     #include "mstruct_analyse_fem_maillage.h"
18     #include "mstruct_analyse_erosion.h"
19     #include "mstruct_analyse_modules_elasticite.h"
20 couturad 971 #include "mstruct_analyse_conductivite_thermique.h"
21 couturad 919 #include "mg_cg_modele.h"
22     #include "mg_cg_assemblage.h"
23     #include "mg_sous_geometrie.h"
24     #include "mg_cg_forme_multi_volume.h"
25 couturad 937 #include "mg_cg_info.h"
26 couturad 919 #include "mg_file.h"
27     #include "fct_taille_fem_solution_generateur_microstructure.h"
28 couturad 951 #include "mailleur3d_couche.h"
29 couturad 919 #include "mailleur0d.h"
30     #include "mailleur1d.h"
31     #include "mailleur2d.h"
32     #include "mailleur3d.h"
33     #include "mailleur_fem.h"
34     #include "mailleur_analyse.h"
35     #include <fstream>
36     #include "mgaster.h"
37     #include "ot_cpu.h"
38     #include "mstruct_outils.h"
39 couturad 926 #include "mg_cg_groupe_forme.h"
40     #include "mstruct_ves_file.h"
41 couturad 933 #include "fem_tetra4.h"
42     #include "fem_tetra10.h"
43     #include "fem_penta6.h"
44     #include "fem_penta15.h"
45 couturad 951 #include "parse.h"
46     #include "pars_argument.h"
47 couturad 926 MSTRUCT_VES::MSTRUCT_VES(void)
48 couturad 919 {
49     m_mg_gestionnaire=new MG_GESTIONNAIRE;
50     m_mg_geometrie=NULL;
51     m_mgcg_modele=NULL;
52 couturad 926 m_mgcg_assemblage=NULL;
53 couturad 919 m_mg_maillage=NULL;
54     m_fem_maillage=NULL;
55 couturad 926 m_ves_file=new MSTRUCT_VES_FILE;
56     change_boite_3D_ves(BOITE_3D(0.0,0.0,0.0,1.0,1.0,1.0));
57     change_precision(1.0e-06);
58     change_temps_geometrie(0.0);
59     change_temps_carte(0.0);
60     change_temps_maillage(0.0);
61     change_temps_fem_maillage(0.0);
62     change_temps_etude(0.0);
63     change_temps_calcul(0.0);
64     change_temps_analyse(0.0);
65 couturad 919 }
66    
67 couturad 926 MSTRUCT_VES::MSTRUCT_VES(char* fichier_ves)
68 couturad 919 {
69 couturad 926 m_ves_file=new MSTRUCT_VES_FILE;
70     m_ves_file->ouvrir(fichier_ves);
71     m_mg_gestionnaire = new MG_FILE(m_ves_file->get_nom_fichier_magic());
72     if(m_ves_file->get_id_mgcg_modele()>0) m_mgcg_modele = m_mg_gestionnaire->get_mgcg_modeleid(m_ves_file->get_id_mgcg_modele());
73     else m_mgcg_modele=NULL;
74     if(m_ves_file->get_id_mgcg_assemblage()>0) m_mgcg_assemblage = m_mgcg_modele->get_mgcg_assemblageid(m_ves_file->get_id_mgcg_assemblage());
75     else m_mgcg_assemblage=NULL;
76     if(m_ves_file->get_id_mg_geometrie()>0) m_mg_geometrie = m_mg_gestionnaire->get_mg_geometrieid(m_ves_file->get_id_mg_geometrie());
77     else m_mg_geometrie = NULL;
78     if(m_ves_file->get_id_mg_maillage()>0) m_mg_maillage = m_mg_gestionnaire->get_mg_maillageid(m_ves_file->get_id_mg_maillage());
79     else m_mg_maillage = NULL;
80     if(m_ves_file->get_id_fem_maillage()>0) m_fem_maillage = m_mg_gestionnaire->get_fem_maillageid(m_ves_file->get_id_fem_maillage());
81     else m_fem_maillage = NULL;
82 couturad 919 }
83    
84 couturad 926 MSTRUCT_VES::~MSTRUCT_VES(void)
85 couturad 919 {
86     delete m_mg_gestionnaire;
87 couturad 926 delete m_ves_file;
88 couturad 919 }
89    
90 couturad 926 MG_GESTIONNAIRE* MSTRUCT_VES::get_mg_gestionnaire(void)
91 couturad 919 {
92     return m_mg_gestionnaire;
93     }
94    
95 couturad 926 void MSTRUCT_VES::change_mg_gestionnaire(MG_GESTIONNAIRE* gest)
96 couturad 919 {
97 couturad 926 m_mg_gestionnaire=gest;
98     }
99    
100     void MSTRUCT_VES::change_mg_geometrie(MG_GEOMETRIE* mg_geometrie)
101     {
102 couturad 919 m_mg_geometrie=mg_geometrie;
103 couturad 926 m_ves_file->change_id_mg_geometrie(m_mg_geometrie->get_id());
104 couturad 919 }
105    
106 couturad 926 MG_GEOMETRIE* MSTRUCT_VES::get_mg_geometrie(void)
107 couturad 919 {
108     return m_mg_geometrie;
109     }
110    
111 couturad 926 void MSTRUCT_VES::change_mgcg_assemblage(MG_CG_ASSEMBLAGE* mgcg_assemblage)
112 couturad 919 {
113     m_mgcg_assemblage=mgcg_assemblage;
114 couturad 926 m_ves_file->change_id_mgcg_assemblage(m_mgcg_assemblage->get_id());
115 couturad 919 }
116    
117 couturad 926 MG_CG_ASSEMBLAGE* MSTRUCT_VES::get_mgcg_assemblage(void)
118 couturad 919 {
119     return m_mgcg_assemblage;
120     }
121    
122 couturad 926 void MSTRUCT_VES::change_mgcg_modele(MG_CG_MODELE* mgcg_modele)
123 couturad 919 {
124     m_mgcg_modele=mgcg_modele;
125 couturad 926 m_ves_file->change_id_mgcg_modele(m_mgcg_modele->get_id());
126 couturad 919 }
127    
128 couturad 926 MG_CG_MODELE* MSTRUCT_VES::get_mgcg_modele(void)
129 couturad 919 {
130     return m_mgcg_modele;
131     }
132    
133 couturad 926 MG_MAILLAGE* MSTRUCT_VES::get_mg_maillage(void)
134 couturad 919 {
135     return m_mg_maillage;
136     }
137    
138 couturad 926 void MSTRUCT_VES::change_mg_maillage(MG_MAILLAGE* mg_maillage)
139 couturad 919 {
140     m_mg_maillage=mg_maillage;
141 couturad 926 m_ves_file->change_id_mg_maillage(m_mg_maillage->get_id());
142 couturad 919 }
143    
144 couturad 926 FEM_MAILLAGE* MSTRUCT_VES::get_fem_maillage(void)
145 couturad 919 {
146     return m_fem_maillage;
147     }
148    
149 couturad 926 void MSTRUCT_VES::change_fem_maillage(FEM_MAILLAGE* fem_maillage)
150 couturad 919 {
151     m_fem_maillage=fem_maillage;
152 couturad 926 m_ves_file->change_id_fem_maillage(m_fem_maillage->get_id());
153 couturad 919 }
154    
155 couturad 926 BOITE_3D MSTRUCT_VES::get_boite3d_ves(void)
156 couturad 919 {
157 couturad 926 return m_ves_file->get_boite_3D_ves();
158 couturad 919 }
159    
160 couturad 926 void MSTRUCT_VES::change_boite_3D_ves(BOITE_3D boite3D)
161 couturad 919 {
162 couturad 926 m_ves_file->change_boite_3D_ves(boite3D);
163 couturad 919 }
164    
165 couturad 926 double MSTRUCT_VES::get_precision(void)
166 couturad 919 {
167 couturad 926 return m_ves_file->get_precision();
168 couturad 919 }
169    
170 couturad 926 void MSTRUCT_VES::change_precision(double precision)
171 couturad 919 {
172 couturad 926 m_ves_file->change_precision(precision);
173 couturad 919 }
174    
175 couturad 926 double MSTRUCT_VES::get_temps_geometrie(void)
176 couturad 919 {
177 couturad 926 return m_ves_file->get_temps_geometrie();
178 couturad 919 }
179    
180 couturad 926 void MSTRUCT_VES::change_temps_geometrie(double temps)
181 couturad 919 {
182 couturad 926 m_ves_file->change_temps_geometrie(temps);
183 couturad 919 }
184    
185 couturad 926 double MSTRUCT_VES::get_temps_materiau(void)
186     {
187     return m_ves_file->get_temps_materiau();
188     }
189 couturad 919
190 couturad 926 void MSTRUCT_VES::change_temps_materiau(double temps)
191 couturad 919 {
192 couturad 926 m_ves_file->change_temps_materiau(temps);
193     }
194    
195     double MSTRUCT_VES::get_temps_carte(void)
196     {
197     return m_ves_file->get_temps_carte();
198     }
199    
200     void MSTRUCT_VES::change_temps_carte(double temps)
201     {
202     m_ves_file->change_temps_carte(temps);
203     }
204    
205     double MSTRUCT_VES::get_temps_maillage(void)
206     {
207     return m_ves_file->get_temps_maillage();
208     }
209    
210     void MSTRUCT_VES::change_temps_maillage(double temps)
211     {
212     m_ves_file->change_temps_maillage(temps);
213     }
214    
215     double MSTRUCT_VES::get_temps_fem_maillage(void)
216     {
217     return m_ves_file->get_temps_fem_maillage();
218     }
219    
220     void MSTRUCT_VES::change_temps_fem_maillage(double temps)
221     {
222     m_ves_file->change_temps_fem_maillage(temps);
223     }
224    
225     double MSTRUCT_VES::get_temps_etude(void)
226     {
227     return m_ves_file->get_temps_etude();
228     }
229    
230     void MSTRUCT_VES::change_temps_etude(double temps)
231     {
232     m_ves_file->change_temps_etude(temps);
233     }
234    
235     double MSTRUCT_VES::get_temps_calcul(void)
236     {
237     return m_ves_file->get_temps_calcul();
238     }
239    
240     void MSTRUCT_VES::change_temps_calcul(double temps)
241     {
242     m_ves_file->change_temps_calcul(temps);
243     }
244    
245     double MSTRUCT_VES::get_temps_analyse(void)
246     {
247     return m_ves_file->get_temps_analyse();
248     }
249    
250     void MSTRUCT_VES::change_temps_analyse(double temps)
251     {
252     m_ves_file->change_temps_analyse(temps);
253     }
254    
255     long int MSTRUCT_VES::get_nb_analyse(void)
256     {
257     return m_ves_file->get_nb_analyse();
258     }
259    
260     int MSTRUCT_VES::ajouter_analyse(MSTRUCT_ANALYSE* analyse_ves)
261     {
262     return m_ves_file->ajouter_analyse(analyse_ves);
263     }
264    
265     MSTRUCT_ANALYSE* MSTRUCT_VES::get_premiere_analyse(std::map< std::string, MSTRUCT_ANALYSE* >::iterator& it)
266     {
267     return m_ves_file->get_premiere_analyse(it);
268     }
269    
270     MSTRUCT_ANALYSE* MSTRUCT_VES::get_suivante_analyse(std::map< std::string, MSTRUCT_ANALYSE* >::iterator& it)
271     {
272     return m_ves_file->get_suivante_analyse(it);
273     }
274    
275 couturad 951 MSTRUCT_ANALYSE* MSTRUCT_VES::get_analyse(std::string identifiant)
276 couturad 926 {
277     return m_ves_file->get_analyse(identifiant);
278     }
279    
280 couturad 951 int MSTRUCT_VES::supprimer_analyse(std::string identifiant)
281 couturad 926 {
282     return m_ves_file->supprimer_analyse(identifiant);
283     }
284    
285     int MSTRUCT_VES::supprimer_tout_analyse(void)
286     {
287     return m_ves_file->supprimer_tout_analyse();
288     }
289    
290     int MSTRUCT_VES::generer_geometrie(std::vector< OT_PARAMETRES* >& vector_params_geometrie)
291     {
292 couturad 919 OT_CPU ot_cpu;
293     ot_cpu.initialise();
294 couturad 951 MSTRUCT_GENERATEUR* generateur=NULL;
295 couturad 919 std::vector<OT_PARAMETRES*>::iterator it;
296     for(it=vector_params_geometrie.begin();it!=vector_params_geometrie.end();it++)
297     {
298     OT_PARAMETRES* param = *it;
299 couturad 968 if(((int)param->get_valeur((char*)"Type_generateur"))==MSTRUCT::TYPE_GENERATEUR::RSA)
300 couturad 919 {
301     std::string Nom_mgcg_modele = param->get_nom((char*)"Nom_mgcg_modele");
302 couturad 951 MSTRUCT_GENERATEUR_RSA *RSA;
303     if(generateur==NULL)
304     {
305     RSA = new MSTRUCT_GENERATEUR_RSA(m_mg_gestionnaire,(char*)Nom_mgcg_modele.c_str());
306     generateur=RSA;
307     RSA->active_affichage(fonc_affiche);
308     }
309    
310 couturad 919 double Boite3D_distribution_Xmin = param->get_valeur((char*)"Boite3D_distribution_Xmin");
311     double Boite3D_distribution_Ymin = param->get_valeur((char*)"Boite3D_distribution_Ymin");
312     double Boite3D_distribution_Zmin = param->get_valeur((char*)"Boite3D_distribution_Zmin");
313     double Boite3D_distribution_Xmax = param->get_valeur((char*)"Boite3D_distribution_Xmax");
314     double Boite3D_distribution_Ymax = param->get_valeur((char*)"Boite3D_distribution_Ymax");
315     double Boite3D_distribution_Zmax = param->get_valeur((char*)"Boite3D_distribution_Zmax");
316     BOITE_3D Boite3D_distribution(Boite3D_distribution_Xmin,
317     Boite3D_distribution_Ymin,
318     Boite3D_distribution_Zmin,
319     Boite3D_distribution_Xmax,
320     Boite3D_distribution_Ymax,
321     Boite3D_distribution_Zmax);
322 couturad 951 RSA->change_boite3d_distribution(Boite3D_distribution);
323 couturad 919 double Nb_pas_X = param->get_valeur((char*)"Nb_pas_X");
324     double Nb_pas_Y = param->get_valeur((char*)"Nb_pas_Y");
325 couturad 951 double Nb_pas_Z = param->get_valeur((char*)"Nb_pas_Z");
326     RSA->change_nb_pas_grille(Nb_pas_X);
327     double Distance_min_inter_volume = param->get_valeur((char*)"Distance_min_inter_volume");
328     RSA->change_distance_inter_volume_min(Distance_min_inter_volume);
329 couturad 919 double Volume_min = param->get_valeur((char*)"Volume_min");
330 couturad 951 RSA->change_volume_min(Volume_min);
331 couturad 919 double Aire_min = param->get_valeur((char*)"Aire_min");
332 couturad 951 RSA->change_aire_min(Aire_min);
333 couturad 919 double Longueur_min = param->get_valeur((char*)"Longueur_min");
334 couturad 951 RSA->change_longueur_min(Longueur_min);
335 couturad 919 double Angle_min = param->get_valeur((char*)"Angle_min");
336 couturad 951 RSA->change_angle_min(Angle_min);
337 couturad 919 double Nb_iteration_max = param->get_valeur((char*)"Nb_iteration_max");
338 couturad 951 RSA->change_nb_iteration_max(Nb_iteration_max);
339     bool Avec_intersections = (bool)param->get_valeur((char*)"Avec_intersections");
340     RSA->change_intersection_bords_ves(Avec_intersections);
341     std::string Nom_groupe_inclusion = param->get_nom((char*)"Nom_groupe_inclusion");
342 couturad 971 char message[1000];
343     sprintf(message,"Generateur RSA : %s",Nom_groupe_inclusion.c_str());
344     affiche(message);
345 couturad 951 int Type_inclusion = param->get_valeur((char*)"Type_inclusion");
346 couturad 919 double Fraction_volumique_cible = param->get_valeur((char*)"Fraction_volumique_cible");
347 couturad 951 double Eps_fraction_volumique = param->get_valeur((char*)"Eps_fraction_volumique");
348     bool Porosite = (bool)param->get_valeur((char*)"Porosite");
349     std::string multicouche = param->get_nom((char*)"Multicouche");
350     PARS_ARGUMENT parse_param[100];
351     PARSE parse;
352     parse.decode(multicouche.c_str(),"@,(&)",parse_param);
353     std::vector<double> *vector_epaisseur=NULL;
354     int nb_couche = atoi(parse_param[0].argument[0].c_str());
355     if(nb_couche>0)
356 couturad 919 {
357 couturad 951 vector_epaisseur=new std::vector<double>;
358     for(int i=0;i<nb_couche;i++)
359     {
360     double epaisseur=atof(parse_param[1].argument[i].c_str());
361     vector_epaisseur->push_back(epaisseur);
362     }
363     }
364 couturad 968 if(Type_inclusion==MSTRUCT::TYPE_INCLUSION::SPHERE)
365 couturad 951 {
366 couturad 966 double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
367     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
368     double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon");
369     double fraction_volumique_actuelle=0.0;
370     RSA->tirrage_aleatoire_sphere(Nom_groupe_inclusion,Mu_rayon,Sigma_rayon,Type_distribution_rayon,Fraction_volumique_cible,Eps_fraction_volumique,fraction_volumique_actuelle,vector_epaisseur,Porosite);
371 couturad 919 }
372 couturad 968 else if(Type_inclusion==MSTRUCT::TYPE_INCLUSION::CYLINDRE)
373 couturad 919 {
374 couturad 966 double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
375     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
376     double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon");
377     double Mu_longueur = param->get_valeur((char*)"Mu_longueur");
378     double Sigma_longueur = param->get_valeur((char*)"Sigma_longueur");
379     double Type_distribution_longueur = param->get_valeur((char*)"Type_distribution_longueur");
380     double Mu_theta = param->get_valeur((char*)"Mu_theta");
381     double Sigma_theta = param->get_valeur((char*)"Sigma_theta");
382     double Type_distribution_theta = param->get_valeur((char*)"Type_distribution_theta");
383     double Mu_phi = param->get_valeur((char*)"Mu_phi");
384     double Sigma_phi = param->get_valeur((char*)"Sigma_phi");
385     double Type_distribution_phi = param->get_valeur((char*)"Type_distribution_phi");
386     double fraction_volumique_actuelle=0.0;
387     RSA->tirrage_aleatoire_cylindre(Nom_groupe_inclusion,
388     Mu_rayon,Sigma_rayon,Type_distribution_rayon,
389     Mu_longueur,Sigma_longueur,Type_distribution_longueur,
390     Mu_theta,Sigma_theta,Type_distribution_theta,
391     Mu_phi,Sigma_phi,Type_distribution_phi,
392     Fraction_volumique_cible,Eps_fraction_volumique,fraction_volumique_actuelle,
393     vector_epaisseur,
394     Porosite);
395 couturad 919 }
396 couturad 993 else if(Type_inclusion==MSTRUCT::TYPE_INCLUSION::ELLIPSOIDE)
397     {
398     double Mu_rayon_majeur = param->get_valeur((char*)"Mu_rayon_majeur");
399     double Sigma_rayon_majeur = param->get_valeur((char*)"Sigma_rayon_majeur");
400     double Type_distribution_rayon_majeur = param->get_valeur((char*)"Type_distribution_rayon_majeur");
401     double Mu_rayon_mineur = param->get_valeur((char*)"Mu_rayon_mineur");
402     double Sigma_rayon_mineur = param->get_valeur((char*)"Sigma_rayon_mineur");
403     double Type_distribution_rayon_mineur = param->get_valeur((char*)"Type_distribution_rayon_mineur");
404     double Mu_theta = param->get_valeur((char*)"Mu_theta");
405     double Sigma_theta = param->get_valeur((char*)"Sigma_theta");
406     double Type_distribution_theta = param->get_valeur((char*)"Type_distribution_theta");
407     double Mu_phi = param->get_valeur((char*)"Mu_phi");
408     double Sigma_phi = param->get_valeur((char*)"Sigma_phi");
409     double Type_distribution_phi = param->get_valeur((char*)"Type_distribution_phi");
410     double fraction_volumique_actuelle=0.0;
411     RSA->tirrage_aleatoire_ellipsoide(Nom_groupe_inclusion,
412     Mu_rayon_majeur,Sigma_rayon_majeur,Type_distribution_rayon_majeur,
413     Mu_rayon_mineur,Sigma_rayon_mineur,Type_distribution_rayon_mineur,
414     Mu_theta,Sigma_theta,Type_distribution_theta,
415     Mu_phi,Sigma_phi,Type_distribution_phi,
416     Fraction_volumique_cible,Eps_fraction_volumique,fraction_volumique_actuelle,
417     vector_epaisseur,
418     Porosite);
419     }
420 couturad 951 if(vector_epaisseur!=NULL) delete vector_epaisseur;
421     }
422 couturad 968 else if(((int)param->get_valeur((char*)"Type_generateur"))==MSTRUCT::TYPE_GENERATEUR::DCR)
423 couturad 951 {
424 couturad 952 #ifdef PROJECT_CHRONO
425 couturad 951 std::string Nom_mgcg_modele = param->get_nom((char*)"Nom_mgcg_modele");
426     MSTRUCT_GENERATEUR_DCR *DCR;
427     if(generateur==NULL)
428     {
429     DCR = new MSTRUCT_GENERATEUR_DCR(m_mg_gestionnaire,(char*)Nom_mgcg_modele.c_str());
430     generateur=DCR;
431     DCR->active_affichage(fonc_affiche);
432     }
433     double Boite3D_distribution_Xmin = param->get_valeur((char*)"Boite3D_distribution_Xmin");
434     double Boite3D_distribution_Ymin = param->get_valeur((char*)"Boite3D_distribution_Ymin");
435     double Boite3D_distribution_Zmin = param->get_valeur((char*)"Boite3D_distribution_Zmin");
436     double Boite3D_distribution_Xmax = param->get_valeur((char*)"Boite3D_distribution_Xmax");
437     double Boite3D_distribution_Ymax = param->get_valeur((char*)"Boite3D_distribution_Ymax");
438     double Boite3D_distribution_Zmax = param->get_valeur((char*)"Boite3D_distribution_Zmax");
439     BOITE_3D Boite3D_distribution(Boite3D_distribution_Xmin,
440     Boite3D_distribution_Ymin,
441     Boite3D_distribution_Zmin,
442     Boite3D_distribution_Xmax,
443     Boite3D_distribution_Ymax,
444     Boite3D_distribution_Zmax);
445     DCR->change_boite3d_distribution(Boite3D_distribution);
446     double Nb_pas_X = param->get_valeur((char*)"Nb_pas_X");
447     double Nb_pas_Y = param->get_valeur((char*)"Nb_pas_Y");
448     double Nb_pas_Z = param->get_valeur((char*)"Nb_pas_Z");
449     DCR->change_nb_pas_grille(Nb_pas_X);
450     double Distance_min_inter_volume = param->get_valeur((char*)"Distance_min_inter_volume");
451     DCR->change_distance_inter_volume_min(Distance_min_inter_volume);
452     double Volume_min = param->get_valeur((char*)"Volume_min");
453     DCR->change_volume_min(Volume_min);
454     double Aire_min = param->get_valeur((char*)"Aire_min");
455     DCR->change_aire_min(Aire_min);
456     double Longueur_min = param->get_valeur((char*)"Longueur_min");
457     DCR->change_longueur_min(Longueur_min);
458     double Angle_min = param->get_valeur((char*)"Angle_min");
459     DCR->change_angle_min(Angle_min);
460 couturad 966 long Nb_iteration_max = (long)param->get_valeur((char*)"Nb_iteration_max");
461 couturad 951 bool Avec_intersections = (bool)param->get_valeur((char*)"Avec_intersections");
462     DCR->change_intersection_bords_ves(Avec_intersections);
463     std::string Nom_groupe_inclusion = param->get_nom((char*)"Nom_groupe_inclusion");
464 couturad 971 char message[1000];
465     sprintf(message,"Generateur DCR : %s",Nom_groupe_inclusion.c_str());
466     affiche(message);
467 couturad 951 int Type_inclusion = param->get_valeur((char*)"Type_inclusion");
468     double Fraction_volumique_cible = param->get_valeur((char*)"Fraction_volumique_cible");
469     double Eps_fraction_volumique = param->get_valeur((char*)"Eps_fraction_volumique");
470     bool Porosite = (bool)param->get_valeur((char*)"Porosite");
471     std::string multicouche = param->get_nom((char*)"Multicouche");
472 couturad 919
473 couturad 960 bool Avec_interface_graphique = (bool)param->get_valeur((char*)"Avec_interface_graphique");
474     double Facteur_reduction_vitesse = param->get_valeur((char*)"Facteur_reduction_vitesse");
475     double Friction = param->get_valeur((char*)"Friction");
476     double Pas_temps_sim = param->get_valeur((char*)"Pas_temps_sim");
477     double Temps_max_sim = param->get_valeur((char*)"Temps_max_sim");
478     double Eps_vitesse = param->get_valeur((char*)"Eps_vitesse");
479     DCR->active_interface_graphique(Avec_interface_graphique);
480     DCR->change_facteur_reduction_vitesse(Facteur_reduction_vitesse);
481     DCR->change_eps_vitesse(Eps_vitesse);
482     DCR->change_friction(Friction);
483     DCR->change_pas_temps(Pas_temps_sim);
484     DCR->change_temps_max_sim(Temps_max_sim);
485 couturad 971
486 couturad 968 if(Type_inclusion==MSTRUCT::TYPE_INCLUSION::SPHERE)
487 couturad 951 {
488 couturad 966 double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
489     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
490     double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon");
491 couturad 971 DCR->ajouter_spheres(Nom_groupe_inclusion,Mu_rayon,Sigma_rayon,Type_distribution_rayon,Fraction_volumique_cible,Eps_fraction_volumique,Porosite);
492 couturad 966 }
493 couturad 968 else if(Type_inclusion==MSTRUCT::TYPE_INCLUSION::CYLINDRE)
494 couturad 966 {
495     double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
496     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
497     double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon");
498     double Mu_longueur = param->get_valeur((char*)"Mu_longueur");
499     double Sigma_longueur = param->get_valeur((char*)"Sigma_longueur");
500     double Type_distribution_longueur = param->get_valeur((char*)"Type_distribution_longueur");
501     double Mu_theta = param->get_valeur((char*)"Mu_theta");
502     double Sigma_theta = param->get_valeur((char*)"Sigma_theta");
503     double Type_distribution_theta = param->get_valeur((char*)"Type_distribution_theta");
504     double Mu_phi = param->get_valeur((char*)"Mu_phi");
505     double Sigma_phi = param->get_valeur((char*)"Sigma_phi");
506     double Type_distribution_phi = param->get_valeur((char*)"Type_distribution_phi");
507     DCR->ajouter_cylindres(Nom_groupe_inclusion,
508     Mu_rayon,Sigma_rayon,Type_distribution_rayon,
509     Mu_longueur,Sigma_longueur,Type_distribution_longueur,
510     Mu_theta,Sigma_theta,Type_distribution_theta,
511     Mu_phi,Sigma_phi,Type_distribution_phi,
512 couturad 971 Fraction_volumique_cible,Eps_fraction_volumique,
513     Porosite);
514 couturad 966 }
515 couturad 971 #else
516     std::cerr << "*** ERREUR : MSTRUCT_VES::generer_geometrie : PROJECT_CHRONO absent ***" << std::endl;
517     #endif
518     }
519     }
520     if(generateur->get_type()==MSTRUCT::TYPE_GENERATEUR::DCR)
521     {
522     #ifdef PROJECT_CHRONO
523     MSTRUCT_GENERATEUR_DCR *DCR= (MSTRUCT_GENERATEUR_DCR*)generateur;
524     if(DCR->lancer_simulation()==FAIL)
525 couturad 966 {
526     delete generateur;
527 couturad 971 return FAIL;
528 couturad 966 }
529 couturad 971 DCR->generer_geometrie();
530 couturad 952 #else
531     std::cerr << "*** ERREUR : MSTRUCT_VES::generer_geometrie : PROJECT_CHRONO absent ***" << std::endl;
532 couturad 971 #endif
533 couturad 919 }
534     ot_cpu.ajouter_etape((char*)"generation_geometrie");
535 couturad 926 double temps_generation_geometrie;
536     ot_cpu.get_etape((char*)"generation_geometrie",temps_generation_geometrie);
537     change_temps_geometrie(get_temps_geometrie()+temps_generation_geometrie);
538 couturad 919 generateur->construire(this);
539     delete generateur;
540     return OK;
541     }
542    
543 couturad 926 int MSTRUCT_VES::generer_materiau(std::vector< OT_PARAMETRES* >& vector_params_materiau)
544 couturad 919 {
545     OT_CPU ot_cpu;
546     ot_cpu.initialise();
547     std::vector<OT_PARAMETRES*>::iterator it;
548     for(it=vector_params_materiau.begin();it!=vector_params_materiau.end();it++)
549     {
550     OT_PARAMETRES* param = *it;
551     std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
552 couturad 971 bool Etude_mecanique = (bool)param->get_valeur((char*)"Etude_mecanique");
553     if(Etude_mecanique)
554 couturad 919 {
555 couturad 971 double Mu_E = param->get_valeur((char*)"Mu_E");
556     double Sigma_E = param->get_valeur((char*)"Sigma_E");
557     int Type_distribution_E = (int)param->get_valeur((char*)"Type_distribution_E");
558     double Mu_nu = param->get_valeur((char*)"Mu_nu");
559     double Sigma_nu = param->get_valeur((char*)"Sigma_nu");
560     int Type_distribution_nu = (int)param->get_valeur((char*)"Type_distribution_nu");
561     std::random_device seed;
562     std::mt19937_64 generateur(seed());
563     std::uniform_real_distribution<double> uniform_distribution_E(Mu_E-Sigma_E,Mu_E+Sigma_E);
564     std::normal_distribution<double> normal_distribution_E(Mu_E,Sigma_E);
565     std::uniform_real_distribution<double> uniform_distribution_nu(Mu_nu-Sigma_nu,Mu_nu+Sigma_nu);
566     std::normal_distribution<double> normal_distribution_nu(Mu_nu,Sigma_nu);
567     MG_CG_GROUPE_FORME* mgcg_groupe_forme = m_mgcg_modele->get_mgcg_groupe_forme(Nom_groupe_forme);
568     std::map<long,MG_CG_FORME*>::iterator it_forme;
569     for(MG_CG_FORME* forme = mgcg_groupe_forme->get_premiere_mgcg_forme(it_forme);forme!=NULL;forme=mgcg_groupe_forme->get_suivante_mgcg_forme(it_forme))
570 couturad 919 {
571 couturad 971 double E;
572     if(Type_distribution_E==MSTRUCT::TYPE_DISTRIBUTION::FIXE) E=Mu_E;
573     else if(Type_distribution_E==MSTRUCT::TYPE_DISTRIBUTION::UNIFORME) E=uniform_distribution_E(generateur);
574     else if(Type_distribution_E==MSTRUCT::TYPE_DISTRIBUTION::NORMALE) E=normal_distribution_E(generateur);
575     double nu;
576     if(Type_distribution_nu==MSTRUCT::TYPE_DISTRIBUTION::FIXE) nu=Mu_nu;
577     else if(Type_distribution_nu==MSTRUCT::TYPE_DISTRIBUTION::UNIFORME) nu=uniform_distribution_nu(generateur);
578     else if(Type_distribution_nu==MSTRUCT::TYPE_DISTRIBUTION::NORMALE) nu=normal_distribution_nu(generateur);
579     if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME)
580     {
581     MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme;
582     forme_volume->get_mg_volume()->ajouter_ccf((char*)"Em",E);
583     forme_volume->get_mg_volume()->ajouter_ccf((char*)"nu",nu);
584     }
585     if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME)
586     {
587     MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme;
588     std::map<long,MG_VOLUME*>::iterator it_volume;
589     for(MG_VOLUME* volume = forme_multi_volume->get_premier_mg_volume(it_volume);volume!=NULL;volume=forme_multi_volume->get_suivant_mg_volume(it_volume))
590     {
591     volume->ajouter_ccf((char*)"Em",E);
592     volume->ajouter_ccf((char*)"nu",nu);
593     }
594     }
595 couturad 919 }
596 couturad 971 }
597     bool Etude_thermique = (bool)param->get_valeur((char*)"Etude_thermique");
598     if(Etude_thermique)
599     {
600     double Mu_Lambda = param->get_valeur((char*)"Mu_Lambda");
601     double Sigma_Lambda = param->get_valeur((char*)"Sigma_Lambda");
602     int Type_distribution_Lambda = (int)param->get_valeur((char*)"Type_distribution_Lambda");
603     double Mu_Ro = param->get_valeur((char*)"Mu_Ro");
604     double Sigma_Ro = param->get_valeur((char*)"Sigma_Ro");
605     int Type_distribution_Ro = (int)param->get_valeur((char*)"Type_distribution_Ro");
606     double Mu_Cp = param->get_valeur((char*)"Mu_Cp");
607     double Sigma_Cp = param->get_valeur((char*)"Sigma_Cp");
608     int Type_distribution_Cp = (int)param->get_valeur((char*)"Type_distribution_Cp");
609     std::random_device seed;
610     std::mt19937_64 generateur(seed());
611     std::uniform_real_distribution<double> uniform_distribution_Lambda(Mu_Lambda-Sigma_Lambda,Mu_Lambda+Sigma_Lambda);
612     std::normal_distribution<double> normal_distribution_Lambda(Mu_Lambda,Sigma_Lambda);
613     std::uniform_real_distribution<double> uniform_distribution_Ro(Mu_Ro-Sigma_Ro,Mu_Ro+Sigma_Ro);
614     std::normal_distribution<double> normal_distribution_Ro(Mu_Ro,Sigma_Ro);
615     std::uniform_real_distribution<double> uniform_distribution_Cp(Mu_Cp-Sigma_Cp,Mu_Cp+Sigma_Cp);
616     std::normal_distribution<double> normal_distribution_Cp(Mu_Cp,Sigma_Cp);
617     MG_CG_GROUPE_FORME* mgcg_groupe_forme = m_mgcg_modele->get_mgcg_groupe_forme(Nom_groupe_forme);
618     std::map<long,MG_CG_FORME*>::iterator it_forme;
619     for(MG_CG_FORME* forme = mgcg_groupe_forme->get_premiere_mgcg_forme(it_forme);forme!=NULL;forme=mgcg_groupe_forme->get_suivante_mgcg_forme(it_forme))
620 couturad 919 {
621 couturad 971 double Lambda;
622     if(Type_distribution_Lambda==MSTRUCT::TYPE_DISTRIBUTION::FIXE) Lambda=Mu_Lambda;
623     else if(Type_distribution_Lambda==MSTRUCT::TYPE_DISTRIBUTION::UNIFORME) Lambda=uniform_distribution_Lambda(generateur);
624     else if(Type_distribution_Lambda==MSTRUCT::TYPE_DISTRIBUTION::NORMALE) Lambda=normal_distribution_Lambda(generateur);
625     double Ro;
626     if(Type_distribution_Ro==MSTRUCT::TYPE_DISTRIBUTION::FIXE) Ro=Mu_Ro;
627     else if(Type_distribution_Ro==MSTRUCT::TYPE_DISTRIBUTION::UNIFORME) Ro=uniform_distribution_Ro(generateur);
628     else if(Type_distribution_Ro==MSTRUCT::TYPE_DISTRIBUTION::NORMALE) Ro=normal_distribution_Ro(generateur);
629     double Cp;
630     if(Type_distribution_Cp==MSTRUCT::TYPE_DISTRIBUTION::FIXE) Cp=Mu_Cp;
631     else if(Type_distribution_Cp==MSTRUCT::TYPE_DISTRIBUTION::UNIFORME) Cp=uniform_distribution_Cp(generateur);
632     else if(Type_distribution_Cp==MSTRUCT::TYPE_DISTRIBUTION::NORMALE) Cp=normal_distribution_Cp(generateur);
633     if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME)
634     {
635     MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme;
636     forme_volume->get_mg_volume()->ajouter_ccf((char*)"Kx",Lambda);
637     forme_volume->get_mg_volume()->ajouter_ccf((char*)"Ro",Ro);
638     forme_volume->get_mg_volume()->ajouter_ccf((char*)"Cp",Cp);
639     }
640     if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME)
641     {
642     MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme;
643     std::map<long,MG_VOLUME*>::iterator it_volume;
644     for(MG_VOLUME* volume = forme_multi_volume->get_premier_mg_volume(it_volume);volume!=NULL;volume=forme_multi_volume->get_suivant_mg_volume(it_volume))
645     {
646     volume->ajouter_ccf((char*)"Kx",Lambda);
647     volume->ajouter_ccf((char*)"Ro",Ro);
648     volume->ajouter_ccf((char*)"Cp",Cp);
649     }
650     }
651 couturad 919 }
652     }
653 couturad 971 }
654 couturad 919 ot_cpu.ajouter_etape((char*)"generation_materiau");
655 couturad 926 double temps_generation_materiau;
656     ot_cpu.get_etape((char*)"generation_materiau",temps_generation_materiau);
657     change_temps_materiau(get_temps_materiau()+temps_generation_materiau);
658 couturad 919 return OK;
659     }
660    
661 couturad 926 int MSTRUCT_VES::generer_carte(OT_PARAMETRES *param)
662 couturad 919 {
663     double Ecart_nodal = param->get_valeur((char*)"Ecart_nodal");
664 couturad 937 double Ecart_nodal_face_particule = param->get_valeur((char*)"Ecart_nodal_face_particule");
665 couturad 919 double Fechantillonnage = param->get_valeur((char*)"Fechantillonnage");
666     double Nb_cellule_direction = param->get_valeur((char*)"Nb_cellule_direction");
667     std::string Nom_fem_solution = param->get_nom((char*)"Nom_fem_solution");
668     std::string Nom_mg_gestionnaire_carte = param->get_nom((char*)"Nom_mg_gestionnaire_carte");
669     std::string Nom_carte = param->get_nom((char*)"Nom_carte");
670     double Nb_couche_min = param->get_valeur((char*)"Nb_couche_min");
671     double Nb_pas = param->get_valeur((char*)"Nb_pas");
672     double Facteur_augmentation = param->get_valeur((char*)"Facteur_augmentation");
673     MG_GESTIONNAIRE *mggest_carte = new MG_GESTIONNAIRE;
674 couturad 926 MG_CG_GROUPE_FORME* mgcg_groupe_matrice = m_mgcg_modele->get_mgcg_groupe_forme((char*)"Matrice");
675     TPL_MAP_ENTITE<MG_VOLUME*> tpl_map_volume_matrice = mgcg_groupe_matrice->get_tpl_map_volume();
676 couturad 919 OT_CPU ot_cpu;
677     ot_cpu.initialise();
678     FCT_TAILLE_FEM_SOLUTION_GENERATEUR_MICROSTRUCTURE *carte = new FCT_TAILLE_FEM_SOLUTION_GENERATEUR_MICROSTRUCTURE(mggest_carte,
679     m_mg_geometrie,
680     Ecart_nodal,
681 couturad 937 Ecart_nodal_face_particule,
682 couturad 919 Fechantillonnage,
683     Nb_cellule_direction,
684     (char*)Nom_fem_solution.c_str(),
685     tpl_map_volume_matrice,
686     Nb_couche_min,
687     Nb_pas,
688     Facteur_augmentation);
689 couturad 926
690    
691 couturad 933 carte->active_affichage(fonc_affiche);
692 couturad 926 carte->construit();
693 couturad 919 ot_cpu.ajouter_etape((char*)"generation_carte");
694 couturad 926 double temps_generation_carte;
695     ot_cpu.get_etape((char*)"generation_carte",temps_generation_carte);
696     change_temps_carte(get_temps_carte()+temps_generation_carte);
697     mggest_carte->enregistrer(Nom_mg_gestionnaire_carte.c_str());
698 couturad 919 carte->enregistrer((char*)Nom_carte.c_str());
699 couturad 964 char message[1000];
700     std::sprintf(message,"Fichier CARTE de sortie : %s",Nom_carte.c_str());
701     affiche(message);
702 couturad 926 m_ves_file->change_nom_fichier_carte((char*)Nom_carte.c_str());
703 couturad 919 return OK;
704     }
705    
706 couturad 926 int MSTRUCT_VES::generer_maillage(OT_PARAMETRES *param,FCT_TAILLE_FEM_SOLUTION* carte)
707 couturad 919 {
708     OT_CPU ot_cpu;
709     ot_cpu.initialise();
710     int Niveau = (int)param->get_valeur((char*)"Niveau");
711     int Niveau_opt_2d = (int)param->get_valeur((char*)"Niveau_opt_2d");
712     int Niveau_opt_3d = (int)param->get_valeur((char*)"Niveau_opt_3d");
713     double Priorite_metrique = param->get_valeur((char*)"Priorite_metrique");
714     int Analyse = (int)param->get_valeur((char*)"Analyse");
715     affiche((char*)"Maillage du VER :");
716     m_mg_maillage = new MG_MAILLAGE(m_mg_geometrie);
717     m_mg_gestionnaire->ajouter_mg_maillage(m_mg_maillage);
718 couturad 951 change_mg_maillage(m_mg_maillage);
719 couturad 993 affiche((char*)"Maillage 3D_couche :");
720 couturad 951 MAILLEUR3D_COUCHE m3d_couche(m_mg_maillage,m_mg_geometrie,carte);
721 couturad 993 m3d_couche.active_affichage(fonc_affiche);
722 couturad 951 LISTE_MG_VOLUME::iterator it_volume;
723     for(MG_VOLUME* volume=m_mg_geometrie->get_premier_volume(it_volume);volume!=NULL;volume=m_mg_geometrie->get_suivant_volume(it_volume))
724 couturad 919 {
725 couturad 951 if(volume->est_mince())
726     {
727     char message[1000];
728 couturad 993 sprintf(message,"-> Maillage du volume id %li",volume->get_id());
729 couturad 951 affiche(message);
730 couturad 966 if(m3d_couche.maille(volume)==FAIL) return FAIL;
731 couturad 951 }
732 couturad 919 }
733 couturad 951 if(Niveau>=0)
734 couturad 919 {
735 couturad 993 long i=1;
736     long nb=m_mg_geometrie->get_nb_mg_sommet();
737 couturad 951 MAILLEUR0D m0d(m_mg_maillage,m_mg_geometrie);
738 couturad 993 affiche((char*)"Maillage 0D :");
739 couturad 951 LISTE_MG_SOMMET::iterator it_sommet;
740     for(MG_SOMMET* sommet=m_mg_geometrie->get_premier_sommet(it_sommet);sommet!=NULL;sommet=m_mg_geometrie->get_suivant_sommet(it_sommet))
741     {
742     if(sommet->get_lien_maillage()->get_nb()>0) continue;
743     char message[1000];
744 couturad 993 sprintf(message,"[%4li/%li] Maillage du sommet id %li",i,nb,sommet->get_id());
745 couturad 951 affiche(message);
746 couturad 966 if(m0d.maille(sommet)==FAIL) return FAIL;
747 couturad 993 i++;
748 couturad 951 }
749 couturad 919 }
750 couturad 951 if(Niveau>=1)
751 couturad 919 {
752 couturad 993 long i=1;
753     long nb=m_mg_geometrie->get_nb_mg_arete();
754 couturad 951 MAILLEUR1D m1d(m_mg_maillage,m_mg_geometrie,carte);
755 couturad 993 affiche((char*)"Maillage 1D :");
756 couturad 951 m1d.active_affichage(fonc_affiche);
757     LISTE_MG_ARETE::iterator it_arete;
758     for(MG_ARETE* arete=m_mg_geometrie->get_premier_arete(it_arete);arete!=NULL;arete=m_mg_geometrie->get_suivant_arete(it_arete))
759     {
760     if(arete->get_lien_maillage()->get_nb()>0) continue;
761     char message[1000];
762 couturad 993 sprintf(message,"[%4li/%li] Maillage de l'arete id %li",i,nb,arete->get_id());
763 couturad 951 affiche(message);
764 couturad 966 if(m1d.maille(arete)==FAIL) return FAIL;
765 couturad 993 i++;
766 couturad 951 }
767 couturad 919 }
768 couturad 951 if(Niveau>=2)
769 couturad 919 {
770 couturad 993 long i=1;
771     long nb=m_mg_geometrie->get_nb_mg_face();
772 couturad 951 MAILLEUR2D m2d(m_mg_maillage,m_mg_geometrie,carte);
773     m2d.change_niveau_optimisation(Niveau_opt_2d);
774     m2d.change_priorite_metrique(Priorite_metrique);
775 couturad 993 affiche((char*)"Maillage 2D :");
776 couturad 951 m2d.active_affichage(fonc_affiche);
777     LISTE_MG_FACE::iterator it_face;
778     for(MG_FACE* face=m_mg_geometrie->get_premier_face(it_face);face!=NULL;face=m_mg_geometrie->get_suivant_face(it_face))
779     {
780     if(face->get_lien_maillage()->get_nb()>0) continue;
781     char message[1000];
782 couturad 993 sprintf(message,"[%4li/%li] Maillage de la face id %li",i,nb,face->get_id());
783 couturad 951 affiche(message);
784 couturad 966 if(m2d.maille(face)==FAIL) return FAIL;
785 couturad 993 i++;
786 couturad 951 }
787 couturad 919 }
788 couturad 951 if(Niveau>=3)
789     {
790 couturad 993 long i=1;
791     long nb=m_mg_geometrie->get_nb_mg_volume();
792 couturad 951 MAILLEUR3D m3d(m_mg_maillage,m_mg_geometrie,carte,false);
793     m3d.change_niveau_optimisation(Niveau_opt_3d);
794     m3d.change_priorite_metrique(Priorite_metrique);
795 couturad 993 affiche((char*)"Maillage 3D :");
796 couturad 951 m3d.active_affichage(fonc_affiche);
797     for(MG_VOLUME* volume=m_mg_geometrie->get_premier_volume(it_volume);volume!=NULL;volume=m_mg_geometrie->get_suivant_volume(it_volume))
798     {
799     if(volume->get_lien_maillage()->get_nb()>0) continue;
800     if(volume->est_mince()) continue;
801     char message[1000];
802 couturad 993 sprintf(message,"[%4li/%li] Maillage du volume id %li",i,nb,volume->get_id());
803 couturad 951 affiche(message);
804 couturad 966 if(m3d.maille(volume)==FAIL) return FAIL;
805 couturad 993 i++;
806 couturad 951 }
807     }
808 couturad 919 ot_cpu.ajouter_etape((char*)"generation_maillage");
809 couturad 926 double temps_generation_maillage;
810     ot_cpu.get_etape((char*)"generation_maillage",temps_generation_maillage);
811     change_temps_maillage(get_temps_maillage()+temps_generation_maillage);
812 couturad 919 return OK;
813     }
814    
815 couturad 926 int MSTRUCT_VES::generer_fem_maillage(OT_PARAMETRES *param)
816 couturad 919 {
817     OT_CPU ot_cpu;
818     ot_cpu.initialise();
819     int Degre = (int)param->get_valeur((char*)"Degre");
820     int Analyse = (int)param->get_valeur((char*)"Analyse");
821     int Optimisation_num_noeud = (int)param->get_valeur((char*)"Optimisation_num_noeud");
822     MAILLEUR_FEM mailleurfem;
823     mailleurfem.active_affichage(fonc_affiche);
824 couturad 926 m_fem_maillage = new FEM_MAILLAGE(m_mg_maillage->get_mg_geometrie(),m_mg_maillage,Degre);
825 couturad 919 m_mg_gestionnaire->ajouter_fem_maillage(m_fem_maillage);
826 couturad 926 change_fem_maillage(m_fem_maillage);
827 couturad 966 if(Optimisation_num_noeud) {if(mailleurfem.maille(m_fem_maillage,1)==FAIL) return FAIL;}
828     else {if(mailleurfem.maille(m_fem_maillage,0)==FAIL) return FAIL;};
829 couturad 919 if(Analyse)
830     {
831     MAILLEUR_ANALYSE m3d(m_fem_maillage);
832     m3d.active_affichage(fonc_affiche);
833     // m3d.analyse();
834     }
835     ot_cpu.ajouter_etape((char*)"generation_fem_maillage");
836 couturad 926 double temps_generation_fem_maillage;
837     ot_cpu.get_etape((char*)"generation_fem_maillage",temps_generation_fem_maillage);
838     change_temps_fem_maillage(get_temps_fem_maillage()+temps_generation_fem_maillage);
839 couturad 919 return OK;
840     }
841    
842 couturad 926 int MSTRUCT_VES::generer_etude(OT_PARAMETRES *param)
843 couturad 919 {
844     OT_CPU ot_cpu;
845     ot_cpu.initialise();
846 couturad 926 BOITE_3D boite3D_ves = get_boite3d_ves();
847     double eps = get_precision();
848 couturad 982 int Type_etude = (int)param->get_valeur((char*)"Type_etude");
849     int Type_Chargement = (int)param->get_valeur((char*)"Type_Chargement");
850     int Type_CL = (int)param->get_valeur((char*)"Type_CL");
851     double Valeur_CL = param->get_valeur((char*)"Valeur_CL");
852     int Direction = (int)param->get_valeur((char*)"Direction");
853     MSTRUCT_OUTILS::appliquer_conditions_limites(m_mg_geometrie,boite3D_ves,Type_etude,Type_CL,Type_Chargement,Valeur_CL,Direction,eps);
854 couturad 919 ot_cpu.ajouter_etape((char*)"generation_etude");
855 couturad 926 double temps_generation_etude;
856     ot_cpu.get_etape((char*)"generation_etude",temps_generation_etude);
857     change_temps_etude(get_temps_etude()+temps_generation_etude);
858 couturad 919 return OK;
859     }
860    
861 couturad 968 int MSTRUCT_VES::generer_calcul(OT_PARAMETRES *param,char* param_aster,std::string nom_etude)
862 couturad 919 {
863     int Type_etude = (int)param->get_valeur((char*)"Type_etude");
864 couturad 971 int Type_calcul;
865     if(Type_etude==MSTRUCT::TYPE_ETUDE::MECANIQUE) Type_calcul=MAGIC::CALCUL_ASTER::ELASTIQUE;
866     else if(Type_etude==MSTRUCT::TYPE_ETUDE::THERMIQUE) Type_calcul=MAGIC::CALCUL_ASTER::THERMIQUE;
867 couturad 919 std::string Code_resu = param->get_nom((char*)"Code_resu");
868     MGASTER mgaster;
869     mgaster.active_affichage(fonc_affiche);
870     OT_CPU ot_cpu;
871     ot_cpu.initialise();
872 couturad 968 mgaster.calcule(param_aster,m_fem_maillage,(char*)nom_etude.c_str(),Type_calcul,(char*)Code_resu.c_str());
873 couturad 919 ot_cpu.ajouter_etape((char*)"calcul");
874 couturad 926 double temps_calcul;
875     ot_cpu.get_etape((char*)"calcul",temps_calcul);
876     change_temps_calcul(get_temps_calcul()+temps_calcul);
877 couturad 919 }
878    
879 couturad 968 int MSTRUCT_VES::generer_post_traitement(std::vector<OT_PARAMETRES *>& vector_params_post_traitement)
880 couturad 919 {
881 couturad 926 OT_CPU ot_cpu;
882     ot_cpu.initialise();
883     std::vector<OT_PARAMETRES*>::iterator it;
884 couturad 968 char ligne[1000];
885     for(it=vector_params_post_traitement.begin();it!=vector_params_post_traitement.end();it++)
886 couturad 919 {
887 couturad 926 OT_PARAMETRES* param = *it;
888 couturad 968 int Type_post_traitement = (int)param->get_valeur((char*)"Type_post_traitement");
889 couturad 926 std::string Identifiant = param->get_nom((char*)"Identifiant");
890     if(get_analyse(Identifiant)!=NULL)
891     {
892     std::cerr << "*** Analyse [" << Identifiant << "] existante ***" << std::endl;
893     continue;
894     }
895     sprintf(ligne,"-> %s",Identifiant.c_str());
896     affiche(ligne);
897 couturad 968 if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP)
898 couturad 926 {
899     long Num_solution = (long)param->get_valeur((char*)"Num_solution");
900 couturad 968 std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
901     double Largeur_colonne_distribution = (double)param->get_valeur((char*)"Largeur_colonne_distribution");
902     BOITE_3D *boite_3d_analyse=NULL;
903     int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse");
904     if(Boite_analyse)
905     {
906     double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin");
907     double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin");
908     double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin");
909     double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax");
910     double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax");
911     double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax");
912     boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
913     }
914     int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
915 couturad 926 FEM_SOLUTION* sol = m_mg_gestionnaire->get_fem_solution(Num_solution);
916     int nb_champ = sol->get_nb_champ();
917 couturad 968 MSTRUCT_ANALYSE_CHAMP* analyse_champ = new MSTRUCT_ANALYSE_CHAMP(this,Identifiant,sol->get_id(),nb_champ,Largeur_colonne_distribution,Nom_groupe_forme,boite_3d_analyse);
918     if(Analyse_erosion)
919 couturad 930 {
920 couturad 968 long Nb_couche = (long)param->get_valeur((char*)"Nb_couche");
921     double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche");
922     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_champ,Nb_couche,Epaisseur_couche);
923     analyse_erosion->executer();
924     ajouter_analyse(analyse_erosion);
925 couturad 930 }
926     else
927     {
928 couturad 968 analyse_champ->executer();
929     ajouter_analyse(analyse_champ);
930 couturad 930 }
931 couturad 968 if(boite_3d_analyse!=NULL) delete boite_3d_analyse;
932     }
933     else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_ORIENTATION)
934 couturad 926 {
935 couturad 968 std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
936     int Avec_fem_maillage = (int)param->get_valeur((char*)"Avec_fem_maillage");
937     BOITE_3D *boite_3d_analyse=NULL;
938     int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse");
939     if(Boite_analyse)
940 couturad 930 {
941 couturad 968 double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin");
942     double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin");
943     double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin");
944     double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax");
945     double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax");
946     double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax");
947     boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
948 couturad 930 }
949 couturad 968 MSTRUCT_ANALYSE_ORIENTATION* analyse_orientation = new MSTRUCT_ANALYSE_ORIENTATION(this,Identifiant,Nom_groupe_forme,boite_3d_analyse,Avec_fem_maillage);
950     int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
951     if(Analyse_erosion)
952 couturad 930 {
953 couturad 968 long Nb_couche = (long)param->get_valeur((char*)"Nb_couche");
954     double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche");
955     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_orientation,Nb_couche,Epaisseur_couche);
956     analyse_erosion->executer();
957     ajouter_analyse(analyse_erosion);
958 couturad 930 }
959 couturad 938 else
960     {
961 couturad 968 analyse_orientation->executer();
962     ajouter_analyse(analyse_orientation);
963 couturad 938 }
964 couturad 968 if(boite_3d_analyse!=NULL) delete boite_3d_analyse;
965 couturad 938 }
966 couturad 968 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CAO)
967 couturad 926 {
968 couturad 968 std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
969 couturad 926 double Largeur_colonne_distribution_volume_forme = (double)param->get_valeur((char*)"Largeur_colonne_distribution_volume_forme");
970 couturad 968 MSTRUCT_ANALYSE_CAO* analyse_cao = new MSTRUCT_ANALYSE_CAO(this,Identifiant,Largeur_colonne_distribution_volume_forme,Nom_groupe_forme);
971     analyse_cao->executer();
972     ajouter_analyse(analyse_cao);
973 couturad 926 }
974 couturad 971 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_PROPRIETE_MASSIQUE)
975     {
976     std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
977     MSTRUCT_ANALYSE_PROPRIETE_MASSIQUE* analyse_prop_mass = new MSTRUCT_ANALYSE_PROPRIETE_MASSIQUE(this,Identifiant,Nom_groupe_forme);
978     analyse_prop_mass->executer();
979     ajouter_analyse(analyse_prop_mass);
980     }
981 couturad 968 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_MAILLAGE_MG)
982 couturad 926 {
983 couturad 968 std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
984 couturad 926 double Largeur_colonne_distribution_qualite_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_qualite_2D");
985     double Largeur_colonne_distribution_qualite_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_qualite_3D");
986     double Largeur_colonne_distribution_taille_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_taille_2D");
987     double Largeur_colonne_distribution_taille_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_taille_3D");
988 couturad 968 BOITE_3D *boite_3d_analyse=NULL;
989     int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse");
990     if(Boite_analyse)
991 couturad 930 {
992 couturad 968 double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin");
993     double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin");
994     double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin");
995     double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax");
996     double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax");
997     double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax");
998     boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
999 couturad 930 }
1000 couturad 968 MSTRUCT_ANALYSE_MG_MAILLAGE* analyse_mg_maillage = new MSTRUCT_ANALYSE_MG_MAILLAGE(this,
1001     Identifiant,
1002     m_mg_maillage->get_id(),
1003     Largeur_colonne_distribution_qualite_2D,
1004     Largeur_colonne_distribution_taille_2D,
1005     Largeur_colonne_distribution_qualite_3D,
1006     Largeur_colonne_distribution_taille_3D,
1007     Nom_groupe_forme,boite_3d_analyse);
1008     int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
1009     if(Analyse_erosion)
1010     {
1011     long Nb_couche = (long)param->get_valeur((char*)"Nb_couche");
1012     double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche");
1013     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_mg_maillage,Nb_couche,Epaisseur_couche);
1014     analyse_erosion->executer();
1015     ajouter_analyse(analyse_erosion);
1016     }
1017 couturad 930 else
1018     {
1019 couturad 968 analyse_mg_maillage->executer();
1020     ajouter_analyse(analyse_mg_maillage);
1021 couturad 930 }
1022 couturad 968 if(boite_3d_analyse!=NULL) delete boite_3d_analyse;
1023 couturad 926 }
1024 couturad 968 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_MAILLAGE_FEM)
1025 couturad 926 {
1026 couturad 968 std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
1027 couturad 926 double Largeur_colonne_distribution_jacobien_2D_min = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_2D_min");
1028     double Largeur_colonne_distribution_jacobien_2D_max = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_2D_max");
1029     double Largeur_colonne_distribution_jacobien_3D_min = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_3D_min");
1030     double Largeur_colonne_distribution_jacobien_3D_max = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_3D_max");
1031     double Largeur_colonne_distribution_distortion_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_distortion_2D");
1032     double Largeur_colonne_distribution_distortion_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_distortion_3D");
1033 couturad 968 BOITE_3D *boite_3d_analyse=NULL;
1034     int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse");
1035     if(Boite_analyse)
1036     {
1037     double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin");
1038     double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin");
1039     double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin");
1040     double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax");
1041     double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax");
1042     double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax");
1043     boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
1044     }
1045     MSTRUCT_ANALYSE_FEM_MAILLAGE* analyse_maillage_fem = new MSTRUCT_ANALYSE_FEM_MAILLAGE(this,
1046     Identifiant,
1047 couturad 926 m_fem_maillage->get_id(),
1048     Largeur_colonne_distribution_jacobien_2D_min,
1049     Largeur_colonne_distribution_jacobien_2D_max,
1050     Largeur_colonne_distribution_jacobien_3D_min,
1051     Largeur_colonne_distribution_jacobien_3D_max,
1052     Largeur_colonne_distribution_distortion_2D,
1053     Largeur_colonne_distribution_distortion_3D,
1054     Nom_groupe_forme,
1055     boite_3d_analyse);
1056 couturad 968 int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
1057     if(Analyse_erosion)
1058 couturad 930 {
1059 couturad 968 long Nb_couche = (long)param->get_valeur((char*)"Nb_couche");
1060     double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche");
1061     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_maillage_fem,Nb_couche,Epaisseur_couche);
1062     analyse_erosion->executer();
1063     ajouter_analyse(analyse_erosion);
1064 couturad 930 }
1065     else
1066     {
1067 couturad 968 analyse_maillage_fem->executer();
1068     ajouter_analyse(analyse_maillage_fem);
1069 couturad 930 }
1070 couturad 968 if(boite_3d_analyse!=NULL) delete boite_3d_analyse;
1071 couturad 926 }
1072 couturad 968 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP_NORMALISE)
1073     {
1074     std::string Identifiant_champ = param->get_nom((char*)"Identifiant_champ");
1075 couturad 982 std::string Identifiant_champ_reference = param->get_nom((char*)"Identifiant_champ_reference");
1076 couturad 968 double Largeur_colonne_distribution = (double)param->get_valeur((char*)"Largeur_colonne_distribution");
1077     if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP)
1078     {
1079     MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)get_analyse(Identifiant_champ);
1080 couturad 982 MSTRUCT_ANALYSE_CHAMP* analyse_champ_reference = (MSTRUCT_ANALYSE_CHAMP*)get_analyse(Identifiant_champ_reference);
1081     double valeur_ref=0.0;
1082     int nb_champ=analyse_champ_reference->get_nb_champ();
1083 couturad 997 for(int i=0;i<nb_champ;i++)
1084     {
1085     valeur_ref+=analyse_champ_reference->get_moyenne()[i]*analyse_champ_reference->get_moyenne()[i];
1086     }
1087     valeur_ref=sqrt(valeur_ref);
1088     // for(int i=0;i<nb_champ;i++) if(abs(analyse_champ_reference->get_moyenne()[i])>valeur_ref) valeur_ref=abs(analyse_champ_reference->get_moyenne()[i]);
1089 couturad 982 MSTRUCT_ANALYSE_CHAMP* analyse_normalise = analyse_champ->normaliser(Identifiant,valeur_ref,Largeur_colonne_distribution);
1090 couturad 968 ajouter_analyse(analyse_normalise);
1091     }
1092     else if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1093     {
1094     MSTRUCT_ANALYSE_EROSION* analyse_erosion_champ = (MSTRUCT_ANALYSE_EROSION*)get_analyse(Identifiant_champ);
1095     double epaisseur_couche = analyse_erosion_champ->get_epaisseur_couche();
1096     std::string Nom_groupe_forme = analyse_erosion_champ->get_nom_groupe_forme();
1097     BOITE_3D *boite_3d_analyse=analyse_erosion_champ->get_boite_analyse();
1098     MSTRUCT_ANALYSE_EROSION* analyse_erosion_normalise = new MSTRUCT_ANALYSE_EROSION(Identifiant,epaisseur_couche,Nom_groupe_forme,boite_3d_analyse);
1099     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion;
1100 couturad 982 int k=0;
1101     double valeur_ref=0.0;
1102 couturad 968 for(MSTRUCT_ANALYSE* analyse=analyse_erosion_champ->get_premiere_analyse(it_analyse_erosion);analyse!=NULL;analyse=analyse_erosion_champ->get_suivante_analyse(it_analyse_erosion))
1103     {
1104 couturad 982 if(k==0)
1105     {
1106     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion_reference;
1107     MSTRUCT_ANALYSE_EROSION* analyse_erosion_champ_reference = (MSTRUCT_ANALYSE_EROSION*)get_analyse(Identifiant_champ_reference);
1108     MSTRUCT_ANALYSE_CHAMP* analyse_champ_reference = (MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_champ_reference->get_premiere_analyse(it_analyse_erosion_reference);
1109     int nb_champ=analyse_champ_reference->get_nb_champ();
1110 couturad 1000 for(int i=0;i<nb_champ;i++)
1111     {
1112     valeur_ref+=analyse_champ_reference->get_moyenne()[i]*analyse_champ_reference->get_moyenne()[i];
1113     }
1114     valeur_ref=sqrt(valeur_ref);
1115 couturad 982 }
1116 couturad 968 MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)analyse;
1117 couturad 982 MSTRUCT_ANALYSE_CHAMP* analyse_normalise = analyse_champ->normaliser(Identifiant,valeur_ref,Largeur_colonne_distribution);
1118 couturad 968 analyse_erosion_normalise->ajouter_analyse(analyse_normalise);
1119 couturad 982 k++;
1120 couturad 968 }
1121     ajouter_analyse(analyse_erosion_normalise);
1122     }
1123     }
1124     else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP_ECART)
1125     {
1126     std::string Identifiant_champ = param->get_nom((char*)"Identifiant_champ");
1127     if(get_analyse(Identifiant_champ)==NULL)
1128     {
1129     std::cerr << "*** Analyse [" << Identifiant << "] inexistante ***" << std::endl;
1130     return FAIL;
1131     }
1132     std::string Identifiant_champ_compare = param->get_nom((char*)"Identifiant_champ_compare");
1133     if(get_analyse(Identifiant_champ_compare)==NULL)
1134     {
1135     std::cerr << "*** Analyse [" << Identifiant << "] inexistante ***" << std::endl;
1136     return FAIL;
1137     }
1138     double Largeur_colonne_distribution = (double)param->get_valeur((char*)"Largeur_colonne_distribution");
1139     int Type_ecart = (int)param->get_valeur((char*)"Type_ecart");
1140     if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP)
1141     {
1142     MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)get_analyse(Identifiant_champ);
1143     MSTRUCT_ANALYSE* analyse_compare = get_analyse(Identifiant_champ_compare);
1144     if(analyse_compare->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP)
1145     {
1146     MSTRUCT_ANALYSE_CHAMP* analyse_champ_compare = (MSTRUCT_ANALYSE_CHAMP*)analyse_compare;
1147     MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart(Identifiant,Largeur_colonne_distribution,analyse_champ_compare,Type_ecart);
1148     ajouter_analyse(analyse_ecart);
1149     }
1150     else if(analyse_compare->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1151     {
1152     MSTRUCT_ANALYSE_EROSION* analyse_erosion_compare = (MSTRUCT_ANALYSE_EROSION*)analyse_compare;
1153     int Num_couche = (int)param->get_valeur((char*)"Num_couche");
1154     if(Num_couche>=0)
1155     {
1156     MSTRUCT_ANALYSE_CHAMP* analyse_champ_compare=(MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_compare->get_analyse(Num_couche);
1157     MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart(Identifiant,Largeur_colonne_distribution,analyse_champ_compare,Type_ecart);
1158     ajouter_analyse(analyse_ecart);
1159     }
1160     else
1161     {
1162     double epaisseur_couche = analyse_erosion_compare->get_epaisseur_couche();
1163     std::string Nom_groupe_forme = analyse_erosion_compare->get_nom_groupe_forme();
1164     BOITE_3D *boite_3d_analyse=analyse_erosion_compare->get_boite_analyse();
1165     MSTRUCT_ANALYSE_EROSION* analyse_erosion_ecart = new MSTRUCT_ANALYSE_EROSION(Identifiant,epaisseur_couche,Nom_groupe_forme,boite_3d_analyse);
1166     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion;
1167     for(MSTRUCT_ANALYSE* analyse_champ_compare=analyse_erosion_compare->get_premiere_analyse(it_analyse_erosion);analyse_champ_compare!=NULL;analyse_champ_compare=analyse_erosion_compare->get_suivante_analyse(it_analyse_erosion))
1168     {
1169     MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart(Identifiant,Largeur_colonne_distribution,(MSTRUCT_ANALYSE_CHAMP*)analyse_champ_compare,Type_ecart);
1170     analyse_erosion_ecart->ajouter_analyse(analyse_ecart);
1171     }
1172     ajouter_analyse(analyse_erosion_ecart);
1173     }
1174    
1175     }
1176     }
1177     else if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1178     {
1179     MSTRUCT_ANALYSE_EROSION* analyse_erosion_champ = (MSTRUCT_ANALYSE_EROSION*)get_analyse(Identifiant_champ);
1180     double epaisseur_couche = analyse_erosion_champ->get_epaisseur_couche();
1181     std::string Nom_groupe_forme = analyse_erosion_champ->get_nom_groupe_forme();
1182     BOITE_3D *boite_3d_analyse=analyse_erosion_champ->get_boite_analyse();
1183     MSTRUCT_ANALYSE_EROSION* analyse_erosion_ecart = new MSTRUCT_ANALYSE_EROSION(Identifiant,epaisseur_couche,Nom_groupe_forme,boite_3d_analyse);
1184     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion;
1185     for(MSTRUCT_ANALYSE* analyse=analyse_erosion_champ->get_premiere_analyse(it_analyse_erosion);analyse!=NULL;analyse=analyse_erosion_champ->get_suivante_analyse(it_analyse_erosion))
1186     {
1187     MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)analyse;
1188     MSTRUCT_ANALYSE* analyse_compare = get_analyse(Identifiant_champ_compare);
1189     if(analyse_compare->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP)
1190     {
1191     MSTRUCT_ANALYSE_CHAMP* analyse_champ_compare = (MSTRUCT_ANALYSE_CHAMP*)analyse_compare;
1192     MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart(Identifiant,Largeur_colonne_distribution,analyse_champ_compare,Type_ecart);
1193     analyse_erosion_ecart->ajouter_analyse(analyse_ecart);
1194     }
1195     else if(analyse_compare->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1196     {
1197     MSTRUCT_ANALYSE_EROSION* analyse_erosion_compare = (MSTRUCT_ANALYSE_EROSION*)analyse_compare;
1198     int Num_couche = (int)param->get_valeur((char*)"Num_couche");
1199     if(Num_couche>=0)
1200     {
1201     MSTRUCT_ANALYSE_CHAMP* analyse_champ_compare=(MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_compare->get_analyse(Num_couche);
1202     MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart(Identifiant,Largeur_colonne_distribution,analyse_champ_compare,Type_ecart);
1203     analyse_erosion_ecart->ajouter_analyse(analyse_ecart);
1204     }
1205     else
1206     {
1207    
1208     }
1209    
1210     }
1211     }
1212     ajouter_analyse(analyse_erosion_ecart);
1213     }
1214     }
1215     else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP_ECART_CHARGEMENT)
1216     {
1217     std::string Identifiant_champ = param->get_nom((char*)"Identifiant_champ");
1218     if(get_analyse(Identifiant_champ)==NULL)
1219     {
1220     std::cerr << "*** Analyse [" << Identifiant << "] inexistante ***" << std::endl;
1221     return FAIL;
1222     }
1223     double Largeur_colonne_distribution = (double)param->get_valeur((char*)"Largeur_colonne_distribution");
1224     int Type_chargement = (int)param->get_valeur((char*)"Type_chargement");
1225     int Type_ecart = (int)param->get_valeur((char*)"Type_ecart");
1226     if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP)
1227     {
1228     MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)get_analyse(Identifiant_champ);
1229     MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart_chargement(Identifiant,Largeur_colonne_distribution,Type_chargement,Type_ecart);
1230     ajouter_analyse(analyse_ecart);
1231     }
1232     else if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1233     {
1234     MSTRUCT_ANALYSE_EROSION* analyse_erosion_champ = (MSTRUCT_ANALYSE_EROSION*)get_analyse(Identifiant_champ);
1235     double epaisseur_couche = analyse_erosion_champ->get_epaisseur_couche();
1236     std::string Nom_groupe_forme = analyse_erosion_champ->get_nom_groupe_forme();
1237     BOITE_3D *boite_3d_analyse=analyse_erosion_champ->get_boite_analyse();
1238     MSTRUCT_ANALYSE_EROSION* analyse_erosion_ecart = new MSTRUCT_ANALYSE_EROSION(Identifiant,epaisseur_couche,Nom_groupe_forme,boite_3d_analyse);
1239     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion;
1240     for(MSTRUCT_ANALYSE* analyse=analyse_erosion_champ->get_premiere_analyse(it_analyse_erosion);analyse!=NULL;analyse=analyse_erosion_champ->get_suivante_analyse(it_analyse_erosion))
1241     {
1242     MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)analyse;
1243     MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart_chargement(Identifiant,Largeur_colonne_distribution,Type_chargement,Type_ecart);
1244     analyse_erosion_ecart->ajouter_analyse(analyse_ecart);
1245     }
1246     ajouter_analyse(analyse_erosion_ecart);
1247     }
1248     }
1249     else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_ORIENTATION_ECART)
1250     {
1251     std::string Identifiant_orientation = param->get_nom((char*)"Identifiant_orientation");
1252     if(get_analyse(Identifiant_orientation)==NULL)
1253     {
1254     std::cerr << "*** Analyse [" << Identifiant << "] inexistante ***" << std::endl;
1255     return FAIL;
1256     }
1257     int Type_ecart = (int)param->get_valeur((char*)"Type_ecart");
1258     double tenseur_compare[6];
1259     tenseur_compare[0] = (double)param->get_valeur((char*)"a_11");
1260     tenseur_compare[1] = (double)param->get_valeur((char*)"a_22");
1261     tenseur_compare[2] = (double)param->get_valeur((char*)"a_33");
1262     tenseur_compare[3] = (double)param->get_valeur((char*)"a_12");
1263     tenseur_compare[4] = (double)param->get_valeur((char*)"a_23");
1264     tenseur_compare[5] = (double)param->get_valeur((char*)"a_13");
1265     if(get_analyse(Identifiant_orientation)->get_type()==MSTRUCT::TYPE_ANALYSE::ORIENTATION)
1266     {
1267     MSTRUCT_ANALYSE_ORIENTATION* analyse_orientation = (MSTRUCT_ANALYSE_ORIENTATION*)get_analyse(Identifiant_orientation);
1268     MSTRUCT_ANALYSE_ORIENTATION* analyse_compare = analyse_orientation->calculer_ecart(Identifiant,tenseur_compare,Type_ecart);
1269     ajouter_analyse(analyse_compare);
1270     }
1271     else if(get_analyse(Identifiant_orientation)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1272     {
1273     MSTRUCT_ANALYSE_EROSION* analyse_erosion_orientation = (MSTRUCT_ANALYSE_EROSION*)get_analyse(Identifiant_orientation);
1274     double epaisseur_couche = analyse_erosion_orientation->get_epaisseur_couche();
1275     std::string Nom_groupe_forme = analyse_erosion_orientation->get_nom_groupe_forme();
1276     BOITE_3D *boite_3d_analyse=analyse_erosion_orientation->get_boite_analyse();
1277     MSTRUCT_ANALYSE_EROSION* analyse_erosion_ecart = new MSTRUCT_ANALYSE_EROSION(Identifiant,epaisseur_couche,Nom_groupe_forme,boite_3d_analyse);
1278     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion;
1279     for(MSTRUCT_ANALYSE* analyse=analyse_erosion_orientation->get_premiere_analyse(it_analyse_erosion);analyse!=NULL;analyse=analyse_erosion_orientation->get_suivante_analyse(it_analyse_erosion))
1280     {
1281     MSTRUCT_ANALYSE_ORIENTATION* analyse_orientation = (MSTRUCT_ANALYSE_ORIENTATION*)analyse;
1282     MSTRUCT_ANALYSE_ORIENTATION* analyse_compare = analyse_orientation->calculer_ecart(Identifiant,tenseur_compare,Type_ecart);
1283     analyse_erosion_ecart->ajouter_analyse(analyse_compare);
1284     }
1285     ajouter_analyse(analyse_erosion_ecart);
1286     }
1287     }
1288 couturad 971 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CONDUCTIVITE_THERMIQUE)
1289     {
1290 couturad 982 long Num_solution_temp=(long)param->get_valeur((char*)"Num_solution_temp");
1291     long Num_solution_flux=(long)param->get_valeur((char*)"Num_solution_flux");
1292     int Direction=(int)param->get_valeur((char*)"Direction");
1293     BOITE_3D *boite_3d_analyse=NULL;
1294     int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse");
1295     if(Boite_analyse)
1296 couturad 971 {
1297 couturad 982 double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin");
1298     double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin");
1299     double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin");
1300     double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax");
1301     double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax");
1302     double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax");
1303     boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
1304 couturad 971 }
1305 couturad 982 int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
1306     FEM_SOLUTION * fem_sol_temp=get_mg_gestionnaire()->get_fem_solution(Num_solution_temp);
1307     FEM_SOLUTION * fem_sol_flux=get_mg_gestionnaire()->get_fem_solution(Num_solution_flux);
1308     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_cond_ther = new MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE(this,Identifiant,fem_sol_temp->get_id(),fem_sol_flux->get_id(),Direction,boite_3d_analyse);
1309     if(Analyse_erosion)
1310 couturad 971 {
1311 couturad 982 long Nb_couche = (long)param->get_valeur((char*)"Nb_couche");
1312     double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche");
1313     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_cond_ther,Nb_couche,Epaisseur_couche);
1314     analyse_erosion->executer();
1315     ajouter_analyse(analyse_erosion);
1316 couturad 971 }
1317     else
1318     {
1319 couturad 982 analyse_cond_ther->executer();
1320     ajouter_analyse(analyse_cond_ther);
1321 couturad 971 }
1322 couturad 982 if(boite_3d_analyse!=NULL) delete boite_3d_analyse;
1323 couturad 971 }
1324 couturad 993 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_TEMPS)
1325     {
1326    
1327     }
1328 couturad 968 else
1329     {
1330     sprintf(ligne,"ERREUR -> %s",Identifiant.c_str());
1331     affiche(ligne);
1332     }
1333 couturad 919 }
1334 couturad 926 ot_cpu.ajouter_etape((char*)"analyse");
1335     double temps_analyse;
1336     ot_cpu.get_etape((char*)"analyse",temps_analyse);
1337     change_temps_analyse(get_temps_analyse()+temps_analyse);
1338 couturad 919 }
1339    
1340 couturad 968 int MSTRUCT_VES::generer_post_traitement(std::vector<OT_PARAMETRES *>& vector_params_post_traitement,
1341     MSTRUCT_VES_FILE* ves_sph,
1342     MSTRUCT_VES_FILE* ves_dev)
1343 couturad 933 {
1344 couturad 968 OT_CPU ot_cpu;
1345     ot_cpu.initialise();
1346     std::vector<OT_PARAMETRES*>::iterator it;
1347     char ligne[1000];
1348     for(it=vector_params_post_traitement.begin();it!=vector_params_post_traitement.end();it++)
1349     {
1350     OT_PARAMETRES* param = *it;
1351     int Type_post_traitement = (int)param->get_valeur((char*)"Type_post_traitement");
1352     std::string Identifiant = param->get_nom((char*)"Identifiant");
1353     if(get_analyse(Identifiant)!=NULL)
1354     {
1355     std::cerr << "*** Analyse [" << Identifiant << "] existante ***" << std::endl;
1356     return FAIL;
1357     }
1358     sprintf(ligne,"-> %s",Identifiant.c_str());
1359     affiche(ligne);
1360     if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_MODULES_ELASTICITE)
1361     {
1362     std::string Identifiant_epsilon = param->get_nom((char*)"Identifiant_epsilon");
1363     std::string Identifiant_sigma = param->get_nom((char*)"Identifiant_sigma");
1364     if(ves_sph->get_analyse(Identifiant_epsilon)->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP)
1365     {
1366     MSTRUCT_ANALYSE_CHAMP* epsilon_sph = (MSTRUCT_ANALYSE_CHAMP*)ves_sph->get_analyse(Identifiant_epsilon);
1367     MSTRUCT_ANALYSE_CHAMP* sigma_sph = (MSTRUCT_ANALYSE_CHAMP*)ves_sph->get_analyse(Identifiant_sigma);
1368     MSTRUCT_ANALYSE_CHAMP* epsilon_dev = (MSTRUCT_ANALYSE_CHAMP*)ves_dev->get_analyse(Identifiant_epsilon);
1369     MSTRUCT_ANALYSE_CHAMP* sigma_dev = (MSTRUCT_ANALYSE_CHAMP*)ves_dev->get_analyse(Identifiant_sigma);
1370     MSTRUCT_ANALYSE_MODULES_ELASTICITE* analyse_modules_elasticite = new MSTRUCT_ANALYSE_MODULES_ELASTICITE(Identifiant,epsilon_sph,sigma_sph,epsilon_dev,sigma_dev);
1371     analyse_modules_elasticite->executer();
1372     ajouter_analyse(analyse_modules_elasticite);
1373     }
1374     else if(ves_sph->get_analyse(Identifiant_epsilon)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1375     {
1376     MSTRUCT_ANALYSE_EROSION* epsilon_sph_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_sph->get_analyse(Identifiant_epsilon);
1377     MSTRUCT_ANALYSE_EROSION* sigma_sph_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_sph->get_analyse(Identifiant_sigma);
1378     MSTRUCT_ANALYSE_EROSION* epsilon_dev_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_dev->get_analyse(Identifiant_epsilon);
1379     MSTRUCT_ANALYSE_EROSION* sigma_dev_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_dev->get_analyse(Identifiant_sigma);
1380     long Nb_couche = epsilon_sph_erosion->get_nb_analyse();
1381     double Epaisseur_couche = epsilon_sph_erosion->get_epaisseur_couche();
1382     std::string Nom_groupe_forme = epsilon_sph_erosion->get_nom_groupe_forme();
1383     BOITE_3D *boite_3d_analyse=epsilon_sph_erosion->get_boite_analyse();
1384     MSTRUCT_ANALYSE_EROSION* analyse_modules_elasticite_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,Epaisseur_couche,Nom_groupe_forme,boite_3d_analyse);
1385     for(int i=0;i<Nb_couche;i++)
1386     {
1387     MSTRUCT_ANALYSE_MODULES_ELASTICITE* analyse_modules_elasticite = new MSTRUCT_ANALYSE_MODULES_ELASTICITE(Identifiant,
1388     (MSTRUCT_ANALYSE_CHAMP*)epsilon_sph_erosion->get_analyse(i),
1389     (MSTRUCT_ANALYSE_CHAMP*)sigma_sph_erosion->get_analyse(i),
1390     (MSTRUCT_ANALYSE_CHAMP*)epsilon_dev_erosion->get_analyse(i),
1391     (MSTRUCT_ANALYSE_CHAMP*)sigma_dev_erosion->get_analyse(i));
1392     analyse_modules_elasticite->executer();
1393     analyse_modules_elasticite_erosion->ajouter_analyse(analyse_modules_elasticite);
1394     }
1395     ajouter_analyse(analyse_modules_elasticite_erosion);
1396     }
1397     }
1398     else
1399     {
1400     sprintf(ligne,"ERREUR -> %s",Identifiant.c_str());
1401     affiche(ligne);
1402     }
1403     }
1404     ot_cpu.ajouter_etape((char*)"analyse");
1405     double temps_analyse;
1406     ot_cpu.get_etape((char*)"analyse",temps_analyse);
1407     change_temps_analyse(get_temps_analyse()+temps_analyse);
1408     }
1409    
1410 couturad 971 int MSTRUCT_VES::generer_post_traitement(std::vector<OT_PARAMETRES *>& vector_params_post_traitement,
1411     MSTRUCT_VES_FILE* ves_lambda_x,
1412     MSTRUCT_VES_FILE* ves_lambda_y,
1413     MSTRUCT_VES_FILE* ves_lambda_z)
1414     {
1415     OT_CPU ot_cpu;
1416     ot_cpu.initialise();
1417     std::vector<OT_PARAMETRES*>::iterator it;
1418     char ligne[1000];
1419     for(it=vector_params_post_traitement.begin();it!=vector_params_post_traitement.end();it++)
1420     {
1421     OT_PARAMETRES* param = *it;
1422     int Type_post_traitement = (int)param->get_valeur((char*)"Type_post_traitement");
1423     std::string Identifiant = param->get_nom((char*)"Identifiant");
1424     if(get_analyse(Identifiant)!=NULL)
1425     {
1426     std::cerr << "*** Analyse [" << Identifiant << "] existante ***" << std::endl;
1427     return FAIL;
1428     }
1429     sprintf(ligne,"-> %s",Identifiant.c_str());
1430     affiche(ligne);
1431     if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CONDUCTIVITE_THERMIQUE)
1432     {
1433     std::string Identifiant = param->get_nom((char*)"Identifiant");
1434     if(ves_lambda_x->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION &&
1435     ves_lambda_y->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION &&
1436     ves_lambda_z->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1437     {
1438     MSTRUCT_ANALYSE_EROSION* erosion_lambda_x = (MSTRUCT_ANALYSE_EROSION*)ves_lambda_x->get_analyse(Identifiant);
1439     MSTRUCT_ANALYSE_EROSION* erosion_lambda_y = (MSTRUCT_ANALYSE_EROSION*)ves_lambda_y->get_analyse(Identifiant);
1440     MSTRUCT_ANALYSE_EROSION* erosion_lambda_z = (MSTRUCT_ANALYSE_EROSION*)ves_lambda_z->get_analyse(Identifiant);
1441     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_x;
1442     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_y;
1443     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_z;
1444     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_x=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_x->get_premiere_analyse(it_analyse_x);
1445     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_y=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_y->get_premiere_analyse(it_analyse_y);
1446     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_z=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_z->get_premiere_analyse(it_analyse_z);
1447     MSTRUCT_ANALYSE_EROSION* erosion_lambda_app = new MSTRUCT_ANALYSE_EROSION(Identifiant,
1448     erosion_lambda_x->get_epaisseur_couche(),
1449     erosion_lambda_x->get_nom_groupe_forme(),
1450     erosion_lambda_x->get_boite_analyse());
1451     while(analyse_lambda_x!=NULL && analyse_lambda_y!=NULL && analyse_lambda_z!=NULL)
1452     {
1453     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_app = new MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE(Identifiant,analyse_lambda_x,analyse_lambda_y,analyse_lambda_z);
1454     analyse_lambda_app->executer();
1455     erosion_lambda_app->ajouter_analyse(analyse_lambda_app);
1456     analyse_lambda_x=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_x->get_suivante_analyse(it_analyse_x);
1457     analyse_lambda_y=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_y->get_suivante_analyse(it_analyse_y);
1458     analyse_lambda_z=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_z->get_suivante_analyse(it_analyse_z);
1459     }
1460     ajouter_analyse(erosion_lambda_app);
1461     }
1462     if(ves_lambda_x->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::CONDUCTIVITE_THERMIQUE &&
1463     ves_lambda_y->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::CONDUCTIVITE_THERMIQUE &&
1464     ves_lambda_z->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::CONDUCTIVITE_THERMIQUE)
1465     {
1466     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_x=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)ves_lambda_x->get_analyse(Identifiant);
1467     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_y=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)ves_lambda_y->get_analyse(Identifiant);
1468     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_z=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)ves_lambda_z->get_analyse(Identifiant);
1469     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_app = new MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE(Identifiant,analyse_lambda_x,analyse_lambda_y,analyse_lambda_z);
1470     analyse_lambda_app->executer();
1471     ajouter_analyse(analyse_lambda_app);
1472     }
1473     }
1474     else
1475     {
1476     sprintf(ligne,"ERREUR -> %s",Identifiant.c_str());
1477     affiche(ligne);
1478     }
1479     }
1480     ot_cpu.ajouter_etape((char*)"analyse");
1481     double temps_analyse;
1482     ot_cpu.get_etape((char*)"analyse",temps_analyse);
1483     change_temps_analyse(get_temps_analyse()+temps_analyse);
1484     }
1485 couturad 968
1486    
1487 couturad 971
1488    
1489 couturad 968 int MSTRUCT_VES::exporter_maillage_abaqus(char* dossier)
1490     {
1491 couturad 933 std::ofstream f;
1492 couturad 968 char file[1000];
1493     sprintf(file,"%s/noeuds",dossier);
1494     f.open(file,std::ios::out);
1495 couturad 933 f.precision(16);
1496     f.setf(std::ios::showpoint);
1497     f << "*NODE"<< std::endl;
1498     LISTE_FEM_NOEUD::iterator it;
1499     long index=1;
1500     for (FEM_NOEUD* noeud=m_fem_maillage->get_premier_noeud(it);noeud;noeud=m_fem_maillage->get_suivant_noeud(it))
1501     {
1502     noeud->change_numero(index);
1503     double *coord=noeud->get_coord();
1504     f << noeud->get_numero() << ", " << coord[0] << ", " << coord[1] << ", " << coord[2] << std::endl;
1505     index++;
1506     }
1507     f.close();
1508 couturad 968 sprintf(file,"%s/elements",dossier);
1509     f.open(file,std::ios::out);
1510 couturad 933 f.precision(16);
1511     f.setf(std::ios::showpoint);
1512     index=1;
1513     LISTE_FEM_ELEMENT3::iterator ittele3;
1514     bool tetralin=false;
1515     for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3))
1516     {
1517     if(ele3->get_type_entite()==IDFEM_TETRA4)
1518     {
1519     if(tetralin==false)
1520     {
1521     tetralin=true;
1522     f << "*ELEMENT,TYPE=C3D4,ELSET=tetralin"<< std::endl;
1523     }
1524     f << index << ", "
1525     << ele3->get_fem_noeud(0)->get_numero() << ", "
1526     << ele3->get_fem_noeud(1)->get_numero() << ", "
1527     << ele3->get_fem_noeud(2)->get_numero() << ", "
1528     << ele3->get_fem_noeud(3)->get_numero() << std::endl;
1529     ele3->change_numero(index);
1530     index++;
1531     }
1532     }
1533     bool pentalin=false;
1534     for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3))
1535     {
1536     if(ele3->get_type_entite()==IDFEM_PENTA6)
1537     {
1538     if(pentalin==false)
1539     {
1540     pentalin=true;
1541     f << "*ELEMENT,TYPE=C3D6,ELSET=pentalin"<< std::endl;
1542     }
1543     f << index << ", "
1544     << ele3->get_fem_noeud(0)->get_numero() << ", "
1545     << ele3->get_fem_noeud(1)->get_numero() << ", "
1546     << ele3->get_fem_noeud(2)->get_numero() << ", "
1547     << ele3->get_fem_noeud(3)->get_numero() << ", "
1548     << ele3->get_fem_noeud(4)->get_numero() << ", "
1549     << ele3->get_fem_noeud(5)->get_numero() << std::endl;
1550     ele3->change_numero(index);
1551     index++;
1552     }
1553     }
1554     bool tetraquad=false;
1555     for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3))
1556     {
1557     if(ele3->get_type_entite()==IDFEM_TETRA10)
1558     {
1559     if(tetraquad==false)
1560     {
1561     tetraquad=true;
1562     f << "*ELEMENT,TYPE=C3D10,ELSET=tetraquad"<< std::endl;
1563     }
1564     f << index << ", "
1565     << ele3->get_fem_noeud(0)->get_numero() << ", "
1566     << ele3->get_fem_noeud(2)->get_numero() << ", "
1567     << ele3->get_fem_noeud(4)->get_numero() << ", "
1568     << ele3->get_fem_noeud(9)->get_numero() << ", "
1569     << ele3->get_fem_noeud(1)->get_numero() << ", "
1570     << ele3->get_fem_noeud(3)->get_numero() << ", "
1571     << ele3->get_fem_noeud(5)->get_numero() << ", "
1572     << ele3->get_fem_noeud(6)->get_numero() << ", "
1573     << ele3->get_fem_noeud(7)->get_numero() << ", "
1574     << ele3->get_fem_noeud(8)->get_numero() << std::endl;
1575     ele3->change_numero(index);
1576     index++;
1577     }
1578     }
1579     bool pentaquad=false;
1580     f << "*ELEMENT,TYPE=C3D15,ELSET=pentaquad"<< std::endl;
1581     for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3))
1582     {
1583     if(ele3->get_type_entite()==IDFEM_PENTA15)
1584     {
1585     if(pentaquad==false)
1586     {
1587     pentaquad=true;
1588     f << "*ELEMENT,TYPE=C3D15,ELSET=pentaquad"<< std::endl;
1589     }
1590     f << index << ", "
1591     << ele3->get_fem_noeud(0)->get_numero() << ", "
1592     << ele3->get_fem_noeud(2)->get_numero() << ", "
1593     << ele3->get_fem_noeud(4)->get_numero() << ", "
1594     << ele3->get_fem_noeud(9)->get_numero() << ", "
1595     << ele3->get_fem_noeud(11)->get_numero() << ", "
1596     << ele3->get_fem_noeud(13)->get_numero() << ", "
1597     << ele3->get_fem_noeud(1)->get_numero() << ", "
1598     << ele3->get_fem_noeud(3)->get_numero() << ", "
1599     << ele3->get_fem_noeud(5)->get_numero() << ", "
1600     << ele3->get_fem_noeud(10)->get_numero() << ", "
1601     << ele3->get_fem_noeud(12)->get_numero() << ", "
1602     << ele3->get_fem_noeud(14)->get_numero() << ", "
1603     << ele3->get_fem_noeud(6)->get_numero() << ", "
1604     << ele3->get_fem_noeud(7)->get_numero() << ", "
1605     << ele3->get_fem_noeud(8)->get_numero() << std::endl;
1606     ele3->change_numero(index);
1607     index++;
1608     }
1609     }
1610     f.close();
1611 couturad 968 sprintf(file,"%s/BC_nsets",dossier);
1612     f.open(file,std::ios::out);
1613 couturad 933 f.precision(16);
1614     f.setf(std::ios::showpoint);
1615     BOITE_3D boite3D_ves = get_boite3d_ves();
1616     double eps = get_precision();
1617     TPL_MAP_ENTITE<MG_FACE*> plan_xy_z0;
1618     TPL_MAP_ENTITE<MG_FACE*> plan_xy_z1;
1619     TPL_MAP_ENTITE<MG_FACE*> plan_yz_x0;
1620     TPL_MAP_ENTITE<MG_FACE*> plan_yz_x1;
1621     TPL_MAP_ENTITE<MG_FACE*> plan_xz_y0;
1622     TPL_MAP_ENTITE<MG_FACE*> plan_xz_y1;
1623     std::map<unsigned long,MG_FACE*,std::less<unsigned long>>::iterator it_face;
1624     for(MG_FACE *face = m_mg_geometrie->get_premier_face(it_face);face!=NULL;face=m_mg_geometrie->get_suivant_face(it_face))
1625     {
1626     double xyzmin[3];
1627     double xyzmax[3];
1628     face->get_xyz_min_max(xyzmin,xyzmax,16);
1629    
1630     if(OPERATEUR::egal(xyzmin[0],boite3D_ves.get_xmin(),eps) && OPERATEUR::egal(xyzmax[0],boite3D_ves.get_xmin(),eps)) plan_yz_x0.ajouter(face);
1631     else if(OPERATEUR::egal(xyzmin[0],boite3D_ves.get_xmax(),eps) && OPERATEUR::egal(xyzmax[0],boite3D_ves.get_xmax(),eps)) plan_yz_x1.ajouter(face);
1632     else if(OPERATEUR::egal(xyzmin[1],boite3D_ves.get_ymin(),eps) && OPERATEUR::egal(xyzmax[1],boite3D_ves.get_ymin(),eps)) plan_xz_y0.ajouter(face);
1633     else if(OPERATEUR::egal(xyzmin[1],boite3D_ves.get_ymax(),eps) && OPERATEUR::egal(xyzmax[1],boite3D_ves.get_ymax(),eps)) plan_xz_y1.ajouter(face);
1634     else if(OPERATEUR::egal(xyzmin[2],boite3D_ves.get_zmin(),eps) && OPERATEUR::egal(xyzmax[2],boite3D_ves.get_zmin(),eps)) plan_xy_z0.ajouter(face);
1635     else if(OPERATEUR::egal(xyzmin[2],boite3D_ves.get_zmax(),eps) && OPERATEUR::egal(xyzmax[2],boite3D_ves.get_zmax(),eps)) plan_xy_z1.ajouter(face);
1636     }
1637     MG_SOMMET* sommet_x0y0z0=NULL;
1638     MG_SOMMET* sommet_x1y0z0=NULL;
1639     MG_SOMMET* sommet_x0y1z0=NULL;
1640     MG_SOMMET* sommet_x1y1z0=NULL;
1641     MG_SOMMET* sommet_x0y0z1=NULL;
1642     MG_SOMMET* sommet_x1y0z1=NULL;
1643     MG_SOMMET* sommet_x0y1z1=NULL;
1644     MG_SOMMET* sommet_x1y1z1=NULL;
1645     std::map<unsigned long,MG_SOMMET*,std::less<unsigned long>>::iterator it_sommet;
1646     for(MG_SOMMET* som=m_mg_geometrie->get_premier_sommet(it_sommet);som!=NULL;som=m_mg_geometrie->get_suivant_sommet(it_sommet))
1647     {
1648     double xyz[3];
1649     som->get_point()->evaluer(xyz);
1650     if(OPERATEUR::egal(xyz[0],boite3D_ves.get_xmin(),eps) && OPERATEUR::egal(xyz[1],boite3D_ves.get_ymin(),eps) && OPERATEUR::egal(xyz[2],boite3D_ves.get_zmin(),eps)) sommet_x0y0z0=som;
1651     else if(OPERATEUR::egal(xyz[0],boite3D_ves.get_xmax(),eps) && OPERATEUR::egal(xyz[1],boite3D_ves.get_ymin(),eps) && OPERATEUR::egal(xyz[2],boite3D_ves.get_zmin(),eps)) sommet_x1y0z0=som;
1652     else if(OPERATEUR::egal(xyz[0],boite3D_ves.get_xmin(),eps) && OPERATEUR::egal(xyz[1],boite3D_ves.get_ymax(),eps) && OPERATEUR::egal(xyz[2],boite3D_ves.get_zmin(),eps)) sommet_x0y1z0=som;
1653     else if(OPERATEUR::egal(xyz[0],boite3D_ves.get_xmax(),eps) && OPERATEUR::egal(xyz[1],boite3D_ves.get_ymax(),eps) && OPERATEUR::egal(xyz[2],boite3D_ves.get_zmin(),eps)) sommet_x1y1z0=som;
1654     else if(OPERATEUR::egal(xyz[0],boite3D_ves.get_xmin(),eps) && OPERATEUR::egal(xyz[1],boite3D_ves.get_ymin(),eps) && OPERATEUR::egal(xyz[2],boite3D_ves.get_zmax(),eps)) sommet_x0y0z1=som;
1655     else if(OPERATEUR::egal(xyz[0],boite3D_ves.get_xmax(),eps) && OPERATEUR::egal(xyz[1],boite3D_ves.get_ymin(),eps) && OPERATEUR::egal(xyz[2],boite3D_ves.get_zmax(),eps)) sommet_x1y0z1=som;
1656     else if(OPERATEUR::egal(xyz[0],boite3D_ves.get_xmin(),eps) && OPERATEUR::egal(xyz[1],boite3D_ves.get_ymax(),eps) && OPERATEUR::egal(xyz[2],boite3D_ves.get_zmax(),eps)) sommet_x0y1z1=som;
1657     else if(OPERATEUR::egal(xyz[0],boite3D_ves.get_xmax(),eps) && OPERATEUR::egal(xyz[1],boite3D_ves.get_ymax(),eps) && OPERATEUR::egal(xyz[2],boite3D_ves.get_zmax(),eps)) sommet_x1y1z1=som;
1658     }
1659     f << "*NSET,NSET=coin_x0y0z0" << std::endl;
1660     FEM_NOEUD* coin_x0y0z0 = (FEM_NOEUD*)(sommet_x0y0z0->get_lien_fem_maillage()->get(0));
1661     f << coin_x0y0z0->get_numero() << std::endl;
1662     f << "*NSET,NSET=coin_x1y0z0" << std::endl;
1663     FEM_NOEUD* coin_x1y0z0 = (FEM_NOEUD*)(sommet_x1y0z0->get_lien_fem_maillage()->get(0));
1664     f << coin_x1y0z0->get_numero() << std::endl;
1665     f << "*NSET,NSET=coin_x0y1z0" << std::endl;
1666     FEM_NOEUD* coin_x0y1z0 = (FEM_NOEUD*)(sommet_x0y1z0->get_lien_fem_maillage()->get(0));
1667     f << coin_x0y1z0->get_numero() << std::endl;
1668     f << "*NSET,NSET=coin_x1y1z0" << std::endl;
1669     FEM_NOEUD* coin_x1y1z0 = (FEM_NOEUD*)(sommet_x1y1z0->get_lien_fem_maillage()->get(0));
1670     f << coin_x1y1z0->get_numero() << std::endl;
1671     f << "*NSET,NSET=coin_x0y0z1" << std::endl;
1672     FEM_NOEUD* coin_x0y0z1 = (FEM_NOEUD*)(sommet_x0y0z1->get_lien_fem_maillage()->get(0));
1673     f << coin_x0y0z1->get_numero() << std::endl;
1674     f << "*NSET,NSET=coin_x1y0z1" << std::endl;
1675     FEM_NOEUD* coin_x1y0z1 = (FEM_NOEUD*)(sommet_x1y0z1->get_lien_fem_maillage()->get(0));
1676     f << coin_x1y0z1->get_numero() << std::endl;
1677     f << "*NSET,NSET=coin_x0y1z1" << std::endl;
1678     FEM_NOEUD* coin_x0y1z1 = (FEM_NOEUD*)(sommet_x0y1z1->get_lien_fem_maillage()->get(0));
1679     f << coin_x0y1z1->get_numero() << std::endl;
1680     f << "*NSET,NSET=coin_x1y1z1" << std::endl;
1681     FEM_NOEUD* coin_x1y1z1 = (FEM_NOEUD*)(sommet_x1y1z1->get_lien_fem_maillage()->get(0));
1682     f << coin_x1y1z1->get_numero() << std::endl;
1683     TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face_plan;
1684     f << "*NSET,NSET=xEQ0" << std::endl;
1685     for(MG_FACE* face=plan_yz_x0.get_premier(it_face_plan);face!=NULL;face=plan_yz_x0.get_suivant(it_face_plan))
1686     {
1687     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
1688     long nb_ele=lst_ele->get_nb();
1689     for(long i=0;i<nb_ele;i++)
1690     {
1691     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
1692     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
1693     {
1694     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
1695     }
1696     }
1697     }
1698     f << "*NSET,NSET=xEQ1" << std::endl;
1699     for(MG_FACE* face=plan_yz_x1.get_premier(it_face_plan);face!=NULL;face=plan_yz_x1.get_suivant(it_face_plan))
1700     {
1701     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
1702     long nb_ele=lst_ele->get_nb();
1703     for(long i=0;i<nb_ele;i++)
1704     {
1705     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
1706     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
1707     {
1708     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
1709     }
1710     }
1711     }
1712     f << "*NSET,NSET=yEQ0" << std::endl;
1713     for(MG_FACE* face=plan_xz_y0.get_premier(it_face_plan);face!=NULL;face=plan_xz_y0.get_suivant(it_face_plan))
1714     {
1715     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
1716     long nb_ele=lst_ele->get_nb();
1717     for(long i=0;i<nb_ele;i++)
1718     {
1719     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
1720     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
1721     {
1722     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
1723     }
1724     }
1725     }
1726     f << "*NSET,NSET=yEQ1" << std::endl;
1727     for(MG_FACE* face=plan_xz_y1.get_premier(it_face_plan);face!=NULL;face=plan_xz_y1.get_suivant(it_face_plan))
1728     {
1729     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
1730     long nb_ele=lst_ele->get_nb();
1731     for(long i=0;i<nb_ele;i++)
1732     {
1733     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
1734     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
1735     {
1736     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
1737     }
1738     }
1739     }
1740     f << "*NSET,NSET=zEQ0" << std::endl;
1741     for(MG_FACE* face=plan_xy_z0.get_premier(it_face_plan);face!=NULL;face=plan_xy_z0.get_suivant(it_face_plan))
1742     {
1743     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
1744     long nb_ele=lst_ele->get_nb();
1745     for(long i=0;i<nb_ele;i++)
1746     {
1747     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
1748     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
1749     {
1750     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
1751     }
1752     }
1753     }
1754     f << "*NSET,NSET=zEQ1" << std::endl;
1755     for(MG_FACE* face=plan_xy_z1.get_premier(it_face_plan);face!=NULL;face=plan_xy_z1.get_suivant(it_face_plan))
1756     {
1757     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
1758     long nb_ele=lst_ele->get_nb();
1759     for(long i=0;i<nb_ele;i++)
1760     {
1761     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
1762     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
1763     {
1764     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
1765     }
1766     }
1767     }
1768     f.close();
1769 couturad 968 sprintf(file,"%s/groupes_elements",dossier);
1770     f.open(file,std::ios::out);
1771 couturad 933 f.precision(16);
1772     f.setf(std::ios::showpoint);
1773     std::map<long,MG_CG_GROUPE_FORME*>::iterator it_groupe_forme;
1774     for(MG_CG_GROUPE_FORME* groupe_forme=m_mgcg_modele->get_premier_mgcg_groupe_forme(it_groupe_forme);groupe_forme!=NULL;groupe_forme=m_mgcg_modele->get_suivant_mgcg_groupe_forme(it_groupe_forme))
1775     {
1776     f << "*ELSET,ELSET=" << groupe_forme->get_nom() << std::endl;
1777     TPL_MAP_ENTITE<MG_VOLUME*> tpl_map_volume = groupe_forme->get_tpl_map_volume();
1778     TPL_MAP_ENTITE<MG_VOLUME*>::ITERATEUR it_volume;
1779     for(MG_VOLUME* volume=tpl_map_volume.get_premier(it_volume);volume!=NULL;volume=tpl_map_volume.get_suivant(it_volume))
1780     {
1781     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=volume->get_lien_fem_maillage();
1782     long nb_ele=lst_ele->get_nb();
1783     for(long i=0;i<nb_ele;i++)
1784     {
1785     FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)lst_ele->get(i);
1786     f << ele3->get_numero() << std::endl;
1787     }
1788     }
1789     }
1790 couturad 937
1791 couturad 968 MG_CG_GROUPE_FORME* groupe_forme_particule=m_mgcg_modele->get_mgcg_groupe_forme((char*)"Particule");
1792 couturad 937 if(groupe_forme_particule!=NULL)
1793     {
1794 couturad 968 sprintf(file,"%s/particules",dossier);
1795     f.open(file,std::ios::out);
1796 couturad 937 f.precision(16);
1797     f.setf(std::ios::showpoint);
1798     std::ofstream f2;
1799     f2.open((char*)"infos_particules");
1800     f2.precision(16);
1801     f2.setf(std::ios::showpoint);
1802     f2 << "# centre_x centre_y centre_z rayon position_relative" << std::endl;
1803     std::ofstream f_bord;
1804     f_bord.open((char*)"particules_bord");
1805     f_bord.precision(16);
1806     f_bord.setf(std::ios::showpoint);
1807     std::ofstream f_interieur;
1808     f_interieur.open((char*)"particules_interieur");
1809     f_interieur.precision(16);
1810     f_interieur.setf(std::ios::showpoint);
1811     long p=1;
1812     std::map<long,MG_CG_FORME*>::iterator it_forme;
1813     for(MG_CG_FORME* forme=groupe_forme_particule->get_premiere_mgcg_forme(it_forme);forme!=NULL;forme=groupe_forme_particule->get_suivante_mgcg_forme(it_forme))
1814     {
1815     if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME)
1816     {
1817     f << "*ELSET,ELSET=P_" << p << std::endl;
1818     MG_CG_INFO_VCT_DOUBLE* centre = (MG_CG_INFO_VCT_DOUBLE*)forme->get_mgcg_info((char*)"CENTRE");
1819     MG_CG_INFO_DOUBLE* rayon = (MG_CG_INFO_DOUBLE*)forme->get_mgcg_info((char*)"RAYON");
1820     MG_CG_INFO_STRING* pos_rel = (MG_CG_INFO_STRING*)forme->get_mgcg_info((char*)"POSITION_RELATIVE");
1821     std::vector<double> vct_centre = centre->get_vct_valeur();
1822     f2 << p << " "
1823     << vct_centre.at(0) << " "
1824     << vct_centre.at(1) << " "
1825     << vct_centre.at(2) << " "
1826     << rayon->get_valeur() << " "
1827     << pos_rel->get_valeur() << std::endl;
1828     bool au_bord;
1829     if(pos_rel->get_valeur()=="AU_BORD") au_bord=true;
1830     else au_bord=false;
1831     MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme;
1832     MG_VOLUME* volume = forme_volume->get_mg_volume();
1833     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=volume->get_lien_fem_maillage();
1834     long nb_ele=lst_ele->get_nb();
1835     if(au_bord) f_bord << "*ELSET,ELSET=P_" << p << std::endl;
1836     else f_interieur << "*ELSET,ELSET=P_" << p << std::endl;
1837     for(long i=0;i<nb_ele;i++)
1838     {
1839     FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)lst_ele->get(i);
1840     f << ele3->get_numero() << std::endl;
1841     if(au_bord)f_bord << ele3->get_numero() << std::endl;
1842     else f_interieur << ele3->get_numero() << std::endl;
1843     }
1844     p++;
1845     }
1846     else if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME)
1847     {
1848     f << "*ELSET,ELSET=P_" << p << std::endl;
1849     MG_CG_INFO_VCT_DOUBLE* centre = (MG_CG_INFO_VCT_DOUBLE*)forme->get_mgcg_info((char*)"CENTRE");
1850     MG_CG_INFO_DOUBLE* rayon = (MG_CG_INFO_DOUBLE*)forme->get_mgcg_info((char*)"RAYON");
1851     MG_CG_INFO_STRING* pos_rel = (MG_CG_INFO_STRING*)forme->get_mgcg_info((char*)"POSITION_RELATIVE");
1852     std::vector<double> vct_centre = centre->get_vct_valeur();
1853     f2 << p << " "
1854     << vct_centre.at(0) << " "
1855     << vct_centre.at(1) << " "
1856     << vct_centre.at(2) << " "
1857     << rayon->get_valeur() << " "
1858     << pos_rel->get_valeur() << std::endl;
1859     bool au_bord;
1860     if(pos_rel->get_valeur()=="AU_BORD") au_bord=true;
1861     else au_bord=false;
1862     MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme;
1863     std::map<long,MG_VOLUME*>::iterator it_volume;
1864     for(MG_VOLUME* volume=forme_multi_volume->get_premier_mg_volume(it_volume);volume!=NULL;volume=forme_multi_volume->get_suivant_mg_volume(it_volume))
1865     {
1866     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=volume->get_lien_fem_maillage();
1867     long nb_ele=lst_ele->get_nb();
1868     if(au_bord) f_bord << "*ELSET,ELSET=P_" << p << std::endl;
1869     else f_interieur << "*ELSET,ELSET=P_" << p << std::endl;
1870     for(long i=0;i<nb_ele;i++)
1871     {
1872     FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)lst_ele->get(i);
1873     f << ele3->get_numero() << std::endl;
1874     if(au_bord)f_bord << ele3->get_numero() << std::endl;
1875     else f_interieur << ele3->get_numero() << std::endl;
1876     }
1877     }
1878     p++;
1879     }
1880     }
1881     f_bord.close();
1882     f_interieur.close();
1883     f2.close();
1884     f.close();
1885     }
1886 couturad 933 }
1887 couturad 926
1888 couturad 933
1889 couturad 926 int MSTRUCT_VES::enregistrer(char* fichier_ves)
1890 couturad 919 {
1891 couturad 926 m_ves_file->enregistrer(fichier_ves);
1892 couturad 919 }
1893    
1894 couturad 926 int MSTRUCT_VES::enregistrer(char *fichier_ves,char* fichier_magic)
1895 couturad 919 {
1896 couturad 926 m_ves_file->change_nom_fichier_magic(fichier_magic);
1897     m_ves_file->enregistrer(fichier_ves);
1898     m_mg_gestionnaire->enregistrer(fichier_magic);
1899 couturad 919 }
1900    
1901 couturad 951 void MSTRUCT_VES::active_affichage(fonction_affiche* fonc)
1902 couturad 919 {
1903     fonc_affiche = fonc;
1904     affichageactif = 1;
1905     }
1906    
1907 couturad 926 void MSTRUCT_VES::affiche(char* message)
1908 couturad 919 {
1909     if(affichageactif==1) fonc_affiche(message);
1910     }
1911    
1912    
1913    
1914    
1915